@rcarls/rc-theme-material 0.5.0 → 0.7.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/CHANGELOG.md +600 -0
- package/DESIGN.md +1399 -0
- package/README.md +138 -5
- package/bridge.css +150 -55
- package/components/accordion.css +43 -157
- package/components/adaptive-menu.css +123 -0
- package/components/app-bar.css +49 -7
- package/components/bottom-sheet.css +10 -7
- package/components/button.css +215 -2
- package/components/card.css +2 -0
- package/components/carousel.css +23 -0
- package/components/chip-group.css +15 -0
- package/components/chip.css +12 -1
- package/components/combobox.css +68 -14
- package/components/dialog.css +77 -15
- package/components/disclosure.css +128 -84
- package/components/field.css +566 -0
- package/components/icons.css +48 -6
- package/components/list-item.css +142 -32
- package/components/listbox.css +5 -4
- package/components/markdown-editor.css +62 -35
- package/components/menu-button.css +105 -1
- package/components/menu.css +32 -16
- package/components/menubar.css +4 -1
- package/components/modes.css +36 -17
- package/components/navigation-bar.css +3 -5
- package/components/navigation-rail.css +5 -7
- package/components/popover.css +50 -0
- package/components/progress.css +15 -0
- package/components/range-slider.css +8 -3
- package/components/scroller.css +7 -0
- package/components/search-bar.css +12 -2
- package/components/segmented-button.css +2 -28
- package/components/select.css +106 -14
- package/components/splitter.css +4 -1
- package/components/switch.css +9 -1
- package/components/textarea.css +13 -3
- package/components/toolbar.css +2 -1
- package/components/tooltip.css +12 -0
- package/components/transfer-list.css +5 -1
- package/components/virtual-canvas.css +4 -1
- package/components/virtual-scroller.css +7 -0
- package/components.css +11 -1
- package/constraints/material.json +99 -0
- package/css-components/button.css +66 -0
- package/css-components/card.css +14 -0
- package/css-components/chip-group.css +9 -0
- package/css-components/chip.css +80 -0
- package/css-components/disclosure.css +25 -0
- package/css-components/list.css +34 -0
- package/css-components/select.css +20 -0
- package/css-components/textarea.css +22 -0
- package/css-components.css +31 -0
- package/defaults.css +329 -14
- package/native.css +258 -0
- package/package.json +21 -2
- package/state-layer.css +5 -1
package/components/button.css
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
--rc-button-hover-state-layer-opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
|
|
17
17
|
--rc-button-focus-state-layer-opacity: var(--md-sys-state-focus-state-layer-opacity, 0.12);
|
|
18
18
|
--rc-button-pressed-state-layer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
|
|
19
|
+
--rc-button-state-layer-duration: var(--rc-motion-effects-duration-fast, 150ms);
|
|
19
20
|
--rc-button-state-layer-easing: var(
|
|
20
21
|
--md-sys-motion-easing-standard,
|
|
21
22
|
cubic-bezier(0.2, 0, 0, 1)
|
|
@@ -23,12 +24,104 @@
|
|
|
23
24
|
--_rc-button-ripple-enabled: 1;
|
|
24
25
|
--_rc-button-ripple-color: var(--md-sys-color-on-primary, currentColor);
|
|
25
26
|
--_rc-button-ripple-opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
|
|
26
|
-
--_rc-button-ripple-duration: var(--
|
|
27
|
+
--_rc-button-ripple-duration: var(--rc-motion-spatial-duration-slow, 500ms);
|
|
27
28
|
--_rc-button-ripple-easing: var(
|
|
28
29
|
--md-sys-motion-easing-emphasized-decelerate,
|
|
29
30
|
cubic-bezier(0.05, 0.7, 0.1, 1)
|
|
30
31
|
);
|
|
31
32
|
--rc-button-progress-color: var(--md-sys-color-on-primary, ButtonText);
|
|
33
|
+
--rc-button-disabled-opacity: var(--rc-disabled-opacity, 0.38);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--tonal {
|
|
37
|
+
--rc-button-bg: var(--md-sys-color-secondary-container, ButtonFace);
|
|
38
|
+
--rc-button-color: var(--md-sys-color-on-secondary-container, ButtonText);
|
|
39
|
+
--rc-button-state-layer-bg: var(--md-sys-color-on-secondary-container, currentColor);
|
|
40
|
+
--_rc-button-ripple-color: var(--md-sys-color-on-secondary-container, currentColor);
|
|
41
|
+
--rc-button-progress-color: var(--md-sys-color-on-secondary-container, ButtonText);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--outlined {
|
|
45
|
+
--rc-button-bg: transparent;
|
|
46
|
+
--rc-button-color: var(--md-sys-color-primary, ButtonText);
|
|
47
|
+
--rc-button-border: 1px solid var(--md-sys-color-outline, ButtonBorder);
|
|
48
|
+
--rc-button-state-layer-bg: var(--md-sys-color-primary, currentColor);
|
|
49
|
+
--_rc-button-ripple-color: var(--md-sys-color-primary, currentColor);
|
|
50
|
+
--rc-button-progress-color: var(--md-sys-color-primary, ButtonText);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--text {
|
|
54
|
+
--rc-button-bg: transparent;
|
|
55
|
+
--rc-button-color: var(--md-sys-color-primary, ButtonText);
|
|
56
|
+
--rc-button-border: 0;
|
|
57
|
+
--rc-button-padding-inline: 0.75rem;
|
|
58
|
+
--rc-button-state-layer-bg: var(--md-sys-color-primary, currentColor);
|
|
59
|
+
--_rc-button-ripple-color: var(--md-sys-color-primary, currentColor);
|
|
60
|
+
--rc-button-progress-color: var(--md-sys-color-primary, ButtonText);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
64
|
+
rc-button.rc-icon-button--standard[icon-only] {
|
|
65
|
+
--rc-button-bg: transparent;
|
|
66
|
+
--rc-button-color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
67
|
+
--rc-button-border: 0;
|
|
68
|
+
--rc-button-state-layer-bg: var(--md-sys-color-on-surface-variant, currentColor);
|
|
69
|
+
--_rc-button-ripple-color: var(--md-sys-color-on-surface-variant, currentColor);
|
|
70
|
+
--rc-button-progress-color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-icon-button--tonal[icon-only] {
|
|
74
|
+
--rc-button-bg: var(--md-sys-color-secondary-container, ButtonFace);
|
|
75
|
+
--rc-button-color: var(--md-sys-color-on-secondary-container, ButtonText);
|
|
76
|
+
--rc-button-state-layer-bg: var(--md-sys-color-on-secondary-container, currentColor);
|
|
77
|
+
--_rc-button-ripple-color: var(--md-sys-color-on-secondary-container, currentColor);
|
|
78
|
+
--rc-button-progress-color: var(--md-sys-color-on-secondary-container, ButtonText);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
82
|
+
rc-button.rc-icon-button--outlined[icon-only] {
|
|
83
|
+
--rc-button-bg: transparent;
|
|
84
|
+
--rc-button-color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
85
|
+
--rc-button-border: 1px solid var(--md-sys-color-outline, ButtonBorder);
|
|
86
|
+
--rc-button-state-layer-bg: var(--md-sys-color-on-surface-variant, currentColor);
|
|
87
|
+
--_rc-button-ripple-color: var(--md-sys-color-on-surface-variant, currentColor);
|
|
88
|
+
--rc-button-progress-color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button[data-tone='danger'] {
|
|
92
|
+
--rc-button-bg: var(--md-sys-color-error, ButtonFace);
|
|
93
|
+
--rc-button-color: var(--md-sys-color-on-error, ButtonText);
|
|
94
|
+
--rc-button-state-layer-bg: var(--md-sys-color-on-error, currentColor);
|
|
95
|
+
--_rc-button-ripple-color: var(--md-sys-color-on-error, currentColor);
|
|
96
|
+
--rc-button-progress-color: var(--md-sys-color-on-error, ButtonText);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
100
|
+
rc-button:is(
|
|
101
|
+
.rc-button--tonal,
|
|
102
|
+
.rc-button--outlined,
|
|
103
|
+
.rc-button--text,
|
|
104
|
+
.rc-icon-button--standard,
|
|
105
|
+
.rc-icon-button--tonal,
|
|
106
|
+
.rc-icon-button--outlined
|
|
107
|
+
)[data-tone='danger'] {
|
|
108
|
+
--rc-button-bg: transparent;
|
|
109
|
+
--rc-button-color: var(--md-sys-color-error, ButtonText);
|
|
110
|
+
--rc-button-state-layer-bg: var(--md-sys-color-error, currentColor);
|
|
111
|
+
--_rc-button-ripple-color: var(--md-sys-color-error, currentColor);
|
|
112
|
+
--rc-button-progress-color: var(--md-sys-color-error, ButtonText);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
116
|
+
rc-button:is(.rc-button--tonal, .rc-icon-button--tonal)[data-tone='danger'] {
|
|
117
|
+
--rc-button-bg: var(--md-sys-color-error-container, ButtonFace);
|
|
118
|
+
--rc-button-color: var(--md-sys-color-on-error-container, ButtonText);
|
|
119
|
+
--rc-button-state-layer-bg: var(--md-sys-color-on-error-container, currentColor);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
123
|
+
rc-button:is(.rc-button--outlined, .rc-icon-button--outlined)[data-tone='danger'] {
|
|
124
|
+
--rc-button-border: 1px solid var(--md-sys-color-error, ButtonBorder);
|
|
32
125
|
}
|
|
33
126
|
|
|
34
127
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button > button:focus-visible {
|
|
@@ -51,7 +144,127 @@
|
|
|
51
144
|
}
|
|
52
145
|
|
|
53
146
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button[icon-only] {
|
|
147
|
+
/* MD3 expressive "Small" icon button (the default/unmodified size): a
|
|
148
|
+
40dp square container around a 24dp icon. rc-button's own touch-target
|
|
149
|
+
affordance (min-inline/block-size 3rem, plus the light-DOM hit-slop)
|
|
150
|
+
makes up the difference to the 48dp minimum tap target on its own; no
|
|
151
|
+
theme-level override is needed for that here. */
|
|
152
|
+
--rc-button-icon-size: 2.5rem;
|
|
153
|
+
--rc-icon-button-icon-font-size: 1.5rem;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/*
|
|
157
|
+
* MD3 expressive icon-button sizes. Each sets both the square container
|
|
158
|
+
* (`--rc-button-block-size`/`--rc-button-icon-size`, since `icon-only`'s
|
|
159
|
+
* default width equals its height) and the icon glyph size together, so
|
|
160
|
+
* the two stay in the spec's fixed ratio instead of drifting independently.
|
|
161
|
+
* Values: https://m3.material.io/components/icon-buttons/specs (container
|
|
162
|
+
* height / icon size, dp): extra-small 32/20, small 40/24 (above, default),
|
|
163
|
+
* medium 56/24, large 96/32, extra-large 136/40.
|
|
164
|
+
*/
|
|
165
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
166
|
+
rc-button.rc-button--extra-small[icon-only] {
|
|
167
|
+
--rc-button-block-size: 2rem;
|
|
168
|
+
--rc-button-icon-size: 2rem;
|
|
169
|
+
--rc-icon-button-icon-font-size: 1.25rem;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--medium[icon-only] {
|
|
173
|
+
--rc-button-block-size: 3.5rem;
|
|
174
|
+
--rc-button-icon-size: 3.5rem;
|
|
175
|
+
--rc-icon-button-icon-font-size: 1.5rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--large[icon-only] {
|
|
179
|
+
--rc-button-block-size: 6rem;
|
|
180
|
+
--rc-button-icon-size: 6rem;
|
|
181
|
+
--rc-icon-button-icon-font-size: 2rem;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
185
|
+
rc-button.rc-button--extra-large[icon-only] {
|
|
186
|
+
--rc-button-block-size: 8.5rem;
|
|
187
|
+
--rc-button-icon-size: 8.5rem;
|
|
188
|
+
--rc-icon-button-icon-font-size: 2.5rem;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/*
|
|
192
|
+
* Width variants change only the container's inline size; block size (and
|
|
193
|
+
* the icon itself) stay governed by the size class above, or the default
|
|
194
|
+
* "small" size when none is present. `narrow` suits dense/overflow
|
|
195
|
+
* contexts (an app bar's trailing overflow trigger); `wide` suits roomier
|
|
196
|
+
* toolbars that can spare the extra tap-friendly width. Per-size pairing
|
|
197
|
+
* is required because each size's narrow/wide delta is a fixed spec value,
|
|
198
|
+
* not a proportional one.
|
|
199
|
+
*/
|
|
200
|
+
/*
|
|
201
|
+
* The overlap tokens below give back exactly what --rc-button-icon-size
|
|
202
|
+
* leaves unclaimed of the 3rem default touch target ((3rem - icon-size) /
|
|
203
|
+
* 2, matching the button's own centered inflation) -- the narrow variant's
|
|
204
|
+
* documented reason for existing is dense/edge contexts, so this is a
|
|
205
|
+
* default here, not left for every consumer to compute and set
|
|
206
|
+
* individually. Trailing-edge only: narrow's own doc comment names an app
|
|
207
|
+
* bar's *trailing* overflow trigger as the canonical case, and defaulting
|
|
208
|
+
* only one side halves the risk of two adjacent narrow buttons' touch
|
|
209
|
+
* targets colliding if a consumer places one where it does have a real
|
|
210
|
+
* neighbor. Medium/large/extra-large narrow variants already meet or
|
|
211
|
+
* exceed the touch target on their own (see each size's own comment
|
|
212
|
+
* above), so they need no overlap default here.
|
|
213
|
+
*/
|
|
214
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
215
|
+
rc-button.rc-button--extra-small.rc-button--narrow[icon-only] {
|
|
216
|
+
--rc-button-icon-size: 1.75rem;
|
|
217
|
+
--rc-button-touch-target-overlap-inline-end: 0.625rem;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
221
|
+
rc-button.rc-button--extra-small.rc-button--wide[icon-only] {
|
|
54
222
|
--rc-button-icon-size: 2.5rem;
|
|
55
|
-
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--narrow[icon-only] {
|
|
226
|
+
--rc-button-icon-size: 2rem;
|
|
227
|
+
--rc-button-touch-target-overlap-inline-end: 0.5rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-button.rc-button--wide[icon-only] {
|
|
231
|
+
--rc-button-icon-size: 3.25rem;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
235
|
+
rc-button.rc-button--medium.rc-button--narrow[icon-only] {
|
|
236
|
+
--rc-button-icon-size: 3rem;
|
|
237
|
+
/* Already meets the 3rem default touch target on its own; the bare
|
|
238
|
+
.rc-button--narrow[icon-only] rule's overlap default still matches
|
|
239
|
+
here too (class selectors don't exclude each other), so it needs an
|
|
240
|
+
explicit reset. */
|
|
241
|
+
--rc-button-touch-target-overlap-inline-end: 0px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
245
|
+
rc-button.rc-button--medium.rc-button--wide[icon-only] {
|
|
246
|
+
--rc-button-icon-size: 4.5rem;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
250
|
+
rc-button.rc-button--large.rc-button--narrow[icon-only] {
|
|
251
|
+
--rc-button-icon-size: 4rem;
|
|
252
|
+
--rc-button-touch-target-overlap-inline-end: 0px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
256
|
+
rc-button.rc-button--large.rc-button--wide[icon-only] {
|
|
257
|
+
--rc-button-icon-size: 8rem;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
261
|
+
rc-button.rc-button--extra-large.rc-button--narrow[icon-only] {
|
|
262
|
+
--rc-button-icon-size: 6.5rem;
|
|
263
|
+
--rc-button-touch-target-overlap-inline-end: 0px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
267
|
+
rc-button.rc-button--extra-large.rc-button--wide[icon-only] {
|
|
268
|
+
--rc-button-icon-size: 11.5rem;
|
|
56
269
|
}
|
|
57
270
|
}
|
package/components/card.css
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
--rc-card-state-layer-bg: var(--md-sys-color-on-surface, currentColor);
|
|
22
22
|
--rc-card-hover-state-layer-opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
|
|
23
23
|
--rc-card-pressed-state-layer-opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
|
|
24
|
+
--rc-card-state-layer-duration: var(--rc-motion-effects-duration-fast, 150ms);
|
|
25
|
+
--rc-card-state-layer-easing: var(--md-sys-motion-easing-standard, ease);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-card[selected] {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-carousel {
|
|
3
|
+
--rc-carousel-color: var(--md-sys-color-on-surface, CanvasText);
|
|
4
|
+
--rc-carousel-navigation-button-background: color-mix(
|
|
5
|
+
in srgb,
|
|
6
|
+
var(--md-sys-color-surface, Canvas) 75%,
|
|
7
|
+
transparent
|
|
8
|
+
);
|
|
9
|
+
--rc-carousel-navigation-button-color: var(--md-sys-color-on-surface, CanvasText);
|
|
10
|
+
--rc-carousel-pagination-item-color: color-mix(
|
|
11
|
+
in srgb,
|
|
12
|
+
var(--md-sys-color-on-surface, CanvasText) 40%,
|
|
13
|
+
transparent
|
|
14
|
+
);
|
|
15
|
+
--rc-carousel-pagination-item-active-color: var(--md-sys-color-primary, Highlight);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-carousel-item {
|
|
19
|
+
--rc-carousel-item-color: var(--md-sys-color-on-surface, CanvasText);
|
|
20
|
+
--rc-carousel-item-background: var(--md-sys-color-surface-container, Canvas);
|
|
21
|
+
--rc-carousel-item-border-radius: var(--md-sys-shape-corner-extra-large, 28px);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-chip-group {
|
|
3
|
+
--rc-chip-group-column-gap: 0.5rem;
|
|
4
|
+
--rc-chip-group-row-gap: 0;
|
|
5
|
+
--rc-chip-group-padding-block: 0;
|
|
6
|
+
--rc-chip-group-scroll-padding-inline: 0;
|
|
7
|
+
--rc-chip-group-scrollbar-width: none;
|
|
8
|
+
--rc-chip-group-toggle-gap: 0.5rem;
|
|
9
|
+
--rc-chip-group-toggle-separator-gap: 0.5rem;
|
|
10
|
+
--rc-chip-group-toggle-icon-size: 1.125rem;
|
|
11
|
+
--rc-chip-group-toggle-separator-block-size: 1.5rem;
|
|
12
|
+
--rc-chip-group-toggle-separator-inline-size: 1px;
|
|
13
|
+
--rc-chip-group-toggle-separator-color: var(--md-sys-color-outline-variant, currentColor);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/components/chip.css
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
--rc-chip-block-size: 2rem;
|
|
4
4
|
--rc-chip-gap: 0px;
|
|
5
5
|
--rc-chip-padding-inline: 1rem;
|
|
6
|
+
--rc-chip-padding-inline-start: var(--rc-chip-padding-inline);
|
|
7
|
+
--rc-chip-padding-inline-end: var(--rc-chip-padding-inline);
|
|
6
8
|
--rc-chip-border: 1px solid var(--md-sys-color-outline, ButtonBorder);
|
|
7
9
|
--rc-chip-radius: var(--md-sys-shape-corner-small, 0.5rem);
|
|
8
10
|
--rc-chip-bg: var(--md-sys-color-surface-container-low, ButtonFace);
|
|
9
11
|
--rc-chip-color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
10
|
-
--rc-chip-font:
|
|
12
|
+
--rc-chip-font: var(--md-sys-typescale-label-large-weight, 500)
|
|
13
|
+
var(--md-sys-typescale-label-large-size, 0.875rem) /
|
|
14
|
+
var(--md-sys-typescale-label-large-line-height, 1.25rem)
|
|
15
|
+
var(--md-sys-typescale-label-large-font, inherit);
|
|
16
|
+
--rc-chip-padding-block: 0;
|
|
11
17
|
--rc-chip-text-decoration: none;
|
|
12
18
|
--rc-chip-selected-border-color: transparent;
|
|
13
19
|
--rc-chip-selected-bg: var(--md-sys-color-secondary-container, Highlight);
|
|
@@ -25,4 +31,9 @@
|
|
|
25
31
|
--rc-chip-remove-target-size: 1.5rem;
|
|
26
32
|
--rc-chip-remove-offset-inline: 0.25rem;
|
|
27
33
|
}
|
|
34
|
+
|
|
35
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-chip:has([data-rc-chip-icon]) {
|
|
36
|
+
--rc-chip-gap: 0.5rem;
|
|
37
|
+
--rc-chip-padding-inline-start: 0.5rem;
|
|
38
|
+
}
|
|
28
39
|
}
|
package/components/combobox.css
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(anchor) {
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
transition:
|
|
5
|
-
border-color 150ms
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
border-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
6
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
7
|
+
box-shadow var(--rc-motion-effects-duration-fast, 150ms)
|
|
8
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
9
|
+
background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
10
|
+
var(--rc-motion-effects-easing-fast, ease);
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(anchor):hover {
|
|
@@ -28,6 +31,27 @@
|
|
|
28
31
|
color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(chips) {
|
|
35
|
+
--rc-chip-block-size: 2rem;
|
|
36
|
+
--rc-chip-touch-target-block-size: 3rem;
|
|
37
|
+
--rc-chip-radius: var(--md-sys-shape-corner-small, 0.5rem);
|
|
38
|
+
--rc-chip-remove-target-size: 1.5rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* Dense chips fit one chip row on the field's single input line, so a
|
|
43
|
+
* populated field keeps the unified 56px height. The touch target is
|
|
44
|
+
* unchanged.
|
|
45
|
+
*/
|
|
46
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
47
|
+
rc-combobox.rc-combobox--dense::part(chips) {
|
|
48
|
+
--rc-chip-block-size: 1.5rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox.rc-combobox--dense::part(chip) {
|
|
52
|
+
min-block-size: 1.5rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
31
55
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(toggle) {
|
|
32
56
|
border-radius: var(--md-sys-shape-corner-full, 999px);
|
|
33
57
|
color: var(
|
|
@@ -35,8 +59,9 @@
|
|
|
35
59
|
var(--md-sys-color-on-surface-variant, CanvasText)
|
|
36
60
|
);
|
|
37
61
|
transition:
|
|
38
|
-
color 150ms ease,
|
|
39
|
-
background-color 150ms
|
|
62
|
+
color var(--rc-motion-effects-duration-fast, 150ms) var(--rc-motion-effects-easing-fast, ease),
|
|
63
|
+
background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
64
|
+
var(--rc-motion-effects-easing-fast, ease);
|
|
40
65
|
}
|
|
41
66
|
|
|
42
67
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(toggle):hover {
|
|
@@ -59,26 +84,55 @@
|
|
|
59
84
|
color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
60
85
|
}
|
|
61
86
|
|
|
87
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
88
|
+
rc-combobox[popup-mode='dialog']::part(dialog-search) {
|
|
89
|
+
color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
90
|
+
font-family: var(--md-sys-typescale-label-medium-font, inherit);
|
|
91
|
+
font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
|
|
92
|
+
line-height: var(--md-sys-typescale-label-medium-line-height, 1rem);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
96
|
+
rc-combobox[popup-mode='dialog']::part(dialog-input) {
|
|
97
|
+
min-block-size: 3.5rem;
|
|
98
|
+
padding-inline: 1rem;
|
|
99
|
+
border: 1px solid var(--md-sys-color-outline, ButtonBorder);
|
|
100
|
+
border-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
101
|
+
background: transparent;
|
|
102
|
+
color: var(--md-sys-color-on-surface, FieldText);
|
|
103
|
+
font-family: var(--md-sys-typescale-body-large-font, inherit);
|
|
104
|
+
font-size: var(--md-sys-typescale-body-large-size, 1rem);
|
|
105
|
+
line-height: var(--md-sys-typescale-body-large-line-height, 1.5rem);
|
|
106
|
+
|
|
107
|
+
&:focus-visible {
|
|
108
|
+
border-color: var(--md-sys-color-primary, Highlight);
|
|
109
|
+
box-shadow: inset 0 0 0 1px var(--md-sys-color-primary, Highlight);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
114
|
+
rc-combobox[popup-mode='dialog']::part(dialog-listbox) {
|
|
115
|
+
min-block-size: 0;
|
|
116
|
+
padding-block: 0;
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
background: transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
62
121
|
/*
|
|
63
122
|
* Propagate Material styles to the embedded rc-listbox host. rc-listbox renders
|
|
64
123
|
* options into its own light DOM inside rc-combobox's shadow root, so inherited
|
|
65
124
|
* custom properties are the stable styling contract for option rows.
|
|
66
125
|
*/
|
|
67
126
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-combobox::part(listbox) {
|
|
68
|
-
background: var(--md-menu-container-color, var(--md-sys-color-surface-container, Canvas));
|
|
69
|
-
color: var(--md-sys-color-on-surface, CanvasText);
|
|
70
|
-
font-family: var(--md-sys-typescale-body-large-font, inherit);
|
|
71
|
-
font-size: var(--md-sys-typescale-body-large-size, 1rem);
|
|
72
|
-
line-height: var(--md-sys-typescale-body-large-line-height, 1.5rem);
|
|
73
|
-
padding-block: 0.5rem;
|
|
74
|
-
border-radius: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 0.25rem));
|
|
75
|
-
|
|
76
127
|
/* Option sizing */
|
|
77
128
|
--rc-listbox-option-gap: var(--rc-list-item-gap, 0.75rem);
|
|
78
129
|
--rc-listbox-option-min-block-size: 3rem;
|
|
79
130
|
--rc-listbox-option-padding-block: 0;
|
|
80
131
|
--rc-listbox-option-padding-inline: 0.75rem;
|
|
81
|
-
--rc-listbox-option-transition:
|
|
132
|
+
--rc-listbox-option-transition:
|
|
133
|
+
background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
134
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
135
|
+
color var(--rc-motion-effects-duration-fast, 150ms) var(--rc-motion-effects-easing-fast, ease);
|
|
82
136
|
|
|
83
137
|
/* M3 hover state layer (8% on-surface) instead of secondary-container */
|
|
84
138
|
--rc-highlight: color-mix(in srgb, var(--md-sys-color-on-surface, CanvasText) 8%, transparent);
|
package/components/dialog.css
CHANGED
|
@@ -1,26 +1,88 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
/*
|
|
3
|
+
* Maps Material tokens onto the public rc-dialog properties. The surface and
|
|
4
|
+
* the fullscreen geometry are drawn by the component's own light-DOM base
|
|
5
|
+
* layer, including the explicit block bound and overflow that keep a tall
|
|
6
|
+
* dialog's corners clipping correctly in Chromium.
|
|
7
|
+
*/
|
|
8
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-dialog {
|
|
9
|
+
--rc-dialog-min-inline-size: min(17.5rem, calc(100vw - 3rem));
|
|
10
|
+
--rc-dialog-max-inline-size: min(35rem, calc(100vw - 3rem));
|
|
11
|
+
--rc-dialog-max-block-size: calc(100dvh - 3rem);
|
|
12
|
+
--rc-dialog-padding: 1.5rem;
|
|
13
|
+
--rc-dialog-border: 0;
|
|
14
|
+
--rc-dialog-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
|
|
15
|
+
--rc-dialog-background: var(--md-sys-color-surface-container-high, Canvas);
|
|
16
|
+
--rc-dialog-color: var(--md-sys-color-on-surface, CanvasText);
|
|
17
|
+
--rc-dialog-shadow: var(--rc-shadow-level3, var(--rc-shadow, none));
|
|
18
|
+
--rc-dialog-scrim: color-mix(in srgb, var(--md-sys-color-scrim, #000) 32%, transparent);
|
|
19
|
+
|
|
20
|
+
/* Material 3 full-screen dialog: the page surface, like its top app bar. */
|
|
21
|
+
--rc-dialog-fullscreen-background: var(--md-sys-color-surface, Canvas);
|
|
22
|
+
|
|
23
|
+
/* Material 3 modal side sheet: a low container at level 1, rounded on its leading edge. */
|
|
24
|
+
--rc-dialog-side-background: var(--md-sys-color-surface-container-low, Canvas);
|
|
25
|
+
--rc-dialog-side-radius: var(--md-sys-shape-corner-large, 1rem);
|
|
26
|
+
--rc-dialog-side-shadow: var(--rc-shadow-level1, var(--rc-shadow, none));
|
|
11
27
|
}
|
|
12
28
|
|
|
13
|
-
:where(.rc-theme-material, :host(.rc-theme-material)) rc-dialog > dialog
|
|
14
|
-
|
|
15
|
-
--rc-dialog-scrim,
|
|
16
|
-
color-mix(in srgb, var(--md-sys-color-scrim, #000) 32%, transparent)
|
|
17
|
-
);
|
|
29
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-dialog > dialog {
|
|
30
|
+
font-family: var(--md-sys-typescale-body-medium-font, inherit);
|
|
18
31
|
}
|
|
19
32
|
|
|
33
|
+
/*
|
|
34
|
+
* Fallback styling for plain, unwrapped buttons in dialog content or
|
|
35
|
+
* actions. Descendants of a defined custom element are excluded because
|
|
36
|
+
* that wrapper owns its native control's presentation. The :where() list
|
|
37
|
+
* identifies native grouping elements that commonly organize dialog
|
|
38
|
+
* content; unlike autonomous custom elements, they should not suppress
|
|
39
|
+
* the fallback treatment.
|
|
40
|
+
*/
|
|
20
41
|
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
21
42
|
rc-dialog
|
|
22
43
|
> dialog
|
|
23
|
-
:is(button, [role='button'])
|
|
44
|
+
:is(button, [role='button']):not(
|
|
45
|
+
rc-dialog
|
|
46
|
+
> dialog
|
|
47
|
+
:defined:not(
|
|
48
|
+
:where(
|
|
49
|
+
address,
|
|
50
|
+
article,
|
|
51
|
+
aside,
|
|
52
|
+
blockquote,
|
|
53
|
+
dd,
|
|
54
|
+
details,
|
|
55
|
+
div,
|
|
56
|
+
dl,
|
|
57
|
+
dt,
|
|
58
|
+
fieldset,
|
|
59
|
+
figcaption,
|
|
60
|
+
figure,
|
|
61
|
+
footer,
|
|
62
|
+
form,
|
|
63
|
+
header,
|
|
64
|
+
hgroup,
|
|
65
|
+
li,
|
|
66
|
+
main,
|
|
67
|
+
menu,
|
|
68
|
+
nav,
|
|
69
|
+
ol,
|
|
70
|
+
p,
|
|
71
|
+
search,
|
|
72
|
+
section,
|
|
73
|
+
span,
|
|
74
|
+
table,
|
|
75
|
+
tbody,
|
|
76
|
+
td,
|
|
77
|
+
tfoot,
|
|
78
|
+
th,
|
|
79
|
+
thead,
|
|
80
|
+
tr,
|
|
81
|
+
ul
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
*
|
|
85
|
+
) {
|
|
24
86
|
min-block-size: 2.5rem;
|
|
25
87
|
padding-inline: 1.5rem;
|
|
26
88
|
border: 0;
|