Material Design component library for Mithril and React
Fixes a bug in TextField where event options were overwritten.
Fixes TS typings for Mithril's m.route.Link
.
Polythene is now compatible with the recent release of Mithril 2.x. Mithril 2 offers better stability and performance and is recommended for Polythene apps with Mithril.
Mithril's API change may have some implications for code written with Polythene:
Link building. The m.route.link
function has been removed in favor of the m.route.Link
component. This leads to a small code change for Polythene component option url
:
Mithril 1.x code:
h(Button, {
label: "Update",
element: "a", // this is the default, so can be omitted
url: {
href: route.path,
oncreate: m.route.link
}
})
Mithril 2.x code:
h(Button, {
label: "Update",
element: h.route.Link, // Note the capital L
url: {
selector: "a", // this is the default, so can be omitted
href: route.path,
}
})
Mithril 2.x is much stricter when to use keys in arrays; when a mix of keyed and unkeyed fragments are encountered, the program will bail with an error. Mithril has an elaborate page on keys that helps to solve issues.
Other changes related to Mithril code can be found in the Mithril release notes.
Bug fixes:
Documentation:
polythene-css-typography
to polythene-css-core
. This ensures layout consistency without having to force to use polythene-css-typography
.Bug fixes:
multi
.style
option.Bug fixes:
Bug fixes:
Bug fixes:
Bug fixes:
element
.Integration of Cyano (which includes the React Hooks API for Mithril). This has resulted in more coherent (and also slighly smaller) code.
Function writeCSS
in polythene-scripts can be used to write themed CSS to a file. The function accepts new option wrapInGlobal
to use with CSS Modules: set to true
to wrap the generated css inside a :global { ... }
tag.
Keyboard TAB navigation now highlights components that have focus. Pressing ENTER executes the equivalent of a click.
Affected components: Button, Icon Button, FAB, List Tile, Checkbox, Radio Button, Switch, Tabs.
The highlight is created by element with className pe-button__wash
. The color can be themed with variables:
color_light_wash_background
and color_dark_wash_background
color_light_wash_opacity
and color_dark_wash_opacity
Raised Buttons also show an extra shadow on focus.
To improve accessibility, all dialogs and drawers (including modal and fullscreen dialogs) can now be closed by pressing ESCAPE.
Use new option disableEscape
to prevent ESCAPE from closing the dialog or drawer.
renderer
is no longer exported from polythene-mithril
and polythene-react
.
m
.ReactDOM.render
.Includes a fix to allow events on List Tile secondary content.