@yahoo/uds 3.159.1 → 3.160.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.cjs +1 -1
- package/dist/automated-config/dist/properties.js +1 -1
- package/dist/components/Text.cjs +4 -2
- package/dist/components/Text.js +4 -2
- package/dist/components/client/Button/Button.cjs +213 -0
- package/dist/components/client/Button/Button.d.cts +50 -0
- package/dist/components/client/Button/Button.d.ts +51 -0
- package/dist/components/client/Button/Button.js +208 -0
- package/dist/components/client/Button/ButtonBase.cjs +120 -0
- package/dist/components/client/Button/ButtonBase.d.cts +52 -0
- package/dist/components/client/Button/ButtonBase.d.ts +53 -0
- package/dist/components/client/Button/ButtonBase.js +116 -0
- package/dist/components/client/{buttonConstants.cjs → Button/buttonConstants.cjs} +1 -1
- package/dist/components/client/Button/buttonConstants.d.cts +7 -0
- package/dist/components/client/Button/buttonConstants.d.ts +8 -0
- package/dist/components/client/{buttonConstants.js → Button/buttonConstants.js} +1 -1
- package/dist/components/client/Button/index.cjs +10 -0
- package/dist/components/client/Button/index.d.cts +4 -0
- package/dist/components/client/Button/index.d.ts +5 -0
- package/dist/components/client/Button/index.js +5 -0
- package/dist/components/client/IconButton/IconButton.cjs +104 -0
- package/dist/components/client/IconButton/IconButton.d.cts +17 -0
- package/dist/components/client/IconButton/IconButton.d.ts +18 -0
- package/dist/components/client/IconButton/IconButton.js +102 -0
- package/dist/components/client/IconButton/IconButtonBase.cjs +68 -0
- package/dist/components/client/IconButton/IconButtonBase.d.cts +45 -0
- package/dist/components/client/IconButton/IconButtonBase.d.ts +46 -0
- package/dist/components/client/IconButton/IconButtonBase.js +65 -0
- package/dist/components/client/IconButton/index.cjs +8 -0
- package/dist/components/client/IconButton/index.d.cts +4 -0
- package/dist/components/client/IconButton/index.d.ts +5 -0
- package/dist/components/client/IconButton/index.js +5 -0
- package/dist/components/client/Pressable.cjs +3 -1
- package/dist/components/client/Pressable.js +3 -1
- package/dist/components/client/SpringMotionConfig.cjs +10 -13
- package/dist/components/client/SpringMotionConfig.js +10 -13
- package/dist/components/client/Switch/Switch.cjs +119 -0
- package/dist/components/client/{Switch.d.cts → Switch/Switch.d.cts} +4 -16
- package/dist/components/client/{Switch.d.ts → Switch/Switch.d.ts} +4 -16
- package/dist/components/client/Switch/Switch.js +115 -0
- package/dist/components/client/Switch/SwitchBase.cjs +129 -0
- package/dist/components/client/Switch/SwitchBase.d.cts +29 -0
- package/dist/components/client/Switch/SwitchBase.d.ts +30 -0
- package/dist/components/client/Switch/SwitchBase.js +126 -0
- package/dist/components/client/Switch/index.cjs +5 -0
- package/dist/components/client/Switch/index.d.cts +3 -0
- package/dist/components/client/Switch/index.d.ts +4 -0
- package/dist/components/client/Switch/index.js +4 -0
- package/dist/components/client/Switch/switchStyles.cjs +17 -0
- package/dist/components/client/Switch/switchStyles.d.cts +9 -0
- package/dist/components/client/Switch/switchStyles.d.ts +10 -0
- package/dist/components/client/Switch/switchStyles.js +16 -0
- package/dist/components/client/Switch/types.cjs +2 -0
- package/dist/components/client/Switch/types.d.cts +33 -0
- package/dist/components/client/Switch/types.d.ts +34 -0
- package/dist/components/client/Switch/types.js +2 -0
- package/dist/components/client/Toast/Toast.cjs +2 -2
- 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/Toast.js +1 -1
- package/dist/components/client/index.cjs +6 -6
- package/dist/components/client/index.d.cts +3 -3
- package/dist/components/client/index.d.ts +3 -3
- package/dist/components/client/index.js +3 -3
- package/dist/components/experimental/client/index.cjs +0 -6
- package/dist/components/experimental/client/index.d.cts +1 -3
- package/dist/components/experimental/client/index.d.ts +1 -3
- package/dist/components/experimental/client/index.js +1 -3
- package/dist/components/experimental/index.cjs +0 -5
- package/dist/components/experimental/index.d.cts +1 -3
- package/dist/components/experimental/index.d.ts +1 -3
- package/dist/components/experimental/index.js +1 -3
- package/dist/components/index.cjs +6 -6
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +3 -3
- package/dist/css-animation/Button/Button.cjs +85 -0
- package/dist/css-animation/Button/Button.d.cts +13 -0
- package/dist/css-animation/Button/Button.d.ts +14 -0
- package/dist/css-animation/Button/Button.js +82 -0
- package/dist/css-animation/Button/index.cjs +5 -0
- package/dist/css-animation/Button/index.d.cts +4 -0
- package/dist/css-animation/Button/index.d.ts +5 -0
- package/dist/css-animation/Button/index.js +4 -0
- package/dist/css-animation/IconButton/IconButton.cjs +55 -0
- package/dist/css-animation/IconButton/IconButton.d.cts +13 -0
- package/dist/css-animation/IconButton/IconButton.d.ts +14 -0
- package/dist/css-animation/IconButton/IconButton.js +53 -0
- package/dist/css-animation/IconButton/index.cjs +5 -0
- package/dist/css-animation/IconButton/index.d.cts +4 -0
- package/dist/css-animation/IconButton/index.d.ts +5 -0
- package/dist/css-animation/IconButton/index.js +4 -0
- package/dist/css-animation/Switch/Switch.cjs +44 -0
- package/dist/css-animation/Switch/Switch.d.cts +22 -0
- package/dist/css-animation/Switch/Switch.d.ts +23 -0
- package/dist/css-animation/Switch/Switch.js +41 -0
- package/dist/css-animation/Switch/SwitchStaticHandle.cjs +56 -0
- package/dist/css-animation/Switch/SwitchStaticHandle.d.cts +31 -0
- package/dist/css-animation/Switch/SwitchStaticHandle.d.ts +32 -0
- package/dist/css-animation/Switch/SwitchStaticHandle.js +54 -0
- package/dist/css-animation/Switch/index.cjs +5 -0
- package/dist/css-animation/Switch/index.d.cts +3 -0
- package/dist/css-animation/Switch/index.d.ts +4 -0
- package/dist/css-animation/Switch/index.js +4 -0
- package/dist/css-animation/index.cjs +9 -0
- package/dist/css-animation/index.d.cts +7 -0
- package/dist/css-animation/index.d.ts +8 -0
- package/dist/css-animation/index.js +6 -0
- package/dist/hooks/usePrefersReducedMotion.cjs +24 -0
- package/dist/hooks/usePrefersReducedMotion.d.cts +5 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +5 -0
- package/dist/hooks/usePrefersReducedMotion.js +22 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/styles/styler.d.cts +4 -4
- package/dist/styles/styler.d.ts +4 -4
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
- package/dist/uds/generated/componentData.cjs +372 -381
- package/dist/uds/generated/componentData.js +372 -381
- package/dist/uds/generated/tailwindPurge.cjs +8 -21
- package/dist/uds/generated/tailwindPurge.js +8 -21
- package/dist/uds/package.cjs +12 -2
- package/dist/uds/package.js +12 -2
- package/generated/componentData.json +572 -603
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +13 -3
- package/dist/components/client/Button.cjs +0 -326
- package/dist/components/client/Button.d.cts +0 -86
- package/dist/components/client/Button.d.ts +0 -87
- package/dist/components/client/Button.js +0 -321
- package/dist/components/client/IconButton.cjs +0 -161
- package/dist/components/client/IconButton.d.cts +0 -46
- package/dist/components/client/IconButton.d.ts +0 -47
- package/dist/components/client/IconButton.js +0 -159
- package/dist/components/client/Switch.cjs +0 -225
- package/dist/components/client/Switch.js +0 -222
- package/dist/components/client/buttonConstants.d.cts +0 -7
- package/dist/components/client/buttonConstants.d.ts +0 -8
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.cjs +0 -14
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.cts +0 -8
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.ts +0 -9
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.js +0 -11
- package/dist/components/experimental/client/SwitchV2.cjs +0 -190
- package/dist/components/experimental/client/SwitchV2.d.cts +0 -46
- package/dist/components/experimental/client/SwitchV2.d.ts +0 -47
- package/dist/components/experimental/client/SwitchV2.js +0 -185
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
5
|
+
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
6
|
+
const require_utils_createSlot = require("../../../utils/createSlot.cjs");
|
|
7
|
+
const require_generateDefaultClassName = require("../../../automated-config/dist/utils/generateDefaultClassName.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
//#region src/components/client/IconButton/IconButtonBase.tsx
|
|
10
|
+
const defaultSizeRootClass = require_generateDefaultClassName.generateDefaultClassName("iconbutton", "size", "root");
|
|
11
|
+
const defaultSizeIconClass = require_generateDefaultClassName.generateDefaultClassName("iconbutton", "size", "icon");
|
|
12
|
+
const defaultVariantRootClass = require_generateDefaultClassName.generateDefaultClassName("button", "variant", "root");
|
|
13
|
+
const defaultVariantIconClass = require_generateDefaultClassName.generateDefaultClassName("button", "variant", "icon");
|
|
14
|
+
const IconButtonBase = (0, react.forwardRef)(function IconButtonBase({ variant, size, iconVariant, loading, disableEffects, name, asChild = false, slotProps, type = "button", htmlName, className, children, renderIconContent, renderRoot, ...rest }, forwardedRef) {
|
|
15
|
+
const { className: iconSlotClassName, ...iconSlotProps } = slotProps?.icon ?? {};
|
|
16
|
+
const Slot = (0, react.useMemo)(() => require_utils_createSlot.createSlot(), []);
|
|
17
|
+
const rootSizeClass = (0, react.useMemo)(() => size ? require_styles_styler.getStyles({ iconbuttonSizeRoot: size }) : defaultSizeRootClass, [size]);
|
|
18
|
+
const rootVariantClass = (0, react.useMemo)(() => variant ? require_styles_styler.getStyles({ buttonVariantRoot: variant }) : defaultVariantRootClass, [variant]);
|
|
19
|
+
const iconSizeClass = (0, react.useMemo)(() => size ? require_styles_styler.getStyles({ iconbuttonSizeIcon: size }) : defaultSizeIconClass, [size]);
|
|
20
|
+
const iconVariantClass = (0, react.useMemo)(() => variant ? require_styles_styler.getStyles({ buttonVariantIcon: variant }) : defaultVariantIconClass, [variant]);
|
|
21
|
+
const styles = (0, react.useMemo)(() => ({
|
|
22
|
+
root: require_styles_styler.cx("uds-ring", "uds-hit-target", "inline-flex overflow-hidden justify-center items-center", "[transform-origin:center]", "[backface-visibility:hidden]", "[transition-property:color,background-color,border-color,box-shadow,text-decoration-color,fill,stroke]", "[transition-timing-function:cubic-bezier(0,0,0.2,1)]", "[transition-duration:220ms]", rootSizeClass, rootVariantClass, rest?.disabled && "cursor-not-allowed", loading && "uds-button-loading", disableEffects && "uds-button-without-effects", className),
|
|
23
|
+
icon: require_styles_styler.getStyles({ className: require_styles_styler.cx(iconSizeClass, iconVariantClass) }),
|
|
24
|
+
loadingIcon: require_styles_styler.getStyles({ className: require_styles_styler.cx([
|
|
25
|
+
"animate-spin",
|
|
26
|
+
iconSizeClass,
|
|
27
|
+
iconVariantClass
|
|
28
|
+
]) })
|
|
29
|
+
}), [
|
|
30
|
+
className,
|
|
31
|
+
disableEffects,
|
|
32
|
+
iconSizeClass,
|
|
33
|
+
iconVariantClass,
|
|
34
|
+
loading,
|
|
35
|
+
rest?.disabled,
|
|
36
|
+
rootSizeClass,
|
|
37
|
+
rootVariantClass
|
|
38
|
+
]);
|
|
39
|
+
return renderRoot({
|
|
40
|
+
asChild,
|
|
41
|
+
Slot,
|
|
42
|
+
children,
|
|
43
|
+
buttonRef: forwardedRef,
|
|
44
|
+
type,
|
|
45
|
+
htmlName,
|
|
46
|
+
rootClassName: styles.root,
|
|
47
|
+
rest,
|
|
48
|
+
iconContent: renderIconContent({
|
|
49
|
+
asChild,
|
|
50
|
+
loading,
|
|
51
|
+
name,
|
|
52
|
+
iconVariant,
|
|
53
|
+
children,
|
|
54
|
+
iconClassName: styles.icon,
|
|
55
|
+
loadingIconClassName: styles.loadingIcon,
|
|
56
|
+
iconSlotClassName,
|
|
57
|
+
iconSlotProps
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
IconButtonBase.displayName = "IconButtonBase";
|
|
62
|
+
function renderIconButtonAsChild(children, content) {
|
|
63
|
+
const childProps = children.props;
|
|
64
|
+
return (0, react.cloneElement)(children, childProps, content);
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
exports.IconButtonBase = IconButtonBase;
|
|
68
|
+
exports.renderIconButtonAsChild = renderIconButtonAsChild;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconPropsWithSVGProps, UniversalIconButtonProps } from "../../../tokens/types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { ForwardRefExoticComponent } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/client/IconButton/IconButtonBase.d.ts
|
|
7
|
+
type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
|
|
8
|
+
type DataAttributes = {
|
|
9
|
+
[name: `data-${string}`]: string;
|
|
10
|
+
};
|
|
11
|
+
interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
|
|
12
|
+
slotProps?: {
|
|
13
|
+
icon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
type IconButtonRenderArgs = {
|
|
17
|
+
asChild: boolean;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
name?: IconButtonProps['name'];
|
|
20
|
+
iconVariant: IconButtonProps['iconVariant'];
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
iconClassName: string;
|
|
23
|
+
loadingIconClassName: string;
|
|
24
|
+
iconSlotClassName?: string;
|
|
25
|
+
iconSlotProps: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
26
|
+
};
|
|
27
|
+
type IconButtonRootRenderArgs = {
|
|
28
|
+
asChild: boolean;
|
|
29
|
+
Slot: ForwardRefExoticComponent<HtmlButtonProps>;
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
buttonRef: React.ForwardedRef<HTMLButtonElement>;
|
|
32
|
+
type: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
33
|
+
htmlName?: string;
|
|
34
|
+
rootClassName: string;
|
|
35
|
+
rest: Record<string, unknown>;
|
|
36
|
+
iconContent: React.ReactNode;
|
|
37
|
+
};
|
|
38
|
+
interface IconButtonBaseProps extends IconButtonProps {
|
|
39
|
+
renderIconContent: (args: IconButtonRenderArgs) => React.ReactNode;
|
|
40
|
+
renderRoot: (args: IconButtonRootRenderArgs) => React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const IconButtonBase: ForwardRefExoticComponent<IconButtonBaseProps & _$react.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
declare function renderIconButtonAsChild(children: React.ReactNode, content: React.ReactNode): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { IconButtonBase, type IconButtonProps, type IconButtonRootRenderArgs, renderIconButtonAsChild };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconPropsWithSVGProps, UniversalIconButtonProps } from "../../../tokens/types.js";
|
|
4
|
+
import * as _$react from "react";
|
|
5
|
+
import { ForwardRefExoticComponent } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/IconButton/IconButtonBase.d.ts
|
|
8
|
+
type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[name: `data-${string}`]: string;
|
|
11
|
+
};
|
|
12
|
+
interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
|
|
13
|
+
slotProps?: {
|
|
14
|
+
icon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
type IconButtonRenderArgs = {
|
|
18
|
+
asChild: boolean;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
name?: IconButtonProps['name'];
|
|
21
|
+
iconVariant: IconButtonProps['iconVariant'];
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
iconClassName: string;
|
|
24
|
+
loadingIconClassName: string;
|
|
25
|
+
iconSlotClassName?: string;
|
|
26
|
+
iconSlotProps: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
27
|
+
};
|
|
28
|
+
type IconButtonRootRenderArgs = {
|
|
29
|
+
asChild: boolean;
|
|
30
|
+
Slot: ForwardRefExoticComponent<HtmlButtonProps>;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
buttonRef: React.ForwardedRef<HTMLButtonElement>;
|
|
33
|
+
type: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
34
|
+
htmlName?: string;
|
|
35
|
+
rootClassName: string;
|
|
36
|
+
rest: Record<string, unknown>;
|
|
37
|
+
iconContent: React.ReactNode;
|
|
38
|
+
};
|
|
39
|
+
interface IconButtonBaseProps extends IconButtonProps {
|
|
40
|
+
renderIconContent: (args: IconButtonRenderArgs) => React.ReactNode;
|
|
41
|
+
renderRoot: (args: IconButtonRootRenderArgs) => React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
declare const IconButtonBase: ForwardRefExoticComponent<IconButtonBaseProps & _$react.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
declare function renderIconButtonAsChild(children: React.ReactNode, content: React.ReactNode): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { IconButtonBase, type IconButtonProps, type IconButtonRootRenderArgs, renderIconButtonAsChild };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
+
import { createSlot } from "../../../utils/createSlot.js";
|
|
5
|
+
import { generateDefaultClassName } from "../../../automated-config/dist/utils/generateDefaultClassName.js";
|
|
6
|
+
import { cloneElement, forwardRef, useMemo } from "react";
|
|
7
|
+
//#region src/components/client/IconButton/IconButtonBase.tsx
|
|
8
|
+
const defaultSizeRootClass = generateDefaultClassName("iconbutton", "size", "root");
|
|
9
|
+
const defaultSizeIconClass = generateDefaultClassName("iconbutton", "size", "icon");
|
|
10
|
+
const defaultVariantRootClass = generateDefaultClassName("button", "variant", "root");
|
|
11
|
+
const defaultVariantIconClass = generateDefaultClassName("button", "variant", "icon");
|
|
12
|
+
const IconButtonBase = forwardRef(function IconButtonBase({ variant, size, iconVariant, loading, disableEffects, name, asChild = false, slotProps, type = "button", htmlName, className, children, renderIconContent, renderRoot, ...rest }, forwardedRef) {
|
|
13
|
+
const { className: iconSlotClassName, ...iconSlotProps } = slotProps?.icon ?? {};
|
|
14
|
+
const Slot = useMemo(() => createSlot(), []);
|
|
15
|
+
const rootSizeClass = useMemo(() => size ? getStyles({ iconbuttonSizeRoot: size }) : defaultSizeRootClass, [size]);
|
|
16
|
+
const rootVariantClass = useMemo(() => variant ? getStyles({ buttonVariantRoot: variant }) : defaultVariantRootClass, [variant]);
|
|
17
|
+
const iconSizeClass = useMemo(() => size ? getStyles({ iconbuttonSizeIcon: size }) : defaultSizeIconClass, [size]);
|
|
18
|
+
const iconVariantClass = useMemo(() => variant ? getStyles({ buttonVariantIcon: variant }) : defaultVariantIconClass, [variant]);
|
|
19
|
+
const styles = useMemo(() => ({
|
|
20
|
+
root: cx("uds-ring", "uds-hit-target", "inline-flex overflow-hidden justify-center items-center", "[transform-origin:center]", "[backface-visibility:hidden]", "[transition-property:color,background-color,border-color,box-shadow,text-decoration-color,fill,stroke]", "[transition-timing-function:cubic-bezier(0,0,0.2,1)]", "[transition-duration:220ms]", rootSizeClass, rootVariantClass, rest?.disabled && "cursor-not-allowed", loading && "uds-button-loading", disableEffects && "uds-button-without-effects", className),
|
|
21
|
+
icon: getStyles({ className: cx(iconSizeClass, iconVariantClass) }),
|
|
22
|
+
loadingIcon: getStyles({ className: cx([
|
|
23
|
+
"animate-spin",
|
|
24
|
+
iconSizeClass,
|
|
25
|
+
iconVariantClass
|
|
26
|
+
]) })
|
|
27
|
+
}), [
|
|
28
|
+
className,
|
|
29
|
+
disableEffects,
|
|
30
|
+
iconSizeClass,
|
|
31
|
+
iconVariantClass,
|
|
32
|
+
loading,
|
|
33
|
+
rest?.disabled,
|
|
34
|
+
rootSizeClass,
|
|
35
|
+
rootVariantClass
|
|
36
|
+
]);
|
|
37
|
+
return renderRoot({
|
|
38
|
+
asChild,
|
|
39
|
+
Slot,
|
|
40
|
+
children,
|
|
41
|
+
buttonRef: forwardedRef,
|
|
42
|
+
type,
|
|
43
|
+
htmlName,
|
|
44
|
+
rootClassName: styles.root,
|
|
45
|
+
rest,
|
|
46
|
+
iconContent: renderIconContent({
|
|
47
|
+
asChild,
|
|
48
|
+
loading,
|
|
49
|
+
name,
|
|
50
|
+
iconVariant,
|
|
51
|
+
children,
|
|
52
|
+
iconClassName: styles.icon,
|
|
53
|
+
loadingIconClassName: styles.loadingIcon,
|
|
54
|
+
iconSlotClassName,
|
|
55
|
+
iconSlotProps
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
IconButtonBase.displayName = "IconButtonBase";
|
|
60
|
+
function renderIconButtonAsChild(children, content) {
|
|
61
|
+
const childProps = children.props;
|
|
62
|
+
return cloneElement(children, childProps, content);
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { IconButtonBase, renderIconButtonAsChild };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_components_client_IconButton_IconButtonBase = require("./IconButtonBase.cjs");
|
|
5
|
+
const require_components_client_IconButton_IconButton = require("./IconButton.cjs");
|
|
6
|
+
exports.IconButton = require_components_client_IconButton_IconButton.IconButton;
|
|
7
|
+
exports.IconButtonBase = require_components_client_IconButton_IconButtonBase.IconButtonBase;
|
|
8
|
+
exports.renderIconButtonAsChild = require_components_client_IconButton_IconButtonBase.renderIconButtonAsChild;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconButtonBase, IconButtonRootRenderArgs, renderIconButtonAsChild } from "./IconButtonBase.cjs";
|
|
3
|
+
import { IconButton, IconButtonProps } from "./IconButton.cjs";
|
|
4
|
+
export { IconButton, IconButtonBase, type IconButtonProps, type IconButtonRootRenderArgs, renderIconButtonAsChild };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconButtonBase, IconButtonRootRenderArgs, renderIconButtonAsChild } from "./IconButtonBase.js";
|
|
4
|
+
import { IconButton, IconButtonProps } from "./IconButton.js";
|
|
5
|
+
export { IconButton, IconButtonBase, type IconButtonProps, type IconButtonRootRenderArgs, renderIconButtonAsChild };
|
|
@@ -43,7 +43,7 @@ const Slot = require_utils_createSlot.createSlot();
|
|
|
43
43
|
* @related [Button](https://uds.build/docs/components/button), [IconButton](https://uds.build/docs/components/icon-button)
|
|
44
44
|
*
|
|
45
45
|
*/
|
|
46
|
-
const Pressable = (0, react.forwardRef)(function Pressable({ className, asChild, onPress, onClick, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, flexBasis, display, overflow, overflowX, overflowY, position, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, dropShadow, insetShadow, ...props }, ref) {
|
|
46
|
+
const Pressable = (0, react.forwardRef)(function Pressable({ className, asChild, onPress, onClick, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, flexBasis, display, overflow, overflowX, overflowY, position, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, width, height, dropShadow, insetShadow, ...props }, ref) {
|
|
47
47
|
const handleClick = onPress || onClick ? (e) => {
|
|
48
48
|
onClick?.(e);
|
|
49
49
|
onPress?.();
|
|
@@ -98,6 +98,8 @@ const Pressable = (0, react.forwardRef)(function Pressable({ className, asChild,
|
|
|
98
98
|
offsetTop,
|
|
99
99
|
columnGap,
|
|
100
100
|
rowGap,
|
|
101
|
+
width,
|
|
102
|
+
height,
|
|
101
103
|
dropShadow,
|
|
102
104
|
insetShadow,
|
|
103
105
|
className
|
|
@@ -41,7 +41,7 @@ const Slot = createSlot();
|
|
|
41
41
|
* @related [Button](https://uds.build/docs/components/button), [IconButton](https://uds.build/docs/components/icon-button)
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
|
-
const Pressable = forwardRef(function Pressable({ className, asChild, onPress, onClick, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, flexBasis, display, overflow, overflowX, overflowY, position, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, dropShadow, insetShadow, ...props }, ref) {
|
|
44
|
+
const Pressable = forwardRef(function Pressable({ className, asChild, onPress, onClick, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, flexBasis, display, overflow, overflowX, overflowY, position, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, width, height, dropShadow, insetShadow, ...props }, ref) {
|
|
45
45
|
const handleClick = onPress || onClick ? (e) => {
|
|
46
46
|
onClick?.(e);
|
|
47
47
|
onPress?.();
|
|
@@ -96,6 +96,8 @@ const Pressable = forwardRef(function Pressable({ className, asChild, onPress, o
|
|
|
96
96
|
offsetTop,
|
|
97
97
|
columnGap,
|
|
98
98
|
rowGap,
|
|
99
|
+
width,
|
|
100
|
+
height,
|
|
99
101
|
dropShadow,
|
|
100
102
|
insetShadow,
|
|
101
103
|
className
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
5
5
|
const require_index = require("../../css-tokens/dist/index.cjs");
|
|
6
6
|
const require_index$1 = require("../../motion-tokens/dist/index.cjs");
|
|
7
|
-
const require_components_experimental_client_AvoidMotionLibraryProvider = require("../experimental/client/AvoidMotionLibraryProvider.cjs");
|
|
8
7
|
let react = require("react");
|
|
9
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
9
|
let motion_react = require("motion/react");
|
|
@@ -72,22 +71,20 @@ function SpringMotionConfig({ children, reducedMotion = "user", loadFeatures = d
|
|
|
72
71
|
layoutDampingVar,
|
|
73
72
|
layoutStiffnessVar
|
|
74
73
|
]);
|
|
75
|
-
const transition = (0, react.useMemo)(() => ({
|
|
76
|
-
type: "spring",
|
|
77
|
-
mass: 1,
|
|
78
|
-
...layoutConfig,
|
|
79
|
-
layout: layoutConfig,
|
|
80
|
-
opacity: colorConfig,
|
|
81
|
-
color: colorConfig,
|
|
82
|
-
borderColor: colorConfig,
|
|
83
|
-
backgroundColor: colorConfig
|
|
84
|
-
}), [colorConfig, layoutConfig]);
|
|
85
|
-
if (require_components_experimental_client_AvoidMotionLibraryProvider.useAvoidMotionLibrary()) return children;
|
|
86
74
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.LazyMotion, {
|
|
87
75
|
features: loadFeatures,
|
|
88
76
|
strict: true,
|
|
89
77
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.MotionConfig, {
|
|
90
|
-
transition,
|
|
78
|
+
transition: (0, react.useMemo)(() => ({
|
|
79
|
+
type: "spring",
|
|
80
|
+
mass: 1,
|
|
81
|
+
...layoutConfig,
|
|
82
|
+
layout: layoutConfig,
|
|
83
|
+
opacity: colorConfig,
|
|
84
|
+
color: colorConfig,
|
|
85
|
+
borderColor: colorConfig,
|
|
86
|
+
backgroundColor: colorConfig
|
|
87
|
+
}), [colorConfig, layoutConfig]),
|
|
91
88
|
reducedMotion,
|
|
92
89
|
children
|
|
93
90
|
})
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { getMotionVar } from "../../css-tokens/dist/index.js";
|
|
4
4
|
import { SPRING_MOTION_DEFAULTS, motion } from "../../motion-tokens/dist/index.js";
|
|
5
|
-
import { useAvoidMotionLibrary } from "../experimental/client/AvoidMotionLibraryProvider.js";
|
|
6
5
|
import { useEffect, useMemo, useState } from "react";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
import { LazyMotion, MotionConfig } from "motion/react";
|
|
@@ -70,22 +69,20 @@ function SpringMotionConfig({ children, reducedMotion = "user", loadFeatures = d
|
|
|
70
69
|
layoutDampingVar,
|
|
71
70
|
layoutStiffnessVar
|
|
72
71
|
]);
|
|
73
|
-
const transition = useMemo(() => ({
|
|
74
|
-
type: "spring",
|
|
75
|
-
mass: 1,
|
|
76
|
-
...layoutConfig,
|
|
77
|
-
layout: layoutConfig,
|
|
78
|
-
opacity: colorConfig,
|
|
79
|
-
color: colorConfig,
|
|
80
|
-
borderColor: colorConfig,
|
|
81
|
-
backgroundColor: colorConfig
|
|
82
|
-
}), [colorConfig, layoutConfig]);
|
|
83
|
-
if (useAvoidMotionLibrary()) return children;
|
|
84
72
|
return /* @__PURE__ */ jsx(LazyMotion, {
|
|
85
73
|
features: loadFeatures,
|
|
86
74
|
strict: true,
|
|
87
75
|
children: /* @__PURE__ */ jsx(MotionConfig, {
|
|
88
|
-
transition
|
|
76
|
+
transition: useMemo(() => ({
|
|
77
|
+
type: "spring",
|
|
78
|
+
mass: 1,
|
|
79
|
+
...layoutConfig,
|
|
80
|
+
layout: layoutConfig,
|
|
81
|
+
opacity: colorConfig,
|
|
82
|
+
color: colorConfig,
|
|
83
|
+
borderColor: colorConfig,
|
|
84
|
+
backgroundColor: colorConfig
|
|
85
|
+
}), [colorConfig, layoutConfig]),
|
|
89
86
|
reducedMotion,
|
|
90
87
|
children
|
|
91
88
|
})
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
5
|
+
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
6
|
+
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
7
|
+
const require_components_Box = require("../../Box.cjs");
|
|
8
|
+
const require_components_client_SpringMotionConfig = require("../SpringMotionConfig.cjs");
|
|
9
|
+
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
10
|
+
const require_components_client_Switch_SwitchBase = require("./SwitchBase.cjs");
|
|
11
|
+
let react = require("react");
|
|
12
|
+
react = require_runtime.__toESM(react);
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
let motion_react_m = require("motion/react-m");
|
|
15
|
+
motion_react_m = require_runtime.__toESM(motion_react_m);
|
|
16
|
+
//#region src/components/client/Switch/Switch.tsx
|
|
17
|
+
const MotionBox = motion_react_m.create(require_components_Box.Box);
|
|
18
|
+
MotionBox.displayName = "SwitchMotionBox";
|
|
19
|
+
const toggleTransition = {
|
|
20
|
+
layoutVariant: "bouncy",
|
|
21
|
+
layoutSpeed: "4"
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* **⚙️️ An switch.
|
|
25
|
+
*
|
|
26
|
+
* @componentType Client component
|
|
27
|
+
*
|
|
28
|
+
* @description
|
|
29
|
+
* A switch (also called a toggle) is a binary on/off input control. It is clickable or touchable on mobile devices allowing users to pick between two clearly opposite choices.
|
|
30
|
+
*
|
|
31
|
+
* @see
|
|
32
|
+
* Check out the {@link https://uds.build/docs/components/switch Switch Docs} for more info
|
|
33
|
+
*
|
|
34
|
+
* @usage
|
|
35
|
+
* - Forms: switch
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* 'use client';
|
|
40
|
+
* import { Switch } from "@yahoo/uds";
|
|
41
|
+
*
|
|
42
|
+
* <Switch label="Name" required />
|
|
43
|
+
*```
|
|
44
|
+
*
|
|
45
|
+
* @related [Checkbox](https://uds.build/docs/components/checkbox).
|
|
46
|
+
**/
|
|
47
|
+
const Switch = (0, react.forwardRef)(function Switch({ reduceMotion: forceReduceMotion, ...props }, parentRef) {
|
|
48
|
+
const prefersReducedMotion = require_hooks_usePrefersReducedMotion.usePrefersReducedMotion();
|
|
49
|
+
const reduceMotion = forceReduceMotion ? "always" : "user";
|
|
50
|
+
const cssAnimationDuration = prefersReducedMotion || forceReduceMotion ? "duration-0" : "duration-120";
|
|
51
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Switch_SwitchBase.SwitchBase, {
|
|
52
|
+
...props,
|
|
53
|
+
ref: parentRef,
|
|
54
|
+
cssAnimationDuration,
|
|
55
|
+
enableHoverTracking: true,
|
|
56
|
+
renderHandle: ({ size, isOn, isOnX, showHoverEffect, disabled, onIcon, offIcon, cssAnimationDuration, handleSlotProps }) => {
|
|
57
|
+
const motionInitialAndAnimate = {
|
|
58
|
+
initial: {
|
|
59
|
+
scale: 1,
|
|
60
|
+
x: isOn ? isOnX : 0
|
|
61
|
+
},
|
|
62
|
+
animate: {
|
|
63
|
+
scale: showHoverEffect ? 1.05 : 1,
|
|
64
|
+
x: isOn ? isOnX : 0
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const classNames = {
|
|
68
|
+
handle: require_styles_styler.getStyles({
|
|
69
|
+
switchSizeHandle: size,
|
|
70
|
+
className: require_styles_styler.cx("relative", "pointer-events-none", "uds-border-radius-full", "overflow-hidden")
|
|
71
|
+
}),
|
|
72
|
+
handleCircle: require_styles_styler.getStyles({
|
|
73
|
+
switchVariantActiveHandle: isOn ? "on" : "off",
|
|
74
|
+
switchVariantHandle: "default",
|
|
75
|
+
className: require_styles_styler.cx("absolute", "top-0", "left-0", "right-0", "bottom-0", "opacity-95", !disabled && "group-hover:opacity-100", cssAnimationDuration, "transition-[background-color,box-shadow,opacity]")
|
|
76
|
+
}),
|
|
77
|
+
handleIcon: require_styles_styler.getStyles({
|
|
78
|
+
switchSizeHandleIcon: size,
|
|
79
|
+
switchVariantHandleIcon: "default",
|
|
80
|
+
switchVariantActiveHandleIcon: isOn ? "on" : "off",
|
|
81
|
+
className: require_styles_styler.cx("absolute", "opacity-0", "top-1/2", "left-1/2", "transform", "translate-x-[-50%]", "translate-y-[-50%]", cssAnimationDuration, "transition-opacity")
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_SpringMotionConfig.SpringMotionConfig, {
|
|
85
|
+
reducedMotion: reduceMotion,
|
|
86
|
+
...toggleTransition,
|
|
87
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionBox, {
|
|
88
|
+
className: classNames.handle,
|
|
89
|
+
...motionInitialAndAnimate,
|
|
90
|
+
...handleSlotProps,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, { className: classNames.handleCircle }),
|
|
93
|
+
onIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
94
|
+
icon: onIcon,
|
|
95
|
+
iconProps: {
|
|
96
|
+
variant: "fill",
|
|
97
|
+
size: "sm"
|
|
98
|
+
},
|
|
99
|
+
"data-testid": "on-icon",
|
|
100
|
+
className: require_styles_styler.cx(classNames.handleIcon, isOn ? "opacity-100" : "opacity-0")
|
|
101
|
+
}),
|
|
102
|
+
offIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
103
|
+
icon: offIcon,
|
|
104
|
+
iconProps: {
|
|
105
|
+
variant: "fill",
|
|
106
|
+
size: "sm"
|
|
107
|
+
},
|
|
108
|
+
"data-testid": "off-icon",
|
|
109
|
+
className: require_styles_styler.cx(classNames.handleIcon, !isOn ? "opacity-100" : "opacity-0")
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
Switch.displayName = "Switch";
|
|
118
|
+
//#endregion
|
|
119
|
+
exports.Switch = Switch;
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { SwitchProps as SwitchProps$1 } from "./types.cjs";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
|
-
//#region src/components/client/Switch.d.ts
|
|
6
|
-
type
|
|
7
|
-
type DataAttributes = {
|
|
8
|
-
[name: `data-${string}`]: string;
|
|
9
|
-
};
|
|
10
|
-
interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
|
11
|
-
/** Props to be passed into various slots within the component. */
|
|
12
|
-
slotProps?: {
|
|
13
|
-
root?: DataAttributes;
|
|
14
|
-
switch?: DataAttributes;
|
|
15
|
-
handle?: DataAttributes;
|
|
16
|
-
label?: DataAttributes;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
5
|
+
//#region src/components/client/Switch/Switch.d.ts
|
|
6
|
+
type SwitchProps = SwitchProps$1;
|
|
19
7
|
/**
|
|
20
8
|
* **⚙️️ An switch.
|
|
21
9
|
*
|
|
@@ -40,6 +28,6 @@ interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
|
|
40
28
|
*
|
|
41
29
|
* @related [Checkbox](https://uds.build/docs/components/checkbox).
|
|
42
30
|
**/
|
|
43
|
-
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
31
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
44
32
|
//#endregion
|
|
45
33
|
export { Switch, type SwitchProps };
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
3
|
+
import { SwitchProps as SwitchProps$1 } from "./types.js";
|
|
4
4
|
import React from "react";
|
|
5
5
|
|
|
6
|
-
//#region src/components/client/Switch.d.ts
|
|
7
|
-
type
|
|
8
|
-
type DataAttributes = {
|
|
9
|
-
[name: `data-${string}`]: string;
|
|
10
|
-
};
|
|
11
|
-
interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
|
12
|
-
/** Props to be passed into various slots within the component. */
|
|
13
|
-
slotProps?: {
|
|
14
|
-
root?: DataAttributes;
|
|
15
|
-
switch?: DataAttributes;
|
|
16
|
-
handle?: DataAttributes;
|
|
17
|
-
label?: DataAttributes;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
6
|
+
//#region src/components/client/Switch/Switch.d.ts
|
|
7
|
+
type SwitchProps = SwitchProps$1;
|
|
20
8
|
/**
|
|
21
9
|
* **⚙️️ An switch.
|
|
22
10
|
*
|
|
@@ -41,6 +29,6 @@ interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
|
|
41
29
|
*
|
|
42
30
|
* @related [Checkbox](https://uds.build/docs/components/checkbox).
|
|
43
31
|
**/
|
|
44
|
-
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
45
33
|
//#endregion
|
|
46
34
|
export { Switch, type SwitchProps };
|