@rcarls/rc-theme-material 0.3.2 → 0.4.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.
@@ -1,16 +1,24 @@
1
1
  @layer rc-theme-material.components {
2
2
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger) {
3
3
  box-sizing: border-box;
4
- transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
4
+ transition:
5
+ border-color 150ms ease,
6
+ box-shadow 150ms ease,
7
+ background-color 150ms ease;
5
8
  }
6
9
 
7
10
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger):hover {
8
11
  border-color: var(--md-sys-color-on-surface, CanvasText);
9
- background: color-mix(in srgb, var(--md-sys-color-on-surface, CanvasText) 4%, var(--md-sys-color-surface, Field));
12
+ background: color-mix(
13
+ in srgb,
14
+ var(--md-sys-color-on-surface, CanvasText) 4%,
15
+ var(--md-sys-color-surface, Field)
16
+ );
10
17
  }
11
18
 
12
19
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger):focus-visible,
13
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(trigger)[aria-expanded='true'] {
20
+ :where(.rc-theme-material, :host(.rc-theme-material))
21
+ rc-select::part(trigger)[aria-expanded='true'] {
14
22
  border-color: var(--md-sys-color-primary, Highlight);
15
23
  box-shadow: inset 0 0 0 1px var(--md-sys-color-primary, Highlight);
16
24
  outline: none;
@@ -24,7 +32,11 @@
24
32
  }
25
33
 
26
34
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-select::part(chip):hover {
27
- background: color-mix(in srgb, var(--md-sys-color-on-surface-variant, CanvasText) 8%, transparent);
35
+ background: color-mix(
36
+ in srgb,
37
+ var(--md-sys-color-on-surface-variant, CanvasText) 8%,
38
+ transparent
39
+ );
28
40
  color: var(--md-sys-color-on-surface-variant, CanvasText);
29
41
  }
30
42
 
@@ -43,7 +55,7 @@
43
55
  border-radius: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 0.25rem));
44
56
 
45
57
  /* Option sizing — inherited by li[role='option'] via rc-listbox's rc-base layer */
46
- --rc-listbox-option-gap: 0.75rem;
58
+ --rc-listbox-option-gap: var(--rc-list-item-gap, 0.75rem);
47
59
  --rc-listbox-option-min-block-size: 3rem;
48
60
  --rc-listbox-option-padding-block: 0;
49
61
  --rc-listbox-option-padding-inline: 0.75rem;
@@ -78,7 +90,9 @@
78
90
  --md-outlined-select-text-field-trailing-icon-color,
79
91
  var(--md-sys-color-on-surface-variant, CanvasText)
80
92
  );
81
- transition: color 150ms ease, transform 150ms ease;
93
+ transition:
94
+ color 150ms ease,
95
+ transform 150ms ease;
82
96
  }
83
97
 
