material-inspired-component-library 8.0.4 → 8.1.1
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/.claude/settings.local.json +4 -1
- package/CLAUDE.md +53 -0
- package/README.md +4 -0
- package/components/alert/index.scss +2 -2
- package/components/appbar/index.scss +2 -2
- package/components/bottomsheet/index.scss +3 -3
- package/components/button/README.md +68 -10
- package/components/button/index.scss +99 -179
- package/components/button/index.ts +4 -4
- package/components/card/index.scss +3 -3
- package/components/checkbox/index.scss +2 -2
- package/components/datepicker/index.scss +3 -3
- package/components/dialog/index.scss +3 -3
- package/components/iconbutton/README.md +55 -9
- package/components/iconbutton/index.scss +109 -167
- package/components/iconbutton/index.ts +4 -4
- package/components/list/index.scss +8 -8
- package/components/menu/index.scss +3 -3
- package/components/navigationrail/README.md +2 -1
- package/components/navigationrail/index.scss +4 -4
- package/components/radio/index.scss +2 -2
- package/components/select/index.scss +2 -2
- package/components/shapes/README.md +94 -0
- package/components/{shape → shapes}/_paths.generated.scss +0 -6
- package/components/{shape → shapes}/index.scss +10 -10
- package/components/{shape → shapes}/master.scss +3 -3
- package/components/sidesheet/index.scss +3 -3
- package/components/slider/index.scss +5 -5
- package/components/snackbar/index.scss +2 -2
- package/components/switch/index.scss +2 -2
- package/components/textfield/index.scss +2 -2
- package/components/timepicker/index.scss +3 -3
- package/dist/bottomsheet.js +1 -1
- package/dist/button.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/iconbutton/index.d.ts +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/iconbutton.css +1 -1
- package/dist/iconbutton.js +1 -1
- package/dist/list.css +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/micl.css +1 -1
- package/dist/micl.js +1 -1
- package/dist/navigationrail.css +1 -1
- package/dist/navigationrail.js +1 -1
- package/dist/progressindicator.js +1 -1
- package/dist/shapes.css +1 -0
- package/dist/slider.js +1 -1
- package/dist/snackbar.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/textfield.js +1 -1
- package/dist/timepicker.js +1 -1
- package/docs/button.html +18 -17
- package/docs/iconbutton.html +12 -10
- package/docs/index.html +104 -89
- package/docs/menu.html +1 -1
- package/docs/micl.css +1 -1
- package/docs/micl.js +1 -1
- package/docs/shapes.css +1 -0
- package/docs/shapes.html +49 -40
- package/foundations/layout/index.scss +2 -2
- package/package.json +2 -1
- package/styles/elevation.scss +10 -7
- package/styles/motion.scss +12 -19
- package/styles/{shapes.scss → shape.scss} +6 -4
- package/styles/statelayer.scss +32 -45
- package/styles/typography.scss +4 -5
- package/styles.scss +1 -4
- package/tools/shapes/check.mjs +1 -1
- package/tools/shapes/generate.mjs +2 -8
- package/webpack.config.js +60 -5
- package/components/shape/README.md +0 -103
- package/dist/shape.css +0 -1
- package/docs/shape.css +0 -1
- /package/dist/{shape.js → shapes.js} +0 -0
- /package/docs/{shape.js → shapes.js} +0 -0
|
@@ -25,7 +25,7 @@ Or import all MICL styles:
|
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### JavaScript
|
|
28
|
-
This component requires JavaScript for
|
|
28
|
+
This component requires JavaScript for to support the **toggle logic**:
|
|
29
29
|
|
|
30
30
|
```JavaScript
|
|
31
31
|
import micl from "material-inspired-component-library/dist/micl";
|
|
@@ -60,9 +60,9 @@ To reduce the width of an icon button, add the `micl-iconbutton--narrow` class.
|
|
|
60
60
|
Adding the `disabled` boolean attribute to the button causes the button to be displayed in a disabled state.
|
|
61
61
|
|
|
62
62
|
### Toggle Button
|
|
63
|
-
A toggle button has two states: **on** (
|
|
64
|
-
- **Off state**: The button has the `micl-button--toggle` class
|
|
65
|
-
- **On state**: The button has
|
|
63
|
+
A toggle button has two states: **on** (pressed) and **off** (unpressed). To create one, add the `micl-button--toggle` class and an `aria-pressed` attribute.
|
|
64
|
+
- **Off state**: The button has the `micl-button--toggle` class and `aria-pressed="false"`.
|
|
65
|
+
- **On state**: The button has the `micl-button--toggle` class and `aria-pressed="true"`.
|
|
66
66
|
|
|
67
67
|
**Example: A selected toggle button**
|
|
68
68
|
|
|
@@ -70,21 +70,22 @@ A toggle button has two states: **on** (selected) and **off** (unselected). To c
|
|
|
70
70
|
<button
|
|
71
71
|
type="button"
|
|
72
72
|
id="id0"
|
|
73
|
-
class="micl-iconbutton-outlined-l micl-button--toggle
|
|
73
|
+
class="micl-iconbutton-outlined-l micl-button--toggle material-symbols-outlined"
|
|
74
|
+
aria-pressed="true"
|
|
74
75
|
commandfor="id0"
|
|
75
76
|
command="--micl-toggle"
|
|
76
77
|
aria-label="Control Panel"
|
|
77
78
|
>settings</button>
|
|
78
79
|
```
|
|
79
80
|
|
|
80
|
-
The self-targeting `command` property (`--micl-toggle`)
|
|
81
|
+
The self-targeting `command` property (`--micl-toggle`) flips `aria-pressed` whenever the user interacts with the button.
|
|
81
82
|
|
|
82
|
-
To use different icons for the **on** state and the **off** state, remove the icon name from the button and add the `data-miclicon` (the name of the **
|
|
83
|
+
To use different icons for the **on** state and the **off** state, remove the icon name from the button and add the `data-miclicon` (the name of the **off** icon) and `data-micliconselected` (the name of the **on** icon) attributes:
|
|
83
84
|
|
|
84
85
|
```HTML
|
|
85
86
|
...
|
|
86
|
-
data-miclicon="
|
|
87
|
-
data-micliconselected="
|
|
87
|
+
data-miclicon="icon_for_off"
|
|
88
|
+
data-micliconselected="icon_for_on"
|
|
88
89
|
></button>
|
|
89
90
|
```
|
|
90
91
|
|
|
@@ -105,5 +106,50 @@ You can also use other icon libraries. For example, with the [Bootstrap Icons li
|
|
|
105
106
|
</button>
|
|
106
107
|
```
|
|
107
108
|
|
|
109
|
+
## Theming
|
|
110
|
+
Each icon button style can be themed with CSS custom properties that follow the Material Design 3 component-token naming convention. Note that the `selected-*` and `unselected-*` properties only apply to [toggle buttons](#toggle-button).
|
|
111
|
+
|
|
112
|
+
### Standard
|
|
113
|
+
| Custom property | Meaning | Default |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `--md-comp-icon-button-icon-color` | Icon colour | `--md-sys-color-on-surface-variant` |
|
|
116
|
+
| `--md-comp-icon-button-selected-icon-color` | Icon colour when selected | `--md-sys-color-primary` |
|
|
117
|
+
| `--md-comp-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
118
|
+
| `--md-comp-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
119
|
+
|
|
120
|
+
### Filled
|
|
121
|
+
| Custom property | Meaning | Default |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `--md-comp-filled-icon-button-container-color` | Container background (also the selected state) | `--md-sys-color-primary` |
|
|
124
|
+
| `--md-comp-filled-icon-button-icon-color` | Icon colour (also the selected state) | `--md-sys-color-on-primary` |
|
|
125
|
+
| `--md-comp-filled-icon-button-unselected-container-color` | Container background when an unselected toggle | `--md-sys-color-surface-container` |
|
|
126
|
+
| `--md-comp-filled-icon-button-unselected-icon-color` | Icon colour when an unselected toggle | `--md-sys-color-on-surface-variant` |
|
|
127
|
+
| `--md-comp-filled-icon-button-disabled-container-color` | Container background when disabled | `--md-sys-color-on-surface` |
|
|
128
|
+
| `--md-comp-filled-icon-button-disabled-container-opacity` | Container opacity when disabled | `10%` |
|
|
129
|
+
| `--md-comp-filled-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
130
|
+
| `--md-comp-filled-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
131
|
+
|
|
132
|
+
### Tonal
|
|
133
|
+
| Custom property | Meaning | Default |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `--md-comp-filled-tonal-icon-button-container-color` | Container background | `--md-sys-color-secondary-container` |
|
|
136
|
+
| `--md-comp-filled-tonal-icon-button-icon-color` | Icon colour | `--md-sys-color-on-secondary-container` |
|
|
137
|
+
| `--md-comp-filled-tonal-icon-button-selected-container-color` | Container background when selected | `--md-sys-color-secondary` |
|
|
138
|
+
| `--md-comp-filled-tonal-icon-button-selected-icon-color` | Icon colour when selected | `--md-sys-color-on-secondary` |
|
|
139
|
+
| `--md-comp-filled-tonal-icon-button-disabled-container-color` | Container background when disabled | `--md-sys-color-on-surface` |
|
|
140
|
+
| `--md-comp-filled-tonal-icon-button-disabled-container-opacity` | Container opacity when disabled | `10%` |
|
|
141
|
+
| `--md-comp-filled-tonal-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
142
|
+
| `--md-comp-filled-tonal-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
143
|
+
|
|
144
|
+
### Outlined
|
|
145
|
+
| Custom property | Meaning | Default |
|
|
146
|
+
|---|---|---|
|
|
147
|
+
| `--md-comp-outlined-icon-button-icon-color` | Icon colour | `--md-sys-color-on-surface-variant` |
|
|
148
|
+
| `--md-comp-outlined-icon-button-outline-color` | Outline (border) colour | `--md-sys-color-outline-variant` |
|
|
149
|
+
| `--md-comp-outlined-icon-button-selected-container-color` | Container background when selected | `--md-sys-color-inverse-surface` |
|
|
150
|
+
| `--md-comp-outlined-icon-button-selected-icon-color` | Icon colour when selected | `--md-sys-color-inverse-on-surface` |
|
|
151
|
+
| `--md-comp-outlined-icon-button-disabled-icon-color` | Icon colour when disabled | `--md-sys-color-on-surface` |
|
|
152
|
+
| `--md-comp-outlined-icon-button-disabled-icon-opacity` | Icon opacity when disabled | `38%` |
|
|
153
|
+
|
|
108
154
|
## Compatibility
|
|
109
155
|
This component utilizes relative RGB color values, which may not be fully supported in your browser. Please check [Browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#browser_compatibility) for details.
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
|
|
28
28
|
@include elevation.level(0);
|
|
29
29
|
|
|
30
|
-
@include
|
|
31
|
-
@include
|
|
32
|
-
@include
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
30
|
+
@include shape.corner('small');
|
|
31
|
+
@include shape.corner('medium');
|
|
32
|
+
@include shape.corner('large');
|
|
33
|
+
@include shape.corner('extra-large');
|
|
34
|
+
@include shape.corner('full');
|
|
35
35
|
|
|
36
36
|
@include statelayer.token('hover-state-layer-opacity');
|
|
37
37
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -43,29 +43,10 @@
|
|
|
43
43
|
@include statelayer.property;
|
|
44
44
|
@include statelayer.keyframes;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
button.micl-iconbutton-standard-m,
|
|
51
|
-
a.micl-iconbutton-standard-m,
|
|
52
|
-
button.micl-iconbutton-standard-l,
|
|
53
|
-
button.micl-iconbutton-standard-xl,
|
|
54
|
-
button.micl-iconbutton-filled-xs,
|
|
55
|
-
button.micl-iconbutton-filled-s,
|
|
56
|
-
button.micl-iconbutton-filled-m,
|
|
57
|
-
button.micl-iconbutton-filled-l,
|
|
58
|
-
button.micl-iconbutton-filled-xl,
|
|
59
|
-
button.micl-iconbutton-tonal-xs,
|
|
60
|
-
button.micl-iconbutton-tonal-s,
|
|
61
|
-
button.micl-iconbutton-tonal-m,
|
|
62
|
-
button.micl-iconbutton-tonal-l,
|
|
63
|
-
button.micl-iconbutton-tonal-xl,
|
|
64
|
-
button.micl-iconbutton-outlined-xs,
|
|
65
|
-
button.micl-iconbutton-outlined-s,
|
|
66
|
-
button.micl-iconbutton-outlined-m,
|
|
67
|
-
button.micl-iconbutton-outlined-l,
|
|
68
|
-
button.micl-iconbutton-outlined-xl {
|
|
46
|
+
[class*="micl-iconbutton-standard-"],
|
|
47
|
+
[class*="micl-iconbutton-filled-"],
|
|
48
|
+
[class*="micl-iconbutton-tonal-"],
|
|
49
|
+
[class*="micl-iconbutton-outlined-"] {
|
|
69
50
|
--md-sys-iconbutton-motion-effects: #{motion.$md-sys-motion-expressive-fast-spatial};
|
|
70
51
|
--md-sys-iconbutton-motion-duration: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
|
|
71
52
|
--md-sys-iconbutton-motion-duration-reverse: #{motion.$md-sys-motion-expressive-fast-spatial-duration};
|
|
@@ -89,7 +70,7 @@ button.micl-iconbutton-outlined-xl {
|
|
|
89
70
|
background-repeat: no-repeat;
|
|
90
71
|
background-size: 0%, 100%;
|
|
91
72
|
-webkit-tap-highlight-color: transparent;
|
|
92
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
73
|
+
color: var(--md-comp-icon-button-icon-color, var(--md-sys-color-on-surface-variant));
|
|
93
74
|
font-variation-settings: 'FILL' 0;
|
|
94
75
|
cursor: pointer;
|
|
95
76
|
transition:
|
|
@@ -99,37 +80,42 @@ button.micl-iconbutton-outlined-xl {
|
|
|
99
80
|
--statelayer-opacity var(--md-sys-iconbutton-motion-duration) linear;
|
|
100
81
|
|
|
101
82
|
&:disabled {
|
|
102
|
-
background-color: rgb(from var(--md-sys-color-on-surface) r g b / 10%);
|
|
103
|
-
color: rgb(from var(--md-sys-color-on-surface) r g b / var(--md-sys-state-disabled-state-layer-opacity, 38%));
|
|
104
83
|
box-shadow: var(--md-sys-elevation-level0);
|
|
105
84
|
cursor: default;
|
|
106
85
|
}
|
|
107
86
|
&:not(:disabled) {
|
|
87
|
+
&:hover {
|
|
88
|
+
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
89
|
+
}
|
|
108
90
|
&:focus-visible {
|
|
91
|
+
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
92
|
+
|
|
109
93
|
outline: var(--md-sys-state-focus-indicator-thickness, 3px) solid var(--md-sys-color-secondary);
|
|
110
94
|
outline-offset: 3px;
|
|
111
95
|
}
|
|
96
|
+
&:active {
|
|
97
|
+
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
98
|
+
}
|
|
112
99
|
&.micl-rippling {
|
|
113
100
|
animation: micl-ripple var(--md-sys-state-ripple-duration) motion.$md-sys-motion-easing-standard;
|
|
114
101
|
}
|
|
115
102
|
}
|
|
116
103
|
&:hover:not(:disabled),
|
|
117
|
-
&.micl-button--toggle
|
|
104
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
118
105
|
font-variation-settings: 'FILL' 1;
|
|
119
106
|
}
|
|
120
|
-
&.micl-button--toggle:not(
|
|
107
|
+
&.micl-button--toggle:not([aria-pressed="true"])::before {
|
|
121
108
|
content: attr(data-miclicon);
|
|
122
109
|
}
|
|
123
|
-
&.micl-button--toggle
|
|
110
|
+
&.micl-button--toggle[aria-pressed="true"]::before {
|
|
124
111
|
content: attr(data-micliconselected);
|
|
125
112
|
}
|
|
126
113
|
}
|
|
127
114
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
button.micl-iconbutton-outlined-xs {
|
|
115
|
+
.micl-iconbutton-standard-xs,
|
|
116
|
+
.micl-iconbutton-filled-xs,
|
|
117
|
+
.micl-iconbutton-tonal-xs,
|
|
118
|
+
.micl-iconbutton-outlined-xs {
|
|
133
119
|
--micl-width: 32px;
|
|
134
120
|
--micl-height: 32px;
|
|
135
121
|
|
|
@@ -151,7 +137,7 @@ button.micl-iconbutton-outlined-xs {
|
|
|
151
137
|
inset: calc((var(--micl-height) - var(--md-sys-target-size, 48px)) / 2) 0 0 calc((min(100%, var(--md-sys-target-size, 48px)) - var(--md-sys-target-size, 48px)) / 2);
|
|
152
138
|
background-color: transparent;
|
|
153
139
|
}
|
|
154
|
-
&.micl-button--toggle
|
|
140
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
155
141
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
156
142
|
}
|
|
157
143
|
&.micl-iconbutton--narrow {
|
|
@@ -165,22 +151,22 @@ button.micl-iconbutton-outlined-xs {
|
|
|
165
151
|
&.micl-button--square {
|
|
166
152
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
167
153
|
|
|
168
|
-
&.micl-button--toggle
|
|
154
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
169
155
|
border-radius: var(--md-sys-shape-corner-full);
|
|
170
156
|
}
|
|
171
157
|
}
|
|
172
|
-
&:not(:disabled) {
|
|
173
|
-
|
|
158
|
+
&:not(:disabled):active {
|
|
159
|
+
&,
|
|
160
|
+
&.micl-button--square {
|
|
174
161
|
border-radius: var(--md-sys-shape-corner-small);
|
|
175
162
|
}
|
|
176
163
|
}
|
|
177
164
|
}
|
|
178
165
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
button.micl-iconbutton-outlined-s {
|
|
166
|
+
.micl-iconbutton-standard-s,
|
|
167
|
+
.micl-iconbutton-filled-s,
|
|
168
|
+
.micl-iconbutton-tonal-s,
|
|
169
|
+
.micl-iconbutton-outlined-s {
|
|
184
170
|
--micl-width: 40px;
|
|
185
171
|
--micl-height: 40px;
|
|
186
172
|
|
|
@@ -202,7 +188,7 @@ button.micl-iconbutton-outlined-s {
|
|
|
202
188
|
inset: calc((var(--micl-height) - var(--md-sys-target-size, 48px)) / 2) 0 0 calc((min(100%, var(--md-sys-target-size, 48px)) - var(--md-sys-target-size, 48px)) / 2);
|
|
203
189
|
background-color: transparent;
|
|
204
190
|
}
|
|
205
|
-
&.micl-button--toggle
|
|
191
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
206
192
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
207
193
|
}
|
|
208
194
|
&.micl-iconbutton--narrow {
|
|
@@ -216,22 +202,22 @@ button.micl-iconbutton-outlined-s {
|
|
|
216
202
|
&.micl-button--square {
|
|
217
203
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
218
204
|
|
|
219
|
-
&.micl-button--toggle
|
|
205
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
220
206
|
border-radius: var(--md-sys-shape-corner-full);
|
|
221
207
|
}
|
|
222
208
|
}
|
|
223
|
-
&:not(:disabled) {
|
|
224
|
-
|
|
209
|
+
&:not(:disabled):active {
|
|
210
|
+
&,
|
|
211
|
+
&.micl-button--square {
|
|
225
212
|
border-radius: var(--md-sys-shape-corner-small);
|
|
226
213
|
}
|
|
227
214
|
}
|
|
228
215
|
}
|
|
229
216
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
button.micl-iconbutton-outlined-m {
|
|
217
|
+
.micl-iconbutton-standard-m,
|
|
218
|
+
.micl-iconbutton-filled-m,
|
|
219
|
+
.micl-iconbutton-tonal-m,
|
|
220
|
+
.micl-iconbutton-outlined-m {
|
|
235
221
|
--micl-width: 56px;
|
|
236
222
|
--micl-height: 56px;
|
|
237
223
|
|
|
@@ -240,7 +226,7 @@ button.micl-iconbutton-outlined-m {
|
|
|
240
226
|
block-size: var(--micl-height);
|
|
241
227
|
font-size: var(--md-sys-icon-size, 24px);
|
|
242
228
|
|
|
243
|
-
&.micl-button--toggle
|
|
229
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
244
230
|
border-radius: var(--md-sys-shape-corner-large);
|
|
245
231
|
}
|
|
246
232
|
&.micl-iconbutton--narrow {
|
|
@@ -254,21 +240,22 @@ button.micl-iconbutton-outlined-m {
|
|
|
254
240
|
&.micl-button--square {
|
|
255
241
|
border-radius: var(--md-sys-shape-corner-large);
|
|
256
242
|
|
|
257
|
-
&.micl-button--toggle
|
|
243
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
258
244
|
border-radius: var(--md-sys-shape-corner-full);
|
|
259
245
|
}
|
|
260
246
|
}
|
|
261
|
-
&:not(:disabled) {
|
|
262
|
-
|
|
247
|
+
&:not(:disabled):active {
|
|
248
|
+
&,
|
|
249
|
+
&.micl-button--square {
|
|
263
250
|
border-radius: var(--md-sys-shape-corner-medium);
|
|
264
251
|
}
|
|
265
252
|
}
|
|
266
253
|
}
|
|
267
254
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
255
|
+
.micl-iconbutton-standard-l,
|
|
256
|
+
.micl-iconbutton-filled-l,
|
|
257
|
+
.micl-iconbutton-tonal-l,
|
|
258
|
+
.micl-iconbutton-outlined-l {
|
|
272
259
|
--micl-width: 96px;
|
|
273
260
|
--micl-height: 96px;
|
|
274
261
|
|
|
@@ -277,7 +264,7 @@ button.micl-iconbutton-outlined-l {
|
|
|
277
264
|
block-size: var(--micl-height);
|
|
278
265
|
font-size: 32px;
|
|
279
266
|
|
|
280
|
-
&.micl-button--toggle
|
|
267
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
281
268
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
282
269
|
}
|
|
283
270
|
&.micl-iconbutton--narrow {
|
|
@@ -291,21 +278,22 @@ button.micl-iconbutton-outlined-l {
|
|
|
291
278
|
&.micl-button--square {
|
|
292
279
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
293
280
|
|
|
294
|
-
&.micl-button--toggle
|
|
281
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
295
282
|
border-radius: var(--md-sys-shape-corner-full);
|
|
296
283
|
}
|
|
297
284
|
}
|
|
298
|
-
&:not(:disabled) {
|
|
299
|
-
|
|
285
|
+
&:not(:disabled):active {
|
|
286
|
+
&,
|
|
287
|
+
&.micl-button--square {
|
|
300
288
|
border-radius: var(--md-sys-shape-corner-large);
|
|
301
289
|
}
|
|
302
290
|
}
|
|
303
291
|
}
|
|
304
292
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
293
|
+
.micl-iconbutton-standard-xl,
|
|
294
|
+
.micl-iconbutton-filled-xl,
|
|
295
|
+
.micl-iconbutton-tonal-xl,
|
|
296
|
+
.micl-iconbutton-outlined-xl {
|
|
309
297
|
--micl-width: 136px;
|
|
310
298
|
--micl-height: 136px;
|
|
311
299
|
|
|
@@ -314,7 +302,7 @@ button.micl-iconbutton-outlined-xl {
|
|
|
314
302
|
block-size: var(--micl-height);
|
|
315
303
|
font-size: 40px;
|
|
316
304
|
|
|
317
|
-
&.micl-button--toggle
|
|
305
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
318
306
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
319
307
|
}
|
|
320
308
|
&.micl-iconbutton--narrow {
|
|
@@ -328,151 +316,105 @@ button.micl-iconbutton-outlined-xl {
|
|
|
328
316
|
&.micl-button--square {
|
|
329
317
|
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
330
318
|
|
|
331
|
-
&.micl-button--toggle
|
|
319
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
332
320
|
border-radius: var(--md-sys-shape-corner-full);
|
|
333
321
|
}
|
|
334
322
|
}
|
|
335
|
-
&:not(:disabled) {
|
|
336
|
-
|
|
323
|
+
&:not(:disabled):active {
|
|
324
|
+
&,
|
|
325
|
+
&.micl-button--square {
|
|
337
326
|
border-radius: var(--md-sys-shape-corner-large);
|
|
338
327
|
}
|
|
339
328
|
}
|
|
340
329
|
}
|
|
341
330
|
|
|
342
|
-
|
|
343
|
-
a.micl-iconbutton-standard-xs,
|
|
344
|
-
button.micl-iconbutton-standard-s,
|
|
345
|
-
a.micl-iconbutton-standard-s,
|
|
346
|
-
button.micl-iconbutton-standard-m,
|
|
347
|
-
a.micl-iconbutton-standard-m,
|
|
348
|
-
button.micl-iconbutton-standard-l,
|
|
349
|
-
button.micl-iconbutton-standard-xl {
|
|
331
|
+
[class*="micl-iconbutton-standard-"] {
|
|
350
332
|
--statelayer-color: var(--md-sys-color-on-surface-variant);
|
|
351
333
|
|
|
352
334
|
text-decoration: none;
|
|
353
335
|
|
|
354
336
|
&:disabled {
|
|
355
337
|
background-color: transparent;
|
|
338
|
+
color: var(--md-comp-icon-button-disabled-icon-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-icon-button-disabled-icon-opacity, 38%)));
|
|
356
339
|
}
|
|
357
340
|
&:not(:disabled) {
|
|
358
|
-
&.micl-button--toggle
|
|
341
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
359
342
|
--statelayer-color: var(--md-sys-color-primary);
|
|
360
343
|
|
|
361
|
-
color: var(--md-sys-color-primary);
|
|
362
|
-
}
|
|
363
|
-
&:hover {
|
|
364
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
365
|
-
}
|
|
366
|
-
&:focus-visible {
|
|
367
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
368
|
-
}
|
|
369
|
-
&:active {
|
|
370
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
344
|
+
color: var(--md-comp-icon-button-selected-icon-color, var(--md-sys-color-primary));
|
|
371
345
|
}
|
|
372
346
|
}
|
|
373
347
|
}
|
|
374
348
|
|
|
375
349
|
|
|
376
|
-
|
|
377
|
-
button.micl-iconbutton-filled-s,
|
|
378
|
-
button.micl-iconbutton-filled-m,
|
|
379
|
-
button.micl-iconbutton-filled-l,
|
|
380
|
-
button.micl-iconbutton-filled-xl {
|
|
350
|
+
[class*="micl-iconbutton-filled-"] {
|
|
381
351
|
--statelayer-color: var(--md-sys-color-on-primary);
|
|
382
352
|
|
|
383
|
-
background-color: var(--md-sys-color-primary);
|
|
384
|
-
color: var(--md-sys-color-on-primary);
|
|
353
|
+
background-color: var(--md-comp-filled-icon-button-container-color, var(--md-sys-color-primary));
|
|
354
|
+
color: var(--md-comp-filled-icon-button-icon-color, var(--md-sys-color-on-primary));
|
|
385
355
|
|
|
356
|
+
&:disabled {
|
|
357
|
+
background-color: var(--md-comp-filled-icon-button-disabled-container-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-filled-icon-button-disabled-container-opacity, 10%)));
|
|
358
|
+
color: var(--md-comp-filled-icon-button-disabled-icon-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-filled-icon-button-disabled-icon-opacity, 38%)));
|
|
359
|
+
}
|
|
386
360
|
&:not(:disabled) {
|
|
387
|
-
&.micl-button--toggle:not(
|
|
361
|
+
&.micl-button--toggle:not([aria-pressed="true"]) {
|
|
388
362
|
--statelayer-color: var(--md-sys-color-on-surface-variant);
|
|
389
363
|
|
|
390
|
-
background-color: var(--md-sys-color-surface-container);
|
|
391
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
392
|
-
}
|
|
393
|
-
&:hover {
|
|
394
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
395
|
-
}
|
|
396
|
-
&:focus-visible {
|
|
397
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
398
|
-
}
|
|
399
|
-
&:active {
|
|
400
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
364
|
+
background-color: var(--md-comp-filled-icon-button-unselected-container-color, var(--md-sys-color-surface-container));
|
|
365
|
+
color: var(--md-comp-filled-icon-button-unselected-icon-color, var(--md-sys-color-on-surface-variant));
|
|
401
366
|
}
|
|
402
367
|
}
|
|
403
368
|
}
|
|
404
369
|
|
|
405
|
-
|
|
406
|
-
button.micl-iconbutton-tonal-s,
|
|
407
|
-
button.micl-iconbutton-tonal-m,
|
|
408
|
-
button.micl-iconbutton-tonal-l,
|
|
409
|
-
button.micl-iconbutton-tonal-xl {
|
|
370
|
+
[class*="micl-iconbutton-tonal-"] {
|
|
410
371
|
--statelayer-color: var(--md-sys-color-on-secondary-container);
|
|
411
372
|
|
|
412
|
-
background-color: var(--md-sys-color-secondary-container);
|
|
413
|
-
color: var(--md-sys-color-on-secondary-container);
|
|
373
|
+
background-color: var(--md-comp-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container));
|
|
374
|
+
color: var(--md-comp-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container));
|
|
414
375
|
|
|
376
|
+
&:disabled {
|
|
377
|
+
background-color: var(--md-comp-filled-tonal-icon-button-disabled-container-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-filled-tonal-icon-button-disabled-container-opacity, 10%)));
|
|
378
|
+
color: var(--md-comp-filled-tonal-icon-button-disabled-icon-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-filled-tonal-icon-button-disabled-icon-opacity, 38%)));
|
|
379
|
+
}
|
|
415
380
|
&:not(:disabled) {
|
|
416
|
-
&.micl-button--toggle
|
|
381
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
417
382
|
--statelayer-color: var(--md-sys-color-on-secondary);
|
|
418
383
|
|
|
419
|
-
background-color: var(--md-sys-color-secondary);
|
|
420
|
-
color: var(--md-sys-color-on-secondary);
|
|
421
|
-
}
|
|
422
|
-
&:hover {
|
|
423
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
424
|
-
}
|
|
425
|
-
&:focus-visible {
|
|
426
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
427
|
-
}
|
|
428
|
-
&:active {
|
|
429
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
384
|
+
background-color: var(--md-comp-filled-tonal-icon-button-selected-container-color, var(--md-sys-color-secondary));
|
|
385
|
+
color: var(--md-comp-filled-tonal-icon-button-selected-icon-color, var(--md-sys-color-on-secondary));
|
|
430
386
|
}
|
|
431
387
|
}
|
|
432
388
|
}
|
|
433
389
|
|
|
434
|
-
|
|
435
|
-
button.micl-iconbutton-outlined-s,
|
|
436
|
-
button.micl-iconbutton-outlined-m,
|
|
437
|
-
button.micl-iconbutton-outlined-l,
|
|
438
|
-
button.micl-iconbutton-outlined-xl {
|
|
390
|
+
[class*="micl-iconbutton-outlined-"] {
|
|
439
391
|
--statelayer-color: var(--md-sys-color-on-surface-variant);
|
|
440
392
|
|
|
441
393
|
background-color: transparent;
|
|
442
|
-
color: var(--md-sys-color-on-surface-variant);
|
|
394
|
+
color: var(--md-comp-outlined-icon-button-icon-color, var(--md-sys-color-on-surface-variant));
|
|
443
395
|
|
|
444
|
-
&.micl-iconbutton-outlined-xs,
|
|
445
|
-
&.micl-iconbutton-outlined-s,
|
|
446
|
-
&.micl-iconbutton-outlined-m {
|
|
447
|
-
// border-color: var(--md-sys-color-outline);
|
|
448
|
-
border: 1px solid var(--md-sys-color-outline-variant);
|
|
449
|
-
}
|
|
450
|
-
&.micl-iconbutton-outlined-l {
|
|
451
|
-
// border: 2px solid var(--md-sys-color-outline);
|
|
452
|
-
border: 2px solid var(--md-sys-color-outline-variant);
|
|
453
|
-
}
|
|
454
|
-
&.micl-iconbutton-outlined-xl {
|
|
455
|
-
// border: 3px solid var(--md-sys-color-outline);
|
|
456
|
-
border: 3px solid var(--md-sys-color-outline-variant);
|
|
457
|
-
}
|
|
458
396
|
&:disabled {
|
|
459
397
|
background-color: transparent;
|
|
398
|
+
color: var(--md-comp-outlined-icon-button-disabled-icon-color, rgb(from var(--md-sys-color-on-surface) r g b / var(--md-comp-outlined-icon-button-disabled-icon-opacity, 38%)));
|
|
460
399
|
}
|
|
461
400
|
&:not(:disabled) {
|
|
462
|
-
&.micl-button--toggle
|
|
401
|
+
&.micl-button--toggle[aria-pressed="true"] {
|
|
463
402
|
--statelayer-color: var(--md-sys-color-inverse-on-surface);
|
|
464
403
|
|
|
465
|
-
|
|
466
|
-
color: var(--md-sys-color-inverse-
|
|
467
|
-
|
|
468
|
-
&:hover {
|
|
469
|
-
--statelayer-opacity: var(--md-sys-state-hover-state-layer-opacity, 8%);
|
|
470
|
-
}
|
|
471
|
-
&:focus-visible {
|
|
472
|
-
--statelayer-opacity: var(--md-sys-state-focus-state-layer-opacity, 10%);
|
|
473
|
-
}
|
|
474
|
-
&:active {
|
|
475
|
-
--statelayer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 10%);
|
|
404
|
+
border: none;
|
|
405
|
+
background-color: var(--md-comp-outlined-icon-button-selected-container-color, var(--md-sys-color-inverse-surface));
|
|
406
|
+
color: var(--md-comp-outlined-icon-button-selected-icon-color, var(--md-sys-color-inverse-on-surface));
|
|
476
407
|
}
|
|
477
408
|
}
|
|
478
409
|
}
|
|
410
|
+
.micl-iconbutton-outlined-xs,
|
|
411
|
+
.micl-iconbutton-outlined-s,
|
|
412
|
+
.micl-iconbutton-outlined-m {
|
|
413
|
+
border: 1px solid var(--md-comp-outlined-icon-button-outline-color, var(--md-sys-color-outline-variant));
|
|
414
|
+
}
|
|
415
|
+
.micl-iconbutton-outlined-l {
|
|
416
|
+
border: 2px solid var(--md-comp-outlined-icon-button-outline-color, var(--md-sys-color-outline-variant));
|
|
417
|
+
}
|
|
418
|
+
.micl-iconbutton-outlined-xl {
|
|
419
|
+
border: 3px solid var(--md-comp-outlined-icon-button-outline-color, var(--md-sys-color-outline-variant));
|
|
420
|
+
}
|
|
@@ -19,11 +19,11 @@
|
|
|
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 = '
|
|
22
|
+
export const buttonSelector = '.micl-button--toggle';
|
|
23
23
|
|
|
24
24
|
const toggleIcon = (button: HTMLButtonElement): void =>
|
|
25
25
|
{
|
|
26
|
-
const selected = button.
|
|
26
|
+
const selected = button.getAttribute('aria-pressed') === 'true';
|
|
27
27
|
if (button.dataset.micliconselected) {
|
|
28
28
|
button.classList.toggle(button.dataset.micliconselected, selected);
|
|
29
29
|
}
|
|
@@ -45,7 +45,7 @@ export default (() =>
|
|
|
45
45
|
&& (event as any).command === '--micl-toggle'
|
|
46
46
|
) {
|
|
47
47
|
target.classList.add('micl-button--toggled');
|
|
48
|
-
target.
|
|
48
|
+
target.setAttribute('aria-pressed', String(target.getAttribute('aria-pressed') !== 'true'));
|
|
49
49
|
|
|
50
50
|
toggleIcon(target);
|
|
51
51
|
}
|
|
@@ -69,7 +69,7 @@ export default (() =>
|
|
|
69
69
|
cleanup: function(element: HTMLButtonElement): void
|
|
70
70
|
{
|
|
71
71
|
if (element.matches(buttonSelector)) {
|
|
72
|
-
|
|
72
|
+
element.removeEventListener('command', this.command);
|
|
73
73
|
delete element.dataset.miclinitialized;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(4);
|
|
30
30
|
|
|
31
|
-
@include
|
|
32
|
-
@include
|
|
33
|
-
@include
|
|
34
|
-
@include
|
|
35
|
-
@include
|
|
31
|
+
@include shape.corner('extra-small');
|
|
32
|
+
@include shape.corner('small');
|
|
33
|
+
@include shape.corner('medium');
|
|
34
|
+
@include shape.corner('large');
|
|
35
|
+
@include shape.corner('full');
|
|
36
36
|
|
|
37
37
|
@include statelayer.token('hover-state-layer-opacity');
|
|
38
38
|
@include statelayer.token('focus-state-layer-opacity');
|
|
@@ -229,8 +229,8 @@ $open-accordion: ':where(details[open] > *)';
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
.micl-list:has(.micl-list-item-one[tabindex], .micl-list-item-two[tabindex], .micl-list-item-three[tabindex]), select {
|
|
233
|
-
.micl-list-item-one, .micl-list-item-two, .micl-list-item-three {
|
|
232
|
+
.micl-list:has(> .micl-list-item-one[tabindex], > .micl-list-item-two[tabindex], > .micl-list-item-three[tabindex]), select {
|
|
233
|
+
> .micl-list-item-one, > .micl-list-item-two, > .micl-list-item-three {
|
|
234
234
|
&:not(:disabled):not(.micl-list-item--disabled) {
|
|
235
235
|
@extend %shared-interactive-states;
|
|
236
236
|
}
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
@use '../../foundations';
|
|
23
23
|
@use '../../styles/elevation';
|
|
24
24
|
@use '../../styles/motion';
|
|
25
|
-
@use '../../styles/
|
|
25
|
+
@use '../../styles/shape';
|
|
26
26
|
@use '../../styles/statelayer';
|
|
27
27
|
@use '../../styles/typography';
|
|
28
28
|
|
|
29
29
|
@include elevation.level(2);
|
|
30
30
|
|
|
31
|
-
@include
|
|
32
|
-
@include
|
|
31
|
+
@include shape.corner('small');
|
|
32
|
+
@include shape.corner('large');
|
|
33
33
|
|
|
34
34
|
@include statelayer.token('hover-state-layer-opacity');
|
|
35
35
|
@include statelayer.token('focus-state-layer-opacity');
|