You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 760550c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(core): a first-party indicator can paint its own press
CheckboxInput paints its press over a replacement indicator as a rounded
square, which tints past a round indicator such as a circle. It now leaves
that layer off over an indicator that applies `indicatorPressScope`, an
internal marker for Astryx's own replacement indicators
(`@astryxdesign/core/internal/indicatorPress.stylex`, not public API). The
row also hands its touch press image down as `--_indicator-press-image`,
because an indicator in another package may not name the row's private
press attribute. Only the row declares it, so an indicator mapped into a
row that paints its own press, such as a menu's checkbox item, paints
nothing twice. Hover and a mouse press reach the indicator through the
row's scope marker, as for the built-in indicator. Indicators without the
marker are unchanged.
component:CheckboxInput AV1 and FR11 now say so: a first-party replacement
indicator may paint its own press from the row's hover and press, while
CheckboxInput still paints focus.
The unit cases that read the injected rules fail on main: the row hands its
touch press image down, and the press layer turns off over a marked
indicator. A disabled row hands nothing down. A unit case keeps the marker
off every public entry and the API report.
[feat] CheckboxInput can leave its rounded-square press layer off over a first-party replacement indicator that paints its own press. Indicators in this release are unchanged.
| Public contract |`CheckboxInput` is a controlled native checkbox with a required `label` and `value`; it supports synchronous and transition-backed change handlers, loading, disabled, disabled-reason, read-only, validation, sizing, and field content. |
55
-
| Behavior | The native input owns role, state, focus, form participation, and activation. A replaceable CheckboxIndicator owns the visible box while CheckboxInput owns its focus ring and pressed overlay. |
55
+
| Behavior | The native input owns role, state, focus, form participation, and activation. A replaceable CheckboxIndicator owns the visible box while CheckboxInput owns its focus ring and pressed overlay, except where a first-party indicator paints its own press (AV1).|
56
56
| End-user impact | People can identify and operate available choices, review inert values as read-only, discover disabled reasons from the keyboard, and perceive busy, validation, focus, and pressed states. |
57
57
| Builder impact | None. Builders control the value and may use `onChange`, `changeAction`, or both; the meaning of omitting both stays an open question (OQ1). |
58
58
| Compatibility/readiness | Records shipped behavior; no API, default, or DOM change. A handlerless checkbox declares no read-only state, a mixed value can lose its native mixed state on activation, and caller key handlers run while disabled; all are listed under Current-state impact. |
@@ -79,7 +79,7 @@ Consumer migration instructions belong in consumer docs and release notes.
79
79
**Owns**
80
80
81
81
- Native checkbox role, checked/mixed state, label, description/status relationships, focus, activation, availability, read-only state, required/invalid/busy state, and form participation.
82
-
- Composition of the resolved checkbox indicator, owner-painted focus ring and pressed overlay, disabled-reason tooltip, field label, description, and detached status.
82
+
- Composition of the resolved checkbox indicator, owner-painted focus ring and pressed overlay (except where a first-party indicator paints its own press; AV1), disabled-reason tooltip, field label, description, and detached status.
83
83
- Ordering between `onChange`, `preventDefault`, optimistic pending state, and `changeAction`.
84
84
85
85
**Does not own / non-goals**
@@ -115,13 +115,13 @@ Consumer migration instructions belong in consumer docs and release notes.
115
115
| FR8 | Caller DOM props MUST reach the input, while component-owned type, checked, disabled, read-only, required, busy, invalid, description, ref, and styling values retain precedence. |`architecture:public-component-api/INV5–INV8`; component tests |
116
116
| FR9 | The outer field MUST retain `checkbox-input`, the label MUST retain `checkbox-label`, and the built-in CheckboxIndicator path MUST retain its canonical targets. Replacement indicators are not required to accept target classes. | source/docs target inventory; replacement component tests; `architecture:component-theming-surface/INV4–INV8,INV12`|
117
117
| FR10 | Keyboard/programmatic focus on the hidden native input MUST paint the shared focus-visible outline on the resolved indicator element, including a replacement indicator that forwards no props. |`architecture:interaction-modality/INV1–INV3`; component tests |
118
-
| FR11 | CheckboxInput applies `design:user-states` DR1 and DR2 for the pressed overlay, painting it on the indicator while the row is pressed. |`design:user-states/DR1–DR5`|
118
+
| FR11 | CheckboxInput applies `design:user-states` DR1 and DR2 for the pressed overlay, painting it on the indicator while the row is pressed, except over an indicator that paints its own press (AV1).|`design:user-states/DR1–DR5`|
119
119
| FR12 |`sm` and `md` MUST keep the native input, indicator, focus paint, and row geometry aligned; field `width` MUST size the whole field rather than only the input. | shipped source, tests, and stories |
120
120
| FR13 | With neither `onChange` nor `changeAction`, activation changes nothing the caller can observe. Implementation gap: the checkbox declares no read-only or unavailable state; its meaning is OQ1 (Current-state impact). | shared checkbox known-failure record |
121
121
122
122
### Allowed variation
123
123
124
-
-**AV1 — Indicator replacement.** A theme may replace the named checkbox indicator if it preserves the Indicator prop and decorative ownership contracts; CheckboxInput still paints focus and pressed feedback on the resolved root.
124
+
-**AV1 — Indicator replacement.** A theme may replace the named checkbox indicator if it preserves the Indicator prop and decorative ownership contracts; CheckboxInput still paints focus and pressed feedback on the resolved root. The one exception: a first-party replacement indicator may paint its own press from the row's hover and press (an internal marker; not public API), while CheckboxInput still paints focus.
125
125
-**AV2 — Theme paint.** Canonical component targets and semantic tokens may change admitted visual properties without changing native semantics, state precedence, or interaction ownership.
126
126
-**AV3 — Caller field content.** Label, description, status text, icon/content, and width may vary within their public types.
127
127
@@ -187,7 +187,7 @@ The consumer record includes composed targets owned by CheckboxIndicator, FieldL
187
187
| FR8 |`CheckboxInput.test.tsx` passthrough, id, ref, and rest-precedence cases | Caller `id`, `data-*`, ref | A caller prop overriding `checked`, `disabled`, or `type` fails. |`audit:CheckboxInput/api`|
188
188
| FR9 |`CheckboxInput.test.tsx` label-target case; `themingTargets.test.ts`| Label; built-in indicator | A missing label target, or a rendered class absent from the documented targets, fails. Evidence gap: no test asserts the root `checkbox-input` target. |`audit:CheckboxInput/theming`|
189
189
| FR10, AR3 |`CheckboxInput.test.tsx` focus-ring ownership suite | Built-in and prop-dropping replacement indicators; blur | A ring on the wrong element, or none, fails. |`audit:CheckboxInput/a11y`|
190
-
| FR11 |`CheckboxInput.test.tsx` pressed-state suite | Enabled press; disabled; touch fade | A missing overlay, or one on a disabled box, fails. |`audit:CheckboxInput/visual`|
190
+
| FR11 |`CheckboxInput.test.tsx` pressed-state suite and its suite for an indicator that paints its own press| Enabled press; disabled; touch fade | A missing overlay, or one on a disabled box, fails. |`audit:CheckboxInput/visual`|
191
191
| FR12, AR5 |`CheckboxInput.test.tsx` coarse-pointer, RTL, and forced-colors suites |`sm`, `md`; RTL; forced colors | A misplaced hit target or a mark lost in forced colors fails. Evidence gap: no test asserts field `width`. |`audit:CheckboxInput/layout`|
192
192
| ORD1–ORD4, PR1 | ORD4 is covered by the FR8 rest-precedence case and ORD3 by the shared accessibility suite's disabled, disabled-reason, and read-only states. Evidence gap: no test asserts the optimistic value between `value` and the indicator (ORD1), the `preventDefault` check before `changeAction` (ORD2), or the absence of global listeners | — | — |`audit:CheckboxInput/behavior`|
Copy file name to clipboardExpand all lines: packages/core/src/CheckboxInput/CheckboxInput.doc.mjs
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,15 @@ export const docs = {
151
151
},
152
152
{className: 'astryx-checkbox-label'},
153
153
],
154
+
vars: [
155
+
{
156
+
name: '--_indicator-press-image',
157
+
description:
158
+
"The row's touch press image, handed down to a first-party indicator that paints its own press. Set from the press paint only while the row itself is pressed; only this row declares it.",
0 commit comments