@astryxdesign/core 0.2.0-canary.f306f13 → 0.2.0-canary.fc53ff7
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/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +6 -2
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -2
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +19 -4
- package/dist/CodeBlock/CodeBlock.js +2 -2
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +10 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +8 -11
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +3 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +9 -1
- package/dist/DropdownMenu/menuItemHover.d.ts +1 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemHover.js +1 -0
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +7 -3
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +12 -2
- package/dist/Item/Item.d.ts +16 -3
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +31 -6
- package/dist/List/ListItem.d.ts +11 -1
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +2 -0
- package/dist/MetadataList/MetadataList.d.ts +1 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +4 -2
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +14 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +3 -2
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -0
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +2 -2
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +15 -4
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +1 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +42 -43
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +61 -9
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +3 -1
- package/dist/Token/Token.d.ts +4 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +68 -43
- package/dist/Token/TokenLink.d.ts +62 -0
- package/dist/Token/TokenLink.d.ts.map +1 -0
- package/dist/Token/TokenLink.js +76 -0
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +9 -3
- package/dist/Typeahead/BaseTypeahead.d.ts +9 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -0
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +8 -1
- package/dist/astryx.css +51 -8
- package/dist/astryx.umd.js +50 -50
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/containerReveal.pool.stylex.d.ts +281 -0
- package/dist/hooks/containerReveal.pool.stylex.d.ts.map +1 -0
- package/dist/hooks/containerReveal.pool.stylex.js +281 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/useContainerReveal.d.ts +83 -0
- package/dist/hooks/useContainerReveal.d.ts.map +1 -0
- package/dist/hooks/useContainerReveal.js +123 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +11 -0
- package/dist/hooks/useKeyboardHint.d.ts +1 -1
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +4 -2
- package/locales/en.json +32 -0
- package/locales/pseudo.json +24 -0
- package/package.json +1 -1
- package/src/AvatarGroup/AvatarGroup.test.tsx +21 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +4 -2
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +1 -1
- package/src/Button/Button.test.tsx +16 -0
- package/src/Button/Button.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.test.tsx +23 -0
- package/src/CheckboxInput/CheckboxInput.tsx +17 -2
- package/src/CheckboxList/CheckboxList.test.tsx +94 -3
- package/src/CheckboxList/CheckboxListItem.tsx +17 -10
- package/src/CodeBlock/CodeBlock.test.tsx +17 -0
- package/src/CodeBlock/CodeBlock.tsx +2 -2
- package/src/ContextMenu/ContextMenu.test.tsx +17 -2
- package/src/ContextMenu/ContextMenu.tsx +10 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +4 -12
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +9 -10
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +20 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +29 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +13 -5
- package/src/DropdownMenu/menuItemHover.ts +1 -0
- package/src/Field/Field.doc.mjs +4 -0
- package/src/Field/FieldLabel.test.tsx +25 -0
- package/src/Field/FieldLabel.tsx +11 -2
- package/src/FieldStatus/FieldStatus.doc.mjs +1 -0
- package/src/FieldStatus/FieldStatus.test.tsx +61 -0
- package/src/FieldStatus/FieldStatus.tsx +14 -3
- package/src/Item/Item.doc.mjs +5 -0
- package/src/Item/Item.test.tsx +88 -0
- package/src/Item/Item.tsx +57 -11
- package/src/List/ListItem.doc.mjs +12 -0
- package/src/List/ListItem.tsx +13 -0
- package/src/MetadataList/MetadataList.test.tsx +24 -0
- package/src/MetadataList/MetadataList.tsx +6 -2
- package/src/MultiSelector/MultiSelector.test.tsx +76 -0
- package/src/MultiSelector/MultiSelector.tsx +28 -7
- package/src/RadioList/RadioList.test.tsx +26 -4
- package/src/RadioList/RadioListItem.tsx +8 -1
- package/src/SegmentedControl/SegmentedControl.test.tsx +28 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +20 -2
- package/src/Selector/Selector.test.tsx +22 -0
- package/src/Selector/Selector.tsx +8 -1
- package/src/Skeleton/Skeleton.test.tsx +16 -0
- package/src/Skeleton/Skeleton.tsx +13 -1
- package/src/Switch/Switch.test.tsx +37 -0
- package/src/Switch/Switch.tsx +52 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +19 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +18 -32
- package/src/Toast/ToastViewport.test.tsx +218 -8
- package/src/Toast/ToastViewport.tsx +71 -12
- package/src/ToggleButton/ToggleButton.test.tsx +24 -0
- package/src/ToggleButton/ToggleButton.tsx +19 -1
- package/src/Token/Token.test.tsx +145 -0
- package/src/Token/Token.tsx +73 -33
- package/src/Token/TokenLink.tsx +107 -0
- package/src/TopNav/TopNavMegaMenu.tsx +26 -2
- package/src/Typeahead/BaseTypeahead.tsx +12 -0
- package/src/Typeahead/Typeahead.test.tsx +62 -0
- package/src/Typeahead/Typeahead.tsx +6 -0
- package/src/__tests__/forcedColors.ts +60 -0
- package/src/hooks/containerReveal.pool.stylex.ts +464 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useContainerReveal.test.tsx +116 -0
- package/src/hooks/useContainerReveal.ts +180 -0
- package/src/hooks/useInputStatusIcon.test.tsx +59 -0
- package/src/hooks/useInputStatusIcon.tsx +12 -1
- package/src/hooks/useKeyboardHint.test.tsx +22 -0
- package/src/hooks/useKeyboardHint.tsx +6 -2
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts +0 -9
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts.map +0 -1
- package/dist/Thumbnail/thumbnail.markers.stylex.js +0 -14
- package/src/Thumbnail/thumbnail.markers.stylex.ts +0 -12
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { isValidElement, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import * as stylex from '@stylexjs/stylex';
|
|
7
7
|
import "../theme/tokens.stylex.js";
|
|
8
8
|
import { spacingVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
9
9
|
import { mergeProps } from "../utils/index.js";
|
|
10
10
|
import { INTERACTIVE_SELECTORS } from "../hooks/useClickableContainer.js";
|
|
11
|
+
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
11
12
|
import { Toast } from "./Toast.js";
|
|
12
13
|
import { ToastContext } from "./ToastContext.js";
|
|
13
14
|
import { useTranslator } from "../i18n/index.js";
|
|
@@ -53,6 +54,31 @@ const styles = {
|
|
|
53
54
|
$$css: true
|
|
54
55
|
}
|
|
55
56
|
};
|
|
57
|
+
|
|
58
|
+
// Flatten a toast's rendered content (title, description, etc.) to the plain
|
|
59
|
+
// text that should be spoken by a screen reader. Only text is announced —
|
|
60
|
+
// interactive endContent is deliberately excluded (it is reachable via F6).
|
|
61
|
+
function getNodeText(node) {
|
|
62
|
+
if (node == null || typeof node === 'boolean') {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
if (typeof node === 'string') {
|
|
66
|
+
return node;
|
|
67
|
+
}
|
|
68
|
+
if (typeof node === 'number') {
|
|
69
|
+
return String(node);
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(node)) {
|
|
72
|
+
return node.map(getNodeText).filter(Boolean).join(' ');
|
|
73
|
+
}
|
|
74
|
+
if (/*#__PURE__*/isValidElement(node)) {
|
|
75
|
+
const {
|
|
76
|
+
children
|
|
77
|
+
} = node.props;
|
|
78
|
+
return getNodeText(children);
|
|
79
|
+
}
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
56
82
|
/**
|
|
57
83
|
* Container that renders and manages toast notifications. Place at the root
|
|
58
84
|
* of your app to enable useToast(). Toasts stack with enter/exit
|
|
@@ -113,24 +139,50 @@ export function ToastViewport({
|
|
|
113
139
|
}
|
|
114
140
|
return null;
|
|
115
141
|
}, []);
|
|
142
|
+
|
|
143
|
+
// Announce toasts through the persistent singleton live regions. Each
|
|
144
|
+
// <Toast> also renders its own role="status"/"alert" region, but that region
|
|
145
|
+
// is "born with content" — mounted together with its text — which many
|
|
146
|
+
// screen readers do not announce (see useAnnounce.ts); the singleton regions
|
|
147
|
+
// are mounted empty and only mutated afterwards, so they are what actually
|
|
148
|
+
// guarantees the announcement (the per-toast markup is kept for browse-mode
|
|
149
|
+
// discoverability). The announcement happens in addToast — the imperative
|
|
150
|
+
// dispatch path invoked once per useToast() call from an event handler,
|
|
151
|
+
// never from render — so each toast is announced exactly once by
|
|
152
|
+
// construction, independent of the React render lifecycle (StrictMode
|
|
153
|
+
// double-render/double-effect, viewport remounts, and unrelated list
|
|
154
|
+
// re-renders never re-announce). It is client-only (addToast never runs
|
|
155
|
+
// during SSR), so it is SSR-safe.
|
|
156
|
+
const announce = useAnnounce();
|
|
116
157
|
const addToast = useCallback(entry => {
|
|
158
|
+
const {
|
|
159
|
+
uniqueID,
|
|
160
|
+
collisionBehavior = 'overwrite'
|
|
161
|
+
} = entry.options;
|
|
162
|
+
// Resolve an ignored collision synchronously against the committed list
|
|
163
|
+
// so a suppressed toast is neither shown nor announced. The remaining
|
|
164
|
+
// announce + setToasts run outside the setToasts updater, which React may
|
|
165
|
+
// invoke more than once — keeping the announcement exactly-once.
|
|
166
|
+
if (uniqueID && collisionBehavior === 'ignore' && toastsRef.current.some(t => t.options.uniqueID === uniqueID)) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const text = getNodeText(entry.options.body);
|
|
170
|
+
if (text) {
|
|
171
|
+
// Error toasts map to the assertive region (role="alert"); everything
|
|
172
|
+
// else to the polite region (role="status") — mirrors Toast.tsx.
|
|
173
|
+
announce(text, entry.options.type === 'error' ? 'assertive' : 'polite');
|
|
174
|
+
}
|
|
117
175
|
setToasts(prev => {
|
|
118
|
-
const {
|
|
119
|
-
uniqueID,
|
|
120
|
-
collisionBehavior = 'overwrite'
|
|
121
|
-
} = entry.options;
|
|
122
176
|
if (uniqueID) {
|
|
123
177
|
const existing = prev.find(t => t.options.uniqueID === uniqueID);
|
|
124
178
|
if (existing) {
|
|
125
|
-
|
|
126
|
-
return prev;
|
|
127
|
-
}
|
|
179
|
+
// An ignored collision already returned above; overwrite in place.
|
|
128
180
|
return prev.map(t => t.options.uniqueID === uniqueID ? entry : t);
|
|
129
181
|
}
|
|
130
182
|
}
|
|
131
183
|
return [...prev, entry];
|
|
132
184
|
});
|
|
133
|
-
}, []);
|
|
185
|
+
}, [announce]);
|
|
134
186
|
const removeToast = useCallback((id, reason) => {
|
|
135
187
|
// An exiting toast stays in toastsRef until its exit transition ends, so
|
|
136
188
|
// a second dismissal inside that window (double-click, auto-timer plus
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAgB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAgB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAChB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KACvC,IAAI,CAAC;IAEV;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,mBAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAsB,EAClC,SAAiB,EACjB,IAAI,EACJ,UAAkB,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EAAE,UAAU,EACrB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CAyG/B;yBA5He,YAAY"}
|
|
@@ -39,7 +39,9 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
39
39
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
40
40
|
const pressedStyles = {
|
|
41
41
|
background: {
|
|
42
|
-
|
|
42
|
+
kAXs8y: "x1kzknox",
|
|
43
|
+
kWkggS: "xi89dp7 x1jzqe4",
|
|
44
|
+
kMwMTN: "x1k5gbb1",
|
|
43
45
|
$$css: true
|
|
44
46
|
}
|
|
45
47
|
};
|
package/dist/Token/Token.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by Token.test.tsx
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update these files to stay in sync:
|
|
8
|
+
* - /packages/core/src/Token/TokenLink.tsx (interactive wrapper for href+onRemove)
|
|
8
9
|
* - /packages/core/src/Token/Token.doc.mjs (props table, features, implementation notes)
|
|
9
10
|
* - /packages/core/src/Token/Token.test.tsx (tests for new/changed behavior)
|
|
10
11
|
* - /packages/core/src/Token/index.ts (exports if types change)
|
|
@@ -106,7 +107,9 @@ export interface TokenProps extends BaseProps<HTMLElement> {
|
|
|
106
107
|
* `<span>` container with an invisible `<button>` when `onClick` is provided.
|
|
107
108
|
* The invisible button pattern provides real button semantics for accessibility
|
|
108
109
|
* while the container uses `:focus-within` to show focus outlines around the
|
|
109
|
-
* entire token.
|
|
110
|
+
* entire token. When both `href` and `onRemove` are provided, the same
|
|
111
|
+
* container pattern is used with an invisible `<a>` so the remove `<button>`
|
|
112
|
+
* renders as a sibling of the link rather than nested inside it.
|
|
110
113
|
*
|
|
111
114
|
* @example
|
|
112
115
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/Token/Token.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/Token/Token.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,IAAI,CAAC;IACd,GAAG,EAAE,IAAI,CAAC;IACV,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,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,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,GACJ,EAAE,UAAU,+BAmLZ;yBApMe,KAAK"}
|
package/dist/Token/Token.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by Token.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
|
+
* - /packages/core/src/Token/TokenLink.tsx (interactive wrapper for href+onRemove)
|
|
12
13
|
* - /packages/core/src/Token/Token.doc.mjs (props table, features, implementation notes)
|
|
13
14
|
* - /packages/core/src/Token/Token.test.tsx (tests for new/changed behavior)
|
|
14
15
|
* - /packages/core/src/Token/index.ts (exports if types change)
|
|
@@ -22,6 +23,7 @@ import { Icon } from "../Icon/index.js";
|
|
|
22
23
|
import { mergeProps } from "../utils/index.js";
|
|
23
24
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
24
25
|
import { useInteractiveRole } from "../hooks/useInteractiveRole.js";
|
|
26
|
+
import { TokenLink } from "./TokenLink.js";
|
|
25
27
|
import { themeProps } from "../utils/themeProps.js";
|
|
26
28
|
import { useTranslator } from "../i18n/index.js";
|
|
27
29
|
|
|
@@ -180,7 +182,9 @@ const colorStyles = {
|
|
|
180
182
|
* `<span>` container with an invisible `<button>` when `onClick` is provided.
|
|
181
183
|
* The invisible button pattern provides real button semantics for accessibility
|
|
182
184
|
* while the container uses `:focus-within` to show focus outlines around the
|
|
183
|
-
* entire token.
|
|
185
|
+
* entire token. When both `href` and `onRemove` are provided, the same
|
|
186
|
+
* container pattern is used with an invisible `<a>` so the remove `<button>`
|
|
187
|
+
* renders as a sibling of the link rather than nested inside it.
|
|
184
188
|
*
|
|
185
189
|
* @example
|
|
186
190
|
* ```
|
|
@@ -220,6 +224,25 @@ export function Token({
|
|
|
220
224
|
// When role is 'button' via context (no explicit onClick), treat as
|
|
221
225
|
// if onClick was provided — the popover attaches its own handler.
|
|
222
226
|
const effectiveOnClick = onClick ?? (role === 'button' ? () => {} : null);
|
|
227
|
+
const removeButton = onRemove != null && /*#__PURE__*/_jsx("button", {
|
|
228
|
+
type: "button",
|
|
229
|
+
"aria-label": t('@astryx.token.remove', {
|
|
230
|
+
label
|
|
231
|
+
}),
|
|
232
|
+
onClick: e => {
|
|
233
|
+
e.stopPropagation();
|
|
234
|
+
onRemove(e);
|
|
235
|
+
},
|
|
236
|
+
disabled: isDisabled,
|
|
237
|
+
...{
|
|
238
|
+
className: "x3nfvp2 x6s0dn4 xl56j7k x1n2onr6 x1717udv xkd40ry x1ypdohk xjspbzw x1kky2od xlup9mm x1heor9g x17nn4n9 x1s928wv x1j6awrg x1xsm0q9"
|
|
239
|
+
},
|
|
240
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
241
|
+
icon: "close",
|
|
242
|
+
size: "xsm",
|
|
243
|
+
color: "inherit"
|
|
244
|
+
})
|
|
245
|
+
});
|
|
223
246
|
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
224
247
|
children: [icon, /*#__PURE__*/_jsx("span", {
|
|
225
248
|
...{
|
|
@@ -231,25 +254,7 @@ export function Token({
|
|
|
231
254
|
}
|
|
232
255
|
}[!!isLabelHidden << 0],
|
|
233
256
|
children: label
|
|
234
|
-
}), endContent,
|
|
235
|
-
type: "button",
|
|
236
|
-
"aria-label": t('@astryx.token.remove', {
|
|
237
|
-
label
|
|
238
|
-
}),
|
|
239
|
-
onClick: e => {
|
|
240
|
-
e.stopPropagation();
|
|
241
|
-
onRemove(e);
|
|
242
|
-
},
|
|
243
|
-
disabled: isDisabled,
|
|
244
|
-
...{
|
|
245
|
-
className: "x3nfvp2 x6s0dn4 xl56j7k x1n2onr6 x1717udv xkd40ry x1ypdohk xjspbzw x1kky2od xlup9mm x1heor9g x17nn4n9 x1s928wv x1j6awrg x1xsm0q9"
|
|
246
|
-
},
|
|
247
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
248
|
-
icon: "close",
|
|
249
|
-
size: "xsm",
|
|
250
|
-
color: "inherit"
|
|
251
|
-
})
|
|
252
|
-
})]
|
|
257
|
+
}), endContent, removeButton]
|
|
253
258
|
});
|
|
254
259
|
const sharedProps = {
|
|
255
260
|
'data-testid': testId,
|
|
@@ -257,16 +262,54 @@ export function Token({
|
|
|
257
262
|
'aria-description': description
|
|
258
263
|
};
|
|
259
264
|
if (role === 'link') {
|
|
260
|
-
|
|
265
|
+
if (onRemove == null) {
|
|
266
|
+
return /*#__PURE__*/_jsx(LinkComponent, {
|
|
267
|
+
ref: ref,
|
|
268
|
+
href: href,
|
|
269
|
+
"aria-disabled": isDisabled || undefined,
|
|
270
|
+
...sharedProps,
|
|
271
|
+
...mergeProps(themeProps('token', {
|
|
272
|
+
color,
|
|
273
|
+
size
|
|
274
|
+
}), stylex.props(styles.base, sizeStyles[size], colorStyles[color], styles.interactive, isDisabled && styles.disabled, xstyle), className, style),
|
|
275
|
+
children: content
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// With a remove button, the link cannot be the root — nesting a <button>
|
|
280
|
+
// inside an <a> is invalid HTML (WCAG 4.1.2). Delegate to TokenLink, a
|
|
281
|
+
// non-presentational wrapper that renders a <span> container with the link
|
|
282
|
+
// and the remove button as siblings and wires up useClickableContainer so
|
|
283
|
+
// the whole token surface activates the link (including middle-click and
|
|
284
|
+
// cmd/ctrl-click to open in a new tab). Token itself stays presentational
|
|
285
|
+
// (no refs/effects) per the @astryx/presentational-component rule.
|
|
286
|
+
return /*#__PURE__*/_jsx(TokenLink, {
|
|
261
287
|
ref: ref,
|
|
262
288
|
href: href,
|
|
263
|
-
|
|
289
|
+
isDisabled: isDisabled,
|
|
290
|
+
LinkComponent: LinkComponent,
|
|
291
|
+
icon: icon,
|
|
292
|
+
endContent: endContent,
|
|
293
|
+
removeButton: removeButton,
|
|
294
|
+
linkStyleProps: {
|
|
295
|
+
className: "xmper1u xln7xf2 x1heor9g x1a2a7pz xb3r6kr xeuugli"
|
|
296
|
+
},
|
|
297
|
+
labelContent: /*#__PURE__*/_jsx("span", {
|
|
298
|
+
...{
|
|
299
|
+
0: {
|
|
300
|
+
className: "xb3r6kr xlyipyv xuxw1ft xeuugli"
|
|
301
|
+
},
|
|
302
|
+
1: {
|
|
303
|
+
className: "xlyipyv xeuugli x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr x1hyvwdk xuxw1ft xc342km"
|
|
304
|
+
}
|
|
305
|
+
}[!!isLabelHidden << 0],
|
|
306
|
+
children: label
|
|
307
|
+
}),
|
|
264
308
|
...sharedProps,
|
|
265
309
|
...mergeProps(themeProps('token', {
|
|
266
310
|
color,
|
|
267
311
|
size
|
|
268
|
-
}), stylex.props(styles.base, sizeStyles[size], colorStyles[color], styles.interactive, isDisabled && styles.disabled, xstyle), className, style)
|
|
269
|
-
children: content
|
|
312
|
+
}), stylex.props(styles.base, sizeStyles[size], colorStyles[color], styles.interactive, styles.focusVisibleOutline, isDisabled && styles.disabled, xstyle), className, style)
|
|
270
313
|
});
|
|
271
314
|
}
|
|
272
315
|
if (effectiveOnClick != null) {
|
|
@@ -303,25 +346,7 @@ export function Token({
|
|
|
303
346
|
}[!!isLabelHidden << 0],
|
|
304
347
|
children: label
|
|
305
348
|
})
|
|
306
|
-
}), endContent,
|
|
307
|
-
type: "button",
|
|
308
|
-
"aria-label": t('@astryx.token.remove', {
|
|
309
|
-
label
|
|
310
|
-
}),
|
|
311
|
-
onClick: e => {
|
|
312
|
-
e.stopPropagation();
|
|
313
|
-
onRemove(e);
|
|
314
|
-
},
|
|
315
|
-
disabled: isDisabled,
|
|
316
|
-
...{
|
|
317
|
-
className: "x3nfvp2 x6s0dn4 xl56j7k x1n2onr6 x1717udv xkd40ry x1ypdohk xjspbzw x1kky2od xlup9mm x1heor9g x17nn4n9 x1s928wv x1j6awrg x1xsm0q9"
|
|
318
|
-
},
|
|
319
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
320
|
-
icon: "close",
|
|
321
|
-
size: "xsm",
|
|
322
|
-
color: "inherit"
|
|
323
|
-
})
|
|
324
|
-
})]
|
|
349
|
+
}), endContent, removeButton]
|
|
325
350
|
});
|
|
326
351
|
}
|
|
327
352
|
return /*#__PURE__*/_jsx("span", {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file TokenLink.tsx
|
|
3
|
+
* @input Rendered token pieces (icon, label, endContent, remove button) plus
|
|
4
|
+
* container/link styling props and the resolved LinkComponent
|
|
5
|
+
* @output Exports TokenLink, the interactive container for the href+onRemove Token variant
|
|
6
|
+
* @position Internal to Token; keeps Token.tsx presentational
|
|
7
|
+
*
|
|
8
|
+
* Token is a presentational component (see
|
|
9
|
+
* /internal/eslint-plugin-astryx/presentational-component.js) and must not use
|
|
10
|
+
* refs or effects. When a Token has both `href` and `onRemove`, the remove
|
|
11
|
+
* <button> must be a sibling of the link (nesting a button inside an anchor is
|
|
12
|
+
* invalid HTML — WCAG 4.1.2), so the surface becomes a clickable container that
|
|
13
|
+
* delegates to an inner link. That delegation needs refs, so it lives here.
|
|
14
|
+
*
|
|
15
|
+
* useClickableContainer gives the container middle-click and cmd/ctrl-click
|
|
16
|
+
* open-in-new-tab behavior for the link, ignores clicks on nested interactive
|
|
17
|
+
* elements (the remove button), and skips activation during text selection.
|
|
18
|
+
*
|
|
19
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
20
|
+
* - /packages/core/src/Token/Token.tsx (renders TokenLink for the href+onRemove case)
|
|
21
|
+
* - /packages/core/src/Token/Token.test.tsx (tests for delegated behavior)
|
|
22
|
+
*/
|
|
23
|
+
import type { ReactNode, CSSProperties, Ref, HTMLAttributes } from 'react';
|
|
24
|
+
import type { LinkComponentType } from '../Link/types';
|
|
25
|
+
export interface TokenLinkProps extends HTMLAttributes<HTMLElement> {
|
|
26
|
+
/** Ref forwarded to the container element. */
|
|
27
|
+
ref?: Ref<HTMLElement>;
|
|
28
|
+
/** Link URL. */
|
|
29
|
+
href: string;
|
|
30
|
+
/** Whether the token is disabled. */
|
|
31
|
+
isDisabled: boolean;
|
|
32
|
+
/** Resolved link component (native `<a>` or a router link). */
|
|
33
|
+
LinkComponent: LinkComponentType;
|
|
34
|
+
/** `stylex.props()` output applied to the invisible inner link. */
|
|
35
|
+
linkStyleProps: {
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
};
|
|
39
|
+
/** Visible (or visually hidden) label node rendered inside the link. */
|
|
40
|
+
labelContent: ReactNode;
|
|
41
|
+
/** Optional leading icon. */
|
|
42
|
+
icon?: ReactNode;
|
|
43
|
+
/** Content rendered after the label, before the remove button. */
|
|
44
|
+
endContent?: ReactNode;
|
|
45
|
+
/** The remove button node, rendered as a sibling of the link. */
|
|
46
|
+
removeButton: ReactNode;
|
|
47
|
+
/** Allow data-* attributes (e.g. data-testid, theme targets) on the container. */
|
|
48
|
+
[dataAttr: `data-${string}`]: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Interactive container for a Token that is both a link and removable.
|
|
52
|
+
*
|
|
53
|
+
* Renders a `<span>` wrapping an invisible inner link and the remove button as
|
|
54
|
+
* siblings. useClickableContainer delegates clicks on the surface to the link
|
|
55
|
+
* (including middle-click / cmd+click to open in a new tab) while the remove
|
|
56
|
+
* button keeps handling its own clicks.
|
|
57
|
+
*/
|
|
58
|
+
export declare function TokenLink({ ref, href, isDisabled, LinkComponent, linkStyleProps, labelContent, icon, endContent, removeButton, ...containerProps }: TokenLinkProps): import("react").JSX.Element;
|
|
59
|
+
export declare namespace TokenLink {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=TokenLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenLink.d.ts","sourceRoot":"","sources":["../../src/Token/TokenLink.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAC,MAAM,OAAO,CAAC;AAIzE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,WAAW,CAAC;IACjE,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,aAAa,EAAE,iBAAiB,CAAC;IACjC,mEAAmE;IACnE,cAAc,EAAE;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,aAAa,CAAA;KAAC,CAAC;IAC5D,wEAAwE;IACxE,YAAY,EAAE,SAAS,CAAC;IACxB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kEAAkE;IAClE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,iEAAiE;IACjE,YAAY,EAAE,SAAS,CAAC;IACxB,kFAAkF;IAClF,CAAC,QAAQ,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,GAAG,EACH,IAAI,EACJ,UAAU,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,GAAG,cAAc,EAClB,EAAE,cAAc,+BA6BhB;yBAxCe,SAAS"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file TokenLink.tsx
|
|
7
|
+
* @input Rendered token pieces (icon, label, endContent, remove button) plus
|
|
8
|
+
* container/link styling props and the resolved LinkComponent
|
|
9
|
+
* @output Exports TokenLink, the interactive container for the href+onRemove Token variant
|
|
10
|
+
* @position Internal to Token; keeps Token.tsx presentational
|
|
11
|
+
*
|
|
12
|
+
* Token is a presentational component (see
|
|
13
|
+
* /internal/eslint-plugin-astryx/presentational-component.js) and must not use
|
|
14
|
+
* refs or effects. When a Token has both `href` and `onRemove`, the remove
|
|
15
|
+
* <button> must be a sibling of the link (nesting a button inside an anchor is
|
|
16
|
+
* invalid HTML — WCAG 4.1.2), so the surface becomes a clickable container that
|
|
17
|
+
* delegates to an inner link. That delegation needs refs, so it lives here.
|
|
18
|
+
*
|
|
19
|
+
* useClickableContainer gives the container middle-click and cmd/ctrl-click
|
|
20
|
+
* open-in-new-tab behavior for the link, ignores clicks on nested interactive
|
|
21
|
+
* elements (the remove button), and skips activation during text selection.
|
|
22
|
+
*
|
|
23
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
24
|
+
* - /packages/core/src/Token/Token.tsx (renders TokenLink for the href+onRemove case)
|
|
25
|
+
* - /packages/core/src/Token/Token.test.tsx (tests for delegated behavior)
|
|
26
|
+
*/
|
|
27
|
+
import { useRef } from 'react';
|
|
28
|
+
import { mergeRefs } from "../utils/index.js";
|
|
29
|
+
import { useClickableContainer } from "../hooks/useClickableContainer.js";
|
|
30
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
|
+
/**
|
|
32
|
+
* Interactive container for a Token that is both a link and removable.
|
|
33
|
+
*
|
|
34
|
+
* Renders a `<span>` wrapping an invisible inner link and the remove button as
|
|
35
|
+
* siblings. useClickableContainer delegates clicks on the surface to the link
|
|
36
|
+
* (including middle-click / cmd+click to open in a new tab) while the remove
|
|
37
|
+
* button keeps handling its own clicks.
|
|
38
|
+
*/
|
|
39
|
+
export function TokenLink({
|
|
40
|
+
ref,
|
|
41
|
+
href,
|
|
42
|
+
isDisabled,
|
|
43
|
+
LinkComponent,
|
|
44
|
+
linkStyleProps,
|
|
45
|
+
labelContent,
|
|
46
|
+
icon,
|
|
47
|
+
endContent,
|
|
48
|
+
removeButton,
|
|
49
|
+
...containerProps
|
|
50
|
+
}) {
|
|
51
|
+
const containerRef = useRef(null);
|
|
52
|
+
const linkRef = useRef(null);
|
|
53
|
+
const {
|
|
54
|
+
onClick,
|
|
55
|
+
onMouseUp
|
|
56
|
+
} = useClickableContainer({
|
|
57
|
+
containerRef,
|
|
58
|
+
interactiveRef: linkRef,
|
|
59
|
+
href,
|
|
60
|
+
disabled: isDisabled
|
|
61
|
+
});
|
|
62
|
+
return /*#__PURE__*/_jsxs("span", {
|
|
63
|
+
ref: mergeRefs(ref, containerRef),
|
|
64
|
+
onClick: isDisabled ? undefined : onClick,
|
|
65
|
+
onMouseUp: isDisabled ? undefined : onMouseUp,
|
|
66
|
+
...containerProps,
|
|
67
|
+
children: [icon, /*#__PURE__*/_jsx(LinkComponent, {
|
|
68
|
+
ref: linkRef,
|
|
69
|
+
href: href,
|
|
70
|
+
"aria-disabled": isDisabled || undefined,
|
|
71
|
+
...linkStyleProps,
|
|
72
|
+
children: labelContent
|
|
73
|
+
}), endContent, removeButton]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
TokenLink.displayName = 'TokenLink';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavMegaMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMegaMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TopNavMegaMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMegaMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA2L5C,MAAM,WAAW,mBAAoB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACvE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAW,EACX,SAAe,EACf,YAAY,GACb,EAAE,mBAAmB,4BA+BrB;yBAvCe,cAAc"}
|
|
@@ -51,6 +51,12 @@ const styles = {
|
|
|
51
51
|
k1tdAh: "x12p7p72",
|
|
52
52
|
$$css: true
|
|
53
53
|
},
|
|
54
|
+
panelViewportFit: {
|
|
55
|
+
k1xSpc: "x78zum5",
|
|
56
|
+
kXwgrk: "xdt5ytf",
|
|
57
|
+
kskxy: "xbhvqqn",
|
|
58
|
+
$$css: true
|
|
59
|
+
},
|
|
54
60
|
drawerHeader: {
|
|
55
61
|
kjj79g: "x1qughib",
|
|
56
62
|
$$css: true
|
|
@@ -288,11 +294,11 @@ function DefaultMegaMenu({
|
|
|
288
294
|
onMouseEnter: handleMouseEnter,
|
|
289
295
|
onMouseLeave: handleMouseLeave,
|
|
290
296
|
...{
|
|
291
|
-
className: "x1prclbq x11xkdxz x13fuv20 x1pc3f07 x1hviunn x1i5ehqx xb3r6kr"
|
|
297
|
+
className: "x1prclbq x11xkdxz x13fuv20 x1pc3f07 x1hviunn x1i5ehqx xb3r6kr x78zum5 xdt5ytf x2lwn1j"
|
|
292
298
|
},
|
|
293
299
|
children: /*#__PURE__*/_jsxs("div", {
|
|
294
300
|
...{
|
|
295
|
-
className: "x78zum5 x1a02dak x1qh66ti x8o8v82 xrrkdod
|
|
301
|
+
className: "x78zum5 x1a02dak x1qh66ti x8o8v82 xrrkdod x1m1aaou x9f619 x1odjw0f xish69e"
|
|
296
302
|
},
|
|
297
303
|
children: [items != null && /*#__PURE__*/_jsx("div", {
|
|
298
304
|
...{
|
|
@@ -313,7 +319,7 @@ function DefaultMegaMenu({
|
|
|
313
319
|
}), {
|
|
314
320
|
placement: 'below',
|
|
315
321
|
alignment: slot,
|
|
316
|
-
xstyle: styles.panelAnimation
|
|
322
|
+
xstyle: [styles.panelAnimation, styles.panelViewportFit]
|
|
317
323
|
})]
|
|
318
324
|
});
|
|
319
325
|
}
|
|
@@ -102,6 +102,15 @@ export interface BaseTypeaheadProps<T extends SearchableItem> extends Omit<BaseP
|
|
|
102
102
|
* Additional StyleX styles for the input element.
|
|
103
103
|
*/
|
|
104
104
|
inputXStyle?: StyleXStyles;
|
|
105
|
+
/**
|
|
106
|
+
* Tab-order override for the input element. Typeahead passes `-1` while
|
|
107
|
+
* its selected-value token is shown: the input is visually collapsed
|
|
108
|
+
* (width 0 / opacity 0) but must stay programmatically focusable for
|
|
109
|
+
* token edit/clear interactions, so removing it from the Tab order is
|
|
110
|
+
* what prevents an invisible tab stop (WCAG 2.4.3 / 2.4.7). The input
|
|
111
|
+
* remains focusable via `.focus()` regardless of this value.
|
|
112
|
+
*/
|
|
113
|
+
inputTabIndex?: number;
|
|
105
114
|
/**
|
|
106
115
|
* Ref to the anchor element for dropdown positioning.
|
|
107
116
|
* The dropdown will be positioned relative to this element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTypeahead.d.ts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IACH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE/D;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAuGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,EAkiBrB,CAAC,CAAC,SAAS,cAAc,EAC5B,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KACzB,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -151,6 +151,7 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
151
151
|
ariaDescribedBy,
|
|
152
152
|
ariaLabelledBy,
|
|
153
153
|
inputXStyle,
|
|
154
|
+
inputTabIndex,
|
|
154
155
|
anchorRef,
|
|
155
156
|
onKeyDown: externalOnKeyDown,
|
|
156
157
|
debounceMs = 150,
|
|
@@ -497,6 +498,7 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
497
498
|
"aria-describedby": ariaDescribedBy,
|
|
498
499
|
"aria-labelledby": ariaLabelledBy,
|
|
499
500
|
"aria-disabled": isFocusableDisabled ? 'true' : undefined,
|
|
501
|
+
tabIndex: inputTabIndex,
|
|
500
502
|
value: query,
|
|
501
503
|
onChange: handleInputChange,
|
|
502
504
|
onPointerDown: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/Typeahead/Typeahead.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAMtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,c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AClD,GAAG,EACH,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,MAAM,EACN,aAA0B,EAC1B,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,UAAkB,EAClB,eAAe,EACf,QAAe,EACf,YAAY,EACZ,IAAI,EAAE,QAAQ,EACd,UAAU,EACV,aAAa,EACb,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,GACtB,EAAE,cAAc,CAAC,CAAC,CAAC,qBA0QnB;yBA1Se,SAAS"}
|
|
@@ -314,7 +314,14 @@ export function Typeahead({
|
|
|
314
314
|
debounceMs: debounceMs,
|
|
315
315
|
anchorRef: wrapperRef,
|
|
316
316
|
onKeyDown: handleKeyDown,
|
|
317
|
-
inputXStyle: showToken ? styles.inputHidden : undefined
|
|
317
|
+
inputXStyle: showToken ? styles.inputHidden : undefined
|
|
318
|
+
// While the token is shown the input is collapsed (width 0 /
|
|
319
|
+
// opacity 0) — take it out of the Tab order so keyboard users
|
|
320
|
+
// don't hit an invisible stop (WCAG 2.4.3 / 2.4.7). It stays
|
|
321
|
+
// programmatically focusable: entering edit mode and clearing
|
|
322
|
+
// both refocus it after it uncollapses.
|
|
323
|
+
,
|
|
324
|
+
inputTabIndex: showToken ? -1 : undefined,
|
|
318
325
|
size: size
|
|
319
326
|
}), hasClear && value && !isDisabled && /*#__PURE__*/_jsx(InputClearButton, {
|
|
320
327
|
label: t('@astryx.typeahead.clearSelection'),
|