@rcarls/rc-theme-substrate 0.4.2 → 0.6.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @rcarls/rc-theme-substrate
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a108336: Add shared-column `rc-list` and `rc-list-item` elements with standard and
8
+ segmented appearances, default content truncation, and native-backed single or
9
+ multiple selection coordination. Restore author-owned item state when native
10
+ selection coordination ends.
11
+ - 509ee64: Add `rc-progress`, a native `<progress>` enhancer with a formatted value
12
+ display, a track and fill you can restyle with CSS custom properties, and a
13
+ built-in fix for the indeterminate/undefined-binding footgun.
14
+
15
+ Keep the native element as the uncontrolled source of truth, support releasing
16
+ a controlled value, and react to live native `value`/`max` changes. Preserve a
17
+ native determinate value while `indeterminate` temporarily removes its
18
+ attribute.
19
+
20
+ The bar renders at its intended height with no `display` attribute set,
21
+ matching its own documented default: previously the track/fill/native
22
+ `<progress>` are all absolutely positioned, contributing nothing to the
23
+ control's normal-flow height, so with no value-display text sharing its grid
24
+ row to give it one, the whole bar collapsed to 0px.
25
+
26
+ ## 0.5.0
27
+
3
28
  ## 0.4.2
4
29
 
5
30
  ## 0.4.1
package/bridge.css CHANGED
@@ -154,6 +154,15 @@
154
154
  --rc-thumb-radius: 0.5625rem;
155
155
  }
156
156
 
157
+ .rc-theme-substrate rc-progress,
158
+ :host(.rc-theme-substrate) rc-progress {
159
+ --rc-progress-track-background: color-mix(in srgb, var(--rc-border-color) 70%, transparent);
160
+ --rc-progress-track-opacity: 1;
161
+ --rc-progress-track-radius: 999px;
162
+ --rc-progress-fill-background: var(--rc-accent);
163
+ --rc-progress-value-color: var(--substrate-on-surface-muted, GrayText);
164
+ }
165
+
157
166
  .rc-theme-substrate rc-bottom-sheet,
158
167
  :host(.rc-theme-substrate) rc-bottom-sheet {
159
168
  --rc-bottom-sheet-bg: var(--substrate-surface-raised, Canvas);
@@ -65,7 +65,10 @@
65
65
  translate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
66
66
  }
67
67
 
68
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-accordion details[open] > summary::after {
68
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
69
+ rc-accordion
70
+ details[open]
71
+ > summary::after {
69
72
  rotate: 135deg;
70
73
  translate: 0 -0.125rem;
71
74
  }
@@ -90,8 +93,7 @@
90
93
  opacity: 0;
91
94
  overflow: clip;
92
95
  transition:
93
- block-size var(--substrate-motion-duration-slow, 240ms)
94
- var(--substrate-motion-easing, ease),
96
+ block-size var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease),
95
97
  content-visibility var(--substrate-motion-duration-slow, 240ms)
96
98
  var(--substrate-motion-easing, ease) allow-discrete,
97
99
  opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
