@rcarls/rc-list 0.6.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 CHANGED
@@ -1,5 +1,182 @@
1
1
  # @rcarls/rc-list
2
2
 
3
+ ## 0.7.0
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
+ - 6ec0857: Add `ordered` to `rc-list`. Visible items in an ordered list receive `aria-posinset` and
39
+ `aria-setsize` so assistive technology reports their position; no counters render, and authored
40
+ positions from a rendered slice of a longer list are kept.
41
+
42
+ Add an expandable `details` region to `rc-list-item`. A button marked
43
+ `data-rc-list-item-toggle` toggles it; the item wires `aria-expanded`, `aria-controls`, and the
44
+ region's `hidden` state, supports controlled `expanded` and uncontrolled `default-expanded`
45
+ state, and fires `rc-list-item-toggle`. Material styles the region as list supporting text.
46
+
47
+ - 54d9ead: Localize every component's built-in text. Button names, role
48
+ descriptions, announcements, and default labels now resolve per key from
49
+ the element's `messages` property, then from text registered with
50
+ `registerMessages(locale, catalog)` in `@rcarls/rc-common`, then from the
51
+ English defaults. The locale is the element's own `lang`, else
52
+ `<html lang>`; an ancestor's `lang` is ignored, because it usually marks
53
+ content rather than the interface. Components re-render when that locale
54
+ changes or new text is registered. `RcMessageCatalog` types the catalog,
55
+ and each package adds its scope to it.
56
+
57
+ Numbers a component formats as text follow the same locale:
58
+ `rc-progress`'s default percentage and `rc-splitter`'s `aria-valuetext`
59
+ use `Intl.NumberFormat`. `TypeaheadController` matches prefixes with an
60
+ `Intl.Collator`, so case and accents are ignored the way the locale
61
+ ignores them, and takes a `locale` option. `ItemsCollectionController`'s
62
+ `setCreateOption(text, label?)` takes the option's visible text from its
63
+ caller.
64
+
65
+ `rc-transfer-list`'s direction arrows are now decorative: screen readers
66
+ read only the action name, and the arrows turn over in RTL.
67
+
68
+ **Breaking:** chrome-text properties are replaced by `messages`. Migrate:
69
+
70
+ - `rc-search-bar` `clear-label` / `clearLabel` → `messages.clear`
71
+ - `rc-adaptive-menu` `overflow-label` / `overflowLabel` → `messages.overflow`
72
+ - `rc-chip-group` `show-all-label` / `showAllLabel` and `show-less-label` /
73
+ `showLessLabel` → `messages.showAll` and `messages.showLess`
74
+ - `rc-select` and `rc-combobox` `dialog-confirm-label` /
75
+ `dialogConfirmLabel` and `dialog-cancel-label` / `dialogCancelLabel` →
76
+ `messages.done` and `messages.cancel`
77
+ - `rc-editor-toolbar` `label` → `messages.toolbar`
78
+
79
+ Per-instance names stay attributes, but now default to `undefined` and fall
80
+ back to a message: `label` on `rc-adaptive-menu`, `rc-chip-group`,
81
+ `rc-menubar`, and `rc-splitter`; `available-label` and `selected-label`
82
+ on `rc-transfer-list`; `low-label` and `high-label` on `rc-range-slider`.
83
+ Read the resolved name from the rendered `aria-label` instead of the
84
+ property.
85
+
86
+ - 6e548d9: Several components handle `prefers-reduced-motion: reduce` in their own
87
+ shadow styles, outside a theme's reach, and refine it the same way the theme
88
+ layer already does: spatial motion (`translate`, `scale`, `transform`,
89
+ `inline-size`, `block-size`) goes fully to zero, while effects motion (color,
90
+ opacity) shortens instead of disappearing.
91
+
92
+ `rc-app-bar` zeros its host's hide/show `translate` but shortens the
93
+ expanded title's fade-in. `rc-disclosure` keeps its panel's expand/collapse
94
+ zeroed, but its summary/content backstop for a theme-added transition now
95
+ shortens instead of zeroing it outright. `rc-list-item`'s row and
96
+ state-layer transition only color and opacity, so the whole sweep shortens.
97
+ `rc-fab-menu`'s popup mixes `scale` with opacity/overlay/display under one
98
+ shared duration; reduced motion now zeros the scale and shortens the rest.
99
+ `rc-switch`'s thumb mixes background-color with inline-size/block-size/
100
+ transform the same way; the icons and track, which each transition only one
101
+ kind of property, needed only the zero-or-shorten call. `rc-fab`'s
102
+ scroll-reveal is opacity/visibility only with no time-based duration to
103
+ shorten in its scroll-linked path, so reduced motion narrows the scroll
104
+ window instead of collapsing it to zero; its JS-transition fallback path
105
+ shortens the same fade rather than removing it. `rc-progress`'s determinate
106
+ fill transition, previously unguarded under reduced motion, is now zeroed;
107
+ its indeterminate loop, a continuous sweep with no meaningful shortened
108
+ form, stays fully stopped rather than shortened.
109
+
110
+ - c130173: Add pointer and keyboard reordering to `rc-list`.
111
+
112
+ Set `reorderable` and give each item a native `<button data-rc-reorder-handle>`. People can drag
113
+ a handle, and the items it passes shift out of the way while the nearest scroll container
114
+ scrolls near its edges. On touch and pen, a long press on an item also starts a drag, while
115
+ movement before activation remains available for scrolling. Or they can focus a handle and use
116
+ Space, the block-axis arrow keys, Home, End, and Escape. Each step is announced, focus stays on
117
+ the moved item's handle, and geometry and keys follow the writing mode. `reorderable` implies
118
+ `ordered`.
119
+
120
+ Each committed move fires a cancelable `rc-list-reorder` event with `{ item, from, to }`. Left
121
+ alone, the list moves the node itself; a framework that renders the items cancels the event and
122
+ reorders its own data. `reorderMessages` overrides the announcements and the handle hint.
123
+
124
+ `rc-common` gains the `ReorderController` behind it and a `LiveAnnouncer` live-region helper.
125
+ `rc-theme-material` styles the lifted item with the dragged elevation, surface, and state layer,
126
+ animates the shifting items with standard motion, and presents plain handles as standard icon
127
+ buttons.
128
+
129
+ ### Patch Changes
130
+
131
+ - 38cd00c: Convert viewport measurements to local CSS pixels when reordering items,
132
+ positioning navigation indicators, and clamping anchored popups under CSS zoom.
133
+ Reorder previews now account for the scroll container's zoom, while anchor
134
+ corrections settle without repeated overshoot.
135
+ - 5c006de: Ship component CSS minified. Package builds now run the CSS in Lit `css` styles
136
+ and light-DOM structural styles through Lightning CSS, removing comments and
137
+ whitespace while keeping source maps that resolve to each template. Rendered
138
+ styles are unchanged.
139
+
140
+ `@rcarls/rc-common` adds `cssText`, an identity tag that marks a plain CSS
141
+ string for minification. `rc-chip`, `rc-disclosure`, and `rc-accordion` now
142
+ depend on `@rcarls/rc-common` for it.
143
+
144
+ - 2dbeccf: Place rows by `aria-posinset` and `aria-setsize` when they carry them, so a
145
+ virtualized list rendering only a slice gives first- and last-row styling to
146
+ the set's real ends instead of the ends of the slice.
147
+ - Updated dependencies [e3dfa59]
148
+ - Updated dependencies [50d5610]
149
+ - Updated dependencies [9ee769c]
150
+ - Updated dependencies [1179f24]
151
+ - Updated dependencies [595fe37]
152
+ - Updated dependencies [38cd00c]
153
+ - Updated dependencies [5c006de]
154
+ - Updated dependencies [a6553ff]
155
+ - Updated dependencies [2205478]
156
+ - Updated dependencies [4341311]
157
+ - Updated dependencies [899bb5e]
158
+ - Updated dependencies [25fcfe0]
159
+ - Updated dependencies [51f6403]
160
+ - Updated dependencies [9caca6b]
161
+ - Updated dependencies [b764a3c]
162
+ - Updated dependencies [54d9ead]
163
+ - Updated dependencies [b9175e9]
164
+ - Updated dependencies [c8b762b]
165
+ - Updated dependencies [55e1e7f]
166
+ - Updated dependencies [f1ca82d]
167
+ - Updated dependencies [b87f27b]
168
+ - Updated dependencies [32ebead]
169
+ - Updated dependencies [bfefedd]
170
+ - Updated dependencies [c130173]
171
+ - Updated dependencies [11680b6]
172
+ - Updated dependencies [223d36c]
173
+ - Updated dependencies [7b91a44]
174
+ - Updated dependencies [aa04ead]
175
+ - Updated dependencies [ac65b5b]
176
+ - Updated dependencies [afcfef8]
177
+ - Updated dependencies [11ef1ad]
178
+ - @rcarls/rc-common@0.7.0
179
+
3
180
  ## 0.6.0
