@yahoo/uds 3.157.1 → 3.158.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/generated/autoVariants.cjs +26 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.js +26 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3220 -545
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +335 -11
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +335 -11
- package/dist/automated-config/dist/generated/generatedConfigs.js +3218 -546
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +275 -44
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +275 -44
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +3 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +3 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +43 -35
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +4 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +4 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.js +44 -36
- package/dist/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.cjs +5 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.js +6 -3
- package/dist/automated-config/dist/utils/index.cjs +21 -5
- package/dist/automated-config/dist/utils/index.d.cts +1 -0
- package/dist/automated-config/dist/utils/index.d.ts +1 -0
- package/dist/automated-config/dist/utils/index.js +22 -6
- package/dist/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.cts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.ts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Menu/Menu.Item.cjs +1 -0
- package/dist/components/client/Menu/Menu.Item.js +1 -0
- 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/Select/Select.cjs +179 -0
- package/dist/components/client/Select/Select.d.cts +55 -0
- package/dist/components/client/Select/Select.d.ts +56 -0
- package/dist/components/client/Select/Select.js +176 -0
- package/dist/components/client/Select/SelectContent.cjs +75 -0
- package/dist/components/client/Select/SelectContent.d.cts +44 -0
- package/dist/components/client/Select/SelectContent.d.ts +45 -0
- package/dist/components/client/Select/SelectContent.js +73 -0
- package/dist/components/client/Select/SelectDivider.cjs +63 -0
- package/dist/components/client/Select/SelectDivider.d.cts +44 -0
- package/dist/components/client/Select/SelectDivider.d.ts +45 -0
- package/dist/components/client/Select/SelectDivider.js +61 -0
- package/dist/components/client/Select/SelectHelpText.cjs +51 -0
- package/dist/components/client/Select/SelectHelpText.d.cts +27 -0
- package/dist/components/client/Select/SelectHelpText.d.ts +28 -0
- package/dist/components/client/Select/SelectHelpText.js +48 -0
- package/dist/components/client/Select/SelectItem.cjs +172 -0
- package/dist/components/client/Select/SelectItem.d.cts +29 -0
- package/dist/components/client/Select/SelectItem.d.ts +30 -0
- package/dist/components/client/Select/SelectItem.js +170 -0
- package/dist/components/client/Select/SelectTrigger.cjs +138 -0
- package/dist/components/client/Select/SelectTrigger.d.cts +27 -0
- package/dist/components/client/Select/SelectTrigger.d.ts +28 -0
- package/dist/components/client/Select/SelectTrigger.js +136 -0
- package/dist/components/client/Select/SelectValue.cjs +28 -0
- package/dist/components/client/Select/SelectValue.d.cts +19 -0
- package/dist/components/client/Select/SelectValue.d.ts +20 -0
- package/dist/components/client/Select/SelectValue.js +26 -0
- package/dist/components/client/Select/index.cjs +11 -0
- package/dist/components/client/Select/index.d.cts +6 -0
- package/dist/components/client/Select/index.d.ts +7 -0
- package/dist/components/client/Select/index.js +7 -0
- package/dist/components/client/Select/selectContext.cjs +20 -0
- package/dist/components/client/Select/selectContext.d.cts +23 -0
- package/dist/components/client/Select/selectContext.d.ts +24 -0
- package/dist/components/client/Select/selectContext.js +16 -0
- package/dist/components/client/Select/selectFieldStyles.cjs +85 -0
- package/dist/components/client/Select/selectFieldStyles.d.cts +37 -0
- package/dist/components/client/Select/selectFieldStyles.d.ts +38 -0
- package/dist/components/client/Select/selectFieldStyles.js +75 -0
- package/dist/components/client/index.cjs +8 -0
- package/dist/components/client/index.d.cts +5 -1
- package/dist/components/client/index.d.ts +5 -1
- package/dist/components/client/index.js +5 -1
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +5 -1
- package/dist/config/dist/index.cjs +380 -70
- package/dist/config/dist/index.js +380 -70
- package/dist/css/dist/css/utils.cjs +3 -0
- package/dist/css/dist/css/utils.js +3 -0
- package/dist/css/dist/packages/config/dist/index.cjs +380 -70
- package/dist/css/dist/packages/config/dist/index.js +380 -70
- package/dist/index.cjs +11 -0
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +6 -2
- package/dist/styles/styler.d.cts +17 -0
- package/dist/styles/styler.d.ts +17 -0
- package/dist/styles/variants.d.cts +54 -0
- package/dist/styles/variants.d.ts +54 -0
- package/dist/tailwind/utils/index.cjs +3 -0
- package/dist/tailwind/utils/index.d.cts +2 -1
- package/dist/tailwind/utils/index.d.ts +2 -1
- package/dist/tailwind/utils/index.js +2 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.js +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.js +1 -1
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.cjs +74 -6
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.cts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.ts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.js +74 -7
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.js +1 -1
- package/dist/tailwind-internal/dist/index.d.cts +1 -0
- package/dist/tailwind-internal/dist/index.d.ts +1 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +3220 -545
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3218 -546
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +21 -5
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +22 -6
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +380 -70
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +380 -70
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +10 -10
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +1 -1
- package/dist/tailwind-internal/dist/plugins/a11y.cjs +6 -2
- package/dist/tailwind-internal/dist/plugins/a11y.js +6 -2
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.js +1 -1
- package/dist/tailwind-internal/dist/plugins/colors.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/colors.js +2 -2
- package/dist/tailwind-internal/dist/plugins/components.cjs +4 -1
- package/dist/tailwind-internal/dist/plugins/components.js +5 -2
- package/dist/tailwind-internal/dist/plugins/elevation.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/elevation.js +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.js +1 -1
- package/dist/tailwind-internal/dist/plugins/typography.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/typography.js +2 -2
- package/dist/tailwind-internal/dist/utils/getElevationStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getElevationStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/parseTokens.cjs +2 -2
- package/dist/tailwind-internal/dist/utils/parseTokens.js +2 -2
- package/dist/tokens/automation/configs/index.cjs +3 -0
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +3 -0
- package/dist/tokens/automation/index.d.cts +2 -2
- package/dist/tokens/automation/index.d.ts +2 -2
- package/dist/tokens/automation/index.js +2 -2
- package/dist/tokens/index.cjs +3 -0
- package/dist/tokens/index.d.cts +3 -3
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +36 -1
- package/dist/types/dist/index.d.ts +36 -1
- package/dist/uds/generated/componentData.cjs +407 -0
- package/dist/uds/generated/componentData.js +407 -0
- package/dist/uds/generated/migrationSchemaVersion.cjs +1 -1
- package/dist/uds/generated/migrationSchemaVersion.js +1 -1
- package/dist/uds/generated/tailwindPurge.cjs +1501 -315
- package/dist/uds/generated/tailwindPurge.js +1501 -315
- package/generated/componentData.json +496 -0
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
5
|
+
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
6
|
+
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
7
|
+
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
8
|
+
const require_components_Box = require("../../Box.cjs");
|
|
9
|
+
const require_components_HStack = require("../../HStack.cjs");
|
|
10
|
+
const require_components_client_Select_selectContext = require("./selectContext.cjs");
|
|
11
|
+
const require_components_client_Select_selectFieldStyles = require("./selectFieldStyles.cjs");
|
|
12
|
+
const require_components_client_Select_SelectValue = require("./SelectValue.cjs");
|
|
13
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
14
|
+
let react = require("react");
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
let _ariakit_react = require("@ariakit/react");
|
|
17
|
+
let motion_react = require("motion/react");
|
|
18
|
+
//#region src/components/client/Select/SelectTrigger.tsx
|
|
19
|
+
const StartIcon = (0, react.memo)(function StartIcon({ icon, className, iconProps }) {
|
|
20
|
+
if (!icon) return null;
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
22
|
+
icon,
|
|
23
|
+
className,
|
|
24
|
+
iconProps: {
|
|
25
|
+
variant: "outline",
|
|
26
|
+
...iconProps
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
StartIcon.displayName = "StartIcon";
|
|
31
|
+
const EndIcon = (0, react.memo)(function EndIcon({ icon, className, iconProps }) {
|
|
32
|
+
if (!icon) return null;
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
34
|
+
icon,
|
|
35
|
+
className,
|
|
36
|
+
iconProps: {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
...iconProps
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
EndIcon.displayName = "EndIcon";
|
|
43
|
+
const SelectTrigger = (0, react.forwardRef)(function SelectTrigger({ placeholder, startIcon, endIcon, slotProps, className, disabled: disabledProp, name, onClick: triggerPassthroughOnClick, onPointerDown: triggerPassthroughOnPointerDown, ...triggerPassthroughProps }, ref) {
|
|
44
|
+
const { size, disabled, readOnly, required, hasError, uid, helpTextId, reduceMotion, triggerWrapperRef } = require_components_client_Select_selectContext.useSelectFieldContext();
|
|
45
|
+
const select = (0, _ariakit_react.useSelectContext)();
|
|
46
|
+
const value = (0, _ariakit_react.useStoreState)(select, "value");
|
|
47
|
+
const open = (0, _ariakit_react.useStoreState)(select, "open");
|
|
48
|
+
const useAnimatedChevron = endIcon === void 0;
|
|
49
|
+
const hasValue = value != null && value !== "";
|
|
50
|
+
const isDisabled = disabledProp ?? disabled;
|
|
51
|
+
const { className: triggerWrapperClassName, ...triggerWrapperProps } = slotProps?.triggerWrapper ?? {};
|
|
52
|
+
const { className: triggerClassName, onClick, ...triggerProps } = slotProps?.trigger ?? {};
|
|
53
|
+
const handlePointerDown = (event) => {
|
|
54
|
+
if (readOnly) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
triggerPassthroughOnPointerDown?.(event);
|
|
60
|
+
};
|
|
61
|
+
const handleClick = (event) => {
|
|
62
|
+
if (readOnly) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
event.stopPropagation();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
triggerPassthroughOnClick?.(event);
|
|
68
|
+
onClick?.(event);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
71
|
+
ref: triggerWrapperRef,
|
|
72
|
+
position: "relative",
|
|
73
|
+
display: "flex",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
width: "full",
|
|
76
|
+
...triggerWrapperProps,
|
|
77
|
+
className: require_components_client_Select_selectFieldStyles.getSelectTriggerWrapperClassName(size, hasValue, triggerWrapperClassName),
|
|
78
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ariakit_react.Select, {
|
|
79
|
+
ref,
|
|
80
|
+
id: uid,
|
|
81
|
+
name,
|
|
82
|
+
disabled: isDisabled,
|
|
83
|
+
required,
|
|
84
|
+
"aria-describedby": helpTextId,
|
|
85
|
+
"aria-invalid": hasError,
|
|
86
|
+
"aria-readonly": readOnly || void 0,
|
|
87
|
+
...triggerPassthroughProps,
|
|
88
|
+
...triggerProps,
|
|
89
|
+
onPointerDown: handlePointerDown,
|
|
90
|
+
onClick: handleClick,
|
|
91
|
+
className: require_styles_styler.cx("flex", "w-full", "min-w-0", "items-center", "border-0", "bg-transparent", "rounded-[inherit]", "outline-none", "shadow-none", "uds-hit-target", isDisabled ? "cursor-not-allowed" : "cursor-pointer"),
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StartIcon, {
|
|
94
|
+
icon: startIcon,
|
|
95
|
+
className: require_components_client_Select_selectFieldStyles.getSelectStartIconClassName(size, hasValue),
|
|
96
|
+
iconProps: slotProps?.startIcon
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
99
|
+
className: require_components_client_Select_selectFieldStyles.getSelectTriggerClassName({
|
|
100
|
+
size,
|
|
101
|
+
hasValue,
|
|
102
|
+
disabled: isDisabled,
|
|
103
|
+
className: require_styles_styler.cx("flex", "min-w-0", "items-center", "self-stretch", className, triggerClassName)
|
|
104
|
+
}),
|
|
105
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
106
|
+
className: "w-full truncate text-left",
|
|
107
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Select_SelectValue.SelectValue, { fallback: placeholder })
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
(useAnimatedChevron || endIcon) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_HStack.HStack, {
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
gap: "1",
|
|
113
|
+
className: "shrink-0",
|
|
114
|
+
children: useAnimatedChevron ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.m.div, {
|
|
115
|
+
animate: { rotate: open ? 180 : 0 },
|
|
116
|
+
transition: reduceMotion ? { duration: 0 } : {
|
|
117
|
+
duration: .2,
|
|
118
|
+
ease: "easeInOut"
|
|
119
|
+
},
|
|
120
|
+
"data-testid": "select-chevron",
|
|
121
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndIcon, {
|
|
122
|
+
icon: _yahoo_uds_icons.ChevronDown,
|
|
123
|
+
className: require_components_client_Select_selectFieldStyles.getSelectEndIconClassName(size, hasValue),
|
|
124
|
+
iconProps: slotProps?.endIcon
|
|
125
|
+
})
|
|
126
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndIcon, {
|
|
127
|
+
icon: endIcon,
|
|
128
|
+
className: require_components_client_Select_selectFieldStyles.getSelectEndIconClassName(size, hasValue),
|
|
129
|
+
iconProps: slotProps?.endIcon
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
137
|
+
//#endregion
|
|
138
|
+
exports.SelectTrigger = SelectTrigger;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalIconSlot } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
|
|
4
|
+
import { BoxProps } from "../../Box.cjs";
|
|
5
|
+
import * as _$react from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Select/SelectTrigger.d.ts
|
|
8
|
+
type DataAttributes = {
|
|
9
|
+
[name: `data-${string}`]: string;
|
|
10
|
+
};
|
|
11
|
+
type NativeSelectTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size' | 'value' | 'defaultValue' | 'onChange' | 'name' | 'color' | 'children'>;
|
|
12
|
+
interface SelectTriggerProps extends NativeSelectTriggerProps {
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
/** Native form field name. Renders a hidden `<select>` for form submission. */
|
|
15
|
+
name?: string;
|
|
16
|
+
startIcon?: UniversalIconSlot;
|
|
17
|
+
endIcon?: UniversalIconSlot;
|
|
18
|
+
slotProps?: {
|
|
19
|
+
trigger?: Partial<React.ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes>;
|
|
20
|
+
triggerWrapper?: Partial<BoxProps & DataAttributes>;
|
|
21
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
22
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare const SelectTrigger: _$react.ForwardRefExoticComponent<SelectTriggerProps & _$react.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { SelectTrigger, type SelectTriggerProps };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { UniversalIconSlot } from "../../../types/dist/index.js";
|
|
4
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
5
|
+
import { BoxProps } from "../../Box.js";
|
|
6
|
+
import * as _$react from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Select/SelectTrigger.d.ts
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[name: `data-${string}`]: string;
|
|
11
|
+
};
|
|
12
|
+
type NativeSelectTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size' | 'value' | 'defaultValue' | 'onChange' | 'name' | 'color' | 'children'>;
|
|
13
|
+
interface SelectTriggerProps extends NativeSelectTriggerProps {
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** Native form field name. Renders a hidden `<select>` for form submission. */
|
|
16
|
+
name?: string;
|
|
17
|
+
startIcon?: UniversalIconSlot;
|
|
18
|
+
endIcon?: UniversalIconSlot;
|
|
19
|
+
slotProps?: {
|
|
20
|
+
trigger?: Partial<React.ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes>;
|
|
21
|
+
triggerWrapper?: Partial<BoxProps & DataAttributes>;
|
|
22
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
23
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
declare const SelectTrigger: _$react.ForwardRefExoticComponent<SelectTriggerProps & _$react.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SelectTrigger, type SelectTriggerProps };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
import { cx } from "../../../styles/styler.js";
|
|
5
|
+
import { IconSlot } from "../../IconSlot.js";
|
|
6
|
+
import { Box } from "../../Box.js";
|
|
7
|
+
import { HStack } from "../../HStack.js";
|
|
8
|
+
import { useSelectFieldContext } from "./selectContext.js";
|
|
9
|
+
import { getSelectEndIconClassName, getSelectStartIconClassName, getSelectTriggerClassName, getSelectTriggerWrapperClassName } from "./selectFieldStyles.js";
|
|
10
|
+
import { SelectValue as SelectValue$1 } from "./SelectValue.js";
|
|
11
|
+
import { ChevronDown } from "@yahoo/uds-icons";
|
|
12
|
+
import { forwardRef, memo } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Select, useSelectContext, useStoreState } from "@ariakit/react";
|
|
15
|
+
import { m } from "motion/react";
|
|
16
|
+
//#region src/components/client/Select/SelectTrigger.tsx
|
|
17
|
+
const StartIcon = memo(function StartIcon({ icon, className, iconProps }) {
|
|
18
|
+
if (!icon) return null;
|
|
19
|
+
return /* @__PURE__ */ jsx(IconSlot, {
|
|
20
|
+
icon,
|
|
21
|
+
className,
|
|
22
|
+
iconProps: {
|
|
23
|
+
variant: "outline",
|
|
24
|
+
...iconProps
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
StartIcon.displayName = "StartIcon";
|
|
29
|
+
const EndIcon = memo(function EndIcon({ icon, className, iconProps }) {
|
|
30
|
+
if (!icon) return null;
|
|
31
|
+
return /* @__PURE__ */ jsx(IconSlot, {
|
|
32
|
+
icon,
|
|
33
|
+
className,
|
|
34
|
+
iconProps: {
|
|
35
|
+
variant: "outline",
|
|
36
|
+
...iconProps
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
EndIcon.displayName = "EndIcon";
|
|
41
|
+
const SelectTrigger = forwardRef(function SelectTrigger({ placeholder, startIcon, endIcon, slotProps, className, disabled: disabledProp, name, onClick: triggerPassthroughOnClick, onPointerDown: triggerPassthroughOnPointerDown, ...triggerPassthroughProps }, ref) {
|
|
42
|
+
const { size, disabled, readOnly, required, hasError, uid, helpTextId, reduceMotion, triggerWrapperRef } = useSelectFieldContext();
|
|
43
|
+
const select = useSelectContext();
|
|
44
|
+
const value = useStoreState(select, "value");
|
|
45
|
+
const open = useStoreState(select, "open");
|
|
46
|
+
const useAnimatedChevron = endIcon === void 0;
|
|
47
|
+
const hasValue = value != null && value !== "";
|
|
48
|
+
const isDisabled = disabledProp ?? disabled;
|
|
49
|
+
const { className: triggerWrapperClassName, ...triggerWrapperProps } = slotProps?.triggerWrapper ?? {};
|
|
50
|
+
const { className: triggerClassName, onClick, ...triggerProps } = slotProps?.trigger ?? {};
|
|
51
|
+
const handlePointerDown = (event) => {
|
|
52
|
+
if (readOnly) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
triggerPassthroughOnPointerDown?.(event);
|
|
58
|
+
};
|
|
59
|
+
const handleClick = (event) => {
|
|
60
|
+
if (readOnly) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
triggerPassthroughOnClick?.(event);
|
|
66
|
+
onClick?.(event);
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
69
|
+
ref: triggerWrapperRef,
|
|
70
|
+
position: "relative",
|
|
71
|
+
display: "flex",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
width: "full",
|
|
74
|
+
...triggerWrapperProps,
|
|
75
|
+
className: getSelectTriggerWrapperClassName(size, hasValue, triggerWrapperClassName),
|
|
76
|
+
children: /* @__PURE__ */ jsxs(Select, {
|
|
77
|
+
ref,
|
|
78
|
+
id: uid,
|
|
79
|
+
name,
|
|
80
|
+
disabled: isDisabled,
|
|
81
|
+
required,
|
|
82
|
+
"aria-describedby": helpTextId,
|
|
83
|
+
"aria-invalid": hasError,
|
|
84
|
+
"aria-readonly": readOnly || void 0,
|
|
85
|
+
...triggerPassthroughProps,
|
|
86
|
+
...triggerProps,
|
|
87
|
+
onPointerDown: handlePointerDown,
|
|
88
|
+
onClick: handleClick,
|
|
89
|
+
className: cx("flex", "w-full", "min-w-0", "items-center", "border-0", "bg-transparent", "rounded-[inherit]", "outline-none", "shadow-none", "uds-hit-target", isDisabled ? "cursor-not-allowed" : "cursor-pointer"),
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(StartIcon, {
|
|
92
|
+
icon: startIcon,
|
|
93
|
+
className: getSelectStartIconClassName(size, hasValue),
|
|
94
|
+
iconProps: slotProps?.startIcon
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ jsx("span", {
|
|
97
|
+
className: getSelectTriggerClassName({
|
|
98
|
+
size,
|
|
99
|
+
hasValue,
|
|
100
|
+
disabled: isDisabled,
|
|
101
|
+
className: cx("flex", "min-w-0", "items-center", "self-stretch", className, triggerClassName)
|
|
102
|
+
}),
|
|
103
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
104
|
+
className: "w-full truncate text-left",
|
|
105
|
+
children: /* @__PURE__ */ jsx(SelectValue$1, { fallback: placeholder })
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
(useAnimatedChevron || endIcon) && /* @__PURE__ */ jsx(HStack, {
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
gap: "1",
|
|
111
|
+
className: "shrink-0",
|
|
112
|
+
children: useAnimatedChevron ? /* @__PURE__ */ jsx(m.div, {
|
|
113
|
+
animate: { rotate: open ? 180 : 0 },
|
|
114
|
+
transition: reduceMotion ? { duration: 0 } : {
|
|
115
|
+
duration: .2,
|
|
116
|
+
ease: "easeInOut"
|
|
117
|
+
},
|
|
118
|
+
"data-testid": "select-chevron",
|
|
119
|
+
children: /* @__PURE__ */ jsx(EndIcon, {
|
|
120
|
+
icon: ChevronDown,
|
|
121
|
+
className: getSelectEndIconClassName(size, hasValue),
|
|
122
|
+
iconProps: slotProps?.endIcon
|
|
123
|
+
})
|
|
124
|
+
}) : /* @__PURE__ */ jsx(EndIcon, {
|
|
125
|
+
icon: endIcon,
|
|
126
|
+
className: getSelectEndIconClassName(size, hasValue),
|
|
127
|
+
iconProps: slotProps?.endIcon
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
135
|
+
//#endregion
|
|
136
|
+
export { SelectTrigger };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
5
|
+
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _ariakit_react = require("@ariakit/react");
|
|
8
|
+
//#region src/components/client/Select/SelectValue.tsx
|
|
9
|
+
function normalizeSelectValue(value) {
|
|
10
|
+
if (typeof value === "string") return value;
|
|
11
|
+
return value.join(", ");
|
|
12
|
+
}
|
|
13
|
+
function SelectValue({ fallback, children, ...props }) {
|
|
14
|
+
const select = (0, _ariakit_react.useSelectContext)();
|
|
15
|
+
const storeValue = (0, _ariakit_react.useStoreState)(select, "value");
|
|
16
|
+
const items = (0, _ariakit_react.useStoreState)(select, "items");
|
|
17
|
+
const hasValue = storeValue != null && storeValue !== "";
|
|
18
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.SelectValue, {
|
|
19
|
+
fallback,
|
|
20
|
+
...props,
|
|
21
|
+
children: (value) => children(normalizeSelectValue(value))
|
|
22
|
+
});
|
|
23
|
+
if (!hasValue) return fallback ?? null;
|
|
24
|
+
return (items?.find((item) => item.value === storeValue))?.element?.textContent ?? storeValue;
|
|
25
|
+
}
|
|
26
|
+
SelectValue.displayName = "SelectValue";
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.SelectValue = SelectValue;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { SelectValueProps } from "@ariakit/react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/client/Select/SelectValue.d.ts
|
|
6
|
+
interface SelectValueProps$1 extends Omit<SelectValueProps, 'children'> {
|
|
7
|
+
fallback?: string;
|
|
8
|
+
children?: (value: string) => ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function SelectValue({
|
|
11
|
+
fallback,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}: SelectValueProps$1): ReactNode;
|
|
15
|
+
declare namespace SelectValue {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { SelectValue };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { SelectValueProps } from "@ariakit/react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/client/Select/SelectValue.d.ts
|
|
7
|
+
interface SelectValueProps$1 extends Omit<SelectValueProps, 'children'> {
|
|
8
|
+
fallback?: string;
|
|
9
|
+
children?: (value: string) => ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function SelectValue({
|
|
12
|
+
fallback,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}: SelectValueProps$1): ReactNode;
|
|
16
|
+
declare namespace SelectValue {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { SelectValue };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { SelectValue as SelectValue$1, useSelectContext, useStoreState } from "@ariakit/react";
|
|
6
|
+
//#region src/components/client/Select/SelectValue.tsx
|
|
7
|
+
function normalizeSelectValue(value) {
|
|
8
|
+
if (typeof value === "string") return value;
|
|
9
|
+
return value.join(", ");
|
|
10
|
+
}
|
|
11
|
+
function SelectValue({ fallback, children, ...props }) {
|
|
12
|
+
const select = useSelectContext();
|
|
13
|
+
const storeValue = useStoreState(select, "value");
|
|
14
|
+
const items = useStoreState(select, "items");
|
|
15
|
+
const hasValue = storeValue != null && storeValue !== "";
|
|
16
|
+
if (children) return /* @__PURE__ */ jsx(SelectValue$1, {
|
|
17
|
+
fallback,
|
|
18
|
+
...props,
|
|
19
|
+
children: (value) => children(normalizeSelectValue(value))
|
|
20
|
+
});
|
|
21
|
+
if (!hasValue) return fallback ?? null;
|
|
22
|
+
return (items?.find((item) => item.value === storeValue))?.element?.textContent ?? storeValue;
|
|
23
|
+
}
|
|
24
|
+
SelectValue.displayName = "SelectValue";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SelectValue };
|
|
@@ -0,0 +1,11 @@
|
|
|
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_Select_Select = require("./Select.cjs");
|
|
5
|
+
const require_components_client_Select_SelectContent = require("./SelectContent.cjs");
|
|
6
|
+
const require_components_client_Select_SelectDivider = require("./SelectDivider.cjs");
|
|
7
|
+
const require_components_client_Select_SelectItem = require("./SelectItem.cjs");
|
|
8
|
+
exports.Select = require_components_client_Select_Select.Select;
|
|
9
|
+
exports.SelectContent = require_components_client_Select_SelectContent.SelectContent;
|
|
10
|
+
exports.SelectDivider = require_components_client_Select_SelectDivider.SelectDivider;
|
|
11
|
+
exports.SelectItem = require_components_client_Select_SelectItem.SelectItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import { Select, SelectProps } from "./Select.cjs";
|
|
3
|
+
import { SelectContent, SelectContentProps } from "./SelectContent.cjs";
|
|
4
|
+
import { SelectDivider, SelectDividerProps } from "./SelectDivider.cjs";
|
|
5
|
+
import { SelectItem, SelectItemProps } from "./SelectItem.cjs";
|
|
6
|
+
export { Select, SelectContent, SelectContentProps, SelectDivider, SelectDividerProps, SelectItem, SelectItemProps, SelectProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { Select, SelectProps } from "./Select.js";
|
|
4
|
+
import { SelectContent, SelectContentProps } from "./SelectContent.js";
|
|
5
|
+
import { SelectDivider, SelectDividerProps } from "./SelectDivider.js";
|
|
6
|
+
import { SelectItem, SelectItemProps } from "./SelectItem.js";
|
|
7
|
+
export { Select, SelectContent, SelectContentProps, SelectDivider, SelectDividerProps, SelectItem, SelectItemProps, SelectProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { Select } from "./Select.js";
|
|
4
|
+
import { SelectContent } from "./SelectContent.js";
|
|
5
|
+
import { SelectDivider } from "./SelectDivider.js";
|
|
6
|
+
import { SelectItem } from "./SelectItem.js";
|
|
7
|
+
export { Select, SelectContent, SelectDivider, SelectItem };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
5
|
+
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
//#region src/components/client/Select/selectContext.tsx
|
|
8
|
+
const SelectFieldContext = (0, react.createContext)(null);
|
|
9
|
+
function useSelectFieldContext() {
|
|
10
|
+
const context = (0, react.useContext)(SelectFieldContext);
|
|
11
|
+
if (!context) throw new Error("Select subcomponents must be used within Select");
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
function useOptionalSelectFieldContext() {
|
|
15
|
+
return (0, react.useContext)(SelectFieldContext);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.SelectFieldContext = SelectFieldContext;
|
|
19
|
+
exports.useOptionalSelectFieldContext = useOptionalSelectFieldContext;
|
|
20
|
+
exports.useSelectFieldContext = useSelectFieldContext;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import { SelectSize, UniversalBoxProps } from "../../../types/dist/index.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { RefObject } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/client/Select/selectContext.d.ts
|
|
7
|
+
type SelectFieldContextValue = {
|
|
8
|
+
size: SelectSize;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
width?: UniversalBoxProps['width'];
|
|
14
|
+
reduceMotion?: boolean;
|
|
15
|
+
uid: string;
|
|
16
|
+
helpTextId?: string; /** Outer field wrapper; used to anchor SelectContent width and gutter. */
|
|
17
|
+
triggerWrapperRef: RefObject<HTMLDivElement | null>;
|
|
18
|
+
};
|
|
19
|
+
declare const SelectFieldContext: _$react.Context<SelectFieldContextValue | null>;
|
|
20
|
+
declare function useSelectFieldContext(): SelectFieldContextValue;
|
|
21
|
+
declare function useOptionalSelectFieldContext(): SelectFieldContextValue | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SelectFieldContext, type SelectFieldContextValue, useOptionalSelectFieldContext, useSelectFieldContext };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { SelectSize, UniversalBoxProps } from "../../../types/dist/index.js";
|
|
4
|
+
import * as _$react from "react";
|
|
5
|
+
import { RefObject } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Select/selectContext.d.ts
|
|
8
|
+
type SelectFieldContextValue = {
|
|
9
|
+
size: SelectSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
width?: UniversalBoxProps['width'];
|
|
15
|
+
reduceMotion?: boolean;
|
|
16
|
+
uid: string;
|
|
17
|
+
helpTextId?: string; /** Outer field wrapper; used to anchor SelectContent width and gutter. */
|
|
18
|
+
triggerWrapperRef: RefObject<HTMLDivElement | null>;
|
|
19
|
+
};
|
|
20
|
+
declare const SelectFieldContext: _$react.Context<SelectFieldContextValue | null>;
|
|
21
|
+
declare function useSelectFieldContext(): SelectFieldContextValue;
|
|
22
|
+
declare function useOptionalSelectFieldContext(): SelectFieldContextValue | null;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { SelectFieldContext, type SelectFieldContextValue, useOptionalSelectFieldContext, useSelectFieldContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
|
+
//#region src/components/client/Select/selectContext.tsx
|
|
6
|
+
const SelectFieldContext = createContext(null);
|
|
7
|
+
function useSelectFieldContext() {
|
|
8
|
+
const context = useContext(SelectFieldContext);
|
|
9
|
+
if (!context) throw new Error("Select subcomponents must be used within Select");
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
function useOptionalSelectFieldContext() {
|
|
13
|
+
return useContext(SelectFieldContext);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SelectFieldContext, useOptionalSelectFieldContext, useSelectFieldContext };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
5
|
+
//#region src/components/client/Select/selectFieldStyles.ts
|
|
6
|
+
function getSelectRootClassName({ size, hasValue, disabled, className }) {
|
|
7
|
+
return require_styles_styler.getStyles({
|
|
8
|
+
inputSizeRoot: size,
|
|
9
|
+
inputVariantRoot: "default",
|
|
10
|
+
inputVariantValueRoot: !hasValue ? "empty" : "filled",
|
|
11
|
+
className: require_styles_styler.cx([className, disabled ? "opacity-50" : ""])
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function getSelectLabelClassName(size, hasValue) {
|
|
15
|
+
return require_styles_styler.cx(require_styles_styler.getStyles({
|
|
16
|
+
inputSizeLabel: size,
|
|
17
|
+
inputVariantLabel: "default",
|
|
18
|
+
inputVariantValueLabel: !hasValue ? "empty" : "filled"
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
function getSelectLabelRequiredClassName(hasValue) {
|
|
22
|
+
return require_styles_styler.getStyles({
|
|
23
|
+
inputVariantLabelRequired: "default",
|
|
24
|
+
inputVariantValueLabelRequired: !hasValue ? "empty" : "filled"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Marks Select field triggers so Input `focus-within` wrapper rules skip them. */
|
|
28
|
+
const SELECT_FIELD_TRIGGER_CLASS = "uds-select-field-trigger";
|
|
29
|
+
function getSelectTriggerWrapperClassName(size, hasValue, className) {
|
|
30
|
+
return require_styles_styler.cx(require_styles_styler.getStyles({
|
|
31
|
+
inputSizeInputWrapperStatic: size,
|
|
32
|
+
inputSizeInputWrapperDynamic: size,
|
|
33
|
+
inputVariantInputWrapper: "default",
|
|
34
|
+
inputVariantValueInputWrapper: !hasValue ? "empty" : "filled"
|
|
35
|
+
}), "flex", "w-full", "items-center", "min-w-[200px]", "uds-ring-shadow", "uds-ring-within", SELECT_FIELD_TRIGGER_CLASS, className);
|
|
36
|
+
}
|
|
37
|
+
function getSelectTriggerClassName({ size, hasValue, disabled, className }) {
|
|
38
|
+
return require_styles_styler.getStyles({
|
|
39
|
+
inputSizeInput: size,
|
|
40
|
+
inputVariantInput: "default",
|
|
41
|
+
inputVariantValueInput: !hasValue ? "empty" : "filled",
|
|
42
|
+
inputVariantInputPlaceholder: "default",
|
|
43
|
+
inputVariantValueInputPlaceholder: !hasValue ? "empty" : "filled",
|
|
44
|
+
className: require_styles_styler.cx("grow", "bg-transparent", "bg-clip-text", "text-left", "focus-visible:outline-none", disabled ? "cursor-not-allowed" : "cursor-pointer", !hasValue && "text-muted", className)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function getSelectStartIconClassName(size, hasValue) {
|
|
48
|
+
return require_styles_styler.getStyles({
|
|
49
|
+
inputSizeStartIcon: size,
|
|
50
|
+
inputVariantStartIcon: "default",
|
|
51
|
+
inputVariantValueStartIcon: !hasValue ? "empty" : "filled"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function getSelectEndIconClassName(size, hasValue) {
|
|
55
|
+
return require_styles_styler.getStyles({
|
|
56
|
+
inputSizeEndIcon: size,
|
|
57
|
+
inputVariantEndIcon: "default",
|
|
58
|
+
inputVariantValueEndIcon: !hasValue ? "empty" : "filled"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function getSelectHelpTextClassName(size, hasValue) {
|
|
62
|
+
return require_styles_styler.cx(require_styles_styler.getStyles({
|
|
63
|
+
inputSizeHelperText: size,
|
|
64
|
+
inputVariantHelperText: "default",
|
|
65
|
+
inputVariantValueHelperText: !hasValue ? "empty" : "filled"
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
function getSelectHelperIconClassName(size, hasValue) {
|
|
69
|
+
return require_styles_styler.getStyles({
|
|
70
|
+
inputSizeHelperIcon: size,
|
|
71
|
+
inputVariantHelperIcon: "default",
|
|
72
|
+
inputVariantValueHelperIcon: !hasValue ? "empty" : "filled"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
exports.SELECT_FIELD_TRIGGER_CLASS = SELECT_FIELD_TRIGGER_CLASS;
|
|
77
|
+
exports.getSelectEndIconClassName = getSelectEndIconClassName;
|
|
78
|
+
exports.getSelectHelpTextClassName = getSelectHelpTextClassName;
|
|
79
|
+
exports.getSelectHelperIconClassName = getSelectHelperIconClassName;
|
|
80
|
+
exports.getSelectLabelClassName = getSelectLabelClassName;
|
|
81
|
+
exports.getSelectLabelRequiredClassName = getSelectLabelRequiredClassName;
|
|
82
|
+
exports.getSelectRootClassName = getSelectRootClassName;
|
|
83
|
+
exports.getSelectStartIconClassName = getSelectStartIconClassName;
|
|
84
|
+
exports.getSelectTriggerClassName = getSelectTriggerClassName;
|
|
85
|
+
exports.getSelectTriggerWrapperClassName = getSelectTriggerWrapperClassName;
|