@yahoo/uds 3.131.0 → 3.132.0
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/components/Banner/Banner.cjs +5 -2
- package/dist/components/Banner/Banner.d.cts +9 -0
- package/dist/components/Banner/Banner.d.ts +9 -0
- package/dist/components/Banner/Banner.js +5 -2
- package/dist/components/Divider/Divider.d.cts +2 -2
- package/dist/components/Divider/Divider.d.ts +2 -2
- package/dist/components/Divider/DividerCore.cjs +17 -10
- package/dist/components/Divider/DividerCore.d.cts +10 -4
- package/dist/components/Divider/DividerCore.d.ts +10 -4
- package/dist/components/Divider/DividerCore.js +17 -10
- package/dist/components/Divider/DividerInternal.cjs +15 -11
- package/dist/components/Divider/DividerInternal.js +15 -11
- package/dist/components/Link.cjs +13 -6
- package/dist/components/Link.d.cts +10 -0
- package/dist/components/Link.d.ts +10 -0
- package/dist/components/Link.js +13 -6
- package/dist/components/client/Badge.cjs +10 -4
- package/dist/components/client/Badge.d.cts +12 -1
- package/dist/components/client/Badge.d.ts +12 -1
- package/dist/components/client/Badge.js +10 -4
- package/dist/components/client/Button.cjs +20 -9
- package/dist/components/client/Button.d.cts +12 -1
- package/dist/components/client/Button.d.ts +12 -1
- package/dist/components/client/Button.js +20 -9
- package/dist/components/client/Checkbox.cjs +14 -6
- package/dist/components/client/Checkbox.d.cts +9 -4
- package/dist/components/client/Checkbox.d.ts +9 -4
- package/dist/components/client/Checkbox.js +14 -6
- package/dist/components/client/Chip/Chip.d.cts +1 -1
- package/dist/components/client/Chip/Chip.d.ts +1 -1
- package/dist/components/client/IconButton.cjs +4 -2
- package/dist/components/client/IconButton.d.cts +10 -2
- package/dist/components/client/IconButton.d.ts +10 -2
- package/dist/components/client/IconButton.js +4 -2
- package/dist/components/client/Input/Input.cjs +8 -2
- package/dist/components/client/Input/Input.d.cts +3 -0
- package/dist/components/client/Input/Input.d.ts +3 -0
- package/dist/components/client/Input/Input.js +8 -2
- package/dist/components/client/Input/InputHelpTextInternal.cjs +16 -6
- package/dist/components/client/Input/InputHelpTextInternal.d.cts +10 -0
- package/dist/components/client/Input/InputHelpTextInternal.d.ts +10 -0
- package/dist/components/client/Input/InputHelpTextInternal.js +16 -6
- package/dist/components/client/Menu/Menu.Content.cjs +2 -1
- package/dist/components/client/Menu/Menu.Content.d.cts +7 -0
- package/dist/components/client/Menu/Menu.Content.d.ts +7 -0
- package/dist/components/client/Menu/Menu.Content.js +2 -1
- package/dist/components/client/Menu/Menu.Divider.cjs +8 -10
- package/dist/components/client/Menu/Menu.Divider.js +8 -10
- package/dist/components/client/Menu/Menu.Item.cjs +23 -14
- package/dist/components/client/Menu/Menu.Item.d.cts +11 -0
- package/dist/components/client/Menu/Menu.Item.d.ts +11 -0
- package/dist/components/client/Menu/Menu.Item.js +24 -15
- package/dist/components/client/Menu/Menu.ItemBase.cjs +17 -9
- package/dist/components/client/Menu/Menu.ItemBase.d.cts +9 -5
- package/dist/components/client/Menu/Menu.ItemBase.d.ts +9 -5
- package/dist/components/client/Menu/Menu.ItemBase.js +17 -9
- package/dist/components/client/Menu/Menu.ItemCheckbox.cjs +10 -10
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.js +10 -10
- package/dist/components/client/Popover/PopoverContent.cjs +4 -1
- package/dist/components/client/Popover/PopoverContent.d.cts +3 -0
- package/dist/components/client/Popover/PopoverContent.d.ts +3 -0
- package/dist/components/client/Popover/PopoverContent.js +4 -1
- package/dist/components/client/Radio/Radio.cjs +18 -15
- package/dist/components/client/Radio/Radio.d.cts +9 -4
- package/dist/components/client/Radio/Radio.d.ts +9 -4
- package/dist/components/client/Radio/Radio.js +18 -15
- package/dist/components/client/Switch.cjs +14 -6
- package/dist/components/client/Switch.d.cts +9 -5
- package/dist/components/client/Switch.d.ts +9 -5
- package/dist/components/client/Switch.js +14 -6
- package/dist/components/client/Tabs/Tab.cjs +11 -5
- package/dist/components/client/Tabs/Tab.d.cts +14 -3
- package/dist/components/client/Tabs/Tab.d.ts +14 -3
- package/dist/components/client/Tabs/Tab.js +11 -5
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +1 -1
- package/dist/components/client/Tooltip/TooltipContent.cjs +9 -3
- package/dist/components/client/Tooltip/TooltipContent.d.cts +14 -2
- package/dist/components/client/Tooltip/TooltipContent.d.ts +14 -2
- package/dist/components/client/Tooltip/TooltipContent.js +9 -3
- package/dist/components/experimental/client/SwitchV2.cjs +14 -6
- package/dist/components/experimental/client/SwitchV2.d.cts +9 -5
- package/dist/components/experimental/client/SwitchV2.d.ts +9 -5
- package/dist/components/experimental/client/SwitchV2.js +14 -6
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles/styler.d.cts +67 -67
- package/dist/styles/styler.d.ts +67 -67
- package/dist/types/dist/index.d.cts +3 -3
- package/dist/types/dist/index.d.ts +3 -3
- package/dist/uds/generated/componentData.cjs +1443 -1440
- package/dist/uds/generated/componentData.js +1443 -1440
- package/dist/uds/generated/tailwindPurge.cjs +73 -73
- package/dist/uds/generated/tailwindPurge.js +73 -73
- package/generated/componentData.json +2046 -2037
- package/generated/tailwindPurge.ts +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { isFunction } from "lodash-es";
|
|
|
13
13
|
import { useReducedMotion } from "motion/react";
|
|
14
14
|
|
|
15
15
|
//#region src/components/client/Input/Input.tsx
|
|
16
|
-
const HelpTextContent = memo(function HelpTextContentOriginal({ helpText, helperTextIcon, spacingStart, spacingTop, size, isFilled, ...rest }) {
|
|
16
|
+
const HelpTextContent = memo(function HelpTextContentOriginal({ helpText, helperTextIcon, spacingStart, spacingTop, size, isFilled, helperTextSlotProps, ...rest }) {
|
|
17
17
|
if (!helpText) return null;
|
|
18
18
|
return /* @__PURE__ */ jsx(Box, {
|
|
19
19
|
spacingTop,
|
|
@@ -23,6 +23,10 @@ const HelpTextContent = memo(function HelpTextContentOriginal({ helpText, helper
|
|
|
23
23
|
startIcon: helperTextIcon,
|
|
24
24
|
size,
|
|
25
25
|
isFilled,
|
|
26
|
+
slotProps: {
|
|
27
|
+
startIcon: helperTextSlotProps?.helperTextIcon,
|
|
28
|
+
text: helperTextSlotProps?.helperText
|
|
29
|
+
},
|
|
26
30
|
children: isFunction(helpText) ? helpText() : helpText
|
|
27
31
|
})
|
|
28
32
|
});
|
|
@@ -144,6 +148,7 @@ const Input = forwardRef(function Input({ id, label, type = "text", size = "md",
|
|
|
144
148
|
className: classNames.label,
|
|
145
149
|
children: [/* @__PURE__ */ jsx("label", {
|
|
146
150
|
htmlFor: uid,
|
|
151
|
+
...slotProps?.label,
|
|
147
152
|
children: isFunction(label) ? label() : label
|
|
148
153
|
}), required && /* @__PURE__ */ jsx("span", {
|
|
149
154
|
className: classNames.labelRequired,
|
|
@@ -196,7 +201,8 @@ const Input = forwardRef(function Input({ id, label, type = "text", size = "md",
|
|
|
196
201
|
spacingTop: "2",
|
|
197
202
|
size,
|
|
198
203
|
isFilled: !!value,
|
|
199
|
-
helperTextIcon
|
|
204
|
+
helperTextIcon,
|
|
205
|
+
helperTextSlotProps: slotProps
|
|
200
206
|
})
|
|
201
207
|
})
|
|
202
208
|
]
|
|
@@ -9,7 +9,7 @@ let react = require("react");
|
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
|
|
11
11
|
//#region src/components/client/Input/InputHelpTextInternal.tsx
|
|
12
|
-
const InputHelpTextInternal = (0, react.forwardRef)(function InputHelpTextInternal({ startIcon, endIcon, iconProps, children, size, isFilled, ...rest }, ref) {
|
|
12
|
+
const InputHelpTextInternal = (0, react.forwardRef)(function InputHelpTextInternal({ startIcon, endIcon, iconProps, children, size, isFilled, slotProps, ...rest }, ref) {
|
|
13
13
|
const defaultIconProps = { variant: "outline" };
|
|
14
14
|
const classNames = {
|
|
15
15
|
helperText: require_styles_styler.cx(require_styles_styler.getStyles({
|
|
@@ -23,6 +23,9 @@ const InputHelpTextInternal = (0, react.forwardRef)(function InputHelpTextIntern
|
|
|
23
23
|
inputVariantValueHelperIcon: !isFilled ? "empty" : "filled"
|
|
24
24
|
})
|
|
25
25
|
};
|
|
26
|
+
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
27
|
+
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
28
|
+
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
26
29
|
const props = {
|
|
27
30
|
...defaultIconProps,
|
|
28
31
|
...iconProps
|
|
@@ -36,18 +39,25 @@ const InputHelpTextInternal = (0, react.forwardRef)(function InputHelpTextIntern
|
|
|
36
39
|
startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
37
40
|
icon: startIcon,
|
|
38
41
|
...props,
|
|
39
|
-
iconProps
|
|
40
|
-
|
|
42
|
+
iconProps: {
|
|
43
|
+
...iconProps,
|
|
44
|
+
...startIconSlotProps
|
|
45
|
+
},
|
|
46
|
+
className: require_styles_styler.cx(classNames.helperIcon, startIconClassName)
|
|
41
47
|
}),
|
|
42
48
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
43
|
-
className: classNames.helperText,
|
|
49
|
+
className: require_styles_styler.cx(classNames.helperText, textClassName),
|
|
50
|
+
...textSlotProps,
|
|
44
51
|
children
|
|
45
52
|
}),
|
|
46
53
|
endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
47
54
|
icon: endIcon,
|
|
48
55
|
...props,
|
|
49
|
-
iconProps
|
|
50
|
-
|
|
56
|
+
iconProps: {
|
|
57
|
+
...iconProps,
|
|
58
|
+
...endIconSlotProps
|
|
59
|
+
},
|
|
60
|
+
className: require_styles_styler.cx(classNames.helperIcon, endIconClassName)
|
|
51
61
|
})
|
|
52
62
|
]
|
|
53
63
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { UniversalIconSlot } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
|
|
3
4
|
import "../../../tokens/index.cjs";
|
|
4
5
|
import { IconProps } from "../../Icon.cjs";
|
|
5
6
|
import { InputProps } from "./Input.cjs";
|
|
@@ -7,6 +8,9 @@ import * as react from "react";
|
|
|
7
8
|
import { PropsWithChildren } from "react";
|
|
8
9
|
|
|
9
10
|
//#region src/components/client/Input/InputHelpTextInternal.d.ts
|
|
11
|
+
type DataAttributes = {
|
|
12
|
+
[name: `data-${string}`]: string;
|
|
13
|
+
};
|
|
10
14
|
interface InputHelpTextInternalProps extends PropsWithChildren {
|
|
11
15
|
/** Icon to render at the start of the content */
|
|
12
16
|
startIcon?: UniversalIconSlot;
|
|
@@ -19,6 +23,12 @@ interface InputHelpTextInternalProps extends PropsWithChildren {
|
|
|
19
23
|
iconProps?: Pick<IconProps, 'color' | 'size' | 'variant'>;
|
|
20
24
|
size?: InputProps['size'];
|
|
21
25
|
isFilled?: boolean;
|
|
26
|
+
/** Props to be passed into various slots within the component. */
|
|
27
|
+
slotProps?: {
|
|
28
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
29
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
30
|
+
text?: Partial<React.HTMLAttributes<HTMLSpanElement> & DataAttributes>;
|
|
31
|
+
};
|
|
22
32
|
}
|
|
23
33
|
declare const InputHelpTextInternalMemo: react.NamedExoticComponent<InputHelpTextInternalProps & react.RefAttributes<HTMLDivElement>>;
|
|
24
34
|
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { UniversalIconSlot } from "../../../types/dist/index.js";
|
|
4
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
4
5
|
import "../../../tokens/index.js";
|
|
5
6
|
import { IconProps } from "../../Icon.js";
|
|
6
7
|
import { InputProps } from "./Input.js";
|
|
@@ -8,6 +9,9 @@ import * as react from "react";
|
|
|
8
9
|
import { PropsWithChildren } from "react";
|
|
9
10
|
|
|
10
11
|
//#region src/components/client/Input/InputHelpTextInternal.d.ts
|
|
12
|
+
type DataAttributes = {
|
|
13
|
+
[name: `data-${string}`]: string;
|
|
14
|
+
};
|
|
11
15
|
interface InputHelpTextInternalProps extends PropsWithChildren {
|
|
12
16
|
/** Icon to render at the start of the content */
|
|
13
17
|
startIcon?: UniversalIconSlot;
|
|
@@ -20,6 +24,12 @@ interface InputHelpTextInternalProps extends PropsWithChildren {
|
|
|
20
24
|
iconProps?: Pick<IconProps, 'color' | 'size' | 'variant'>;
|
|
21
25
|
size?: InputProps['size'];
|
|
22
26
|
isFilled?: boolean;
|
|
27
|
+
/** Props to be passed into various slots within the component. */
|
|
28
|
+
slotProps?: {
|
|
29
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
30
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
31
|
+
text?: Partial<React.HTMLAttributes<HTMLSpanElement> & DataAttributes>;
|
|
32
|
+
};
|
|
23
33
|
}
|
|
24
34
|
declare const InputHelpTextInternalMemo: react.NamedExoticComponent<InputHelpTextInternalProps & react.RefAttributes<HTMLDivElement>>;
|
|
25
35
|
//#endregion
|
|
@@ -7,7 +7,7 @@ import { forwardRef, memo } from "react";
|
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/components/client/Input/InputHelpTextInternal.tsx
|
|
10
|
-
const InputHelpTextInternal = forwardRef(function InputHelpTextInternal({ startIcon, endIcon, iconProps, children, size, isFilled, ...rest }, ref) {
|
|
10
|
+
const InputHelpTextInternal = forwardRef(function InputHelpTextInternal({ startIcon, endIcon, iconProps, children, size, isFilled, slotProps, ...rest }, ref) {
|
|
11
11
|
const defaultIconProps = { variant: "outline" };
|
|
12
12
|
const classNames = {
|
|
13
13
|
helperText: cx(getStyles({
|
|
@@ -21,6 +21,9 @@ const InputHelpTextInternal = forwardRef(function InputHelpTextInternal({ startI
|
|
|
21
21
|
inputVariantValueHelperIcon: !isFilled ? "empty" : "filled"
|
|
22
22
|
})
|
|
23
23
|
};
|
|
24
|
+
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
25
|
+
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
26
|
+
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
24
27
|
const props = {
|
|
25
28
|
...defaultIconProps,
|
|
26
29
|
...iconProps
|
|
@@ -34,18 +37,25 @@ const InputHelpTextInternal = forwardRef(function InputHelpTextInternal({ startI
|
|
|
34
37
|
startIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
35
38
|
icon: startIcon,
|
|
36
39
|
...props,
|
|
37
|
-
iconProps
|
|
38
|
-
|
|
40
|
+
iconProps: {
|
|
41
|
+
...iconProps,
|
|
42
|
+
...startIconSlotProps
|
|
43
|
+
},
|
|
44
|
+
className: cx(classNames.helperIcon, startIconClassName)
|
|
39
45
|
}),
|
|
40
46
|
/* @__PURE__ */ jsx("span", {
|
|
41
|
-
className: classNames.helperText,
|
|
47
|
+
className: cx(classNames.helperText, textClassName),
|
|
48
|
+
...textSlotProps,
|
|
42
49
|
children
|
|
43
50
|
}),
|
|
44
51
|
endIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
45
52
|
icon: endIcon,
|
|
46
53
|
...props,
|
|
47
|
-
iconProps
|
|
48
|
-
|
|
54
|
+
iconProps: {
|
|
55
|
+
...iconProps,
|
|
56
|
+
...endIconSlotProps
|
|
57
|
+
},
|
|
58
|
+
className: cx(classNames.helperIcon, endIconClassName)
|
|
49
59
|
})
|
|
50
60
|
]
|
|
51
61
|
});
|
|
@@ -94,7 +94,7 @@ const useMenuAnimationVariants = (placement) => {
|
|
|
94
94
|
*
|
|
95
95
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
|
96
96
|
**/
|
|
97
|
-
const MenuContent = (0, react.forwardRef)(function MenuContent({ size = "default", variant = "default", gutter = "1", overflow, className, sameWidth, focusable, children, portalElement, portal = true, disableAutoBorderRadius, nestedBorderRadius = !disableAutoBorderRadius, nestedBorderRadiusSize, nestedBorderRadiusSpacing, nestedBorderRadiusWidth, ...props }, ref) {
|
|
97
|
+
const MenuContent = (0, react.forwardRef)(function MenuContent({ size = "default", variant = "default", gutter = "1", overflow, className, slotProps, sameWidth, focusable, children, portalElement, portal = true, disableAutoBorderRadius, nestedBorderRadius = !disableAutoBorderRadius, nestedBorderRadiusSize, nestedBorderRadiusSpacing, nestedBorderRadiusWidth, ...props }, ref) {
|
|
98
98
|
const context = (0, _ariakit_react_menu.useMenuContext)();
|
|
99
99
|
const open = (0, _ariakit_react.useStoreState)(context, "open");
|
|
100
100
|
const mounted = (0, _ariakit_react.useStoreState)(context, "mounted");
|
|
@@ -146,6 +146,7 @@ const MenuContent = (0, react.forwardRef)(function MenuContent({ size = "default
|
|
|
146
146
|
nestedBorderRadiusSpacing,
|
|
147
147
|
nestedBorderRadiusWidth,
|
|
148
148
|
className: classNames.root,
|
|
149
|
+
...slotProps?.root,
|
|
149
150
|
children
|
|
150
151
|
})
|
|
151
152
|
})
|
|
@@ -6,6 +6,9 @@ import * as react from "react";
|
|
|
6
6
|
import { MenuProps } from "@ariakit/react/menu";
|
|
7
7
|
|
|
8
8
|
//#region src/components/client/Menu/Menu.Content.d.ts
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[name: `data-${string}`]: string;
|
|
11
|
+
};
|
|
9
12
|
interface MenuContentProps extends Omit<VStackProps, 'asChild'> {
|
|
10
13
|
/**
|
|
11
14
|
* Controls spacing-related properties (border radius, border width, shadow, spacing, gap)
|
|
@@ -18,6 +21,10 @@ interface MenuContentProps extends Omit<VStackProps, 'asChild'> {
|
|
|
18
21
|
*/
|
|
19
22
|
variant?: 'default';
|
|
20
23
|
gutter?: SpacingAlias;
|
|
24
|
+
/** Props to be passed into various slots within the component. */
|
|
25
|
+
slotProps?: {
|
|
26
|
+
root?: DataAttributes;
|
|
27
|
+
};
|
|
21
28
|
/** UDS handles nested border radius for the first and last item for you to prevent clipping and visual jank.
|
|
22
29
|
* If you need to disable this, set this prop to true.
|
|
23
30
|
*
|
|
@@ -7,6 +7,9 @@ import * as react from "react";
|
|
|
7
7
|
import { MenuProps } from "@ariakit/react/menu";
|
|
8
8
|
|
|
9
9
|
//#region src/components/client/Menu/Menu.Content.d.ts
|
|
10
|
+
type DataAttributes = {
|
|
11
|
+
[name: `data-${string}`]: string;
|
|
12
|
+
};
|
|
10
13
|
interface MenuContentProps extends Omit<VStackProps, 'asChild'> {
|
|
11
14
|
/**
|
|
12
15
|
* Controls spacing-related properties (border radius, border width, shadow, spacing, gap)
|
|
@@ -19,6 +22,10 @@ interface MenuContentProps extends Omit<VStackProps, 'asChild'> {
|
|
|
19
22
|
*/
|
|
20
23
|
variant?: 'default';
|
|
21
24
|
gutter?: SpacingAlias;
|
|
25
|
+
/** Props to be passed into various slots within the component. */
|
|
26
|
+
slotProps?: {
|
|
27
|
+
root?: DataAttributes;
|
|
28
|
+
};
|
|
22
29
|
/** UDS handles nested border radius for the first and last item for you to prevent clipping and visual jank.
|
|
23
30
|
* If you need to disable this, set this prop to true.
|
|
24
31
|
*
|
|
@@ -92,7 +92,7 @@ const useMenuAnimationVariants = (placement) => {
|
|
|
92
92
|
*
|
|
93
93
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
|
94
94
|
**/
|
|
95
|
-
const MenuContent = forwardRef(function MenuContent({ size = "default", variant = "default", gutter = "1", overflow, className, sameWidth, focusable, children, portalElement, portal = true, disableAutoBorderRadius, nestedBorderRadius = !disableAutoBorderRadius, nestedBorderRadiusSize, nestedBorderRadiusSpacing, nestedBorderRadiusWidth, ...props }, ref) {
|
|
95
|
+
const MenuContent = forwardRef(function MenuContent({ size = "default", variant = "default", gutter = "1", overflow, className, slotProps, sameWidth, focusable, children, portalElement, portal = true, disableAutoBorderRadius, nestedBorderRadius = !disableAutoBorderRadius, nestedBorderRadiusSize, nestedBorderRadiusSpacing, nestedBorderRadiusWidth, ...props }, ref) {
|
|
96
96
|
const context = useMenuContext();
|
|
97
97
|
const open = useStoreState(context, "open");
|
|
98
98
|
const mounted = useStoreState(context, "mounted");
|
|
@@ -144,6 +144,7 @@ const MenuContent = forwardRef(function MenuContent({ size = "default", variant
|
|
|
144
144
|
nestedBorderRadiusSpacing,
|
|
145
145
|
nestedBorderRadiusWidth,
|
|
146
146
|
className: classNames.root,
|
|
147
|
+
...slotProps?.root,
|
|
147
148
|
children
|
|
148
149
|
})
|
|
149
150
|
})
|
|
@@ -47,14 +47,6 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
47
47
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item), [Divider](https://uds.build/docs/components/divider)
|
|
48
48
|
**/
|
|
49
49
|
const MenuDivider = (0, react.forwardRef)(function MenuDivider({ role = "separator", contentPosition = "start", gap = "4", children, spacingVertical = children ? "2" : "0", spacingHorizontal = children ? "4" : "0", className, ...props }, ref) {
|
|
50
|
-
const layerClassNames = {
|
|
51
|
-
root: require_styles_styler.getStyles({
|
|
52
|
-
menuitemDividerVariantRoot: "default",
|
|
53
|
-
className
|
|
54
|
-
}),
|
|
55
|
-
text: require_styles_styler.getStyles({ menuitemDividerVariantText: "default" }),
|
|
56
|
-
line: require_styles_styler.getStyles({ menuitemDividerVariantLine: "default" })
|
|
57
|
-
};
|
|
58
50
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerInternal.DividerInternal, {
|
|
59
51
|
ref,
|
|
60
52
|
role,
|
|
@@ -63,8 +55,14 @@ const MenuDivider = (0, react.forwardRef)(function MenuDivider({ role = "separat
|
|
|
63
55
|
gap,
|
|
64
56
|
spacingVertical,
|
|
65
57
|
spacingHorizontal,
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
slotProps: {
|
|
59
|
+
root: { className: require_styles_styler.getStyles({
|
|
60
|
+
menuitemDividerVariantRoot: "default",
|
|
61
|
+
className
|
|
62
|
+
}) },
|
|
63
|
+
label: { className: require_styles_styler.getStyles({ menuitemDividerVariantText: "default" }) },
|
|
64
|
+
line: { className: require_styles_styler.getStyles({ menuitemDividerVariantLine: "default" }) }
|
|
65
|
+
},
|
|
68
66
|
...props,
|
|
69
67
|
children
|
|
70
68
|
});
|
|
@@ -45,14 +45,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
45
45
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item), [Divider](https://uds.build/docs/components/divider)
|
|
46
46
|
**/
|
|
47
47
|
const MenuDivider = forwardRef(function MenuDivider({ role = "separator", contentPosition = "start", gap = "4", children, spacingVertical = children ? "2" : "0", spacingHorizontal = children ? "4" : "0", className, ...props }, ref) {
|
|
48
|
-
const layerClassNames = {
|
|
49
|
-
root: getStyles({
|
|
50
|
-
menuitemDividerVariantRoot: "default",
|
|
51
|
-
className
|
|
52
|
-
}),
|
|
53
|
-
text: getStyles({ menuitemDividerVariantText: "default" }),
|
|
54
|
-
line: getStyles({ menuitemDividerVariantLine: "default" })
|
|
55
|
-
};
|
|
56
48
|
return /* @__PURE__ */ jsx(DividerInternal, {
|
|
57
49
|
ref,
|
|
58
50
|
role,
|
|
@@ -61,8 +53,14 @@ const MenuDivider = forwardRef(function MenuDivider({ role = "separator", conten
|
|
|
61
53
|
gap,
|
|
62
54
|
spacingVertical,
|
|
63
55
|
spacingHorizontal,
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
slotProps: {
|
|
57
|
+
root: { className: getStyles({
|
|
58
|
+
menuitemDividerVariantRoot: "default",
|
|
59
|
+
className
|
|
60
|
+
}) },
|
|
61
|
+
label: { className: getStyles({ menuitemDividerVariantText: "default" }) },
|
|
62
|
+
line: { className: getStyles({ menuitemDividerVariantLine: "default" }) }
|
|
63
|
+
},
|
|
66
64
|
...props,
|
|
67
65
|
children
|
|
68
66
|
});
|
|
@@ -52,24 +52,33 @@ let _ariakit_react_menu = require("@ariakit/react/menu");
|
|
|
52
52
|
*
|
|
53
53
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
|
54
54
|
**/
|
|
55
|
-
const MenuItem = (0, react.forwardRef)(function MenuItem({ active, hideOnClick, ...props }, ref) {
|
|
55
|
+
const MenuItem = (0, react.forwardRef)(function MenuItem({ active, hideOnClick, slotProps, ...props }, ref) {
|
|
56
56
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Menu_Menu_ItemBase.MenuItemBase, {
|
|
57
57
|
ref,
|
|
58
58
|
as: _ariakit_react_menu.MenuItem,
|
|
59
59
|
active,
|
|
60
|
-
|
|
61
|
-
root:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
slotProps: {
|
|
61
|
+
root: {
|
|
62
|
+
className: require_styles_styler.cx(require_styles_styler.getStyles({
|
|
63
|
+
menuitemItemVariantRoot: "default",
|
|
64
|
+
menuitemItemVariantActiveRoot: active ? "on" : "off"
|
|
65
|
+
}), slotProps?.root?.className),
|
|
66
|
+
...slotProps?.root
|
|
67
|
+
},
|
|
68
|
+
text: {
|
|
69
|
+
className: require_styles_styler.cx(require_styles_styler.getStyles({
|
|
70
|
+
menuitemItemVariantText: "default",
|
|
71
|
+
menuitemItemVariantActiveText: active ? "on" : "off"
|
|
72
|
+
}), slotProps?.text?.className),
|
|
73
|
+
...slotProps?.text
|
|
74
|
+
},
|
|
75
|
+
startIcon: {
|
|
76
|
+
className: require_styles_styler.cx(require_styles_styler.getStyles({
|
|
77
|
+
menuitemItemVariantIcon: "default",
|
|
78
|
+
menuitemItemVariantActiveIcon: active ? "on" : "off"
|
|
79
|
+
}), slotProps?.startIcon?.className),
|
|
80
|
+
...slotProps?.startIcon
|
|
81
|
+
}
|
|
73
82
|
},
|
|
74
83
|
rootProps: { hideOnClick },
|
|
75
84
|
...props
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { UniversalMenuItemProps } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
|
|
3
4
|
import "../../../tokens/index.cjs";
|
|
4
5
|
import { PressableProps } from "../Pressable.cjs";
|
|
5
6
|
import * as react from "react";
|
|
@@ -7,6 +8,9 @@ import { AriaRole } from "react";
|
|
|
7
8
|
import { MenuItemProps as MenuItemProps$1 } from "@ariakit/react/menu";
|
|
8
9
|
|
|
9
10
|
//#region src/components/client/Menu/Menu.Item.d.ts
|
|
11
|
+
type DataAttributes = {
|
|
12
|
+
[name: `data-${string}`]: string;
|
|
13
|
+
};
|
|
10
14
|
interface MenuItemProps extends Omit<PressableProps, 'asChild'>, Omit<UniversalMenuItemProps, 'name'> {
|
|
11
15
|
/**
|
|
12
16
|
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
|
@@ -30,6 +34,13 @@ interface MenuItemProps extends Omit<PressableProps, 'asChild'>, Omit<UniversalM
|
|
|
30
34
|
* @default 'menuitem'
|
|
31
35
|
*/
|
|
32
36
|
role?: AriaRole;
|
|
37
|
+
/** Props to be passed into various slots within the component. */
|
|
38
|
+
slotProps?: {
|
|
39
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
40
|
+
text?: Partial<Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> & DataAttributes>;
|
|
41
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
42
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
43
|
+
};
|
|
33
44
|
}
|
|
34
45
|
/**
|
|
35
46
|
* **📋 A Menu Item component for navigation and actions**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { UniversalMenuItemProps } from "../../../types/dist/index.js";
|
|
4
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
4
5
|
import "../../../tokens/index.js";
|
|
5
6
|
import { PressableProps } from "../Pressable.js";
|
|
6
7
|
import * as react from "react";
|
|
@@ -8,6 +9,9 @@ import { AriaRole } from "react";
|
|
|
8
9
|
import { MenuItemProps as MenuItemProps$1 } from "@ariakit/react/menu";
|
|
9
10
|
|
|
10
11
|
//#region src/components/client/Menu/Menu.Item.d.ts
|
|
12
|
+
type DataAttributes = {
|
|
13
|
+
[name: `data-${string}`]: string;
|
|
14
|
+
};
|
|
11
15
|
interface MenuItemProps extends Omit<PressableProps, 'asChild'>, Omit<UniversalMenuItemProps, 'name'> {
|
|
12
16
|
/**
|
|
13
17
|
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
|
@@ -31,6 +35,13 @@ interface MenuItemProps extends Omit<PressableProps, 'asChild'>, Omit<UniversalM
|
|
|
31
35
|
* @default 'menuitem'
|
|
32
36
|
*/
|
|
33
37
|
role?: AriaRole;
|
|
38
|
+
/** Props to be passed into various slots within the component. */
|
|
39
|
+
slotProps?: {
|
|
40
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
41
|
+
text?: Partial<Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> & DataAttributes>;
|
|
42
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
43
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
44
|
+
};
|
|
34
45
|
}
|
|
35
46
|
/**
|
|
36
47
|
* **📋 A Menu Item component for navigation and actions**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
-
import { getStyles } from "../../../styles/styler.js";
|
|
3
|
+
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
4
|
import { MenuItemBase } from "./Menu.ItemBase.js";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -50,24 +50,33 @@ import { MenuItem as MenuItem$1 } from "@ariakit/react/menu";
|
|
|
50
50
|
*
|
|
51
51
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
|
52
52
|
**/
|
|
53
|
-
const MenuItem = forwardRef(function MenuItem({ active, hideOnClick, ...props }, ref) {
|
|
53
|
+
const MenuItem = forwardRef(function MenuItem({ active, hideOnClick, slotProps, ...props }, ref) {
|
|
54
54
|
return /* @__PURE__ */ jsx(MenuItemBase, {
|
|
55
55
|
ref,
|
|
56
56
|
as: MenuItem$1,
|
|
57
57
|
active,
|
|
58
|
-
|
|
59
|
-
root:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
slotProps: {
|
|
59
|
+
root: {
|
|
60
|
+
className: cx(getStyles({
|
|
61
|
+
menuitemItemVariantRoot: "default",
|
|
62
|
+
menuitemItemVariantActiveRoot: active ? "on" : "off"
|
|
63
|
+
}), slotProps?.root?.className),
|
|
64
|
+
...slotProps?.root
|
|
65
|
+
},
|
|
66
|
+
text: {
|
|
67
|
+
className: cx(getStyles({
|
|
68
|
+
menuitemItemVariantText: "default",
|
|
69
|
+
menuitemItemVariantActiveText: active ? "on" : "off"
|
|
70
|
+
}), slotProps?.text?.className),
|
|
71
|
+
...slotProps?.text
|
|
72
|
+
},
|
|
73
|
+
startIcon: {
|
|
74
|
+
className: cx(getStyles({
|
|
75
|
+
menuitemItemVariantIcon: "default",
|
|
76
|
+
menuitemItemVariantActiveIcon: active ? "on" : "off"
|
|
77
|
+
}), slotProps?.startIcon?.className),
|
|
78
|
+
...slotProps?.startIcon
|
|
79
|
+
}
|
|
71
80
|
},
|
|
72
81
|
rootProps: { hideOnClick },
|
|
73
82
|
...props
|
|
@@ -30,18 +30,22 @@ const buildMenuItemClasses = ({ active, disabled, className }) => {
|
|
|
30
30
|
* @private This is an internal component shared by [Menu.Item](https://uds.build/docs/components/menu#menu-item) and [Menu.ItemCheckbox](https://uds.build/docs/components/menu#menu-item-checkbox)
|
|
31
31
|
* and may change without notice. Please do not use this component directly.
|
|
32
32
|
*/
|
|
33
|
-
const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0", spacingBottom, spacingEnd, spacingHorizontal = "4", spacingStart, spacingTop, spacingVertical = "3.5", columnGap = "2", className, children, endIcon, startIcon, hideEndIcon, active, disabled, as: RootComponent, name, alignItems = "center", justifyContent = "space-between",
|
|
33
|
+
const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0", spacingBottom, spacingEnd, spacingHorizontal = "4", spacingStart, spacingTop, spacingVertical = "3.5", columnGap = "2", className, children, endIcon, startIcon, hideEndIcon, active, disabled, as: RootComponent, name, alignItems = "center", justifyContent = "space-between", slotProps, slots, rootProps, ...props }, ref) {
|
|
34
34
|
const hasMultipleChildren = react.Children.count(children) > 1;
|
|
35
35
|
const menuItemClassName = buildMenuItemClasses({
|
|
36
36
|
active,
|
|
37
37
|
disabled,
|
|
38
38
|
className
|
|
39
39
|
});
|
|
40
|
+
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
41
|
+
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
42
|
+
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
43
|
+
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
40
44
|
/**
|
|
41
45
|
* Get content styles based on children layout needs
|
|
42
46
|
*/
|
|
43
47
|
const contentStyles = require_styles_styler.getStyles({
|
|
44
|
-
className: require_styles_styler.cx(`${ITEM_CLASS_NAME}-content truncate`,
|
|
48
|
+
className: require_styles_styler.cx(`${ITEM_CLASS_NAME}-content truncate`, textClassName),
|
|
45
49
|
textAlign: "start",
|
|
46
50
|
...hasMultipleChildren && {
|
|
47
51
|
columnGap,
|
|
@@ -68,23 +72,23 @@ const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0"
|
|
|
68
72
|
columnGap,
|
|
69
73
|
alignItems,
|
|
70
74
|
justifyContent,
|
|
71
|
-
className: require_styles_styler.cx(menuItemClassName,
|
|
75
|
+
className: require_styles_styler.cx(menuItemClassName, rootClassName)
|
|
72
76
|
}),
|
|
73
77
|
startIcon: require_styles_styler.getStyles({
|
|
74
78
|
menuitemSizeStartIcon: "default",
|
|
75
|
-
className:
|
|
79
|
+
className: startIconClassName
|
|
76
80
|
}),
|
|
77
81
|
endIcon: require_styles_styler.getStyles({
|
|
78
82
|
menuitemSizeEndIcon: "default",
|
|
79
|
-
className:
|
|
83
|
+
className: endIconClassName
|
|
80
84
|
})
|
|
81
85
|
}), [
|
|
82
86
|
alignItems,
|
|
83
87
|
columnGap,
|
|
84
88
|
justifyContent,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
endIconClassName,
|
|
90
|
+
rootClassName,
|
|
91
|
+
startIconClassName,
|
|
88
92
|
menuItemClassName,
|
|
89
93
|
spacing,
|
|
90
94
|
spacingBottom,
|
|
@@ -109,6 +113,7 @@ const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0"
|
|
|
109
113
|
render: rootRender,
|
|
110
114
|
disabled,
|
|
111
115
|
className: classNames.root,
|
|
116
|
+
...rootSlotProps,
|
|
112
117
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_HStack.HStack, {
|
|
113
118
|
gap: columnGap,
|
|
114
119
|
alignItems: "center",
|
|
@@ -127,12 +132,15 @@ const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0"
|
|
|
127
132
|
iconProps: {
|
|
128
133
|
size: "sm",
|
|
129
134
|
variant: active ? "fill" : "outline",
|
|
130
|
-
color: "current"
|
|
135
|
+
color: "current",
|
|
136
|
+
...endIconSlotProps,
|
|
137
|
+
...startIconSlotProps
|
|
131
138
|
}
|
|
132
139
|
})
|
|
133
140
|
})
|
|
134
141
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
135
142
|
className: contentStyles,
|
|
143
|
+
...textSlotProps,
|
|
136
144
|
children
|
|
137
145
|
})]
|
|
138
146
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { UniversalMenuItemProps } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
|
|
3
4
|
import "../../../tokens/index.cjs";
|
|
4
5
|
import { PressableProps } from "../Pressable.cjs";
|
|
5
6
|
import * as react from "react";
|
|
@@ -7,6 +8,9 @@ import { MenuItem, MenuItemCheckbox } from "@ariakit/react";
|
|
|
7
8
|
|
|
8
9
|
//#region src/components/client/Menu/Menu.ItemBase.d.ts
|
|
9
10
|
type MenuItemRootComponent = typeof MenuItem | typeof MenuItemCheckbox;
|
|
11
|
+
type DataAttributes = {
|
|
12
|
+
[name: `data-${string}`]: string;
|
|
13
|
+
};
|
|
10
14
|
interface MenuItemBaseProps extends Omit<PressableProps, 'asChild'>, UniversalMenuItemProps {
|
|
11
15
|
/** Whether to show the end icon */
|
|
12
16
|
hideEndIcon?: boolean;
|
|
@@ -15,11 +19,11 @@ interface MenuItemBaseProps extends Omit<PressableProps, 'asChild'>, UniversalMe
|
|
|
15
19
|
/** Additional props to pass to the root component */
|
|
16
20
|
rootProps?: Record<string, unknown>;
|
|
17
21
|
/** Internal overrides for downstream components. */
|
|
18
|
-
|
|
19
|
-
root?:
|
|
20
|
-
text?:
|
|
21
|
-
startIcon?:
|
|
22
|
-
endIcon?:
|
|
22
|
+
slotProps?: {
|
|
23
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
24
|
+
text?: Partial<Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> & DataAttributes>;
|
|
25
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
26
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
23
27
|
};
|
|
24
28
|
}
|
|
25
29
|
declare const ITEM_CLASS_NAME = "uds-menu-item";
|