@astryxdesign/core 0.7.6-canary.f29e90e → 0.7.6-canary.f67d5fa
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/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +8 -4
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +10 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +19 -9
- package/package.json +4 -4
- package/src/DateRangeInput/DateRangeInput.tsx +18 -3
- package/src/Lightbox/Lightbox.spec.md +249 -61
- package/src/Link/Link.tsx +9 -2
- package/src/MultiSelector/MultiSelector.tsx +19 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAW9C,YAAY,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,SAAS,CAAC;CAC3B;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,YAAY,EACV,WAAW,IAAI,oBAAoB,EACnC,eAAe,IAAI,wBAAwB,GAC5C,MAAM,UAAU,CAAC;AAuLlB,MAAM,WAAW,mBAAoB,SAA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GG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,QAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,cAAkB,EAClB,YAAY,EACZ,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,GAAG,SAAS,EACb,EAAE,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AA4CA,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,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ACZ,YAAY,EACZ,OAAO,EACP,QAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,cAAkB,EAClB,YAAY,EACZ,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,GAAG,SAAS,EACb,EAAE,mBAAmB,+BA2WrB;yBA9Ye,cAAc"}
|
|
@@ -281,7 +281,7 @@ export function DateRangeInput({
|
|
|
281
281
|
dateConstraints
|
|
282
282
|
});
|
|
283
283
|
const fireChange = useCallback(newValue => {
|
|
284
|
-
if (
|
|
284
|
+
if (isEffectivelyDisabled) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
287
|
onChange(newValue);
|
|
@@ -291,7 +291,7 @@ export function DateRangeInput({
|
|
|
291
291
|
await changeAction(newValue);
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
-
}, [
|
|
294
|
+
}, [isEffectivelyDisabled, onChange, changeAction, startTransition, setOptimisticValue]);
|
|
295
295
|
const handleToggle = useCallback(() => {
|
|
296
296
|
if (!isEffectivelyDisabled) {
|
|
297
297
|
if (popover.isOpen) {
|
|
@@ -302,9 +302,12 @@ export function DateRangeInput({
|
|
|
302
302
|
}
|
|
303
303
|
}, [isEffectivelyDisabled, popover]);
|
|
304
304
|
const handleRangeSelect = useCallback(range => {
|
|
305
|
+
if (isDisabled) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
305
308
|
fireChange(range);
|
|
306
309
|
popover.hide();
|
|
307
|
-
}, [fireChange, popover]);
|
|
310
|
+
}, [isDisabled, fireChange, popover]);
|
|
308
311
|
const triggerRef = useRef(null);
|
|
309
312
|
// The busy Spinner is decorative; this control announces its busy start
|
|
310
313
|
// (spec:AST-086 FR8).
|
|
@@ -432,7 +435,7 @@ export function DateRangeInput({
|
|
|
432
435
|
children: presets.map(preset => {
|
|
433
436
|
const presetRange = preset.getRange();
|
|
434
437
|
const isActive = isRangeEqual(value, presetRange);
|
|
435
|
-
const isPresetDisabled = !isRangeWithinSpan(presetRange, maxRangeSpan, minRangeSpan) || isDateDisabled(plainDateFromISO(presetRange.start)) || isDateDisabled(plainDateFromISO(presetRange.end));
|
|
438
|
+
const isPresetDisabled = isDisabled || !isRangeWithinSpan(presetRange, maxRangeSpan, minRangeSpan) || isDateDisabled(plainDateFromISO(presetRange.start)) || isDateDisabled(plainDateFromISO(presetRange.end));
|
|
436
439
|
return /*#__PURE__*/_jsx("button", {
|
|
437
440
|
type: "button"
|
|
438
441
|
// These presets are independent action buttons navigated by
|
|
@@ -445,6 +448,7 @@ export function DateRangeInput({
|
|
|
445
448
|
// Focusable while disabled (AR3, spec:AST-085 FR1).
|
|
446
449
|
,
|
|
447
450
|
"aria-disabled": isPresetDisabled || undefined,
|
|
451
|
+
"aria-describedby": showsDisabledMessage ? disabledMessageTooltip.describedBy : undefined,
|
|
448
452
|
onClick: () => {
|
|
449
453
|
if (!isPresetDisabled) {
|
|
450
454
|
handleRangeSelect(presetRange);
|
package/dist/Link/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAc5C,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AA8G/C,MAAM,WAAW,SAAU,SAAQ,SAAS,CAC1C,iBAAiB,GAAG,iBAAiB,CACtC;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,G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Link.js
CHANGED
|
@@ -26,7 +26,7 @@ import { useLinkComponent } from "./useLinkComponent.js";
|
|
|
26
26
|
import { mergeProps } from "../utils/index.js";
|
|
27
27
|
import { computeTargetAndRel } from "./computeTargetAndRel.js";
|
|
28
28
|
import { useInteractiveRole } from "../hooks/useInteractiveRole.js";
|
|
29
|
-
import { themeProps } from "../utils/themeProps.js";
|
|
29
|
+
import { themeDataAttributes, themeProps } from "../utils/themeProps.js";
|
|
30
30
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
31
31
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
32
32
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
@@ -178,6 +178,12 @@ export function Link({
|
|
|
178
178
|
// When role resolves to 'button' (no href, or context-provided),
|
|
179
179
|
// render as a <button> with link styling for semantic correctness.
|
|
180
180
|
const renderAsButton = role === 'button' || role === 'inert' && href == null;
|
|
181
|
+
|
|
182
|
+
// The reflected theme attributes win over a caller's same-named `data-*`, so
|
|
183
|
+
// theme targeting always sees the real value (public-component-api INV5).
|
|
184
|
+
const reflectedAttributes = themeDataAttributes({
|
|
185
|
+
color
|
|
186
|
+
});
|
|
181
187
|
const sharedContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
182
188
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
183
189
|
type: type,
|
|
@@ -213,6 +219,7 @@ export function Link({
|
|
|
213
219
|
// colour change above, so a press is the one background it paints.
|
|
214
220
|
!isDisabled && interactionOverlayStyles.pressedBackgroundColor, hasUnderline && styles.hasUnderline, isStandalone && styles.standalone, isDisabled && styles.disabled, maxLines > 0 && styles.truncating, xstyle), className, style),
|
|
215
221
|
...props,
|
|
222
|
+
...reflectedAttributes,
|
|
216
223
|
...(isDisabled ? disabledInteractionProps(props.onKeyDown) : null),
|
|
217
224
|
children: sharedContent
|
|
218
225
|
});
|
|
@@ -233,6 +240,7 @@ export function Link({
|
|
|
233
240
|
color
|
|
234
241
|
}), focusOutlineProps.focusVisible(styles.base, linkColorStyles[color], hasUnderline && styles.hasUnderline, isStandalone && styles.standalone, styles.disabled, maxLines > 0 && styles.truncating, xstyle), className, style),
|
|
235
242
|
...props,
|
|
243
|
+
...reflectedAttributes,
|
|
236
244
|
...disabledInteractionProps(props.onKeyDown),
|
|
237
245
|
children: sharedContent
|
|
238
246
|
});
|
|
@@ -251,6 +259,7 @@ export function Link({
|
|
|
251
259
|
color
|
|
252
260
|
}), focusOutlineProps.focusVisible(styles.base, linkColorStyles[color], !isDisabled && interactionOverlayStyles.pressedBackgroundColor, hasUnderline && styles.hasUnderline, isStandalone && styles.standalone, isDisabled && styles.disabled, maxLines > 0 && styles.truncating, xstyle), className, style),
|
|
253
261
|
...props,
|
|
262
|
+
...reflectedAttributes,
|
|
254
263
|
children: sharedContent
|
|
255
264
|
});
|
|
256
265
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelector.d.ts","sourceRoot":"","sources":["../../src/MultiSelector/MultiSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAWZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAcpD,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAoBjB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAW9C,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAub3E,MAAM,MAAM,iBA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N,aAA0B,EAC1B,YAAY,EACZ,SAAS,EACT,QAAgB,EAChB,YAAoB,EACpB,cAAc,EAAE,uBAAuB,EACvC,SAAiB,EACjB,iBAAiB,EAAE,0BAA0B,EAC7C,SAAS,EAAE,kBAAkB,EAC7B,eAAe,EAAE,wBAAwB,EACzC,SAAiB,EACjB,cAAwB,EACxB,WAAW,EACX,SAAa,EACb,YAAY,EACZ,iBAA2B,EAC3B,YAAwB,EACxB,aAAqB,EACrB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EACF,OAAO,EACP,OAAO,EACP,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,mBAAmB,EACvC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,SAAS,EACb,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAkoDvB;yBAzrDe,aAAa"}
|
|
@@ -470,11 +470,9 @@ export function MultiSelector({
|
|
|
470
470
|
// (spec:AST-086 FR8).
|
|
471
471
|
useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), triggerRef);
|
|
472
472
|
|
|
473
|
-
// Disabled-reason tooltip
|
|
474
|
-
//
|
|
475
|
-
//
|
|
476
|
-
// disabled attribute. Activation is blocked by the isDisabled guards in
|
|
477
|
-
// useMultiCombobox (onTriggerClick / onKeyDown).
|
|
473
|
+
// Disabled-reason tooltip listeners attach to the existing trigger container.
|
|
474
|
+
// The trigger stays focusable via aria-disabled. Trigger guards and the value
|
|
475
|
+
// commit guards below block activation, including from an already-open panel.
|
|
478
476
|
const showsDisabledMessage = isDisabled && !!disabledMessage;
|
|
479
477
|
const disabledMessageTooltip = useTooltip({
|
|
480
478
|
placement: 'above',
|
|
@@ -814,6 +812,9 @@ export function MultiSelector({
|
|
|
814
812
|
// Clear all selected values. Shared by the clear button and the keyboard
|
|
815
813
|
// Delete/Backspace path so clearing is reachable without a mouse.
|
|
816
814
|
const clearValues = useCallback(() => {
|
|
815
|
+
if (isDisabled) {
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
817
818
|
onChange([]);
|
|
818
819
|
announceSelection([]);
|
|
819
820
|
if (changeAction) {
|
|
@@ -822,7 +823,7 @@ export function MultiSelector({
|
|
|
822
823
|
await changeAction([]);
|
|
823
824
|
});
|
|
824
825
|
}
|
|
825
|
-
}, [onChange, changeAction, startTransition, setOptimisticValue, announceSelection]);
|
|
826
|
+
}, [isDisabled, onChange, changeAction, startTransition, setOptimisticValue, announceSelection]);
|
|
826
827
|
|
|
827
828
|
// Whether there is at least one selected value (clearing is meaningful).
|
|
828
829
|
const hasValue = optimisticValue.length > 0;
|
|
@@ -839,6 +840,9 @@ export function MultiSelector({
|
|
|
839
840
|
}
|
|
840
841
|
}, [clearValues]);
|
|
841
842
|
const handleToggle = useCallback(itemValue => {
|
|
843
|
+
if (isDisabled) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
842
846
|
const newValue = optimisticValue.includes(itemValue) ? optimisticValue.filter(v => v !== itemValue) : [...optimisticValue, itemValue];
|
|
843
847
|
onChange(newValue);
|
|
844
848
|
announceSelection(newValue);
|
|
@@ -848,7 +852,7 @@ export function MultiSelector({
|
|
|
848
852
|
await changeAction(newValue);
|
|
849
853
|
});
|
|
850
854
|
}
|
|
851
|
-
}, [optimisticValue, onChange, changeAction, startTransition, setOptimisticValue, announceSelection]);
|
|
855
|
+
}, [isDisabled, optimisticValue, onChange, changeAction, startTransition, setOptimisticValue, announceSelection]);
|
|
852
856
|
|
|
853
857
|
// Select-all logic
|
|
854
858
|
const enabledItems = useMemo(() => filteredItems.filter(item => !item.disabled), [filteredItems]);
|
|
@@ -856,6 +860,9 @@ export function MultiSelector({
|
|
|
856
860
|
const someSelected = useMemo(() => enabledItems.some(item => optimisticValue.includes(item.value)), [enabledItems, optimisticValue]);
|
|
857
861
|
const selectAllState = allEnabledSelected ? true : someSelected ? 'indeterminate' : false;
|
|
858
862
|
const handleSelectAll = useCallback(() => {
|
|
863
|
+
if (isDisabled) {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
859
866
|
let newValue;
|
|
860
867
|
if (allEnabledSelected) {
|
|
861
868
|
// Deselect all enabled items, keep disabled items that are selected
|
|
@@ -879,13 +886,16 @@ export function MultiSelector({
|
|
|
879
886
|
await changeAction(newValue);
|
|
880
887
|
});
|
|
881
888
|
}
|
|
882
|
-
}, [allEnabledSelected, enabledItems, optimisticValue, onChange, changeAction, startTransition, setOptimisticValue, announceSelection]);
|
|
889
|
+
}, [isDisabled, allEnabledSelected, enabledItems, optimisticValue, onChange, changeAction, startTransition, setOptimisticValue, announceSelection]);
|
|
883
890
|
|
|
884
891
|
// Picking the create row: the typed text joins the value and the caller is
|
|
885
892
|
// told it is a creation on the channel it already listens to, so adding the
|
|
886
893
|
// option and accepting the value are one update. The search is cleared so
|
|
887
894
|
// the option the caller adds is visible.
|
|
888
895
|
const commitCreate = useCallback(query => {
|
|
896
|
+
if (isDisabled) {
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
889
899
|
const newValue = optimisticValue.includes(query) ? optimisticValue : [...optimisticValue, query];
|
|
890
900
|
onChange(newValue, {
|
|
891
901
|
type: 'create',
|
|
@@ -901,7 +911,7 @@ export function MultiSelector({
|
|
|
901
911
|
await changeAction(newValue);
|
|
902
912
|
});
|
|
903
913
|
}
|
|
904
|
-
}, [optimisticValue, onChange, changeAction, startTransition, setOptimisticValue, announce, t]);
|
|
914
|
+
}, [isDisabled, optimisticValue, onChange, changeAction, startTransition, setOptimisticValue, announce, t]);
|
|
905
915
|
|
|
906
916
|
// Route toggle: select-all sentinel → handleSelectAll, the create row →
|
|
907
917
|
// commitCreate, everything else → handleToggle
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.6-canary.
|
|
3
|
+
"version": "0.7.6-canary.f67d5fa",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -860,9 +860,9 @@
|
|
|
860
860
|
"react-dom": ">=19.0.0"
|
|
861
861
|
},
|
|
862
862
|
"devDependencies": {
|
|
863
|
-
"@astryxdesign/a11y-spec": "0.7.6-canary.
|
|
864
|
-
"@astryxdesign/cli": "0.7.6-canary.
|
|
865
|
-
"@astryxdesign/interaction-harness": "0.7.6-canary.
|
|
863
|
+
"@astryxdesign/a11y-spec": "0.7.6-canary.f67d5fa",
|
|
864
|
+
"@astryxdesign/cli": "0.7.6-canary.f67d5fa",
|
|
865
|
+
"@astryxdesign/interaction-harness": "0.7.6-canary.f67d5fa",
|
|
866
866
|
"@babel/cli": "^7.29.7",
|
|
867
867
|
"@babel/core": "^7.29.7",
|
|
868
868
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -613,7 +613,7 @@ export function DateRangeInput({
|
|
|
613
613
|
|
|
614
614
|
const fireChange = useCallback(
|
|
615
615
|
(newValue: DateRange | null) => {
|
|
616
|
-
if (
|
|
616
|
+
if (isEffectivelyDisabled) {
|
|
617
617
|
return;
|
|
618
618
|
}
|
|
619
619
|
onChange(newValue);
|
|
@@ -624,7 +624,13 @@ export function DateRangeInput({
|
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
|
-
[
|
|
627
|
+
[
|
|
628
|
+
isEffectivelyDisabled,
|
|
629
|
+
onChange,
|
|
630
|
+
changeAction,
|
|
631
|
+
startTransition,
|
|
632
|
+
setOptimisticValue,
|
|
633
|
+
],
|
|
628
634
|
);
|
|
629
635
|
|
|
630
636
|
const handleToggle = useCallback(() => {
|
|
@@ -639,10 +645,13 @@ export function DateRangeInput({
|
|
|
639
645
|
|
|
640
646
|
const handleRangeSelect = useCallback(
|
|
641
647
|
(range: DateRange) => {
|
|
648
|
+
if (isDisabled) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
642
651
|
fireChange(range);
|
|
643
652
|
popover.hide();
|
|
644
653
|
},
|
|
645
|
-
[fireChange, popover],
|
|
654
|
+
[isDisabled, fireChange, popover],
|
|
646
655
|
);
|
|
647
656
|
|
|
648
657
|
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
@@ -813,6 +822,7 @@ export function DateRangeInput({
|
|
|
813
822
|
const presetRange = preset.getRange();
|
|
814
823
|
const isActive = isRangeEqual(value, presetRange);
|
|
815
824
|
const isPresetDisabled =
|
|
825
|
+
isDisabled ||
|
|
816
826
|
!isRangeWithinSpan(presetRange, maxRangeSpan, minRangeSpan) ||
|
|
817
827
|
isDateDisabled(plainDateFromISO(presetRange.start)) ||
|
|
818
828
|
isDateDisabled(plainDateFromISO(presetRange.end));
|
|
@@ -828,6 +838,11 @@ export function DateRangeInput({
|
|
|
828
838
|
aria-current={isActive ? 'true' : undefined}
|
|
829
839
|
// Focusable while disabled (AR3, spec:AST-085 FR1).
|
|
830
840
|
aria-disabled={isPresetDisabled || undefined}
|
|
841
|
+
aria-describedby={
|
|
842
|
+
showsDisabledMessage
|
|
843
|
+
? disabledMessageTooltip.describedBy
|
|
844
|
+
: undefined
|
|
845
|
+
}
|
|
831
846
|
onClick={() => {
|
|
832
847
|
if (!isPresetDisabled) {
|
|
833
848
|
handleRangeSelect(presetRange);
|
|
@@ -3,31 +3,34 @@ schema_version: 3
|
|
|
3
3
|
template_version: 3
|
|
4
4
|
kind: component
|
|
5
5
|
id: component:Lightbox
|
|
6
|
-
authority:
|
|
6
|
+
authority: current
|
|
7
7
|
archive_reason: null
|
|
8
8
|
superseded_by: null
|
|
9
|
-
approved_by:
|
|
10
|
-
approved_at:
|
|
9
|
+
approved_by: cixzhang
|
|
10
|
+
approved_at: 2026-10-31
|
|
11
11
|
owners: [cixzhang]
|
|
12
|
-
review_triggers: [behavior, theming, accessibility]
|
|
12
|
+
review_triggers: [public-api, behavior, interaction, theming, accessibility]
|
|
13
13
|
verified_by:
|
|
14
14
|
[
|
|
15
15
|
packages/core/src/Lightbox/Lightbox.test.tsx,
|
|
16
|
+
packages/core/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts,
|
|
17
|
+
packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts,
|
|
16
18
|
packages/core/src/theme/themingTargets.test.ts,
|
|
17
19
|
scripts/check-knowledge.mjs,
|
|
18
20
|
]
|
|
19
21
|
modules: []
|
|
20
22
|
families: [family:overlay-dismissal]
|
|
21
|
-
design_specs: []
|
|
23
|
+
design_specs: [design:reduced-motion]
|
|
22
24
|
architecture:
|
|
23
25
|
[
|
|
24
26
|
architecture:component-theming-surface,
|
|
25
27
|
architecture:interaction-modality,
|
|
26
28
|
architecture:layer-runtime,
|
|
27
29
|
architecture:public-component-api,
|
|
30
|
+
architecture:react-component-runtime,
|
|
28
31
|
]
|
|
29
32
|
contributing: []
|
|
30
|
-
system_specs: []
|
|
33
|
+
system_specs: [spec:AST-017, spec:AST-020, spec:AST-086, spec:AST-094]
|
|
31
34
|
---
|
|
32
35
|
|
|
33
36
|
# Lightbox component contract
|
|
@@ -35,81 +38,205 @@ system_specs: []
|
|
|
35
38
|
## Intent
|
|
36
39
|
|
|
37
40
|
Lightbox presents one active image or video in a full-viewport viewer and may
|
|
38
|
-
add gallery navigation, a caption, and a position counter.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
add gallery navigation, a caption, and a position counter. On a touch screen it
|
|
42
|
+
behaves like a native photo viewer: a person pinches and double-taps to zoom,
|
|
43
|
+
swipes between items, drags a photo down or pinches it in to close, and taps to
|
|
44
|
+
hide the controls. Every gesture has a button, key, or single-pointer
|
|
45
|
+
alternative, so keyboard, screen-reader, and single-pointer users reach the
|
|
46
|
+
same actions.
|
|
41
47
|
|
|
42
48
|
## Compatibility and migration
|
|
43
49
|
|
|
44
|
-
- Released default preserved: `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
50
|
+
- Released default preserved: `no`. Under a coarse primary pointer the touch
|
|
51
|
+
presentation (FR5–FR10) and the touch exit (FR16) are the default
|
|
52
|
+
(`spec:AST-094` FR13). Under a fine pointer a mouse or pen drag pages and
|
|
53
|
+
closes the viewer, a ctrl-wheel or trackpad pinch over the photo zooms the
|
|
54
|
+
photo instead of the page, a wheel pans a zoomed photo, and a double-click
|
|
55
|
+
zooms 2× about the clicked point instead of the centre (FR11). Preserved: a
|
|
56
|
+
click on the photo keeps the controls, the viewer opens at once under every
|
|
57
|
+
pointer and closes at once under a fine pointer, keyboard zoom stays 2× about
|
|
58
|
+
the centre, and video playback and controls are unchanged; a drag on a video
|
|
59
|
+
item's frame pages (FR7)
|
|
60
|
+
- Compatibility class: additive behavior, released in three kinds under
|
|
61
|
+
`spec:AST-017`. `[fix]` under FR53, as accessibility conformance: Tab
|
|
62
|
+
containment (FR4), the double-click about the clicked point (AR2), the `0`
|
|
63
|
+
key (AR3), and position and zoom announcements delivered inside the open
|
|
64
|
+
viewer with the zoom level (AR4). `[feat]`: the touch presentation and touch
|
|
65
|
+
exit (FR5–FR10, FR16) and the fine-pointer gestures (FR11), which are named
|
|
66
|
+
cross-device consistency under FR59 and need fine-pointer evidence before and
|
|
67
|
+
after. `[experimental]`: the thumbnail transition and `experimental.sourceFor`
|
|
68
|
+
(FR12, FR21)
|
|
69
|
+
- Controlled/uncontrolled behavior: unchanged; a swipe reports through
|
|
70
|
+
`onIndexChange`, and a controlled `index` the caller refuses springs back
|
|
71
|
+
- Migration decision: none required. `hasZoom={false}` turns off FR6, FR9, and
|
|
72
|
+
FR10 (FR13)
|
|
49
73
|
|
|
50
74
|
Consumer migration instructions belong in consumer docs and release notes.
|
|
51
75
|
|
|
76
|
+
## Current-state impact
|
|
77
|
+
|
|
78
|
+
The shipped Lightbox does not yet meet every requirement below. Each gap names
|
|
79
|
+
the requirement it misses and the person it affects.
|
|
80
|
+
|
|
81
|
+
- **Touch presentation (FR5–FR10, FR12).** On a touch screen a pinch zooms the
|
|
82
|
+
page instead of the photo, a double tap zooms 2× about the centre, and there
|
|
83
|
+
is no swipe paging, drag or pinch to close, tap to hide the controls, or
|
|
84
|
+
thumbnail transition.
|
|
85
|
+
- **Tab containment (FR4).** Tab from the viewer's last control can move focus
|
|
86
|
+
to the browser's own interface.
|
|
87
|
+
- **Single-pointer pan (AR2, FR11).** A double-click zooms 2× about the centre,
|
|
88
|
+
not about the clicked point, so a single-pointer user can reach a zoomed
|
|
89
|
+
photo's edge only by dragging.
|
|
90
|
+
- **Zoom reset key (AR3).** `0` does not return a zoomed photo to its fitted
|
|
91
|
+
size.
|
|
92
|
+
- **Zoom announcement (AR4).** A zoom change announces "zoomed in" or "zoomed
|
|
93
|
+
out" without the zoom level.
|
|
94
|
+
- **Announcements outside the open viewer (AR4).** Position and zoom messages
|
|
95
|
+
are sent from above the modal Lightbox renders, so they reach the page body
|
|
96
|
+
and a screen-reader user does not hear them while the viewer is open
|
|
97
|
+
(`spec:AST-086` FR14).
|
|
98
|
+
- **Lightbox-owned pan listeners (FR14).** The pan drag registers Lightbox's
|
|
99
|
+
own `window` pointer listeners instead of using the shared touch modules.
|
|
100
|
+
- **Fine-pointer gestures (FR11).** A mouse drag on a fitted photo does
|
|
101
|
+
nothing, a ctrl-wheel zooms the page, and a wheel does not pan a zoomed photo.
|
|
102
|
+
- **Touch exit (FR16).** On a touch screen the viewer disappears at once when
|
|
103
|
+
it closes.
|
|
104
|
+
|
|
52
105
|
## Ownership boundary
|
|
53
106
|
|
|
54
107
|
**Owns**
|
|
55
108
|
|
|
56
109
|
- The Viewer overlay and its current `lightbox` target.
|
|
57
|
-
- Media presentation, optional Caption and Counter placement, gallery
|
|
58
|
-
|
|
110
|
+
- Media presentation, optional Caption and Counter placement, gallery
|
|
111
|
+
navigation, image zoom and pan, the touch presentation (FR5–FR12), and the
|
|
112
|
+
touch exit (FR16).
|
|
113
|
+
- The accessible alternative for every gesture it presents (AR1–AR8).
|
|
59
114
|
|
|
60
115
|
**Does not own / non-goals**
|
|
61
116
|
|
|
62
117
|
- The Close, Previous, and Next button surfaces — delegated to
|
|
63
118
|
`component:Button` through IconButton.
|
|
64
119
|
- Caller-provided Caption content.
|
|
65
|
-
- New targets for Media, Caption, or Counter; none exist
|
|
66
|
-
- Shared layer hosting or dismissal policy
|
|
120
|
+
- New targets for Media, Caption, or Counter; none exist.
|
|
121
|
+
- Shared layer hosting or dismissal policy — owned by
|
|
122
|
+
`architecture:layer-runtime` and `family:overlay-dismissal`.
|
|
123
|
+
- Touch physics, measured values, and motion roles' values — owned by
|
|
124
|
+
`spec:AST-094` and its measured motion table.
|
|
67
125
|
|
|
68
126
|
## Public concepts
|
|
69
127
|
|
|
70
|
-
No new public concept is introduced.
|
|
71
|
-
|
|
128
|
+
No new stable public concept is introduced. `experimental.sourceFor` is an
|
|
129
|
+
experimental option inside the `experimental` prop object (`spec:AST-017`
|
|
130
|
+
FR21). Consumer props and usage remain documented in `Lightbox.doc.mjs`.
|
|
72
131
|
|
|
73
132
|
## Behavioral and layout contract
|
|
74
133
|
|
|
75
|
-
| ID
|
|
76
|
-
|
|
|
77
|
-
| FR1
|
|
78
|
-
| FR2
|
|
79
|
-
| FR3
|
|
80
|
-
| FR4
|
|
134
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
135
|
+
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | --------------------------- |
|
|
136
|
+
| FR1 | The viewer contains one active Media item and a Close button; galleries additionally contain Previous and Next buttons plus a Counter, and Caption renders only when supplied. | Current source, docs, and tests | settled |
|
|
137
|
+
| FR2 | Viewer overlay carries the current `lightbox` target. Media, Caption, and Counter carry no Lightbox public target. | Current source and public docs | settled |
|
|
138
|
+
| FR3 | Close, Previous, and Next button surfaces use Button's `button` target through IconButton rather than Lightbox-owned button targets. | Current source and target docs | settled |
|
|
139
|
+
| FR4 | The open viewer is a focus region through Core's shared focus-region module (`component:Dialog/DEC-2`): Tab from its last control moves focus to its first and Shift+Tab from its first moves focus to its last, so focus never leaves the viewer for the browser's own interface. | `component:Dialog/DEC-2` | settled; implementation gap |
|
|
140
|
+
| FR5 | Under a coarse primary pointer, after hydration, Lightbox presents FR6–FR10 with no opt-in. Every spring, duration, and curve they play is a named motion role (zoom settle, page settle, dismiss, pinch close, controls fade, zoom transition) read through the motion role table, never a literal. Under reduced motion they follow AR6. | `spec:AST-094` FR4, FR13 | settled; implementation gap |
|
|
141
|
+
| FR6 | With `hasZoom`, on an image, a pinch zooms about the fingers and pans while it zooms; past the minimum or maximum the photo resists and eases back without overshoot. A double tap zooms to the larger of filling the viewer and 2×, about the tapped point; a second double tap returns to the fitted size. A zoomed photo pans with momentum and rubber-band edges. A pinch on the controls or the caption still zooms the page. | `spec:AST-094` FR3, FR10 | settled; implementation gap |
|
|
142
|
+
| FR7 | In a gallery, a horizontal drag moves the row of items, which sit apart by the measured gap. The release lands on at most one neighbouring item by the projection rule. Paging applies over a video item's frame as over a photo; a drag that starts on the video's own controls, such as its scrubber or volume, stays the video's. A zoomed photo pans to its edge before a new drag pages. A pinch never pages. Previous, Next, and the arrow keys keep paging. A controlled `index` the caller refuses springs back. `onIndexChange` reports a swipe. | `spec:AST-094` FR14, FR36–FR39 | settled; implementation gap |
|
|
143
|
+
| FR8 | On a fitted image, a downward drag moves the photo with the finger, shrinks it, and fades the backdrop. The release decides once: a projected travel past the commit point closes the viewer and reports `onOpenChange(false)` at the lift; a release moving back springs back. Video is unchanged. | `spec:AST-094` FR36–FR40 | settled; implementation gap |
|
|
144
|
+
| FR9 | With `hasZoom`, a pinch in from the fitted size is a release decision: below the measured fraction of the fitted size the release closes the viewer; opening the fingers again by the measured amount before the lift is moving back and cancels. A pinch that starts zoomed in never closes the viewer. | `spec:AST-094` FR36, FR37 | settled; implementation gap |
|
|
145
|
+
| FR10 | With `hasZoom`, under a coarse pointer only, a tap on the photo fades the controls and caption and darkens the backdrop. While they are hidden, the next tap on the photo, a tap beside the photo, or a cancelled drag brings them back, and that tap beside the photo does not close the viewer (ORD3). AR5 governs keyboard and assistive-technology access while they are hidden. | `architecture:public-component-api` INV16 | settled; implementation gap |
|
|
146
|
+
| FR11 | A mouse, a pen, and a trackpad also use FR7's drag paging, FR8's drag to close, a ctrl-wheel or trackpad pinch over the photo for FR6's zoom and FR9's close, and a wheel to pan a zoomed photo; over the photo these replace the browser's page zoom and scroll. A double-click zooms 2× about the clicked point. A click on the photo keeps the controls, and the viewer opens and closes at once. | `spec:AST-094` FR43; `spec:AST-017` FR59 | settled; implementation gap |
|
|
147
|
+
| FR12 | Inside `experimental` only, under a coarse pointer, the photo grows out of its source when the viewer opens and returns into it when it closes: the element `experimental.sourceFor(index)` returns, else the opener when it shows a picture. A close reports `onOpenChange(false)` at the request; the viewer stays only until the photo lands. Pointer input during the entrance is held; keys and assistive technology stay live. Without `experimental`, opening is unchanged and closing plays FR16. | `spec:AST-017` FR21; `spec:AST-094` FR35 | settled; implementation gap |
|
|
148
|
+
| FR13 | `hasZoom={false}` turns off FR6, FR9, and FR10. FR7 and FR8 add to the buttons, keys, and Escape and remove none of them, so Lightbox takes no `presentation` prop. | `architecture:public-component-api` INV16 | settled |
|
|
149
|
+
| FR14 | Gestures, paging, motion, and reduced motion run through Core's one shared set of internal touch modules; Lightbox bundles no copy of a module's primitive and adds no gesture listener outside them. | `architecture:react-component-runtime` INV13 | settled; implementation gap |
|
|
150
|
+
| FR15 | Lightbox supports a Picture-in-Picture window as its only second document; there it ranks Escape and platform close among that window's members. | `family:overlay-dismissal` FR8 | settled |
|
|
151
|
+
| FR16 | Under a coarse primary pointer, a close that is not a drag down (FR8), a pinch in (FR9), or a return into a source (FR12) plays the touch exit: Close, Escape, a platform close, and a tap beside the photo while the controls are shown (ORD3). The photo shrinks a little and fades out in place with the backdrop and controls, as the native viewer's zoom transition does without a source, on its named motion role. `onOpenChange(false)` reports at the request, and the viewer takes no input while the exit plays. Under a fine pointer the viewer closes at once (FR11). | `spec:AST-094` FR7 | settled; implementation gap |
|
|
81
152
|
|
|
82
153
|
### Allowed variation
|
|
83
154
|
|
|
84
|
-
- **AV1 — Media mode.** Media may be an image or video; zoom
|
|
85
|
-
|
|
155
|
+
- **AV1 — Media mode.** Media may be an image or video; zoom, pan, drag down to
|
|
156
|
+
close, pinch to close, and the tap that hides the controls are available only
|
|
157
|
+
on images. Paging applies to both (FR7).
|
|
86
158
|
- **AV2 — Gallery mode.** Previous, Next, and Counter are absent for a single
|
|
87
159
|
item. Navigation button disabled state follows the current gallery boundary.
|
|
88
160
|
- **AV3 — Caption content.** Caller-provided Caption content may vary without
|
|
89
161
|
becoming a Lightbox-owned target.
|
|
162
|
+
- **AV4 — Measured values.** Thresholds, gaps, commit points, and timings may
|
|
163
|
+
change with the measured motion table without changing this record.
|
|
90
164
|
|
|
91
165
|
### Representative states
|
|
92
166
|
|
|
93
|
-
| State | Required invariant
|
|
94
|
-
| ---------------- |
|
|
95
|
-
| Single image | Viewer overlay, Media, and Close button render.
|
|
96
|
-
| Gallery boundary | Both navigation buttons and Counter remain rendered.
|
|
97
|
-
| Video | Media renders native video controls without image zoom interaction.
|
|
98
|
-
| Captioned media | Caption follows the active Media inside the centered media group.
|
|
167
|
+
| State | Required invariant | Allowed variation |
|
|
168
|
+
| ---------------- | --------------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
169
|
+
| Single image | Viewer overlay, Media, and Close button render. | Caption and zoom may be absent or present. |
|
|
170
|
+
| Gallery boundary | Both navigation buttons and Counter remain rendered. | Previous or Next is disabled at its boundary. |
|
|
171
|
+
| Video | Media renders native video controls without image zoom interaction. | Autoplay follows the existing consumer prop. |
|
|
172
|
+
| Captioned media | Caption follows the active Media inside the centered media group. | Caption content remains caller-provided. |
|
|
173
|
+
| Zoomed image | A double tap or double-click, `-`, or `0` returns to the fitted size. | The zoom level and pan position. |
|
|
174
|
+
| Controls hidden | Controls stay focusable and in the accessibility tree; focus or a key brings them back. | Backdrop shade while hidden. |
|
|
99
175
|
|
|
100
176
|
### Transformation and precedence order
|
|
101
177
|
|
|
102
|
-
-
|
|
178
|
+
- **ORD1 — Zoom before paging.** A drag on a zoomed photo pans it until the
|
|
179
|
+
photo's edge; only a new drag from that edge pages (FR7).
|
|
180
|
+
- **ORD2 — Fitted size before closing.** A drag down or a pinch in closes the
|
|
181
|
+
viewer only from the fitted size (FR8, FR9).
|
|
182
|
+
- **ORD3 — Hidden controls before closing.** While the controls are hidden, the
|
|
183
|
+
first tap beside the photo only brings them back; only while they are shown
|
|
184
|
+
does a tap beside the photo close the viewer (FR10, FR16).
|
|
103
185
|
|
|
104
186
|
### Performance and resources
|
|
105
187
|
|
|
106
|
-
-
|
|
188
|
+
- **PR1 — Settles survive a busy page.** Zoom, page, dismiss, and transition
|
|
189
|
+
settles keep moving while the main thread is busy (`spec:AST-094`).
|
|
107
190
|
|
|
108
191
|
## Accessibility contract
|
|
109
192
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
193
|
+
Every expectation below cites its WCAG 2.2 Level A or AA success criterion
|
|
194
|
+
under `spec:AST-020` FR1; reduced motion cites `design:reduced-motion`.
|
|
195
|
+
|
|
196
|
+
- **AR1 — Every multipoint or path gesture has a single-pointer alternative
|
|
197
|
+
(WCAG 2.2 2.5.1).** Pinch zoom has the double tap or double-click (FR6,
|
|
198
|
+
FR11); swipe paging has the Previous and Next buttons (FR7); drag down and
|
|
199
|
+
pinch in to close have the Close button (FR8, FR9).
|
|
200
|
+
- **AR2 — Every drag has a non-drag alternative (WCAG 2.2 2.5.7).** Drag to
|
|
201
|
+
close has the Close button; drag paging has the Previous and Next buttons; a
|
|
202
|
+
zoomed photo's pan has the double tap or double-click, which returns to the
|
|
203
|
+
fitted size, and a double tap or double-click on a point, which zooms in about
|
|
204
|
+
that point (FR6, FR11).
|
|
205
|
+
- **AR3 — Keyboard operation (WCAG 2.2 2.1.1, 2.1.2, 2.4.3).** Escape closes
|
|
206
|
+
the viewer. ArrowLeft and ArrowRight page in the logical direction, so in a
|
|
207
|
+
right-to-left page ArrowLeft moves to the next item. With `hasZoom`, `+` zooms
|
|
208
|
+
in, `-` zooms out, and `0` returns to the fitted size; while zoomed, the arrow
|
|
209
|
+
keys pan the photo. Focus stays inside the viewer (FR4), and on close returns
|
|
210
|
+
to the element that opened the viewer when that element is still connected and
|
|
211
|
+
can receive focus (`family:overlay-dismissal` AV1).
|
|
212
|
+
- **AR4 — Screen-reader semantics and announcements (WCAG 2.2 1.1.1, 4.1.2,
|
|
213
|
+
4.1.3).** The viewer is a modal dialog named by the active item's `alt`, or a
|
|
214
|
+
localized "Media viewer" when it has none. Every item requires `alt`, which
|
|
215
|
+
reaches the image's alternative text or the video's accessible name. Moving to
|
|
216
|
+
another item in an open viewer, by button, key, or swipe, announces the item
|
|
217
|
+
and its position ("<alt>, 3 of 12") once, through the `spec:AST-086` FR14
|
|
218
|
+
route. Every zoom change, by any input, announces the new zoom level once when
|
|
219
|
+
it settles, or that the photo is back at its fitted size.
|
|
220
|
+
- **AR5 — Hidden controls stay reachable (WCAG 2.2 2.1.1, 2.4.11, 4.1.2).**
|
|
221
|
+
FR10 hides the controls visually only: they stay focusable and in the
|
|
222
|
+
accessibility tree. Focus reaching a control, from the keyboard or from
|
|
223
|
+
assistive technology, and any key press inside the viewer bring them back. A
|
|
224
|
+
zoom from the keyboard never hides them.
|
|
225
|
+
- **AR6 — Reduced motion (`design:reduced-motion` DR1–DR3).** Under reduced
|
|
226
|
+
motion, the thumbnail transition, the touch exit, the page settle, the dismiss
|
|
227
|
+
and pinch-close settles, and the controls fade change opacity only and finish
|
|
228
|
+
within 200 ms when the primary pointer is coarse or when the release of a
|
|
229
|
+
touch drag starts them (DR2), including a mouse, pen, or trackpad release
|
|
230
|
+
where the primary pointer is coarse (`spec:AST-094` FR43). Otherwise they
|
|
231
|
+
complete at once (DR3). The momentum coast of a thrown zoomed photo is direct
|
|
232
|
+
movement and continues (DR2). These motions read the named motion roles (FR5), which carry the
|
|
233
|
+
reduced-motion path.
|
|
234
|
+
- **AR7 — Focus visible and not obscured (WCAG 2.2 2.4.7, 2.4.11).** Every
|
|
235
|
+
focusable control and the zoom target show the shared focus indicator. A
|
|
236
|
+
focused control is never hidden by FR10 (AR5), and the caption or counter
|
|
237
|
+
never covers it.
|
|
238
|
+
- **AR8 — The page keeps its own zoom (WCAG 2.2 1.4.4).** A pinch on the
|
|
239
|
+
controls or the caption zooms the page, so their text stays resizable (FR6).
|
|
113
240
|
|
|
114
241
|
## Design relationships
|
|
115
242
|
|
|
@@ -117,11 +244,12 @@ button labels, keyboard behavior, or dismissal behavior.
|
|
|
117
244
|
| ---------------- | -------------------------------------------------------------------- | ------------------------------ | ----------------- | ------------------ |
|
|
118
245
|
| Viewer overlay | Presents the full-viewport dialog and surrounding overlay treatment. | Current source and public docs | Supporting | FR1, FR2 |
|
|
119
246
|
| Media | Presents the active image or video. | Current source and public docs | Prominent | FR1, FR2 |
|
|
120
|
-
| Close button | Provides the persistent viewer dismissal action. | `component:Button` | Supporting | FR1, FR3
|
|
121
|
-
| Previous button | Moves gallery presentation to the preceding item. | `component:Button` | Supporting | FR1, FR3
|
|
122
|
-
| Next button | Moves gallery presentation to the following item. | `component:Button` | Supporting | FR1, FR3
|
|
247
|
+
| Close button | Provides the persistent viewer dismissal action. | `component:Button` | Supporting | FR1, FR3, AR1 |
|
|
248
|
+
| Previous button | Moves gallery presentation to the preceding item. | `component:Button` | Supporting | FR1, FR3, AR1 |
|
|
249
|
+
| Next button | Moves gallery presentation to the following item. | `component:Button` | Supporting | FR1, FR3, AR1 |
|
|
123
250
|
| Caption | Presents caller-provided context below the active Media. | Current source and public docs | Context-dependent | FR1, FR2 |
|
|
124
251
|
| Counter | Presents current gallery position and total. | Current source and tests | Supporting | FR1, FR2 |
|
|
252
|
+
| Reduced motion | `design:reduced-motion/DR1`–`DR3` | prescribed | Supporting | AR6 |
|
|
125
253
|
|
|
126
254
|
Media, Caption, and Counter are stable visible parts, but no current public
|
|
127
255
|
target reaches them. Their `none` dispositions record factual reachability, not
|
|
@@ -163,37 +291,97 @@ a decision that they must remain unthemeable.
|
|
|
163
291
|
|
|
164
292
|
## Family and system relationships
|
|
165
293
|
|
|
294
|
+
- `spec:AST-094` owns touch physics, release decisions, measured values, and
|
|
295
|
+
motion roles; this record names which gestures Lightbox presents and when.
|
|
296
|
+
- `spec:AST-017` owns experimental isolation (FR21) and fine-pointer
|
|
297
|
+
preservation (FR59); FR11 and FR12 apply them.
|
|
298
|
+
- `spec:AST-020` owns the WCAG 2.2 A and AA baseline AR1–AR5, AR7, and AR8 cite.
|
|
299
|
+
- `spec:AST-086` owns how position and zoom announcements are delivered inside
|
|
300
|
+
an open modal (FR14).
|
|
301
|
+
- `design:reduced-motion` owns the reduced-motion representation AR6 applies.
|
|
166
302
|
- `architecture:component-theming-surface` owns anatomy qualification, target
|
|
167
303
|
mapping, delegation, and factual `none` dispositions.
|
|
168
304
|
- `architecture:layer-runtime` owns the current native-dialog host and shared
|
|
169
|
-
layer plumbing; Lightbox retains its
|
|
170
|
-
- `
|
|
171
|
-
|
|
172
|
-
- `architecture:
|
|
173
|
-
|
|
305
|
+
layer plumbing; Lightbox retains its media and local backdrop behavior.
|
|
306
|
+
- `architecture:react-component-runtime` owns the shared internal touch modules
|
|
307
|
+
FR14 uses (INV13).
|
|
308
|
+
- `architecture:public-component-api` owns the caller's way back from touch
|
|
309
|
+
defaults (INV16); FR13 applies it.
|
|
310
|
+
- `family:overlay-dismissal` owns shared Escape and platform-close ordering,
|
|
311
|
+
including per-document ranking (FR8), and records Lightbox as an adopter.
|
|
312
|
+
- `architecture:interaction-modality` owns shared modality boundaries; this
|
|
313
|
+
record changes none.
|
|
174
314
|
|
|
175
315
|
## Verification map
|
|
176
316
|
|
|
177
|
-
| Contract | Verification
|
|
178
|
-
| ------------------- |
|
|
179
|
-
| FR1 | `Lightbox.test.tsx` render, gallery, caption, media, and zoom suites
|
|
180
|
-
| FR2 | Source inspection and `themingTargets.test.ts`
|
|
181
|
-
| FR3 | Source inspection plus Button and IconButton public composition
|
|
182
|
-
|
|
|
317
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
318
|
+
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
319
|
+
| FR1 | `Lightbox.test.tsx` render, gallery, caption, media, and zoom suites | Single image, gallery edges, caption, video | Removing a documented part fails existing role, content, media, or navigation assertions. | `audit:Lightbox/anatomy` |
|
|
320
|
+
| FR2 | Source inspection and `themingTargets.test.ts` | Viewer overlay, Media, Caption, and Counter | Removing the root target or documenting an unshipped child target fails evidence or inventory. | `audit:Lightbox/theming` |
|
|
321
|
+
| FR3 | Source inspection plus Button and IconButton public composition | Close and gallery navigation controls | Re-owning a control surface requires the delegated owner and this map to change. | `audit:Lightbox/theming` |
|
|
322
|
+
| FR4, AR3 | Browser keyboard test: Tab and Shift+Tab at both ends, Escape, arrows in LTR and RTL, `+`, `-`, `0`, close focus | Single image, gallery, zoomed image, removed opener | Focus leaving the viewer, a key without its action, or focus not returning to a connected opener fails. | `audit:Lightbox/accessibility` |
|
|
323
|
+
| FR5–FR10 | Interaction tests on synthetic touch streams with explicit timestamps; Reduce Motion; a busy main thread | Below and past each commit point; a release moving back; a drag on a video's frame and on its scrubber; a tap beside the photo with the controls hidden | A literal timing, a second decision during a settle, a gesture that pages while pinching, a drag on a video's frame that does not page, a drag on its controls that pages, or a tap beside the photo that closes while the controls are hidden fails. | `audit:Lightbox/touch` |
|
|
324
|
+
| FR11 | Fine-pointer browser tests | Double-click, click on the photo, drag, ctrl-wheel, wheel | A double-click that does not zoom 2× about the point, a click that hides the controls, or a fine-pointer close that animates fails. | `audit:Lightbox/touch` |
|
|
325
|
+
| FR6, AR1 | Touch test double-tapping a photo shaped like the screen and a landscape photo | 9:16 photo on a phone viewport, 3:2 photo | A double tap that zooms less than 2×, or not about the tapped point, fails. | `audit:Lightbox/touch` |
|
|
326
|
+
| FR16 | Touch tests closing by Close, Escape, platform close, and a tap beside the photo with the controls shown; Reduce Motion | With and without `experimental`; controls shown and hidden | A touch close without the exit, a literal timing, input reaching the viewer during the exit, or a tap beside the photo that closes while the controls are hidden fails. | `audit:Lightbox/touch` |
|
|
327
|
+
| FR12 | Opener and `sourceFor` tests, with and without `experimental` | Image opener, text-button opener, mid-entrance close | Any change to opening or closing without `experimental` fails. | `audit:Lightbox/touch` |
|
|
328
|
+
| FR13 | `hasZoom={false}` tests under a coarse pointer | Gallery, single image | A zoom, a pinch close, or a tap that hides the controls with `hasZoom={false}` fails. | `audit:Lightbox/touch` |
|
|
329
|
+
| FR14 | Source boundary check and bundle analysis | A page with Lightbox and another touch component | A second copy of a touch module or a Lightbox-owned gesture listener fails. | `audit:Lightbox/touch` |
|
|
330
|
+
| AR1, AR2 | Browser tests that complete every gesture's action with one pointer and no drag | Zoom, page, close, reach a zoomed photo's edge | An action reachable only by a multipoint, path, or drag gesture fails. | `audit:Lightbox/accessibility` |
|
|
331
|
+
| AR4 | Accessibility-tree and announcement tests | Open, page by button, key, and swipe, zoom by every input | A missing dialog name or `alt`, a repeated or missing position announcement, a message not exposed inside the open viewer, or a zoom without its level fails. | `audit:Lightbox/accessibility` |
|
|
332
|
+
| AR5, AR7 | Browser tests with the controls hidden | Tab, assistive-technology focus, a key press, keyboard zoom | A hidden control that is unfocusable, absent from the tree, or still hidden when focused fails. | `audit:Lightbox/accessibility` |
|
|
333
|
+
| AR6 | Reduced-motion tests under a coarse and a fine pointer | Transition, page settle, dismiss, pinch close, controls fade | Travel, scaling, or a cross-fade over 200 ms under reduced motion fails. | `audit:Lightbox/accessibility` |
|
|
334
|
+
| AR8 | Touch test pinching on the controls and on the caption | Single image, gallery | A pinch on the controls or caption that does not zoom the page fails. | `audit:Lightbox/accessibility` |
|
|
335
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target | Missing, extra, prefixed, stale, or multiply assigned mappings fail repository validation. | `audit:Lightbox/theming` |
|
|
183
336
|
|
|
184
337
|
## Decision log
|
|
185
338
|
|
|
186
|
-
|
|
187
|
-
|
|
339
|
+
### DEC-1 — The touch presentation is the native photo viewer
|
|
340
|
+
|
|
341
|
+
**Reference:** `component:Lightbox/DEC-1`
|
|
342
|
+
**Decider:** cixzhang, 2026-10-31
|
|
343
|
+
|
|
344
|
+
On a touch screen people compare Lightbox with the photo viewer on their own
|
|
345
|
+
phone, so Lightbox presents its gestures by default (FR5–FR10), each close or
|
|
346
|
+
page decided once at the release.
|
|
347
|
+
|
|
348
|
+
### DEC-2 — Fine pointers get the gestures and keep the desktop look
|
|
349
|
+
|
|
350
|
+
**Reference:** `component:Lightbox/DEC-2`
|
|
351
|
+
**Decider:** cixzhang, 2026-10-31
|
|
352
|
+
|
|
353
|
+
Mouse, pen, and trackpad get the gestures `spec:AST-094` FR43 gives every
|
|
354
|
+
pointer, while a double-click zooms 2× about the clicked point, a click keeps
|
|
355
|
+
the controls, and the viewer opens and closes at once (FR11), so the viewer
|
|
356
|
+
keeps its desktop look.
|
|
357
|
+
|
|
358
|
+
Rejected: filling the viewer on a double-click, which barely zooms a landscape
|
|
359
|
+
photo in a wide window.
|
|
360
|
+
|
|
361
|
+
### DEC-3 — The thumbnail transition is experimental
|
|
362
|
+
|
|
363
|
+
**Reference:** `component:Lightbox/DEC-3`
|
|
364
|
+
**Decider:** cixzhang, 2026-10-31
|
|
365
|
+
|
|
366
|
+
The thumbnail transition, `experimental.sourceFor`, and the close that waits for
|
|
367
|
+
the landing stay inside `experimental` (FR12), so their API can still change.
|
|
368
|
+
|
|
369
|
+
### DEC-4 — `hasZoom` is the way back
|
|
370
|
+
|
|
371
|
+
**Reference:** `component:Lightbox/DEC-4`
|
|
372
|
+
**Decider:** cixzhang, 2026-10-31
|
|
373
|
+
|
|
374
|
+
`hasZoom={false}` turns off the zoom-related touch behaviors, and the other
|
|
375
|
+
gestures only add to existing controls, so Lightbox needs no `presentation`
|
|
376
|
+
prop (FR13).
|
|
188
377
|
|
|
189
378
|
## Open questions
|
|
190
379
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
intent.
|
|
380
|
+
None. Media, Caption, and Counter keep no public target; adding one is a change
|
|
381
|
+
to this record.
|
|
194
382
|
|
|
195
383
|
## Content boundary
|
|
196
384
|
|
|
197
|
-
This file does not duplicate consumer prop tables/examples,
|
|
198
|
-
shared layer rules, current audit results, or implementation
|
|
199
|
-
their owners.
|
|
385
|
+
This file does not duplicate consumer prop tables/examples, measured values,
|
|
386
|
+
media algorithms, shared layer rules, current audit results, or implementation
|
|
387
|
+
steps. It links to their owners.
|
package/src/Link/Link.tsx
CHANGED
|
@@ -43,7 +43,7 @@ import type {LinkComponentType} from './types';
|
|
|
43
43
|
import {mergeProps} from '../utils';
|
|
44
44
|
import {computeTargetAndRel} from './computeTargetAndRel';
|
|
45
45
|
import {useInteractiveRole} from '../hooks/useInteractiveRole';
|
|
46
|
-
import {themeProps} from '../utils/themeProps';
|
|
46
|
+
import {themeDataAttributes, themeProps} from '../utils/themeProps';
|
|
47
47
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
48
48
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
49
49
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
@@ -335,6 +335,10 @@ export function Link({
|
|
|
335
335
|
const renderAsButton =
|
|
336
336
|
role === 'button' || (role === 'inert' && href == null);
|
|
337
337
|
|
|
338
|
+
// The reflected theme attributes win over a caller's same-named `data-*`, so
|
|
339
|
+
// theme targeting always sees the real value (public-component-api INV5).
|
|
340
|
+
const reflectedAttributes = themeDataAttributes({color});
|
|
341
|
+
|
|
338
342
|
const sharedContent = (
|
|
339
343
|
<>
|
|
340
344
|
<Text
|
|
@@ -385,6 +389,7 @@ export function Link({
|
|
|
385
389
|
style,
|
|
386
390
|
)}
|
|
387
391
|
{...props}
|
|
392
|
+
{...reflectedAttributes}
|
|
388
393
|
// Focusable while disabled (spec:AST-085 FR1), but inert (FR2).
|
|
389
394
|
{...(isDisabled ? disabledInteractionProps(props.onKeyDown) : null)}>
|
|
390
395
|
{sharedContent}
|
|
@@ -419,6 +424,7 @@ export function Link({
|
|
|
419
424
|
style,
|
|
420
425
|
)}
|
|
421
426
|
{...props}
|
|
427
|
+
{...reflectedAttributes}
|
|
422
428
|
{...disabledInteractionProps(props.onKeyDown)}>
|
|
423
429
|
{sharedContent}
|
|
424
430
|
</a>
|
|
@@ -450,7 +456,8 @@ export function Link({
|
|
|
450
456
|
className,
|
|
451
457
|
style,
|
|
452
458
|
)}
|
|
453
|
-
{...props}
|
|
459
|
+
{...props}
|
|
460
|
+
{...reflectedAttributes}>
|
|
454
461
|
{sharedContent}
|
|
455
462
|
</LinkComponent>
|
|
456
463
|
);
|
|
@@ -1215,11 +1215,9 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1215
1215
|
// (spec:AST-086 FR8).
|
|
1216
1216
|
useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), triggerRef);
|
|
1217
1217
|
|
|
1218
|
-
// Disabled-reason tooltip
|
|
1219
|
-
//
|
|
1220
|
-
//
|
|
1221
|
-
// disabled attribute. Activation is blocked by the isDisabled guards in
|
|
1222
|
-
// useMultiCombobox (onTriggerClick / onKeyDown).
|
|
1218
|
+
// Disabled-reason tooltip listeners attach to the existing trigger container.
|
|
1219
|
+
// The trigger stays focusable via aria-disabled. Trigger guards and the value
|
|
1220
|
+
// commit guards below block activation, including from an already-open panel.
|
|
1223
1221
|
const showsDisabledMessage = isDisabled && !!disabledMessage;
|
|
1224
1222
|
const disabledMessageTooltip = useTooltip({
|
|
1225
1223
|
placement: 'above',
|
|
@@ -1626,6 +1624,9 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1626
1624
|
// Clear all selected values. Shared by the clear button and the keyboard
|
|
1627
1625
|
// Delete/Backspace path so clearing is reachable without a mouse.
|
|
1628
1626
|
const clearValues = useCallback(() => {
|
|
1627
|
+
if (isDisabled) {
|
|
1628
|
+
return;
|
|
1629
|
+
}
|
|
1629
1630
|
onChange([]);
|
|
1630
1631
|
announceSelection([]);
|
|
1631
1632
|
if (changeAction) {
|
|
@@ -1635,6 +1636,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1635
1636
|
});
|
|
1636
1637
|
}
|
|
1637
1638
|
}, [
|
|
1639
|
+
isDisabled,
|
|
1638
1640
|
onChange,
|
|
1639
1641
|
changeAction,
|
|
1640
1642
|
startTransition,
|
|
@@ -1663,6 +1665,9 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1663
1665
|
|
|
1664
1666
|
const handleToggle = useCallback(
|
|
1665
1667
|
(itemValue: string) => {
|
|
1668
|
+
if (isDisabled) {
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1666
1671
|
const newValue = optimisticValue.includes(itemValue)
|
|
1667
1672
|
? optimisticValue.filter(v => v !== itemValue)
|
|
1668
1673
|
: [...optimisticValue, itemValue];
|
|
@@ -1677,6 +1682,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1677
1682
|
}
|
|
1678
1683
|
},
|
|
1679
1684
|
[
|
|
1685
|
+
isDisabled,
|
|
1680
1686
|
optimisticValue,
|
|
1681
1687
|
onChange,
|
|
1682
1688
|
changeAction,
|
|
@@ -1711,6 +1717,9 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1711
1717
|
: false;
|
|
1712
1718
|
|
|
1713
1719
|
const handleSelectAll = useCallback(() => {
|
|
1720
|
+
if (isDisabled) {
|
|
1721
|
+
return;
|
|
1722
|
+
}
|
|
1714
1723
|
let newValue: string[];
|
|
1715
1724
|
if (allEnabledSelected) {
|
|
1716
1725
|
// Deselect all enabled items, keep disabled items that are selected
|
|
@@ -1736,6 +1745,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1736
1745
|
});
|
|
1737
1746
|
}
|
|
1738
1747
|
}, [
|
|
1748
|
+
isDisabled,
|
|
1739
1749
|
allEnabledSelected,
|
|
1740
1750
|
enabledItems,
|
|
1741
1751
|
optimisticValue,
|
|
@@ -1752,6 +1762,9 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1752
1762
|
// the option the caller adds is visible.
|
|
1753
1763
|
const commitCreate = useCallback(
|
|
1754
1764
|
(query: string) => {
|
|
1765
|
+
if (isDisabled) {
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1755
1768
|
const newValue = optimisticValue.includes(query)
|
|
1756
1769
|
? optimisticValue
|
|
1757
1770
|
: [...optimisticValue, query];
|
|
@@ -1766,6 +1779,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1766
1779
|
}
|
|
1767
1780
|
},
|
|
1768
1781
|
[
|
|
1782
|
+
isDisabled,
|
|
1769
1783
|
optimisticValue,
|
|
1770
1784
|
onChange,
|
|
1771
1785
|
changeAction,
|