@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
/*
|
|
3
|
+
* The surface color, text color, and border come from the bridge's
|
|
4
|
+
* --rc-popup-* tokens. Only the popover's own corner and elevation differ
|
|
5
|
+
* from a menu container. Declared on the theme root so popovers rendered
|
|
6
|
+
* inside other shadow roots inherit the same values.
|
|
7
|
+
*/
|
|
8
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) {
|
|
9
|
+
--rc-popover-radius: var(--md-sys-shape-corner-medium, 0.75rem);
|
|
10
|
+
--rc-popover-shadow: var(--rc-shadow-level2, none);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-popover[data-rc-material-rich-tooltip] {
|
|
14
|
+
--rc-popover-max-inline-size: min(20rem, 100dvi - 1rem);
|
|
15
|
+
--rc-popover-padding-block: 0.75rem;
|
|
16
|
+
--rc-popover-padding-inline: 1rem;
|
|
17
|
+
--rc-popover-color: var(--md-sys-color-on-surface-variant, CanvasText);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
21
|
+
rc-popover[data-rc-material-rich-tooltip]
|
|
22
|
+
> [slot='content']
|
|
23
|
+
> h2 {
|
|
24
|
+
margin: 0 0 0.25rem;
|
|
25
|
+
color: var(--md-sys-color-on-surface, CanvasText);
|
|
26
|
+
font-family: var(--md-sys-typescale-title-small-font, inherit);
|
|
27
|
+
font-size: var(--md-sys-typescale-title-small-size, 0.875rem);
|
|
28
|
+
font-weight: var(--md-sys-typescale-title-small-weight, 500);
|
|
29
|
+
line-height: var(--md-sys-typescale-title-small-line-height, 1.25rem);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
33
|
+
rc-popover[data-rc-material-rich-tooltip]
|
|
34
|
+
> [slot='content']
|
|
35
|
+
> p {
|
|
36
|
+
margin: 0;
|
|
37
|
+
font-family: var(--md-sys-typescale-body-medium-font, inherit);
|
|
38
|
+
font-size: var(--md-sys-typescale-body-medium-size, 0.875rem);
|
|
39
|
+
line-height: var(--md-sys-typescale-body-medium-line-height, 1.25rem);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
43
|
+
rc-popover[data-rc-material-rich-tooltip]
|
|
44
|
+
> [slot='content']
|
|
45
|
+
> footer {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
margin-block-start: 0.75rem;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-progress::part(value-display) {
|
|
3
|
+
color: var(--md-sys-color-on-surface-variant, GrayText);
|
|
4
|
+
font-size: var(--md-sys-typescale-label-small-size, 0.75rem);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-progress[disabled] {
|
|
8
|
+
opacity: var(--md-sys-state-disabled-state-layer-opacity, 0.38);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-progress {
|
|
12
|
+
--rc-progress-fill-transition-duration: var(--rc-motion-effects-duration-fast, 150ms);
|
|
13
|
+
--rc-progress-fill-transition-easing: var(--rc-motion-effects-easing-fast, ease-out);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -3,15 +3,20 @@
|
|
|
3
3
|
border-width: 0;
|
|
4
4
|
border-radius: var(--md-sys-shape-corner-full, 999px);
|
|
5
5
|
box-shadow: 0 0 0 0 transparent;
|
|
6
|
-
transition:
|
|
6
|
+
transition:
|
|
7
|
+
box-shadow var(--rc-motion-effects-duration-fast, 150ms)
|
|
8
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
9
|
+
scale var(--rc-motion-spatial-duration-fast, 300ms) var(--rc-motion-spatial-easing-fast, ease);
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-range-slider::part(thumb):hover {
|
|
10
|
-
box-shadow: 0 0 0 0.5rem
|
|
13
|
+
box-shadow: 0 0 0 0.5rem
|
|
14
|
+
color-mix(in srgb, var(--md-sys-color-primary, Highlight) 8%, transparent);
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-range-slider::part(thumb):active {
|
|
14
|
-
box-shadow: 0 0 0 0.625rem
|
|
18
|
+
box-shadow: 0 0 0 0.625rem
|
|
19
|
+
color-mix(in srgb, var(--md-sys-color-primary, Highlight) 12%, transparent);
|
|
15
20
|
scale: 0.9;
|
|
16
21
|
}
|
|
17
22
|
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-search-bar {
|
|
3
|
+
/*
|
|
4
|
+
* The bar is already the full-height field, so the shared outset ring
|
|
5
|
+
* floats off its edge and crowds the app bar. Draw it on the edge instead.
|
|
6
|
+
*/
|
|
7
|
+
--rc-focus-ring-offset: -2px;
|
|
8
|
+
}
|
|
9
|
+
|
|
2
10
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-search-bar::part(root) {
|
|
3
11
|
box-sizing: border-box;
|
|
4
12
|
transition:
|
|
5
|
-
box-shadow 200ms
|
|
6
|
-
|
|
13
|
+
box-shadow var(--rc-motion-effects-duration-default, 200ms)
|
|
14
|
+
var(--rc-motion-effects-easing-default, ease),
|
|
15
|
+
background-color var(--rc-motion-effects-duration-default, 200ms)
|
|
16
|
+
var(--rc-motion-effects-easing-default, ease);
|
|
7
17
|
}
|
|
8
18
|
|
|
9
19
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-search-bar:hover::part(root) {
|
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
2
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-segmented-button {
|
|
3
|
-
|
|
4
|
-
--
|
|
5
|
-
--_rc-segmented-button-fieldset-padding: 0;
|
|
6
|
-
--_rc-segmented-button-fieldset-border: 0;
|
|
7
|
-
--_rc-segmented-button-fieldset-radius: 0;
|
|
8
|
-
--_rc-segmented-button-fieldset-overflow: visible;
|
|
9
|
-
--_rc-segmented-button-legend-position: absolute;
|
|
10
|
-
--_rc-segmented-button-legend-inline-size: 1px;
|
|
11
|
-
--_rc-segmented-button-legend-block-size: 1px;
|
|
12
|
-
--_rc-segmented-button-legend-margin: -1px;
|
|
13
|
-
--_rc-segmented-button-legend-padding: 0;
|
|
14
|
-
--_rc-segmented-button-legend-border: 0;
|
|
15
|
-
--_rc-segmented-button-legend-overflow: hidden;
|
|
16
|
-
--_rc-segmented-button-legend-clip: rect(0 0 0 0);
|
|
17
|
-
--_rc-segmented-button-legend-white-space: nowrap;
|
|
18
|
-
--_rc-segmented-button-segment-display: inline-flex;
|
|
19
|
-
--_rc-segmented-button-segment-cursor: pointer;
|
|
20
|
-
--_rc-segmented-button-segment-user-select: none;
|
|
21
|
-
--_rc-segmented-button-disabled-cursor: not-allowed;
|
|
22
|
-
--_rc-segmented-button-radio-position: absolute;
|
|
23
|
-
--_rc-segmented-button-radio-inline-size: 1px;
|
|
24
|
-
--_rc-segmented-button-radio-block-size: 1px;
|
|
25
|
-
--_rc-segmented-button-radio-margin: 0;
|
|
26
|
-
--_rc-segmented-button-radio-opacity: 0;
|
|
27
|
-
--_rc-segmented-button-radio-pointer-events: none;
|
|
28
|
-
--_rc-segmented-button-selected-icon-display: inline-grid;
|
|
29
|
-
--_rc-segmented-button-vertical-border-inline-start: 1px solid
|
|
30
|
-
var(--md-sys-color-outline, ButtonBorder);
|
|
3
|
+
/* One switch turns on the component-owned segmented recipe. */
|
|
4
|
+
--rc-segmented-button-appearance: segmented;
|
|
31
5
|
--rc-segmented-button-border: 1px solid var(--md-sys-color-outline, ButtonBorder);
|
|
32
6
|
--rc-segmented-button-radius: var(--md-sys-shape-corner-full, 9999px);
|
|
33
7
|
--rc-segmented-button-divider: 0;
|
package/components/select.css
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
@layer rc-theme-material.components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
3
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog) {
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: auto;
|
|
6
|
+
top: var(--rc-dialog-visual-viewport-top, 0);
|
|
7
|
+
left: var(--rc-dialog-visual-viewport-left, 0);
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
inline-size: var(--rc-dialog-visual-viewport-width, 100dvw);
|
|
10
|
+
block-size: var(--rc-dialog-visual-viewport-height, 100dvh);
|
|
11
|
+
max-inline-size: none;
|
|
12
|
+
max-block-size: none;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding-block: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-bottom));
|
|
15
|
+
padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
|
|
16
|
+
resize: none;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
border: 0;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
background: var(--md-sys-color-surface-container-high, Canvas);
|
|
21
|
+
color: var(--md-sys-color-on-surface, CanvasText);
|
|
22
|
+
box-shadow: none;
|
|
23
|
+
transform: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
2
26
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger) {
|
|
3
27
|
box-sizing: border-box;
|
|
4
28
|
transition:
|
|
5
|
-
border-color 150ms
|
|
6
|
-
|
|
7
|
-
|
|
29
|
+
border-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
30
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
31
|
+
box-shadow var(--rc-motion-effects-duration-fast, 150ms)
|
|
32
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
33
|
+
background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
34
|
+
var(--rc-motion-effects-easing-fast, ease);
|
|
8
35
|
}
|
|
9
36
|
|
|
10
37
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger):hover {
|
|
@@ -31,6 +58,26 @@
|
|
|
31
58
|
color: var(--md-sys-color-on-surface-variant, ButtonText);
|
|
32
59
|
}
|
|
33
60
|
|
|
61
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(chips) {
|
|
62
|
+
--rc-chip-block-size: 2rem;
|
|
63
|
+
--rc-chip-touch-target-block-size: 3rem;
|
|
64
|
+
--rc-chip-radius: var(--md-sys-shape-corner-small, 0.5rem);
|
|
65
|
+
--rc-chip-remove-target-size: 1.5rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Dense chips fit one chip row on the field's single input line, so a
|
|
70
|
+
* populated field keeps the unified 56px height. The touch target is
|
|
71
|
+
* unchanged.
|
|
72
|
+
*/
|
|
73
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select.rc-select--dense::part(chips) {
|
|
74
|
+
--rc-chip-block-size: 1.5rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select.rc-select--dense::part(chip) {
|
|
78
|
+
min-block-size: 1.5rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
34
81
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(chip):hover {
|
|
35
82
|
background: color-mix(
|
|
36
83
|
in srgb,
|
|
@@ -46,20 +93,15 @@
|
|
|
46
93
|
* custom properties are the stable styling contract for option rows.
|
|
47
94
|
*/
|
|
48
95
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(listbox) {
|
|
49
|
-
background: var(--md-menu-container-color, var(--md-sys-color-surface-container, Canvas));
|
|
50
|
-
color: var(--md-sys-color-on-surface, CanvasText);
|
|
51
|
-
font-family: var(--md-sys-typescale-body-large-font, inherit);
|
|
52
|
-
font-size: var(--md-sys-typescale-body-large-size, 1rem);
|
|
53
|
-
line-height: var(--md-sys-typescale-body-large-line-height, 1.5rem);
|
|
54
|
-
padding-block: 0.5rem;
|
|
55
|
-
border-radius: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 0.25rem));
|
|
56
|
-
|
|
57
96
|
/* Option sizing — inherited by li[role='option'] via rc-listbox's rc-base layer */
|
|
58
97
|
--rc-listbox-option-gap: var(--rc-list-item-gap, 0.75rem);
|
|
59
98
|
--rc-listbox-option-min-block-size: 3rem;
|
|
60
99
|
--rc-listbox-option-padding-block: 0;
|
|
61
100
|
--rc-listbox-option-padding-inline: 0.75rem;
|
|
62
|
-
--rc-listbox-option-transition:
|
|
101
|
+
--rc-listbox-option-transition:
|
|
102
|
+
background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
103
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
104
|
+
color var(--rc-motion-effects-duration-fast, 150ms) var(--rc-motion-effects-easing-fast, ease);
|
|
63
105
|
|
|
64
106
|
/* M3 hover/focus state layers use on-surface, not the selected container role. */
|
|
65
107
|
--rc-highlight: color-mix(in srgb, var(--md-sys-color-on-surface, CanvasText) 8%, transparent);
|
|
@@ -91,8 +133,9 @@
|
|
|
91
133
|
var(--md-sys-color-on-surface-variant, CanvasText)
|
|
92
134
|
);
|
|
93
135
|
transition:
|
|
94
|
-
color 150ms ease,
|
|
95
|
-
transform
|
|
136
|
+
color var(--rc-motion-effects-duration-fast, 150ms) var(--rc-motion-effects-easing-fast, ease),
|
|
137
|
+
transform var(--rc-motion-spatial-duration-fast, 300ms)
|
|
138
|
+
var(--rc-motion-spatial-easing-fast, ease);
|
|
96
139
|
}
|
|
97
140
|
|
|
98
141
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-select[open]::part(toggle-indicator) {
|
|
@@ -107,4 +150,53 @@
|
|
|
107
150
|
opacity: var(--md-sys-state-disabled-container-opacity, 0.38);
|
|
108
151
|
pointer-events: none;
|
|
109
152
|
}
|
|
153
|
+
|
|
154
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
155
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-header) {
|
|
156
|
+
min-block-size: 3.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
160
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-title) {
|
|
161
|
+
color: var(--md-sys-color-on-surface, CanvasText);
|
|
162
|
+
font-family: var(--md-sys-typescale-headline-small-font, inherit);
|
|
163
|
+
font-size: var(--md-sys-typescale-headline-small-size, 1.5rem);
|
|
164
|
+
font-style: normal;
|
|
165
|
+
font-weight: var(--md-sys-typescale-headline-small-weight, 400);
|
|
166
|
+
line-height: var(--md-sys-typescale-headline-small-line-height, 2rem);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
170
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-cancel),
|
|
171
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
172
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-confirm) {
|
|
173
|
+
border: 0;
|
|
174
|
+
border-radius: var(--md-sys-shape-corner-full, 999px);
|
|
175
|
+
background: transparent;
|
|
176
|
+
color: var(--md-sys-color-primary, Highlight);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
180
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-cancel) {
|
|
181
|
+
color: var(--md-sys-color-on-surface, ButtonText);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
185
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-confirm) {
|
|
186
|
+
padding-inline: 0.75rem;
|
|
187
|
+
font-family: var(--md-sys-typescale-label-large-font, inherit);
|
|
188
|
+
font-size: var(--md-sys-typescale-label-large-size, 0.875rem);
|
|
189
|
+
font-weight: var(--md-sys-typescale-label-large-weight, 500);
|
|
190
|
+
line-height: var(--md-sys-typescale-label-large-line-height, 1.25rem);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
194
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-cancel):hover {
|
|
195
|
+
background: color-mix(in srgb, var(--md-sys-color-on-surface, CanvasText) 8%, transparent);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
199
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog-confirm):hover {
|
|
200
|
+
background: color-mix(in srgb, var(--md-sys-color-primary, Highlight) 8%, transparent);
|
|
201
|
+
}
|
|
110
202
|
}
|
package/components/splitter.css
CHANGED
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
var(--md-sys-color-primary, Highlight) 8%,
|
|
28
28
|
transparent
|
|
29
29
|
);
|
|
30
|
-
--rc-splitter-handle-transition:
|
|
30
|
+
--rc-splitter-handle-transition: var(--rc-motion-effects-duration-fast, 150ms)
|
|
31
|
+
var(--rc-motion-effects-easing-fast, ease);
|
|
32
|
+
/* The panel visibly resizes to the snap point, which is spatial motion. */
|
|
33
|
+
--rc-splitter-snap-duration: var(--rc-motion-spatial-duration-fast, 300ms);
|
|
31
34
|
}
|
|
32
35
|
}
|
package/components/switch.css
CHANGED
|
@@ -23,7 +23,15 @@
|
|
|
23
23
|
--rc-switch-focus-ring: var(--rc-focus-ring);
|
|
24
24
|
--rc-switch-focus-ring-offset: var(--rc-focus-ring-offset);
|
|
25
25
|
--rc-switch-disabled-opacity: var(--rc-disabled-opacity);
|
|
26
|
-
|
|
26
|
+
/*
|
|
27
|
+
* The switch's single duration/easing pair drives both its
|
|
28
|
+
* background-color/border-color fades and its thumb/track resize and
|
|
29
|
+
* slide; the dominant motion is spatial (the thumb visibly moves and
|
|
30
|
+
* grows), so it takes the spatial scale rather than the compatibility
|
|
31
|
+
* token.
|
|
32
|
+
*/
|
|
33
|
+
--rc-switch-duration: var(--rc-motion-spatial-duration-fast, 300ms);
|
|
34
|
+
--rc-switch-easing: var(--rc-motion-spatial-easing-fast, ease);
|
|
27
35
|
|
|
28
36
|
/* Keep long flex/grid siblings from shrinking the control below its track. */
|
|
29
37
|
min-inline-size: var(--rc-switch-track-inline-size) !important;
|
package/components/textarea.css
CHANGED
|
@@ -4,17 +4,27 @@
|
|
|
4
4
|
--rc-textarea-border-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
5
5
|
--rc-textarea-background: var(--md-sys-color-surface, Field);
|
|
6
6
|
--rc-textarea-color: var(--md-sys-color-on-surface, FieldText);
|
|
7
|
-
--rc-textarea-padding: 1rem;
|
|
7
|
+
--rc-textarea-padding-block: 1rem;
|
|
8
|
+
--rc-textarea-padding-inline: 1rem;
|
|
9
|
+
--rc-textarea-gutter-min-inline-size: 48px;
|
|
8
10
|
--rc-textarea-focus-outline: 2px solid var(--md-sys-color-primary, Highlight);
|
|
9
11
|
--rc-textarea-caret-color: var(--md-sys-color-primary, FieldText);
|
|
10
|
-
--rc-textarea-active-line-bg: color-mix(
|
|
12
|
+
--rc-textarea-active-line-bg: color-mix(
|
|
13
|
+
in srgb,
|
|
14
|
+
var(--md-sys-color-primary, Highlight) 8%,
|
|
15
|
+
transparent
|
|
16
|
+
);
|
|
11
17
|
--rc-textarea-gutter-bg: var(--md-sys-color-surface-container, Canvas);
|
|
12
18
|
--rc-textarea-gutter-color: var(--md-sys-color-on-surface-variant, GrayText);
|
|
13
19
|
--rc-textarea-gutter-border: 1px solid var(--md-sys-color-outline-variant, ButtonBorder);
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-textarea::part(root) {
|
|
17
|
-
transition:
|
|
23
|
+
transition:
|
|
24
|
+
border-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
25
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
26
|
+
box-shadow var(--rc-motion-effects-duration-fast, 150ms)
|
|
27
|
+
var(--rc-motion-effects-easing-fast, ease);
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-textarea::part(root):hover {
|
package/components/toolbar.css
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
background: transparent;
|
|
14
14
|
color: inherit;
|
|
15
15
|
font: inherit;
|
|
16
|
-
transition: background-color 150ms
|
|
16
|
+
transition: background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
17
|
+
var(--rc-motion-effects-easing-fast, ease);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
:where(.rc-theme-material, :host(.rc-theme-material)) rc-toolbar > button:hover {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@layer rc-theme-material.components {
|
|
2
|
+
/* Declared on the theme root so tooltips inside other shadow roots inherit it. */
|
|
3
|
+
:where(.rc-theme-material, :host(.rc-theme-material)) {
|
|
4
|
+
--rc-tooltip-padding-block: 0.5rem;
|
|
5
|
+
--rc-tooltip-padding-inline: 0.75rem;
|
|
6
|
+
--rc-tooltip-border: 0;
|
|
7
|
+
--rc-tooltip-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
8
|
+
--rc-tooltip-background: var(--md-sys-color-inverse-surface, CanvasText);
|
|
9
|
+
--rc-tooltip-color: var(--md-sys-color-inverse-on-surface, Canvas);
|
|
10
|
+
--rc-tooltip-shadow: var(--rc-shadow-level2, none);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
--rc-transfer-list-gap: 1rem;
|
|
4
4
|
--rc-transfer-list-panel-gap: 0.5rem;
|
|
5
5
|
--rc-transfer-list-listbox-border: 1px solid var(--md-sys-color-outline-variant, ButtonBorder);
|
|
6
|
+
--rc-transfer-list-listbox-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
|
|
6
7
|
--rc-transfer-list-listbox-bg: var(--md-sys-color-surface, Canvas);
|
|
7
8
|
--rc-transfer-list-option-gap: 0.75rem;
|
|
8
9
|
--rc-transfer-list-option-padding-block: 0;
|
|
@@ -37,7 +38,10 @@
|
|
|
37
38
|
--rc-listbox-option-min-block-size: 3rem;
|
|
38
39
|
--rc-listbox-option-padding-block: 0;
|
|
39
40
|
--rc-listbox-option-padding-inline: 0.75rem;
|
|
40
|
-
--rc-listbox-option-transition:
|
|
41
|
+
--rc-listbox-option-transition:
|
|
42
|
+
background-color var(--rc-motion-effects-duration-fast, 150ms)
|
|
43
|
+
var(--rc-motion-effects-easing-fast, ease),
|
|
44
|
+
color var(--rc-motion-effects-duration-fast, 150ms) var(--rc-motion-effects-easing-fast, ease);
|
|
41
45
|
--rc-listbox-hover-bg: color-mix(
|
|
42
46
|
in srgb,
|
|
43
47
|
var(--md-sys-color-on-surface, CanvasText) 8%,
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
--rc-virtual-canvas-scrollbar-size: 0.75rem;
|
|
5
5
|
--rc-virtual-canvas-scrollbar-thumb-background: var(--md-sys-color-outline, ButtonFace);
|
|
6
6
|
--rc-virtual-canvas-scrollbar-track-background: var(--md-sys-color-surface-container, Canvas);
|
|
7
|
-
--rc-virtual-canvas-scrollbar-button-background: var(
|
|
7
|
+
--rc-virtual-canvas-scrollbar-button-background: var(
|
|
8
|
+
--md-sys-color-surface-container-high,
|
|
9
|
+
ButtonFace
|
|
10
|
+
);
|
|
8
11
|
border-radius: var(--md-sys-shape-corner-medium, 0.75rem);
|
|
9
12
|
background: var(--md-sys-color-surface-container-low, Canvas);
|
|
10
13
|
box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant, ButtonBorder);
|
package/components.css
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
|
-
@layer rc-theme-material.defaults, rc-theme-material.bridge, rc-theme-material.components
|
|
1
|
+
@layer rc-base, rc-theme-material.defaults, rc-theme-material.bridge, rc-theme-material.native, rc-theme-material.components, rc-theme-material.css-components,
|
|
2
|
+
rc-theme-material.overrides;
|
|
2
3
|
|
|
3
4
|
@import './components/icons.css';
|
|
4
5
|
@import './components/listbox.css';
|
|
5
6
|
@import './components/select.css';
|
|
6
7
|
@import './components/combobox.css';
|
|
7
8
|
@import './components/search-bar.css';
|
|
9
|
+
@import './components/field.css';
|
|
8
10
|
@import './components/bottom-sheet.css';
|
|
9
11
|
@import './components/textarea.css';
|
|
10
12
|
@import './components/markdown-editor.css';
|
|
11
13
|
@import './components/transfer-list.css';
|
|
12
14
|
@import './components/button.css';
|
|
13
15
|
@import './components/card.css';
|
|
16
|
+
@import './components/scroller.css';
|
|
17
|
+
@import './components/carousel.css';
|
|
14
18
|
@import './components/chip.css';
|
|
19
|
+
@import './components/chip-group.css';
|
|
15
20
|
@import './components/list-item.css';
|
|
16
21
|
@import './components/fab.css';
|
|
17
22
|
@import './components/fab-menu.css';
|
|
18
23
|
@import './components/app-bar.css';
|
|
19
24
|
@import './components/menu.css';
|
|
20
25
|
@import './components/menu-button.css';
|
|
26
|
+
@import './components/adaptive-menu.css';
|
|
21
27
|
@import './components/menubar.css';
|
|
22
28
|
@import './components/navigation-bar.css';
|
|
23
29
|
@import './components/navigation-rail.css';
|
|
24
30
|
@import './components/toolbar.css';
|
|
25
31
|
@import './components/segmented-button.css';
|
|
26
32
|
@import './components/slider.css';
|
|
33
|
+
@import './components/progress.css';
|
|
27
34
|
@import './components/snackbar.css';
|
|
35
|
+
@import './components/tooltip.css';
|
|
36
|
+
@import './components/popover.css';
|
|
28
37
|
@import './components/range-slider.css';
|
|
29
38
|
@import './components/splitter.css';
|
|
30
39
|
@import './components/switch.css';
|
|
@@ -32,5 +41,6 @@
|
|
|
32
41
|
@import './components/disclosure.css';
|
|
33
42
|
@import './components/accordion.css';
|
|
34
43
|
@import './components/virtual-canvas.css';
|
|
44
|
+
@import './components/virtual-scroller.css';
|
|
35
45
|
@import './components/modes.css';
|
|
36
46
|
@import './state-layer.css';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"name": "rc-theme-material rendered constraints",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"sources": {
|
|
6
|
+
"material3": "https://m3.material.io/",
|
|
7
|
+
"lists": "https://m3.material.io/components/lists/specs",
|
|
8
|
+
"buttons": "https://m3.material.io/components/buttons/specs",
|
|
9
|
+
"iconButtons": "https://m3.material.io/components/icon-buttons/specs",
|
|
10
|
+
"iconButtonsExpressive": "https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/button/res/values/styles.xml",
|
|
11
|
+
"menus": "https://m3.material.io/components/menus/specs"
|
|
12
|
+
},
|
|
13
|
+
"constraints": [
|
|
14
|
+
{
|
|
15
|
+
"id": "list.inline-content-padding",
|
|
16
|
+
"selector": "rc-list > rc-list-item",
|
|
17
|
+
"variants": ["standard", "segmented"],
|
|
18
|
+
"geometry": {
|
|
19
|
+
"contentInlineStart": "16px",
|
|
20
|
+
"contentInlineEnd": "16px"
|
|
21
|
+
},
|
|
22
|
+
"source": "lists"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "list.leading-icon",
|
|
26
|
+
"selector": "rc-list-item > [slot='leading'][data-rc-list-leading]",
|
|
27
|
+
"geometry": {
|
|
28
|
+
"inlineSize": "24px",
|
|
29
|
+
"blockSize": "24px",
|
|
30
|
+
"iconSize": "24px"
|
|
31
|
+
},
|
|
32
|
+
"source": "lists"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "button.small-container",
|
|
36
|
+
"selector": "rc-button:not([icon-only])",
|
|
37
|
+
"geometry": {
|
|
38
|
+
"minBlockSize": "40px"
|
|
39
|
+
},
|
|
40
|
+
"typography": {
|
|
41
|
+
"role": "label-large"
|
|
42
|
+
},
|
|
43
|
+
"source": "buttons"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "icon-button.small",
|
|
47
|
+
"selector": "rc-button[icon-only]",
|
|
48
|
+
"geometry": {
|
|
49
|
+
"containerInlineSize": "40px",
|
|
50
|
+
"containerBlockSize": "40px",
|
|
51
|
+
"iconSize": "24px",
|
|
52
|
+
"minTouchTarget": "48px"
|
|
53
|
+
},
|
|
54
|
+
"source": "iconButtons"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "adaptive-menu.overflow-trigger",
|
|
58
|
+
"selector": "rc-adaptive-menu::part(overflow-trigger)",
|
|
59
|
+
"variants": ["small", "narrow"],
|
|
60
|
+
"geometry": {
|
|
61
|
+
"containerInlineSize": "32px",
|
|
62
|
+
"containerBlockSize": "40px",
|
|
63
|
+
"iconSize": "24px",
|
|
64
|
+
"minTouchTarget": "48px"
|
|
65
|
+
},
|
|
66
|
+
"source": "iconButtonsExpressive"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "menu.item",
|
|
70
|
+
"selector": "rc-menu [role^='menuitem'], rc-adaptive-menu > [data-rc-action-overflowed]",
|
|
71
|
+
"geometry": {
|
|
72
|
+
"minBlockSize": "48px",
|
|
73
|
+
"paddingInlineStart": "12px",
|
|
74
|
+
"paddingInlineEnd": "12px",
|
|
75
|
+
"contentGap": "12px",
|
|
76
|
+
"leadingIconSize": "24px"
|
|
77
|
+
},
|
|
78
|
+
"typography": {
|
|
79
|
+
"role": "body-large",
|
|
80
|
+
"fontSize": "16px",
|
|
81
|
+
"fontWeight": "400",
|
|
82
|
+
"lineHeight": "24px",
|
|
83
|
+
"tracking": "0.5px"
|
|
84
|
+
},
|
|
85
|
+
"source": "menus"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "adaptive-menu.viewport-containment",
|
|
89
|
+
"selector": "rc-adaptive-menu::part(popup)",
|
|
90
|
+
"behavior": {
|
|
91
|
+
"maxInlineSize": "viewport - 8px",
|
|
92
|
+
"maxBlockSize": "viewport - 8px",
|
|
93
|
+
"overflow": "auto",
|
|
94
|
+
"overscrollBehavior": "contain"
|
|
95
|
+
},
|
|
96
|
+
"source": "menus"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@layer rc-theme-material.css-components {
|
|
2
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
3
|
+
:where(button.rc-button, a[href].rc-button):not(:where(rc-button > button)):not(
|
|
4
|
+
:where(rc-button > a)
|
|
5
|
+
) {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
gap: var(--rc-button-gap, 0.5rem);
|
|
10
|
+
min-block-size: var(--rc-button-block-size, 2.5rem);
|
|
11
|
+
padding-block: var(--rc-button-padding-block, 0.5rem);
|
|
12
|
+
padding-inline: var(--rc-button-padding-inline, 1.5rem);
|
|
13
|
+
border: var(--rc-button-border, var(--rc-border, 1px solid ButtonBorder));
|
|
14
|
+
border-radius: var(--rc-button-radius, var(--rc-control-radius, 999px));
|
|
15
|
+
background: var(--rc-button-bg, ButtonFace);
|
|
16
|
+
color: var(--rc-button-color, var(--rc-button-text, ButtonText));
|
|
17
|
+
font: var(--rc-button-font, inherit);
|
|
18
|
+
text-decoration: var(--rc-button-text-decoration, none);
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
user-select: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
24
|
+
:where(button.rc-button, a[href].rc-button):not(:where(rc-button > button)):not(
|
|
25
|
+
:where(rc-button > a)
|
|
26
|
+
):hover:not(:where(:disabled)) {
|
|
27
|
+
background: color-mix(in srgb, currentColor 8%, var(--rc-button-bg, ButtonFace));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
31
|
+
:where(button.rc-button, a[href].rc-button):not(:where(rc-button > button)):not(
|
|
32
|
+
:where(rc-button > a)
|
|
33
|
+
):active:not(:where(:disabled)),
|
|
34
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
35
|
+
:where(button.rc-button, a[href].rc-button)[aria-pressed='true']:not(
|
|
36
|
+
:where(rc-button > button)
|
|
37
|
+
):not(:where(rc-button > a)) {
|
|
38
|
+
background: var(--rc-highlight, Highlight);
|
|
39
|
+
color: var(--rc-highlight-text, HighlightText);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
43
|
+
:where(button.rc-button, a[href].rc-button):not(:where(rc-button > button)):not(
|
|
44
|
+
:where(rc-button > a)
|
|
45
|
+
):focus-visible {
|
|
46
|
+
outline: var(--rc-focus-ring, 2px solid Highlight);
|
|
47
|
+
outline-offset: var(--rc-focus-ring-offset, 2px);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
51
|
+
:where(button.rc-button, a[href].rc-button):is(:disabled, [aria-disabled='true']) {
|
|
52
|
+
color: var(--rc-text-disabled, GrayText);
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media (forced-colors: active) {
|
|
57
|
+
:where(.rc-theme-material, :host(.rc-theme-material))
|
|
58
|
+
:where(button.rc-button, a[href].rc-button)[aria-pressed='true'] {
|
|
59
|
+
border-color: Highlight;
|
|
60
|
+
outline: 1px solid Highlight;
|
|
61
|
+
outline-offset: -1px;
|
|
62
|
+
background: Highlight;
|
|
63
|
+
color: HighlightText;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|