@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
|
@@ -30,7 +30,7 @@ import { BottomSheetHeader, BottomSheetHeaderProps } from "./client/BottomSheet/
|
|
|
30
30
|
import { BottomSheetProvider, BottomSheetProviderProps } from "./client/BottomSheet/BottomSheetProvider.js";
|
|
31
31
|
import { BottomSheetTrigger, BottomSheetTriggerProps } from "./client/BottomSheet/BottomSheetTrigger.js";
|
|
32
32
|
import { Button, ButtonProps } from "./client/Button/Button.js";
|
|
33
|
-
import { Checkbox, CheckboxProps } from "./client/Checkbox.js";
|
|
33
|
+
import { Checkbox, CheckboxProps } from "./client/Checkbox/Checkbox.js";
|
|
34
34
|
import { Chip, ChipProps } from "./client/Chip/Chip.js";
|
|
35
35
|
import { ChipButton, ChipButtonProps } from "./client/Chip/ChipButton.js";
|
|
36
36
|
import { ChipDismissible, ChipDismissibleProps } from "./client/Chip/ChipDismissible.js";
|
package/dist/components/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import { BottomSheetProvider } from "./client/BottomSheet/BottomSheetProvider.js
|
|
|
30
30
|
import { BottomSheetTrigger } from "./client/BottomSheet/BottomSheetTrigger.js";
|
|
31
31
|
import { SpringMotionConfig } from "./client/SpringMotionConfig.js";
|
|
32
32
|
import { Button } from "./client/Button/Button.js";
|
|
33
|
-
import { Checkbox } from "./client/Checkbox.js";
|
|
33
|
+
import { Checkbox } from "./client/Checkbox/Checkbox.js";
|
|
34
34
|
import { ChipButton } from "./client/Chip/ChipButton.js";
|
|
35
35
|
import { ChipDismissible } from "./client/Chip/ChipDismissible.js";
|
|
36
36
|
import { ChipLink } from "./client/Chip/ChipLink.js";
|
|
@@ -0,0 +1,75 @@
|
|
|
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("../../components/Icon.cjs");
|
|
7
|
+
const require_components_Box = require("../../components/Box.cjs");
|
|
8
|
+
const require_components_client_Checkbox_CheckboxBase = require("../../components/client/Checkbox/CheckboxBase.cjs");
|
|
9
|
+
let react = require("react");
|
|
10
|
+
react = require_runtime.__toESM(react);
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
//#region src/css-animation/Checkbox/Checkbox.tsx
|
|
13
|
+
/**
|
|
14
|
+
* CSS-animation Checkbox variant. This component intentionally never imports motion.
|
|
15
|
+
*
|
|
16
|
+
* @componentType Client component
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* 'use client';
|
|
21
|
+
* import { Checkbox } from '@yahoo/uds/css-animation';
|
|
22
|
+
*
|
|
23
|
+
* <Checkbox label="Name" required />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const Checkbox = (0, react.forwardRef)(function Checkbox(props, parentRef) {
|
|
27
|
+
const cssAnimationDuration = "duration-120";
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Checkbox_CheckboxBase.CheckboxBase, {
|
|
29
|
+
...props,
|
|
30
|
+
ref: parentRef,
|
|
31
|
+
cssAnimationDuration,
|
|
32
|
+
renderRoot: ({ className, style, rootSlotProps, hasLabel, children }) => {
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(hasLabel ? "label" : "div", {
|
|
34
|
+
className: require_styles_styler.cx("group", className),
|
|
35
|
+
"data-testid": "container",
|
|
36
|
+
style,
|
|
37
|
+
tabIndex: -1,
|
|
38
|
+
...rootSlotProps,
|
|
39
|
+
children
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
renderIndicator: ({ size, variant, valueState, checked, disabled, cssAnimationDuration, checkIcon, checkboxSlotProps, iconSlotProps, children }) => {
|
|
43
|
+
const classNames = {
|
|
44
|
+
checkbox: require_styles_styler.getStyles({
|
|
45
|
+
checkboxSizeCheckbox: size,
|
|
46
|
+
checkboxVariantCheckbox: variant,
|
|
47
|
+
checkboxVariantValueCheckbox: valueState,
|
|
48
|
+
className: require_styles_styler.cx("uds-ring", "uds-ring-within", !disabled && "group-hover:scale-110", !disabled && "group-active:scale-90", cssAnimationDuration, "transition-[background-color,border-color,box-shadow,transform]")
|
|
49
|
+
}),
|
|
50
|
+
check: require_styles_styler.getStyles({
|
|
51
|
+
checkboxVariantCheckboxIcon: variant,
|
|
52
|
+
checkboxVariantValueCheckboxIcon: valueState,
|
|
53
|
+
className: require_styles_styler.cx("pointer-events-none", checked ? "opacity-100" : "opacity-0", Boolean(checked) && !disabled && "group-active:opacity-55", cssAnimationDuration, "transition-opacity")
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
57
|
+
position: "relative",
|
|
58
|
+
className: classNames.checkbox,
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center",
|
|
61
|
+
flex: "none",
|
|
62
|
+
...checkboxSlotProps,
|
|
63
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
64
|
+
name: checkIcon,
|
|
65
|
+
size: "sm",
|
|
66
|
+
className: classNames.check,
|
|
67
|
+
...iconSlotProps
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
Checkbox.displayName = "Checkbox";
|
|
74
|
+
//#endregion
|
|
75
|
+
exports.Checkbox = Checkbox;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { CheckboxProps as CheckboxProps$1 } from "../../components/client/Checkbox/types.cjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/css-animation/Checkbox/Checkbox.d.ts
|
|
6
|
+
type CheckboxProps = CheckboxProps$1;
|
|
7
|
+
/**
|
|
8
|
+
* CSS-animation Checkbox variant. This component intentionally never imports motion.
|
|
9
|
+
*
|
|
10
|
+
* @componentType Client component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* 'use client';
|
|
15
|
+
* import { Checkbox } from '@yahoo/uds/css-animation';
|
|
16
|
+
*
|
|
17
|
+
* <Checkbox label="Name" required />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Checkbox, type CheckboxProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { CheckboxProps as CheckboxProps$1 } from "../../components/client/Checkbox/types.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/css-animation/Checkbox/Checkbox.d.ts
|
|
7
|
+
type CheckboxProps = CheckboxProps$1;
|
|
8
|
+
/**
|
|
9
|
+
* CSS-animation Checkbox variant. This component intentionally never imports motion.
|
|
10
|
+
*
|
|
11
|
+
* @componentType Client component
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* 'use client';
|
|
16
|
+
* import { Checkbox } from '@yahoo/uds/css-animation';
|
|
17
|
+
*
|
|
18
|
+
* <Checkbox label="Name" required />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Checkbox, type CheckboxProps };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { cx, getStyles } from "../../styles/styler.js";
|
|
4
|
+
import { Icon } from "../../components/Icon.js";
|
|
5
|
+
import { Box } from "../../components/Box.js";
|
|
6
|
+
import { CheckboxBase } from "../../components/client/Checkbox/CheckboxBase.js";
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/css-animation/Checkbox/Checkbox.tsx
|
|
10
|
+
/**
|
|
11
|
+
* CSS-animation Checkbox variant. This component intentionally never imports motion.
|
|
12
|
+
*
|
|
13
|
+
* @componentType Client component
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* 'use client';
|
|
18
|
+
* import { Checkbox } from '@yahoo/uds/css-animation';
|
|
19
|
+
*
|
|
20
|
+
* <Checkbox label="Name" required />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
const Checkbox = forwardRef(function Checkbox(props, parentRef) {
|
|
24
|
+
const cssAnimationDuration = "duration-120";
|
|
25
|
+
return /* @__PURE__ */ jsx(CheckboxBase, {
|
|
26
|
+
...props,
|
|
27
|
+
ref: parentRef,
|
|
28
|
+
cssAnimationDuration,
|
|
29
|
+
renderRoot: ({ className, style, rootSlotProps, hasLabel, children }) => {
|
|
30
|
+
return /* @__PURE__ */ jsx(hasLabel ? "label" : "div", {
|
|
31
|
+
className: cx("group", className),
|
|
32
|
+
"data-testid": "container",
|
|
33
|
+
style,
|
|
34
|
+
tabIndex: -1,
|
|
35
|
+
...rootSlotProps,
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
renderIndicator: ({ size, variant, valueState, checked, disabled, cssAnimationDuration, checkIcon, checkboxSlotProps, iconSlotProps, children }) => {
|
|
40
|
+
const classNames = {
|
|
41
|
+
checkbox: getStyles({
|
|
42
|
+
checkboxSizeCheckbox: size,
|
|
43
|
+
checkboxVariantCheckbox: variant,
|
|
44
|
+
checkboxVariantValueCheckbox: valueState,
|
|
45
|
+
className: cx("uds-ring", "uds-ring-within", !disabled && "group-hover:scale-110", !disabled && "group-active:scale-90", cssAnimationDuration, "transition-[background-color,border-color,box-shadow,transform]")
|
|
46
|
+
}),
|
|
47
|
+
check: getStyles({
|
|
48
|
+
checkboxVariantCheckboxIcon: variant,
|
|
49
|
+
checkboxVariantValueCheckboxIcon: valueState,
|
|
50
|
+
className: cx("pointer-events-none", checked ? "opacity-100" : "opacity-0", Boolean(checked) && !disabled && "group-active:opacity-55", cssAnimationDuration, "transition-opacity")
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
54
|
+
position: "relative",
|
|
55
|
+
className: classNames.checkbox,
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
flex: "none",
|
|
59
|
+
...checkboxSlotProps,
|
|
60
|
+
children: [children, /* @__PURE__ */ jsx(Icon, {
|
|
61
|
+
name: checkIcon,
|
|
62
|
+
size: "sm",
|
|
63
|
+
className: classNames.check,
|
|
64
|
+
...iconSlotProps
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
Checkbox.displayName = "Checkbox";
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Checkbox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_css_animation_Checkbox_Checkbox = require("./Checkbox.cjs");
|
|
5
|
+
exports.Checkbox = require_css_animation_Checkbox_Checkbox.Checkbox;
|
|
@@ -0,0 +1,92 @@
|
|
|
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_Box = require("../../components/Box.cjs");
|
|
7
|
+
const require_components_client_Radio_RadioBase = require("../../components/client/Radio/RadioBase.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_runtime.__toESM(react);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
//#region src/css-animation/Radio/Radio.tsx
|
|
12
|
+
/**
|
|
13
|
+
* CSS-animation Radio variant. This component intentionally never imports motion.
|
|
14
|
+
*
|
|
15
|
+
* @componentType Client component
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* 'use client';
|
|
20
|
+
* import { Radio } from '@yahoo/uds/css-animation';
|
|
21
|
+
*
|
|
22
|
+
* <Radio label="Name" />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
const Radio = (0, react.forwardRef)(function Radio(props, parentRef) {
|
|
26
|
+
const cssAnimationDuration = "duration-120";
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Radio_RadioBase.RadioBase, {
|
|
28
|
+
...props,
|
|
29
|
+
ref: parentRef,
|
|
30
|
+
cssAnimationDuration,
|
|
31
|
+
renderRoot: ({ className, style, rootSlotProps, hasLabel, children }) => {
|
|
32
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(hasLabel ? "label" : "div", {
|
|
33
|
+
className: require_styles_styler.cx("group", className),
|
|
34
|
+
"data-testid": "container",
|
|
35
|
+
style,
|
|
36
|
+
tabIndex: -1,
|
|
37
|
+
...rootSlotProps,
|
|
38
|
+
children
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
renderIndicator: ({ size, variant, checked, disabled, cssAnimationDuration, radioSlotProps, radioIconSlotProps, children }) => {
|
|
42
|
+
const classNames = {
|
|
43
|
+
radio: require_styles_styler.getStyles({
|
|
44
|
+
radioSizeRadio: size,
|
|
45
|
+
radioVariantRadio: variant,
|
|
46
|
+
radioVariantValueRadio: checked ? "checked" : "unchecked",
|
|
47
|
+
className: require_styles_styler.cx([
|
|
48
|
+
"border",
|
|
49
|
+
"uds-ring",
|
|
50
|
+
"uds-ring-within",
|
|
51
|
+
!disabled && "group-hover:scale-110",
|
|
52
|
+
!disabled && !checked && "group-active:scale-90",
|
|
53
|
+
!disabled && !checked && "group-active:uds-inset-shadow-lg-invert",
|
|
54
|
+
!disabled && checked && "group-hover:uds-inset-shadow-lg-invert",
|
|
55
|
+
cssAnimationDuration,
|
|
56
|
+
"transition-[background-color,border-color,transform]",
|
|
57
|
+
"transition-shadow"
|
|
58
|
+
])
|
|
59
|
+
}),
|
|
60
|
+
radioCircle: require_styles_styler.getStyles({
|
|
61
|
+
radioVariantRadioCircle: variant,
|
|
62
|
+
radioVariantValueRadioCircle: checked ? "checked" : "unchecked",
|
|
63
|
+
className: require_styles_styler.cx([
|
|
64
|
+
"pointer-events-none",
|
|
65
|
+
"w-[8px]",
|
|
66
|
+
"h-[8px]",
|
|
67
|
+
checked ? "opacity-100" : "opacity-0",
|
|
68
|
+
cssAnimationDuration,
|
|
69
|
+
"transition-opacity"
|
|
70
|
+
])
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
74
|
+
position: "relative",
|
|
75
|
+
borderRadius: "full",
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
flex: "none",
|
|
79
|
+
className: classNames.radio,
|
|
80
|
+
...radioSlotProps,
|
|
81
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
82
|
+
borderRadius: "full",
|
|
83
|
+
className: classNames.radioCircle,
|
|
84
|
+
...radioIconSlotProps
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
Radio.displayName = "Radio";
|
|
91
|
+
//#endregion
|
|
92
|
+
exports.Radio = Radio;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { RadioProps as RadioProps$1 } from "../../components/client/Radio/types.cjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/css-animation/Radio/Radio.d.ts
|
|
6
|
+
type RadioProps = RadioProps$1;
|
|
7
|
+
/**
|
|
8
|
+
* CSS-animation Radio variant. This component intentionally never imports motion.
|
|
9
|
+
*
|
|
10
|
+
* @componentType Client component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* 'use client';
|
|
15
|
+
* import { Radio } from '@yahoo/uds/css-animation';
|
|
16
|
+
*
|
|
17
|
+
* <Radio label="Name" />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Radio, type RadioProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { RadioProps as RadioProps$1 } from "../../components/client/Radio/types.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/css-animation/Radio/Radio.d.ts
|
|
7
|
+
type RadioProps = RadioProps$1;
|
|
8
|
+
/**
|
|
9
|
+
* CSS-animation Radio variant. This component intentionally never imports motion.
|
|
10
|
+
*
|
|
11
|
+
* @componentType Client component
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* 'use client';
|
|
16
|
+
* import { Radio } from '@yahoo/uds/css-animation';
|
|
17
|
+
*
|
|
18
|
+
* <Radio label="Name" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioProps$1 & React.RefAttributes<HTMLInputElement>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Radio, type RadioProps };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { cx, getStyles } from "../../styles/styler.js";
|
|
4
|
+
import { Box } from "../../components/Box.js";
|
|
5
|
+
import { RadioBase } from "../../components/client/Radio/RadioBase.js";
|
|
6
|
+
import { forwardRef } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/css-animation/Radio/Radio.tsx
|
|
9
|
+
/**
|
|
10
|
+
* CSS-animation Radio variant. This component intentionally never imports motion.
|
|
11
|
+
*
|
|
12
|
+
* @componentType Client component
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* 'use client';
|
|
17
|
+
* import { Radio } from '@yahoo/uds/css-animation';
|
|
18
|
+
*
|
|
19
|
+
* <Radio label="Name" />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
const Radio = forwardRef(function Radio(props, parentRef) {
|
|
23
|
+
const cssAnimationDuration = "duration-120";
|
|
24
|
+
return /* @__PURE__ */ jsx(RadioBase, {
|
|
25
|
+
...props,
|
|
26
|
+
ref: parentRef,
|
|
27
|
+
cssAnimationDuration,
|
|
28
|
+
renderRoot: ({ className, style, rootSlotProps, hasLabel, children }) => {
|
|
29
|
+
return /* @__PURE__ */ jsx(hasLabel ? "label" : "div", {
|
|
30
|
+
className: cx("group", className),
|
|
31
|
+
"data-testid": "container",
|
|
32
|
+
style,
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
...rootSlotProps,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
renderIndicator: ({ size, variant, checked, disabled, cssAnimationDuration, radioSlotProps, radioIconSlotProps, children }) => {
|
|
39
|
+
const classNames = {
|
|
40
|
+
radio: getStyles({
|
|
41
|
+
radioSizeRadio: size,
|
|
42
|
+
radioVariantRadio: variant,
|
|
43
|
+
radioVariantValueRadio: checked ? "checked" : "unchecked",
|
|
44
|
+
className: cx([
|
|
45
|
+
"border",
|
|
46
|
+
"uds-ring",
|
|
47
|
+
"uds-ring-within",
|
|
48
|
+
!disabled && "group-hover:scale-110",
|
|
49
|
+
!disabled && !checked && "group-active:scale-90",
|
|
50
|
+
!disabled && !checked && "group-active:uds-inset-shadow-lg-invert",
|
|
51
|
+
!disabled && checked && "group-hover:uds-inset-shadow-lg-invert",
|
|
52
|
+
cssAnimationDuration,
|
|
53
|
+
"transition-[background-color,border-color,transform]",
|
|
54
|
+
"transition-shadow"
|
|
55
|
+
])
|
|
56
|
+
}),
|
|
57
|
+
radioCircle: getStyles({
|
|
58
|
+
radioVariantRadioCircle: variant,
|
|
59
|
+
radioVariantValueRadioCircle: checked ? "checked" : "unchecked",
|
|
60
|
+
className: cx([
|
|
61
|
+
"pointer-events-none",
|
|
62
|
+
"w-[8px]",
|
|
63
|
+
"h-[8px]",
|
|
64
|
+
checked ? "opacity-100" : "opacity-0",
|
|
65
|
+
cssAnimationDuration,
|
|
66
|
+
"transition-opacity"
|
|
67
|
+
])
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
71
|
+
position: "relative",
|
|
72
|
+
borderRadius: "full",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
flex: "none",
|
|
76
|
+
className: classNames.radio,
|
|
77
|
+
...radioSlotProps,
|
|
78
|
+
children: [children, /* @__PURE__ */ jsx(Box, {
|
|
79
|
+
borderRadius: "full",
|
|
80
|
+
className: classNames.radioCircle,
|
|
81
|
+
...radioIconSlotProps
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
Radio.displayName = "Radio";
|
|
88
|
+
//#endregion
|
|
89
|
+
export { Radio };
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const require_css_animation_Button_Button = require("./Button/Button.cjs");
|
|
5
|
+
const require_css_animation_Checkbox_Checkbox = require("./Checkbox/Checkbox.cjs");
|
|
5
6
|
const require_css_animation_IconButton_IconButton = require("./IconButton/IconButton.cjs");
|
|
7
|
+
const require_css_animation_Radio_Radio = require("./Radio/Radio.cjs");
|
|
6
8
|
const require_css_animation_Switch_Switch = require("./Switch/Switch.cjs");
|
|
7
9
|
exports.Button = require_css_animation_Button_Button.Button;
|
|
10
|
+
exports.Checkbox = require_css_animation_Checkbox_Checkbox.Checkbox;
|
|
8
11
|
exports.IconButton = require_css_animation_IconButton_IconButton.IconButton;
|
|
12
|
+
exports.Radio = require_css_animation_Radio_Radio.Radio;
|
|
9
13
|
exports.Switch = require_css_animation_Switch_Switch.Switch;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { ButtonProps } from "../components/client/Button/Button.cjs";
|
|
3
3
|
import { IconButtonProps } from "../components/client/IconButton/IconButton.cjs";
|
|
4
4
|
import { Button } from "./Button/Button.cjs";
|
|
5
|
+
import { Checkbox, CheckboxProps } from "./Checkbox/Checkbox.cjs";
|
|
5
6
|
import { IconButton } from "./IconButton/IconButton.cjs";
|
|
7
|
+
import { Radio, RadioProps } from "./Radio/Radio.cjs";
|
|
6
8
|
import { Switch, SwitchProps } from "./Switch/Switch.cjs";
|
|
7
|
-
export { Button, type ButtonProps, IconButton, type IconButtonProps, Switch, type SwitchProps };
|
|
9
|
+
export { Button, type ButtonProps, Checkbox, type CheckboxProps, IconButton, type IconButtonProps, Radio, type RadioProps, Switch, type SwitchProps };
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { ButtonProps } from "../components/client/Button/Button.js";
|
|
4
4
|
import { IconButtonProps } from "../components/client/IconButton/IconButton.js";
|
|
5
5
|
import { Button } from "./Button/Button.js";
|
|
6
|
+
import { Checkbox, CheckboxProps } from "./Checkbox/Checkbox.js";
|
|
6
7
|
import { IconButton } from "./IconButton/IconButton.js";
|
|
8
|
+
import { Radio, RadioProps } from "./Radio/Radio.js";
|
|
7
9
|
import { Switch, SwitchProps } from "./Switch/Switch.js";
|
|
8
|
-
export { Button, type ButtonProps, IconButton, type IconButtonProps, Switch, type SwitchProps };
|
|
10
|
+
export { Button, type ButtonProps, Checkbox, type CheckboxProps, IconButton, type IconButtonProps, Radio, type RadioProps, Switch, type SwitchProps };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
import { Button } from "./Button/Button.js";
|
|
4
|
+
import { Checkbox } from "./Checkbox/Checkbox.js";
|
|
4
5
|
import { IconButton } from "./IconButton/IconButton.js";
|
|
6
|
+
import { Radio } from "./Radio/Radio.js";
|
|
5
7
|
import { Switch } from "./Switch/Switch.js";
|
|
6
|
-
export { Button, IconButton, Switch };
|
|
8
|
+
export { Button, Checkbox, IconButton, Radio, Switch };
|
|
@@ -4,21 +4,33 @@ require("../_virtual/_rolldown/runtime.cjs");
|
|
|
4
4
|
let react = require("react");
|
|
5
5
|
//#region src/hooks/usePrefersReducedMotion.ts
|
|
6
6
|
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
mediaQueryList.addEventListener("change", updatePreference);
|
|
17
|
-
return () => {
|
|
18
|
-
mediaQueryList.removeEventListener("change", updatePreference);
|
|
19
|
-
};
|
|
20
|
-
}, []);
|
|
21
|
-
return prefersReducedMotion;
|
|
7
|
+
/**
|
|
8
|
+
* Module-level singleton store so every consumer of the hook shares a single
|
|
9
|
+
* MediaQueryList `change` listener instead of registering one per hook instance.
|
|
10
|
+
*/
|
|
11
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
12
|
+
let mediaQueryList = null;
|
|
13
|
+
const getMediaQueryList = () => {
|
|
14
|
+
if (!mediaQueryList && typeof window !== "undefined" && typeof window.matchMedia === "function") mediaQueryList = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
15
|
+
return mediaQueryList;
|
|
22
16
|
};
|
|
17
|
+
const notifySubscribers = () => {
|
|
18
|
+
subscribers.forEach((notify) => notify());
|
|
19
|
+
};
|
|
20
|
+
const subscribe = (notify) => {
|
|
21
|
+
const currentMediaQueryList = getMediaQueryList();
|
|
22
|
+
if (currentMediaQueryList && subscribers.size === 0) currentMediaQueryList.addEventListener("change", notifySubscribers);
|
|
23
|
+
subscribers.add(notify);
|
|
24
|
+
return () => {
|
|
25
|
+
subscribers.delete(notify);
|
|
26
|
+
if (subscribers.size === 0 && mediaQueryList) {
|
|
27
|
+
mediaQueryList.removeEventListener("change", notifySubscribers);
|
|
28
|
+
mediaQueryList = null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const getSnapshot = () => getMediaQueryList()?.matches ?? false;
|
|
33
|
+
const getServerSnapshot = () => false;
|
|
34
|
+
const usePrefersReducedMotion = () => (0, react.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
|
|
23
35
|
//#endregion
|
|
24
36
|
exports.usePrefersReducedMotion = usePrefersReducedMotion;
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import {
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
3
|
//#region src/hooks/usePrefersReducedMotion.ts
|
|
4
4
|
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
mediaQueryList.addEventListener("change", updatePreference);
|
|
15
|
-
return () => {
|
|
16
|
-
mediaQueryList.removeEventListener("change", updatePreference);
|
|
17
|
-
};
|
|
18
|
-
}, []);
|
|
19
|
-
return prefersReducedMotion;
|
|
5
|
+
/**
|
|
6
|
+
* Module-level singleton store so every consumer of the hook shares a single
|
|
7
|
+
* MediaQueryList `change` listener instead of registering one per hook instance.
|
|
8
|
+
*/
|
|
9
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
10
|
+
let mediaQueryList = null;
|
|
11
|
+
const getMediaQueryList = () => {
|
|
12
|
+
if (!mediaQueryList && typeof window !== "undefined" && typeof window.matchMedia === "function") mediaQueryList = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
13
|
+
return mediaQueryList;
|
|
20
14
|
};
|
|
15
|
+
const notifySubscribers = () => {
|
|
16
|
+
subscribers.forEach((notify) => notify());
|
|
17
|
+
};
|
|
18
|
+
const subscribe = (notify) => {
|
|
19
|
+
const currentMediaQueryList = getMediaQueryList();
|
|
20
|
+
if (currentMediaQueryList && subscribers.size === 0) currentMediaQueryList.addEventListener("change", notifySubscribers);
|
|
21
|
+
subscribers.add(notify);
|
|
22
|
+
return () => {
|
|
23
|
+
subscribers.delete(notify);
|
|
24
|
+
if (subscribers.size === 0 && mediaQueryList) {
|
|
25
|
+
mediaQueryList.removeEventListener("change", notifySubscribers);
|
|
26
|
+
mediaQueryList = null;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const getSnapshot = () => getMediaQueryList()?.matches ?? false;
|
|
31
|
+
const getServerSnapshot = () => false;
|
|
32
|
+
const usePrefersReducedMotion = () => useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
21
33
|
//#endregion
|
|
22
34
|
export { usePrefersReducedMotion };
|