material-inspired-component-library 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/components/alert/index.scss +4 -4
- package/components/appbar/index.scss +3 -2
- package/components/badge/index.scss +2 -2
- package/components/bottomsheet/index.scss +6 -5
- package/components/button/README.md +9 -1
- package/components/button/index.scss +20 -20
- package/components/button/index.ts +21 -37
- package/components/card/index.scss +10 -9
- package/components/checkbox/index.scss +11 -11
- package/components/datepicker/README.md +146 -0
- package/components/datepicker/index.scss +436 -0
- package/components/datepicker/index.ts +701 -0
- package/components/dialog/README.md +6 -6
- package/components/dialog/index.scss +23 -17
- package/components/divider/index.scss +2 -0
- package/components/iconbutton/README.md +10 -1
- package/components/iconbutton/index.scss +18 -17
- package/components/iconbutton/index.ts +21 -37
- package/components/list/index.scss +10 -10
- package/components/menu/index.scss +2 -1
- package/components/navigationrail/index.scss +10 -9
- package/components/radio/README.md +0 -1
- package/components/radio/index.scss +11 -11
- package/components/select/index.scss +2 -1
- package/components/sidesheet/index.scss +3 -1
- package/components/slider/index.scss +7 -7
- package/components/stepper/index.scss +5 -4
- package/components/switch/README.md +0 -1
- package/components/switch/index.scss +21 -21
- package/components/textfield/index.scss +6 -5
- package/components/textfield/index.ts +63 -6
- package/components/timepicker/README.md +8 -9
- package/components/timepicker/index.scss +9 -8
- package/components/timepicker/index.ts +17 -17
- package/dist/alert.css +1 -1
- package/dist/appbar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/bottomsheet.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/datepicker/index.d.ts +6 -0
- package/dist/components/iconbutton/index.d.ts +2 -1
- package/dist/datepicker.css +1 -0
- package/dist/datepicker.js +1 -0
- package/dist/dialog.css +1 -1
- package/dist/divider.css +1 -1
- package/dist/foundations.css +1 -0
- package/dist/foundations.js +1 -0
- package/dist/iconbutton.css +1 -1
- package/dist/layout.css +1 -1
- package/dist/list.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/navigationrail.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/scrollbar.css +1 -0
- package/dist/scrollbar.js +1 -0
- package/dist/select.css +1 -1
- package/dist/sidesheet.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/stepper.css +1 -1
- package/dist/switch.css +1 -1
- package/dist/textfield.css +1 -1
- package/dist/timepicker.css +1 -1
- package/docs/accordion.html +3 -1
- package/docs/alert.html +3 -1
- package/docs/bottomsheet.html +6 -4
- package/docs/button.html +19 -17
- package/docs/card.html +3 -1
- package/docs/checkbox.html +3 -1
- package/docs/datepicker.html +275 -0
- package/docs/dialog.html +24 -10
- package/docs/divider.html +3 -1
- package/docs/docs.js +65 -1
- package/docs/iconbutton.html +9 -9
- package/docs/index.html +6 -3
- package/docs/list.html +3 -1
- package/docs/menu.html +3 -1
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/navigationrail.html +5 -3
- package/docs/radio.html +3 -1
- package/docs/select.html +3 -1
- package/docs/sidesheet.html +6 -4
- package/docs/slider.html +1 -1
- package/docs/stepper.html +3 -1
- package/docs/switch.html +3 -1
- package/docs/textfield.html +3 -1
- package/docs/themes/gray/dark-hc.css +51 -0
- package/docs/themes/gray/dark-mc.css +51 -0
- package/docs/themes/gray/dark.css +51 -0
- package/docs/themes/gray/light-hc.css +51 -0
- package/docs/themes/gray/light-mc.css +51 -0
- package/docs/themes/gray/light.css +51 -0
- package/docs/themes/gray/theme.css +306 -0
- package/docs/themes/greenery/dark-hc.css +51 -0
- package/docs/themes/greenery/dark-mc.css +51 -0
- package/docs/themes/greenery/dark.css +51 -0
- package/docs/themes/greenery/light-hc.css +51 -0
- package/docs/themes/greenery/light-mc.css +51 -0
- package/docs/themes/greenery/light.css +51 -0
- package/docs/themes/greenery/theme.css +306 -0
- package/docs/themes/hermana/dark-hc.css +51 -0
- package/docs/themes/hermana/dark-mc.css +51 -0
- package/docs/themes/hermana/dark.css +51 -0
- package/docs/themes/hermana/light-hc.css +51 -0
- package/docs/themes/hermana/light-mc.css +51 -0
- package/docs/themes/hermana/light.css +51 -0
- package/docs/themes/hermana/theme.css +306 -0
- package/docs/themes/illuminating/dark-hc.css +51 -0
- package/docs/themes/illuminating/dark-mc.css +51 -0
- package/docs/themes/illuminating/dark.css +51 -0
- package/docs/themes/illuminating/light-hc.css +51 -0
- package/docs/themes/illuminating/light-mc.css +51 -0
- package/docs/themes/illuminating/light.css +51 -0
- package/docs/themes/illuminating/theme.css +306 -0
- package/docs/themes/magenta/dark-hc.css +51 -0
- package/docs/themes/magenta/dark-mc.css +51 -0
- package/docs/themes/magenta/dark.css +51 -0
- package/docs/themes/magenta/light-hc.css +51 -0
- package/docs/themes/magenta/light-mc.css +51 -0
- package/docs/themes/magenta/light.css +51 -0
- package/docs/themes/magenta/theme.css +306 -0
- package/docs/themes/mocha/dark-hc.css +51 -0
- package/docs/themes/mocha/dark-mc.css +51 -0
- package/docs/themes/mocha/dark.css +51 -0
- package/docs/themes/mocha/light-hc.css +51 -0
- package/docs/themes/mocha/light-mc.css +51 -0
- package/docs/themes/mocha/light.css +51 -0
- package/docs/themes/mocha/theme.css +306 -0
- package/docs/themes/peri/dark-hc.css +51 -0
- package/docs/themes/peri/dark-mc.css +51 -0
- package/docs/themes/peri/dark.css +51 -0
- package/docs/themes/peri/light-hc.css +51 -0
- package/docs/themes/peri/light-mc.css +51 -0
- package/docs/themes/peri/light.css +51 -0
- package/docs/themes/peri/theme.css +306 -0
- package/docs/timepicker.html +5 -3
- package/foundations/index.scss +102 -0
- package/foundations/layout/index.scss +0 -52
- package/foundations/scrollbar/index.scss +46 -0
- package/intl.d.ts +9 -0
- package/micl.ts +18 -8
- package/package.json +2 -1
- package/styles/README.md +17 -8
- package/styles/motion.scss +3 -0
- package/styles/shapes.scss +23 -18
- package/styles/statelayer.scss +4 -0
- package/styles/typography.scss +2 -2
- package/styles.scss +3 -26
- package/themes/gray/dark-hc.css +51 -0
- package/themes/gray/dark-mc.css +51 -0
- package/themes/gray/dark.css +51 -0
- package/themes/gray/light-hc.css +51 -0
- package/themes/gray/light-mc.css +51 -0
- package/themes/gray/light.css +51 -0
- package/themes/gray/theme.css +306 -0
- package/themes/greenery/dark-hc.css +51 -0
- package/themes/greenery/dark-mc.css +51 -0
- package/themes/greenery/dark.css +51 -0
- package/themes/greenery/light-hc.css +51 -0
- package/themes/greenery/light-mc.css +51 -0
- package/themes/greenery/light.css +51 -0
- package/themes/greenery/theme.css +306 -0
- package/themes/hermana/dark-hc.css +51 -0
- package/themes/hermana/dark-mc.css +51 -0
- package/themes/hermana/dark.css +51 -0
- package/themes/hermana/light-hc.css +51 -0
- package/themes/hermana/light-mc.css +51 -0
- package/themes/hermana/light.css +51 -0
- package/themes/hermana/theme.css +306 -0
- package/themes/illuminating/dark-hc.css +51 -0
- package/themes/illuminating/dark-mc.css +51 -0
- package/themes/illuminating/dark.css +51 -0
- package/themes/illuminating/light-hc.css +51 -0
- package/themes/illuminating/light-mc.css +51 -0
- package/themes/illuminating/light.css +51 -0
- package/themes/illuminating/theme.css +306 -0
- package/themes/magenta/dark-hc.css +51 -0
- package/themes/magenta/dark-mc.css +51 -0
- package/themes/magenta/dark.css +51 -0
- package/themes/magenta/light-hc.css +51 -0
- package/themes/magenta/light-mc.css +51 -0
- package/themes/magenta/light.css +51 -0
- package/themes/magenta/theme.css +306 -0
- package/themes/mocha/dark-hc.css +51 -0
- package/themes/mocha/dark-mc.css +51 -0
- package/themes/mocha/dark.css +51 -0
- package/themes/mocha/light-hc.css +51 -0
- package/themes/mocha/light-mc.css +51 -0
- package/themes/mocha/light.css +51 -0
- package/themes/mocha/theme.css +306 -0
- package/themes/peri/dark-hc.css +51 -0
- package/themes/peri/dark-mc.css +51 -0
- package/themes/peri/dark.css +51 -0
- package/themes/peri/light-hc.css +51 -0
- package/themes/peri/light-mc.css +51 -0
- package/themes/peri/light.css +51 -0
- package/themes/peri/theme.css +306 -0
- package/tsconfig.json +2 -2
package/README.md
CHANGED
|
@@ -78,6 +78,15 @@ Copy the main `micl.js` file to your distribution folder and include it in your
|
|
|
78
78
|
```
|
|
79
79
|
This will initialize all MICL components, including those that will be added to the DOM later on.
|
|
80
80
|
|
|
81
|
+
### 4. Add a font
|
|
82
|
+
MICL uses the [**Google Sans**](https://fonts.google.com/specimen/Google+Sans) as its default font. Include a reference to this font in your application.
|
|
83
|
+
|
|
84
|
+
```HTML
|
|
85
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap">
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The [Styles guide](styles/README.md) describes how to change the default font.
|
|
89
|
+
|
|
81
90
|
## Foundations 🪟
|
|
82
91
|
A separate CSS file, based on the [Material Design Layout Foundation](https://m3.material.io/foundations/layout/understanding-layout/overview), provides styles for an adaptive layout. It includes styles for the **window frame**, **body region** and **panes** that adjust to the available screen space, ensuring your layout follows Material Design's responsive guidelines.
|
|
83
92
|
|
|
@@ -93,6 +102,7 @@ The library currently consists of the following components:
|
|
|
93
102
|
- [x] [Button](components/button/README.md)
|
|
94
103
|
- [x] [Card](components/card/README.md)
|
|
95
104
|
- [x] [Checkbox](components/checkbox/README.md)
|
|
105
|
+
- [x] [Date picker](components/datepicker/README.md)
|
|
96
106
|
- [x] [Dialog](components/dialog/README.md)
|
|
97
107
|
- [x] [Divider](components/divider/README.md)
|
|
98
108
|
- [x] [Icon button](components/iconbutton/README.md)
|
|
@@ -110,11 +120,15 @@ The library currently consists of the following components:
|
|
|
110
120
|
|
|
111
121
|
## Change Log ↪️
|
|
112
122
|
|
|
123
|
+
### 6.0.0 (23.12.2025)
|
|
124
|
+
- **BREAKING**: Use command-attribute to control toggle buttons.
|
|
125
|
+
- **Date picker**: New component.
|
|
126
|
+
|
|
113
127
|
### 5.0.0 (02.12.2025)
|
|
114
128
|
- **Time picker**: New component.
|
|
115
129
|
|
|
116
130
|
### 4.0.0 (27.10.2025)
|
|
117
|
-
- **BREAKING**: Moved layout.scss
|
|
131
|
+
- **BREAKING**: Moved layout.scss to sub-folder.
|
|
118
132
|
- **Alert**: New component.
|
|
119
133
|
- **Stepper**: New component.
|
|
120
134
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../../foundations
|
|
22
|
+
@use '../../foundations';
|
|
23
23
|
@use '../../styles/shapes';
|
|
24
24
|
@use '../../styles/typography';
|
|
25
25
|
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
color: var(--md-sys-alert-color);
|
|
47
47
|
|
|
48
48
|
.micl-alert__icon {
|
|
49
|
-
block-size: var(--md-sys-
|
|
50
|
-
inline-size: var(--md-sys-
|
|
51
|
-
font-size: var(--md-sys-
|
|
49
|
+
block-size: var(--md-sys-icon-size, 24px);
|
|
50
|
+
inline-size: var(--md-sys-icon-size, 24px);
|
|
51
|
+
font-size: var(--md-sys-icon-size, 24px);
|
|
52
52
|
}
|
|
53
53
|
.micl-alert__text {
|
|
54
54
|
display: flex;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
+
@use '../../foundations';
|
|
22
23
|
@use '../../foundations/layout';
|
|
23
24
|
@use '../../styles/elevation';
|
|
24
25
|
@use '../../styles/shapes';
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
}
|
|
67
68
|
.micl-appbar__leading-icon {
|
|
68
69
|
grid-area: appbar-leading;
|
|
69
|
-
margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-
|
|
70
|
+
margin-inline-start: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
|
|
70
71
|
color: var(--md-sys-color-on-surface);
|
|
71
72
|
}
|
|
72
73
|
.micl-appbar__headline {
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
}
|
|
104
105
|
.micl-appbar__trailing-icon {
|
|
105
106
|
grid-area: appbar-trailing;
|
|
106
|
-
margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-
|
|
107
|
+
margin-inline-end: calc(var(--md-sys-layout-window-margin) - (var(--micl-width, statelayer.$md-sys-target-size) / 2) + (var(--md-sys-icon-size, 24px) / 2) - var(--md-sys-appbar-padding-inline));
|
|
107
108
|
color: var(--md-sys-color-on-surface-variant);
|
|
108
109
|
}
|
|
109
110
|
&.micl-appbar--medium {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../../foundations
|
|
22
|
+
@use '../../foundations';
|
|
23
23
|
@use '../../styles/typography';
|
|
24
24
|
|
|
25
25
|
:root {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
margin-block: calc(12px + var(--md-sys-badge-block-offset)) auto;
|
|
69
69
|
|
|
70
70
|
&.micl-badge--small {
|
|
71
|
-
margin-inline-start: calc(var(--md-sys-
|
|
71
|
+
margin-inline-start: calc(var(--md-sys-icon-size) - var(--md-sys-badge-small-size) - var(--md-sys-badge-inline-offset));
|
|
72
72
|
}
|
|
73
73
|
&:not(.micl-badge--small) {
|
|
74
74
|
margin-inline-start: calc(12px - var(--md-sys-badge-inline-offset));
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
+
@use '../../foundations';
|
|
22
23
|
@use '../../styles/elevation';
|
|
23
24
|
@use '../../styles/motion';
|
|
24
25
|
@use '../../styles/shapes';
|
|
@@ -64,7 +65,7 @@ dialog.micl-bottomsheet {
|
|
|
64
65
|
display: flex;
|
|
65
66
|
align-items: center;
|
|
66
67
|
inline-size: 100%;
|
|
67
|
-
block-size: var(--md-sys-target-size);
|
|
68
|
+
block-size: var(--md-sys-target-size, 48px);
|
|
68
69
|
justify-content: center;
|
|
69
70
|
cursor: grab;
|
|
70
71
|
|
|
@@ -72,7 +73,7 @@ dialog.micl-bottomsheet {
|
|
|
72
73
|
box-sizing: content-box;
|
|
73
74
|
inline-size: var(--md-sys-bottomsheet-handle-width);
|
|
74
75
|
block-size: var(--md-sys-bottomsheet-handle-height);
|
|
75
|
-
padding: 16px calc((var(--md-sys-target-size) - var(--md-sys-bottomsheet-handle-width)) / 2);
|
|
76
|
+
padding: 16px calc((var(--md-sys-target-size, 48px) - var(--md-sys-bottomsheet-handle-width)) / 2);
|
|
76
77
|
border: none;
|
|
77
78
|
border-radius: var(--md-sys-shape-corner-small);
|
|
78
79
|
background-color: var(--md-sys-color-on-surface-variant);
|
|
@@ -80,8 +81,8 @@ dialog.micl-bottomsheet {
|
|
|
80
81
|
cursor: pointer;
|
|
81
82
|
|
|
82
83
|
&:focus-visible {
|
|
83
|
-
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
84
|
-
outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
|
|
84
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
85
|
+
outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
}
|
|
@@ -119,7 +120,7 @@ dialog.micl-bottomsheet {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
&[open]::backdrop {
|
|
122
|
-
background-color: rgba(0, 0, 0,
|
|
123
|
+
background-color: rgba(0, 0, 0, var(--md-sys-state-backdrop-opacity, 32%));
|
|
123
124
|
|
|
124
125
|
@starting-style {
|
|
125
126
|
background-color: rgba(0, 0, 0, 0);
|
|
@@ -63,9 +63,17 @@ A toggle button has two states: **on** (selected) and **off** (unselected). To c
|
|
|
63
63
|
**Example: A selected toggle button**
|
|
64
64
|
|
|
65
65
|
```HTML
|
|
66
|
-
<button
|
|
66
|
+
<button
|
|
67
|
+
type="button"
|
|
68
|
+
id="id0"
|
|
69
|
+
class="micl-button-tonal-s micl-button--toggle micl-button--selected"
|
|
70
|
+
commandfor="id0"
|
|
71
|
+
command="--micl-toggle"
|
|
72
|
+
>Selected</button>
|
|
67
73
|
```
|
|
68
74
|
|
|
75
|
+
The self-targeting `command` property (`--micl-toggle`) toggles the button state whenever the user interacts with the button.
|
|
76
|
+
|
|
69
77
|
## Icons
|
|
70
78
|
To add a leading icon to a button, include an element with the `micl-button__icon` class inside the `<button>`:
|
|
71
79
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
@use '../../foundations
|
|
22
|
+
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
25
|
@use '../../styles/shapes';
|
|
@@ -82,13 +82,13 @@ button.micl-button-outlined-xl {
|
|
|
82
82
|
|
|
83
83
|
&:disabled {
|
|
84
84
|
background-color: rgb(from var(--md-sys-color-on-surface) r g b / 10%);
|
|
85
|
-
color: rgb(from var(--md-sys-color-on-surface) r g b / 38%);
|
|
85
|
+
color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
|
|
86
86
|
box-shadow: var(--md-sys-elevation-level0);
|
|
87
87
|
cursor: default;
|
|
88
88
|
}
|
|
89
89
|
&:not(:disabled) {
|
|
90
90
|
&:focus-visible {
|
|
91
|
-
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
91
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
92
92
|
outline-offset: 3px;
|
|
93
93
|
}
|
|
94
94
|
&:active {
|
|
@@ -230,8 +230,8 @@ button.micl-button-outlined-m {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
.micl-button__icon {
|
|
233
|
-
font-size: var(--md-sys-
|
|
234
|
-
inline-size: var(--md-sys-
|
|
233
|
+
font-size: var(--md-sys-icon-size, 24px);
|
|
234
|
+
inline-size: var(--md-sys-icon-size, 24px);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
|
@@ -324,17 +324,17 @@ button.micl-button-text-xl {
|
|
|
324
324
|
|
|
325
325
|
&:not(:disabled) {
|
|
326
326
|
&:hover {
|
|
327
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
327
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
328
328
|
|
|
329
329
|
.micl-button__icon {
|
|
330
330
|
font-variation-settings: 'FILL' 1;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
&:focus-visible {
|
|
334
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
334
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
335
335
|
}
|
|
336
336
|
&:active {
|
|
337
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
337
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
}
|
|
@@ -362,17 +362,17 @@ button.micl-button-elevated-xl {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
&:hover {
|
|
365
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
365
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
366
366
|
|
|
367
367
|
.micl-button__icon {
|
|
368
368
|
font-variation-settings: 'FILL' 1;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
&:focus-visible {
|
|
372
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
372
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
373
373
|
}
|
|
374
374
|
&:active {
|
|
375
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
375
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
}
|
|
@@ -408,17 +408,17 @@ button.micl-button-filled-xl {
|
|
|
408
408
|
color: var(--md-sys-color-on-surface-variant);
|
|
409
409
|
}
|
|
410
410
|
&:hover {
|
|
411
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
411
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
412
412
|
|
|
413
413
|
.micl-button__icon {
|
|
414
414
|
font-variation-settings: 'FILL' 1;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
&:focus-visible {
|
|
418
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
418
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
419
419
|
}
|
|
420
420
|
&:active {
|
|
421
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
421
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
}
|
|
@@ -445,17 +445,17 @@ button.micl-button-tonal-xl {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
&:hover {
|
|
448
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
448
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
449
449
|
|
|
450
450
|
.micl-button__icon {
|
|
451
451
|
font-variation-settings: 'FILL' 1;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
&:focus-visible {
|
|
455
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
455
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
456
456
|
}
|
|
457
457
|
&:active {
|
|
458
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
458
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
}
|
|
@@ -482,17 +482,17 @@ button.micl-button-outlined-xl {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
&:hover {
|
|
485
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
485
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
486
486
|
|
|
487
487
|
.micl-button__icon {
|
|
488
488
|
font-variation-settings: 'FILL' 1;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
&:focus-visible {
|
|
492
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
492
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
493
493
|
}
|
|
494
494
|
&:active {
|
|
495
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
495
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
}
|
|
@@ -19,58 +19,42 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
-
export const buttonSelector = 'button
|
|
22
|
+
export const buttonSelector = 'button.micl-button--toggle';
|
|
23
23
|
|
|
24
24
|
export default (() =>
|
|
25
25
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (event.target.classList.contains('micl-button--toggle')) {
|
|
40
|
-
event.target.classList.add('micl-button--toggled');
|
|
41
|
-
event.target.classList.toggle('micl-button--selected');
|
|
42
|
-
if (!!event.target.dataset.miclalt) {
|
|
43
|
-
[event.target.textContent, event.target.dataset.miclalt] =
|
|
44
|
-
[event.target.dataset.miclalt, event.target.textContent];
|
|
26
|
+
return {
|
|
27
|
+
command: (event: Event): void =>
|
|
28
|
+
{
|
|
29
|
+
const target = event.target as HTMLButtonElement;
|
|
30
|
+
|
|
31
|
+
if (
|
|
32
|
+
target.matches(buttonSelector)
|
|
33
|
+
&& !target.disabled
|
|
34
|
+
&& (event as any).command === '--micl-toggle'
|
|
35
|
+
) {
|
|
36
|
+
target.classList.add('micl-button--toggled');
|
|
37
|
+
target.classList.toggle('micl-button--selected');
|
|
45
38
|
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
39
|
+
},
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
initialize: (element: HTMLButtonElement) =>
|
|
41
|
+
initialize: function(element: HTMLButtonElement): void
|
|
51
42
|
{
|
|
52
43
|
if (
|
|
53
|
-
!element.matches(
|
|
44
|
+
!element.matches(buttonSelector)
|
|
54
45
|
|| element.dataset.miclinitialized
|
|
55
46
|
) {
|
|
56
47
|
return;
|
|
57
48
|
}
|
|
58
49
|
element.dataset.miclinitialized = '1';
|
|
59
50
|
|
|
60
|
-
|
|
61
|
-
(element.popoverTargetElement instanceof HTMLDialogElement)
|
|
62
|
-
&& !element.popoverTargetElement.hasAttribute('popover')
|
|
63
|
-
) {
|
|
64
|
-
element.addEventListener('click', onClick);
|
|
65
|
-
}
|
|
66
|
-
else if (element.classList.contains('micl-button--toggle')) {
|
|
67
|
-
element.addEventListener('click', onClick);
|
|
68
|
-
}
|
|
51
|
+
element.addEventListener('command', this.command);
|
|
69
52
|
},
|
|
70
|
-
|
|
53
|
+
|
|
54
|
+
cleanup: function(element: HTMLButtonElement): void
|
|
71
55
|
{
|
|
72
|
-
if (element.matches(
|
|
73
|
-
document.removeEventListener('
|
|
56
|
+
if (element.matches(buttonSelector)) {
|
|
57
|
+
document.removeEventListener('command', this.command);
|
|
74
58
|
delete element.dataset.miclinitialized;
|
|
75
59
|
}
|
|
76
60
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
+
@use '../../foundations';
|
|
22
23
|
@use '../../styles/elevation';
|
|
23
24
|
@use '../../styles/motion';
|
|
24
25
|
@use '../../styles/shapes';
|
|
@@ -61,25 +62,25 @@
|
|
|
61
62
|
--statelayer-opacity var(--md-sys-card-motion-duration) linear;
|
|
62
63
|
|
|
63
64
|
&:hover {
|
|
64
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
65
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
65
66
|
|
|
66
67
|
box-shadow: var(--md-sys-elevation-level1);
|
|
67
68
|
cursor: pointer;
|
|
68
69
|
}
|
|
69
70
|
&:focus-visible {
|
|
70
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
71
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
71
72
|
|
|
72
|
-
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
73
|
-
outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
|
|
73
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
74
|
+
outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
|
|
74
75
|
}
|
|
75
76
|
&:active {
|
|
76
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
77
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
77
78
|
|
|
78
79
|
background-size: 0%, 100%;
|
|
79
80
|
transition: background-size 0ms;
|
|
80
81
|
}
|
|
81
82
|
&.micl-card--dragging {
|
|
82
|
-
--statelayer-opacity: var(--md-sys-state-dragged-state-layer-opacity);
|
|
83
|
+
--statelayer-opacity: var(--md-sys-state-dragged-state-layer-opacity, 16%);
|
|
83
84
|
|
|
84
85
|
box-shadow: var(--md-sys-elevation-level3);
|
|
85
86
|
cursor: grabbing;
|
|
@@ -89,8 +90,8 @@
|
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
&:not([tabindex='0']):not(.micl-card--disabled):has(> summary:focus-visible) {
|
|
92
|
-
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
93
|
-
outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
|
|
93
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
94
|
+
outline-offset: var(--md-sys-state-focus-indicator-outer-offset, 2px);
|
|
94
95
|
}
|
|
95
96
|
&::details-content {
|
|
96
97
|
block-size: 0;
|
|
@@ -145,7 +146,7 @@
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
.micl-card--disabled {
|
|
148
|
-
opacity: 38
|
|
149
|
+
opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
|
|
149
150
|
pointer-events: none;
|
|
150
151
|
|
|
151
152
|
&.micl-card-elevated {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
20
|
// SOFTWARE.
|
|
21
21
|
|
|
22
|
+
@use '../../foundations';
|
|
22
23
|
@use '../../styles/motion';
|
|
23
24
|
@use '../../styles/statelayer';
|
|
24
25
|
@use '../../styles/typography';
|
|
@@ -27,7 +28,6 @@
|
|
|
27
28
|
--md-sys-checkbox-border-width: 2px;
|
|
28
29
|
--md-sys-checkbox-check-thickness: 2px;
|
|
29
30
|
--md-sys-checkbox-container-size: 18px;
|
|
30
|
-
--md-sys-checkbox-state-layer-size: 40px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
input[type=checkbox].micl-checkbox {
|
|
@@ -40,12 +40,12 @@ input[type=checkbox].micl-checkbox {
|
|
|
40
40
|
appearance: none;
|
|
41
41
|
box-sizing: border-box;
|
|
42
42
|
position: relative;
|
|
43
|
-
inline-size: var(--md-sys-target-size);
|
|
44
|
-
min-inline-size: var(--md-sys-target-size);
|
|
45
|
-
block-size: var(--md-sys-target-size);
|
|
46
|
-
min-block-size: var(--md-sys-target-size);
|
|
43
|
+
inline-size: var(--md-sys-target-size, 48px);
|
|
44
|
+
min-inline-size: var(--md-sys-target-size, 48px);
|
|
45
|
+
block-size: var(--md-sys-target-size, 48px);
|
|
46
|
+
min-block-size: var(--md-sys-target-size, 48px);
|
|
47
47
|
margin: 0;
|
|
48
|
-
border: calc((var(--md-sys-target-size) - var(--md-sys-
|
|
48
|
+
border: calc((var(--md-sys-target-size, 48px) - var(--md-sys-state-layer-size, 40px)) / 2) solid transparent;
|
|
49
49
|
background-clip: content-box;
|
|
50
50
|
background-color: transparent;
|
|
51
51
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -168,16 +168,16 @@ input[type=checkbox].micl-checkbox {
|
|
|
168
168
|
--statelayer-opacity var(--md-sys-checkbox-motion-duration) linear;
|
|
169
169
|
|
|
170
170
|
&:hover {
|
|
171
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity);
|
|
171
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
172
172
|
|
|
173
173
|
&:not(:checked):not(:indeterminate)::after {
|
|
174
174
|
--md-sys-checkbox-border-color: var(--md-sys-color-on-surface);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
&:focus-visible {
|
|
178
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity);
|
|
178
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
179
179
|
|
|
180
|
-
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
180
|
+
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
181
181
|
|
|
182
182
|
&:not(:checked):not(:indeterminate)::after {
|
|
183
183
|
--md-sys-checkbox-border-color: var(--md-sys-color-on-surface);
|
|
@@ -185,7 +185,7 @@ input[type=checkbox].micl-checkbox {
|
|
|
185
185
|
}
|
|
186
186
|
&:active {
|
|
187
187
|
--statelayer-color: var(--md-sys-color-on-surface);
|
|
188
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity);
|
|
188
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
189
189
|
|
|
190
190
|
background-size: 0%, 100%;
|
|
191
191
|
transition: background-size 0ms;
|
|
@@ -200,7 +200,7 @@ input[type=checkbox].micl-checkbox {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
&:disabled {
|
|
203
|
-
opacity: 38
|
|
203
|
+
opacity: var(--md-sys-state-disabled-state-layer-opacity, 38%);
|
|
204
204
|
|
|
205
205
|
&:checked,
|
|
206
206
|
&:indeterminate {
|