All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
8.0.1 (2021-10-04)
- CHANGELOG.md (b27f508)
8.0.0 (2021-10-04)
- The configuration options
TextField.setFullWith
(TextArea.setFullWidth
) have been removed because they are not in the Material Design specification. To archieve a similar effect, set the CSS propertywidth: 100%
on the text field/ text area.
Before:
TextField.config
|> TextField.setFullWidth True
After:
TextField.config
|> TextField.setAttributes [ Html.Attributes.style "width" "100%" ]
- The function
SelectItem.selectItem
is restricted to have onlyString
content.
Before:
SelectItem.selectItem SelectItem.config [ text "Option" ]
After:
SelectItem.selectItem SelectItem.config "Option"
- The function
Menu.menu
has been constrained to list items to more closely match the intended use-case, as well as to align with similar functions in the library (ie.Select.select
).
Before:
Menu.menu Menu.config
(List.list
(List.config
|> List.setRipples False
|> List.setWrapFocus True
)
(ListItem.listItem ListItem.config [ text "Option 1" ])
[ ListItem.listItem ListItem.config [ text "Option 2" ] ]
)
After:
Menu.menu Menu.config
(ListItem.listItem ListItem.config [ text "Option 1" ])
[ ListItem.listItem ListItem.config [ text "Option 2" ] ]
- The function
List.setNonInteractive
has been replaced byList.setInteractive
. Non-interactive lists do not receive keyboard focus and feature no interaction with pointing devices. - The function
Dialog.dialog
has been removed, and instead has been replaced by more specializedDialog.simple
,Dialog.alert
andDialog.confirmation
variants. - The function
LinearProgress.setReverse
has been removed as the direction of text is now automatically determined.
Refer to the documentation for ways to manually set the direction in case this fails or is not desired.
- Add Dialog variants
simple
,alert
andconfirmation
(dbd1a75) - Add Dialog.defaultAction (a299231)
- Add Dialog.fullscreen variant (1100a0b)
- Add Dialog.initialFocus (918f900)
- Add Dialog.setScrimCloses (2f36bab)
- Add List.setRipples (0cf254c)
- Constrain
Menu.menu
to list items (e48a41e) - Remove LinearProgress.setReverse (5e59f2f)
- Remove TextField.setFullWidth, TextArea.setFullWidth (0ee80dd)
- Restrict select items to String content (6ddcb1e)
- Ripple.unbounded sets cursor to pointer (2d83781)
- Update to MDC Web 11.0.0 (4ba3d99)
7.0.0 (2021-03-26)
- The signature of
TabBar.tabBar
has changed. It now takes the first tab as an extra argument to guarantee that the list of tabs passed to it is non-empty.
Before:
TabBar.tabBar TabBar.config
[ Tab.tab Tab.config { … }
, Tab.tab Tab.config { … }
]
After:
TabBar.tabBar TabBar.config
(Tab.tab Tab.config { … })
[ Tab.tab Tab.config { … } ]
- Add Button.setMenu and IconButton.setMenu (43ae4f1)
- Add setHref and setTarget to IconButton (e6969cb)
- Link buttons can be disabled (dd513f6)
- Guarantee that precisely one tab within a tab bar is active (540113c)
- IconButtons and IconToggles cannot be disabled (66d0967)
- Support dynamic tabs (9878e53)
6.0.0 (2020-10-08)
- The type signature of
chipSet
changed from
chipSet : List (Html.Attribute msg) -> List (Chip msg) -> Html msg
to
chipSet : List (Html.Attribute msg) -> Chip msg -> List (Chip msg) -> Html msg
- docs: Add Text area with character counter demo (a066421)
- Add component CircularProgress (19717c2)
- Add TextField.setEndAligned (dd6d0bf)
- Add TextField.setPrefix, TextField.setSuffix (96d6ca8)
- Add Theme.error and Theme.onError to provide CSS error classes (ff5b9c9)
- Disallow empty chip sets (9c514dc)
- Update to MDC 6.0.0 (a65b371)
- Character counters for TextAreas were throwing due to missing maxLength prop (9902c0e)
- SvgIcon was not handled by Snackbar (d179f4a)
5.1.0 (2020-09-13)
- Refactor list selection (25c0929)
- Remove non-existent .mdc-chip-set--action class (d482328)
- Unregister body click handler when menu surface is destroyed (83c997f)
5.0.0 (2020-08-30)
- Generally, how icons are specified in this library changed. When before
we just wrote the Material Icon's /icon name/ as a String, say,
"favorite"
, now we writeButton.icon "favorite"
for the Material Icon (for a button). There are functionsButton.customIcon
andButton.svgIcon
to support custom icons.
The following modules have been updated to support custom icons:
- ActionChip
- Button
- ChoiceChip
- Fab
- Fab.Extended
- FilterChip
- IconButton
- IconToggle
- InputChip
- Select
- Snackbar
- Tab
- TextField
- Add support for custom icons. (110f89e)
4.0.0 (2020-07-05)
- Native Select and Enhanced Select have been replaced by a unified Select component. The API changed as follows:
Before:
import Material.Select as Select
import Material.Select.Option as SelectOption
Select.filled
(Select.config
|> Select.setLabel (Just "Fruit")
|> Select.setValue (Just "")
|> Select.setOnChange ValueChanged
)
[ SelectOption.selectOption
(SelectOption.config
|> SelectOption.setValue (Just "")
)
[ text "" ]
, SelectOption.selectOption
(SelectOption.config
|> SelectOption.setValue (Just "Apple")
)
[ text "Apple" ]
]
After:
import Material.Select as Select
import Material.Select.Item as SelectItem
Select.filled
(Select.config
|> Select.setSelected (Just "")
|> Select.setOnChange ValueChanged
)
(SelectItem.selectItem
(SelectItem.config { value = "" })
[ text "" ]
)
[ SelectItem.selectItem
(SelectItem.config { value = "Apple" })
[ text "Apple" ]
]
- Snackbar messages now require you to set a label.
Before:
Snackbar.message
|> Snackbar.setLabel "Something happened"
After:
Snackbar.message "Something happened"
- Snackbar now offers a simpler interface.
Before:
type Msg
= SnackbarMsg (Snackbar.Msg Msg)
| SomethingHappened
update msg model =
case msg of
SnackbarMsg msg_ ->
let
( newQueue, cmd) =
Snackbar.update SnackbarMsg msg_ model.queue
in
( { model | queue = newQueue }, cmd )
SomethingHappened ->
( model, Snackbar.addMessage SnackbarMsg Snackbar.message )
view model =
Snackbar.snackbar SnackbarMsg Snackbar.config model.queue
After:
type Msg
= SnackbarClosed Snackbar.MessageId
| SomethingHappened
update msg model =
case msg of
SnackbarClosed messageId ->
{ model | queue = Snackbar.close messageId model.queue }
SomethingHappened ->
{ model | queue = Snackbar.addMessage Snackbar.message model.queue }
view model =
Snackbar.snackbar (Snackbar.config { onClosed = SnackbarClosed }) model.queue
List.list
type signature changed.
Before:
List.list List.config
[ ListItem.listItem ListItem.config [ text "List Item" ]
, ListItem.listItem ListItem.config [ text "List Item" ]
]
After:
List.list List.config
(ListItem.listItem ListItem.config [ text "List Item" ])
[ ListItem.listItem ListItem.config [ text "List Item" ] ]
Material.Choice.set
was renamed toMaterial.ChipSet.Choice.chipSet
. The same is true for filter and input chips.- Choice chip API changed.
Before:
import Material.Chip.Choice as ChoiceChip
ChoiceChip.set []
[ ChoiceChip.chip
(ChoiceChip.config
|> ChoiceChip.setSelected (Just True)
|> ChoiceChip.setOnClick (Clicked "Chip")
)
"Chip"
]
After:
import Material.Chip.Choice as ChoiceChip
improt Material.ChipSet.Choice as ChoiceChipSet
ChoiceChipSet.chipSet
(ChoiceChipSet.config { toLabel = identity }
|> ChoiceChipSet.setSelected (Just "Chip")
|> ChoiceChipSet.setOnChange Clicked
)
[ ChoiceChip.chip ChoiceChip.config "Chip" ]
- Snackbar's
setTimeout
function now takes aMaybe Int
instead of aInt
.
Before:
Snackbar.message
|> Snackbar.setTimeout 4000
After:
Snackbar.message
|> Snackbar.setTimeout (Just 4000)
- Removes
Slider.setOnChange
. Update your sliders to usesetOnInput
instead.
Before:
Slider.slider (Slider.config |> Slider.setOnChange Changed)
After:
Slider.slider (Slider.config |> Slider.setOnInput Changed)
- Add focus support to ChipSet (da373a1)
- Add Select.setLeadingIcon (d3aa83f)
- Add support for incrased touch target size (b281c23)
- Add support for persistent snackbar messages (e6cbc50)
- List items are guaranteed to have at least one item (6f7521f)
- Refactor Select (57e5a02)
- Remove Snackbar.Msg (05ac366)
- Remove Snackbar.setLabel (e45553d)
- Update to MDC Web 4.0.0 (915cdbd)
-
Add Slider.setOnInput (1470dfc)
-
TextField's pattern property incorrectly defaulted to the empty pattern (c2bab28)
-
Refactor chips (2ff6a46)
3.0.3 (2020-06-30)
- Add support for Browser.Dom.focus (fae5d07)
- Make Text Field compatible with Browser.Dom.focus (bd04282)
- (Empty) List throws when dynamically adding first item (9f7142a)
- Fix source map locations in assets (3d29b9e)
- Make card's primary action accessible to keyboard navigation (d0a095a)
- Make FABs accessible to keyboard navigation (cf4e641)
- Remove inline-flex display from mdc-button element (082f059)
3.0.2 (2020-06-08)
- Data table rows were being marked as header rows (639b6f1)
3.0.1 (2020-06-02)
- This commit implements the builder pattern for configuration types, replacing record based configuration. In most cases, migration should be straight-forward. For example,
import Material.Button exposing (textButton, buttonConfig)
main =
textButton
{ buttonConfig | icon = Just "favorite" }
"Add to favorites"
becomes
import Material.Button as Button
main =
Button.text
(Button.config |> Button.setIcon "favorite")
"Add to favorites"
If you have trouble migrating some code, please leave a message on GitHub issues!
- docs: Fix broken demo links in documentation (7a0ed82)
- Distribute non-minified and source map assets via npm (432b262)
- Fix floating label lowering incorrectly (acd7c88)
- Fix input chip set incorrectly removing chip on trailing icon interaction (a7a2d98)
- Data Table throws error upon destruction (eaf1649)
- Update to MDC Web v2.3.1 (7468981)
- Fix determinate linear progress variants (e9c3c8c)
- Fix ripple for buttons (8d59940)
- Fix snackbar crashing when messages cycled very quickly (c816c5b)
- Card.actionIcon now takes a IconButtonConfig instead of a IconConfig as first argument
- CheckboxConfig.onClick has been renamed to CheckboxConfig.onChange
- TextFieldConfig.invalid has been replaced by TextFieldConfig.valid (default to True). The same is true for TextAreaConfig
- SnackbarConfig has been extended by a field
closesOnEscape : Bool
. Additionally, Snackbar.Message's configuration field timeoutMs has been changed from Float to Int - SliderConfig.step has been changed from taking a
Maybe Float
to taking aFloat
only - SwitchConfig.onClick has been renamed to SwitchConfig.onChange
- The function ripple has been renamed to boundedRipple.
RippleConfig does not contain the field
unbounded
anymore - Functions listItem, listItemDivider and
listGroupSubheader now return
ListItem msg
instead ofHtml msg
. The function list has been changed accordingly. - IconToggleConfig.onClick has been renamed to IconToggleConfig.onChange
- DismissibleDrawerConfig has been extended by a field
onClose : Maybe msg
. This facilitates the dismissible drawer closing on pressing the Escape key. - SelectConfig has been extended by the following boolean fields: disabled, required and valid
- Add fields href, target to ButtonConfig (3c60856)
- Add href to ListItemConfig (6773780)
- Card.actionIcon is now based on IconButton (0a4a5c0)
-
Checkbox no longer plays animation when initially rendered as checked or indeterminate (0b8f623)
-
Dialog applies additionalAttributes (02fae12)
-
Disabled buttons now work (97a66f4)
-
Update checkbox implementation (78f99d4)
-
Update drawer implementation (83aa9d8)
-
Update icon button implementation (7fde683)
-
Update image list item implementation (22d3a7d)
-
Update ripple implementation (704f9e8)
-
Update select implementation (94e7a0c)
-
Update slider implementation (bf7ad91)
-
Update snackbar implementation (278ea96)
-
Update switch implementation (11d10a8)
-
Update text field implementation (b4a73ca)
- Add ripple to image list items (1e81d39)
- Add support for Elm 0.19.1 (94d1137)
- Permanent drawer destroys foundation (e7c8bef)
- docs: Use CDN links in README and examples (a3859d2)