4
181
 
5
182
  ### Minor Changes
package/README.md CHANGED
@@ -34,6 +34,103 @@ input. Links, buttons, inputs, and other interactive descendants retain their
34
34
  own behavior. Radios in a single-selection list should share a `name`, just as
35
35
  they would in an unenhanced native radio group.
36
36
 
37
+ ## Ordered lists
38
+
39
+ Set `ordered` when item order carries meaning, such as recipe steps. Each visible item receives
40
+ `aria-posinset` and `aria-setsize`, so assistive technology reports its position. The list
41
+ renders no counters: numbering the content shows, if any, stays in the item text. Items that
42
+ already carry authored positions, as in a virtualized slice, keep them.
43
+
44
+ ```html
45
+ <rc-list ordered aria-label="Directions">
46
+ <rc-list-item>1. Heat the oven.</rc-list-item>
47
+ <rc-list-item>2. Mix the batter.</rc-list-item>
48
+ </rc-list>
49
+ ```
50
+
51
+ ## Reordering
52
+
53
+ Set `reorderable` to let people change the order. It implies `ordered`. Give each item a native
54
+ `<button data-rc-reorder-handle>`, usually in the `trailing` slot, and label it yourself. Handles
55
+ without an authored `aria-description` get a short keyboard hint, which `reorderMessages` can
56
+ replace along with every announcement.
57
+
58
+ - **Pointer:** press a handle and drag. The lifted item follows the pointer, the items it passes
59
+ shift out of its way, and the nearest scroll container scrolls near its edges. Escape cancels.
60
+ A press without movement stays a plain button press.
61
+ - **Touch and pen:** as on Android, a long press anywhere on an item also picks it up, then
62
+ drag. Moving before the press completes scrolls the list instead, and lifting the finger
63
+ after the drag does not also activate a control in the item. A mouse drags only by the
64
+ handle. Item text cannot be selected in a `reorderable` list.
65
+ - **Keyboard:** Space or Enter picks the item up. The block-axis arrow keys, Home, and End move
66
+ it, Space or Enter drops it, and Escape returns it to where it started. Moving focus away
67
+ drops it. Each step is announced through a polite live region in the nearest open dialog or
68
+ popover, else the document body.
69
+
70
+ Each committed move fires a cancelable `rc-list-reorder` event with `{ item, from, to }`. Left
71
+ alone, the list moves the item's node itself, so plain HTML needs no script. A framework that
72
+ renders the items cancels the event and reorders its own data; focus returns to the moved
73
+ item's handle even when the framework replaces the item's nodes. A pointer drag fires once on
74
+ drop. The keyboard fires on every step, and once more when a reorder is canceled.
75
+
76
+ ```html
77
+ <rc-list reorderable aria-label="Photo order">
78
+ <rc-list-item>
79
+ Cover photo
80
+ <button slot="trailing" type="button" data-rc-reorder-handle aria-label="Reorder cover photo">
81
+ ⠿
82
+ </button>
83
+ </rc-list-item>
84
+ <rc-list-item>
85
+ Plated
86
+ <button slot="trailing" type="button" data-rc-reorder-handle aria-label="Reorder plated">
87
+ ⠿
88
+ </button>
89
+ </rc-list-item>
90
+ </rc-list>
91
+ ```
92
+
93
+ ```js
94
+ list.addEventListener('rc-list-reorder', (event) => {
95
+ event.preventDefault();
96
+ photos = move(photos, event.detail.from, event.detail.to);
97
+ });
98
+ ```
99
+
100
+ While an item is lifted it carries `data-dragging` and the list carries `data-reordering`. Themes
101
+ style the lifted item with the `--rc-list-item-dragged-*` properties and animate the shifting
102
+ items with `--rc-list-item-reorder-duration`. Reduced motion turns that shift off.
103
+
104
+ ### Localizing the reorder text
105
+
106
+ The handle hint and announcements follow the list's own `lang`, else `<html lang>`. Override
107
+ them per list with `reorderMessages`, or for every list with `registerMessages()` from
108
+ `@rcarls/rc-common` under `reorder` (`instructions`, `grabbed`, `moved`, `dropped`,
109
+ `canceled`).
110
+
111
+ ## Expandable details
112
+
113
+ An item can carry a supporting region below its row in the `details` slot. Mark a button inside
114
+ the item, usually in the `trailing` slot, with `data-rc-list-item-toggle`. The item wires the
115
+ button's `aria-expanded` and `aria-controls`, keeps the region `hidden` while collapsed, and
116
+ fires `rc-list-item-toggle` with the requested state. Use `default-expanded` for an initial
117
+ uncontrolled state, or set `expanded` to control it; assign `undefined` to release control.
118
+
119
+ ```html
120
+ <rc-list aria-label="Ingredients">
121
+ <rc-list-item>
122
+ 3 garlic cloves, chopped
123
+ <button slot="trailing" type="button" data-rc-list-item-toggle aria-label="Garlic details">
124
+ i
125
+ </button>
126
+ <div slot="details">"garlic" is not a recognized unit of measure.</div>
127
+ </rc-list-item>
128
+ </rc-list>
129
+ ```
130
+
131
+ The region spans the text and trailing columns, so its content wraps freely even while the row
132
+ text truncates.
133
+
37
134
  ## Action targets
38
135
 
39
136
  For a row whose primary action is not its selection input, set `interactive`
@@ -82,5 +179,10 @@ collapse the shared trailing track and place trailing metadata below content:
82
179
  }
83
180
  ```
84
181
 
182
+ To render only part of a long list, wrap it in `rc-virtual-scroller` and give
183
+ each rendered row `aria-posinset` and `aria-setsize` for its place in the whole set. The list
184
+ then gives first- and last-row styling only to the set's real first and last
185
+ rows, not to the ends of the rendered slice.
186
+
85
187
  Import `@rcarls/rc-list` to use the classes without registering them, or import
86
188
  `@rcarls/rc-list/define` to register `<rc-list>` and `<rc-list-item>`.