@yahoo/uds 3.131.0 → 3.132.1
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/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- 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 +16 -6
- 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 +17 -7
- 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/Popover/UDSPopoverConfigProvider.d.cts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -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 +65 -65
- package/dist/styles/styler.d.ts +65 -65
- package/dist/types/dist/index.d.cts +3 -3
- package/dist/types/dist/index.d.ts +3 -3
- package/dist/uds/generated/componentData.cjs +1485 -1482
- package/dist/uds/generated/componentData.js +1485 -1482
- package/dist/uds/generated/tailwindPurge.cjs +73 -73
- package/dist/uds/generated/tailwindPurge.js +73 -73
- package/generated/componentData.json +2039 -2030
- package/generated/tailwindPurge.ts +1 -1
- package/package.json +1 -1
|
@@ -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";
|
|
@@ -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 { MenuItem, MenuItemCheckbox } from "@ariakit/react";
|
|
|
8
9
|
|
|
9
10
|
//#region src/components/client/Menu/Menu.ItemBase.d.ts
|
|
10
11
|
type MenuItemRootComponent = typeof MenuItem | typeof MenuItemCheckbox;
|
|
12
|
+
type DataAttributes = {
|
|
13
|
+
[name: `data-${string}`]: string;
|
|
14
|
+
};
|
|
11
15
|
interface MenuItemBaseProps extends Omit<PressableProps, 'asChild'>, UniversalMenuItemProps {
|
|
12
16
|
/** Whether to show the end icon */
|
|
13
17
|
hideEndIcon?: boolean;
|
|
@@ -16,11 +20,11 @@ interface MenuItemBaseProps extends Omit<PressableProps, 'asChild'>, UniversalMe
|
|
|
16
20
|
/** Additional props to pass to the root component */
|
|
17
21
|
rootProps?: Record<string, unknown>;
|
|
18
22
|
/** Internal overrides for downstream components. */
|
|
19
|
-
|
|
20
|
-
root?:
|
|
21
|
-
text?:
|
|
22
|
-
startIcon?:
|
|
23
|
-
endIcon?:
|
|
23
|
+
slotProps?: {
|
|
24
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
25
|
+
text?: Partial<Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> & DataAttributes>;
|
|
26
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
27
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
declare const ITEM_CLASS_NAME = "uds-menu-item";
|
|
@@ -28,18 +28,22 @@ const buildMenuItemClasses = ({ active, disabled, className }) => {
|
|
|
28
28
|
* @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)
|
|
29
29
|
* and may change without notice. Please do not use this component directly.
|
|
30
30
|
*/
|
|
31
|
-
const MenuItemBase = 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",
|
|
31
|
+
const MenuItemBase = 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) {
|
|
32
32
|
const hasMultipleChildren = Children.count(children) > 1;
|
|
33
33
|
const menuItemClassName = buildMenuItemClasses({
|
|
34
34
|
active,
|
|
35
35
|
disabled,
|
|
36
36
|
className
|
|
37
37
|
});
|
|
38
|
+
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
39
|
+
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
40
|
+
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
41
|
+
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
38
42
|
/**
|
|
39
43
|
* Get content styles based on children layout needs
|
|
40
44
|
*/
|
|
41
45
|
const contentStyles = getStyles({
|
|
42
|
-
className: cx(`${ITEM_CLASS_NAME}-content truncate`,
|
|
46
|
+
className: cx(`${ITEM_CLASS_NAME}-content truncate`, textClassName),
|
|
43
47
|
textAlign: "start",
|
|
44
48
|
...hasMultipleChildren && {
|
|
45
49
|
columnGap,
|
|
@@ -66,23 +70,23 @@ const MenuItemBase = forwardRef(function MenuItemBase({ spacing = "0", spacingBo
|
|
|
66
70
|
columnGap,
|
|
67
71
|
alignItems,
|
|
68
72
|
justifyContent,
|
|
69
|
-
className: cx(menuItemClassName,
|
|
73
|
+
className: cx(menuItemClassName, rootClassName)
|
|
70
74
|
}),
|
|
71
75
|
startIcon: getStyles({
|
|
72
76
|
menuitemSizeStartIcon: "default",
|
|
73
|
-
className:
|
|
77
|
+
className: startIconClassName
|
|
74
78
|
}),
|
|
75
79
|
endIcon: getStyles({
|
|
76
80
|
menuitemSizeEndIcon: "default",
|
|
77
|
-
className:
|
|
81
|
+
className: endIconClassName
|
|
78
82
|
})
|
|
79
83
|
}), [
|
|
80
84
|
alignItems,
|
|
81
85
|
columnGap,
|
|
82
86
|
justifyContent,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
endIconClassName,
|
|
88
|
+
rootClassName,
|
|
89
|
+
startIconClassName,
|
|
86
90
|
menuItemClassName,
|
|
87
91
|
spacing,
|
|
88
92
|
spacingBottom,
|
|
@@ -107,6 +111,7 @@ const MenuItemBase = forwardRef(function MenuItemBase({ spacing = "0", spacingBo
|
|
|
107
111
|
render: rootRender,
|
|
108
112
|
disabled,
|
|
109
113
|
className: classNames.root,
|
|
114
|
+
...rootSlotProps,
|
|
110
115
|
children: [/* @__PURE__ */ jsxs(HStack, {
|
|
111
116
|
gap: columnGap,
|
|
112
117
|
alignItems: "center",
|
|
@@ -125,12 +130,15 @@ const MenuItemBase = forwardRef(function MenuItemBase({ spacing = "0", spacingBo
|
|
|
125
130
|
iconProps: {
|
|
126
131
|
size: "sm",
|
|
127
132
|
variant: active ? "fill" : "outline",
|
|
128
|
-
color: "current"
|
|
133
|
+
color: "current",
|
|
134
|
+
...endIconSlotProps,
|
|
135
|
+
...startIconSlotProps
|
|
129
136
|
}
|
|
130
137
|
})
|
|
131
138
|
})
|
|
132
139
|
}), /* @__PURE__ */ jsx("span", {
|
|
133
140
|
className: contentStyles,
|
|
141
|
+
...textSlotProps,
|
|
134
142
|
children
|
|
135
143
|
})]
|
|
136
144
|
}), /* @__PURE__ */ jsx(AnimatePresence, {
|
|
@@ -97,23 +97,23 @@ const MenuItemCheckbox = (0, react.forwardRef)(function MenuItemCheckbox({ name,
|
|
|
97
97
|
context,
|
|
98
98
|
checked
|
|
99
99
|
]);
|
|
100
|
-
const
|
|
101
|
-
root: require_styles_styler.getStyles({
|
|
100
|
+
const menuSlotProps = {
|
|
101
|
+
root: { className: require_styles_styler.getStyles({
|
|
102
102
|
menuitemItemCheckboxVariantRoot: "default",
|
|
103
103
|
menuitemItemCheckboxVariantActiveRoot: isChecked ? "on" : "off"
|
|
104
|
-
}),
|
|
105
|
-
text: require_styles_styler.getStyles({
|
|
104
|
+
}) },
|
|
105
|
+
text: { className: require_styles_styler.getStyles({
|
|
106
106
|
menuitemItemCheckboxVariantText: "default",
|
|
107
107
|
menuitemItemCheckboxVariantActiveText: isChecked ? "on" : "off"
|
|
108
|
-
}),
|
|
109
|
-
startIcon: require_styles_styler.getStyles({
|
|
108
|
+
}) },
|
|
109
|
+
startIcon: { className: require_styles_styler.getStyles({
|
|
110
110
|
menuitemItemCheckboxVariantStartIcon: "default",
|
|
111
111
|
menuitemItemCheckboxVariantActiveStartIcon: isChecked ? "on" : "off"
|
|
112
|
-
}),
|
|
113
|
-
endIcon: require_styles_styler.getStyles({
|
|
112
|
+
}) },
|
|
113
|
+
endIcon: { className: require_styles_styler.getStyles({
|
|
114
114
|
menuitemItemCheckboxVariantEndIcon: "default",
|
|
115
115
|
menuitemItemCheckboxVariantActiveEndIcon: isChecked ? "on" : "off"
|
|
116
|
-
})
|
|
116
|
+
}) }
|
|
117
117
|
};
|
|
118
118
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Menu_Menu_ItemBase.MenuItemBase, {
|
|
119
119
|
ref,
|
|
@@ -122,7 +122,7 @@ const MenuItemCheckbox = (0, react.forwardRef)(function MenuItemCheckbox({ name,
|
|
|
122
122
|
endIcon,
|
|
123
123
|
active: isChecked,
|
|
124
124
|
className: require_styles_styler.cx("uds-menu-item-checkbox", className),
|
|
125
|
-
|
|
125
|
+
slotProps: menuSlotProps,
|
|
126
126
|
name,
|
|
127
127
|
rootProps: {
|
|
128
128
|
onChange: handleChange,
|
|
@@ -88,6 +88,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
|
|
|
88
88
|
*
|
|
89
89
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
|
90
90
|
**/
|
|
91
|
-
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "
|
|
91
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "hideEndIcon" | "rootProps"> & react.RefAttributes<HTMLDivElement>>;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { MenuItemCheckbox, type MenuItemCheckboxProps };
|
|
@@ -89,6 +89,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
|
|
|
89
89
|
*
|
|
90
90
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
|
91
91
|
**/
|
|
92
|
-
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "
|
|
92
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "hideEndIcon" | "rootProps"> & react.RefAttributes<HTMLDivElement>>;
|
|
93
93
|
//#endregion
|
|
94
94
|
export { MenuItemCheckbox, type MenuItemCheckboxProps };
|
|
@@ -95,23 +95,23 @@ const MenuItemCheckbox = forwardRef(function MenuItemCheckbox({ name, endIcon =
|
|
|
95
95
|
context,
|
|
96
96
|
checked
|
|
97
97
|
]);
|
|
98
|
-
const
|
|
99
|
-
root: getStyles({
|
|
98
|
+
const menuSlotProps = {
|
|
99
|
+
root: { className: getStyles({
|
|
100
100
|
menuitemItemCheckboxVariantRoot: "default",
|
|
101
101
|
menuitemItemCheckboxVariantActiveRoot: isChecked ? "on" : "off"
|
|
102
|
-
}),
|
|
103
|
-
text: getStyles({
|
|
102
|
+
}) },
|
|
103
|
+
text: { className: getStyles({
|
|
104
104
|
menuitemItemCheckboxVariantText: "default",
|
|
105
105
|
menuitemItemCheckboxVariantActiveText: isChecked ? "on" : "off"
|
|
106
|
-
}),
|
|
107
|
-
startIcon: getStyles({
|
|
106
|
+
}) },
|
|
107
|
+
startIcon: { className: getStyles({
|
|
108
108
|
menuitemItemCheckboxVariantStartIcon: "default",
|
|
109
109
|
menuitemItemCheckboxVariantActiveStartIcon: isChecked ? "on" : "off"
|
|
110
|
-
}),
|
|
111
|
-
endIcon: getStyles({
|
|
110
|
+
}) },
|
|
111
|
+
endIcon: { className: getStyles({
|
|
112
112
|
menuitemItemCheckboxVariantEndIcon: "default",
|
|
113
113
|
menuitemItemCheckboxVariantActiveEndIcon: isChecked ? "on" : "off"
|
|
114
|
-
})
|
|
114
|
+
}) }
|
|
115
115
|
};
|
|
116
116
|
return /* @__PURE__ */ jsx(MenuItemBase, {
|
|
117
117
|
ref,
|
|
@@ -120,7 +120,7 @@ const MenuItemCheckbox = forwardRef(function MenuItemCheckbox({ name, endIcon =
|
|
|
120
120
|
endIcon,
|
|
121
121
|
active: isChecked,
|
|
122
122
|
className: cx("uds-menu-item-checkbox", className),
|
|
123
|
-
|
|
123
|
+
slotProps: menuSlotProps,
|
|
124
124
|
name,
|
|
125
125
|
rootProps: {
|
|
126
126
|
onChange: handleChange,
|
|
@@ -104,6 +104,7 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
104
104
|
},
|
|
105
105
|
ref: mergedRef,
|
|
106
106
|
className: classNames.root,
|
|
107
|
+
...slotProps?.root,
|
|
107
108
|
portal: internalContext ? internalContext.portal : true,
|
|
108
109
|
gutter: internalContext?.hideArrow ? gutter : ARROW_HEIGHT + gutter,
|
|
109
110
|
updatePosition: onPositionUpdate,
|
|
@@ -135,6 +136,7 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
135
136
|
...svgFloatingContentProps,
|
|
136
137
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
137
138
|
className: require_styles_styler.cx(classNames.contentWrapper),
|
|
139
|
+
...slotProps?.content,
|
|
138
140
|
style: { paddingInlineEnd: internalContext?.hideDismissButton || disableHorizontalSpacing ? void 0 : require_index.spacingMap[gap] + require_index.spacingMap[spacingHorizontal] + dismissButtonSize },
|
|
139
141
|
children
|
|
140
142
|
})
|
|
@@ -161,7 +163,8 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
161
163
|
!internalContext?.hideArrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverArrow, {
|
|
162
164
|
size: 1,
|
|
163
165
|
ref: arrowRef,
|
|
164
|
-
style: { opacity: 0 }
|
|
166
|
+
style: { opacity: 0 },
|
|
167
|
+
...slotProps?.caret
|
|
165
168
|
})
|
|
166
169
|
]
|
|
167
170
|
});
|
|
@@ -11,6 +11,9 @@ type DataAttributes = {
|
|
|
11
11
|
};
|
|
12
12
|
interface PopoverContentProps extends UniversalPopoverContentProps {
|
|
13
13
|
slotProps?: {
|
|
14
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
15
|
+
content?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
16
|
+
caret?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
14
17
|
closeIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
15
18
|
closeIconContainer?: Partial<PressableProps & DataAttributes>;
|
|
16
19
|
svgBase?: {
|
|
@@ -12,6 +12,9 @@ type DataAttributes = {
|
|
|
12
12
|
};
|
|
13
13
|
interface PopoverContentProps extends UniversalPopoverContentProps {
|
|
14
14
|
slotProps?: {
|
|
15
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
16
|
+
content?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
17
|
+
caret?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
15
18
|
closeIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
16
19
|
closeIconContainer?: Partial<PressableProps & DataAttributes>;
|
|
17
20
|
svgBase?: {
|
|
@@ -102,6 +102,7 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
102
102
|
},
|
|
103
103
|
ref: mergedRef,
|
|
104
104
|
className: classNames.root,
|
|
105
|
+
...slotProps?.root,
|
|
105
106
|
portal: internalContext ? internalContext.portal : true,
|
|
106
107
|
gutter: internalContext?.hideArrow ? gutter : ARROW_HEIGHT + gutter,
|
|
107
108
|
updatePosition: onPositionUpdate,
|
|
@@ -133,6 +134,7 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
133
134
|
...svgFloatingContentProps,
|
|
134
135
|
children: /* @__PURE__ */ jsx(Box, {
|
|
135
136
|
className: cx(classNames.contentWrapper),
|
|
137
|
+
...slotProps?.content,
|
|
136
138
|
style: { paddingInlineEnd: internalContext?.hideDismissButton || disableHorizontalSpacing ? void 0 : spacingMap[gap] + spacingMap[spacingHorizontal] + dismissButtonSize },
|
|
137
139
|
children
|
|
138
140
|
})
|
|
@@ -159,7 +161,8 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
159
161
|
!internalContext?.hideArrow && /* @__PURE__ */ jsx(PopoverArrow, {
|
|
160
162
|
size: 1,
|
|
161
163
|
ref: arrowRef,
|
|
162
|
-
style: { opacity: 0 }
|
|
164
|
+
style: { opacity: 0 },
|
|
165
|
+
...slotProps?.caret
|
|
163
166
|
})
|
|
164
167
|
]
|
|
165
168
|
});
|
|
@@ -29,7 +29,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
|
|
|
29
29
|
gap: SpacingAlias;
|
|
30
30
|
dismissButtonSpacing: SpacingAlias;
|
|
31
31
|
dismissIconSize: number;
|
|
32
|
-
ariaKitPlacement: ("
|
|
32
|
+
ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
|
|
33
33
|
animationDuration: number;
|
|
34
34
|
};
|
|
35
35
|
//#endregion
|
|
@@ -30,7 +30,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
|
|
|
30
30
|
gap: SpacingAlias;
|
|
31
31
|
dismissButtonSpacing: SpacingAlias;
|
|
32
32
|
dismissIconSize: number;
|
|
33
|
-
ariaKitPlacement: ("
|
|
33
|
+
ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
|
|
34
34
|
animationDuration: number;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
@@ -52,9 +52,13 @@ const pressTransition = {
|
|
|
52
52
|
*
|
|
53
53
|
* @related [Radio](https://uds.build/docs/components/Radio).
|
|
54
54
|
**/
|
|
55
|
-
const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label, labelPosition = "start", variant: variantProp = "primary", size = "md", reduceMotion: forceReduceMotion, value: valueProp = "", checked: checkedProp, defaultChecked, disabled, hasError, onChange, onFocus, onBlur, className, style,
|
|
55
|
+
const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label, labelPosition = "start", variant: variantProp = "primary", size = "md", reduceMotion: forceReduceMotion, value: valueProp = "", checked: checkedProp, defaultChecked, disabled, hasError, onChange, onFocus, onBlur, className, style, slotProps, ...radioProps }, parentRef) {
|
|
56
56
|
const generatedId = (0, react.useId)();
|
|
57
57
|
const uid = id ?? `uds-radio-${generatedId}`;
|
|
58
|
+
const rootSlotProps = slotProps?.root ?? {};
|
|
59
|
+
const radioSlotProps = slotProps?.radio ?? {};
|
|
60
|
+
const radioIconSlotProps = slotProps?.radioIcon ?? {};
|
|
61
|
+
const labelSlotProps = slotProps?.label ?? {};
|
|
58
62
|
const innerRef = (0, react.useRef)(null);
|
|
59
63
|
/**
|
|
60
64
|
* State
|
|
@@ -125,15 +129,11 @@ const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label,
|
|
|
125
129
|
display: "flex",
|
|
126
130
|
flexDirection: labelPosition === "start" ? "row" : "row-reverse",
|
|
127
131
|
alignItems: "center",
|
|
128
|
-
className: require_styles_styler.cx([
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
className,
|
|
135
|
-
layerClassNames?.root
|
|
136
|
-
])
|
|
132
|
+
className: require_styles_styler.cx([{
|
|
133
|
+
"cursor-pointer": !disabled,
|
|
134
|
+
"cursor-default": disabled,
|
|
135
|
+
"opacity-50": disabled
|
|
136
|
+
}, className])
|
|
137
137
|
}),
|
|
138
138
|
radio: require_styles_styler.getStyles({
|
|
139
139
|
radioSizeRadio: size,
|
|
@@ -145,8 +145,7 @@ const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label,
|
|
|
145
145
|
"uds-ring-within",
|
|
146
146
|
cssAnimationDuration,
|
|
147
147
|
"transition-[background-color,border-color]",
|
|
148
|
-
"transition-shadow"
|
|
149
|
-
layerClassNames?.radio
|
|
148
|
+
"transition-shadow"
|
|
150
149
|
])
|
|
151
150
|
}),
|
|
152
151
|
radioCircle: require_styles_styler.getStyles({
|
|
@@ -162,7 +161,7 @@ const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label,
|
|
|
162
161
|
])
|
|
163
162
|
}),
|
|
164
163
|
htmlRadio: require_styles_styler.cx("cursor-[inherit]", "absolute", "opacity-0", "top-1/2", "left-1/2", "w-[calc(100%+2px)]", "h-[calc(100%+2px)]", "transform", "translate-x-[-50%]", "translate-y-[-50%]"),
|
|
165
|
-
label: require_styles_styler.cx(labelPosition === "start" ? "text-start" : "text-end"
|
|
164
|
+
label: require_styles_styler.cx(labelPosition === "start" ? "text-start" : "text-end")
|
|
166
165
|
};
|
|
167
166
|
const RootElement = label ? motion_react.m.label : motion_react.m.div;
|
|
168
167
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_SpringMotionConfig.SpringMotionConfig, {
|
|
@@ -178,6 +177,7 @@ const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label,
|
|
|
178
177
|
onTap: handleTapEnd,
|
|
179
178
|
onTapCancel: handleTapEnd,
|
|
180
179
|
tabIndex: -1,
|
|
180
|
+
...rootSlotProps,
|
|
181
181
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionBox, {
|
|
182
182
|
position: "relative",
|
|
183
183
|
borderRadius: "full",
|
|
@@ -187,6 +187,7 @@ const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label,
|
|
|
187
187
|
className: classNames.radio,
|
|
188
188
|
animate: motionAnimate,
|
|
189
189
|
insetShadow: showShadow ? "lg-invert" : "none",
|
|
190
|
+
...radioSlotProps,
|
|
190
191
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
191
192
|
type: "radio",
|
|
192
193
|
tabIndex: 0,
|
|
@@ -208,14 +209,16 @@ const Radio = (0, react.forwardRef)(function Radio({ id, name: nameProp, label,
|
|
|
208
209
|
className: classNames.htmlRadio
|
|
209
210
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
210
211
|
borderRadius: "full",
|
|
211
|
-
className: classNames.radioCircle
|
|
212
|
+
className: classNames.radioCircle,
|
|
213
|
+
...radioIconSlotProps
|
|
212
214
|
})]
|
|
213
215
|
}), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_FormLabel.FormLabel, {
|
|
214
216
|
as: "div",
|
|
215
217
|
variant: "inherit",
|
|
216
218
|
color: "inherit",
|
|
217
219
|
label,
|
|
218
|
-
className: classNames.label
|
|
220
|
+
className: classNames.label,
|
|
221
|
+
...labelSlotProps
|
|
219
222
|
})]
|
|
220
223
|
})
|
|
221
224
|
});
|
|
@@ -5,11 +5,16 @@ import React from "react";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/client/Radio/Radio.d.ts
|
|
7
7
|
type NativeInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'value' | 'size' | 'height' | 'width' | 'color' | 'required'>;
|
|
8
|
+
type DataAttributes = {
|
|
9
|
+
[name: `data-${string}`]: string;
|
|
10
|
+
};
|
|
8
11
|
interface RadioProps extends NativeInputProps, UniversalRadioProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
/** Props to be passed into various slots within the component. */
|
|
13
|
+
slotProps?: {
|
|
14
|
+
root?: DataAttributes;
|
|
15
|
+
radio?: DataAttributes;
|
|
16
|
+
radioIcon?: DataAttributes;
|
|
17
|
+
label?: DataAttributes;
|
|
13
18
|
};
|
|
14
19
|
}
|
|
15
20
|
declare const RADIO_VARIANTS: RadioVariant[];
|
|
@@ -6,11 +6,16 @@ import React from "react";
|
|
|
6
6
|
|
|
7
7
|
//#region src/components/client/Radio/Radio.d.ts
|
|
8
8
|
type NativeInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'value' | 'size' | 'height' | 'width' | 'color' | 'required'>;
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[name: `data-${string}`]: string;
|
|
11
|
+
};
|
|
9
12
|
interface RadioProps extends NativeInputProps, UniversalRadioProps {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/** Props to be passed into various slots within the component. */
|
|
14
|
+
slotProps?: {
|
|
15
|
+
root?: DataAttributes;
|
|
16
|
+
radio?: DataAttributes;
|
|
17
|
+
radioIcon?: DataAttributes;
|
|
18
|
+
label?: DataAttributes;
|
|
14
19
|
};
|
|
15
20
|
}
|
|
16
21
|
declare const RADIO_VARIANTS: RadioVariant[];
|