84
98
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-select[open]::part(toggle-indicator) {
@@ -0,0 +1,23 @@
1
+ @layer rc-theme-material.components {
2
+ :where(.rc-theme-material, :host(.rc-theme-material)) rc-snackbar {
3
+ --rc-snackbar-inset-block-end: calc(1rem + var(--rc-navigation-bar-block-size, 0px));
4
+ --rc-snackbar-min-block-size: 3rem;
5
+ --rc-snackbar-max-inline-size: 30rem;
6
+ --rc-snackbar-padding-block: 0.875rem;
7
+ --rc-snackbar-padding-inline: 1rem;
8
+ --rc-snackbar-border: 0;
9
+ --rc-snackbar-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
10
+ --rc-snackbar-bg: var(--md-sys-color-inverse-surface, CanvasText);
11
+ --rc-snackbar-color: var(--md-sys-color-inverse-on-surface, Canvas);
12
+ --rc-snackbar-action-color: var(--md-sys-color-inverse-primary, LinkText);
13
+ --rc-snackbar-action-border: 0;
14
+ --rc-snackbar-action-radius: var(--md-sys-shape-corner-full, 9999px);
15
+ --rc-snackbar-action-padding-block: 0.5rem;
16
+ --rc-snackbar-action-padding-inline: 0.75rem;
17
+ --rc-snackbar-action-bg: transparent;
18
+ --rc-snackbar-action-font: inherit;
19
+ --rc-snackbar-shadow: var(--rc-shadow-level3);
20
+ --rc-snackbar-focus-ring: 2px solid var(--md-sys-color-inverse-primary, Highlight);
21
+ --rc-snackbar-focus-ring-offset: 2px;
22
+ }
23
+ }
@@ -0,0 +1,33 @@
1
+ @layer rc-theme-material.components {
2
+ :where(.rc-theme-material, :host(.rc-theme-material)) rc-switch {
3
+ --rc-switch-native-appearance: none;
4
+ --rc-switch-native-inline-size: 100%;
5
+ --rc-switch-native-block-size: 100%;
6
+ --rc-switch-native-margin: 0;
7
+ --rc-switch-native-opacity: 0;
8
+ --rc-switch-decoration-display: block;
9
+ --rc-switch-icon-display: grid;
10
+ --rc-switch-track-inline-size: 3.25rem;
11
+ --rc-switch-track-block-size: 2rem;
12
+ --rc-switch-track-border: 2px solid var(--md-sys-color-outline, ButtonBorder);
13
+ --rc-switch-track-radius: var(--md-sys-shape-corner-full, 9999px);
14
+ --rc-switch-track-bg: var(--md-sys-color-surface-container-highest, ButtonFace);
15
+ --rc-switch-thumb-size: 1rem;
16
+ --rc-switch-thumb-offset: 0.375rem;
17
+ --rc-switch-thumb-bg: var(--md-sys-color-outline, ButtonText);
18
+ --rc-switch-selected-track-border-color: var(--md-sys-color-primary, Highlight);
19
+ --rc-switch-selected-track-bg: var(--md-sys-color-primary, Highlight);
20
+ --rc-switch-selected-thumb-size: 1.5rem;
21
+ --rc-switch-selected-thumb-bg: var(--md-sys-color-on-primary, HighlightText);
22
+ --rc-switch-thumb-translate: 1.125rem;
23
+ --rc-switch-focus-ring: var(--rc-focus-ring);
24
+ --rc-switch-focus-ring-offset: var(--rc-focus-ring-offset);
25
+ --rc-switch-disabled-opacity: var(--rc-disabled-opacity);
26
+ --rc-switch-duration: var(--rc-motion-duration);
27
+
28
+ /* Keep long flex/grid siblings from shrinking the control below its track. */
29
+ min-inline-size: var(--rc-switch-track-inline-size) !important;
30
+ min-block-size: var(--rc-switch-track-block-size) !important;
31
+ flex-shrink: 0 !important;
32
+ }
33
+ }
@@ -33,7 +33,7 @@
33
33
 
34
34
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-transfer-list::part(listbox) {
35
35
  border-radius: var(--md-sys-shape-corner-small, 0.25rem);
36
- --rc-listbox-option-gap: 0.75rem;
36
+ --rc-listbox-option-gap: var(--rc-list-item-gap, 0.75rem);
37
37
  --rc-listbox-option-min-block-size: 3rem;
38
38
  --rc-listbox-option-padding-block: 0;
39
39
  --rc-listbox-option-padding-inline: 0.75rem;
package/components.css CHANGED
@@ -1,23 +1,36 @@
1
1
  @layer rc-theme-material.defaults, rc-theme-material.bridge, rc-theme-material.components;
2
2
 
3
+ @import './components/icons.css';
3
4
  @import './components/listbox.css';
4
5
  @import './components/select.css';
5
6
  @import './components/combobox.css';
6
7
  @import './components/search-bar.css';
8
+ @import './components/bottom-sheet.css';
7
9
  @import './components/textarea.css';
8
10
  @import './components/markdown-editor.css';
9
11
  @import './components/transfer-list.css';
12
+ @import './components/button.css';
13
+ @import './components/card.css';
14
+ @import './components/chip.css';
15
+ @import './components/list-item.css';
10
16
  @import './components/fab.css';
17
+ @import './components/fab-menu.css';
11
18
  @import './components/app-bar.css';
12
19
  @import './components/menu.css';
13
20
  @import './components/menu-button.css';
14
21
  @import './components/menubar.css';
22
+ @import './components/navigation-bar.css';
23
+ @import './components/navigation-rail.css';
15
24
  @import './components/toolbar.css';
25
+ @import './components/segmented-button.css';
16
26
  @import './components/slider.css';
27
+ @import './components/snackbar.css';
17
28
  @import './components/range-slider.css';
18
29
  @import './components/splitter.css';
30
+ @import './components/switch.css';
19
31
  @import './components/dialog.css';
20
32
  @import './components/disclosure.css';
21
33
  @import './components/accordion.css';
22
34
  @import './components/virtual-canvas.css';
23
35
  @import './components/modes.css';
36
+ @import './state-layer.css';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.2",
6
+ "version": "0.4.0",
7
7
  "description": "Material 3 CSS theme and token bridge for rc-webcomponents.",
8
8
  "repository": {
9
9
  "type": "git",
@@ -22,6 +22,7 @@
22
22
  "./defaults.css": "./defaults.css",
23
23
  "./components.css": "./components.css",
24
24
  "./components/*.css": "./components/*.css",
25
+ "./state-layer.css": "./state-layer.css",
25
26
  "./theme.css": "./theme.css"
26
27
  },
27
28
  "files": [
@@ -0,0 +1,33 @@
1
+ @layer rc-theme-material.components {
2
+ /*
3
+ * Material 3 state layers for interactive elements that already own their
4
+ * border radius. Uses currentColor so the layer follows each component's
5
+ * foreground token.
6
+ */
7
+ .rc-state-layer {
8
+ position: relative;
9
+ }
10
+
11
+ .rc-state-layer::after {
12
+ content: '';
13
+ position: absolute;
14
+ inset: 0;
15
+ border-radius: inherit;
16
+ background: currentColor;
17
+ opacity: 0;
18
+ pointer-events: none;
19
+ transition: opacity 150ms var(--md-sys-motion-easing-standard, cubic-bezier(0.4, 0, 0.2, 1));
20
+ }
21
+
22
+ .rc-state-layer:hover::after {
23
+ opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
24
+ }
25
+
26
+ .rc-state-layer:focus-visible::after {
27
+ opacity: var(--md-sys-state-focus-state-layer-opacity, 0.12);
28
+ }
29
+
30
+ .rc-state-layer:active::after {
31
+ opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
32
+ }
33
+ }