@karakuri-ui/react 0.2.2 → 0.2.4
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/README.md +9 -0
- package/dist/components/ui/accordion.d.mts +49 -0
- package/dist/components/ui/accordion.d.ts +49 -0
- package/dist/components/ui/accordion.js +220 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/accordion.mjs +181 -0
- package/dist/components/ui/accordion.mjs.map +1 -0
- package/dist/components/ui/alert.d.mts +47 -0
- package/dist/components/ui/alert.d.ts +47 -0
- package/dist/components/ui/alert.js +223 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/alert.mjs +185 -0
- package/dist/components/ui/alert.mjs.map +1 -0
- package/dist/components/ui/avatar.d.mts +232 -0
- package/dist/components/ui/avatar.d.ts +232 -0
- package/dist/components/ui/avatar.js +250 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/avatar.mjs +209 -0
- package/dist/components/ui/avatar.mjs.map +1 -0
- package/dist/components/ui/badge.d.mts +31 -0
- package/dist/components/ui/badge.d.ts +31 -0
- package/dist/components/ui/badge.js +205 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/badge.mjs +170 -0
- package/dist/components/ui/badge.mjs.map +1 -0
- package/dist/components/ui/breadcrumb.d.mts +57 -0
- package/dist/components/ui/breadcrumb.d.ts +57 -0
- package/dist/components/ui/breadcrumb.js +209 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/breadcrumb.mjs +168 -0
- package/dist/components/ui/breadcrumb.mjs.map +1 -0
- package/dist/components/ui/button-group.d.mts +22 -0
- package/dist/components/ui/button-group.d.ts +22 -0
- package/dist/components/ui/button-group.js +107 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button-group.mjs +72 -0
- package/dist/components/ui/button-group.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +31 -0
- package/dist/components/ui/button.d.ts +31 -0
- package/dist/components/ui/button.js +176 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/button.mjs +141 -0
- package/dist/components/ui/button.mjs.map +1 -0
- package/dist/components/ui/card.d.mts +77 -0
- package/dist/components/ui/card.d.ts +77 -0
- package/dist/components/ui/card.js +370 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/card.mjs +328 -0
- package/dist/components/ui/card.mjs.map +1 -0
- package/dist/{chart.js → components/ui/chart.js} +29 -39
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/{chart.mjs → components/ui/chart.mjs} +21 -31
- package/dist/components/ui/chart.mjs.map +1 -0
- package/dist/components/ui/checkbox.d.mts +24 -0
- package/dist/components/ui/checkbox.d.ts +24 -0
- package/dist/components/ui/checkbox.js +173 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/checkbox.mjs +138 -0
- package/dist/components/ui/checkbox.mjs.map +1 -0
- package/dist/components/ui/divider.d.mts +27 -0
- package/dist/components/ui/divider.d.ts +27 -0
- package/dist/components/ui/divider.js +147 -0
- package/dist/components/ui/divider.js.map +1 -0
- package/dist/components/ui/divider.mjs +112 -0
- package/dist/components/ui/divider.mjs.map +1 -0
- package/dist/components/ui/drawer.d.mts +51 -0
- package/dist/components/ui/drawer.d.ts +51 -0
- package/dist/components/ui/drawer.js +225 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/drawer.mjs +178 -0
- package/dist/components/ui/drawer.mjs.map +1 -0
- package/dist/components/ui/dropdown.d.mts +59 -0
- package/dist/components/ui/dropdown.d.ts +59 -0
- package/dist/components/ui/dropdown.js +310 -0
- package/dist/components/ui/dropdown.js.map +1 -0
- package/dist/components/ui/dropdown.mjs +263 -0
- package/dist/components/ui/dropdown.mjs.map +1 -0
- package/dist/components/ui/field.d.mts +33 -0
- package/dist/components/ui/field.d.ts +33 -0
- package/dist/components/ui/field.js +146 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/field.mjs +108 -0
- package/dist/components/ui/field.mjs.map +1 -0
- package/dist/components/ui/icon-button.d.mts +20 -0
- package/dist/components/ui/icon-button.d.ts +20 -0
- package/dist/components/ui/icon-button.js +147 -0
- package/dist/components/ui/icon-button.js.map +1 -0
- package/dist/components/ui/icon-button.mjs +112 -0
- package/dist/components/ui/icon-button.mjs.map +1 -0
- package/dist/components/ui/index.d.mts +55 -0
- package/dist/components/ui/index.d.ts +55 -0
- package/dist/components/ui/index.js +476 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/index.mjs +246 -0
- package/dist/components/ui/index.mjs.map +1 -0
- package/dist/components/ui/input.d.mts +20 -0
- package/dist/components/ui/input.d.ts +20 -0
- package/dist/components/ui/input.js +250 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/input.mjs +215 -0
- package/dist/components/ui/input.mjs.map +1 -0
- package/dist/components/ui/metric-card.d.mts +53 -0
- package/dist/components/ui/metric-card.d.ts +53 -0
- package/dist/components/ui/metric-card.js +258 -0
- package/dist/components/ui/metric-card.js.map +1 -0
- package/dist/components/ui/metric-card.mjs +217 -0
- package/dist/components/ui/metric-card.mjs.map +1 -0
- package/dist/components/ui/modal.d.mts +77 -0
- package/dist/components/ui/modal.d.ts +77 -0
- package/dist/components/ui/modal.js +396 -0
- package/dist/components/ui/modal.js.map +1 -0
- package/dist/components/ui/modal.mjs +338 -0
- package/dist/components/ui/modal.mjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.mts +139 -0
- package/dist/components/ui/navigation-menu.d.ts +139 -0
- package/dist/components/ui/navigation-menu.js +531 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/navigation-menu.mjs +488 -0
- package/dist/components/ui/navigation-menu.mjs.map +1 -0
- package/dist/components/ui/pagination.d.mts +130 -0
- package/dist/components/ui/pagination.d.ts +130 -0
- package/dist/components/ui/pagination.js +495 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/pagination.mjs +449 -0
- package/dist/components/ui/pagination.mjs.map +1 -0
- package/dist/components/ui/popover.d.mts +41 -0
- package/dist/components/ui/popover.d.ts +41 -0
- package/dist/components/ui/popover.js +175 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/popover.mjs +133 -0
- package/dist/components/ui/popover.mjs.map +1 -0
- package/dist/components/ui/progress.d.mts +35 -0
- package/dist/components/ui/progress.d.ts +35 -0
- package/dist/components/ui/progress.js +194 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/progress.mjs +159 -0
- package/dist/components/ui/progress.mjs.map +1 -0
- package/dist/components/ui/radio-group.d.mts +40 -0
- package/dist/components/ui/radio-group.d.ts +40 -0
- package/dist/components/ui/radio-group.js +177 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/radio-group.mjs +140 -0
- package/dist/components/ui/radio-group.mjs.map +1 -0
- package/dist/components/ui/segmented.d.mts +30 -0
- package/dist/components/ui/segmented.d.ts +30 -0
- package/dist/components/ui/segmented.js +241 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/segmented.mjs +204 -0
- package/dist/components/ui/segmented.mjs.map +1 -0
- package/dist/components/ui/select.d.mts +31 -0
- package/dist/components/ui/select.d.ts +31 -0
- package/dist/components/ui/select.js +317 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/select.mjs +276 -0
- package/dist/components/ui/select.mjs.map +1 -0
- package/dist/components/ui/skeleton.d.mts +26 -0
- package/dist/components/ui/skeleton.d.ts +26 -0
- package/dist/components/ui/skeleton.js +144 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/skeleton.mjs +109 -0
- package/dist/components/ui/skeleton.mjs.map +1 -0
- package/dist/components/ui/slider.d.mts +38 -0
- package/dist/components/ui/slider.d.ts +38 -0
- package/dist/components/ui/slider.js +180 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/slider.mjs +145 -0
- package/dist/components/ui/slider.mjs.map +1 -0
- package/dist/components/ui/spinner.d.mts +23 -0
- package/dist/components/ui/spinner.d.ts +23 -0
- package/dist/components/ui/spinner.js +471 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/spinner.mjs +436 -0
- package/dist/components/ui/spinner.mjs.map +1 -0
- package/dist/components/ui/switch.d.mts +22 -0
- package/dist/components/ui/switch.d.ts +22 -0
- package/dist/components/ui/switch.js +173 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/switch.mjs +138 -0
- package/dist/components/ui/switch.mjs.map +1 -0
- package/dist/components/ui/table.d.mts +74 -0
- package/dist/components/ui/table.d.ts +74 -0
- package/dist/components/ui/table.js +240 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/table.mjs +199 -0
- package/dist/components/ui/table.mjs.map +1 -0
- package/dist/components/ui/tabs.d.mts +40 -0
- package/dist/components/ui/tabs.d.ts +40 -0
- package/dist/components/ui/tabs.js +238 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/tabs.mjs +199 -0
- package/dist/components/ui/tabs.mjs.map +1 -0
- package/dist/components/ui/textarea.d.mts +19 -0
- package/dist/components/ui/textarea.d.ts +19 -0
- package/dist/components/ui/textarea.js +181 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/textarea.mjs +146 -0
- package/dist/components/ui/textarea.mjs.map +1 -0
- package/dist/components/ui/toast.d.mts +93 -0
- package/dist/components/ui/toast.d.ts +93 -0
- package/dist/components/ui/toast.js +429 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toast.mjs +393 -0
- package/dist/components/ui/toast.mjs.map +1 -0
- package/dist/components/ui/toggle-group.d.mts +47 -0
- package/dist/components/ui/toggle-group.d.ts +47 -0
- package/dist/components/ui/toggle-group.js +186 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle-group.mjs +149 -0
- package/dist/components/ui/toggle-group.mjs.map +1 -0
- package/dist/components/ui/toggle.d.mts +19 -0
- package/dist/components/ui/toggle.d.ts +19 -0
- package/dist/components/ui/toggle.js +194 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/toggle.mjs +159 -0
- package/dist/components/ui/toggle.mjs.map +1 -0
- package/dist/components/ui/tooltip.d.mts +37 -0
- package/dist/components/ui/tooltip.d.ts +37 -0
- package/dist/components/ui/tooltip.js +137 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/tooltip.mjs +96 -0
- package/dist/components/ui/tooltip.mjs.map +1 -0
- package/dist/lib/utils.d.mts +10 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/lib/utils.js +33 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +9 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/package.json +11 -11
- package/dist/chart.js.map +0 -1
- package/dist/chart.mjs.map +0 -1
- package/dist/index.d.mts +0 -1636
- package/dist/index.d.ts +0 -1636
- package/dist/index.js +0 -7291
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -7048
- package/dist/index.mjs.map +0 -1
- /package/dist/{chart.d.mts → components/ui/chart.d.mts} +0 -0
- /package/dist/{chart.d.ts → components/ui/chart.d.ts} +0 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var select_exports = {};
|
|
31
|
+
__export(select_exports, {
|
|
32
|
+
Select: () => Select,
|
|
33
|
+
SelectContent: () => SelectContent,
|
|
34
|
+
SelectGroup: () => SelectGroup,
|
|
35
|
+
SelectItem: () => SelectItem,
|
|
36
|
+
SelectLabel: () => SelectLabel,
|
|
37
|
+
SelectSeparator: () => SelectSeparator,
|
|
38
|
+
SelectTrigger: () => SelectTrigger,
|
|
39
|
+
SelectValue: () => SelectValue
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(select_exports);
|
|
42
|
+
var React = __toESM(require("react"));
|
|
43
|
+
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
44
|
+
var import_utils = require("../../lib/utils");
|
|
45
|
+
const triggerRadiusMap = {
|
|
46
|
+
none: "rounded-none",
|
|
47
|
+
sm: "rounded-sm",
|
|
48
|
+
base: "rounded",
|
|
49
|
+
default: "rounded-md",
|
|
50
|
+
lg: "rounded-lg",
|
|
51
|
+
xl: "rounded-xl",
|
|
52
|
+
"2xl": "rounded-2xl",
|
|
53
|
+
"3xl": "rounded-3xl",
|
|
54
|
+
full: "rounded-full"
|
|
55
|
+
};
|
|
56
|
+
const contentRadiusFromRoot = {
|
|
57
|
+
none: "md",
|
|
58
|
+
sm: "md",
|
|
59
|
+
base: "md",
|
|
60
|
+
default: "md",
|
|
61
|
+
lg: "lg",
|
|
62
|
+
xl: "xl",
|
|
63
|
+
"2xl": "xl",
|
|
64
|
+
"3xl": "xl",
|
|
65
|
+
full: "xl"
|
|
66
|
+
};
|
|
67
|
+
const contentRadiusMap = {
|
|
68
|
+
md: "rounded-md",
|
|
69
|
+
// 6px
|
|
70
|
+
lg: "rounded-lg",
|
|
71
|
+
// 8px
|
|
72
|
+
xl: "rounded-xl"
|
|
73
|
+
// 12px
|
|
74
|
+
};
|
|
75
|
+
const itemRadiusMap = {
|
|
76
|
+
md: "rounded",
|
|
77
|
+
// 4px — perceptual balance (67%)
|
|
78
|
+
lg: "rounded-md",
|
|
79
|
+
// 6px — perceptual balance (75%)
|
|
80
|
+
xl: "rounded-lg"
|
|
81
|
+
// 8px — perceptual balance (67%)
|
|
82
|
+
};
|
|
83
|
+
const triggerSizeMap = {
|
|
84
|
+
xs: "h-9 px-3 text-sm",
|
|
85
|
+
// 36px
|
|
86
|
+
sm: "h-10 px-3 text-md",
|
|
87
|
+
// 40px
|
|
88
|
+
default: "h-11 px-4 text-base",
|
|
89
|
+
// 44px
|
|
90
|
+
lg: "h-12 px-4 text-base",
|
|
91
|
+
// 48px
|
|
92
|
+
xl: "h-14 px-4 text-base"
|
|
93
|
+
// 56px
|
|
94
|
+
};
|
|
95
|
+
const triggerIconSizeMap = {
|
|
96
|
+
xs: "icon-xs",
|
|
97
|
+
// 14px
|
|
98
|
+
sm: "icon-xs",
|
|
99
|
+
// 14px
|
|
100
|
+
default: "icon-sm",
|
|
101
|
+
// 16px
|
|
102
|
+
lg: "icon-sm",
|
|
103
|
+
// 16px
|
|
104
|
+
xl: "icon-sm"
|
|
105
|
+
// 16px
|
|
106
|
+
};
|
|
107
|
+
const itemSizeFromTrigger = {
|
|
108
|
+
xs: "sm",
|
|
109
|
+
sm: "sm",
|
|
110
|
+
default: "md",
|
|
111
|
+
lg: "md",
|
|
112
|
+
xl: "lg"
|
|
113
|
+
};
|
|
114
|
+
const itemSizeMap = {
|
|
115
|
+
sm: "pl-2 pr-6 py-1.5 text-sm",
|
|
116
|
+
md: "pl-3 pr-8 py-1.5 text-base",
|
|
117
|
+
lg: "pl-3 pr-10 py-2.5 text-base"
|
|
118
|
+
};
|
|
119
|
+
const indicatorSizeMap = {
|
|
120
|
+
sm: "right-2 h-3 w-3",
|
|
121
|
+
md: "right-2 h-3.5 w-3.5",
|
|
122
|
+
lg: "right-3 h-4 w-4"
|
|
123
|
+
};
|
|
124
|
+
const labelSizeMap = {
|
|
125
|
+
sm: "px-2 py-1.5 text-xs",
|
|
126
|
+
md: "px-2 py-1.5 text-xs",
|
|
127
|
+
lg: "px-3 py-2.5 text-xs"
|
|
128
|
+
};
|
|
129
|
+
const flushItemPaddingMap = {
|
|
130
|
+
sm: "pl-3 pr-7",
|
|
131
|
+
md: "pl-4 pr-9",
|
|
132
|
+
lg: "pl-4 pr-11"
|
|
133
|
+
};
|
|
134
|
+
const flushIndicatorSizeMap = {
|
|
135
|
+
sm: "right-3 h-3 w-3",
|
|
136
|
+
md: "right-3 h-3.5 w-3.5",
|
|
137
|
+
lg: "right-4 h-4 w-4"
|
|
138
|
+
};
|
|
139
|
+
const flushLabelPaddingMap = {
|
|
140
|
+
sm: "px-3",
|
|
141
|
+
md: "px-3",
|
|
142
|
+
lg: "px-4"
|
|
143
|
+
};
|
|
144
|
+
const SelectRootContext = React.createContext({ size: "default", radius: "default" });
|
|
145
|
+
const SelectStyleContext = React.createContext({ contentRadius: "xl", itemSize: "md", flush: false });
|
|
146
|
+
const SelectRoot = ({
|
|
147
|
+
size = "default",
|
|
148
|
+
radius = "default",
|
|
149
|
+
...props
|
|
150
|
+
}) => /* @__PURE__ */ React.createElement(SelectRootContext.Provider, { value: { size, radius } }, /* @__PURE__ */ React.createElement(SelectPrimitive.Root, { ...props }));
|
|
151
|
+
const SelectValue = SelectPrimitive.Value;
|
|
152
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
153
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
154
|
+
const { size, radius } = React.useContext(SelectRootContext);
|
|
155
|
+
return /* @__PURE__ */ React.createElement(
|
|
156
|
+
SelectPrimitive.Trigger,
|
|
157
|
+
{
|
|
158
|
+
ref,
|
|
159
|
+
className: (0, import_utils.cn)(
|
|
160
|
+
"flex w-full items-center justify-between bg-background text-foreground hover:bg-background-muted",
|
|
161
|
+
"border border-border-form",
|
|
162
|
+
triggerRadiusMap[radius],
|
|
163
|
+
"transition-colors duration-micro outline-transparent",
|
|
164
|
+
"focus-visible:shadow-[0_0_0_2px_var(--color-focus-ring)] focus:[outline:2px_solid_transparent]",
|
|
165
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
166
|
+
"data-[placeholder]:text-foreground/30",
|
|
167
|
+
triggerSizeMap[size],
|
|
168
|
+
className
|
|
169
|
+
),
|
|
170
|
+
...props
|
|
171
|
+
},
|
|
172
|
+
children,
|
|
173
|
+
/* @__PURE__ */ React.createElement(SelectPrimitive.Icon, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
174
|
+
"svg",
|
|
175
|
+
{
|
|
176
|
+
className: (0, import_utils.cn)("ml-2 shrink-0 text-text-muted", triggerIconSizeMap[size]),
|
|
177
|
+
fill: "none",
|
|
178
|
+
viewBox: "0 0 24 24",
|
|
179
|
+
stroke: "currentColor",
|
|
180
|
+
strokeWidth: 2,
|
|
181
|
+
"aria-hidden": "true"
|
|
182
|
+
},
|
|
183
|
+
/* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
184
|
+
))
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
188
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
189
|
+
SelectPrimitive.ScrollUpButton,
|
|
190
|
+
{
|
|
191
|
+
ref,
|
|
192
|
+
className: (0, import_utils.cn)("flex items-center justify-center py-1 cursor-default", className),
|
|
193
|
+
...props
|
|
194
|
+
},
|
|
195
|
+
/* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }))
|
|
196
|
+
));
|
|
197
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
198
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
199
|
+
SelectPrimitive.ScrollDownButton,
|
|
200
|
+
{
|
|
201
|
+
ref,
|
|
202
|
+
className: (0, import_utils.cn)("flex items-center justify-center py-1 cursor-default", className),
|
|
203
|
+
...props
|
|
204
|
+
},
|
|
205
|
+
/* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }))
|
|
206
|
+
));
|
|
207
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
208
|
+
const SelectContent = React.forwardRef(({ className, children, position = "popper", sideOffset = 1, flush = false, onCloseAutoFocus, ...props }, ref) => {
|
|
209
|
+
const { size, radius } = React.useContext(SelectRootContext);
|
|
210
|
+
const itemSize = itemSizeFromTrigger[size];
|
|
211
|
+
const contentRadius = contentRadiusFromRoot[radius];
|
|
212
|
+
return /* @__PURE__ */ React.createElement(SelectPrimitive.Portal, null, /* @__PURE__ */ React.createElement(SelectStyleContext.Provider, { value: { contentRadius, itemSize, flush } }, /* @__PURE__ */ React.createElement(
|
|
213
|
+
SelectPrimitive.Content,
|
|
214
|
+
{
|
|
215
|
+
ref,
|
|
216
|
+
onCloseAutoFocus: (e) => {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
onCloseAutoFocus?.(e);
|
|
219
|
+
},
|
|
220
|
+
className: (0, import_utils.cn)(
|
|
221
|
+
"relative z-dropdown min-w-[var(--radix-select-trigger-width)] overflow-hidden border border-border bg-background text-foreground shadow-lg",
|
|
222
|
+
flush ? "py-1" : "p-1",
|
|
223
|
+
contentRadiusMap[contentRadius],
|
|
224
|
+
position === "popper" && "max-h-[var(--radix-select-content-available-height)]",
|
|
225
|
+
className
|
|
226
|
+
),
|
|
227
|
+
position,
|
|
228
|
+
sideOffset,
|
|
229
|
+
...props
|
|
230
|
+
},
|
|
231
|
+
/* @__PURE__ */ React.createElement(SelectScrollUpButton, null),
|
|
232
|
+
/* @__PURE__ */ React.createElement(
|
|
233
|
+
SelectPrimitive.Viewport,
|
|
234
|
+
{
|
|
235
|
+
className: (0, import_utils.cn)(
|
|
236
|
+
position === "popper" && "h-[var(--radix-select-content-available-height)] w-full"
|
|
237
|
+
)
|
|
238
|
+
},
|
|
239
|
+
children
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ React.createElement(SelectScrollDownButton, null)
|
|
242
|
+
)));
|
|
243
|
+
});
|
|
244
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
245
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
246
|
+
const { contentRadius, itemSize, flush } = React.useContext(SelectStyleContext);
|
|
247
|
+
return /* @__PURE__ */ React.createElement(
|
|
248
|
+
SelectPrimitive.Item,
|
|
249
|
+
{
|
|
250
|
+
ref,
|
|
251
|
+
className: (0, import_utils.cn)(
|
|
252
|
+
"relative flex w-full cursor-default select-none items-center outline-none",
|
|
253
|
+
itemSizeMap[itemSize],
|
|
254
|
+
!flush && itemRadiusMap[contentRadius],
|
|
255
|
+
flush && flushItemPaddingMap[itemSize],
|
|
256
|
+
"transition-colors duration-fast",
|
|
257
|
+
"focus:bg-background-muted",
|
|
258
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
259
|
+
className
|
|
260
|
+
),
|
|
261
|
+
...props
|
|
262
|
+
},
|
|
263
|
+
/* @__PURE__ */ React.createElement(SelectPrimitive.ItemText, { className: "truncate" }, children),
|
|
264
|
+
/* @__PURE__ */ React.createElement("span", { className: (0, import_utils.cn)("absolute flex items-center justify-center", flush ? flushIndicatorSizeMap[itemSize] : indicatorSizeMap[itemSize]) }, /* @__PURE__ */ React.createElement(SelectPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))))
|
|
265
|
+
);
|
|
266
|
+
});
|
|
267
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
268
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
269
|
+
const { itemSize, flush } = React.useContext(SelectStyleContext);
|
|
270
|
+
return /* @__PURE__ */ React.createElement(
|
|
271
|
+
SelectPrimitive.Label,
|
|
272
|
+
{
|
|
273
|
+
ref,
|
|
274
|
+
className: (0, import_utils.cn)(
|
|
275
|
+
"font-semibold text-text-muted",
|
|
276
|
+
labelSizeMap[itemSize],
|
|
277
|
+
flush && flushLabelPaddingMap[itemSize],
|
|
278
|
+
className
|
|
279
|
+
),
|
|
280
|
+
...props
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
});
|
|
284
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
285
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
286
|
+
const { flush } = React.useContext(SelectStyleContext);
|
|
287
|
+
return /* @__PURE__ */ React.createElement(
|
|
288
|
+
SelectPrimitive.Separator,
|
|
289
|
+
{
|
|
290
|
+
ref,
|
|
291
|
+
className: (0, import_utils.cn)("h-px bg-border my-1", !flush && "-mx-1", className),
|
|
292
|
+
...props
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
});
|
|
296
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
297
|
+
const Select = Object.assign(SelectRoot, {
|
|
298
|
+
Trigger: SelectTrigger,
|
|
299
|
+
Value: SelectValue,
|
|
300
|
+
Content: SelectContent,
|
|
301
|
+
Item: SelectItem,
|
|
302
|
+
Group: SelectGroup,
|
|
303
|
+
Label: SelectLabel,
|
|
304
|
+
Separator: SelectSeparator
|
|
305
|
+
});
|
|
306
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
307
|
+
0 && (module.exports = {
|
|
308
|
+
Select,
|
|
309
|
+
SelectContent,
|
|
310
|
+
SelectGroup,
|
|
311
|
+
SelectItem,
|
|
312
|
+
SelectLabel,
|
|
313
|
+
SelectSeparator,
|
|
314
|
+
SelectTrigger,
|
|
315
|
+
SelectValue
|
|
316
|
+
});
|
|
317
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as SelectPrimitive from '@radix-ui/react-select'\nimport { cn } from '../../lib/utils'\n\n// Radius (matches Input — set at Root, propagates to Trigger and Content)\ntype SelectRadius = 'none' | 'sm' | 'base' | 'default' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n\nconst triggerRadiusMap: Record<SelectRadius, string> = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n base: 'rounded',\n default: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n}\n\n// Auto-mapping: root radius → content radius (3 levels)\ntype SelectContentRadius = 'md' | 'lg' | 'xl'\n\nconst contentRadiusFromRoot: Record<SelectRadius, SelectContentRadius> = {\n none: 'md',\n sm: 'md',\n base: 'md',\n default: 'md',\n lg: 'lg',\n xl: 'xl',\n '2xl': 'xl',\n '3xl': 'xl',\n full: 'xl',\n}\n\nconst contentRadiusMap: Record<SelectContentRadius, string> = {\n md: 'rounded-md', // 6px\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<SelectContentRadius, string> = {\n md: 'rounded', // 4px — perceptual balance (67%)\n lg: 'rounded-md', // 6px — perceptual balance (75%)\n xl: 'rounded-lg', // 8px — perceptual balance (67%)\n}\n\n// Size variants (matches Input component)\ntype SelectSize = 'xs' | 'sm' | 'default' | 'lg' | 'xl'\n\n// Trigger sizes (identical to Input)\nconst triggerSizeMap: Record<SelectSize, string> = {\n xs: 'h-9 px-3 text-sm', // 36px\n sm: 'h-10 px-3 text-md', // 40px\n default: 'h-11 px-4 text-base', // 44px\n lg: 'h-12 px-4 text-base', // 48px\n xl: 'h-14 px-4 text-base', // 56px\n}\n\n// Trigger icon sizes (matches Input icon pattern)\nconst triggerIconSizeMap: Record<SelectSize, string> = {\n xs: 'icon-xs', // 14px\n sm: 'icon-xs', // 14px\n default: 'icon-sm', // 16px\n lg: 'icon-sm', // 16px\n xl: 'icon-sm', // 16px\n}\n\n// Auto-mapping: trigger size → content item size (3 levels)\ntype SelectItemSize = 'sm' | 'md' | 'lg'\n\nconst itemSizeFromTrigger: Record<SelectSize, SelectItemSize> = {\n xs: 'sm',\n sm: 'sm',\n default: 'md',\n lg: 'md',\n xl: 'lg',\n}\n\n// Item sizes (font matches Trigger for seamless selection, padding controls density)\nconst itemSizeMap: Record<SelectItemSize, string> = {\n sm: 'pl-2 pr-6 py-1.5 text-sm',\n md: 'pl-3 pr-8 py-1.5 text-base',\n lg: 'pl-3 pr-10 py-2.5 text-base',\n}\n\n// Item indicator (check mark) — right-aligned\nconst indicatorSizeMap: Record<SelectItemSize, string> = {\n sm: 'right-2 h-3 w-3',\n md: 'right-2 h-3.5 w-3.5',\n lg: 'right-3 h-4 w-4',\n}\n\n// Label sizes\nconst labelSizeMap: Record<SelectItemSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2.5 text-xs',\n}\n\n// Flush mode — items span full width, no inner radius\nconst flushItemPaddingMap: Record<SelectItemSize, string> = {\n sm: 'pl-3 pr-7',\n md: 'pl-4 pr-9',\n lg: 'pl-4 pr-11',\n}\n\nconst flushIndicatorSizeMap: Record<SelectItemSize, string> = {\n sm: 'right-3 h-3 w-3',\n md: 'right-3 h-3.5 w-3.5',\n lg: 'right-4 h-4 w-4',\n}\n\nconst flushLabelPaddingMap: Record<SelectItemSize, string> = {\n sm: 'px-3',\n md: 'px-3',\n lg: 'px-4',\n}\n\n// Root context — set at Root, consumed by Trigger and Content\nconst SelectRootContext = React.createContext<{\n size: SelectSize\n radius: SelectRadius\n}>({ size: 'default', radius: 'default' })\n\n// Style context — set at Content, consumed by Item/Label\nconst SelectStyleContext = React.createContext<{\n contentRadius: SelectContentRadius\n itemSize: SelectItemSize\n flush: boolean\n}>({ contentRadius: 'xl', itemSize: 'md', flush: false })\n\n// Root — state management + size/radius context\nconst SelectRoot = ({\n size = 'default',\n radius = 'default',\n ...props\n}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> & {\n size?: SelectSize\n radius?: SelectRadius\n}) => (\n <SelectRootContext.Provider value={{ size, radius }}>\n <SelectPrimitive.Root {...props} />\n </SelectRootContext.Provider>\n)\n\n// Value — displays selected value or placeholder\nconst SelectValue = SelectPrimitive.Value\n\n// Group — groups related items\nconst SelectGroup = SelectPrimitive.Group\n\n// Trigger — the element that opens the select (reads size + radius from context)\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size, radius } = React.useContext(SelectRootContext)\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex w-full items-center justify-between bg-background text-foreground hover:bg-background-muted',\n 'border border-border-form',\n triggerRadiusMap[radius],\n 'transition-colors duration-micro outline-transparent',\n 'focus-visible:shadow-[0_0_0_2px_var(--color-focus-ring)] focus:[outline:2px_solid_transparent]',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[placeholder]:text-foreground/30',\n triggerSizeMap[size],\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <svg\n className={cn('ml-2 shrink-0 text-text-muted', triggerIconSizeMap[size])}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\n// ScrollUpButton — scroll indicator at top\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex items-center justify-center py-1 cursor-default', className)}\n {...props}\n >\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 15l7-7 7 7\" />\n </svg>\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\n// ScrollDownButton — scroll indicator at bottom\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex items-center justify-center py-1 cursor-default', className)}\n {...props}\n >\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\n// Content — the floating panel (reads size + radius from context, auto-maps both)\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {\n flush?: boolean\n }\n>(({ className, children, position = 'popper', sideOffset = 1, flush = false, onCloseAutoFocus, ...props }, ref) => {\n const { size, radius } = React.useContext(SelectRootContext)\n const itemSize = itemSizeFromTrigger[size]\n const contentRadius = contentRadiusFromRoot[radius]\n return (\n <SelectPrimitive.Portal>\n <SelectStyleContext.Provider value={{ contentRadius, itemSize, flush }}>\n <SelectPrimitive.Content\n ref={ref}\n onCloseAutoFocus={(e) => {\n e.preventDefault()\n onCloseAutoFocus?.(e)\n }}\n className={cn(\n 'relative z-dropdown min-w-[var(--radix-select-trigger-width)] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[contentRadius],\n position === 'popper' &&\n 'max-h-[var(--radix-select-content-available-height)]',\n className\n )}\n position={position}\n sideOffset={sideOffset}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n position === 'popper' &&\n 'h-[var(--radix-select-content-available-height)] w-full'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectStyleContext.Provider>\n </SelectPrimitive.Portal>\n )\n})\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\n// Item — a single selectable item (with right-aligned check indicator)\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const { contentRadius, itemSize, flush } = React.useContext(SelectStyleContext)\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default select-none items-center outline-none',\n itemSizeMap[itemSize],\n !flush && itemRadiusMap[contentRadius],\n flush && flushItemPaddingMap[itemSize],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"truncate\">{children}</SelectPrimitive.ItemText>\n <span className={cn('absolute flex items-center justify-center', flush ? flushIndicatorSizeMap[itemSize] : indicatorSizeMap[itemSize])}>\n <SelectPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={3} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n )\n})\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\n// Label — non-interactive group heading\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => {\n const { itemSize, flush } = React.useContext(SelectStyleContext)\n return (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n 'font-semibold text-text-muted',\n labelSizeMap[itemSize],\n flush && flushLabelPaddingMap[itemSize],\n className\n )}\n {...props}\n />\n )\n})\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\n// Separator — visual divider between groups\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n const { flush } = React.useContext(SelectStyleContext)\n return (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('h-px bg-border my-1', !flush && '-mx-1', className)}\n {...props}\n />\n )\n})\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport type { SelectRadius, SelectSize }\n\n// ─── Namespace ──────────────────────────────────────────\nconst Select = Object.assign(SelectRoot, {\n Trigger: SelectTrigger,\n Value: SelectValue,\n Content: SelectContent,\n Item: SelectItem,\n Group: SelectGroup,\n Label: SelectLabel,\n Separator: SelectSeparator,\n})\n\nexport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n SelectGroup,\n SelectLabel,\n SelectSeparator,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,sBAAiC;AACjC,mBAAmB;AAKnB,MAAM,mBAAiD;AAAA,EACrD,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AAKA,MAAM,wBAAmE;AAAA,EACvE,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AAEA,MAAM,mBAAwD;AAAA,EAC5D,IAAI;AAAA;AAAA,EACJ,IAAI;AA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,QAAQ;AAAA,QACtC;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,YAAY,cAAc,gBAAgB,MAAM;AAGhD,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,MAAM,IAAI,MAAM,WAAW,kBAAkB;AACrD,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,uBAAuB,CAAC,SAAS,SAAS,SAAS;AAAA,MAChE,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,gBAAgB,cAAc,gBAAgB,UAAU;AAKxD,MAAM,SAAS,OAAO,OAAO,YAAY;AAAA,EACvC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AACb,CAAC;","names":[]}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const triggerRadiusMap = {
|
|
6
|
+
none: "rounded-none",
|
|
7
|
+
sm: "rounded-sm",
|
|
8
|
+
base: "rounded",
|
|
9
|
+
default: "rounded-md",
|
|
10
|
+
lg: "rounded-lg",
|
|
11
|
+
xl: "rounded-xl",
|
|
12
|
+
"2xl": "rounded-2xl",
|
|
13
|
+
"3xl": "rounded-3xl",
|
|
14
|
+
full: "rounded-full"
|
|
15
|
+
};
|
|
16
|
+
const contentRadiusFromRoot = {
|
|
17
|
+
none: "md",
|
|
18
|
+
sm: "md",
|
|
19
|
+
base: "md",
|
|
20
|
+
default: "md",
|
|
21
|
+
lg: "lg",
|
|
22
|
+
xl: "xl",
|
|
23
|
+
"2xl": "xl",
|
|
24
|
+
"3xl": "xl",
|
|
25
|
+
full: "xl"
|
|
26
|
+
};
|
|
27
|
+
const contentRadiusMap = {
|
|
28
|
+
md: "rounded-md",
|
|
29
|
+
// 6px
|
|
30
|
+
lg: "rounded-lg",
|
|
31
|
+
// 8px
|
|
32
|
+
xl: "rounded-xl"
|
|
33
|
+
// 12px
|
|
34
|
+
};
|
|
35
|
+
const itemRadiusMap = {
|
|
36
|
+
md: "rounded",
|
|
37
|
+
// 4px — perceptual balance (67%)
|
|
38
|
+
lg: "rounded-md",
|
|
39
|
+
// 6px — perceptual balance (75%)
|
|
40
|
+
xl: "rounded-lg"
|
|
41
|
+
// 8px — perceptual balance (67%)
|
|
42
|
+
};
|
|
43
|
+
const triggerSizeMap = {
|
|
44
|
+
xs: "h-9 px-3 text-sm",
|
|
45
|
+
// 36px
|
|
46
|
+
sm: "h-10 px-3 text-md",
|
|
47
|
+
// 40px
|
|
48
|
+
default: "h-11 px-4 text-base",
|
|
49
|
+
// 44px
|
|
50
|
+
lg: "h-12 px-4 text-base",
|
|
51
|
+
// 48px
|
|
52
|
+
xl: "h-14 px-4 text-base"
|
|
53
|
+
// 56px
|
|
54
|
+
};
|
|
55
|
+
const triggerIconSizeMap = {
|
|
56
|
+
xs: "icon-xs",
|
|
57
|
+
// 14px
|
|
58
|
+
sm: "icon-xs",
|
|
59
|
+
// 14px
|
|
60
|
+
default: "icon-sm",
|
|
61
|
+
// 16px
|
|
62
|
+
lg: "icon-sm",
|
|
63
|
+
// 16px
|
|
64
|
+
xl: "icon-sm"
|
|
65
|
+
// 16px
|
|
66
|
+
};
|
|
67
|
+
const itemSizeFromTrigger = {
|
|
68
|
+
xs: "sm",
|
|
69
|
+
sm: "sm",
|
|
70
|
+
default: "md",
|
|
71
|
+
lg: "md",
|
|
72
|
+
xl: "lg"
|
|
73
|
+
};
|
|
74
|
+
const itemSizeMap = {
|
|
75
|
+
sm: "pl-2 pr-6 py-1.5 text-sm",
|
|
76
|
+
md: "pl-3 pr-8 py-1.5 text-base",
|
|
77
|
+
lg: "pl-3 pr-10 py-2.5 text-base"
|
|
78
|
+
};
|
|
79
|
+
const indicatorSizeMap = {
|
|
80
|
+
sm: "right-2 h-3 w-3",
|
|
81
|
+
md: "right-2 h-3.5 w-3.5",
|
|
82
|
+
lg: "right-3 h-4 w-4"
|
|
83
|
+
};
|
|
84
|
+
const labelSizeMap = {
|
|
85
|
+
sm: "px-2 py-1.5 text-xs",
|
|
86
|
+
md: "px-2 py-1.5 text-xs",
|
|
87
|
+
lg: "px-3 py-2.5 text-xs"
|
|
88
|
+
};
|
|
89
|
+
const flushItemPaddingMap = {
|
|
90
|
+
sm: "pl-3 pr-7",
|
|
91
|
+
md: "pl-4 pr-9",
|
|
92
|
+
lg: "pl-4 pr-11"
|
|
93
|
+
};
|
|
94
|
+
const flushIndicatorSizeMap = {
|
|
95
|
+
sm: "right-3 h-3 w-3",
|
|
96
|
+
md: "right-3 h-3.5 w-3.5",
|
|
97
|
+
lg: "right-4 h-4 w-4"
|
|
98
|
+
};
|
|
99
|
+
const flushLabelPaddingMap = {
|
|
100
|
+
sm: "px-3",
|
|
101
|
+
md: "px-3",
|
|
102
|
+
lg: "px-4"
|
|
103
|
+
};
|
|
104
|
+
const SelectRootContext = React.createContext({ size: "default", radius: "default" });
|
|
105
|
+
const SelectStyleContext = React.createContext({ contentRadius: "xl", itemSize: "md", flush: false });
|
|
106
|
+
const SelectRoot = ({
|
|
107
|
+
size = "default",
|
|
108
|
+
radius = "default",
|
|
109
|
+
...props
|
|
110
|
+
}) => /* @__PURE__ */ React.createElement(SelectRootContext.Provider, { value: { size, radius } }, /* @__PURE__ */ React.createElement(SelectPrimitive.Root, { ...props }));
|
|
111
|
+
const SelectValue = SelectPrimitive.Value;
|
|
112
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
113
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
114
|
+
const { size, radius } = React.useContext(SelectRootContext);
|
|
115
|
+
return /* @__PURE__ */ React.createElement(
|
|
116
|
+
SelectPrimitive.Trigger,
|
|
117
|
+
{
|
|
118
|
+
ref,
|
|
119
|
+
className: cn(
|
|
120
|
+
"flex w-full items-center justify-between bg-background text-foreground hover:bg-background-muted",
|
|
121
|
+
"border border-border-form",
|
|
122
|
+
triggerRadiusMap[radius],
|
|
123
|
+
"transition-colors duration-micro outline-transparent",
|
|
124
|
+
"focus-visible:shadow-[0_0_0_2px_var(--color-focus-ring)] focus:[outline:2px_solid_transparent]",
|
|
125
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
126
|
+
"data-[placeholder]:text-foreground/30",
|
|
127
|
+
triggerSizeMap[size],
|
|
128
|
+
className
|
|
129
|
+
),
|
|
130
|
+
...props
|
|
131
|
+
},
|
|
132
|
+
children,
|
|
133
|
+
/* @__PURE__ */ React.createElement(SelectPrimitive.Icon, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
134
|
+
"svg",
|
|
135
|
+
{
|
|
136
|
+
className: cn("ml-2 shrink-0 text-text-muted", triggerIconSizeMap[size]),
|
|
137
|
+
fill: "none",
|
|
138
|
+
viewBox: "0 0 24 24",
|
|
139
|
+
stroke: "currentColor",
|
|
140
|
+
strokeWidth: 2,
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
},
|
|
143
|
+
/* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
144
|
+
))
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
148
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
149
|
+
SelectPrimitive.ScrollUpButton,
|
|
150
|
+
{
|
|
151
|
+
ref,
|
|
152
|
+
className: cn("flex items-center justify-center py-1 cursor-default", className),
|
|
153
|
+
...props
|
|
154
|
+
},
|
|
155
|
+
/* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }))
|
|
156
|
+
));
|
|
157
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
158
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
159
|
+
SelectPrimitive.ScrollDownButton,
|
|
160
|
+
{
|
|
161
|
+
ref,
|
|
162
|
+
className: cn("flex items-center justify-center py-1 cursor-default", className),
|
|
163
|
+
...props
|
|
164
|
+
},
|
|
165
|
+
/* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }))
|
|
166
|
+
));
|
|
167
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
168
|
+
const SelectContent = React.forwardRef(({ className, children, position = "popper", sideOffset = 1, flush = false, onCloseAutoFocus, ...props }, ref) => {
|
|
169
|
+
const { size, radius } = React.useContext(SelectRootContext);
|
|
170
|
+
const itemSize = itemSizeFromTrigger[size];
|
|
171
|
+
const contentRadius = contentRadiusFromRoot[radius];
|
|
172
|
+
return /* @__PURE__ */ React.createElement(SelectPrimitive.Portal, null, /* @__PURE__ */ React.createElement(SelectStyleContext.Provider, { value: { contentRadius, itemSize, flush } }, /* @__PURE__ */ React.createElement(
|
|
173
|
+
SelectPrimitive.Content,
|
|
174
|
+
{
|
|
175
|
+
ref,
|
|
176
|
+
onCloseAutoFocus: (e) => {
|
|
177
|
+
e.preventDefault();
|
|
178
|
+
onCloseAutoFocus?.(e);
|
|
179
|
+
},
|
|
180
|
+
className: cn(
|
|
181
|
+
"relative z-dropdown min-w-[var(--radix-select-trigger-width)] overflow-hidden border border-border bg-background text-foreground shadow-lg",
|
|
182
|
+
flush ? "py-1" : "p-1",
|
|
183
|
+
contentRadiusMap[contentRadius],
|
|
184
|
+
position === "popper" && "max-h-[var(--radix-select-content-available-height)]",
|
|
185
|
+
className
|
|
186
|
+
),
|
|
187
|
+
position,
|
|
188
|
+
sideOffset,
|
|
189
|
+
...props
|
|
190
|
+
},
|
|
191
|
+
/* @__PURE__ */ React.createElement(SelectScrollUpButton, null),
|
|
192
|
+
/* @__PURE__ */ React.createElement(
|
|
193
|
+
SelectPrimitive.Viewport,
|
|
194
|
+
{
|
|
195
|
+
className: cn(
|
|
196
|
+
position === "popper" && "h-[var(--radix-select-content-available-height)] w-full"
|
|
197
|
+
)
|
|
198
|
+
},
|
|
199
|
+
children
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ React.createElement(SelectScrollDownButton, null)
|
|
202
|
+
)));
|
|
203
|
+
});
|
|
204
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
205
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
206
|
+
const { contentRadius, itemSize, flush } = React.useContext(SelectStyleContext);
|
|
207
|
+
return /* @__PURE__ */ React.createElement(
|
|
208
|
+
SelectPrimitive.Item,
|
|
209
|
+
{
|
|
210
|
+
ref,
|
|
211
|
+
className: cn(
|
|
212
|
+
"relative flex w-full cursor-default select-none items-center outline-none",
|
|
213
|
+
itemSizeMap[itemSize],
|
|
214
|
+
!flush && itemRadiusMap[contentRadius],
|
|
215
|
+
flush && flushItemPaddingMap[itemSize],
|
|
216
|
+
"transition-colors duration-fast",
|
|
217
|
+
"focus:bg-background-muted",
|
|
218
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
219
|
+
className
|
|
220
|
+
),
|
|
221
|
+
...props
|
|
222
|
+
},
|
|
223
|
+
/* @__PURE__ */ React.createElement(SelectPrimitive.ItemText, { className: "truncate" }, children),
|
|
224
|
+
/* @__PURE__ */ React.createElement("span", { className: cn("absolute flex items-center justify-center", flush ? flushIndicatorSizeMap[itemSize] : indicatorSizeMap[itemSize]) }, /* @__PURE__ */ React.createElement(SelectPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))))
|
|
225
|
+
);
|
|
226
|
+
});
|
|
227
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
228
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
229
|
+
const { itemSize, flush } = React.useContext(SelectStyleContext);
|
|
230
|
+
return /* @__PURE__ */ React.createElement(
|
|
231
|
+
SelectPrimitive.Label,
|
|
232
|
+
{
|
|
233
|
+
ref,
|
|
234
|
+
className: cn(
|
|
235
|
+
"font-semibold text-text-muted",
|
|
236
|
+
labelSizeMap[itemSize],
|
|
237
|
+
flush && flushLabelPaddingMap[itemSize],
|
|
238
|
+
className
|
|
239
|
+
),
|
|
240
|
+
...props
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
});
|
|
244
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
245
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
246
|
+
const { flush } = React.useContext(SelectStyleContext);
|
|
247
|
+
return /* @__PURE__ */ React.createElement(
|
|
248
|
+
SelectPrimitive.Separator,
|
|
249
|
+
{
|
|
250
|
+
ref,
|
|
251
|
+
className: cn("h-px bg-border my-1", !flush && "-mx-1", className),
|
|
252
|
+
...props
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
});
|
|
256
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
257
|
+
const Select = Object.assign(SelectRoot, {
|
|
258
|
+
Trigger: SelectTrigger,
|
|
259
|
+
Value: SelectValue,
|
|
260
|
+
Content: SelectContent,
|
|
261
|
+
Item: SelectItem,
|
|
262
|
+
Group: SelectGroup,
|
|
263
|
+
Label: SelectLabel,
|
|
264
|
+
Separator: SelectSeparator
|
|
265
|
+
});
|
|
266
|
+
export {
|
|
267
|
+
Select,
|
|
268
|
+
SelectContent,
|
|
269
|
+
SelectGroup,
|
|
270
|
+
SelectItem,
|
|
271
|
+
SelectLabel,
|
|
272
|
+
SelectSeparator,
|
|
273
|
+
SelectTrigger,
|
|
274
|
+
SelectValue
|
|
275
|
+
};
|
|
276
|
+
//# sourceMappingURL=select.mjs.map
|