@yahoo/uds 3.160.0 → 3.162.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/client/BottomSheet/BottomSheet.cjs +2 -2
- package/dist/components/client/BottomSheet/BottomSheet.js +2 -2
- package/dist/components/client/Button/Button.cjs +2 -1
- package/dist/components/client/Button/Button.js +3 -2
- package/dist/components/client/Checkbox/Checkbox.cjs +118 -0
- package/dist/components/client/{Checkbox.d.cts → Checkbox/Checkbox.d.cts} +5 -18
- package/dist/components/client/{Checkbox.d.ts → Checkbox/Checkbox.d.ts} +5 -18
- package/dist/components/client/Checkbox/Checkbox.js +113 -0
- package/dist/components/client/Checkbox/CheckboxBase.cjs +141 -0
- package/dist/components/client/Checkbox/CheckboxBase.d.cts +48 -0
- package/dist/components/client/Checkbox/CheckboxBase.d.ts +49 -0
- package/dist/components/client/Checkbox/CheckboxBase.js +138 -0
- package/dist/components/client/Checkbox/checkboxConstants.cjs +23 -0
- package/dist/components/client/Checkbox/checkboxConstants.d.cts +25 -0
- package/dist/components/client/Checkbox/checkboxConstants.d.ts +26 -0
- package/dist/components/client/Checkbox/checkboxConstants.js +17 -0
- package/dist/components/client/Checkbox/index.cjs +10 -0
- package/dist/components/client/Checkbox/index.d.cts +6 -0
- package/dist/components/client/Checkbox/index.d.ts +7 -0
- package/dist/components/client/Checkbox/index.js +6 -0
- package/dist/components/client/Checkbox/types.cjs +2 -0
- package/dist/components/client/Checkbox/types.d.cts +22 -0
- package/dist/components/client/Checkbox/types.d.ts +23 -0
- package/dist/components/client/Checkbox/types.js +2 -0
- package/dist/components/client/Chip/ChipBase.cjs +2 -2
- package/dist/components/client/Chip/ChipBase.js +2 -2
- package/dist/components/client/IconButton/IconButton.cjs +2 -1
- package/dist/components/client/IconButton/IconButton.js +3 -2
- package/dist/components/client/Input/Input.cjs +2 -2
- package/dist/components/client/Input/Input.js +2 -2
- 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/Modal/ManagedModal.cjs +2 -2
- package/dist/components/client/Modal/ManagedModal.js +2 -2
- package/dist/components/client/Modal/Modal.cjs +2 -2
- package/dist/components/client/Modal/Modal.js +2 -2
- package/dist/components/client/Popover/Popover.cjs +2 -2
- package/dist/components/client/Popover/Popover.js +2 -2
- 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 +69 -165
- package/dist/components/client/Radio/Radio.d.cts +4 -17
- package/dist/components/client/Radio/Radio.d.ts +4 -17
- package/dist/components/client/Radio/Radio.js +69 -165
- package/dist/components/client/Radio/RadioBase.cjs +133 -0
- package/dist/components/client/Radio/RadioBase.d.cts +45 -0
- package/dist/components/client/Radio/RadioBase.d.ts +46 -0
- package/dist/components/client/Radio/RadioBase.js +130 -0
- package/dist/components/client/Radio/radioConstants.cjs +14 -0
- package/dist/components/client/Radio/radioConstants.d.cts +8 -0
- package/dist/components/client/Radio/radioConstants.d.ts +9 -0
- package/dist/components/client/Radio/radioConstants.js +11 -0
- package/dist/components/client/Radio/types.cjs +2 -0
- package/dist/components/client/Radio/types.d.cts +20 -0
- package/dist/components/client/Radio/types.d.ts +21 -0
- package/dist/components/client/Radio/types.js +2 -0
- package/dist/components/client/Switch/Switch.cjs +1 -1
- package/dist/components/client/Switch/Switch.js +1 -1
- package/dist/components/client/Tabs/TabList.cjs +2 -2
- package/dist/components/client/Tabs/TabList.js +2 -2
- package/dist/components/client/Toast/Toast.cjs +2 -2
- package/dist/components/client/Toast/Toast.js +2 -2
- package/dist/components/client/index.cjs +2 -2
- package/dist/components/client/index.d.cts +1 -1
- package/dist/components/client/index.d.ts +1 -1
- package/dist/components/client/index.js +1 -1
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/css-animation/Checkbox/Checkbox.cjs +75 -0
- package/dist/css-animation/Checkbox/Checkbox.d.cts +22 -0
- package/dist/css-animation/Checkbox/Checkbox.d.ts +23 -0
- package/dist/css-animation/Checkbox/Checkbox.js +72 -0
- package/dist/css-animation/Checkbox/index.cjs +5 -0
- package/dist/css-animation/Checkbox/index.d.cts +3 -0
- package/dist/css-animation/Checkbox/index.d.ts +4 -0
- package/dist/css-animation/Checkbox/index.js +4 -0
- package/dist/css-animation/Radio/Radio.cjs +92 -0
- package/dist/css-animation/Radio/Radio.d.cts +22 -0
- package/dist/css-animation/Radio/Radio.d.ts +23 -0
- package/dist/css-animation/Radio/Radio.js +89 -0
- package/dist/css-animation/Radio/index.cjs +5 -0
- package/dist/css-animation/Radio/index.d.cts +3 -0
- package/dist/css-animation/Radio/index.d.ts +4 -0
- package/dist/css-animation/Radio/index.js +4 -0
- package/dist/css-animation/index.cjs +4 -0
- package/dist/css-animation/index.d.cts +3 -1
- package/dist/css-animation/index.d.ts +3 -1
- package/dist/css-animation/index.js +3 -1
- package/dist/hooks/usePrefersReducedMotion.cjs +27 -15
- package/dist/hooks/usePrefersReducedMotion.js +28 -16
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/styler.d.cts +45 -45
- package/dist/styles/styler.d.ts +45 -45
- package/dist/uds/generated/componentData.cjs +2540 -2490
- package/dist/uds/generated/componentData.js +2540 -2490
- package/dist/uds/generated/tailwindPurge.cjs +12 -12
- package/dist/uds/generated/tailwindPurge.js +12 -12
- package/generated/componentData.json +3258 -3169
- package/generated/tailwindPurge.ts +2 -2
- package/package.json +1 -1
- package/dist/components/client/Checkbox.cjs +0 -223
- package/dist/components/client/Checkbox.js +0 -218
|
@@ -5,6 +5,7 @@ require("../../../_virtual/_rolldown/runtime.cjs");
|
|
|
5
5
|
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
6
6
|
const require_components_Box = require("../../Box.cjs");
|
|
7
7
|
const require_components_Scrim = require("../../Scrim.cjs");
|
|
8
|
+
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
8
9
|
const require_utils_exposeAriakitScrollbarWidth = require("../../../utils/exposeAriakitScrollbarWidth.cjs");
|
|
9
10
|
const require_components_client_BottomSheet_BottomSheetHandle = require("./BottomSheetHandle.cjs");
|
|
10
11
|
const require_components_client_BottomSheet_BottomSheetInternalContext = require("./BottomSheetInternalContext.cjs");
|
|
@@ -19,7 +20,6 @@ const require_components_client_BottomSheet_useVirtualKeyboard = require("./useV
|
|
|
19
20
|
let react = require("react");
|
|
20
21
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
21
22
|
let _ariakit_react = require("@ariakit/react");
|
|
22
|
-
let motion_react = require("motion/react");
|
|
23
23
|
//#region src/components/client/BottomSheet/BottomSheet.tsx
|
|
24
24
|
/**
|
|
25
25
|
* Drag-to-dismiss distance threshold as a ratio of the lowest snap point's
|
|
@@ -43,7 +43,7 @@ function BottomSheet({ children, className: sheetClassName, controller: controll
|
|
|
43
43
|
const isOpen = dialogStore.useState().open;
|
|
44
44
|
const keyboardHeightPx = require_components_client_BottomSheet_useVirtualKeyboard.useVirtualKeyboard(isOpen);
|
|
45
45
|
const viewportHeightPx = require_components_client_BottomSheet_useViewportHeight.useViewportHeight();
|
|
46
|
-
const prefersReducedMotion =
|
|
46
|
+
const prefersReducedMotion = require_hooks_usePrefersReducedMotion.usePrefersReducedMotion();
|
|
47
47
|
const reducedMotion = forceReduceMotion || prefersReducedMotion;
|
|
48
48
|
const isDraggingRef = (0, react.useRef)(false);
|
|
49
49
|
const forceZeroMarginsRef = (0, react.useRef)(false);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
4
|
import { Box } from "../../Box.js";
|
|
5
5
|
import { Scrim } from "../../Scrim.js";
|
|
6
|
+
import { usePrefersReducedMotion } from "../../../hooks/usePrefersReducedMotion.js";
|
|
6
7
|
import { exposeAriakitScrollbarWidth } from "../../../utils/exposeAriakitScrollbarWidth.js";
|
|
7
8
|
import { BottomSheetHandle } from "./BottomSheetHandle.js";
|
|
8
9
|
import { BottomSheetInternalContext } from "./BottomSheetInternalContext.js";
|
|
@@ -17,7 +18,6 @@ import { useVirtualKeyboard } from "./useVirtualKeyboard.js";
|
|
|
17
18
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
18
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
import { Dialog, useDialogContext } from "@ariakit/react";
|
|
20
|
-
import { useReducedMotion } from "motion/react";
|
|
21
21
|
//#region src/components/client/BottomSheet/BottomSheet.tsx
|
|
22
22
|
/**
|
|
23
23
|
* Drag-to-dismiss distance threshold as a ratio of the lowest snap point's
|
|
@@ -41,7 +41,7 @@ function BottomSheet({ children, className: sheetClassName, controller: controll
|
|
|
41
41
|
const isOpen = dialogStore.useState().open;
|
|
42
42
|
const keyboardHeightPx = useVirtualKeyboard(isOpen);
|
|
43
43
|
const viewportHeightPx = useViewportHeight();
|
|
44
|
-
const prefersReducedMotion =
|
|
44
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
45
45
|
const reducedMotion = forceReduceMotion || prefersReducedMotion;
|
|
46
46
|
const isDraggingRef = useRef(false);
|
|
47
47
|
const forceZeroMarginsRef = useRef(false);
|
|
@@ -6,6 +6,7 @@ const require_index = require("../../../css-tokens/dist/index.cjs");
|
|
|
6
6
|
const require_utils_createSlot = require("../../../utils/createSlot.cjs");
|
|
7
7
|
const require_components_Icon = require("../../Icon.cjs");
|
|
8
8
|
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
9
|
+
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
9
10
|
const require_components_client_SpringMotionConfig = require("../SpringMotionConfig.cjs");
|
|
10
11
|
const require_components_client_Button_ButtonBase = require("./ButtonBase.cjs");
|
|
11
12
|
require("./buttonConstants.cjs");
|
|
@@ -70,7 +71,7 @@ const loadingMotionVariants = {
|
|
|
70
71
|
* @componentType Client component
|
|
71
72
|
*/
|
|
72
73
|
const Button = (0, react.forwardRef)(function Button(props, forwardedRef) {
|
|
73
|
-
const prefersReducedMotion =
|
|
74
|
+
const prefersReducedMotion = require_hooks_usePrefersReducedMotion.usePrefersReducedMotion();
|
|
74
75
|
const disableMotion = !!props.disableEffects || !!props.disabled;
|
|
75
76
|
const layoutVariant = prefersReducedMotion ? "smooth" : "subtle";
|
|
76
77
|
const endVariant = props.endIcon ? "icon" : "hide";
|
|
@@ -4,13 +4,14 @@ import { BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED,
|
|
|
4
4
|
import { createSlot } from "../../../utils/createSlot.js";
|
|
5
5
|
import { Icon } from "../../Icon.js";
|
|
6
6
|
import { IconSlot } from "../../IconSlot.js";
|
|
7
|
+
import { usePrefersReducedMotion } from "../../../hooks/usePrefersReducedMotion.js";
|
|
7
8
|
import { SpringMotionConfig } from "../SpringMotionConfig.js";
|
|
8
9
|
import { ButtonBase, renderButtonChildren } from "./ButtonBase.js";
|
|
9
10
|
import "./buttonConstants.js";
|
|
10
11
|
import { Progress } from "@yahoo/uds-icons";
|
|
11
12
|
import { forwardRef, isValidElement, useMemo } from "react";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { AnimatePresence, m
|
|
14
|
+
import { AnimatePresence, m } from "motion/react";
|
|
14
15
|
//#region src/components/client/Button/Button.tsx
|
|
15
16
|
const iconContainerMotionVariants = {
|
|
16
17
|
hide: {
|
|
@@ -67,7 +68,7 @@ const loadingMotionVariants = {
|
|
|
67
68
|
* @componentType Client component
|
|
68
69
|
*/
|
|
69
70
|
const Button = forwardRef(function Button(props, forwardedRef) {
|
|
70
|
-
const prefersReducedMotion =
|
|
71
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
71
72
|
const disableMotion = !!props.disableEffects || !!props.disabled;
|
|
72
73
|
const layoutVariant = prefersReducedMotion ? "smooth" : "subtle";
|
|
73
74
|
const endVariant = props.endIcon ? "icon" : "hide";
|
|
@@ -0,0 +1,118 @@
|
|
|
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_Icon = require("../../Icon.cjs");
|
|
7
|
+
const require_components_Box = require("../../Box.cjs");
|
|
8
|
+
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
9
|
+
const require_components_client_SpringMotionConfig = require("../SpringMotionConfig.cjs");
|
|
10
|
+
const require_components_client_Checkbox_checkboxConstants = require("./checkboxConstants.cjs");
|
|
11
|
+
const require_components_client_Checkbox_CheckboxBase = require("./CheckboxBase.cjs");
|
|
12
|
+
let react = require("react");
|
|
13
|
+
react = require_runtime.__toESM(react);
|
|
14
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
|
+
let motion_react = require("motion/react");
|
|
16
|
+
//#region src/components/client/Checkbox/Checkbox.tsx
|
|
17
|
+
const MotionBox = motion_react.m.create(require_components_Box.Box);
|
|
18
|
+
MotionBox.displayName = "CheckboxMotionBox";
|
|
19
|
+
const hoverTransition = {
|
|
20
|
+
layoutVariant: "smooth",
|
|
21
|
+
layoutSpeed: "3"
|
|
22
|
+
};
|
|
23
|
+
const pressTransition = {
|
|
24
|
+
layoutVariant: "veryBouncy",
|
|
25
|
+
layoutSpeed: "4"
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* **⚙️️ An checkbox.
|
|
29
|
+
*
|
|
30
|
+
* @componentType Client component
|
|
31
|
+
*
|
|
32
|
+
* @description
|
|
33
|
+
* A checkbox component allows users to select one or multiple options from a set. It represents a binary state, typically as checked or unchecked, and optionally includes a third "indeterminate" state to indicate partial selection.
|
|
34
|
+
*
|
|
35
|
+
* @see
|
|
36
|
+
* Check out the {@link https://uds.build/docs/components/checkbox Checkbox Docs} for more info
|
|
37
|
+
*
|
|
38
|
+
* @usage
|
|
39
|
+
* - Forms: checkbox
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* 'use client';
|
|
44
|
+
* import { Checkbox } from "@yahoo/uds";
|
|
45
|
+
*
|
|
46
|
+
* <Checkbox label="Name" required />
|
|
47
|
+
*```
|
|
48
|
+
*
|
|
49
|
+
* @related [Radio](https://uds.build/docs/components/radio), [Switch](https://uds.build/docs/components/switch), [Input](https://uds.build/docs/components/input).
|
|
50
|
+
**/
|
|
51
|
+
const Checkbox = (0, react.forwardRef)(function Checkbox({ reduceMotion: forceReduceMotion, ...props }, parentRef) {
|
|
52
|
+
const prefersReducedMotion = require_hooks_usePrefersReducedMotion.usePrefersReducedMotion();
|
|
53
|
+
const reduceMotion = forceReduceMotion ? "always" : "user";
|
|
54
|
+
const cssAnimationDuration = prefersReducedMotion || forceReduceMotion ? "duration-0" : "duration-120";
|
|
55
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Checkbox_CheckboxBase.CheckboxBase, {
|
|
56
|
+
...props,
|
|
57
|
+
ref: parentRef,
|
|
58
|
+
cssAnimationDuration,
|
|
59
|
+
enableInteractionTracking: true,
|
|
60
|
+
renderRoot: ({ className, style, rootSlotProps, hasLabel, isPressed, onHoverStart, onHoverEnd, onTapStart, onTapEnd, children }) => {
|
|
61
|
+
const RootElement = hasLabel ? motion_react.m.label : motion_react.m.div;
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_SpringMotionConfig.SpringMotionConfig, {
|
|
63
|
+
reducedMotion: reduceMotion,
|
|
64
|
+
...isPressed ? pressTransition : hoverTransition,
|
|
65
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RootElement, {
|
|
66
|
+
className,
|
|
67
|
+
"data-testid": "container",
|
|
68
|
+
style,
|
|
69
|
+
onHoverStart,
|
|
70
|
+
onHoverEnd,
|
|
71
|
+
onTapStart,
|
|
72
|
+
onTap: onTapEnd,
|
|
73
|
+
onTapCancel: onTapEnd,
|
|
74
|
+
tabIndex: -1,
|
|
75
|
+
...rootSlotProps,
|
|
76
|
+
children
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
renderIndicator: ({ size, variant, valueState, checked, showHoverEffect, showPressedEffect, cssAnimationDuration, checkIcon, checkboxSlotProps, iconSlotProps, children }) => {
|
|
81
|
+
const scale = showPressedEffect ? .9 : showHoverEffect ? 1.1 : 1;
|
|
82
|
+
const checkOpacity = !checked ? require_styles_styler.cx("opacity-0") : showPressedEffect ? require_styles_styler.cx("opacity-55") : require_styles_styler.cx("opacity-100");
|
|
83
|
+
const classNames = {
|
|
84
|
+
checkbox: require_styles_styler.getStyles({
|
|
85
|
+
checkboxSizeCheckbox: size,
|
|
86
|
+
checkboxVariantCheckbox: variant,
|
|
87
|
+
checkboxVariantValueCheckbox: valueState,
|
|
88
|
+
className: require_styles_styler.cx("uds-ring", "uds-ring-within", cssAnimationDuration, "transition-[background-color,border-color,box-shadow]")
|
|
89
|
+
}),
|
|
90
|
+
check: require_styles_styler.getStyles({
|
|
91
|
+
checkboxVariantCheckboxIcon: variant,
|
|
92
|
+
checkboxVariantValueCheckboxIcon: valueState,
|
|
93
|
+
className: require_styles_styler.cx("pointer-events-none", checkOpacity, cssAnimationDuration, "transition-opacity")
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionBox, {
|
|
97
|
+
position: "relative",
|
|
98
|
+
className: classNames.checkbox,
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
justifyContent: "center",
|
|
101
|
+
flex: "none",
|
|
102
|
+
animate: { scale },
|
|
103
|
+
...checkboxSlotProps,
|
|
104
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
105
|
+
name: checkIcon,
|
|
106
|
+
size: "sm",
|
|
107
|
+
className: classNames.check,
|
|
108
|
+
...iconSlotProps
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
Checkbox.displayName = "Checkbox";
|
|
115
|
+
//#endregion
|
|
116
|
+
exports.Checkbox = Checkbox;
|
|
117
|
+
exports.SIZES = require_components_client_Checkbox_checkboxConstants.SIZES;
|
|
118
|
+
exports.VARIANTS = require_components_client_Checkbox_checkboxConstants.VARIANTS;
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { SIZES, VARIANTS } from "./checkboxConstants.cjs";
|
|
3
|
+
import { CheckboxProps as CheckboxProps$1 } from "./types.cjs";
|
|
3
4
|
import React from "react";
|
|
4
5
|
|
|
5
|
-
//#region src/components/client/Checkbox.d.ts
|
|
6
|
-
type
|
|
7
|
-
type DataAttributes = {
|
|
8
|
-
[name: `data-${string}`]: string;
|
|
9
|
-
};
|
|
10
|
-
interface CheckboxProps extends NativeInputProps, UniversalCheckboxProps {
|
|
11
|
-
/** Props to be passed into various slots within the component. */
|
|
12
|
-
slotProps?: {
|
|
13
|
-
root?: DataAttributes;
|
|
14
|
-
checkbox?: DataAttributes;
|
|
15
|
-
icon?: DataAttributes;
|
|
16
|
-
label?: DataAttributes;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
declare const VARIANTS: ("primary" | "secondary")[];
|
|
20
|
-
declare const SIZES: ("sm" | "md")[];
|
|
6
|
+
//#region src/components/client/Checkbox/Checkbox.d.ts
|
|
7
|
+
type CheckboxProps = CheckboxProps$1;
|
|
21
8
|
/**
|
|
22
9
|
* **⚙️️ An checkbox.
|
|
23
10
|
*
|
|
@@ -42,6 +29,6 @@ declare const SIZES: ("sm" | "md")[];
|
|
|
42
29
|
*
|
|
43
30
|
* @related [Radio](https://uds.build/docs/components/radio), [Switch](https://uds.build/docs/components/switch), [Input](https://uds.build/docs/components/input).
|
|
44
31
|
**/
|
|
45
|
-
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
46
33
|
//#endregion
|
|
47
34
|
export { Checkbox, type CheckboxProps, SIZES, VARIANTS };
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
3
|
+
import { SIZES, VARIANTS } from "./checkboxConstants.js";
|
|
4
|
+
import { CheckboxProps as CheckboxProps$1 } from "./types.js";
|
|
4
5
|
import React from "react";
|
|
5
6
|
|
|
6
|
-
//#region src/components/client/Checkbox.d.ts
|
|
7
|
-
type
|
|
8
|
-
type DataAttributes = {
|
|
9
|
-
[name: `data-${string}`]: string;
|
|
10
|
-
};
|
|
11
|
-
interface CheckboxProps extends NativeInputProps, UniversalCheckboxProps {
|
|
12
|
-
/** Props to be passed into various slots within the component. */
|
|
13
|
-
slotProps?: {
|
|
14
|
-
root?: DataAttributes;
|
|
15
|
-
checkbox?: DataAttributes;
|
|
16
|
-
icon?: DataAttributes;
|
|
17
|
-
label?: DataAttributes;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
declare const VARIANTS: ("primary" | "secondary")[];
|
|
21
|
-
declare const SIZES: ("sm" | "md")[];
|
|
7
|
+
//#region src/components/client/Checkbox/Checkbox.d.ts
|
|
8
|
+
type CheckboxProps = CheckboxProps$1;
|
|
22
9
|
/**
|
|
23
10
|
* **⚙️️ An checkbox.
|
|
24
11
|
*
|
|
@@ -43,6 +30,6 @@ declare const SIZES: ("sm" | "md")[];
|
|
|
43
30
|
*
|
|
44
31
|
* @related [Radio](https://uds.build/docs/components/radio), [Switch](https://uds.build/docs/components/switch), [Input](https://uds.build/docs/components/input).
|
|
45
32
|
**/
|
|
46
|
-
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
33
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
47
34
|
//#endregion
|
|
48
35
|
export { Checkbox, type CheckboxProps, SIZES, VARIANTS };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
+
import { Icon } from "../../Icon.js";
|
|
5
|
+
import { Box } from "../../Box.js";
|
|
6
|
+
import { usePrefersReducedMotion } from "../../../hooks/usePrefersReducedMotion.js";
|
|
7
|
+
import { SpringMotionConfig } from "../SpringMotionConfig.js";
|
|
8
|
+
import { SIZES, VARIANTS } from "./checkboxConstants.js";
|
|
9
|
+
import { CheckboxBase } from "./CheckboxBase.js";
|
|
10
|
+
import { forwardRef } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { m } from "motion/react";
|
|
13
|
+
//#region src/components/client/Checkbox/Checkbox.tsx
|
|
14
|
+
const MotionBox = m.create(Box);
|
|
15
|
+
MotionBox.displayName = "CheckboxMotionBox";
|
|
16
|
+
const hoverTransition = {
|
|
17
|
+
layoutVariant: "smooth",
|
|
18
|
+
layoutSpeed: "3"
|
|
19
|
+
};
|
|
20
|
+
const pressTransition = {
|
|
21
|
+
layoutVariant: "veryBouncy",
|
|
22
|
+
layoutSpeed: "4"
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* **⚙️️ An checkbox.
|
|
26
|
+
*
|
|
27
|
+
* @componentType Client component
|
|
28
|
+
*
|
|
29
|
+
* @description
|
|
30
|
+
* A checkbox component allows users to select one or multiple options from a set. It represents a binary state, typically as checked or unchecked, and optionally includes a third "indeterminate" state to indicate partial selection.
|
|
31
|
+
*
|
|
32
|
+
* @see
|
|
33
|
+
* Check out the {@link https://uds.build/docs/components/checkbox Checkbox Docs} for more info
|
|
34
|
+
*
|
|
35
|
+
* @usage
|
|
36
|
+
* - Forms: checkbox
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* 'use client';
|
|
41
|
+
* import { Checkbox } from "@yahoo/uds";
|
|
42
|
+
*
|
|
43
|
+
* <Checkbox label="Name" required />
|
|
44
|
+
*```
|
|
45
|
+
*
|
|
46
|
+
* @related [Radio](https://uds.build/docs/components/radio), [Switch](https://uds.build/docs/components/switch), [Input](https://uds.build/docs/components/input).
|
|
47
|
+
**/
|
|
48
|
+
const Checkbox = forwardRef(function Checkbox({ reduceMotion: forceReduceMotion, ...props }, parentRef) {
|
|
49
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
50
|
+
const reduceMotion = forceReduceMotion ? "always" : "user";
|
|
51
|
+
const cssAnimationDuration = prefersReducedMotion || forceReduceMotion ? "duration-0" : "duration-120";
|
|
52
|
+
return /* @__PURE__ */ jsx(CheckboxBase, {
|
|
53
|
+
...props,
|
|
54
|
+
ref: parentRef,
|
|
55
|
+
cssAnimationDuration,
|
|
56
|
+
enableInteractionTracking: true,
|
|
57
|
+
renderRoot: ({ className, style, rootSlotProps, hasLabel, isPressed, onHoverStart, onHoverEnd, onTapStart, onTapEnd, children }) => {
|
|
58
|
+
const RootElement = hasLabel ? m.label : m.div;
|
|
59
|
+
return /* @__PURE__ */ jsx(SpringMotionConfig, {
|
|
60
|
+
reducedMotion: reduceMotion,
|
|
61
|
+
...isPressed ? pressTransition : hoverTransition,
|
|
62
|
+
children: /* @__PURE__ */ jsx(RootElement, {
|
|
63
|
+
className,
|
|
64
|
+
"data-testid": "container",
|
|
65
|
+
style,
|
|
66
|
+
onHoverStart,
|
|
67
|
+
onHoverEnd,
|
|
68
|
+
onTapStart,
|
|
69
|
+
onTap: onTapEnd,
|
|
70
|
+
onTapCancel: onTapEnd,
|
|
71
|
+
tabIndex: -1,
|
|
72
|
+
...rootSlotProps,
|
|
73
|
+
children
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
renderIndicator: ({ size, variant, valueState, checked, showHoverEffect, showPressedEffect, cssAnimationDuration, checkIcon, checkboxSlotProps, iconSlotProps, children }) => {
|
|
78
|
+
const scale = showPressedEffect ? .9 : showHoverEffect ? 1.1 : 1;
|
|
79
|
+
const checkOpacity = !checked ? cx("opacity-0") : showPressedEffect ? cx("opacity-55") : cx("opacity-100");
|
|
80
|
+
const classNames = {
|
|
81
|
+
checkbox: getStyles({
|
|
82
|
+
checkboxSizeCheckbox: size,
|
|
83
|
+
checkboxVariantCheckbox: variant,
|
|
84
|
+
checkboxVariantValueCheckbox: valueState,
|
|
85
|
+
className: cx("uds-ring", "uds-ring-within", cssAnimationDuration, "transition-[background-color,border-color,box-shadow]")
|
|
86
|
+
}),
|
|
87
|
+
check: getStyles({
|
|
88
|
+
checkboxVariantCheckboxIcon: variant,
|
|
89
|
+
checkboxVariantValueCheckboxIcon: valueState,
|
|
90
|
+
className: cx("pointer-events-none", checkOpacity, cssAnimationDuration, "transition-opacity")
|
|
91
|
+
})
|
|
92
|
+
};
|
|
93
|
+
return /* @__PURE__ */ jsxs(MotionBox, {
|
|
94
|
+
position: "relative",
|
|
95
|
+
className: classNames.checkbox,
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
justifyContent: "center",
|
|
98
|
+
flex: "none",
|
|
99
|
+
animate: { scale },
|
|
100
|
+
...checkboxSlotProps,
|
|
101
|
+
children: [children, /* @__PURE__ */ jsx(Icon, {
|
|
102
|
+
name: checkIcon,
|
|
103
|
+
size: "sm",
|
|
104
|
+
className: classNames.check,
|
|
105
|
+
...iconSlotProps
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
Checkbox.displayName = "Checkbox";
|
|
112
|
+
//#endregion
|
|
113
|
+
export { Checkbox, SIZES, VARIANTS };
|
|
@@ -0,0 +1,141 @@
|
|
|
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_FormLabel = require("../../FormLabel.cjs");
|
|
7
|
+
const require_components_client_Checkbox_checkboxConstants = require("./checkboxConstants.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_runtime.__toESM(react);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
//#region src/components/client/Checkbox/CheckboxBase.tsx
|
|
12
|
+
const CheckboxBase = (0, react.forwardRef)(function CheckboxBase({ id, checked: checkedProp, defaultChecked, onChange, label, labelPosition = "start", variant: variantProp = "primary", size = "md", reduceMotion: _reduceMotion, disabled, required, hasError, className, style, slotProps, cssAnimationDuration, enableInteractionTracking = false, renderRoot, renderIndicator, ...checkboxProps }, parentRef) {
|
|
13
|
+
const generatedId = (0, react.useId)();
|
|
14
|
+
const uid = id ?? `uds-input-${generatedId}`;
|
|
15
|
+
const rootSlotProps = slotProps?.root ?? {};
|
|
16
|
+
const checkboxSlotProps = slotProps?.checkbox ?? {};
|
|
17
|
+
const iconSlotProps = slotProps?.icon ?? {};
|
|
18
|
+
const labelSlotProps = slotProps?.label ?? {};
|
|
19
|
+
const innerRef = (0, react.useRef)(null);
|
|
20
|
+
/**
|
|
21
|
+
* State
|
|
22
|
+
*/
|
|
23
|
+
const isControlled = checkedProp !== void 0;
|
|
24
|
+
const [checked, setChecked] = (0, react.useState)(isControlled ? checkedProp : defaultChecked);
|
|
25
|
+
const [isHovered, setIsHovered] = (0, react.useState)(false);
|
|
26
|
+
const [isPressed, setIsPressed] = (0, react.useState)(false);
|
|
27
|
+
/**
|
|
28
|
+
* Derived values
|
|
29
|
+
*/
|
|
30
|
+
const variant = (0, react.useMemo)(() => hasError ? require_components_client_Checkbox_checkboxConstants.VARIANT_ERROR_MAP[variantProp] : variantProp, [hasError, variantProp]);
|
|
31
|
+
const showHoverEffect = enableInteractionTracking && !disabled && isHovered;
|
|
32
|
+
const showPressedEffect = enableInteractionTracking && !disabled && isPressed;
|
|
33
|
+
/**
|
|
34
|
+
* Handlers
|
|
35
|
+
*/
|
|
36
|
+
const handleChange = (0, react.useCallback)((e) => {
|
|
37
|
+
onChange?.(e);
|
|
38
|
+
if (!isControlled) setChecked(e.target.checked);
|
|
39
|
+
}, [isControlled, onChange]);
|
|
40
|
+
const handleHoverStart = (0, react.useCallback)(() => {
|
|
41
|
+
if (enableInteractionTracking) setIsHovered(true);
|
|
42
|
+
}, [enableInteractionTracking]);
|
|
43
|
+
const handleHoverEnd = (0, react.useCallback)(() => {
|
|
44
|
+
if (enableInteractionTracking) setIsHovered(false);
|
|
45
|
+
}, [enableInteractionTracking]);
|
|
46
|
+
const handleTapStart = (0, react.useCallback)(() => {
|
|
47
|
+
if (enableInteractionTracking) setIsPressed(true);
|
|
48
|
+
}, [enableInteractionTracking]);
|
|
49
|
+
const handleTapEnd = (0, react.useCallback)(() => {
|
|
50
|
+
if (enableInteractionTracking) setIsPressed(false);
|
|
51
|
+
}, [enableInteractionTracking]);
|
|
52
|
+
/**
|
|
53
|
+
* Helpers
|
|
54
|
+
*/
|
|
55
|
+
const setDOMIndeterminate = (checked_) => {
|
|
56
|
+
if (!innerRef.current) return;
|
|
57
|
+
innerRef.current.indeterminate = require_components_client_Checkbox_checkboxConstants.isIndeterminate(checked_);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Effects
|
|
61
|
+
*/
|
|
62
|
+
(0, react.useEffect)(() => {
|
|
63
|
+
if (isControlled) setChecked(checkedProp);
|
|
64
|
+
}, [checkedProp, isControlled]);
|
|
65
|
+
(0, react.useEffect)(() => {
|
|
66
|
+
setDOMIndeterminate(checked);
|
|
67
|
+
}, [checked]);
|
|
68
|
+
const valueState = require_components_client_Checkbox_checkboxConstants.isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
69
|
+
const classNames = {
|
|
70
|
+
root: require_styles_styler.getStyles({
|
|
71
|
+
checkboxSizeRoot: size,
|
|
72
|
+
checkboxVariantRoot: variant,
|
|
73
|
+
checkboxVariantValueRoot: valueState,
|
|
74
|
+
display: "flex",
|
|
75
|
+
flexDirection: labelPosition === "start" ? "row" : "row-reverse",
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
className: require_styles_styler.cx({
|
|
78
|
+
"cursor-pointer": !disabled,
|
|
79
|
+
"cursor-default": disabled,
|
|
80
|
+
"opacity-50": disabled
|
|
81
|
+
}, className)
|
|
82
|
+
}),
|
|
83
|
+
htmlCheckbox: 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%]"),
|
|
84
|
+
label: require_styles_styler.cx(labelPosition === "start" ? "text-start" : "text-end")
|
|
85
|
+
};
|
|
86
|
+
const input = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
87
|
+
type: "checkbox",
|
|
88
|
+
tabIndex: 0,
|
|
89
|
+
...checkboxProps,
|
|
90
|
+
ref: (ref) => {
|
|
91
|
+
innerRef.current = ref;
|
|
92
|
+
setDOMIndeterminate(checked);
|
|
93
|
+
if (typeof parentRef === "function") parentRef(ref);
|
|
94
|
+
else if (parentRef !== null) parentRef.current = ref;
|
|
95
|
+
},
|
|
96
|
+
id: uid,
|
|
97
|
+
disabled,
|
|
98
|
+
required,
|
|
99
|
+
"aria-invalid": hasError,
|
|
100
|
+
checked: isControlled ? require_components_client_Checkbox_checkboxConstants.isIndeterminate(checked) ? false : checked : void 0,
|
|
101
|
+
defaultChecked: isControlled ? void 0 : defaultChecked,
|
|
102
|
+
onChange: handleChange,
|
|
103
|
+
className: classNames.htmlCheckbox
|
|
104
|
+
});
|
|
105
|
+
return renderRoot({
|
|
106
|
+
className: classNames.root,
|
|
107
|
+
style,
|
|
108
|
+
rootSlotProps,
|
|
109
|
+
hasLabel: Boolean(label),
|
|
110
|
+
isPressed,
|
|
111
|
+
onHoverStart: handleHoverStart,
|
|
112
|
+
onHoverEnd: handleHoverEnd,
|
|
113
|
+
onTapStart: handleTapStart,
|
|
114
|
+
onTapEnd: handleTapEnd,
|
|
115
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderIndicator({
|
|
116
|
+
size,
|
|
117
|
+
variant,
|
|
118
|
+
valueState,
|
|
119
|
+
checked,
|
|
120
|
+
disabled,
|
|
121
|
+
showHoverEffect,
|
|
122
|
+
showPressedEffect,
|
|
123
|
+
cssAnimationDuration,
|
|
124
|
+
checkIcon: require_components_client_Checkbox_checkboxConstants.getIcon(checked),
|
|
125
|
+
checkboxSlotProps,
|
|
126
|
+
iconSlotProps,
|
|
127
|
+
children: input
|
|
128
|
+
}), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_FormLabel.FormLabel, {
|
|
129
|
+
as: "div",
|
|
130
|
+
variant: "inherit",
|
|
131
|
+
color: "inherit",
|
|
132
|
+
required,
|
|
133
|
+
label,
|
|
134
|
+
className: classNames.label,
|
|
135
|
+
...labelSlotProps
|
|
136
|
+
})] })
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
CheckboxBase.displayName = "CheckboxBase";
|
|
140
|
+
//#endregion
|
|
141
|
+
exports.CheckboxBase = CheckboxBase;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { CheckboxVariant } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { getIcon } from "./checkboxConstants.cjs";
|
|
4
|
+
import { CheckboxProps, CheckboxValueState, DataAttributes } from "./types.cjs";
|
|
5
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Checkbox/CheckboxBase.d.ts
|
|
8
|
+
type ResolvedCheckboxVariant = CheckboxVariant | 'alert' | 'alert-secondary';
|
|
9
|
+
type RenderRootArgs = {
|
|
10
|
+
className: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
rootSlotProps: DataAttributes;
|
|
13
|
+
hasLabel: boolean;
|
|
14
|
+
isPressed: boolean;
|
|
15
|
+
onHoverStart: () => void;
|
|
16
|
+
onHoverEnd: () => void;
|
|
17
|
+
onTapStart: () => void;
|
|
18
|
+
onTapEnd: () => void;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
type RenderIndicatorArgs = {
|
|
22
|
+
size: NonNullable<CheckboxProps['size']>;
|
|
23
|
+
variant: ResolvedCheckboxVariant;
|
|
24
|
+
valueState: CheckboxValueState;
|
|
25
|
+
checked: CheckboxProps['checked'];
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
showHoverEffect: boolean;
|
|
28
|
+
showPressedEffect: boolean;
|
|
29
|
+
cssAnimationDuration: string;
|
|
30
|
+
checkIcon: ReturnType<typeof getIcon>;
|
|
31
|
+
checkboxSlotProps: DataAttributes;
|
|
32
|
+
iconSlotProps: DataAttributes;
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
type CheckboxBaseProps = CheckboxProps & {
|
|
36
|
+
cssAnimationDuration: string;
|
|
37
|
+
enableInteractionTracking?: boolean;
|
|
38
|
+
renderRoot: (args: RenderRootArgs) => ReactNode;
|
|
39
|
+
renderIndicator: (args: RenderIndicatorArgs) => ReactNode;
|
|
40
|
+
};
|
|
41
|
+
declare const CheckboxBase: React.ForwardRefExoticComponent<CheckboxProps & {
|
|
42
|
+
cssAnimationDuration: string;
|
|
43
|
+
enableInteractionTracking?: boolean;
|
|
44
|
+
renderRoot: (args: RenderRootArgs) => ReactNode;
|
|
45
|
+
renderIndicator: (args: RenderIndicatorArgs) => ReactNode;
|
|
46
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { CheckboxBase, type CheckboxBaseProps, type RenderIndicatorArgs, type RenderRootArgs, type ResolvedCheckboxVariant };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { CheckboxVariant } from "../../../types/dist/index.js";
|
|
4
|
+
import { getIcon } from "./checkboxConstants.js";
|
|
5
|
+
import { CheckboxProps, CheckboxValueState, DataAttributes } from "./types.js";
|
|
6
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Checkbox/CheckboxBase.d.ts
|
|
9
|
+
type ResolvedCheckboxVariant = CheckboxVariant | 'alert' | 'alert-secondary';
|
|
10
|
+
type RenderRootArgs = {
|
|
11
|
+
className: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
rootSlotProps: DataAttributes;
|
|
14
|
+
hasLabel: boolean;
|
|
15
|
+
isPressed: boolean;
|
|
16
|
+
onHoverStart: () => void;
|
|
17
|
+
onHoverEnd: () => void;
|
|
18
|
+
onTapStart: () => void;
|
|
19
|
+
onTapEnd: () => void;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
type RenderIndicatorArgs = {
|
|
23
|
+
size: NonNullable<CheckboxProps['size']>;
|
|
24
|
+
variant: ResolvedCheckboxVariant;
|
|
25
|
+
valueState: CheckboxValueState;
|
|
26
|
+
checked: CheckboxProps['checked'];
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
showHoverEffect: boolean;
|
|
29
|
+
showPressedEffect: boolean;
|
|
30
|
+
cssAnimationDuration: string;
|
|
31
|
+
checkIcon: ReturnType<typeof getIcon>;
|
|
32
|
+
checkboxSlotProps: DataAttributes;
|
|
33
|
+
iconSlotProps: DataAttributes;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
};
|
|
36
|
+
type CheckboxBaseProps = CheckboxProps & {
|
|
37
|
+
cssAnimationDuration: string;
|
|
38
|
+
enableInteractionTracking?: boolean;
|
|
39
|
+
renderRoot: (args: RenderRootArgs) => ReactNode;
|
|
40
|
+
renderIndicator: (args: RenderIndicatorArgs) => ReactNode;
|
|
41
|
+
};
|
|
42
|
+
declare const CheckboxBase: React.ForwardRefExoticComponent<CheckboxProps & {
|
|
43
|
+
cssAnimationDuration: string;
|
|
44
|
+
enableInteractionTracking?: boolean;
|
|
45
|
+
renderRoot: (args: RenderRootArgs) => ReactNode;
|
|
46
|
+
renderIndicator: (args: RenderIndicatorArgs) => ReactNode;
|
|
47
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { CheckboxBase, type CheckboxBaseProps, type RenderIndicatorArgs, type RenderRootArgs, type ResolvedCheckboxVariant };
|