@astryxdesign/core 0.2.0-canary.4ffab6f → 0.2.0-canary.54759c8
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/Center/Center.d.ts +20 -3
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +10 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +18 -12
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +38 -63
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +5 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +4 -4
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +6 -4
- package/dist/astryx.umd.js +42 -42
- package/dist/astryx.umd.js.map +4 -4
- package/package.json +1 -1
- package/src/Center/Center.doc.mjs +38 -0
- package/src/Center/Center.test.tsx +75 -0
- package/src/Center/Center.tsx +37 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +5 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +35 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +41 -64
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +10 -1
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +64 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +17 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +10 -2
- package/src/DropdownMenu/renderDropdownItems.tsx +14 -2
package/dist/Center/Center.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Center.tsx
|
|
3
|
-
* @input Uses React, StyleX for centering styles
|
|
3
|
+
* @input Uses React, StyleX for centering styles, Layout padding.stylex for spacing-scale padding
|
|
4
4
|
* @output Exports Center component and CenterProps
|
|
5
5
|
* @position Center component for centering children horizontally/vertically
|
|
6
6
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { ReactNode } from 'react';
|
|
14
14
|
import type { BaseProps } from '../BaseProps';
|
|
15
|
-
import type { SizeValue } from '../utils/types';
|
|
15
|
+
import type { SizeValue, SpacingStep } from '../utils/types';
|
|
16
16
|
export type CenterAxis = 'both' | 'horizontal' | 'vertical';
|
|
17
17
|
export interface CenterProps extends BaseProps<HTMLDivElement> {
|
|
18
18
|
/** Ref forwarded to the root element */
|
|
@@ -45,6 +45,23 @@ export interface CenterProps extends BaseProps<HTMLDivElement> {
|
|
|
45
45
|
* Numbers are treated as pixels, strings are used as-is (e.g., '100%').
|
|
46
46
|
*/
|
|
47
47
|
minHeight?: SizeValue;
|
|
48
|
+
/**
|
|
49
|
+
* Inner padding on all sides, using the spacing scale.
|
|
50
|
+
* Accepts numeric spacing steps: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.
|
|
51
|
+
*
|
|
52
|
+
* Matches the `padding` prop on `Stack`, `Card`, `LayoutContent`, and `LayoutPanel`.
|
|
53
|
+
*/
|
|
54
|
+
padding?: SpacingStep;
|
|
55
|
+
/**
|
|
56
|
+
* Inline (horizontal) padding, using the spacing scale.
|
|
57
|
+
* Overrides `padding` on the inline axis when both are set.
|
|
58
|
+
*/
|
|
59
|
+
paddingInline?: SpacingStep;
|
|
60
|
+
/**
|
|
61
|
+
* Block (vertical) padding, using the spacing scale.
|
|
62
|
+
* Overrides `padding` on the block axis when both are set.
|
|
63
|
+
*/
|
|
64
|
+
paddingBlock?: SpacingStep;
|
|
48
65
|
/**
|
|
49
66
|
* Whether to make the container inline-flex (useful for text/icons).
|
|
50
67
|
* @default false
|
|
@@ -68,7 +85,7 @@ export interface CenterProps extends BaseProps<HTMLDivElement> {
|
|
|
68
85
|
* </Center>
|
|
69
86
|
* ```
|
|
70
87
|
*/
|
|
71
|
-
export declare function Center({ axis, width, height, maxWidth, minHeight, isInline, children, xstyle, className, style, ref, ...props }: CenterProps): import("react").JSX.Element;
|
|
88
|
+
export declare function Center({ axis, width, height, maxWidth, minHeight, padding, paddingInline, paddingBlock, isInline, children, xstyle, className, style, ref, ...props }: CenterProps): import("react").JSX.Element;
|
|
72
89
|
export declare namespace Center {
|
|
73
90
|
var displayName: string;
|
|
74
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/Center/Center.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/Center/Center.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAsC3D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAE5D,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,EACrB,IAAa,EACb,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,aAAa,EACb,YAAY,EACZ,QAAgB,EAChB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAgCb;yBAhDe,MAAM"}
|
package/dist/Center/Center.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Center.tsx
|
|
7
|
-
* @input Uses React, StyleX for centering styles
|
|
7
|
+
* @input Uses React, StyleX for centering styles, Layout padding.stylex for spacing-scale padding
|
|
8
8
|
* @output Exports Center component and CenterProps
|
|
9
9
|
* @position Center component for centering children horizontally/vertically
|
|
10
10
|
*
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* - /packages/cli/templates/blocks/components/Center/ (showcase blocks)
|
|
16
16
|
*/
|
|
17
17
|
import * as stylex from '@stylexjs/stylex';
|
|
18
|
+
import { paddingInlineStyles, paddingBlockStyles } from "../Layout/padding.stylex.js";
|
|
18
19
|
import { mergeProps } from "../utils/index.js";
|
|
19
20
|
import { themeProps } from "../utils/themeProps.js";
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -71,6 +72,9 @@ export function Center({
|
|
|
71
72
|
height,
|
|
72
73
|
maxWidth,
|
|
73
74
|
minHeight,
|
|
75
|
+
padding,
|
|
76
|
+
paddingInline,
|
|
77
|
+
paddingBlock,
|
|
74
78
|
isInline = false,
|
|
75
79
|
children,
|
|
76
80
|
xstyle,
|
|
@@ -79,9 +83,13 @@ export function Center({
|
|
|
79
83
|
ref,
|
|
80
84
|
...props
|
|
81
85
|
}) {
|
|
86
|
+
// Resolve padding to per-axis values: `padding` sets both axes; `paddingInline`
|
|
87
|
+
// / `paddingBlock` take precedence on their own axis when provided.
|
|
88
|
+
const resolvedPaddingInline = paddingInline ?? padding;
|
|
89
|
+
const resolvedPaddingBlock = paddingBlock ?? padding;
|
|
82
90
|
const stylexProps = mergeProps(themeProps('center', {
|
|
83
91
|
axis
|
|
84
|
-
}), stylex.props(isInline ? styles.inline : styles.base, (axis === 'both' || axis === 'vertical') && styles.alignItemsCenter, (axis === 'both' || axis === 'horizontal') && styles.justifyContentCenter, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), xstyle), className, style);
|
|
92
|
+
}), stylex.props(isInline ? styles.inline : styles.base, (axis === 'both' || axis === 'vertical') && styles.alignItemsCenter, (axis === 'both' || axis === 'horizontal') && styles.justifyContentCenter, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), resolvedPaddingInline != null && paddingInlineStyles[resolvedPaddingInline], resolvedPaddingBlock != null && paddingBlockStyles[resolvedPaddingBlock], xstyle), className, style);
|
|
85
93
|
return /*#__PURE__*/_jsx("div", {
|
|
86
94
|
ref: ref,
|
|
87
95
|
...stylexProps,
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file DropdownMenuCheckboxItem.tsx
|
|
3
|
-
* @input React, stylex, Item +
|
|
3
|
+
* @input React, stylex, Item + CheckboxInput + DropdownMenu context + tokens from core
|
|
4
4
|
* @output DropdownMenuCheckboxItem — a standalone checkable menu item.
|
|
5
5
|
* @position Sub-component; used inside DropdownMenu.
|
|
6
6
|
*
|
|
7
7
|
* A menu item that toggles an independent boolean (role="menuitemcheckbox").
|
|
8
|
-
* Unlike CheckboxInput, there is no nested native <input
|
|
9
|
-
* the role and aria-checked, per the
|
|
10
|
-
* Keyboard navigation (arrows/typeahead) and
|
|
11
|
-
* the parent DropdownMenu's useListFocus +
|
|
12
|
-
* menuitemcheckbox alongside plain menuitem rows.
|
|
8
|
+
* Unlike CheckboxInput, there is no nested native <input> that participates in
|
|
9
|
+
* accessibility: the row itself owns the role and aria-checked, per the
|
|
10
|
+
* WAI-ARIA menuitemcheckbox pattern. Keyboard navigation (arrows/typeahead) and
|
|
11
|
+
* Enter/Space activation come from the parent DropdownMenu's useListFocus +
|
|
12
|
+
* activation path, which matches menuitemcheckbox alongside plain menuitem rows.
|
|
13
13
|
*
|
|
14
|
-
* The
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
14
|
+
* The checkbox visual composes the real CheckboxInput primitive so its checkmark
|
|
15
|
+
* matches CheckboxListItem and picks up the standard `checkbox` theming slots.
|
|
16
|
+
* It is purely decorative: the composed control is wrapped in an element that is
|
|
17
|
+
* both `aria-hidden` and `inert`, so it contributes nothing to the row's
|
|
18
|
+
* accessible name, and its native <input> and sr-only label stay out of the tab
|
|
19
|
+
* order and the accessibility tree while pointer clicks fall through to the row
|
|
20
|
+
* — the same shim MultiSelector uses. The row owns the checked state and
|
|
21
|
+
* accessible name. The control size is derived from the menu's item size (a
|
|
22
|
+
* `sm` menu gets the compact control; `md`/`lg` get the standard one) and it
|
|
23
|
+
* swaps to the inline-end of the row on coarse-pointer (touch) devices via CSS
|
|
24
|
+
* `order`, so it lands where selection toggles are conventionally placed on
|
|
25
|
+
* mobile.
|
|
20
26
|
*/
|
|
21
27
|
import { type ReactNode } from 'react';
|
|
22
28
|
import { type IconType } from '../Icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAOtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsC5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,6BAA6B,+BA6D/B;yBA1Ee,wBAAwB"}
|
|
@@ -4,32 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DropdownMenuCheckboxItem.tsx
|
|
7
|
-
* @input React, stylex, Item +
|
|
7
|
+
* @input React, stylex, Item + CheckboxInput + DropdownMenu context + tokens from core
|
|
8
8
|
* @output DropdownMenuCheckboxItem — a standalone checkable menu item.
|
|
9
9
|
* @position Sub-component; used inside DropdownMenu.
|
|
10
10
|
*
|
|
11
11
|
* A menu item that toggles an independent boolean (role="menuitemcheckbox").
|
|
12
|
-
* Unlike CheckboxInput, there is no nested native <input
|
|
13
|
-
* the role and aria-checked, per the
|
|
14
|
-
* Keyboard navigation (arrows/typeahead) and
|
|
15
|
-
* the parent DropdownMenu's useListFocus +
|
|
16
|
-
* menuitemcheckbox alongside plain menuitem rows.
|
|
12
|
+
* Unlike CheckboxInput, there is no nested native <input> that participates in
|
|
13
|
+
* accessibility: the row itself owns the role and aria-checked, per the
|
|
14
|
+
* WAI-ARIA menuitemcheckbox pattern. Keyboard navigation (arrows/typeahead) and
|
|
15
|
+
* Enter/Space activation come from the parent DropdownMenu's useListFocus +
|
|
16
|
+
* activation path, which matches menuitemcheckbox alongside plain menuitem rows.
|
|
17
17
|
*
|
|
18
|
-
* The
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* The checkbox visual composes the real CheckboxInput primitive so its checkmark
|
|
19
|
+
* matches CheckboxListItem and picks up the standard `checkbox` theming slots.
|
|
20
|
+
* It is purely decorative: the composed control is wrapped in an element that is
|
|
21
|
+
* both `aria-hidden` and `inert`, so it contributes nothing to the row's
|
|
22
|
+
* accessible name, and its native <input> and sr-only label stay out of the tab
|
|
23
|
+
* order and the accessibility tree while pointer clicks fall through to the row
|
|
24
|
+
* — the same shim MultiSelector uses. The row owns the checked state and
|
|
25
|
+
* accessible name. The control size is derived from the menu's item size (a
|
|
26
|
+
* `sm` menu gets the compact control; `md`/`lg` get the standard one) and it
|
|
27
|
+
* swaps to the inline-end of the row on coarse-pointer (touch) devices via CSS
|
|
28
|
+
* `order`, so it lands where selection toggles are conventionally placed on
|
|
29
|
+
* mobile.
|
|
24
30
|
*/
|
|
25
31
|
import { useCallback } from 'react';
|
|
26
32
|
import * as stylex from '@stylexjs/stylex';
|
|
27
|
-
import {
|
|
33
|
+
import { renderIconSlot } from "../Icon/index.js";
|
|
34
|
+
import { CheckboxInput } from "../CheckboxInput/CheckboxInput.js";
|
|
28
35
|
import { Item } from "../Item/index.js";
|
|
29
36
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
30
37
|
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
31
38
|
import "../theme/tokens.stylex.js";
|
|
32
|
-
import { colorVars, spacingVars
|
|
39
|
+
import { colorVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
33
40
|
import { mergeProps, themeProps } from "../utils/index.js";
|
|
34
41
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
42
|
const styles = {
|
|
@@ -46,45 +53,6 @@ const styles = {
|
|
|
46
53
|
kSiTet: "xbyyjgo",
|
|
47
54
|
kkrTdU: "x1h6gzvc",
|
|
48
55
|
$$css: true
|
|
49
|
-
},
|
|
50
|
-
box: {
|
|
51
|
-
k1xSpc: "x78zum5",
|
|
52
|
-
kGNEyG: "x6s0dn4",
|
|
53
|
-
kjj79g: "xl56j7k",
|
|
54
|
-
kmuXW: "x2lah0s",
|
|
55
|
-
kB7OPa: "x9f619",
|
|
56
|
-
kMzoRj: "x1litavf",
|
|
57
|
-
ksu8eU: "x1y0btm7",
|
|
58
|
-
kaIpWk: "xx3sua9",
|
|
59
|
-
kMwMTN: "x17wrial",
|
|
60
|
-
k1ekBW: "xts7igz",
|
|
61
|
-
kIyJzY: "xuedmi6 x12w9bfk",
|
|
62
|
-
kAMwcw: "xlr8y92",
|
|
63
|
-
kayTVb: "x1g77sc7 xozvky",
|
|
64
|
-
keTefX: "x1lziwak x1jymrmb",
|
|
65
|
-
$$css: true
|
|
66
|
-
},
|
|
67
|
-
unchecked: {
|
|
68
|
-
kVAM5u: "xvy26l8",
|
|
69
|
-
kWkggS: "x10xzikg",
|
|
70
|
-
$$css: true
|
|
71
|
-
},
|
|
72
|
-
checked: {
|
|
73
|
-
kVAM5u: "xad5do",
|
|
74
|
-
kWkggS: "x1ewilqj",
|
|
75
|
-
$$css: true
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const boxSizeStyles = {
|
|
79
|
-
sm: {
|
|
80
|
-
kzqmXN: "x1xp8n7a",
|
|
81
|
-
kZKoxP: "xmix8c7",
|
|
82
|
-
$$css: true
|
|
83
|
-
},
|
|
84
|
-
md: {
|
|
85
|
-
kzqmXN: "x17z2i9w",
|
|
86
|
-
kZKoxP: "x17rw0jw",
|
|
87
|
-
$$css: true
|
|
88
56
|
}
|
|
89
57
|
};
|
|
90
58
|
/**
|
|
@@ -122,6 +90,12 @@ export function DropdownMenuCheckboxItem({
|
|
|
122
90
|
const ctx = useDropdownMenuContext();
|
|
123
91
|
const menuSize = ctx?.menuSize ?? 'md';
|
|
124
92
|
const controlSize = menuSize === 'sm' ? 'sm' : 'md';
|
|
93
|
+
|
|
94
|
+
// The composed checkbox is decorative and inert, so its label never reaches
|
|
95
|
+
// the accessibility tree — the row's `label` prop provides the announced
|
|
96
|
+
// name. CheckboxInput still requires a string label, so pass one through when
|
|
97
|
+
// the row label is a plain string.
|
|
98
|
+
const checkboxLabel = typeof label === 'string' ? label : '';
|
|
125
99
|
const handleClick = useCallback(() => {
|
|
126
100
|
if (isDisabled) {
|
|
127
101
|
return;
|
|
@@ -138,17 +112,18 @@ export function DropdownMenuCheckboxItem({
|
|
|
138
112
|
"aria-checked": value,
|
|
139
113
|
tabIndex: isDisabled ? undefined : -1,
|
|
140
114
|
onPointerMove: handlePointerMove,
|
|
141
|
-
marker: /*#__PURE__*/_jsx("
|
|
115
|
+
marker: /*#__PURE__*/_jsx("div", {
|
|
142
116
|
"aria-hidden": "true",
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
117
|
+
inert: true,
|
|
118
|
+
...{
|
|
119
|
+
className: "x78zum5 x2lah0s x47corl x1g77sc7 xozvky x1lziwak x1jymrmb"
|
|
120
|
+
},
|
|
121
|
+
children: /*#__PURE__*/_jsx(CheckboxInput, {
|
|
122
|
+
label: checkboxLabel,
|
|
123
|
+
isLabelHidden: true,
|
|
124
|
+
value: value,
|
|
125
|
+
isDisabled: isDisabled,
|
|
126
|
+
size: controlSize
|
|
152
127
|
})
|
|
153
128
|
}),
|
|
154
129
|
startContent: icon ? renderIconSlot(icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAYtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqE5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+
|
|
1
|
+
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAYtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqE5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAgF5B;yBA3Fe,qBAAqB"}
|
|
@@ -157,7 +157,11 @@ export function DropdownMenuRadioItem({
|
|
|
157
157
|
disabled: isDisabled ? 'disabled' : null
|
|
158
158
|
}), stylex.props(styles.circle, circleSizeStyles[controlSize], isChecked ? styles.checked : styles.unchecked)),
|
|
159
159
|
children: isChecked && /*#__PURE__*/_jsx("span", {
|
|
160
|
-
...
|
|
160
|
+
...mergeProps(themeProps('dropdown-menu-radio-dot', {
|
|
161
|
+
size: controlSize,
|
|
162
|
+
checked: 'checked',
|
|
163
|
+
disabled: isDisabled ? 'disabled' : null
|
|
164
|
+
}), stylex.props(styles.dot, dotSizeStyles[controlSize]))
|
|
161
165
|
})
|
|
162
166
|
}),
|
|
163
167
|
startContent: icon ? renderIconSlot(icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAc,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAoB5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0F5C,UAAU,4BAA6B,SAAQ,IAAI,CACjD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,
|
|
1
|
+
{"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAc,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAoB5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0F5C,UAAU,4BAA6B,SAAQ,IAAI,CACjD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,CAmVX;yBArVe,mBAAmB"}
|
|
@@ -355,16 +355,16 @@ export function DropdownMenuSubMenu(props) {
|
|
|
355
355
|
}
|
|
356
356
|
}), [menuSize, close, menuCtx]);
|
|
357
357
|
const endAffordance = hasSpinner ? /*#__PURE__*/_jsx("span", {
|
|
358
|
-
...{
|
|
358
|
+
...mergeProps(themeProps('dropdown-menu-indicator-icon'), {
|
|
359
359
|
className: "x78zum5 x6s0dn4"
|
|
360
|
-
},
|
|
360
|
+
}),
|
|
361
361
|
children: /*#__PURE__*/_jsx(Spinner, {
|
|
362
362
|
size: "sm"
|
|
363
363
|
})
|
|
364
364
|
}) : /*#__PURE__*/_jsx("span", {
|
|
365
|
-
...{
|
|
365
|
+
...mergeProps(themeProps('dropdown-menu-indicator-icon'), {
|
|
366
366
|
className: "x78zum5 x6s0dn4"
|
|
367
|
-
},
|
|
367
|
+
}),
|
|
368
368
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
369
369
|
icon: "chevronRight",
|
|
370
370
|
size: "sm",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderDropdownItems.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/renderDropdownItems.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"renderDropdownItems.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/renderDropdownItems.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAYrC,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AAyBxB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAwE1E"}
|
|
@@ -12,6 +12,7 @@ import { DropdownMenuItem } from "./DropdownMenuItem.js";
|
|
|
12
12
|
import { DropdownMenuSubMenu } from "./DropdownMenuSubMenu.js";
|
|
13
13
|
import "../theme/tokens.stylex.js";
|
|
14
14
|
import { spacingVars, typographyVars, typeScaleVars, colorVars } from "../theme/tokens.stylex.js";
|
|
15
|
+
import { mergeProps, themeProps } from "../utils/index.js";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
const styles = {
|
|
17
18
|
divider: {
|
|
@@ -36,17 +37,18 @@ export function renderDropdownItems(items) {
|
|
|
36
37
|
const option = items[i];
|
|
37
38
|
if ('type' in option && option.type === 'divider') {
|
|
38
39
|
elements.push(/*#__PURE__*/_jsx(Divider, {
|
|
39
|
-
xstyle: styles.divider
|
|
40
|
+
xstyle: styles.divider,
|
|
41
|
+
...themeProps('dropdown-menu-divider')
|
|
40
42
|
}, `divider-${i}`));
|
|
41
43
|
} else if ('type' in option && option.type === 'section') {
|
|
42
44
|
elements.push(/*#__PURE__*/_jsxs("div", {
|
|
43
45
|
role: "group",
|
|
44
46
|
"aria-label": option.title,
|
|
45
47
|
children: [option.title && /*#__PURE__*/_jsx("div", {
|
|
46
|
-
...{
|
|
47
|
-
className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
|
|
48
|
-
},
|
|
49
48
|
"aria-hidden": "true",
|
|
49
|
+
...mergeProps(themeProps('dropdown-menu-section-heading'), {
|
|
50
|
+
className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
|
|
51
|
+
}),
|
|
50
52
|
children: option.title
|
|
51
53
|
}), option.items.map(item => /*#__PURE__*/_jsx(DropdownMenuItem, {
|
|
52
54
|
icon: item.icon,
|