@rcarls/rc-field 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,88 @@
1
+ # @rcarls/rc-field
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
+ - 9ab269c: Support `<select>` as a field control, both as a plain direct child and wrapped by an
39
+ enhancing control provider (the same contract `rc-textarea` already uses). Populated state for
40
+ a multiple select comes from `selectedOptions` rather than `.value`, which only reflects the
41
+ first selected option in tree order and can read empty even with a real selection.
42
+ - e23a39c: Add an accessible native input and textarea field wrapper with Material 3 filled and outlined
43
+ theme treatments, including an explicit provider contract for enhanced native controls.
44
+
45
+ ### Patch Changes
46
+
47
+ - 011f3c6: Keep combobox chips clear of their trailing toggle, reset native selects inside
48
+ `rc-field`, keep controlled carousel accessibility state synchronized, and align
49
+ Material chips, menus, lists, disclosures, nested editors, and bottom-sheet
50
+ motion with their MD3 defaults.
51
+ - c5b62c9: Fix an empty `leading`/`trailing`/`prefix`/`suffix` slot silently keeping its layout box (and any
52
+ margin meant for the non-empty case), eating into the control's available width. The `.empty-slot`
53
+ class could never win against the id-selector rule setting its `display`, regardless of source
54
+ order.
55
+ - f4c0244: Prefer a control provider's own `disabled` property over its raw native control when both are
56
+ present. A provider disabling its control for an internal reason unrelated to the field's real
57
+ enabled/disabled intent (confirmed with `rc-select`'s GeckoView picker guard) no longer leaks
58
+ into `data-disabled` and the field's dimmed styling.
59
+ - f6eea6f: Suppress Chromium's tap-highlight flash on the native control. Firefox has no
60
+ equivalent behavior, so an unstyled control only flashed on Chrome despite the
61
+ existing focus-outline reset.
62
+ - 77f9c63: Fix three theme gaps where a token fell through to a system color.
63
+
64
+ **Substrate had no error color.** `--rc-field-error-color` fell through to `rc-field`'s own
65
+ default of `Mark`, the system color for the background of highlighted text, which renders as
66
+ pure yellow and measured 1.07:1 against the field. Validation worked, the message was in the
67
+ accessibility tree, and it could not be read. Substrate now ships `--substrate-error`, held
68
+ at hue 25 so it reads as red rather than as a darker shade of the orange primary at hue 48,
69
+ and the bridge maps it. Both modes clear 7:1.
70
+
71
+ Every remaining error fallback of `Mark`, in `rc-field` and in the Material field styles, now
72
+ falls back to the validation red a user agent uses for an invalid control. The `Mark` usages
73
+ inside `forced-colors` blocks are unchanged, where a system color is correct.
74
+
75
+ **Material never set `--rc-button-text`.** `rc-select`, `rc-combobox`, and `rc-menu-button`
76
+ read it directly for text drawn over `--rc-button-bg`, which Material sets to the primary
77
+ fill, so the `ButtonText` fallback gave 3.26:1 in light and 1.70:1 in dark. It now follows
78
+ `--md-sys-color-on-primary` alongside `--rc-button-color`, giving 6.44:1 and 7.71:1.
79
+
80
+ **Substrate referenced three tokens it never declared.** `--substrate-inverse-surface`,
81
+ `--substrate-inverse-on-surface`, and `--substrate-radius-pill` were used by the bridge and
82
+ component styles but missing from `defaults.css`, leaving `rc-snackbar` on system colors and
83
+ the bottom sheet handle on a literal. All three are declared, and a `defaults` test now
84
+ asserts that every referenced token exists.
85
+
86
+ - Updated dependencies [50d5610]
87
+ - Updated dependencies [4341311]
88
+ - @rcarls/rc-common@0.0.0-next-20260921045401
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # rc-field
2
+
3
+ Accessible field wrapper for a native input, textarea, or select with labels and supporting text.
4
+
5
+ Docs: [https://richardcarls.github.io/rc-webcomponents/components/rc-field](https://richardcarls.github.io/rc-webcomponents/components/rc-field).
6
+
7
+ `rc-field` keeps the native control in light DOM as the source of truth for value, validation,
8
+ autofill, labels, and form submission. It adds layout, state hooks, accessible hint/error wiring,
9
+ and theme affordances without replacing the browser's control behavior.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @rcarls/rc-field
15
+ ```
16
+
17
+ ```bash
18
+ yarn add @rcarls/rc-field
19
+ ```
20
+
21
+ ## Use
22
+
23
+ ```js
24
+ import '@rcarls/rc-field/define';
25
+ ```
26
+
27
+ ```html
28
+ <rc-field counter>
29
+ <label slot="label" for="recipe-title">Recipe title</label>
30
+ <input id="recipe-title" name="title" maxlength="80" required />
31
+ <small slot="hint">Use the title printed on the recipe.</small>
32
+ <small slot="error">Enter a recipe title.</small>
33
+ </rc-field>
34
+ ```
35
+
36
+ The control must be a direct child. Use an explicit `for` and `id` pair when the label should work
37
+ before custom-element upgrade. A slotted native label without `for` is associated automatically
38
+ after upgrade; an ancestor native label can wrap the complete field instead. Native `input`,
39
+ `change`, and `invalid` events are not replaced or duplicated.
40
+
41
+ Call `sync()` after changing `.value` programmatically. Native input events, constraint attributes,
42
+ form reset, and control replacement synchronize automatically.
43
+
44
+ ## Material theme
45
+
46
+ Import `@rcarls/rc-theme-material/theme.css` and place the field under `.rc-theme-material`.
47
+ Filled is the default treatment; add `class="rc-field--outlined"` for the outlined variant.
48
+
49
+ An enhancing control may wrap the native control when the direct child is explicitly marked as
50
+ the field control provider. The native control must remain its direct child:
51
+
52
+ ```html
53
+ <rc-field>
54
+ <label slot="label" for="notes">Notes</label>
55
+ <rc-textarea data-rc-field-control>
56
+ <textarea id="notes" name="notes"></textarea>
57
+ </rc-textarea>
58
+ </rc-field>
59
+ ```
60
+
61
+ `select` is a supported control shape too, either as a plain direct child:
62
+
63
+ ```html
64
+ <rc-field>
65
+ <label slot="label" for="unit">Unit</label>
66
+ <select id="unit" name="unit">
67
+ <option value="oz">oz</option>
68
+ <option value="mL">mL</option>
69
+ </select>
70
+ </rc-field>
71
+ ```
72
+
73
+ or wrapped by an enhancing control provider the same way as `rc-textarea`:
74
+
75
+ ```html
76
+ <rc-field>
77
+ <label slot="label" for="categories">Categories</label>
78
+ <rc-combobox data-rc-field-control multiple allow-create>
79
+ <select id="categories" name="categories" multiple>
80
+ <option value="braiser">Braiser</option>
81
+ <option value="chicken">Chicken</option>
82
+ </select>
83
+ </rc-combobox>
84
+ </rc-field>
85
+ ```
86
+
87
+ A multiple select's populated state comes from `selectedOptions`, not `.value` (which only ever
88
+ reflects the first *selected* option in tree order and can read empty even with a real selection).