@yahoo/uds 3.131.0-beta.2 → 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/automated-config/dist/properties.d.cts +1 -1
- package/dist/automated-config/dist/properties.d.ts +1 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +1 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +1 -1
- package/dist/components/Banner/Banner.cjs +5 -2
- package/dist/components/Banner/Banner.d.cts +10 -1
- package/dist/components/Banner/Banner.d.ts +10 -1
- package/dist/components/Banner/Banner.js +5 -2
- package/dist/components/Banner/utils.d.cts +1 -1
- package/dist/components/Banner/utils.d.ts +1 -1
- package/dist/components/Box.d.cts +1 -1
- package/dist/components/Box.d.ts +1 -1
- 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 +11 -5
- package/dist/components/Divider/DividerCore.d.ts +11 -5
- package/dist/components/Divider/DividerCore.js +17 -10
- package/dist/components/Divider/DividerInternal.cjs +15 -11
- package/dist/components/Divider/DividerInternal.d.cts +1 -1
- package/dist/components/Divider/DividerInternal.d.ts +1 -1
- package/dist/components/Divider/DividerInternal.js +15 -11
- package/dist/components/FormLabel.d.cts +1 -1
- package/dist/components/FormLabel.d.ts +1 -1
- package/dist/components/HStack.d.cts +1 -1
- package/dist/components/HStack.d.ts +1 -1
- package/dist/components/Icon.cjs +6 -15
- package/dist/components/Icon.d.cts +1 -0
- package/dist/components/Icon.d.ts +1 -0
- package/dist/components/Icon.js +7 -16
- package/dist/components/IconSlot.cjs +6 -25
- package/dist/components/IconSlot.d.cts +2 -3
- package/dist/components/IconSlot.d.ts +2 -3
- package/dist/components/IconSlot.js +5 -25
- package/dist/components/Image.d.cts +1 -1
- package/dist/components/Image.d.ts +1 -1
- package/dist/components/Link.cjs +13 -6
- package/dist/components/Link.d.cts +11 -1
- package/dist/components/Link.d.ts +11 -1
- package/dist/components/Link.js +13 -6
- package/dist/components/Text.d.cts +1 -1
- package/dist/components/Text.d.ts +1 -1
- package/dist/components/VStack.d.cts +1 -1
- package/dist/components/VStack.d.ts +1 -1
- package/dist/components/client/Avatar/AvatarIcon.d.cts +1 -1
- package/dist/components/client/Avatar/AvatarIcon.d.ts +1 -1
- package/dist/components/client/Avatar/AvatarImage.d.cts +1 -1
- package/dist/components/client/Avatar/AvatarImage.d.ts +1 -1
- package/dist/components/client/Avatar/AvatarText.d.cts +1 -1
- package/dist/components/client/Avatar/AvatarText.d.ts +1 -1
- package/dist/components/client/Avatar/utils.d.cts +1 -1
- package/dist/components/client/Avatar/utils.d.ts +1 -1
- package/dist/components/client/Badge.cjs +10 -4
- package/dist/components/client/Badge.d.cts +13 -2
- package/dist/components/client/Badge.d.ts +13 -2
- package/dist/components/client/Badge.js +10 -4
- package/dist/components/client/BottomSheet/BottomSheet.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetContent.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetContent.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.ts +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.cts +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.ts +1 -1
- package/dist/components/client/BottomSheet/utils.d.cts +1 -1
- package/dist/components/client/BottomSheet/utils.d.ts +1 -1
- package/dist/components/client/Button.cjs +20 -9
- package/dist/components/client/Button.d.cts +13 -2
- package/dist/components/client/Button.d.ts +13 -2
- package/dist/components/client/Button.js +20 -9
- package/dist/components/client/Checkbox.cjs +14 -6
- package/dist/components/client/Checkbox.d.cts +10 -5
- package/dist/components/client/Checkbox.d.ts +10 -5
- 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/Chip/ChipBase.d.cts +1 -1
- package/dist/components/client/Chip/ChipBase.d.ts +1 -1
- package/dist/components/client/Chip/ChipButton.d.cts +1 -1
- package/dist/components/client/Chip/ChipButton.d.ts +1 -1
- package/dist/components/client/Chip/ChipDismissible.d.cts +1 -1
- package/dist/components/client/Chip/ChipDismissible.d.ts +1 -1
- package/dist/components/client/Chip/ChipLink.d.cts +1 -1
- package/dist/components/client/Chip/ChipLink.d.ts +1 -1
- package/dist/components/client/Chip/ChipToggle.d.cts +1 -1
- package/dist/components/client/Chip/ChipToggle.d.ts +1 -1
- package/dist/components/client/IconButton.cjs +5 -8
- package/dist/components/client/IconButton.d.cts +10 -2
- package/dist/components/client/IconButton.d.ts +10 -2
- package/dist/components/client/IconButton.js +5 -8
- package/dist/components/client/Input/Input.cjs +8 -2
- package/dist/components/client/Input/Input.d.cts +4 -1
- package/dist/components/client/Input/Input.d.ts +4 -1
- 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 +11 -1
- package/dist/components/client/Input/InputHelpTextInternal.d.ts +11 -1
- 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 +8 -1
- package/dist/components/client/Menu/Menu.Content.d.ts +8 -1
- 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 +12 -1
- package/dist/components/client/Menu/Menu.Item.d.ts +12 -1
- 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 +10 -6
- package/dist/components/client/Menu/Menu.ItemBase.d.ts +10 -6
- 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 +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.js +10 -10
- package/dist/components/client/Popover/Popover.d.cts +1 -1
- package/dist/components/client/Popover/Popover.d.ts +1 -1
- package/dist/components/client/Popover/PopoverContent.cjs +4 -1
- package/dist/components/client/Popover/PopoverContent.d.cts +4 -1
- package/dist/components/client/Popover/PopoverContent.d.ts +4 -1
- package/dist/components/client/Popover/PopoverContent.js +4 -1
- package/dist/components/client/Popover/PopoverTrigger.d.cts +1 -1
- package/dist/components/client/Popover/PopoverTrigger.d.ts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +2 -2
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +2 -2
- package/dist/components/client/Popover/index.d.cts +1 -1
- package/dist/components/client/Popover/index.d.ts +1 -1
- package/dist/components/client/Pressable.d.cts +1 -1
- package/dist/components/client/Pressable.d.ts +1 -1
- package/dist/components/client/Radio/Radio.cjs +18 -15
- package/dist/components/client/Radio/Radio.d.cts +10 -5
- package/dist/components/client/Radio/Radio.d.ts +10 -5
- package/dist/components/client/Radio/Radio.js +18 -15
- package/dist/components/client/Radio/RadioGroupProvider.d.cts +1 -1
- package/dist/components/client/Radio/RadioGroupProvider.d.ts +1 -1
- package/dist/components/client/SpringMotionConfig.d.cts +1 -1
- package/dist/components/client/SpringMotionConfig.d.ts +1 -1
- package/dist/components/client/Switch.cjs +14 -6
- package/dist/components/client/Switch.d.cts +10 -6
- package/dist/components/client/Switch.d.ts +10 -6
- 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/Tabs/TabList.d.cts +1 -1
- package/dist/components/client/Tabs/TabList.d.ts +1 -1
- package/dist/components/client/Tabs/TabPanel.d.cts +1 -1
- package/dist/components/client/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/client/Tabs/Tabs.d.cts +1 -1
- package/dist/components/client/Tabs/Tabs.d.ts +1 -1
- package/dist/components/client/Tabs/tabsContext.d.cts +1 -1
- package/dist/components/client/Tabs/tabsContext.d.ts +1 -1
- package/dist/components/client/Toast/Toast.d.cts +1 -1
- package/dist/components/client/Toast/Toast.d.ts +1 -1
- package/dist/components/client/Toast/ToastContainer.d.cts +1 -1
- package/dist/components/client/Toast/ToastContainer.d.ts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +1 -1
- package/dist/components/client/Toast/createToast.d.cts +1 -1
- package/dist/components/client/Toast/createToast.d.ts +1 -1
- package/dist/components/client/Tooltip/Tooltip.d.cts +1 -1
- package/dist/components/client/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/client/Tooltip/TooltipContent.cjs +9 -3
- package/dist/components/client/Tooltip/TooltipContent.d.cts +14 -3
- package/dist/components/client/Tooltip/TooltipContent.d.ts +14 -3
- package/dist/components/client/Tooltip/TooltipContent.js +9 -3
- package/dist/components/client/Tooltip/TooltipTrigger.d.cts +1 -1
- package/dist/components/client/Tooltip/TooltipTrigger.d.ts +1 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.cts +1 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.ts +1 -1
- package/dist/components/client/Tooltip/index.d.cts +1 -1
- package/dist/components/client/Tooltip/index.d.ts +1 -1
- package/dist/components/client/buttonConstants.d.cts +1 -1
- package/dist/components/client/buttonConstants.d.ts +1 -1
- package/dist/components/client/index.d.cts +1 -1
- package/dist/components/client/index.d.ts +1 -1
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.cts +1 -1
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.ts +1 -1
- package/dist/components/experimental/Table.d.cts +1 -1
- package/dist/components/experimental/Table.d.ts +1 -1
- package/dist/components/experimental/client/SwitchV2.cjs +14 -6
- package/dist/components/experimental/client/SwitchV2.d.cts +10 -6
- package/dist/components/experimental/client/SwitchV2.d.ts +10 -6
- package/dist/components/experimental/client/SwitchV2.js +14 -6
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/config/dist/index.d.cts +1 -1
- package/dist/config/dist/index.d.ts +1 -1
- package/dist/css-tokens/dist/index.d.cts +1 -1
- package/dist/css-tokens/dist/index.d.ts +1 -1
- package/dist/fixtures/dist/index.d.cts +1 -1
- package/dist/fixtures/dist/index.d.ts +1 -1
- package/dist/fixtures/index.d.cts +1 -1
- package/dist/fixtures/index.d.ts +1 -1
- package/dist/fonts/dist/index.d.cts +1 -1
- package/dist/fonts/dist/index.d.ts +1 -1
- package/dist/icons/dist/types.d.cts +30 -0
- package/dist/icons/dist/types.d.ts +30 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/modes/dist/index.d.cts +1 -1
- package/dist/modes/dist/index.d.ts +1 -1
- package/dist/motion-tokens/dist/index.d.cts +1 -1
- package/dist/motion-tokens/dist/index.d.ts +1 -1
- package/dist/providers/ColorModeProvider.d.cts +1 -1
- package/dist/providers/ColorModeProvider.d.ts +1 -1
- package/dist/providers/ScaleModeProvider.d.cts +1 -1
- package/dist/providers/ScaleModeProvider.d.ts +1 -1
- package/dist/providers/ThemeProvider.d.cts +1 -1
- package/dist/providers/ThemeProvider.d.ts +1 -1
- package/dist/runtime/bottomSheetConfig.d.cts +1 -1
- package/dist/runtime/bottomSheetConfig.d.ts +1 -1
- package/dist/runtime/breakpointsConfig.d.cts +1 -1
- package/dist/runtime/breakpointsConfig.d.ts +1 -1
- package/dist/runtime/popoverConfig.d.cts +1 -1
- package/dist/runtime/popoverConfig.d.ts +1 -1
- package/dist/runtime/toastConfig.d.cts +1 -1
- package/dist/runtime/toastConfig.d.ts +1 -1
- package/dist/runtime/tooltipConfig.d.cts +1 -1
- package/dist/runtime/tooltipConfig.d.ts +1 -1
- package/dist/styles/styler.d.cts +76 -76
- package/dist/styles/styler.d.ts +76 -76
- package/dist/styles/stylerTypes.d.cts +1 -1
- package/dist/styles/stylerTypes.d.ts +1 -1
- package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
- package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
- package/dist/tokens/configs/borderRadius.d.cts +1 -1
- package/dist/tokens/configs/borderRadius.d.ts +1 -1
- package/dist/tokens/configs/borderWidth.d.cts +1 -1
- package/dist/tokens/configs/borderWidth.d.ts +1 -1
- package/dist/tokens/configs/font.d.cts +1 -1
- package/dist/tokens/configs/font.d.ts +1 -1
- package/dist/tokens/configs/scaleMode.d.cts +1 -1
- package/dist/tokens/configs/scaleMode.d.ts +1 -1
- package/dist/tokens/configs/shadow.d.cts +1 -1
- package/dist/tokens/configs/shadow.d.ts +1 -1
- package/dist/tokens/configs/sizes.d.cts +1 -1
- package/dist/tokens/configs/sizes.d.ts +1 -1
- package/dist/tokens/configs/typography.d.cts +1 -1
- package/dist/tokens/configs/typography.d.ts +1 -1
- package/dist/tokens/index.d.cts +2 -2
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/parseButtonVariants.d.cts +1 -1
- package/dist/tokens/parseButtonVariants.d.ts +1 -1
- package/dist/tokens/types.d.cts +7 -7
- package/dist/tokens/types.d.ts +7 -7
- package/dist/tokens/utils/spectrum.d.cts +1 -1
- package/dist/tokens/utils/spectrum.d.ts +1 -1
- package/dist/types/{src → dist}/index.d.cts +26 -38
- package/dist/types/{src → dist}/index.d.ts +26 -38
- package/dist/uds/generated/componentData.cjs +109 -106
- package/dist/uds/generated/componentData.js +109 -106
- package/dist/uds/generated/tailwindPurge.cjs +73 -73
- package/dist/uds/generated/tailwindPurge.js +73 -73
- package/dist/uds/package.cjs +1 -1
- package/dist/uds/package.js +1 -1
- package/dist/utils/isElevationAlias.d.cts +1 -1
- package/dist/utils/isElevationAlias.d.ts +1 -1
- package/generated/componentData.json +135 -124
- package/generated/tailwindPurge.ts +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalIconButtonProps } from "../../tokens/types.cjs";
|
|
2
|
+
import { IconPropsWithSVGProps, UniversalIconButtonProps } from "../../tokens/types.cjs";
|
|
3
3
|
import "../../tokens/index.cjs";
|
|
4
4
|
import * as react from "react";
|
|
5
5
|
import { HTMLMotionProps } from "motion/react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/client/IconButton.d.ts
|
|
8
8
|
type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
|
|
9
|
-
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[name: `data-${string}`]: string;
|
|
11
|
+
};
|
|
12
|
+
interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
|
|
13
|
+
/** Props to be passed into various slots within the component. */
|
|
14
|
+
slotProps?: {
|
|
15
|
+
icon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
10
18
|
/**
|
|
11
19
|
* **⚙️️ An icon button element that can be used to trigger an action**
|
|
12
20
|
*
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { UniversalIconButtonProps } from "../../tokens/types.js";
|
|
3
|
+
import { IconPropsWithSVGProps, UniversalIconButtonProps } from "../../tokens/types.js";
|
|
4
4
|
import "../../tokens/index.js";
|
|
5
5
|
import * as react from "react";
|
|
6
6
|
import { HTMLMotionProps } from "motion/react";
|
|
7
7
|
|
|
8
8
|
//#region src/components/client/IconButton.d.ts
|
|
9
9
|
type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
|
|
10
|
-
|
|
10
|
+
type DataAttributes = {
|
|
11
|
+
[name: `data-${string}`]: string;
|
|
12
|
+
};
|
|
13
|
+
interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
|
|
14
|
+
/** Props to be passed into various slots within the component. */
|
|
15
|
+
slotProps?: {
|
|
16
|
+
icon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
11
19
|
/**
|
|
12
20
|
* **⚙️️ An icon button element that can be used to trigger an action**
|
|
13
21
|
*
|
|
@@ -10,7 +10,6 @@ import { iconMotionVariants, loadingMotionVariants } from "./Button.js";
|
|
|
10
10
|
import { Progress } from "@yahoo/uds-icons";
|
|
11
11
|
import { forwardRef, useImperativeHandle, useMemo, useRef } from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { getIconName, isIconDefinition } from "@yahoo/uds-icons/utils";
|
|
14
13
|
import { AnimatePresence, m, useReducedMotion } from "motion/react";
|
|
15
14
|
|
|
16
15
|
//#region src/components/client/IconButton.tsx
|
|
@@ -18,10 +17,6 @@ const defaultSizeRootClass = generateDefaultClassName("iconbutton", "size", "roo
|
|
|
18
17
|
const defaultSizeIconClass = generateDefaultClassName("iconbutton", "size", "icon");
|
|
19
18
|
const defaultVariantRootClass = generateDefaultClassName("button", "variant", "root");
|
|
20
19
|
const defaultVariantIconClass = generateDefaultClassName("button", "variant", "icon");
|
|
21
|
-
function getIconMotionKey(icon) {
|
|
22
|
-
if (isIconDefinition(icon)) return getIconName(icon);
|
|
23
|
-
return "icon";
|
|
24
|
-
}
|
|
25
20
|
/**
|
|
26
21
|
* **⚙️️ An icon button element that can be used to trigger an action**
|
|
27
22
|
*
|
|
@@ -48,9 +43,10 @@ function getIconMotionKey(icon) {
|
|
|
48
43
|
* @related [Icon](https://uds.build/docs/components/icon), [Button](https://uds.build/docs/components/button), and [Pressable](https://uds.build/docs/components/pressable)
|
|
49
44
|
*
|
|
50
45
|
**/
|
|
51
|
-
const IconButton = forwardRef(function IconButton({ variant, size, iconVariant, loading, disableEffects, name, type = "button", htmlName, className, children, ...rest }, forwardedRef) {
|
|
46
|
+
const IconButton = forwardRef(function IconButton({ variant, size, iconVariant, loading, disableEffects, name, slotProps, type = "button", htmlName, className, children, ...rest }, forwardedRef) {
|
|
52
47
|
const ref = useRef(null);
|
|
53
48
|
useImperativeHandle(forwardedRef, () => ref.current);
|
|
49
|
+
const { className: iconSlotClassName, ...iconSlotProps } = slotProps?.icon ?? {};
|
|
54
50
|
const prefersReducedMotion = useReducedMotion();
|
|
55
51
|
const disableMotion = !!disableEffects || !!rest?.disabled;
|
|
56
52
|
const layoutVariant = useMemo(() => prefersReducedMotion ? "smooth" : "subtle", [prefersReducedMotion]);
|
|
@@ -120,9 +116,10 @@ const IconButton = forwardRef(function IconButton({ variant, size, iconVariant,
|
|
|
120
116
|
name,
|
|
121
117
|
variant: iconVariant,
|
|
122
118
|
color: "current",
|
|
123
|
-
className: styles.icon
|
|
119
|
+
className: cx(styles.icon, iconSlotClassName),
|
|
120
|
+
...iconSlotProps
|
|
124
121
|
})
|
|
125
|
-
},
|
|
122
|
+
}, name.name)]
|
|
126
123
|
})
|
|
127
124
|
})
|
|
128
125
|
});
|
|
@@ -16,7 +16,7 @@ lodash_isFunction_js = require_runtime.__toESM(lodash_isFunction_js);
|
|
|
16
16
|
let motion_react = require("motion/react");
|
|
17
17
|
|
|
18
18
|
//#region src/components/client/Input/Input.tsx
|
|
19
|
-
const HelpTextContent = (0, react.memo)(function HelpTextContentOriginal({ helpText, helperTextIcon, spacingStart, spacingTop, size, isFilled, ...rest }) {
|
|
19
|
+
const HelpTextContent = (0, react.memo)(function HelpTextContentOriginal({ helpText, helperTextIcon, spacingStart, spacingTop, size, isFilled, helperTextSlotProps, ...rest }) {
|
|
20
20
|
if (!helpText) return null;
|
|
21
21
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
22
22
|
spacingTop,
|
|
@@ -26,6 +26,10 @@ const HelpTextContent = (0, react.memo)(function HelpTextContentOriginal({ helpT
|
|
|
26
26
|
startIcon: helperTextIcon,
|
|
27
27
|
size,
|
|
28
28
|
isFilled,
|
|
29
|
+
slotProps: {
|
|
30
|
+
startIcon: helperTextSlotProps?.helperTextIcon,
|
|
31
|
+
text: helperTextSlotProps?.helperText
|
|
32
|
+
},
|
|
29
33
|
children: (0, lodash_isFunction_js.default)(helpText) ? helpText() : helpText
|
|
30
34
|
})
|
|
31
35
|
});
|
|
@@ -147,6 +151,7 @@ const Input = (0, react.forwardRef)(function Input({ id, label, type = "text", s
|
|
|
147
151
|
className: classNames.label,
|
|
148
152
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
149
153
|
htmlFor: uid,
|
|
154
|
+
...slotProps?.label,
|
|
150
155
|
children: (0, lodash_isFunction_js.default)(label) ? label() : label
|
|
151
156
|
}), required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
152
157
|
className: classNames.labelRequired,
|
|
@@ -199,7 +204,8 @@ const Input = (0, react.forwardRef)(function Input({ id, label, type = "text", s
|
|
|
199
204
|
spacingTop: "2",
|
|
200
205
|
size,
|
|
201
206
|
isFilled: !!value,
|
|
202
|
-
helperTextIcon
|
|
207
|
+
helperTextIcon,
|
|
208
|
+
helperTextSlotProps: slotProps
|
|
203
209
|
})
|
|
204
210
|
})
|
|
205
211
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalInputProps } from "../../../types/
|
|
2
|
+
import { UniversalInputProps } from "../../../types/dist/index.cjs";
|
|
3
3
|
import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
|
|
4
4
|
import "../../../tokens/index.cjs";
|
|
5
5
|
import { BoxProps } from "../../Box.cjs";
|
|
@@ -24,6 +24,9 @@ interface InputProps extends NativeInputProps, UniversalInputProps {
|
|
|
24
24
|
inputWrapper?: Partial<BoxProps & DataAttributes>;
|
|
25
25
|
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
26
26
|
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
27
|
+
label?: Partial<React.LabelHTMLAttributes<HTMLLabelElement> & DataAttributes>;
|
|
28
|
+
helperText?: Partial<React.HTMLAttributes<HTMLSpanElement> & DataAttributes>;
|
|
29
|
+
helperTextIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { UniversalInputProps } from "../../../types/
|
|
3
|
+
import { UniversalInputProps } from "../../../types/dist/index.js";
|
|
4
4
|
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
5
5
|
import "../../../tokens/index.js";
|
|
6
6
|
import { BoxProps } from "../../Box.js";
|
|
@@ -25,6 +25,9 @@ interface InputProps extends NativeInputProps, UniversalInputProps {
|
|
|
25
25
|
inputWrapper?: Partial<BoxProps & DataAttributes>;
|
|
26
26
|
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
27
27
|
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
28
|
+
label?: Partial<React.LabelHTMLAttributes<HTMLLabelElement> & DataAttributes>;
|
|
29
|
+
helperText?: Partial<React.HTMLAttributes<HTMLSpanElement> & DataAttributes>;
|
|
30
|
+
helperTextIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
@@ -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
|
-
import { UniversalIconSlot } from "../../../types/
|
|
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
|
-
import { UniversalIconSlot } from "../../../types/
|
|
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
|
})
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { SpacingAlias } from "../../../types/
|
|
2
|
+
import { SpacingAlias } from "../../../types/dist/index.cjs";
|
|
3
3
|
import "../../../tokens/index.cjs";
|
|
4
4
|
import { VStackProps } from "../../VStack.cjs";
|
|
5
5
|
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
|
*
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { SpacingAlias } from "../../../types/
|
|
3
|
+
import { SpacingAlias } from "../../../types/dist/index.js";
|
|
4
4
|
import "../../../tokens/index.js";
|
|
5
5
|
import { VStackProps } from "../../VStack.js";
|
|
6
6
|
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
|
-
import { UniversalMenuItemProps } from "../../../types/
|
|
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
|
-
import { UniversalMenuItemProps } from "../../../types/
|
|
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**
|