@astryxdesign/core 0.7.6-canary.3a2d3d9 → 0.7.6-canary.3ccdb9e
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAuCA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAUlB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AA2P9C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,mBAAmB,EACnB,UAAU,GAAG,cAAc,GAAG,OAAO,CACtC;IACC;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,aAA0B,EAC1B,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EAAE,MAAM,EACV,GAAG,SAAS,EACb,EAAE,cAAc,+
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names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IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,aAA0B,EAC1B,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EAAE,MAAM,EACV,GAAG,SAAS,EACb,EAAE,cAAc,+BAshBhB;yBArjBe,SAAS"}
|
|
@@ -307,6 +307,30 @@ export function FileInput({
|
|
|
307
307
|
// The tooltip variant renders no message box; describe the input by the
|
|
308
308
|
// tooltip's content instead so the status is still announced.
|
|
309
309
|
statusTooltipDescribedBy, conveysRequired ? requiredID : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined;
|
|
310
|
+
|
|
311
|
+
// The native input keeps taking the caller's base props (the shared FR10
|
|
312
|
+
// contract), but it is `aria-hidden` and never focused, so a caller's
|
|
313
|
+
// `aria-*` props are also set on the trigger, the field's focusable control,
|
|
314
|
+
// where assistive tech reads them. The ones the trigger composes itself are
|
|
315
|
+
// not copied, and a caller's description is joined to its own, first.
|
|
316
|
+
const {
|
|
317
|
+
'aria-describedby': callerDescribedBy,
|
|
318
|
+
'aria-label': _callerLabel,
|
|
319
|
+
'aria-labelledby': _callerLabelledBy,
|
|
320
|
+
'aria-hidden': _callerHidden,
|
|
321
|
+
'aria-disabled': _callerDisabled,
|
|
322
|
+
'aria-busy': _callerBusy,
|
|
323
|
+
'aria-invalid': _callerInvalid,
|
|
324
|
+
...otherRest
|
|
325
|
+
} = rest;
|
|
326
|
+
const triggerAriaProps = {};
|
|
327
|
+
for (const [key, value] of Object.entries(otherRest)) {
|
|
328
|
+
// Booleans and numbers are valid ARIA values too: React serializes them.
|
|
329
|
+
if (key.startsWith('aria-') && value != null) {
|
|
330
|
+
triggerAriaProps[key] = value;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const triggerDescribedBy = [callerDescribedBy, ariaDescribedBy].filter(Boolean).join(' ') || undefined;
|
|
310
334
|
const defaultPlaceholder = isMultiple ? t('@astryx.fileInput.placeholderMultiple') : t('@astryx.fileInput.placeholder');
|
|
311
335
|
const displayPlaceholder = placeholder ?? defaultPlaceholder;
|
|
312
336
|
const handleFiles = useCallback(fileList => {
|
|
@@ -598,8 +622,9 @@ export function FileInput({
|
|
|
598
622
|
fileNames
|
|
599
623
|
}) : label,
|
|
600
624
|
"aria-busy": isBusy || undefined,
|
|
601
|
-
"aria-
|
|
602
|
-
|
|
625
|
+
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
626
|
+
...triggerAriaProps,
|
|
627
|
+
"aria-describedby": triggerDescribedBy
|
|
603
628
|
})
|
|
604
629
|
}), /*#__PURE__*/_jsx("input", {
|
|
605
630
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemSwipeLayer.d.ts","sourceRoot":"","sources":["../../src/Item/ItemSwipeLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ItemSwipeLayer.d.ts","sourceRoot":"","sources":["../../src/Item/ItemSwipeLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAcxD,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAC,eAAe,EAAE,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAM/D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,aAAa,CAAC;IACxB,mBAAmB,EAAE,MAAM,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACvC;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AA8HD;;;GAGG;AACH,iBAAwB,cAAc,CAAC,EACrC,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,EAAE,mBAAmB,+BA8IrB;kBApJuB,cAAc;;;eAAd,cAAc"}
|
|
@@ -25,6 +25,7 @@ import "../theme/tokens.stylex.js";
|
|
|
25
25
|
import { fontWeightVars, typographyVars, colorVars, spacingVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
26
26
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
27
27
|
import { themeProps } from "../utils/themeProps.js";
|
|
28
|
+
import { disabledInteractionProps } from "../utils/disabledInteraction.js";
|
|
28
29
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
29
30
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
30
31
|
import { useSwipeAction } from "./useSwipeAction.js";
|
|
@@ -240,11 +241,16 @@ export default function ItemSwipeLayer({
|
|
|
240
241
|
}
|
|
241
242
|
return /*#__PURE__*/_jsx("button", {
|
|
242
243
|
type: "button",
|
|
243
|
-
disabled: entry.isDisabled === true,
|
|
244
|
+
"aria-disabled": entry.isDisabled === true ? true : undefined,
|
|
244
245
|
onClick: () => swipe.activateEntry(() => {
|
|
245
246
|
void entry.onActivate();
|
|
246
247
|
return entry.hasRemoval === true;
|
|
247
|
-
})
|
|
248
|
+
})
|
|
249
|
+
// A disabled entry stays focusable while the row rests open but
|
|
250
|
+
// is inert: it runs no `onActivate` and its click does not
|
|
251
|
+
// reach the row (spec:AST-085 FR1, FR2).
|
|
252
|
+
,
|
|
253
|
+
...(entry.isDisabled === true ? disabledInteractionProps() : null),
|
|
248
254
|
...mergeProps(themeProps('item-swipe-action', {
|
|
249
255
|
variant
|
|
250
256
|
}), focusOutlineProps.focusVisible(styles.swipeEntry, swipeVariantStyles[variant], entry.isDisabled === true && styles.swipeEntryDisabled)),
|
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.3ccdb9e",
|
|
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.3ccdb9e",
|
|
864
|
+
"@astryxdesign/cli": "0.7.6-canary.3ccdb9e",
|
|
865
|
+
"@astryxdesign/interaction-harness": "0.7.6-canary.3ccdb9e",
|
|
866
866
|
"@babel/cli": "^7.29.7",
|
|
867
867
|
"@babel/core": "^7.29.7",
|
|
868
868
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -575,6 +575,33 @@ export function FileInput({
|
|
|
575
575
|
.filter(Boolean)
|
|
576
576
|
.join(' ') || undefined;
|
|
577
577
|
|
|
578
|
+
// The native input keeps taking the caller's base props (the shared FR10
|
|
579
|
+
// contract), but it is `aria-hidden` and never focused, so a caller's
|
|
580
|
+
// `aria-*` props are also set on the trigger, the field's focusable control,
|
|
581
|
+
// where assistive tech reads them. The ones the trigger composes itself are
|
|
582
|
+
// not copied, and a caller's description is joined to its own, first.
|
|
583
|
+
const {
|
|
584
|
+
'aria-describedby': callerDescribedBy,
|
|
585
|
+
'aria-label': _callerLabel,
|
|
586
|
+
'aria-labelledby': _callerLabelledBy,
|
|
587
|
+
'aria-hidden': _callerHidden,
|
|
588
|
+
'aria-disabled': _callerDisabled,
|
|
589
|
+
'aria-busy': _callerBusy,
|
|
590
|
+
'aria-invalid': _callerInvalid,
|
|
591
|
+
...otherRest
|
|
592
|
+
} = rest as typeof rest & Record<string, unknown>;
|
|
593
|
+
const triggerAriaProps: Record<string, unknown> = {};
|
|
594
|
+
for (const [key, value] of Object.entries(otherRest)) {
|
|
595
|
+
// Booleans and numbers are valid ARIA values too: React serializes them.
|
|
596
|
+
if (key.startsWith('aria-') && value != null) {
|
|
597
|
+
triggerAriaProps[key] = value;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
const triggerDescribedBy =
|
|
601
|
+
[callerDescribedBy, ariaDescribedBy]
|
|
602
|
+
.filter(Boolean)
|
|
603
|
+
.join(' ') || undefined;
|
|
604
|
+
|
|
578
605
|
const defaultPlaceholder = isMultiple
|
|
579
606
|
? t('@astryx.fileInput.placeholderMultiple')
|
|
580
607
|
: t('@astryx.fileInput.placeholder');
|
|
@@ -946,8 +973,9 @@ export function FileInput({
|
|
|
946
973
|
: label
|
|
947
974
|
}
|
|
948
975
|
aria-busy={isBusy || undefined}
|
|
949
|
-
aria-describedby={ariaDescribedBy}
|
|
950
976
|
aria-invalid={status?.type === 'error' ? 'true' : undefined}
|
|
977
|
+
{...triggerAriaProps}
|
|
978
|
+
aria-describedby={triggerDescribedBy}
|
|
951
979
|
/>
|
|
952
980
|
</VisuallyHidden>
|
|
953
981
|
<input
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
} from '../theme/tokens.stylex';
|
|
32
32
|
import {mergeProps} from '../utils/mergeProps';
|
|
33
33
|
import {themeProps} from '../utils/themeProps';
|
|
34
|
+
import {disabledInteractionProps} from '../utils/disabledInteraction';
|
|
34
35
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
35
36
|
import {useMediaQuery} from '../hooks/useMediaQuery';
|
|
36
37
|
import {
|
|
@@ -307,13 +308,19 @@ export default function ItemSwipeLayer({
|
|
|
307
308
|
<button
|
|
308
309
|
key={entry.id ?? entry.label}
|
|
309
310
|
type="button"
|
|
310
|
-
disabled={entry.isDisabled === true}
|
|
311
|
+
aria-disabled={entry.isDisabled === true ? true : undefined}
|
|
311
312
|
onClick={() =>
|
|
312
313
|
swipe.activateEntry(() => {
|
|
313
314
|
void entry.onActivate();
|
|
314
315
|
return entry.hasRemoval === true;
|
|
315
316
|
})
|
|
316
317
|
}
|
|
318
|
+
// A disabled entry stays focusable while the row rests open but
|
|
319
|
+
// is inert: it runs no `onActivate` and its click does not
|
|
320
|
+
// reach the row (spec:AST-085 FR1, FR2).
|
|
321
|
+
{...(entry.isDisabled === true
|
|
322
|
+
? disabledInteractionProps<HTMLButtonElement>()
|
|
323
|
+
: null)}
|
|
317
324
|
{...mergeProps(
|
|
318
325
|
themeProps('item-swipe-action', {variant}),
|
|
319
326
|
focusOutlineProps.focusVisible(
|