@rcarls/rc-app-bar 0.0.0-next-20260921045401

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 ADDED
@@ -0,0 +1,164 @@
1
+ # @rcarls/rc-app-bar
2
+
3
+ ## 0.0.0-next-20260921045401
4
+
5
+ ### Minor Changes
6
+
7
+ - 079e025: Standardize component styling contracts for the breaking 0.7 release.
8
+
9
+ BREAKING CHANGE: Rename the Markdown editor's `--rme-*` properties to
10
+ `--rc-markdown-editor-*`, `--rc-app-bar-background` to `--rc-app-bar-bg`,
11
+ `--rc-textarea-radius` to `--rc-textarea-border-radius`, the transfer-list
12
+ `--rc-transfer-list-panel-*` properties to `--rc-transfer-list-listbox-*`,
13
+ `--rc-chip-group-webkit-scrollbar-display` to
14
+ `--rc-chip-group-scrollbar-display`, and `--rc-text` to `--rc-field-text`.
15
+ Compatibility aliases are intentionally not provided.
16
+
17
+ BREAKING CHANGE: Replace `--rc-select-chip-padding-inline` and
18
+ `--rc-combobox-chip-padding-inline` with explicit `*-padding-inline-start` and
19
+ `*-padding-inline-end` tokens. Generated removable chips now reserve the full
20
+ remove target and its edge offset, so their indicator cannot overlap label text.
21
+
22
+ Add canonical app-bar elevation, transfer-list listbox radius, and textarea
23
+ line-action tokens. Add logical `rc-chip` inline-padding properties so themes
24
+ can implement Material's icon-aware spacing without overriding authored child
25
+ styles. Make `rc-field` consume the shared semantic token layer,
26
+ and place the `rc-chip` and `rc-search-bar` light-DOM structural styles in the
27
+ `rc-base` cascade layer so normal consumer rules override them.
28
+
29
+ Prevent decorative, `aria-hidden` trailing list content from intercepting a
30
+ whole-row action target, and keep segmented-list item geometry from leaking
31
+ into nested standard lists.
32
+
33
+ Remove unused Material navigation-rail toggle tokens and obsolete list-item
34
+ theme tokens. Register the segmented-button private theme seam and enforce
35
+ token ownership, documentation, removed-name, selector-budget, and cascade
36
+ layer contracts through the component architecture audit.
37
+
38
+ - 6e548d9: Several components handle `prefers-reduced-motion: reduce` in their own
39
+ shadow styles, outside a theme's reach, and refine it the same way the theme
40
+ layer already does: spatial motion (`translate`, `scale`, `transform`,
41
+ `inline-size`, `block-size`) goes fully to zero, while effects motion (color,
42
+ opacity) shortens instead of disappearing.
43
+
44
+ `rc-app-bar` zeros its host's hide/show `translate` but shortens the
45
+ expanded title's fade-in. `rc-disclosure` keeps its panel's expand/collapse
46
+ zeroed, but its summary/content backstop for a theme-added transition now
47
+ shortens instead of zeroing it outright. `rc-list-item`'s row and
48
+ state-layer transition only color and opacity, so the whole sweep shortens.
49
+ `rc-fab-menu`'s popup mixes `scale` with opacity/overlay/display under one
50
+ shared duration; reduced motion now zeros the scale and shortens the rest.
51
+ `rc-switch`'s thumb mixes background-color with inline-size/block-size/
52
+ transform the same way; the icons and track, which each transition only one
53
+ kind of property, needed only the zero-or-shorten call. `rc-fab`'s
54
+ scroll-reveal is opacity/visibility only with no time-based duration to
55
+ shorten in its scroll-linked path, so reduced motion narrows the scroll
56
+ window instead of collapsing it to zero; its JS-transition fallback path
57
+ shortens the same fade rather than removing it. `rc-progress`'s determinate
58
+ fill transition, previously unguarded under reduced motion, is now zeroed;
59
+ its indeterminate loop, a continuous sweep with no meaningful shortened
60
+ form, stays fully stopped rather than shortened.
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [50d5610]
65
+ - Updated dependencies [4341311]
66
+ - @rcarls/rc-common@0.0.0-next-20260921045401
67
+
68
+ ## 0.6.0
69
+
70
+ ### Minor Changes
71
+
72
+ - b6f52a2: Change the default `slot="center"` layout: it now fills the flexible space
73
+ between leading and trailing, capped by the new
74
+ `--rc-app-bar-center-max-inline-size` before it centers within available
75
+ space instead of continuing to stretch, rather than always mirroring the
76
+ leading/trailing edges to stay exactly viewport-centered. Add the new
77
+ `center-symmetric` attribute to keep the previous behavior (exact
78
+ viewport-centering regardless of asymmetric leading/trailing widths).
79
+
80
+ ### Patch Changes
81
+
82
+ - b6f52a2: Defer app-bar layout measurements to animation frames, group geometry reads
83
+ before style writes, and remeasure when symmetric centering changes live.
84
+ - Updated dependencies [6683eb9]
85
+ - Updated dependencies [ee7ba6c]
86
+ - Updated dependencies [30eb232]
87
+ - @rcarls/rc-common@0.6.0
88
+
89
+ ## 0.5.0
90
+
91
+ ### Minor Changes
92
+
93
+ - d440edc: Add `--rc-app-bar-title-start-padding`, applied only when the leading slot is
94
+ empty. Per the M3 Top App Bar spec, a headline with no navigation icon should
95
+ align with the start margin of the content below the bar, not the bar's own
96
+ edge padding (which is calibrated for the leading icon button's touch
97
+ target). Defaults to `0px` (no behavior change for existing consumers).
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [4ae2ef0]
102
+ - Updated dependencies [689340c]
103
+ - @rcarls/rc-common@0.5.0
104
+
105
+ ## 0.4.2
106
+
107
+ ### Patch Changes
108
+
109
+ - @rcarls/rc-common@0.4.2
110
+
111
+ ## 0.4.1
112
+
113
+ ### Patch Changes
114
+
115
+ - @rcarls/rc-common@0.4.1
116
+
117
+ ## 0.4.0
118
+
119
+ ### Patch Changes
120
+
121
+ - 468e009: Document `variant`, `scroll-behavior`, `scroll-target`, and `scroll-threshold`
122
+ attributes, and note the `data-scrolled`/`data-collapsed`/`data-hidden` and
123
+ `:state()` environment-driven output convention in the class JSDoc.
124
+ - Updated dependencies [e57277f]
125
+ - Updated dependencies [ccca8e2]
126
+ - Updated dependencies [037b1b3]
127
+ - @rcarls/rc-common@0.4.0
128
+
129
+ ## 0.3.2
130
+
131
+ ### Patch Changes
132
+
133
+ - Updated dependencies [88b4086]
134
+ - @rcarls/rc-common@0.3.2
135
+
136
+ ## 0.3.1
137
+
138
+ ### Patch Changes
139
+
140
+ - @rcarls/rc-common@0.3.1
141
+
142
+ ## 0.3.0
143
+
144
+ ### Changed
145
+
146
+ - Update package metadata, README intro, and docs links.
147
+
148
+ ### Fixed
149
+
150
+ - Defer layout measurements to the next animation frame to avoid measurement loops.
151
+
152
+ ### Dependencies
153
+
154
+ - Sync internal dependencies to 0.3.0.
155
+
156
+ ## 0.2.0
157
+
158
+ ### Minor Changes
159
+
160
+ - Add rc-app-bar with headless grid layout, dual-mode scrolled state, and pinned/collapse/hide scroll behavior. Align strict TypeScript configuration, add dialog feature detection, and prepare all packages for public npm release with provenance publishing.
161
+
162
+ ### Patch Changes
163
+
164
+ - @rcarls/rc-common@0.2.0
package/README.md ADDED
@@ -0,0 +1,247 @@
1
+ # `@rcarls/rc-app-bar`
2
+
3
+ App bar modeled after the
4
+ [Material 3 Top app bar](https://m3.material.io/components/top-app-bar/overview),
5
+ with leading, title, center, trailing regions and optional scroll behavior.
6
+
7
+ Docs: [https://richardcarls.github.io/rc-webcomponents/components/rc-app-bar](https://richardcarls.github.io/rc-webcomponents/components/rc-app-bar).
8
+
9
+ Material 3 and Apple HIG inform the available structures and behaviors, but the
10
+ default appearance remains deliberately UA-like: system colors, a thin
11
+ scrolled divider, and no supplied action controls or decorative icons.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install @rcarls/rc-app-bar
17
+ ```
18
+
19
+ ```js
20
+ import '@rcarls/rc-app-bar/define';
21
+ ```
22
+
23
+ ## Basic usage
24
+
25
+ ```html
26
+ <header>
27
+ <rc-app-bar scroll-target="#content">
28
+ <button slot="leading" aria-label="Back">&larr;</button>
29
+ <span>Inbox</span>
30
+ <rc-toolbar slot="trailing" label="Actions">...</rc-toolbar>
31
+ </rc-app-bar>
32
+ </header>
33
+ <div id="content" class="scroll-area">...</div>
34
+ ```
35
+
36
+ The default slot is the single title region. It may contain a title, subtitle,
37
+ or any other consumer markup. The title node remains connected and is never
38
+ duplicated while the bar changes layout.
39
+
40
+ ## Expanded and scroll behaviors
41
+
42
+ `variant="expanded"` places the title in a flexible second row. Its height
43
+ comes from the title content rather than a Material-specific fixed size.
44
+
45
+ ```html
46
+ <rc-app-bar variant="expanded" scroll-behavior="collapse" scroll-target="#content">
47
+ <button slot="leading" aria-label="Back">&larr;</button>
48
+ <div>
49
+ <strong>Slow-Roasted Tomato Pasta</strong>
50
+ <small>Summer recipes</small>
51
+ </div>
52
+ <button slot="trailing" aria-label="Edit">Edit</button>
53
+ </rc-app-bar>
54
+ ```
55
+
56
+ Scroll behaviors are exclusive:
57
+
58
+ - `pinned` keeps the current structure visible and only exposes scrolled state.
59
+ - `collapse` continuously shrinks an expanded title row over its measured
60
+ height, then keeps the compact row visible.
61
+ - `hide` hides the complete bar while scrolling down past `scroll-threshold`
62
+ and reveals it when scrolling up or returning near the top.
63
+
64
+ The component never consumes, stops, or rewrites the document's scroll.
65
+
66
+ ## Center-slot composition
67
+
68
+ The optional `center` slot, useful for desktop controls or an
69
+ [`rc-search-bar`](../rc-search-bar/), fills the flexible space between leading
70
+ and trailing by default:
71
+
72
+ ```html
73
+ <rc-app-bar style="--rc-app-bar-center-max-inline-size: 32rem;">
74
+ <button slot="leading">Back</button>
75
+ <span>Recipes</span>
76
+ <rc-search-bar slot="center" placeholder="Search recipes">
77
+ <input type="search" aria-label="Search recipes" />
78
+ </rc-search-bar>
79
+ <button slot="trailing" aria-label="Account">Account</button>
80
+ </rc-app-bar>
81
+ ```
82
+
83
+ Uncapped, it stretches edge-to-edge like any other content in that space. Set
84
+ `--rc-app-bar-center-max-inline-size` and it centers within the available
85
+ space once it hits that width instead of continuing to stretch (centered
86
+ between wherever leading ends and trailing begins, not on the bar's own
87
+ viewport midpoint).
88
+
89
+ For a control that must sit at the bar's exact geometric midpoint regardless
90
+ of asymmetric leading/trailing widths, add `center-symmetric`:
91
+
92
+ ```html
93
+ <rc-app-bar center-symmetric>
94
+ <button slot="leading">Long leading label</button>
95
+ <span>Recipes</span>
96
+ <rc-search-bar slot="center">...</rc-search-bar>
97
+ <button slot="trailing" aria-label="Account">Account</button>
98
+ </rc-app-bar>
99
+ ```
100
+
101
+ This mirrors the leading/trailing edge widths so the center slot stays
102
+ viewport-centered even when the two sides differ, at the cost of extra reserved
103
+ space on whichever side is narrower.
104
+
105
+ Title and center content may coexist. The title is constrained before it can
106
+ overlap the centered content. Without center content, the title uses all space
107
+ between leading and trailing controls; consumers may apply
108
+ `rc-app-bar::part(title) { text-align: center; }`.
109
+
110
+ ## Controlled state
111
+
112
+ `scrolled` follows the library's controlled/uncontrolled convention:
113
+
114
+ - Set `scrollTarget` or `scroll-target` for uncontrolled observation.
115
+ - Assign `scrolled` to control the endpoint silently.
116
+ - Assign `undefined` to release control back to observation.
117
+
118
+ In controlled collapse mode, `true` snaps to compact and `false` restores the
119
+ expanded row. Controlled hide mode remains visible because a boolean value
120
+ cannot express scroll direction.
121
+
122
+ State output is available as `data-scrolled`, `data-collapsed`, and
123
+ `data-hidden`, with equivalent `:state(scrolled)`, `:state(collapsed)`, and
124
+ `:state(hidden)` custom states.
125
+
126
+ ## View Transitions
127
+
128
+ Document View Transitions are consumer-owned progressive enhancement. Assign a
129
+ unique `view-transition-name` to the light-DOM title element, not
130
+ `::part(title)` or the shadow-owned slot wrapper:
131
+
132
+ ```html
133
+ <rc-app-bar id="recipe-bar" variant="expanded" scroll-behavior="collapse">
134
+ <h1 class="recipe-title">Slow-Roasted Tomato Pasta</h1>
135
+ </rc-app-bar>
136
+ ```
137
+
138
+ ```css
139
+ .recipe-title {
140
+ view-transition-name: recipe-app-bar-title;
141
+ }
142
+
143
+ ::view-transition-old(recipe-app-bar-title) {
144
+ animation: 180ms ease-out both title-out;
145
+ }
146
+
147
+ ::view-transition-new(recipe-app-bar-title) {
148
+ animation: 180ms 120ms ease-in both title-in;
149
+ }
150
+
151
+ @keyframes title-out {
152
+ to {
153
+ opacity: 0;
154
+ translate: 0 -1rem;
155
+ }
156
+ }
157
+
158
+ @keyframes title-in {
159
+ from {
160
+ opacity: 0;
161
+ }
162
+ }
163
+ ```
164
+
165
+ ```js
166
+ const bar = document.querySelector('#recipe-bar');
167
+ const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)');
168
+
169
+ async function setCollapsed(collapsed) {
170
+ const update = async () => {
171
+ bar.scrolled = collapsed;
172
+ await bar.updateComplete;
173
+ };
174
+
175
+ if (!document.startViewTransition || reduceMotion.matches) {
176
+ await update();
177
+ return;
178
+ }
179
+
180
+ document.startViewTransition(update);
181
+ }
182
+ ```
183
+
184
+ The app bar never starts a document transition itself because the API is
185
+ global and may conflict with navigation or unrelated components. Unsupported
186
+ browsers receive the immediate endpoint change. Give concurrently rendered
187
+ titles unique transition names.
188
+
189
+ ## Styling
190
+
191
+ The component supplies no controls or action icons. The default scrolled
192
+ separator is the `scroll-shadow` part, despite being rendered as a system-color
193
+ border by default:
194
+
195
+ ```css
196
+ rc-app-bar::part(scroll-shadow) {
197
+ border-block-end: 0;
198
+ box-shadow: 0 1px 4px rgb(0 0 0 / 0.2);
199
+ }
200
+
201
+ rc-app-bar.glass::part(root) {
202
+ background: color-mix(in srgb, Canvas 70%, transparent);
203
+ backdrop-filter: blur(18px);
204
+ }
205
+ ```
206
+
207
+ ### CSS custom properties
208
+
209
+ | Property | Default | Description |
210
+ | --------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
211
+ | `--rc-app-bar-bg` | `Canvas` | Bar background |
212
+ | `--rc-app-bar-color` | `CanvasText` | Bar text color |
213
+ | `--rc-app-bar-shadow` | `none` | Bar box shadow |
214
+ | `--rc-app-bar-compact-min-height` | `3rem` | Compact row minimum height |
215
+ | `--rc-app-bar-expanded-padding-block` | `0.75em` | Expanded title block padding |
216
+ | `--rc-app-bar-padding-inline` | `0.75em` | Horizontal padding |
217
+ | `--rc-app-bar-gap` | `0.5em` | Gap between regions |
218
+ | `--rc-app-bar-center-max-inline-size` | `100%` | Max width of `slot="center"` content before it centers within the available space instead of filling it. No effect when `center-symmetric` is set. |
219
+ | `--rc-app-bar-title-start-padding` | `0px` | Extra title inline-start padding when the leading slot is empty |
220
+ | `--rc-app-bar-transition-duration` | `200ms` | Endpoint and hide transition duration |
221
+ | `--rc-app-bar-scroll-divider` | `1px solid GrayText` | Scrolled separator border |
222
+ | `--rc-app-bar-collapse-progress` | `0` | Read-only collapse animation progress from 0 through 1 |
223
+ | `--rc-app-bar-title-font-size` | unset | Optional compact-row title font size; inherits when unset |
224
+ | `--rc-app-bar-expanded-title-font-size` | unset | Optional expanded-row title font size; inherits when unset |
225
+
226
+ ### CSS parts
227
+
228
+ `root`, `leading`, `title`, `center`, `trailing`, `scroll-shadow`
229
+
230
+ ## Breaking migration
231
+
232
+ - Replace `variant="small"` with `variant="compact"`.
233
+ - Replace `variant="medium"` with `variant="expanded"`.
234
+ - Remove `slot="expanded-title"` and keep one title in the default slot.
235
+ - Replace old fixed height/title-font tokens and the `title-row`/`expanded`
236
+ parts with the structural API documented above.
237
+
238
+ ## Accessibility
239
+
240
+ - The host has no implicit landmark role. Wrap a page-level instance in
241
+ `<header>` when appropriate.
242
+ - Consumer-provided controls retain their native semantics and keyboard
243
+ behavior.
244
+ - The single title remains connected and exposed to assistive technology in
245
+ every visual state.
246
+ - Movement and fades are disabled under `prefers-reduced-motion: reduce`.
247
+ - The default divider uses `GrayText` and remains visible in forced colors.