@astryxdesign/core 0.1.7-canary.fb9c68c → 0.1.7
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/README.md +15 -24
- package/dist/Collapsible/Collapsible.d.ts +1 -11
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +4 -36
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +3 -4
- package/dist/ContextMenu/index.d.ts +0 -3
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +1 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +4 -8
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +1 -17
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +0 -18
- package/dist/DropdownMenu/index.d.ts +1 -5
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +1 -10
- package/dist/Icon/Icon.d.ts +12 -17
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +20 -28
- package/dist/Outline/Outline.d.ts +3 -69
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +26 -129
- package/dist/Outline/useScrollSpy.d.ts +7 -27
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +70 -202
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +0 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/index.d.ts +0 -2
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +0 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +2 -24
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +7 -18
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +3 -6
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +1 -8
- package/dist/astryx.css +2 -18
- package/dist/astryx.umd.js +48 -48
- package/dist/astryx.umd.js.map +4 -4
- package/dist/theme/Theme.js +1 -1
- package/dist/theme/defineTheme.d.ts +1 -1
- package/dist/theme/defineTheme.js +1 -1
- package/dist/theme/hct.d.ts +1 -0
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +3 -0
- package/locales/en.json +0 -28
- package/locales/pseudo.json +0 -21
- package/package.json +1 -3
- package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
- package/src/Collapsible/Collapsible.doc.mjs +0 -7
- package/src/Collapsible/Collapsible.test.tsx +0 -80
- package/src/Collapsible/Collapsible.tsx +5 -58
- package/src/ContextMenu/ContextMenu.test.tsx +1 -75
- package/src/ContextMenu/ContextMenu.tsx +5 -10
- package/src/ContextMenu/index.ts +0 -15
- package/src/DropdownMenu/DropdownMenu.doc.mjs +0 -23
- package/src/DropdownMenu/DropdownMenu.tsx +6 -11
- package/src/DropdownMenu/DropdownMenuContext.tsx +1 -29
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +1 -7
- package/src/DropdownMenu/index.ts +3 -23
- package/src/Field/Field.doc.mjs +1 -1
- package/src/Field/FieldLabel.doc.mjs +1 -1
- package/src/Icon/Icon.test.tsx +0 -46
- package/src/Icon/Icon.tsx +24 -37
- package/src/NumberInput/NumberInput.doc.mjs +2 -2
- package/src/Outline/Outline.doc.mjs +3 -123
- package/src/Outline/Outline.test.tsx +0 -735
- package/src/Outline/Outline.tsx +33 -184
- package/src/Outline/useScrollSpy.ts +72 -248
- package/src/Selector/SelectorOption.doc.mjs +1 -1
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/Switch/Switch.doc.mjs +1 -1
- package/src/TabList/Tab.tsx +1 -5
- package/src/TabList/TabList.doc.mjs +3 -3
- package/src/TabList/TabList.test.tsx +0 -66
- package/src/TabList/TabList.tsx +0 -8
- package/src/TabList/TabMenu.tsx +1 -4
- package/src/Table/Table.doc.mjs +0 -2
- package/src/Table/index.ts +0 -7
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +1 -90
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +5 -37
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +9 -95
- package/src/Table/plugins/sortable/useTableSortable.tsx +7 -23
- package/src/Table/useBaseTablePlugins.ts +2 -6
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextInput/TextInput.doc.mjs +1 -1
- package/src/Toolbar/Toolbar.tsx +3 -10
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +1 -1
- package/src/theme/defineTheme.ts +1 -1
- package/src/theme/hct.ts +4 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +0 -89
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +0 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +0 -170
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +0 -69
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +0 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +0 -70
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +0 -69
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +0 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +0 -178
- package/dist/DropdownMenu/menuItemRoles.d.ts +0 -13
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +0 -1
- package/dist/DropdownMenu/menuItemRoles.js +0 -15
- package/dist/Table/plugins/tree/index.d.ts +0 -5
- package/dist/Table/plugins/tree/index.d.ts.map +0 -1
- package/dist/Table/plugins/tree/index.js +0 -4
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +0 -38
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +0 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +0 -358
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +0 -51
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +0 -1
- package/dist/Table/plugins/tree/useTableTreeState.js +0 -175
- package/scripts/postinstall.mjs +0 -93
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +0 -95
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +0 -237
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +0 -80
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +0 -119
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +0 -80
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +0 -232
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +0 -163
- package/src/DropdownMenu/menuItemRoles.ts +0 -22
- package/src/Table/plugins/tree/index.ts +0 -12
- package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +0 -163
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +0 -594
- package/src/Table/plugins/tree/useTableTreeData.tsx +0 -495
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +0 -636
- package/src/Table/plugins/tree/useTableTreeState.tsx +0 -253
- package/src/Table/useTableTreeData.doc.mjs +0 -75
- package/src/Table/useTableTreeState.doc.mjs +0 -98
- package/src/postinstall.test.mjs +0 -71
package/README.md
CHANGED
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Core UI components, theme system, and utilities for the Astryx design system. For project setup, see [Quick Start](#quick-start) below.
|
|
4
4
|
|
|
5
|
-
> **Building with an AI agent?**
|
|
6
|
-
>
|
|
7
|
-
> ```bash
|
|
8
|
-
> npm install -D @astryxdesign/cli # or: pnpm add -D / yarn add -D / bun add -d
|
|
9
|
-
> npx astryx init # resolves to the CLI you just installed
|
|
10
|
-
> ```
|
|
11
|
-
>
|
|
12
|
-
> `init` writes the Astryx component index into your `AGENTS.md`/`CLAUDE.md` so your agent discovers components, templates, and design tokens instead of guessing. Need a single command without installing? Use the scoped package directly — `npx @astryxdesign/cli <cmd>` (or `pnpm dlx`/`bunx @astryxdesign/cli`). Bare `npx astryx` only works once `@astryxdesign/cli` is a dependency; before that npm resolves it to an unrelated package. See [XDS CLI](#xds-cli).
|
|
5
|
+
> **Building with an AI agent?** Run **`npx astryx init`** first. It installs the Astryx CLI's component index into your `AGENTS.md`/`CLAUDE.md` so your agent discovers components, templates, and design tokens instead of guessing. Without it, agents can't see the CLI — see [XDS CLI](#xds-cli).
|
|
13
6
|
|
|
14
7
|
## Component Docs
|
|
15
8
|
|
|
@@ -32,9 +25,9 @@ global navigation.
|
|
|
32
25
|
Requires `@astryxdesign/cli` (`npm install -D @astryxdesign/cli`):
|
|
33
26
|
|
|
34
27
|
```bash
|
|
35
|
-
astryx template --list # browse all page and block templates
|
|
36
|
-
astryx template dashboard # emit full page source
|
|
37
|
-
astryx template settings --skeleton # layout skeleton with spatial annotations
|
|
28
|
+
npx astryx template --list # browse all page and block templates
|
|
29
|
+
npx astryx template dashboard # emit full page source
|
|
30
|
+
npx astryx template settings --skeleton # layout skeleton with spatial annotations
|
|
38
31
|
```
|
|
39
32
|
|
|
40
33
|
## Astryx CLI
|
|
@@ -42,21 +35,19 @@ astryx template settings --skeleton # layout skeleton with spatial annotations
|
|
|
42
35
|
The CLI (`@astryxdesign/cli`) provides additional tooling:
|
|
43
36
|
|
|
44
37
|
```bash
|
|
45
|
-
astryx --help # full listing of all commands
|
|
46
|
-
astryx component Button # full docs + related block templates
|
|
47
|
-
astryx docs # reference docs (principles, tokens, theming, styling)
|
|
48
|
-
astryx docs theme # theming guide (Theme, defineTheme, light/dark)
|
|
49
|
-
astryx docs tokens # spacing, color, radius, typography token reference
|
|
50
|
-
astryx init # initialize Astryx in your project
|
|
51
|
-
astryx theme build # build theme CSS for production
|
|
52
|
-
astryx swizzle Button # eject component source for customization
|
|
53
|
-
astryx upgrade --apply # run codemods to migrate between versions
|
|
54
|
-
astryx discover # discover external Astryx packages
|
|
55
|
-
astryx gap-report # report a missing capability
|
|
38
|
+
npx astryx --help # full listing of all commands
|
|
39
|
+
npx astryx component Button # full docs + related block templates
|
|
40
|
+
npx astryx docs # reference docs (principles, tokens, theming, styling)
|
|
41
|
+
npx astryx docs theme # theming guide (Theme, defineTheme, light/dark)
|
|
42
|
+
npx astryx docs tokens # spacing, color, radius, typography token reference
|
|
43
|
+
npx astryx init # initialize Astryx in your project
|
|
44
|
+
npx astryx theme build # build theme CSS for production
|
|
45
|
+
npx astryx swizzle Button # eject component source for customization
|
|
46
|
+
npx astryx upgrade --apply # run codemods to migrate between versions
|
|
47
|
+
npx astryx discover # discover external Astryx packages
|
|
48
|
+
npx astryx gap-report # report a missing capability
|
|
56
49
|
```
|
|
57
50
|
|
|
58
|
-
> Prefix these with your runner: `npx astryx …` / `pnpm exec astryx …` once the CLI is installed, or `npx @astryxdesign/cli …` to run without installing.
|
|
59
|
-
|
|
60
51
|
## Related Packages
|
|
61
52
|
|
|
62
53
|
| Package | Description |
|
|
@@ -45,16 +45,6 @@ export interface CollapsibleProps extends BaseProps {
|
|
|
45
45
|
* Controlled open state. When provided, the component is fully controlled.
|
|
46
46
|
*/
|
|
47
47
|
isOpen?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Whether the collapsible is disabled. A disabled item can't be toggled —
|
|
50
|
-
* its trigger is non-interactive and dimmed. Following the system-wide
|
|
51
|
-
* disabled convention, the trigger uses `aria-disabled` (not the native
|
|
52
|
-
* `disabled` attribute) and drops out of the tab order, staying perceivable
|
|
53
|
-
* to assistive tech. The content stays in whatever open state it was;
|
|
54
|
-
* disabling doesn't collapse an already-open item.
|
|
55
|
-
* @default false
|
|
56
|
-
*/
|
|
57
|
-
isDisabled?: boolean;
|
|
58
48
|
/**
|
|
59
49
|
* Callback when the open state changes.
|
|
60
50
|
*/
|
|
@@ -106,7 +96,7 @@ export interface CollapsibleProps extends BaseProps {
|
|
|
106
96
|
* </CollapsibleGroup>
|
|
107
97
|
* ```
|
|
108
98
|
*/
|
|
109
|
-
export declare function Collapsible({ trigger, children, defaultIsOpen, isOpen: controlledIsOpen,
|
|
99
|
+
export declare function Collapsible({ trigger, children, defaultIsOpen, isOpen: controlledIsOpen, onOpenChange, value, ref, xstyle, className, style, ...props }: CollapsibleProps): import("react").JSX.Element;
|
|
110
100
|
export declare namespace Collapsible {
|
|
111
101
|
var displayName: string;
|
|
112
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../../src/Collapsible/Collapsible.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../../src/Collapsible/Collapsible.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAgBjD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAkG5C,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,gBAAgB,EACxB,YAAY,EACZ,KAAK,EACL,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,gBAAgB,+BAqElB;yBAjFe,WAAW"}
|
|
@@ -58,22 +58,12 @@ const styles = {
|
|
|
58
58
|
kInvED: "x1wfwxd8 x7s97pk",
|
|
59
59
|
$$css: true
|
|
60
60
|
},
|
|
61
|
-
triggerDisabled: {
|
|
62
|
-
kkrTdU: "x1h6gzvc",
|
|
63
|
-
kSiTet: "xbyyjgo",
|
|
64
|
-
$$css: true
|
|
65
|
-
},
|
|
66
61
|
contentHidden: {
|
|
67
62
|
k1xSpc: "x1s85apg",
|
|
68
63
|
$$css: true
|
|
69
64
|
},
|
|
70
65
|
content: {
|
|
71
66
|
kLKAdn: "xfsso4q",
|
|
72
|
-
kMv6JI: "x9ynric",
|
|
73
|
-
kGuDYH: "xjm74w1",
|
|
74
|
-
k63SB2: "xxovm9e",
|
|
75
|
-
kLWn49: "xw6l6zx",
|
|
76
|
-
kMwMTN: "x1tgivj0",
|
|
77
67
|
$$css: true
|
|
78
68
|
},
|
|
79
69
|
divided: {
|
|
@@ -165,7 +155,6 @@ export function Collapsible({
|
|
|
165
155
|
children,
|
|
166
156
|
defaultIsOpen,
|
|
167
157
|
isOpen: controlledIsOpen,
|
|
168
|
-
isDisabled = false,
|
|
169
158
|
onOpenChange,
|
|
170
159
|
value,
|
|
171
160
|
ref,
|
|
@@ -189,17 +178,6 @@ export function Collapsible({
|
|
|
189
178
|
isCollapsible: collapsibleConfig,
|
|
190
179
|
value
|
|
191
180
|
});
|
|
192
|
-
|
|
193
|
-
// Activation is blocked by this guard rather than the native `disabled`
|
|
194
|
-
// attribute, so the trigger keeps `aria-disabled` semantics and stays
|
|
195
|
-
// discoverable. A native `disabled` button would silently swallow events
|
|
196
|
-
// (e.g. a wrapping tooltip's hover) — the system-wide disabled convention.
|
|
197
|
-
const handleToggle = () => {
|
|
198
|
-
if (isDisabled) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
toggle();
|
|
202
|
-
};
|
|
203
181
|
const presentation = use(CollapsibleGroupPresentationContext);
|
|
204
182
|
const isDivided = presentation?.hasDividers ?? false;
|
|
205
183
|
const density = presentation?.density ?? null;
|
|
@@ -216,18 +194,10 @@ export function Collapsible({
|
|
|
216
194
|
...props,
|
|
217
195
|
children: [/*#__PURE__*/_jsxs("button", {
|
|
218
196
|
type: "button",
|
|
219
|
-
onClick:
|
|
220
|
-
"aria-disabled": isDisabled || undefined,
|
|
197
|
+
onClick: toggle,
|
|
221
198
|
"aria-expanded": isOpen,
|
|
222
|
-
"aria-controls": contentId
|
|
223
|
-
|
|
224
|
-
// dead tab stop; activation stays blocked by the handleToggle guard,
|
|
225
|
-
// and aria-disabled keeps the state perceivable to assistive tech —
|
|
226
|
-
// the system-wide disabled convention (never native `disabled`, which
|
|
227
|
-
// would swallow events like a wrapping tooltip's hover).
|
|
228
|
-
,
|
|
229
|
-
tabIndex: isDisabled ? -1 : undefined,
|
|
230
|
-
...stylex.props(styles.trigger, density != null && triggerDensity[density], isDisabled && styles.triggerDisabled),
|
|
199
|
+
"aria-controls": contentId,
|
|
200
|
+
...stylex.props(styles.trigger, density != null && triggerDensity[density]),
|
|
231
201
|
children: [/*#__PURE__*/_jsx("span", {
|
|
232
202
|
...{
|
|
233
203
|
className: "x1b2iylo xwgcxoh"
|
|
@@ -246,9 +216,7 @@ export function Collapsible({
|
|
|
246
216
|
})]
|
|
247
217
|
}), /*#__PURE__*/_jsx("div", {
|
|
248
218
|
id: contentId,
|
|
249
|
-
...
|
|
250
|
-
density: density ?? undefined
|
|
251
|
-
}), stylex.props(styles.content, density != null && contentDensity[density], !isOpen && styles.contentHidden)),
|
|
219
|
+
...stylex.props(styles.content, density != null && contentDensity[density], !isOpen && styles.contentHidden),
|
|
252
220
|
children: presentation != null ? /*#__PURE__*/_jsx(CollapsibleGroupPresentationContext, {
|
|
253
221
|
value: null,
|
|
254
222
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAqBrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAqDtC,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAMnD,UAAU,oBAAqB,SA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|
|
34
34
|
import { useLayer } from "../Layer/useLayer.js";
|
|
35
35
|
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
36
36
|
import { DropdownMenuContext } from "../DropdownMenu/DropdownMenuContext.js";
|
|
37
|
-
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR } from "../DropdownMenu/menuItemRoles.js";
|
|
38
37
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
39
38
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
40
39
|
import { useLongPress } from "../hooks/useLongPress.js";
|
|
@@ -179,13 +178,13 @@ export function ContextMenu({
|
|
|
179
178
|
focusFirst,
|
|
180
179
|
focusItem
|
|
181
180
|
} = useListFocus({
|
|
182
|
-
itemSelector:
|
|
181
|
+
itemSelector: '[role="menuitem"]:not([aria-disabled="true"])',
|
|
183
182
|
wrap: false,
|
|
184
183
|
onEscape: closeMenu
|
|
185
184
|
});
|
|
186
185
|
|
|
187
186
|
// First-character typeahead over the enabled menu items (menus-11).
|
|
188
|
-
const getMenuItems = useCallback(() => listRef.current ? Array.from(listRef.current.querySelectorAll(
|
|
187
|
+
const getMenuItems = useCallback(() => listRef.current ? Array.from(listRef.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) : [], [listRef]);
|
|
189
188
|
const typeahead = useTypeahead({
|
|
190
189
|
getItemLabels: () => getMenuItems().map(el => el.textContent),
|
|
191
190
|
onMatch: focusItem,
|
|
@@ -239,7 +238,7 @@ export function ContextMenu({
|
|
|
239
238
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
240
239
|
e.preventDefault();
|
|
241
240
|
const focused = document.activeElement;
|
|
242
|
-
if (focused
|
|
241
|
+
if (focused?.getAttribute('role') === 'menuitem') {
|
|
243
242
|
focused.click();
|
|
244
243
|
}
|
|
245
244
|
return;
|
|
@@ -5,7 +5,4 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { ContextMenu, type ContextMenuProps, type ContextMenuItemData, type ContextMenuDivider, type ContextMenuSection, type ContextMenuOption, } from './ContextMenu';
|
|
7
7
|
export { DropdownMenuItem as ContextMenuItem, type DropdownMenuItemProps as ContextMenuItemProps, } from '../DropdownMenu/DropdownMenuItem';
|
|
8
|
-
export { DropdownMenuCheckboxItem as ContextMenuCheckboxItem, type DropdownMenuCheckboxItemProps as ContextMenuCheckboxItemProps, } from '../DropdownMenu/DropdownMenuCheckboxItem';
|
|
9
|
-
export { DropdownMenuRadioGroup as ContextMenuRadioGroup, type DropdownMenuRadioGroupProps as ContextMenuRadioGroupProps, } from '../DropdownMenu/DropdownMenuRadioGroup';
|
|
10
|
-
export { DropdownMenuRadioItem as ContextMenuRadioItem, type DropdownMenuRadioItemProps as ContextMenuRadioItemProps, } from '../DropdownMenu/DropdownMenuRadioItem';
|
|
11
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,IAAI,eAAe,EACnC,KAAK,qBAAqB,IAAI,oBAAoB,GACnD,MAAM,kCAAkC,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,IAAI,eAAe,EACnC,KAAK,qBAAqB,IAAI,oBAAoB,GACnD,MAAM,kCAAkC,CAAC"}
|
|
@@ -7,10 +7,4 @@
|
|
|
7
7
|
* @position Public API entry point
|
|
8
8
|
*/
|
|
9
9
|
export { ContextMenu } from "./ContextMenu.js";
|
|
10
|
-
export { DropdownMenuItem as ContextMenuItem } from "../DropdownMenu/DropdownMenuItem.js";
|
|
11
|
-
|
|
12
|
-
// Selectable items work inside a ContextMenu too — re-exported under the
|
|
13
|
-
// ContextMenu name for a coherent API.
|
|
14
|
-
export { DropdownMenuCheckboxItem as ContextMenuCheckboxItem } from "../DropdownMenu/DropdownMenuCheckboxItem.js";
|
|
15
|
-
export { DropdownMenuRadioGroup as ContextMenuRadioGroup } from "../DropdownMenu/DropdownMenuRadioGroup.js";
|
|
16
|
-
export { DropdownMenuRadioItem as ContextMenuRadioItem } from "../DropdownMenu/DropdownMenuRadioItem.js";
|
|
10
|
+
export { DropdownMenuItem as ContextMenuItem } from "../DropdownMenu/DropdownMenuItem.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAUtC,OAAO,KAAK,EA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Q,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AA+BpD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,gBAAgB,EAC5B,YAAY,EACZ,SAAS,EACT,OAAO,EACP,UAAiB,EACjB,SAAmB,EACnB,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAwQnB;yBArRe,YAAY"}
|
|
@@ -27,7 +27,6 @@ import { usePopover } from "../Popover/usePopover.js";
|
|
|
27
27
|
import { Button } from "../Button/index.js";
|
|
28
28
|
import { Icon } from "../Icon/index.js";
|
|
29
29
|
import { renderDropdownItems } from "./renderDropdownItems.js";
|
|
30
|
-
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR } from "./menuItemRoles.js";
|
|
31
30
|
import { DropdownMenuContext } from "./DropdownMenuContext.js";
|
|
32
31
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
33
32
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
@@ -187,24 +186,21 @@ export function DropdownMenu({
|
|
|
187
186
|
popover.hide();
|
|
188
187
|
}, [popover]);
|
|
189
188
|
|
|
190
|
-
// Single keyboard navigation path for both modes
|
|
191
|
-
// The selector matches plain items plus selectable items
|
|
192
|
-
// (menuitemradio/menuitemcheckbox) so lab checkbox/radio rows are reachable
|
|
193
|
-
// and roved to alongside plain items — not just role="menuitem".
|
|
189
|
+
// Single keyboard navigation path for both modes
|
|
194
190
|
const {
|
|
195
191
|
listRef,
|
|
196
192
|
handleKeyDown: listNavKeyDown,
|
|
197
193
|
focusFirst,
|
|
198
194
|
focusItem
|
|
199
195
|
} = useListFocus({
|
|
200
|
-
itemSelector:
|
|
196
|
+
itemSelector: '[role="menuitem"]:not([aria-disabled="true"])',
|
|
201
197
|
wrap: false,
|
|
202
198
|
onEscape: closeMenu
|
|
203
199
|
});
|
|
204
200
|
|
|
205
201
|
// First-character typeahead over the (enabled) menu items — jump to the next
|
|
206
202
|
// item whose label starts with the typed text (menus-11).
|
|
207
|
-
const getMenuItems = useCallback(() => listRef.current ? Array.from(listRef.current.querySelectorAll(
|
|
203
|
+
const getMenuItems = useCallback(() => listRef.current ? Array.from(listRef.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) : [], [listRef]);
|
|
208
204
|
const typeahead = useTypeahead({
|
|
209
205
|
getItemLabels: () => getMenuItems().map(el => el.textContent),
|
|
210
206
|
onMatch: focusItem,
|
|
@@ -228,7 +224,7 @@ export function DropdownMenu({
|
|
|
228
224
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
229
225
|
e.preventDefault();
|
|
230
226
|
const focused = document.activeElement;
|
|
231
|
-
if (focused
|
|
227
|
+
if (focused?.getAttribute('role') === 'menuitem') {
|
|
232
228
|
focused.click();
|
|
233
229
|
}
|
|
234
230
|
return;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
/** Menu size, derived from the trigger button size. */
|
|
2
|
-
export type DropdownMenuSize = 'sm' | 'md' | 'lg';
|
|
3
1
|
export interface DropdownMenuContextValue {
|
|
4
2
|
/** Close the menu and return focus to trigger */
|
|
5
3
|
closeMenu: () => void;
|
|
6
4
|
/** Menu size derived from button size */
|
|
7
|
-
menuSize:
|
|
5
|
+
menuSize: 'sm' | 'md' | 'lg';
|
|
8
6
|
}
|
|
9
7
|
export declare const DropdownMenuContext: import("react").Context<DropdownMenuContextValue | null>;
|
|
10
8
|
/**
|
|
@@ -12,18 +10,4 @@ export declare const DropdownMenuContext: import("react").Context<DropdownMenuCo
|
|
|
12
10
|
* Returns null outside of a DropdownMenu.
|
|
13
11
|
*/
|
|
14
12
|
export declare function useDropdownMenuContext(): DropdownMenuContextValue | null;
|
|
15
|
-
export interface DropdownMenuRadioGroupContextValue {
|
|
16
|
-
/** The currently selected value in the group. */
|
|
17
|
-
value: string | undefined;
|
|
18
|
-
/** Select a value. Called by a DropdownMenuRadioItem on activation. */
|
|
19
|
-
onChange: (value: string) => void;
|
|
20
|
-
/** Whether selecting an item should close the menu. @default true */
|
|
21
|
-
hasCloseOnSelect: boolean;
|
|
22
|
-
}
|
|
23
|
-
export declare const DropdownMenuRadioGroupContext: import("react").Context<DropdownMenuRadioGroupContextValue | null>;
|
|
24
|
-
/**
|
|
25
|
-
* Read the enclosing radio group's selection state.
|
|
26
|
-
* Returns null when used outside a DropdownMenuRadioGroup.
|
|
27
|
-
*/
|
|
28
|
-
export declare function useDropdownMenuRadioGroupContext(): DropdownMenuRadioGroupContextValue | null;
|
|
29
13
|
//# sourceMappingURL=DropdownMenuContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuContext.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuContext.tsx"],"names":[],"mappings":"AAgBA,
|
|
1
|
+
{"version":3,"file":"DropdownMenuContext.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuContext.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,yCAAyC;IACzC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,mBAAmB,0DACsB,CAAC;AAGvD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,wBAAwB,GAAG,IAAI,CAExE"}
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
* items don't need to register themselves.
|
|
13
13
|
*/
|
|
14
14
|
import { createContext, use } from 'react';
|
|
15
|
-
|
|
16
|
-
/** Menu size, derived from the trigger button size. */
|
|
17
|
-
|
|
18
15
|
export const DropdownMenuContext = /*#__PURE__*/createContext(null);
|
|
19
16
|
DropdownMenuContext.displayName = 'DropdownMenuContext';
|
|
20
17
|
|
|
@@ -24,19 +21,4 @@ DropdownMenuContext.displayName = 'DropdownMenuContext';
|
|
|
24
21
|
*/
|
|
25
22
|
export function useDropdownMenuContext() {
|
|
26
23
|
return use(DropdownMenuContext);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// =============================================================================
|
|
30
|
-
// Radio group coordination
|
|
31
|
-
// =============================================================================
|
|
32
|
-
|
|
33
|
-
export const DropdownMenuRadioGroupContext = /*#__PURE__*/createContext(null);
|
|
34
|
-
DropdownMenuRadioGroupContext.displayName = 'DropdownMenuRadioGroupContext';
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Read the enclosing radio group's selection state.
|
|
38
|
-
* Returns null when used outside a DropdownMenuRadioGroup.
|
|
39
|
-
*/
|
|
40
|
-
export function useDropdownMenuRadioGroupContext() {
|
|
41
|
-
return use(DropdownMenuRadioGroupContext);
|
|
42
24
|
}
|
|
@@ -4,9 +4,5 @@
|
|
|
4
4
|
* @position Public API entry point
|
|
5
5
|
*/
|
|
6
6
|
export { DropdownMenu, type DropdownMenuProps, type DropdownMenuButtonProps, type DropdownMenuItemData, type DropdownMenuDivider, type DropdownMenuSection, type DropdownMenuOption, } from './DropdownMenu';
|
|
7
|
-
export { DropdownMenuItem, type DropdownMenuItemProps } from './DropdownMenuItem';
|
|
8
|
-
export { DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, } from './DropdownMenuCheckboxItem';
|
|
9
|
-
export { DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, } from './DropdownMenuRadioGroup';
|
|
10
|
-
export { DropdownMenuRadioItem, type DropdownMenuRadioItemProps, } from './DropdownMenuRadioItem';
|
|
11
|
-
export { DropdownMenuContext, useDropdownMenuContext, type DropdownMenuContextValue, type DropdownMenuSize, } from './DropdownMenuContext';
|
|
7
|
+
export { DropdownMenuItem, type DropdownMenuItemProps, } from './DropdownMenuItem';
|
|
12
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC"}
|
|
@@ -8,13 +8,4 @@
|
|
|
8
8
|
* @position Public API entry point
|
|
9
9
|
*/
|
|
10
10
|
export { DropdownMenu } from "./DropdownMenu.js";
|
|
11
|
-
export { DropdownMenuItem } from "./DropdownMenuItem.js";
|
|
12
|
-
|
|
13
|
-
// Selectable items — checkbox (independent) and radio (single-select group).
|
|
14
|
-
export { DropdownMenuCheckboxItem } from "./DropdownMenuCheckboxItem.js";
|
|
15
|
-
export { DropdownMenuRadioGroup } from "./DropdownMenuRadioGroup.js";
|
|
16
|
-
export { DropdownMenuRadioItem } from "./DropdownMenuRadioItem.js";
|
|
17
|
-
|
|
18
|
-
// Menu-coordination context — public so consumers can build custom menu items
|
|
19
|
-
// that read the menu size / close the menu.
|
|
20
|
-
export { DropdownMenuContext, useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
11
|
+
export { DropdownMenuItem } from "./DropdownMenuItem.js";
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -82,28 +82,23 @@ declare const colorStyles: Readonly<{
|
|
|
82
82
|
/**
|
|
83
83
|
* Size styles for direct SVG icon components.
|
|
84
84
|
* Uses width/height only — SVG components handle their own viewBox scaling.
|
|
85
|
-
*
|
|
86
|
-
* Sizes are expressed in `rem` (relative to the root font-size) so icons scale
|
|
87
|
-
* in step with text when the document font-size changes, matching the rest of
|
|
88
|
-
* the design system's rem-based type scale. Values are the px-equivalents at a
|
|
89
|
-
* 16px root: 12px → 0.75rem, 16px → 1rem, 20px → 1.25rem, 24px → 1.5rem.
|
|
90
85
|
*/
|
|
91
86
|
declare const sizeStyles: Readonly<{
|
|
92
87
|
readonly xsm: Readonly<{
|
|
93
|
-
readonly width: stylex.StyleXClassNameFor<"width",
|
|
94
|
-
readonly height: stylex.StyleXClassNameFor<"height",
|
|
88
|
+
readonly width: stylex.StyleXClassNameFor<"width", 12>;
|
|
89
|
+
readonly height: stylex.StyleXClassNameFor<"height", 12>;
|
|
95
90
|
}>;
|
|
96
91
|
readonly sm: Readonly<{
|
|
97
|
-
readonly width: stylex.StyleXClassNameFor<"width",
|
|
98
|
-
readonly height: stylex.StyleXClassNameFor<"height",
|
|
92
|
+
readonly width: stylex.StyleXClassNameFor<"width", 16>;
|
|
93
|
+
readonly height: stylex.StyleXClassNameFor<"height", 16>;
|
|
99
94
|
}>;
|
|
100
95
|
readonly md: Readonly<{
|
|
101
|
-
readonly width: stylex.StyleXClassNameFor<"width",
|
|
102
|
-
readonly height: stylex.StyleXClassNameFor<"height",
|
|
96
|
+
readonly width: stylex.StyleXClassNameFor<"width", 20>;
|
|
97
|
+
readonly height: stylex.StyleXClassNameFor<"height", 20>;
|
|
103
98
|
}>;
|
|
104
99
|
readonly lg: Readonly<{
|
|
105
|
-
readonly width: stylex.StyleXClassNameFor<"width",
|
|
106
|
-
readonly height: stylex.StyleXClassNameFor<"height",
|
|
100
|
+
readonly width: stylex.StyleXClassNameFor<"width", 24>;
|
|
101
|
+
readonly height: stylex.StyleXClassNameFor<"height", 24>;
|
|
107
102
|
}>;
|
|
108
103
|
}>;
|
|
109
104
|
export type IconColor = keyof typeof colorStyles;
|
|
@@ -133,10 +128,10 @@ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'color'
|
|
|
133
128
|
color?: IconColor;
|
|
134
129
|
/**
|
|
135
130
|
* The size of the icon.
|
|
136
|
-
* - 'xsm':
|
|
137
|
-
* - 'sm':
|
|
138
|
-
* - 'md':
|
|
139
|
-
* - 'lg':
|
|
131
|
+
* - 'xsm': 12px
|
|
132
|
+
* - 'sm': 16px
|
|
133
|
+
* - 'md': 20px
|
|
134
|
+
* - 'lg': 24px
|
|
140
135
|
* @default 'md'
|
|
141
136
|
*/
|
|
142
137
|
size?: IconSize;
|
package/dist/Icon/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAqBnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2Df,CAAC;AAEH
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAqBnD,QAAA,MAAM,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uses width/height only — SVG components handle their own viewBox scaling.
|
|
131
|
-
*
|
|
132
|
-
* Sizes are expressed in `rem` (relative to the root font-size) so icons scale
|
|
133
|
-
* in step with text when the document font-size changes, matching the rest of
|
|
134
|
-
* the design system's rem-based type scale. Values are the px-equivalents at a
|
|
135
|
-
* 16px root: 12px → 0.75rem, 16px → 1rem, 20px → 1.25rem, 24px → 1.5rem.
|
|
136
131
|
*/
|
|
137
132
|
const sizeStyles = {
|
|
138
133
|
xsm: {
|
|
139
|
-
kzqmXN: "
|
|
140
|
-
kZKoxP: "
|
|
134
|
+
kzqmXN: "xsmyaan",
|
|
135
|
+
kZKoxP: "x1kpxq89",
|
|
141
136
|
$$css: true
|
|
142
137
|
},
|
|
143
138
|
sm: {
|
|
144
|
-
kzqmXN: "
|
|
145
|
-
kZKoxP: "
|
|
139
|
+
kzqmXN: "x1kky2od",
|
|
140
|
+
kZKoxP: "xlup9mm",
|
|
146
141
|
$$css: true
|
|
147
142
|
},
|
|
148
143
|
md: {
|
|
149
|
-
kzqmXN: "
|
|
150
|
-
kZKoxP: "
|
|
144
|
+
kzqmXN: "xw4jnvo",
|
|
145
|
+
kZKoxP: "x1qx5ct2",
|
|
151
146
|
$$css: true
|
|
152
147
|
},
|
|
153
148
|
lg: {
|
|
154
|
-
kzqmXN: "
|
|
155
|
-
kZKoxP: "
|
|
149
|
+
kzqmXN: "xvy4d1p",
|
|
150
|
+
kZKoxP: "xxk0z11",
|
|
156
151
|
$$css: true
|
|
157
152
|
}
|
|
158
153
|
};
|
|
@@ -160,33 +155,30 @@ const sizeStyles = {
|
|
|
160
155
|
/**
|
|
161
156
|
* Size styles for string-based (registry) icons.
|
|
162
157
|
* Includes fontSize so that 1em-based icons from the registry scale correctly.
|
|
163
|
-
*
|
|
164
|
-
* Expressed in `rem` for the same reason as {@link sizeStyles} — icons track the
|
|
165
|
-
* root font-size instead of being locked to absolute pixels.
|
|
166
158
|
*/
|
|
167
159
|
const spanSizeStyles = {
|
|
168
160
|
xsm: {
|
|
169
|
-
kzqmXN: "
|
|
170
|
-
kZKoxP: "
|
|
171
|
-
kGuDYH: "
|
|
161
|
+
kzqmXN: "xsmyaan",
|
|
162
|
+
kZKoxP: "x1kpxq89",
|
|
163
|
+
kGuDYH: "xfifm61",
|
|
172
164
|
$$css: true
|
|
173
165
|
},
|
|
174
166
|
sm: {
|
|
175
|
-
kzqmXN: "
|
|
176
|
-
kZKoxP: "
|
|
177
|
-
kGuDYH: "
|
|
167
|
+
kzqmXN: "x1kky2od",
|
|
168
|
+
kZKoxP: "xlup9mm",
|
|
169
|
+
kGuDYH: "x1j61zf2",
|
|
178
170
|
$$css: true
|
|
179
171
|
},
|
|
180
172
|
md: {
|
|
181
|
-
kzqmXN: "
|
|
182
|
-
kZKoxP: "
|
|
183
|
-
kGuDYH: "
|
|
173
|
+
kzqmXN: "xw4jnvo",
|
|
174
|
+
kZKoxP: "x1qx5ct2",
|
|
175
|
+
kGuDYH: "xwsyq91",
|
|
184
176
|
$$css: true
|
|
185
177
|
},
|
|
186
178
|
lg: {
|
|
187
|
-
kzqmXN: "
|
|
188
|
-
kZKoxP: "
|
|
189
|
-
kGuDYH: "
|
|
179
|
+
kzqmXN: "xvy4d1p",
|
|
180
|
+
kZKoxP: "xxk0z11",
|
|
181
|
+
kGuDYH: "x1pvqxga",
|
|
190
182
|
$$css: true
|
|
191
183
|
}
|
|
192
184
|
};
|