material-inspired-component-library 1.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/.editorconfig +12 -0
- package/.gitattributes +9 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/LICENSE +21 -0
- package/README.md +99 -0
- package/components/README.md +12 -0
- package/components/accordion/README.md +94 -0
- package/components/bottomsheet/README.md +77 -0
- package/components/bottomsheet/bottomsheet.scss +134 -0
- package/components/bottomsheet/index.ts +152 -0
- package/components/button/README.md +92 -0
- package/components/button/button.scss +515 -0
- package/components/button/index.ts +73 -0
- package/components/card/README.md +125 -0
- package/components/card/card.scss +261 -0
- package/components/checkbox/README.md +62 -0
- package/components/checkbox/checkbox.scss +275 -0
- package/components/checkbox/index.ts +48 -0
- package/components/dialog/README.md +133 -0
- package/components/dialog/dialog.scss +262 -0
- package/components/divider/README.md +52 -0
- package/components/divider/divider.scss +74 -0
- package/components/iconbutton/README.md +86 -0
- package/components/iconbutton/iconbutton.scss +461 -0
- package/components/iconbutton/index.ts +73 -0
- package/components/list/README.md +176 -0
- package/components/list/index.ts +108 -0
- package/components/list/list.scss +295 -0
- package/components/menu/README.md +96 -0
- package/components/menu/index.ts +77 -0
- package/components/menu/menu.scss +124 -0
- package/components/radio/README.md +53 -0
- package/components/radio/radio.scss +138 -0
- package/components/select/README.md +84 -0
- package/components/select/select.scss +122 -0
- package/components/sidesheet/README.md +99 -0
- package/components/sidesheet/sidesheet.scss +162 -0
- package/components/slider/README.md +69 -0
- package/components/slider/index.ts +114 -0
- package/components/slider/slider.scss +258 -0
- package/components/switch/README.md +49 -0
- package/components/switch/switch.scss +176 -0
- package/components/textfield/README.md +75 -0
- package/components/textfield/index.ts +81 -0
- package/components/textfield/textfield.scss +387 -0
- package/components.ts +169 -0
- package/dist/bottomsheet.css +1 -0
- package/dist/bottomsheet.js +0 -0
- package/dist/button.css +1 -0
- package/dist/button.js +0 -0
- package/dist/card.css +1 -0
- package/dist/card.js +0 -0
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.js +0 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.js +0 -0
- package/dist/divider.css +1 -0
- package/dist/divider.js +0 -0
- package/dist/iconbutton.css +1 -0
- package/dist/iconbutton.js +0 -0
- package/dist/list.css +1 -0
- package/dist/list.js +0 -0
- package/dist/menu.css +1 -0
- package/dist/menu.js +0 -0
- package/dist/micl.css +1 -0
- package/dist/micl.js +1 -0
- package/dist/radio.css +1 -0
- package/dist/radio.js +0 -0
- package/dist/select.css +1 -0
- package/dist/select.js +0 -0
- package/dist/sidesheet.css +1 -0
- package/dist/sidesheet.js +0 -0
- package/dist/slider.css +1 -0
- package/dist/slider.js +0 -0
- package/dist/switch.css +1 -0
- package/dist/switch.js +0 -0
- package/dist/textfield.css +1 -0
- package/dist/textfield.js +0 -0
- package/docs/accordion.html +285 -0
- package/docs/bottomsheet.html +162 -0
- package/docs/button.html +206 -0
- package/docs/card-awards.webp +0 -0
- package/docs/card-cabinet.webp +0 -0
- package/docs/card-city.webp +0 -0
- package/docs/card-fingerprint.webp +0 -0
- package/docs/card-holiday.webp +0 -0
- package/docs/card-names.webp +0 -0
- package/docs/card.html +91 -0
- package/docs/checkbox.html +99 -0
- package/docs/dialog.html +153 -0
- package/docs/divider.html +103 -0
- package/docs/docs.css +34 -0
- package/docs/docs.js +69 -0
- package/docs/iconbutton.html +197 -0
- package/docs/index.html +319 -0
- package/docs/list.html +224 -0
- package/docs/menu.html +143 -0
- package/docs/micl.css +1 -0
- package/docs/micl.js +1 -0
- package/docs/radio.html +101 -0
- package/docs/select.html +205 -0
- package/docs/sidesheet.html +115 -0
- package/docs/slider.html +72 -0
- package/docs/switch.html +151 -0
- package/docs/textfield.html +151 -0
- package/docs/themes/airblue/dark-hc.css +51 -0
- package/docs/themes/airblue/dark-mc.css +51 -0
- package/docs/themes/airblue/dark.css +51 -0
- package/docs/themes/airblue/light-hc.css +51 -0
- package/docs/themes/airblue/light-mc.css +51 -0
- package/docs/themes/airblue/light.css +51 -0
- package/docs/themes/airblue/theme.css +306 -0
- package/docs/themes/barnred/dark-hc.css +51 -0
- package/docs/themes/barnred/dark-mc.css +51 -0
- package/docs/themes/barnred/dark.css +51 -0
- package/docs/themes/barnred/light-hc.css +51 -0
- package/docs/themes/barnred/light-mc.css +51 -0
- package/docs/themes/barnred/light.css +51 -0
- package/docs/themes/barnred/theme.css +306 -0
- package/docs/themes/citrine/dark-hc.css +51 -0
- package/docs/themes/citrine/dark-mc.css +51 -0
- package/docs/themes/citrine/dark.css +51 -0
- package/docs/themes/citrine/light-hc.css +51 -0
- package/docs/themes/citrine/light-mc.css +51 -0
- package/docs/themes/citrine/light.css +51 -0
- package/docs/themes/citrine/theme.css +306 -0
- package/docs/themes/olivegreen/dark-hc.css +51 -0
- package/docs/themes/olivegreen/dark-mc.css +51 -0
- package/docs/themes/olivegreen/dark.css +51 -0
- package/docs/themes/olivegreen/light-hc.css +51 -0
- package/docs/themes/olivegreen/light-mc.css +51 -0
- package/docs/themes/olivegreen/light.css +51 -0
- package/docs/themes/olivegreen/theme.css +306 -0
- package/package.json +62 -0
- package/styles/README.md +99 -0
- package/styles/elevation.scss +36 -0
- package/styles/motion.scss +124 -0
- package/styles/ripple.scss +50 -0
- package/styles/shapes.scss +46 -0
- package/styles/statelayer.scss +42 -0
- package/styles/typography.scss +568 -0
- package/styles.scss +43 -0
- package/themes/README.md +57 -0
- package/themes/airblue/dark-hc.css +51 -0
- package/themes/airblue/dark-mc.css +51 -0
- package/themes/airblue/dark.css +51 -0
- package/themes/airblue/light-hc.css +51 -0
- package/themes/airblue/light-mc.css +51 -0
- package/themes/airblue/light.css +51 -0
- package/themes/airblue/theme.css +306 -0
- package/themes/barnred/dark-hc.css +51 -0
- package/themes/barnred/dark-mc.css +51 -0
- package/themes/barnred/dark.css +51 -0
- package/themes/barnred/light-hc.css +51 -0
- package/themes/barnred/light-mc.css +51 -0
- package/themes/barnred/light.css +51 -0
- package/themes/barnred/theme.css +306 -0
- package/themes/citrine/dark-hc.css +51 -0
- package/themes/citrine/dark-mc.css +51 -0
- package/themes/citrine/dark.css +51 -0
- package/themes/citrine/light-hc.css +51 -0
- package/themes/citrine/light-mc.css +51 -0
- package/themes/citrine/light.css +51 -0
- package/themes/citrine/theme.css +306 -0
- package/themes/olivegreen/dark-hc.css +51 -0
- package/themes/olivegreen/dark-mc.css +51 -0
- package/themes/olivegreen/dark.css +51 -0
- package/themes/olivegreen/light-hc.css +51 -0
- package/themes/olivegreen/light-mc.css +51 -0
- package/themes/olivegreen/light.css +51 -0
- package/themes/olivegreen/theme.css +306 -0
- package/tsconfig.json +110 -0
- package/webpack.config.js +49 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2025 Hermana AS
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
// copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
// SOFTWARE.
|
|
21
|
+
|
|
22
|
+
@use '../../styles/motion';
|
|
23
|
+
@use '../../styles/ripple';
|
|
24
|
+
|
|
25
|
+
button.micl-iconbutton-standard-xs,
|
|
26
|
+
button.micl-iconbutton-standard-s,
|
|
27
|
+
button.micl-iconbutton-standard-m,
|
|
28
|
+
button.micl-iconbutton-standard-l,
|
|
29
|
+
button.micl-iconbutton-standard-xl,
|
|
30
|
+
button.micl-iconbutton-filled-xs,
|
|
31
|
+
button.micl-iconbutton-filled-s,
|
|
32
|
+
button.micl-iconbutton-filled-m,
|
|
33
|
+
button.micl-iconbutton-filled-l,
|
|
34
|
+
button.micl-iconbutton-filled-xl,
|
|
35
|
+
button.micl-iconbutton-tonal-xs,
|
|
36
|
+
button.micl-iconbutton-tonal-s,
|
|
37
|
+
button.micl-iconbutton-tonal-m,
|
|
38
|
+
button.micl-iconbutton-tonal-l,
|
|
39
|
+
button.micl-iconbutton-tonal-xl,
|
|
40
|
+
button.micl-iconbutton-outlined-xs,
|
|
41
|
+
button.micl-iconbutton-outlined-s,
|
|
42
|
+
button.micl-iconbutton-outlined-m,
|
|
43
|
+
button.micl-iconbutton-outlined-l,
|
|
44
|
+
button.micl-iconbutton-outlined-xl {
|
|
45
|
+
padding: 0;
|
|
46
|
+
border: none;
|
|
47
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
font-variation-settings: 'FILL' 0;
|
|
52
|
+
transition:
|
|
53
|
+
font-variation-settings 600ms,
|
|
54
|
+
border-radius var(--md-sys-motion-duration-extra-long4) linear(motion.$md-sys-motion-spring-fast-spatial);
|
|
55
|
+
|
|
56
|
+
&:disabled {
|
|
57
|
+
background-color: rgb(from var(--md-sys-color-on-surface) r g b / 10%);
|
|
58
|
+
color: rgb(from var(--md-sys-color-on-surface) r g b / 38%);
|
|
59
|
+
box-shadow: var(--md-sys-elevation-level0);
|
|
60
|
+
cursor: default;
|
|
61
|
+
}
|
|
62
|
+
&:not(:disabled):focus-visible {
|
|
63
|
+
outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
|
|
64
|
+
outline-offset: 3px;
|
|
65
|
+
}
|
|
66
|
+
&:hover:not(:disabled),
|
|
67
|
+
&.micl-button--toggle.micl-button--selected {
|
|
68
|
+
font-variation-settings: 'FILL' 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
button.micl-iconbutton-standard-xs,
|
|
73
|
+
button.micl-iconbutton-filled-xs,
|
|
74
|
+
button.micl-iconbutton-tonal-xs,
|
|
75
|
+
button.micl-iconbutton-outlined-xs {
|
|
76
|
+
width: var(--md-sys-target-size);
|
|
77
|
+
min-width: var(--md-sys-target-size);
|
|
78
|
+
height: var(--md-sys-target-size);
|
|
79
|
+
font-size: 20px;
|
|
80
|
+
border: 8px solid transparent;
|
|
81
|
+
background-clip: content-box;
|
|
82
|
+
|
|
83
|
+
&.micl-button--toggle.micl-button--selected {
|
|
84
|
+
// border-radius: var(--md-sys-shape-corner-medium);
|
|
85
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
86
|
+
}
|
|
87
|
+
&:not(:disabled) {
|
|
88
|
+
--miclripple: 1;
|
|
89
|
+
@include ripple.effect;
|
|
90
|
+
|
|
91
|
+
&:active {
|
|
92
|
+
// border-radius: var(--md-sys-shape-corner-small);
|
|
93
|
+
border-radius: var(--md-sys-shape-corner-medium);
|
|
94
|
+
}
|
|
95
|
+
&:focus-visible {
|
|
96
|
+
outline-offset: -6px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
&.micl-iconbutton--narrow {
|
|
100
|
+
height: calc(var(--md-sys-target-size) + 10px);
|
|
101
|
+
border-width: 10px;
|
|
102
|
+
border-radius: calc(var(--md-sys-target-size) / 2);
|
|
103
|
+
|
|
104
|
+
&:focus-visible {
|
|
105
|
+
outline-offset: -8px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
&.micl-iconbutton--wide {
|
|
109
|
+
width: calc(var(--md-sys-target-size) + 8px);
|
|
110
|
+
border-radius: calc(var(--md-sys-target-size) / 2);
|
|
111
|
+
|
|
112
|
+
&:focus-visible {
|
|
113
|
+
outline-offset: -6px;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
&.micl-button--square {
|
|
117
|
+
// border-radius: var(--md-sys-shape-corner-medium);
|
|
118
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
119
|
+
|
|
120
|
+
&.micl-button--toggle.micl-button--selected {
|
|
121
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button.micl-iconbutton-standard-s,
|
|
127
|
+
button.micl-iconbutton-filled-s,
|
|
128
|
+
button.micl-iconbutton-tonal-s,
|
|
129
|
+
button.micl-iconbutton-outlined-s {
|
|
130
|
+
width: var(--md-sys-target-size);
|
|
131
|
+
min-width: var(--md-sys-target-size);
|
|
132
|
+
height: var(--md-sys-target-size);
|
|
133
|
+
font-size: 24px;
|
|
134
|
+
border: 4px solid transparent;
|
|
135
|
+
background-clip: content-box;
|
|
136
|
+
|
|
137
|
+
&.micl-button--toggle.micl-button--selected {
|
|
138
|
+
// border-radius: var(--md-sys-shape-corner-medium);
|
|
139
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
140
|
+
}
|
|
141
|
+
&:not(:disabled) {
|
|
142
|
+
--miclripple: 1;
|
|
143
|
+
@include ripple.effect;
|
|
144
|
+
|
|
145
|
+
&:active {
|
|
146
|
+
// border-radius: var(--md-sys-shape-corner-small);
|
|
147
|
+
border-radius: var(--md-sys-shape-corner-medium);
|
|
148
|
+
}
|
|
149
|
+
&:focus-visible {
|
|
150
|
+
outline-offset: -2px;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
&.micl-iconbutton--narrow {
|
|
154
|
+
height: calc(var(--md-sys-target-size) + 8px);
|
|
155
|
+
border-width: 8px;
|
|
156
|
+
border-radius: calc(var(--md-sys-target-size) / 2);
|
|
157
|
+
|
|
158
|
+
&:focus-visible {
|
|
159
|
+
outline-offset: -6px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
&.micl-iconbutton--wide {
|
|
163
|
+
width: calc(var(--md-sys-target-size) + 12px);
|
|
164
|
+
border-radius: 26px;
|
|
165
|
+
|
|
166
|
+
&:focus-visible {
|
|
167
|
+
outline-offset: -2px;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
&.micl-button--square {
|
|
171
|
+
// border-radius: var(--md-sys-shape-corner-medium);
|
|
172
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
173
|
+
|
|
174
|
+
&.micl-button--toggle.micl-button--selected {
|
|
175
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
button.micl-iconbutton-standard-m,
|
|
181
|
+
button.micl-iconbutton-filled-m,
|
|
182
|
+
button.micl-iconbutton-tonal-m,
|
|
183
|
+
button.micl-iconbutton-outlined-m {
|
|
184
|
+
width: 56px;
|
|
185
|
+
min-width: 56px;
|
|
186
|
+
height: 56px;
|
|
187
|
+
font-size: 24px;
|
|
188
|
+
|
|
189
|
+
&.micl-button--toggle.micl-button--selected {
|
|
190
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
191
|
+
}
|
|
192
|
+
&:not(:disabled) {
|
|
193
|
+
--miclripple: 1;
|
|
194
|
+
@include ripple.effect;
|
|
195
|
+
|
|
196
|
+
&:active {
|
|
197
|
+
// border-radius: var(--md-sys-shape-corner-small);
|
|
198
|
+
border-radius: var(--md-sys-shape-corner-medium);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
&.micl-iconbutton--narrow {
|
|
202
|
+
width: var(--md-sys-target-size);
|
|
203
|
+
min-width: var(--md-sys-target-size);
|
|
204
|
+
border-radius: calc(var(--md-sys-target-size) / 2);
|
|
205
|
+
}
|
|
206
|
+
&.micl-iconbutton--wide {
|
|
207
|
+
width: 72px;
|
|
208
|
+
min-width: 72px;
|
|
209
|
+
border-radius: 36px;
|
|
210
|
+
}
|
|
211
|
+
&.micl-button--square {
|
|
212
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
213
|
+
|
|
214
|
+
&.micl-button--toggle.micl-button--selected {
|
|
215
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
button.micl-iconbutton-standard-l,
|
|
221
|
+
button.micl-iconbutton-filled-l,
|
|
222
|
+
button.micl-iconbutton-tonal-l,
|
|
223
|
+
button.micl-iconbutton-outlined-l {
|
|
224
|
+
width: 96px;
|
|
225
|
+
min-width: 96px;
|
|
226
|
+
height: 96px;
|
|
227
|
+
font-size: 32px;
|
|
228
|
+
|
|
229
|
+
&.micl-button--toggle.micl-button--selected {
|
|
230
|
+
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
231
|
+
}
|
|
232
|
+
&:not(:disabled) {
|
|
233
|
+
--miclripple: 1;
|
|
234
|
+
@include ripple.effect;
|
|
235
|
+
|
|
236
|
+
&:active {
|
|
237
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
&.micl-iconbutton--narrow {
|
|
241
|
+
width: 64px;
|
|
242
|
+
min-width: 64px;
|
|
243
|
+
border-radius: 32px;
|
|
244
|
+
}
|
|
245
|
+
&.micl-iconbutton--wide {
|
|
246
|
+
width: 128px;
|
|
247
|
+
min-width: 128px;
|
|
248
|
+
border-radius: 64px;
|
|
249
|
+
}
|
|
250
|
+
&.micl-button--square {
|
|
251
|
+
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
252
|
+
|
|
253
|
+
&.micl-button--toggle.micl-button--selected {
|
|
254
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
button.micl-iconbutton-standard-xl,
|
|
260
|
+
button.micl-iconbutton-filled-xl,
|
|
261
|
+
button.micl-iconbutton-tonal-xl,
|
|
262
|
+
button.micl-iconbutton-outlined-xl {
|
|
263
|
+
width: 136px;
|
|
264
|
+
min-width: 136px;
|
|
265
|
+
height: 136px;
|
|
266
|
+
font-size: 40px;
|
|
267
|
+
|
|
268
|
+
&.micl-button--toggle.micl-button--selected {
|
|
269
|
+
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
270
|
+
}
|
|
271
|
+
&:not(:disabled) {
|
|
272
|
+
--miclripple: 1;
|
|
273
|
+
@include ripple.effect;
|
|
274
|
+
|
|
275
|
+
&:active {
|
|
276
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
&.micl-iconbutton--narrow {
|
|
280
|
+
width: 104px;
|
|
281
|
+
min-width: 104px;
|
|
282
|
+
border-radius: 52px;
|
|
283
|
+
}
|
|
284
|
+
&.micl-iconbutton--wide {
|
|
285
|
+
width: 184px;
|
|
286
|
+
min-width: 184px;
|
|
287
|
+
border-radius: 92px;
|
|
288
|
+
}
|
|
289
|
+
&.micl-button--square {
|
|
290
|
+
border-radius: var(--md-sys-shape-corner-extra-large);
|
|
291
|
+
|
|
292
|
+
&.micl-button--toggle.micl-button--selected {
|
|
293
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
button.micl-iconbutton-standard-xs,
|
|
299
|
+
button.micl-iconbutton-standard-s,
|
|
300
|
+
button.micl-iconbutton-standard-m,
|
|
301
|
+
button.micl-iconbutton-standard-l,
|
|
302
|
+
button.micl-iconbutton-standard-xl {
|
|
303
|
+
&:not(:disabled) {
|
|
304
|
+
&.micl-button--toggle.micl-button--selected {
|
|
305
|
+
color: var(--md-sys-color-primary);
|
|
306
|
+
}
|
|
307
|
+
&:hover {
|
|
308
|
+
background-color: rgb(from var(--md-sys-color-on-surface-variant) r g b / var(--md-sys-state-hover-state-layer-opacity));
|
|
309
|
+
|
|
310
|
+
&.micl-button--toggle.micl-button--selected {
|
|
311
|
+
background-color: rgb(from var(--md-sys-color-primary) r g b / var(--md-sys-state-hover-state-layer-opacity));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
&:focus-visible {
|
|
315
|
+
background-color: rgb(from var(--md-sys-color-on-surface-variant) r g b / var(--md-sys-state-focus-state-layer-opacity));
|
|
316
|
+
|
|
317
|
+
&.micl-button--toggle.micl-button--selected {
|
|
318
|
+
background-color: rgb(from var(--md-sys-color-primary) r g b / var(--md-sys-state-focus-state-layer-opacity));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
&:active {
|
|
322
|
+
background-color: rgb(from var(--md-sys-color-on-surface-variant) r g b / var(--md-sys-state-pressed-state-layer-opacity));
|
|
323
|
+
|
|
324
|
+
&.micl-button--toggle.micl-button--selected {
|
|
325
|
+
background-color: rgb(from var(--md-sys-color-primary) r g b / var(--md-sys-state-pressed-state-layer-opacity));
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
button.micl-iconbutton-filled-xs,
|
|
333
|
+
button.micl-iconbutton-filled-s,
|
|
334
|
+
button.micl-iconbutton-filled-m,
|
|
335
|
+
button.micl-iconbutton-filled-l,
|
|
336
|
+
button.micl-iconbutton-filled-xl {
|
|
337
|
+
background-color: var(--md-sys-color-primary);
|
|
338
|
+
color: var(--md-sys-color-on-primary);
|
|
339
|
+
|
|
340
|
+
&:not(:disabled) {
|
|
341
|
+
&.micl-button--toggle:not(.micl-button--selected) {
|
|
342
|
+
background-color: var(--md-sys-color-surface-container);
|
|
343
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
344
|
+
}
|
|
345
|
+
&:hover {
|
|
346
|
+
background-color: color-mix(in srgb, var(--md-sys-color-primary), var(--md-sys-color-on-primary) var(--md-sys-state-hover-state-layer-opacity));
|
|
347
|
+
|
|
348
|
+
&.micl-button--toggle:not(.micl-button--selected) {
|
|
349
|
+
background-color: color-mix(in srgb, var(--md-sys-color-surface-container), var(--md-sys-color-on-surface-variant) var(--md-sys-state-hover-state-layer-opacity));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
&:focus-visible {
|
|
353
|
+
background-color: color-mix(in srgb, var(--md-sys-color-primary), var(--md-sys-color-on-primary) var(--md-sys-state-focus-state-layer-opacity));
|
|
354
|
+
|
|
355
|
+
&.micl-button--toggle:not(.micl-button--selected) {
|
|
356
|
+
background-color: color-mix(in srgb, var(--md-sys-color-surface-container), var(--md-sys-color-on-surface-variant) var(--md-sys-state-focus-state-layer-opacity));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
&:active {
|
|
360
|
+
background-color: color-mix(in srgb, var(--md-sys-color-primary), var(--md-sys-color-on-primary) var(--md-sys-state-pressed-state-layer-opacity));
|
|
361
|
+
|
|
362
|
+
&.micl-button--toggle:not(.micl-button--selected) {
|
|
363
|
+
background-color: color-mix(in srgb, var(--md-sys-color-surface-container), var(--md-sys-color-on-surface-variant) var(--md-sys-state-pressed-state-layer-opacity));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
button.micl-iconbutton-tonal-xs,
|
|
370
|
+
button.micl-iconbutton-tonal-s,
|
|
371
|
+
button.micl-iconbutton-tonal-m,
|
|
372
|
+
button.micl-iconbutton-tonal-l,
|
|
373
|
+
button.micl-iconbutton-tonal-xl {
|
|
374
|
+
background-color: var(--md-sys-color-secondary-container);
|
|
375
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
376
|
+
|
|
377
|
+
&:not(:disabled) {
|
|
378
|
+
&.micl-button--toggle.micl-button--selected {
|
|
379
|
+
background-color: var(--md-sys-color-secondary);
|
|
380
|
+
color: var(--md-sys-color-on-secondary);
|
|
381
|
+
}
|
|
382
|
+
&:hover {
|
|
383
|
+
background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) var(--md-sys-state-hover-state-layer-opacity));
|
|
384
|
+
|
|
385
|
+
&.micl-button--toggle.micl-button--selected {
|
|
386
|
+
background-color: color-mix(in srgb, var(--md-sys-color-secondary), var(--md-sys-color-on-secondary) var(--md-sys-state-hover-state-layer-opacity));
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
&:focus-visible {
|
|
390
|
+
background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) var(--md-sys-state-focus-state-layer-opacity));
|
|
391
|
+
|
|
392
|
+
&.micl-button--toggle.micl-button--selected {
|
|
393
|
+
background-color: color-mix(in srgb, var(--md-sys-color-secondary), var(--md-sys-color-on-secondary) var(--md-sys-state-focus-state-layer-opacity));
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
&:active {
|
|
397
|
+
background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) var(--md-sys-state-pressed-state-layer-opacity));
|
|
398
|
+
|
|
399
|
+
&.micl-button--toggle.micl-button--selected {
|
|
400
|
+
background-color: color-mix(in srgb, var(--md-sys-color-secondary), var(--md-sys-color-on-secondary) var(--md-sys-state-pressed-state-layer-opacity));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
button.micl-iconbutton-outlined-xs,
|
|
407
|
+
button.micl-iconbutton-outlined-s,
|
|
408
|
+
button.micl-iconbutton-outlined-m,
|
|
409
|
+
button.micl-iconbutton-outlined-l,
|
|
410
|
+
button.micl-iconbutton-outlined-xl {
|
|
411
|
+
background-color: transparent;
|
|
412
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
413
|
+
|
|
414
|
+
&.micl-iconbutton-outlined-xs,
|
|
415
|
+
&.micl-iconbutton-outlined-s {
|
|
416
|
+
// border-color: var(--md-sys-color-outline);
|
|
417
|
+
box-shadow: inset 1px 0px var(--md-sys-color-outline-variant),
|
|
418
|
+
inset -1px 0px var(--md-sys-color-outline-variant),
|
|
419
|
+
inset 0px -1px var(--md-sys-color-outline-variant),
|
|
420
|
+
inset 0px 1px var(--md-sys-color-outline-variant);
|
|
421
|
+
}
|
|
422
|
+
&.micl-iconbutton-outlined-m {
|
|
423
|
+
// border: 1px solid var(--md-sys-color-outline);
|
|
424
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
425
|
+
}
|
|
426
|
+
&.micl-iconbutton-outlined-l {
|
|
427
|
+
// border: 2px solid var(--md-sys-color-outline);
|
|
428
|
+
border: 2px solid var(--md-sys-color-outline-variant);
|
|
429
|
+
}
|
|
430
|
+
&.micl-iconbutton-outlined-xl {
|
|
431
|
+
// border: 3px solid var(--md-sys-color-outline);
|
|
432
|
+
border: 3px solid var(--md-sys-color-outline-variant);
|
|
433
|
+
}
|
|
434
|
+
&:not(:disabled) {
|
|
435
|
+
&.micl-button--toggle.micl-button--selected {
|
|
436
|
+
background-color: var(--md-sys-color-inverse-surface);
|
|
437
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
438
|
+
}
|
|
439
|
+
&:hover {
|
|
440
|
+
background-color: rgb(from var(--md-sys-color-on-surface-variant) r g b / var(--md-sys-state-hover-state-layer-opacity));
|
|
441
|
+
|
|
442
|
+
&.micl-button--toggle.micl-button--selected {
|
|
443
|
+
background-color: color-mix(in srgb, var(--md-sys-color-inverse-surface), var(--md-sys-color-inverse-on-surface) var(--md-sys-state-hover-state-layer-opacity));
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
&:focus-visible {
|
|
447
|
+
background-color: rgb(from var(--md-sys-color-on-surface-variant) r g b / var(--md-sys-state-focus-state-layer-opacity));
|
|
448
|
+
|
|
449
|
+
&.micl-button--toggle.micl-button--selected {
|
|
450
|
+
background-color: color-mix(in srgb, var(--md-sys-color-inverse-surface), var(--md-sys-color-inverse-on-surface) var(--md-sys-state-focus-state-layer-opacity));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
&:active {
|
|
454
|
+
background-color: rgb(from var(--md-sys-color-on-surface-variant) r g b / var(--md-sys-state-pressed-state-layer-opacity));
|
|
455
|
+
|
|
456
|
+
&.micl-button--toggle.micl-button--selected {
|
|
457
|
+
background-color: color-mix(in srgb, var(--md-sys-color-inverse-surface), var(--md-sys-color-inverse-on-surface) var(--md-sys-state-pressed-state-layer-opacity));
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2025 Hermana AS
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
// in the Software without restriction, including without limitation the rights
|
|
7
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
// furnished to do so, subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
// copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
// SOFTWARE.
|
|
21
|
+
|
|
22
|
+
export const buttonSelector = 'button[popovertarget],button.micl-button--toggle';
|
|
23
|
+
|
|
24
|
+
export default (() =>
|
|
25
|
+
{
|
|
26
|
+
const onClick = (event: Event) =>
|
|
27
|
+
{
|
|
28
|
+
if (!event.target || !(event.target instanceof HTMLButtonElement)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (event.target.popoverTargetElement instanceof HTMLDialogElement) {
|
|
32
|
+
if (event.target.popoverTargetElement.open) {
|
|
33
|
+
event.target.popoverTargetElement.close();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
event.target.popoverTargetElement.showModal();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (event.target.classList.contains('micl-button--toggle')) {
|
|
40
|
+
event.target.classList.toggle('micl-button--selected');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
initialize: (element: HTMLButtonElement) =>
|
|
46
|
+
{
|
|
47
|
+
if (
|
|
48
|
+
!element.matches('button[popovertarget],button.micl-button--toggle')
|
|
49
|
+
|| element.dataset.miclinitialized
|
|
50
|
+
) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
element.dataset.miclinitialized = '1';
|
|
54
|
+
|
|
55
|
+
if (
|
|
56
|
+
(element.popoverTargetElement instanceof HTMLDialogElement)
|
|
57
|
+
&& !element.popoverTargetElement.hasAttribute('popover')
|
|
58
|
+
) {
|
|
59
|
+
element.addEventListener('click', onClick);
|
|
60
|
+
}
|
|
61
|
+
else if (element.classList.contains('micl-button--toggle')) {
|
|
62
|
+
element.addEventListener('click', onClick);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
cleanup: (element: HTMLButtonElement) =>
|
|
66
|
+
{
|
|
67
|
+
if (element.matches('button[popovertarget],button.micl-button--toggle')) {
|
|
68
|
+
document.removeEventListener('click', onClick);
|
|
69
|
+
delete element.dataset.miclinitialized;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
})();
|