@yahoo/uds 3.157.0 → 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 +3287 -596
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +276 -45
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +276 -45
- package/dist/automated-config/dist/properties.cjs +8 -1
- package/dist/automated-config/dist/properties.d.cts +8 -0
- package/dist/automated-config/dist/properties.d.ts +8 -0
- package/dist/automated-config/dist/properties.js +8 -1
- 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 +48 -33
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.js +49 -34
- 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/getButtonControlHeight.cjs +129 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.cts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.ts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.js +122 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.cjs +114 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.cts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.ts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.js +108 -0
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- 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/iconButtonMatchButtonHeight.cjs +110 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.cts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.js +108 -0
- package/dist/automated-config/dist/utils/index.cjs +106 -33
- package/dist/automated-config/dist/utils/index.d.cts +16 -4
- package/dist/automated-config/dist/utils/index.d.ts +16 -4
- package/dist/automated-config/dist/utils/index.js +107 -34
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.cjs +15 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.cts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.ts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.js +15 -0
- 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/Button.cjs +3 -3
- package/dist/components/client/Button.js +3 -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/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 +383 -73
- package/dist/config/dist/index.js +383 -73
- package/dist/css/dist/css/utils.cjs +3 -0
- package/dist/css/dist/css/utils.js +3 -0
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/css/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/css/dist/packages/config/dist/index.cjs +383 -73
- package/dist/css/dist/packages/config/dist/index.js +383 -73
- package/dist/css-tokens/dist/index.cjs +2 -0
- package/dist/css-tokens/dist/index.d.cts +2 -1
- package/dist/css-tokens/dist/index.d.ts +2 -1
- package/dist/css-tokens/dist/index.js +2 -1
- package/dist/index.cjs +34 -0
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +11 -3
- package/dist/styles/styler.d.cts +29 -12
- package/dist/styles/styler.d.ts +29 -12
- 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 +3287 -596
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +8 -1
- 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/getButtonControlHeight.cjs +126 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js +123 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +103 -33
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +104 -34
- 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 +383 -73
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +383 -73
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +12 -10
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +3 -2
- 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 +5 -2
- package/dist/tailwind-internal/dist/plugins/components.js +6 -3
- 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 +25 -0
- package/dist/tokens/automation/index.d.cts +6 -2
- package/dist/tokens/automation/index.d.ts +6 -2
- package/dist/tokens/automation/index.js +6 -2
- package/dist/tokens/consts/cssTokens.cjs +1 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +26 -0
- package/dist/tokens/index.d.cts +8 -4
- package/dist/tokens/index.d.ts +8 -4
- package/dist/tokens/index.js +7 -3
- 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 +718 -308
- package/dist/uds/generated/componentData.js +718 -308
- 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 +897 -398
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { UniversalIconSlot } from "../../../types/dist/index.js";
|
|
4
|
+
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
5
|
+
import * as _$react from "react";
|
|
6
|
+
import { SelectItemProps as SelectItemProps$1 } from "@ariakit/react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Select/SelectItem.d.ts
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[name: `data-${string}`]: string;
|
|
11
|
+
};
|
|
12
|
+
interface SelectItemProps extends Omit<SelectItemProps$1, 'className'> {
|
|
13
|
+
/** Icon displayed at the start of the select item. */
|
|
14
|
+
startIcon?: UniversalIconSlot;
|
|
15
|
+
slotProps?: {
|
|
16
|
+
root?: Partial<React.HTMLAttributes<HTMLDivElement> & DataAttributes>;
|
|
17
|
+
text?: Partial<Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'> & DataAttributes>;
|
|
18
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
19
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
20
|
+
};
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* **▾ Select item**
|
|
25
|
+
*
|
|
26
|
+
* @componentType Client component
|
|
27
|
+
*/
|
|
28
|
+
declare const SelectItem: _$react.ForwardRefExoticComponent<Omit<SelectItemProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SelectItem, type SelectItemProps };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
import { cx, getStyles } from "../../../styles/styler.js";
|
|
5
|
+
import { IconSlot } from "../../IconSlot.js";
|
|
6
|
+
import { HStack } from "../../HStack.js";
|
|
7
|
+
import { Check } from "@yahoo/uds-icons";
|
|
8
|
+
import { forwardRef, useMemo } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { SelectItem as SelectItem$1, useSelectContext, useStoreState } from "@ariakit/react";
|
|
11
|
+
import { AnimatePresence, m } from "motion/react";
|
|
12
|
+
//#region src/components/client/Select/SelectItem.tsx
|
|
13
|
+
const ITEM_CLASS_NAME = "uds-select-item";
|
|
14
|
+
const iconAnimationVariants = {
|
|
15
|
+
visible: {
|
|
16
|
+
scale: 1,
|
|
17
|
+
opacity: 1
|
|
18
|
+
},
|
|
19
|
+
hidden: {
|
|
20
|
+
scale: .7,
|
|
21
|
+
opacity: 0
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/** Mirrors Menu.ItemBase row chrome so option rows match menu item height. */
|
|
25
|
+
const buildSelectItemClasses = ({ disabled, className }) => {
|
|
26
|
+
return cx(ITEM_CLASS_NAME, "flex", "cursor-pointer", "outline-none", "data-[active-item]:z-10", "uds-ring", "!-outline-offset-2", "duration-20", "transition-[font-variation-settings]", "ease-in-out", "z-0", disabled && "opacity-50 cursor-not-allowed", className);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* **▾ Select item**
|
|
30
|
+
*
|
|
31
|
+
* @componentType Client component
|
|
32
|
+
*/
|
|
33
|
+
const SelectItem = forwardRef(function SelectItem({ children, className, slotProps, disabled, value, startIcon, ...props }, ref) {
|
|
34
|
+
const isSelected = useStoreState(useSelectContext(), "value") === value;
|
|
35
|
+
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
36
|
+
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
37
|
+
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
38
|
+
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
39
|
+
const selectItemClassName = buildSelectItemClasses({
|
|
40
|
+
disabled,
|
|
41
|
+
className
|
|
42
|
+
});
|
|
43
|
+
const selectSlotProps = useMemo(() => ({
|
|
44
|
+
root: {
|
|
45
|
+
className: cx(getStyles({
|
|
46
|
+
selectitemItemVariantRoot: "default",
|
|
47
|
+
selectitemItemVariantActiveRoot: isSelected ? "on" : "off"
|
|
48
|
+
}), rootClassName),
|
|
49
|
+
...rootSlotProps
|
|
50
|
+
},
|
|
51
|
+
text: {
|
|
52
|
+
className: cx(getStyles({
|
|
53
|
+
selectitemSizeText: "default",
|
|
54
|
+
selectitemItemVariantText: "default",
|
|
55
|
+
selectitemItemVariantActiveText: isSelected ? "on" : "off"
|
|
56
|
+
}), textClassName),
|
|
57
|
+
...textSlotProps
|
|
58
|
+
},
|
|
59
|
+
startIcon: {
|
|
60
|
+
className: cx(getStyles({
|
|
61
|
+
selectitemItemVariantIcon: "default",
|
|
62
|
+
selectitemItemVariantActiveIcon: isSelected ? "on" : "off"
|
|
63
|
+
}), startIconClassName),
|
|
64
|
+
...startIconSlotProps
|
|
65
|
+
}
|
|
66
|
+
}), [
|
|
67
|
+
isSelected,
|
|
68
|
+
rootClassName,
|
|
69
|
+
rootSlotProps,
|
|
70
|
+
startIconClassName,
|
|
71
|
+
startIconSlotProps,
|
|
72
|
+
textClassName,
|
|
73
|
+
textSlotProps
|
|
74
|
+
]);
|
|
75
|
+
const contentStyles = getStyles({
|
|
76
|
+
className: cx(`${ITEM_CLASS_NAME}-content`, "truncate", selectSlotProps.text.className),
|
|
77
|
+
textAlign: "start"
|
|
78
|
+
});
|
|
79
|
+
const classNames = useMemo(() => ({
|
|
80
|
+
root: getStyles({
|
|
81
|
+
selectitemSizeRoot: "default",
|
|
82
|
+
flexDirection: "row",
|
|
83
|
+
spacing: "0",
|
|
84
|
+
spacingHorizontal: "4",
|
|
85
|
+
spacingVertical: "3.5",
|
|
86
|
+
columnGap: "2",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
justifyContent: "space-between",
|
|
89
|
+
width: "full",
|
|
90
|
+
className: cx(selectItemClassName, selectSlotProps.root.className)
|
|
91
|
+
}),
|
|
92
|
+
startIcon: getStyles({
|
|
93
|
+
selectitemSizeStartIcon: "default",
|
|
94
|
+
className: selectSlotProps.startIcon.className
|
|
95
|
+
}),
|
|
96
|
+
endIcon: getStyles({
|
|
97
|
+
selectitemSizeEndIcon: "default",
|
|
98
|
+
className: cx(getStyles({
|
|
99
|
+
selectitemItemVariantIcon: "default",
|
|
100
|
+
selectitemItemVariantActiveIcon: "on"
|
|
101
|
+
}), endIconClassName)
|
|
102
|
+
})
|
|
103
|
+
}), [
|
|
104
|
+
endIconClassName,
|
|
105
|
+
selectItemClassName,
|
|
106
|
+
selectSlotProps.root.className,
|
|
107
|
+
selectSlotProps.startIcon.className
|
|
108
|
+
]);
|
|
109
|
+
return /* @__PURE__ */ jsxs(SelectItem$1, {
|
|
110
|
+
ref,
|
|
111
|
+
autoFocus: false,
|
|
112
|
+
disabled,
|
|
113
|
+
value,
|
|
114
|
+
className: classNames.root,
|
|
115
|
+
...rootSlotProps,
|
|
116
|
+
...props,
|
|
117
|
+
children: [/* @__PURE__ */ jsxs(HStack, {
|
|
118
|
+
gap: "2",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
width: "full",
|
|
121
|
+
children: [/* @__PURE__ */ jsx(AnimatePresence, {
|
|
122
|
+
initial: false,
|
|
123
|
+
children: startIcon && /* @__PURE__ */ jsx(m.span, {
|
|
124
|
+
variants: iconAnimationVariants,
|
|
125
|
+
initial: "hidden",
|
|
126
|
+
animate: "visible",
|
|
127
|
+
exit: "hidden",
|
|
128
|
+
className: "uds-start-icon inline-flex shrink-0 items-center",
|
|
129
|
+
children: /* @__PURE__ */ jsx(IconSlot, {
|
|
130
|
+
icon: startIcon,
|
|
131
|
+
className: classNames.startIcon,
|
|
132
|
+
iconProps: {
|
|
133
|
+
size: "sm",
|
|
134
|
+
variant: isSelected ? "fill" : "outline",
|
|
135
|
+
color: "current",
|
|
136
|
+
...startIconSlotProps
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
141
|
+
className: contentStyles,
|
|
142
|
+
...textSlotProps,
|
|
143
|
+
children
|
|
144
|
+
})]
|
|
145
|
+
}), /* @__PURE__ */ jsx(AnimatePresence, {
|
|
146
|
+
initial: false,
|
|
147
|
+
mode: "popLayout",
|
|
148
|
+
children: isSelected && /* @__PURE__ */ jsx(m.span, {
|
|
149
|
+
variants: iconAnimationVariants,
|
|
150
|
+
initial: "hidden",
|
|
151
|
+
animate: "visible",
|
|
152
|
+
exit: "hidden",
|
|
153
|
+
className: "uds-end-icon inline-flex shrink-0 items-center",
|
|
154
|
+
children: /* @__PURE__ */ jsx(IconSlot, {
|
|
155
|
+
icon: Check,
|
|
156
|
+
className: classNames.endIcon,
|
|
157
|
+
iconProps: {
|
|
158
|
+
size: "sm",
|
|
159
|
+
variant: "fill",
|
|
160
|
+
color: "current",
|
|
161
|
+
...endIconSlotProps
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
})]
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
SelectItem.displayName = "SelectItem";
|
|
169
|
+
//#endregion
|
|
170
|
+
export { SelectItem };
|
|
@@ -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 };
|