@@ -1,10 +1,6 @@
1
1
  @layer rc-theme-substrate.components {
2
2
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-app-bar {
3
- --rc-app-bar-background: color-mix(
4
- in srgb,
5
- var(--substrate-surface, Canvas) 88%,
6
- transparent
7
- );
3
+ --rc-app-bar-background: color-mix(in srgb, var(--substrate-surface, Canvas) 88%, transparent);
8
4
  --rc-app-bar-color: var(--rc-field-text, CanvasText);
9
5
  --rc-app-bar-scroll-divider: var(--rc-border, 1px solid ButtonBorder);
10
6
  --rc-app-bar-shadow: none;
@@ -46,10 +46,7 @@
46
46
  display: none;
47
47
  }
48
48
 
49
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
50
- rc-disclosure
51
- > details
52
- > summary::after {
49
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > summary::after {
53
50
  content: '';
54
51
  inline-size: 0.5rem;
55
52
  block-size: 0.5rem;
@@ -69,17 +66,11 @@
69
66
  translate: 0 -0.125rem;
70
67
  }
71
68
 
72
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
73
- rc-disclosure
74
- > details
75
- > summary:hover {
69
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > summary:hover {
76
70
  background: color-mix(in srgb, var(--rc-accent, Highlight) 8%, transparent);
77
71
  }
78
72
 
79
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
80
- rc-disclosure
81
- > details
82
- > :not(summary) {
73
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > :not(summary) {
83
74
  display: flow-root;
84
75
  padding-inline: 0.875rem;
85
76
  opacity: 1;
@@ -101,8 +92,7 @@
101
92
  opacity: 0;
102
93
  overflow: clip;
103
94
  transition:
104
- block-size var(--substrate-motion-duration-slow, 240ms)
105
- var(--substrate-motion-easing, ease),
95
+ block-size var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease),
106
96
  content-visibility var(--substrate-motion-duration-slow, 240ms)
107
97
  var(--substrate-motion-easing, ease) allow-discrete,
108
98
  opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
@@ -1,12 +1,11 @@
1
1
  @layer rc-theme-substrate.components {
2
2
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
3
+ /* Compatibility tokens retained for rc-listbox and embedded selectors. */
3
4
  --rc-list-item-gap: var(--substrate-item-gap, 0.5rem);
4
5
  --rc-list-item-min-block-size: 2.25rem;
5
6
  --rc-list-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
6
7
  --rc-list-item-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
7
- --rc-list-item-divider: 0;
8
8
  --rc-list-item-bg: transparent;
9
- --rc-list-item-color: var(--rc-field-text, FieldText);
10
9
  --rc-list-item-supporting-color: var(--substrate-on-surface-muted, GrayText);
11
10
  --rc-list-item-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
12
11
  --rc-list-item-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
@@ -15,41 +14,47 @@
15
14
  --rc-list-item-disabled-opacity: var(--rc-disabled-opacity, 0.52);
16
15
  }
17
16
 
18
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list {
19
- list-style: none;
20
- margin: 0;
21
- padding: 0;
22
- }
23
-
24
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list-item {
25
- display: flex;
26
- align-items: center;
27
- gap: var(--rc-list-item-gap);
28
- min-block-size: var(--rc-list-item-min-block-size);
29
- padding: var(--rc-list-item-padding-block) var(--rc-list-item-padding-inline);
30
- border-block-end: var(--rc-list-item-divider);
31
- background: var(--rc-list-item-bg);
32
- color: var(--rc-list-item-color);
33
- box-sizing: border-box;
17
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-list {
18
+ --rc-list-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
19
+ --rc-list-leading-gap: var(--substrate-item-gap, 0.5rem);
20
+ --rc-list-trailing-gap: var(--substrate-item-gap, 0.5rem);
21
+ --rc-list-row-gap: 0;
22
+ --rc-list-item-min-block-size: 2.25rem;
23
+ --rc-list-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
24
+ --rc-list-item-color: var(--rc-field-text, FieldText);
25
+ --rc-list-item-background: transparent;
26
+ --rc-list-item-selected-color: var(--rc-highlight-text, HighlightText);
27
+ --rc-list-item-selected-background: var(--rc-highlight, Highlight);
28
+ --rc-list-item-divider: 1px solid var(--substrate-border, GrayText);
29
+ --rc-list-item-state-layer-color: var(--rc-accent, Highlight);
30
+ --rc-list-item-hover-state-layer-opacity: 0.1;
31
+ --rc-list-item-focus-state-layer-opacity: 0.12;
32
+ --rc-list-item-pressed-state-layer-opacity: 0.16;
33
+ --rc-list-item-disabled-opacity: var(--rc-disabled-opacity, 0.52);
34
+ --rc-list-item-transition-duration: 100ms;
34
35
  }
35
36
 
36
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list-item__start,
37
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list-item__trailing,
38
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list-item__end {
39
- display: inline-flex;
40
- align-items: center;
41
- flex-shrink: 0;
37
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-list[variant='segmented'] {
38
+ --rc-list-padding-inline: 0;
39
+ --rc-list-row-gap: 0.25rem;
40
+ --rc-list-item-background: var(--substrate-surface-raised, Field);
41
+ --rc-list-item-divider: 0;
42
+ --rc-list-item-border: 1px solid var(--substrate-border, GrayText);
43
+ --rc-list-item-border-radius: var(--substrate-radius-medium, 0.375rem);
42
44
  }
43
45
 
44
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list-item__body {
45
- display: flex;
46
- flex: 1 1 auto;
47
- flex-direction: column;
48
- min-inline-size: 0;
46
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
47
+ rc-list-item
48
+ > :where([data-rc-list-supporting], small) {
49
+ display: block;
50
+ color: var(--substrate-on-surface-muted, GrayText);
49
51
  }
50
52
 
51
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) .rc-list-item__supporting {
52
- color: var(--rc-list-item-supporting-color);
53
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
54
+ rc-list-item
55
+ > :is(input[type='checkbox'], input[type='radio'])[slot='leading'] {
56
+ margin: 0;
57
+ accent-color: var(--rc-accent, Highlight);
53
58
  }
54
59
 
55
60
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-listbox,
@@ -0,0 +1,6 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-progress::part(value-display) {
3
+ color: var(--substrate-on-surface-muted, GrayText);
4
+ font-variant-numeric: tabular-nums;
5
+ }
6
+ }
@@ -22,7 +22,9 @@
22
22
  outline-offset: var(--rc-focus-ring-offset, 2px);
23
23
  }
24
24
 
25
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-search-bar > input[type='search']:focus-visible {
25
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
26
+ rc-search-bar
27
+ > input[type='search']:focus-visible {
26
28
  outline: none;
27
29
  }
28
30
  }
@@ -36,6 +36,7 @@
36
36
  --rc-segmented-button-selected-color: var(--rc-highlight-text, HighlightText);
37
37
  --rc-segmented-button-segment-min-block-size: var(--rc-control-block-size, 2.5rem);
38
38
  --rc-segmented-button-segment-padding-inline: var(--rc-control-padding-inline, 0.75rem);
39
+ --rc-segmented-button-segment-gap: 0.5em;
39
40
  --rc-segmented-button-focus-ring: var(--rc-focus-ring);
40
41
  --rc-segmented-button-focus-ring-offset: -2px;
41
42
  --rc-segmented-button-disabled-opacity: var(--rc-disabled-opacity);
@@ -1,14 +1,6 @@
1
1
  @layer rc-theme-substrate.components {
2
2
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-splitter {
3
- --rc-splitter-separator-color: color-mix(
4
- in srgb,
5
- var(--rc-accent, Highlight) 8%,
6
- Canvas
7
- );
8
- --rc-splitter-handle-color: color-mix(
9
- in srgb,
10
- var(--rc-accent, Highlight) 45%,
11
- ButtonBorder
12
- );
3
+ --rc-splitter-separator-color: color-mix(in srgb, var(--rc-accent, Highlight) 8%, Canvas);
4
+ --rc-splitter-handle-color: color-mix(in srgb, var(--rc-accent, Highlight) 45%, ButtonBorder);
13
5
  }
14
6
  }
@@ -22,9 +22,7 @@
22
22
  background: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
23
23
  }
24
24
 
25
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
26
- rc-toolbar
27
- > button[aria-pressed='true'] {
25
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar > button[aria-pressed='true'] {
28
26
  background: var(--rc-highlight, Highlight);
29
27
  color: var(--rc-highlight-text, HighlightText);
30
28
  }
package/components.css CHANGED
@@ -24,6 +24,7 @@
24
24
  @import './components/toolbar.css';
25
25
  @import './components/segmented-button.css';
26
26
  @import './components/slider.css';
27
+ @import './components/progress.css';
27
28
  @import './components/snackbar.css';
28
29
  @import './components/range-slider.css';
29
30
  @import './components/splitter.css';
package/defaults.css CHANGED
@@ -46,11 +46,11 @@
46
46
 
47
47
  --substrate-shadow-sm: 0 1px 2px var(--substrate-shadow-color);
48
48
  --substrate-shadow-md:
49
- 0 1px 2px var(--substrate-shadow-color), 0 10px 30px
50
- color-mix(in oklch, var(--substrate-shadow-color) 65%, transparent);
49
+ 0 1px 2px var(--substrate-shadow-color),
50
+ 0 10px 30px color-mix(in oklch, var(--substrate-shadow-color) 65%, transparent);
51
51
  --substrate-shadow-lg:
52
- 0 1px 2px var(--substrate-shadow-color), 0 18px 48px
53
- color-mix(in oklch, var(--substrate-shadow-color) 80%, transparent);
52
+ 0 1px 2px var(--substrate-shadow-color),
53
+ 0 18px 48px color-mix(in oklch, var(--substrate-shadow-color) 80%, transparent);
54
54
 
55
55
  --substrate-focus-ring: 2px solid var(--substrate-primary);
56
56
  --substrate-focus-ring-offset: 2px;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.2",
6
+ "version": "0.6.0",
7
7
  "description": "Lightweight CSS reference theme for app-oriented rc-webcomponents layouts.",
8
8
  "repository": {
9
9
  "type": "git",