@northslopetech/altitude-ui 3.0.0 → 3.1.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/index.d.mts +440 -4
- package/dist/index.d.ts +440 -4
- package/dist/index.js +2166 -482
- package/dist/index.mjs +2125 -493
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -86,6 +86,16 @@ __export(index_exports, {
|
|
|
86
86
|
CaretLeftIcon: () => CaretLeftIcon,
|
|
87
87
|
CaretRightIcon: () => CaretRightIcon,
|
|
88
88
|
CaretUpIcon: () => CaretUpIcon,
|
|
89
|
+
Carousel: () => Carousel,
|
|
90
|
+
CarouselContent: () => CarouselContent,
|
|
91
|
+
CarouselItem: () => CarouselItem,
|
|
92
|
+
CarouselNext: () => CarouselNext,
|
|
93
|
+
CarouselPrevious: () => CarouselPrevious,
|
|
94
|
+
ChartContainer: () => ChartContainer,
|
|
95
|
+
ChartLegend: () => ChartLegend,
|
|
96
|
+
ChartLegendContent: () => ChartLegendContent,
|
|
97
|
+
ChartTooltip: () => ChartTooltip,
|
|
98
|
+
ChartTooltipContent: () => ChartTooltipContent,
|
|
89
99
|
ChatIcon: () => ChatIcon,
|
|
90
100
|
CheckIcon: () => CheckIcon,
|
|
91
101
|
Checkbox: () => Checkbox,
|
|
@@ -93,7 +103,21 @@ __export(index_exports, {
|
|
|
93
103
|
CheckmarkSquareIcon: () => CheckmarkSquareIcon,
|
|
94
104
|
CloseIcon: () => CloseIcon,
|
|
95
105
|
CogIcon: () => CogIcon,
|
|
106
|
+
Combobox: () => Combobox,
|
|
107
|
+
ComboboxChip: () => ComboboxChip,
|
|
108
|
+
ComboboxChips: () => ComboboxChips,
|
|
109
|
+
ComboboxChipsInput: () => ComboboxChipsInput,
|
|
110
|
+
ComboboxContent: () => ComboboxContent,
|
|
111
|
+
ComboboxEmpty: () => ComboboxEmpty,
|
|
112
|
+
ComboboxGroup: () => ComboboxGroup,
|
|
113
|
+
ComboboxInput: () => ComboboxInput,
|
|
114
|
+
ComboboxItem: () => ComboboxItem,
|
|
115
|
+
ComboboxLabel: () => ComboboxLabel,
|
|
116
|
+
ComboboxList: () => ComboboxList,
|
|
117
|
+
ComboboxSeparator: () => ComboboxSeparator,
|
|
118
|
+
ComboboxTrigger: () => ComboboxTrigger,
|
|
96
119
|
CredentialsIcon: () => CredentialsIcon,
|
|
120
|
+
DataTable: () => DataTable,
|
|
97
121
|
DataTableColumnHeader: () => DataTableColumnHeader,
|
|
98
122
|
DataTablePagination: () => DataTablePagination,
|
|
99
123
|
DataTableView: () => DataTableView,
|
|
@@ -138,6 +162,12 @@ __export(index_exports, {
|
|
|
138
162
|
DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
|
|
139
163
|
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
140
164
|
EditIcon: () => EditIcon,
|
|
165
|
+
Empty: () => Empty,
|
|
166
|
+
EmptyActions: () => EmptyActions,
|
|
167
|
+
EmptyContent: () => EmptyContent,
|
|
168
|
+
EmptyDescription: () => EmptyDescription,
|
|
169
|
+
EmptyMedia: () => EmptyMedia,
|
|
170
|
+
EmptyTitle: () => EmptyTitle,
|
|
141
171
|
EnvelopeIcon: () => EnvelopeIcon,
|
|
142
172
|
ExclamationIcon: () => ExclamationIcon,
|
|
143
173
|
EyeClosedIcon: () => EyeClosedIcon,
|
|
@@ -160,6 +190,9 @@ __export(index_exports, {
|
|
|
160
190
|
GraphPieIcon: () => GraphPieIcon,
|
|
161
191
|
HamburgerMenuIcon: () => HamburgerMenuIcon,
|
|
162
192
|
HomeIcon: () => HomeIcon,
|
|
193
|
+
HoverCard: () => HoverCard,
|
|
194
|
+
HoverCardContent: () => HoverCardContent,
|
|
195
|
+
HoverCardTrigger: () => HoverCardTrigger,
|
|
163
196
|
InformationIcon: () => InformationIcon,
|
|
164
197
|
Input: () => Input,
|
|
165
198
|
InputGroup: () => InputGroup,
|
|
@@ -196,6 +229,9 @@ __export(index_exports, {
|
|
|
196
229
|
PopoverTrigger: () => PopoverTrigger,
|
|
197
230
|
PrintIcon: () => PrintIcon,
|
|
198
231
|
QuestionCircleIcon: () => QuestionCircleIcon,
|
|
232
|
+
RadioGroup: () => RadioGroup,
|
|
233
|
+
RadioGroupCard: () => RadioGroupCard,
|
|
234
|
+
RadioGroupItem: () => RadioGroupItem,
|
|
199
235
|
Select: () => Select,
|
|
200
236
|
SelectContent: () => SelectContent,
|
|
201
237
|
SelectGroup: () => SelectGroup,
|
|
@@ -219,6 +255,7 @@ __export(index_exports, {
|
|
|
219
255
|
SidebarMenuButton: () => SidebarMenuButton,
|
|
220
256
|
SidebarMenuItem: () => SidebarMenuItem,
|
|
221
257
|
SidebarProvider: () => SidebarProvider,
|
|
258
|
+
Slider: () => Slider,
|
|
222
259
|
StarIcon: () => StarIcon,
|
|
223
260
|
StatementIcon: () => StatementIcon,
|
|
224
261
|
Switch: () => Switch,
|
|
@@ -235,8 +272,10 @@ __export(index_exports, {
|
|
|
235
272
|
TabsContent: () => TabsContent,
|
|
236
273
|
TabsList: () => TabsList,
|
|
237
274
|
TabsTrigger: () => TabsTrigger,
|
|
275
|
+
Tag: () => Tag,
|
|
238
276
|
Text: () => Text,
|
|
239
277
|
Textarea: () => Textarea,
|
|
278
|
+
Toaster: () => Toaster,
|
|
240
279
|
Tooltip: () => Tooltip,
|
|
241
280
|
TooltipContent: () => TooltipContent,
|
|
242
281
|
TooltipProvider: () => TooltipProvider,
|
|
@@ -247,6 +286,8 @@ __export(index_exports, {
|
|
|
247
286
|
UserMultiIcon: () => UserMultiIcon,
|
|
248
287
|
WarningIcon: () => WarningIcon,
|
|
249
288
|
WrenchIcon: () => WrenchIcon,
|
|
289
|
+
ZoomInIcon: () => ZoomInIcon,
|
|
290
|
+
ZoomOutIcon: () => ZoomOutIcon,
|
|
250
291
|
alertVariants: () => alertVariants,
|
|
251
292
|
avatarVariants: () => avatarVariants,
|
|
252
293
|
badgeVariants: () => badgeVariants,
|
|
@@ -254,19 +295,35 @@ __export(index_exports, {
|
|
|
254
295
|
buttonGroupVariants: () => buttonGroupVariants,
|
|
255
296
|
buttonVariants: () => buttonVariants,
|
|
256
297
|
checkboxVariants: () => checkboxVariants,
|
|
298
|
+
cn: () => cn,
|
|
299
|
+
comboboxChipsVariants: () => comboboxChipsVariants,
|
|
300
|
+
comboboxInputVariants: () => comboboxInputVariants,
|
|
301
|
+
createToaster: () => createToaster,
|
|
302
|
+
cva: () => import_class_variance_authority.cva,
|
|
257
303
|
dropdownMenuItemVariants: () => dropdownMenuItemVariants,
|
|
304
|
+
emptyMediaVariants: () => emptyMediaVariants,
|
|
305
|
+
emptyVariants: () => emptyVariants,
|
|
258
306
|
inputGroupAddonVariants: () => inputGroupAddonVariants,
|
|
259
307
|
inputGroupButtonVariants: () => inputGroupButtonVariants,
|
|
260
308
|
inputGroupVariants: () => inputGroupVariants,
|
|
261
309
|
inputVariants: () => inputVariants,
|
|
262
310
|
itemMediaVariants: () => itemMediaVariants,
|
|
263
311
|
itemVariants: () => itemVariants,
|
|
312
|
+
radioGroupVariants: () => radioGroupVariants,
|
|
313
|
+
radioItemVariants: () => radioItemVariants,
|
|
264
314
|
selectTriggerVariants: () => selectTriggerVariants,
|
|
265
315
|
switchVariants: () => switchVariants,
|
|
266
316
|
tabsListVariants: () => tabsListVariants,
|
|
267
317
|
tabsTriggerVariants: () => tabsTriggerVariants,
|
|
318
|
+
tagVariants: () => tagVariants,
|
|
268
319
|
textVariants: () => textVariants,
|
|
320
|
+
toast: () => toast,
|
|
321
|
+
toastManager: () => toastManager,
|
|
269
322
|
uploadVariants: () => uploadVariants,
|
|
323
|
+
useCarousel: () => useCarousel,
|
|
324
|
+
useChart: () => useChart,
|
|
325
|
+
useComboboxAnchor: () => useComboboxAnchor,
|
|
326
|
+
useComboboxFilter: () => useComboboxFilter,
|
|
270
327
|
useSidebar: () => useSidebar
|
|
271
328
|
});
|
|
272
329
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -963,10 +1020,110 @@ function ButtonGroupSeparator({
|
|
|
963
1020
|
);
|
|
964
1021
|
}
|
|
965
1022
|
|
|
966
|
-
// src/components/ui/
|
|
1023
|
+
// src/components/ui/empty.tsx
|
|
967
1024
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
968
1025
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
969
|
-
var
|
|
1026
|
+
var emptyVariants = (0, import_class_variance_authority5.cva)("w-full rounded-md p-8 text-center", {
|
|
1027
|
+
variants: {
|
|
1028
|
+
variant: {
|
|
1029
|
+
default: "",
|
|
1030
|
+
outline: "border border-default",
|
|
1031
|
+
background: "surface-muted",
|
|
1032
|
+
"outline-dashed": "border border-dashed border-default"
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
defaultVariants: {
|
|
1036
|
+
variant: "default"
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
var Empty = ({ className, variant, children, ref, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1040
|
+
"div",
|
|
1041
|
+
{
|
|
1042
|
+
ref,
|
|
1043
|
+
"data-slot": "empty",
|
|
1044
|
+
className: cn(emptyVariants({ variant }), className),
|
|
1045
|
+
...props,
|
|
1046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex w-full flex-col items-center gap-4", children })
|
|
1047
|
+
}
|
|
1048
|
+
);
|
|
1049
|
+
Empty.displayName = "Empty";
|
|
1050
|
+
var emptyMediaVariants = (0, import_class_variance_authority5.cva)("flex shrink-0 items-center justify-center", {
|
|
1051
|
+
variants: {
|
|
1052
|
+
variant: {
|
|
1053
|
+
default: "",
|
|
1054
|
+
icon: "size-10 rounded-lg surface-secondary p-2"
|
|
1055
|
+
}
|
|
1056
|
+
},
|
|
1057
|
+
defaultVariants: {
|
|
1058
|
+
variant: "default"
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
var EmptyMedia = ({ className, variant, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1062
|
+
"div",
|
|
1063
|
+
{
|
|
1064
|
+
"data-slot": "empty-media",
|
|
1065
|
+
className: cn(emptyMediaVariants({ variant }), className),
|
|
1066
|
+
...props
|
|
1067
|
+
}
|
|
1068
|
+
);
|
|
1069
|
+
EmptyMedia.displayName = "EmptyMedia";
|
|
1070
|
+
var EmptyContent = ({ className, ref, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1071
|
+
"div",
|
|
1072
|
+
{
|
|
1073
|
+
ref,
|
|
1074
|
+
"data-slot": "empty-content",
|
|
1075
|
+
className: cn("flex w-full flex-col gap-1", className),
|
|
1076
|
+
...props
|
|
1077
|
+
}
|
|
1078
|
+
);
|
|
1079
|
+
EmptyContent.displayName = "EmptyContent";
|
|
1080
|
+
var EmptyTitle = ({
|
|
1081
|
+
className,
|
|
1082
|
+
as: Component = "p",
|
|
1083
|
+
ref,
|
|
1084
|
+
...props
|
|
1085
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1086
|
+
Component,
|
|
1087
|
+
{
|
|
1088
|
+
ref,
|
|
1089
|
+
"data-slot": "empty-title",
|
|
1090
|
+
className: cn("type-body-md-medium text-default", className),
|
|
1091
|
+
...props
|
|
1092
|
+
}
|
|
1093
|
+
);
|
|
1094
|
+
EmptyTitle.displayName = "EmptyTitle";
|
|
1095
|
+
var EmptyDescription = ({
|
|
1096
|
+
className,
|
|
1097
|
+
ref,
|
|
1098
|
+
...props
|
|
1099
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1100
|
+
"p",
|
|
1101
|
+
{
|
|
1102
|
+
ref,
|
|
1103
|
+
"data-slot": "empty-description",
|
|
1104
|
+
className: cn("type-body-sm text-secondary", className),
|
|
1105
|
+
...props
|
|
1106
|
+
}
|
|
1107
|
+
);
|
|
1108
|
+
EmptyDescription.displayName = "EmptyDescription";
|
|
1109
|
+
var EmptyActions = ({ className, ref, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1110
|
+
"div",
|
|
1111
|
+
{
|
|
1112
|
+
ref,
|
|
1113
|
+
"data-slot": "empty-actions",
|
|
1114
|
+
className: cn(
|
|
1115
|
+
"flex flex-wrap items-center justify-center gap-2",
|
|
1116
|
+
className
|
|
1117
|
+
),
|
|
1118
|
+
...props
|
|
1119
|
+
}
|
|
1120
|
+
);
|
|
1121
|
+
EmptyActions.displayName = "EmptyActions";
|
|
1122
|
+
|
|
1123
|
+
// src/components/ui/text.tsx
|
|
1124
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1125
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1126
|
+
var textVariants = (0, import_class_variance_authority6.cva)("text-default", {
|
|
970
1127
|
variants: {
|
|
971
1128
|
variant: {
|
|
972
1129
|
// Headings
|
|
@@ -1019,7 +1176,7 @@ function getDefaultElement(variant) {
|
|
|
1019
1176
|
}
|
|
1020
1177
|
function Text({ className, variant, as, style, ref, ...props }) {
|
|
1021
1178
|
const Component = as || getDefaultElement(variant);
|
|
1022
|
-
return /* @__PURE__ */ (0,
|
|
1179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1023
1180
|
Component,
|
|
1024
1181
|
{
|
|
1025
1182
|
className: cn(textVariants({ variant }), className),
|
|
@@ -1031,9 +1188,9 @@ function Text({ className, variant, as, style, ref, ...props }) {
|
|
|
1031
1188
|
}
|
|
1032
1189
|
|
|
1033
1190
|
// src/components/ui/card.tsx
|
|
1034
|
-
var
|
|
1191
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1035
1192
|
function Card({ className, size = "default", ref, ...props }) {
|
|
1036
|
-
return /* @__PURE__ */ (0,
|
|
1193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1037
1194
|
"div",
|
|
1038
1195
|
{
|
|
1039
1196
|
ref,
|
|
@@ -1048,7 +1205,7 @@ function Card({ className, size = "default", ref, ...props }) {
|
|
|
1048
1205
|
);
|
|
1049
1206
|
}
|
|
1050
1207
|
function CardHeader({ className, ref, ...props }) {
|
|
1051
|
-
return /* @__PURE__ */ (0,
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1052
1209
|
"div",
|
|
1053
1210
|
{
|
|
1054
1211
|
ref,
|
|
@@ -1062,7 +1219,7 @@ function CardHeader({ className, ref, ...props }) {
|
|
|
1062
1219
|
);
|
|
1063
1220
|
}
|
|
1064
1221
|
function CardTitle({ className, ref, ...props }) {
|
|
1065
|
-
return /* @__PURE__ */ (0,
|
|
1222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1066
1223
|
Text,
|
|
1067
1224
|
{
|
|
1068
1225
|
ref,
|
|
@@ -1074,7 +1231,7 @@ function CardTitle({ className, ref, ...props }) {
|
|
|
1074
1231
|
);
|
|
1075
1232
|
}
|
|
1076
1233
|
function CardDescription({ className, ref, ...props }) {
|
|
1077
|
-
return /* @__PURE__ */ (0,
|
|
1234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1078
1235
|
Text,
|
|
1079
1236
|
{
|
|
1080
1237
|
ref,
|
|
@@ -1086,7 +1243,7 @@ function CardDescription({ className, ref, ...props }) {
|
|
|
1086
1243
|
);
|
|
1087
1244
|
}
|
|
1088
1245
|
function CardAction({ className, ref, ...props }) {
|
|
1089
|
-
return /* @__PURE__ */ (0,
|
|
1246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1090
1247
|
"div",
|
|
1091
1248
|
{
|
|
1092
1249
|
ref,
|
|
@@ -1100,7 +1257,7 @@ function CardAction({ className, ref, ...props }) {
|
|
|
1100
1257
|
);
|
|
1101
1258
|
}
|
|
1102
1259
|
function CardContent({ className, bleed, ref, ...props }) {
|
|
1103
|
-
return /* @__PURE__ */ (0,
|
|
1260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1104
1261
|
"div",
|
|
1105
1262
|
{
|
|
1106
1263
|
ref,
|
|
@@ -1114,7 +1271,7 @@ function CardContent({ className, bleed, ref, ...props }) {
|
|
|
1114
1271
|
);
|
|
1115
1272
|
}
|
|
1116
1273
|
function CardFooter({ className, ref, ...props }) {
|
|
1117
|
-
return /* @__PURE__ */ (0,
|
|
1274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1118
1275
|
"div",
|
|
1119
1276
|
{
|
|
1120
1277
|
ref,
|
|
@@ -1130,9 +1287,9 @@ function CardFooter({ className, ref, ...props }) {
|
|
|
1130
1287
|
|
|
1131
1288
|
// src/components/ui/select.tsx
|
|
1132
1289
|
var import_select = require("@base-ui/react/select");
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1135
|
-
var selectTriggerVariants = (0,
|
|
1290
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1291
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1292
|
+
var selectTriggerVariants = (0, import_class_variance_authority7.cva)(
|
|
1136
1293
|
[
|
|
1137
1294
|
// Layout
|
|
1138
1295
|
"flex w-full items-center justify-between",
|
|
@@ -1176,7 +1333,7 @@ function SelectTrigger({
|
|
|
1176
1333
|
ref,
|
|
1177
1334
|
...props
|
|
1178
1335
|
}) {
|
|
1179
|
-
return /* @__PURE__ */ (0,
|
|
1336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1180
1337
|
import_select.Select.Trigger,
|
|
1181
1338
|
{
|
|
1182
1339
|
"data-slot": "select-trigger",
|
|
@@ -1184,13 +1341,13 @@ function SelectTrigger({
|
|
|
1184
1341
|
className: cn(selectTriggerVariants({ size }), className),
|
|
1185
1342
|
...props,
|
|
1186
1343
|
children: [
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1344
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate text-left", children }),
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1189
1346
|
import_select.Select.Icon,
|
|
1190
1347
|
{
|
|
1191
1348
|
"data-slot": "select-icon",
|
|
1192
1349
|
className: "shrink-0 transition-transform duration-200 data-[open]:rotate-180",
|
|
1193
|
-
children: /* @__PURE__ */ (0,
|
|
1350
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CaretDownIcon, { size: 16, className: "text-secondary" })
|
|
1194
1351
|
}
|
|
1195
1352
|
)
|
|
1196
1353
|
]
|
|
@@ -1204,7 +1361,7 @@ function SelectContent({
|
|
|
1204
1361
|
ref,
|
|
1205
1362
|
...props
|
|
1206
1363
|
}) {
|
|
1207
|
-
return /* @__PURE__ */ (0,
|
|
1364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1208
1365
|
import_select.Select.Positioner,
|
|
1209
1366
|
{
|
|
1210
1367
|
side: "bottom",
|
|
@@ -1216,7 +1373,7 @@ function SelectContent({
|
|
|
1216
1373
|
positionerClassName
|
|
1217
1374
|
),
|
|
1218
1375
|
...props,
|
|
1219
|
-
children: /* @__PURE__ */ (0,
|
|
1376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1220
1377
|
import_select.Select.Popup,
|
|
1221
1378
|
{
|
|
1222
1379
|
ref,
|
|
@@ -1229,9 +1386,9 @@ function SelectContent({
|
|
|
1229
1386
|
className
|
|
1230
1387
|
),
|
|
1231
1388
|
children: [
|
|
1232
|
-
/* @__PURE__ */ (0,
|
|
1233
|
-
/* @__PURE__ */ (0,
|
|
1234
|
-
/* @__PURE__ */ (0,
|
|
1389
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectScrollUpButton, {}),
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_select.Select.List, { className: "p-[var(--3xs,2px)] overflow-y-auto max-h-[inherit]", children }),
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectScrollDownButton, {})
|
|
1235
1392
|
]
|
|
1236
1393
|
}
|
|
1237
1394
|
)
|
|
@@ -1239,7 +1396,7 @@ function SelectContent({
|
|
|
1239
1396
|
) });
|
|
1240
1397
|
}
|
|
1241
1398
|
function SelectLabel({ className, ref, ...props }) {
|
|
1242
|
-
return /* @__PURE__ */ (0,
|
|
1399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1243
1400
|
import_select.Select.GroupLabel,
|
|
1244
1401
|
{
|
|
1245
1402
|
ref,
|
|
@@ -1258,36 +1415,441 @@ function SelectItem({
|
|
|
1258
1415
|
ref,
|
|
1259
1416
|
...props
|
|
1260
1417
|
}) {
|
|
1261
|
-
return /* @__PURE__ */ (0,
|
|
1418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1262
1419
|
import_select.Select.Item,
|
|
1263
1420
|
{
|
|
1264
|
-
ref,
|
|
1265
|
-
label: label ?? (typeof children === "string" ? children : void 0),
|
|
1421
|
+
ref,
|
|
1422
|
+
label: label ?? (typeof children === "string" ? children : void 0),
|
|
1423
|
+
className: cn(
|
|
1424
|
+
"relative flex w-full cursor-pointer select-none items-center",
|
|
1425
|
+
"min-h-8 px-2 py-[5.5px] rounded-md",
|
|
1426
|
+
"type-body-sm-regular outline-none transition-colors text-default",
|
|
1427
|
+
"data-[highlighted]:interactive-hover",
|
|
1428
|
+
"data-[selected]:surface-secondary",
|
|
1429
|
+
"data-[selected]:data-[highlighted]:interactive-hover",
|
|
1430
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1431
|
+
className
|
|
1432
|
+
),
|
|
1433
|
+
...props,
|
|
1434
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_select.Select.ItemText, { className: "flex-1 min-w-0 truncate", children })
|
|
1435
|
+
}
|
|
1436
|
+
);
|
|
1437
|
+
}
|
|
1438
|
+
function SelectSeparator({
|
|
1439
|
+
className,
|
|
1440
|
+
ref,
|
|
1441
|
+
...props
|
|
1442
|
+
}) {
|
|
1443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1444
|
+
"div",
|
|
1445
|
+
{
|
|
1446
|
+
ref,
|
|
1447
|
+
role: "separator",
|
|
1448
|
+
className: cn(
|
|
1449
|
+
"-mx-[2px] my-1 h-px bg-[var(--color-border-default)]",
|
|
1450
|
+
className
|
|
1451
|
+
),
|
|
1452
|
+
...props
|
|
1453
|
+
}
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
function SelectScrollUpButton({
|
|
1457
|
+
className,
|
|
1458
|
+
ref,
|
|
1459
|
+
...props
|
|
1460
|
+
}) {
|
|
1461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1462
|
+
import_select.Select.ScrollUpArrow,
|
|
1463
|
+
{
|
|
1464
|
+
ref,
|
|
1465
|
+
className: cn(
|
|
1466
|
+
"flex cursor-default items-center justify-center py-1 text-secondary",
|
|
1467
|
+
className
|
|
1468
|
+
),
|
|
1469
|
+
...props,
|
|
1470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CaretUpIcon, { size: 14 })
|
|
1471
|
+
}
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
function SelectScrollDownButton({
|
|
1475
|
+
className,
|
|
1476
|
+
ref,
|
|
1477
|
+
...props
|
|
1478
|
+
}) {
|
|
1479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1480
|
+
import_select.Select.ScrollDownArrow,
|
|
1481
|
+
{
|
|
1482
|
+
ref,
|
|
1483
|
+
className: cn(
|
|
1484
|
+
"flex cursor-default items-center justify-center py-1 text-secondary",
|
|
1485
|
+
className
|
|
1486
|
+
),
|
|
1487
|
+
...props,
|
|
1488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CaretDownIcon, { size: 14 })
|
|
1489
|
+
}
|
|
1490
|
+
);
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
// src/components/ui/combobox.tsx
|
|
1494
|
+
var React5 = __toESM(require("react"));
|
|
1495
|
+
var import_react = require("@base-ui/react");
|
|
1496
|
+
|
|
1497
|
+
// src/components/ui/badge.tsx
|
|
1498
|
+
var React4 = __toESM(require("react"));
|
|
1499
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1500
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1501
|
+
var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
1502
|
+
[
|
|
1503
|
+
// Layout
|
|
1504
|
+
"inline-flex items-center justify-center gap-1",
|
|
1505
|
+
// Size
|
|
1506
|
+
"h-6 px-2",
|
|
1507
|
+
// Text
|
|
1508
|
+
"whitespace-nowrap type-label-xs-medium",
|
|
1509
|
+
// Shape
|
|
1510
|
+
"rounded-md",
|
|
1511
|
+
// Transitions
|
|
1512
|
+
"transition-colors",
|
|
1513
|
+
// Focus — flush ring, no gap
|
|
1514
|
+
"focus-visible:outline-none",
|
|
1515
|
+
"focus-visible:ring-2 focus-visible:ring-focus-default",
|
|
1516
|
+
// Icons
|
|
1517
|
+
"[&_svg]:pointer-events-none [&_svg]:size-3 [&_svg]:shrink-0"
|
|
1518
|
+
],
|
|
1519
|
+
{
|
|
1520
|
+
variants: {
|
|
1521
|
+
variant: {
|
|
1522
|
+
primary: ["interactive-accent interactive-accent-fg"],
|
|
1523
|
+
secondary: ["interactive-secondary interactive-secondary-fg"],
|
|
1524
|
+
outline: [
|
|
1525
|
+
"interactive-default interactive-default-fg",
|
|
1526
|
+
"border border-default"
|
|
1527
|
+
],
|
|
1528
|
+
ghost: ["interactive-default interactive-default-fg"],
|
|
1529
|
+
urgent: [
|
|
1530
|
+
"interactive-destructive interactive-destructive-fg",
|
|
1531
|
+
// Focus
|
|
1532
|
+
"focus-visible:ring-3 focus-visible:ring-focus-error"
|
|
1533
|
+
]
|
|
1534
|
+
}
|
|
1535
|
+
},
|
|
1536
|
+
defaultVariants: {}
|
|
1537
|
+
}
|
|
1538
|
+
);
|
|
1539
|
+
function isSingleDisplayCharacter(node) {
|
|
1540
|
+
if (node == null || typeof node === "boolean") return false;
|
|
1541
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
1542
|
+
const trimmed = String(node).trim();
|
|
1543
|
+
return trimmed.length === 1;
|
|
1544
|
+
}
|
|
1545
|
+
if (Array.isArray(node)) {
|
|
1546
|
+
const parts = node.filter((x) => x != null && typeof x !== "boolean");
|
|
1547
|
+
if (parts.length !== 1) return false;
|
|
1548
|
+
return isSingleDisplayCharacter(parts[0]);
|
|
1549
|
+
}
|
|
1550
|
+
if (React4.isValidElement(node)) {
|
|
1551
|
+
return isSingleDisplayCharacter(
|
|
1552
|
+
node.props.children
|
|
1553
|
+
);
|
|
1554
|
+
}
|
|
1555
|
+
return false;
|
|
1556
|
+
}
|
|
1557
|
+
function Badge({
|
|
1558
|
+
className,
|
|
1559
|
+
variant,
|
|
1560
|
+
iconLeft,
|
|
1561
|
+
iconRight,
|
|
1562
|
+
onKeyDown,
|
|
1563
|
+
style,
|
|
1564
|
+
children,
|
|
1565
|
+
ref,
|
|
1566
|
+
...props
|
|
1567
|
+
}) {
|
|
1568
|
+
if (!variant) {
|
|
1569
|
+
return null;
|
|
1570
|
+
}
|
|
1571
|
+
const circle = isSingleDisplayCharacter(children) && !iconLeft && !iconRight;
|
|
1572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1573
|
+
"span",
|
|
1574
|
+
{
|
|
1575
|
+
...props,
|
|
1576
|
+
role: "button",
|
|
1577
|
+
tabIndex: 0,
|
|
1578
|
+
onKeyDown: (e) => {
|
|
1579
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1580
|
+
e.preventDefault();
|
|
1581
|
+
e.currentTarget.click();
|
|
1582
|
+
}
|
|
1583
|
+
onKeyDown?.(e);
|
|
1584
|
+
},
|
|
1585
|
+
className: cn(
|
|
1586
|
+
badgeVariants({ variant }),
|
|
1587
|
+
circle ? "size-5 shrink-0 p-0" : "",
|
|
1588
|
+
className
|
|
1589
|
+
),
|
|
1590
|
+
style,
|
|
1591
|
+
ref,
|
|
1592
|
+
children: [
|
|
1593
|
+
iconLeft,
|
|
1594
|
+
children,
|
|
1595
|
+
iconRight
|
|
1596
|
+
]
|
|
1597
|
+
}
|
|
1598
|
+
);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
// src/components/ui/combobox.tsx
|
|
1602
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1603
|
+
var comboboxInputVariants = (0, import_class_variance_authority.cva)(
|
|
1604
|
+
[
|
|
1605
|
+
// Layout
|
|
1606
|
+
"flex w-full items-center",
|
|
1607
|
+
// Appearance
|
|
1608
|
+
"border border-default surface-default shadow-xs",
|
|
1609
|
+
// Typography
|
|
1610
|
+
"text-default type-body-sm-regular",
|
|
1611
|
+
// Transition
|
|
1612
|
+
"transition-colors",
|
|
1613
|
+
// Focus (delegated from inner input)
|
|
1614
|
+
"focus-within:outline-none focus-within:border-strong focus-within:ring-2 focus-within:ring-focus-default",
|
|
1615
|
+
// Disabled
|
|
1616
|
+
"has-[:disabled]:pointer-events-none has-[:disabled]:opacity-50 has-[:disabled]:cursor-not-allowed",
|
|
1617
|
+
// Error
|
|
1618
|
+
"has-[[aria-invalid=true]]:border-error",
|
|
1619
|
+
"has-[[aria-invalid=true]:focus-visible]:ring-2 has-[[aria-invalid=true]:focus-visible]:ring-focus-error has-[[aria-invalid=true]:focus-visible]:border-error"
|
|
1620
|
+
],
|
|
1621
|
+
{
|
|
1622
|
+
variants: {
|
|
1623
|
+
size: {
|
|
1624
|
+
default: "h-9 gap-2 pl-3 pr-2 rounded-md",
|
|
1625
|
+
large: "h-10 gap-3 pl-4 pr-2 rounded-md",
|
|
1626
|
+
small: "h-8 gap-1.5 px-2 rounded-sm",
|
|
1627
|
+
mini: "h-6 gap-1 px-1.5 rounded-sm type-body-xs-regular"
|
|
1628
|
+
}
|
|
1629
|
+
},
|
|
1630
|
+
defaultVariants: {
|
|
1631
|
+
size: "default"
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
);
|
|
1635
|
+
var Combobox = import_react.Combobox.Root;
|
|
1636
|
+
var useComboboxFilter = import_react.Combobox.useFilter;
|
|
1637
|
+
function ComboboxTrigger({
|
|
1638
|
+
className,
|
|
1639
|
+
...props
|
|
1640
|
+
}) {
|
|
1641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1642
|
+
import_react.Combobox.Trigger,
|
|
1643
|
+
{
|
|
1644
|
+
"data-slot": "combobox-trigger",
|
|
1645
|
+
"aria-label": "Toggle suggestions",
|
|
1646
|
+
className: cn(
|
|
1647
|
+
"shrink-0 transition-transform duration-200 data-[open]:rotate-180",
|
|
1648
|
+
className
|
|
1649
|
+
),
|
|
1650
|
+
...props,
|
|
1651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CaretDownIcon, { size: 16, className: "text-secondary" })
|
|
1652
|
+
}
|
|
1653
|
+
);
|
|
1654
|
+
}
|
|
1655
|
+
function ComboboxClear({ className, ...props }) {
|
|
1656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1657
|
+
import_react.Combobox.Clear,
|
|
1658
|
+
{
|
|
1659
|
+
"data-slot": "combobox-clear",
|
|
1660
|
+
"aria-label": "Clear selection",
|
|
1661
|
+
className: cn("shrink-0", className),
|
|
1662
|
+
...props,
|
|
1663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon, { size: 16, className: "text-secondary" })
|
|
1664
|
+
}
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
function ComboboxInput({
|
|
1668
|
+
className,
|
|
1669
|
+
children,
|
|
1670
|
+
size,
|
|
1671
|
+
disabled = false,
|
|
1672
|
+
showTrigger = true,
|
|
1673
|
+
showClear = false,
|
|
1674
|
+
ref,
|
|
1675
|
+
...props
|
|
1676
|
+
}) {
|
|
1677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1678
|
+
"div",
|
|
1679
|
+
{
|
|
1680
|
+
ref,
|
|
1681
|
+
"data-slot": "combobox-input",
|
|
1682
|
+
className: cn(
|
|
1683
|
+
"group/combobox-input",
|
|
1684
|
+
comboboxInputVariants({ size }),
|
|
1685
|
+
className
|
|
1686
|
+
),
|
|
1687
|
+
children: [
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1689
|
+
import_react.Combobox.Input,
|
|
1690
|
+
{
|
|
1691
|
+
disabled,
|
|
1692
|
+
className: "flex-1 min-w-0 bg-transparent outline-none placeholder:text-secondary",
|
|
1693
|
+
...props
|
|
1694
|
+
}
|
|
1695
|
+
),
|
|
1696
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxClear, { disabled }),
|
|
1697
|
+
showTrigger && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1698
|
+
ComboboxTrigger,
|
|
1699
|
+
{
|
|
1700
|
+
className: "group-has-[[data-slot=combobox-clear]]/combobox-input:hidden",
|
|
1701
|
+
disabled
|
|
1702
|
+
}
|
|
1703
|
+
),
|
|
1704
|
+
children
|
|
1705
|
+
]
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1708
|
+
}
|
|
1709
|
+
function ComboboxContent({
|
|
1710
|
+
className,
|
|
1711
|
+
side = "bottom",
|
|
1712
|
+
sideOffset = 8,
|
|
1713
|
+
align = "start",
|
|
1714
|
+
alignOffset = 0,
|
|
1715
|
+
anchor,
|
|
1716
|
+
...props
|
|
1717
|
+
}) {
|
|
1718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react.Combobox.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1719
|
+
import_react.Combobox.Positioner,
|
|
1720
|
+
{
|
|
1721
|
+
side,
|
|
1722
|
+
sideOffset,
|
|
1723
|
+
align,
|
|
1724
|
+
alignOffset,
|
|
1725
|
+
anchor,
|
|
1726
|
+
className: "isolate z-50 w-[var(--anchor-width)] outline-none",
|
|
1727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1728
|
+
import_react.Combobox.Popup,
|
|
1729
|
+
{
|
|
1730
|
+
"data-slot": "combobox-content",
|
|
1731
|
+
className: cn(
|
|
1732
|
+
// Layout — matches SelectContent
|
|
1733
|
+
"group/combobox-content relative max-h-60 min-w-32 overflow-hidden",
|
|
1734
|
+
// Appearance
|
|
1735
|
+
"rounded-lg border border-default surface-default shadow-md",
|
|
1736
|
+
// Open / close animation
|
|
1737
|
+
"data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95",
|
|
1738
|
+
"data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95",
|
|
1739
|
+
"duration-150",
|
|
1740
|
+
className
|
|
1741
|
+
),
|
|
1742
|
+
...props
|
|
1743
|
+
}
|
|
1744
|
+
)
|
|
1745
|
+
}
|
|
1746
|
+
) });
|
|
1747
|
+
}
|
|
1748
|
+
function ComboboxList({ className, ...props }) {
|
|
1749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1750
|
+
import_react.Combobox.List,
|
|
1751
|
+
{
|
|
1752
|
+
"data-slot": "combobox-list",
|
|
1753
|
+
className: cn(
|
|
1754
|
+
// Layout — matches SelectContent list
|
|
1755
|
+
"group/combobox-list p-[2px] overflow-y-auto max-h-[inherit]",
|
|
1756
|
+
className
|
|
1757
|
+
),
|
|
1758
|
+
...props
|
|
1759
|
+
}
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
function ComboboxItem({
|
|
1763
|
+
className,
|
|
1764
|
+
children,
|
|
1765
|
+
...props
|
|
1766
|
+
}) {
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1768
|
+
import_react.Combobox.Item,
|
|
1769
|
+
{
|
|
1770
|
+
"data-slot": "combobox-item",
|
|
1771
|
+
className: cn(
|
|
1772
|
+
// Layout
|
|
1773
|
+
"relative flex w-full cursor-default select-none items-center gap-2",
|
|
1774
|
+
"min-h-8 py-[5.5px] pr-8 pl-2 rounded-md",
|
|
1775
|
+
// Typography & appearance
|
|
1776
|
+
"text-default type-body-sm-regular",
|
|
1777
|
+
"outline-none transition-colors",
|
|
1778
|
+
// Highlighted
|
|
1779
|
+
"data-[highlighted]:interactive-hover data-[highlighted]:outline-none",
|
|
1780
|
+
// Disabled
|
|
1781
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1782
|
+
// SVG
|
|
1783
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1784
|
+
className
|
|
1785
|
+
),
|
|
1786
|
+
...props,
|
|
1787
|
+
children: [
|
|
1788
|
+
children,
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1790
|
+
import_react.Combobox.ItemIndicator,
|
|
1791
|
+
{
|
|
1792
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CheckmarkIcon, { size: 16 }) })
|
|
1793
|
+
}
|
|
1794
|
+
)
|
|
1795
|
+
]
|
|
1796
|
+
}
|
|
1797
|
+
);
|
|
1798
|
+
}
|
|
1799
|
+
function ComboboxGroup({ className, ...props }) {
|
|
1800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1801
|
+
import_react.Combobox.Group,
|
|
1802
|
+
{
|
|
1803
|
+
"data-slot": "combobox-group",
|
|
1804
|
+
className: cn(className),
|
|
1805
|
+
...props
|
|
1806
|
+
}
|
|
1807
|
+
);
|
|
1808
|
+
}
|
|
1809
|
+
function ComboboxLabel({
|
|
1810
|
+
className,
|
|
1811
|
+
...props
|
|
1812
|
+
}) {
|
|
1813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1814
|
+
import_react.Combobox.GroupLabel,
|
|
1815
|
+
{
|
|
1816
|
+
"data-slot": "combobox-label",
|
|
1817
|
+
className: cn(
|
|
1818
|
+
"px-2 py-1.5 text-secondary type-label-xs-semibold",
|
|
1819
|
+
className
|
|
1820
|
+
),
|
|
1821
|
+
...props
|
|
1822
|
+
}
|
|
1823
|
+
);
|
|
1824
|
+
}
|
|
1825
|
+
function ComboboxEmpty({
|
|
1826
|
+
className,
|
|
1827
|
+
...props
|
|
1828
|
+
}) {
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1830
|
+
"div",
|
|
1831
|
+
{
|
|
1832
|
+
"data-slot": "combobox-empty",
|
|
1833
|
+
role: "status",
|
|
1266
1834
|
className: cn(
|
|
1267
|
-
|
|
1268
|
-
"
|
|
1269
|
-
"
|
|
1270
|
-
"
|
|
1271
|
-
"data-[selected]:surface-secondary",
|
|
1272
|
-
"data-[selected]:data-[highlighted]:interactive-hover",
|
|
1273
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1835
|
+
// Visible by default, hidden when the list contains items
|
|
1836
|
+
"flex group-has-[[data-slot=combobox-item]]/combobox-list:hidden",
|
|
1837
|
+
"w-full justify-center py-2 text-center",
|
|
1838
|
+
"type-body-sm-regular text-secondary",
|
|
1274
1839
|
className
|
|
1275
1840
|
),
|
|
1276
|
-
...props
|
|
1277
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.ItemText, { className: "flex-1 min-w-0 truncate", children })
|
|
1841
|
+
...props
|
|
1278
1842
|
}
|
|
1279
1843
|
);
|
|
1280
1844
|
}
|
|
1281
|
-
function
|
|
1845
|
+
function ComboboxSeparator({
|
|
1282
1846
|
className,
|
|
1283
|
-
ref,
|
|
1284
1847
|
...props
|
|
1285
1848
|
}) {
|
|
1286
|
-
return /* @__PURE__ */ (0,
|
|
1287
|
-
|
|
1849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1850
|
+
import_react.Combobox.Separator,
|
|
1288
1851
|
{
|
|
1289
|
-
|
|
1290
|
-
role: "separator",
|
|
1852
|
+
"data-slot": "combobox-separator",
|
|
1291
1853
|
className: cn(
|
|
1292
1854
|
"-mx-[2px] my-1 h-px bg-[var(--color-border-default)]",
|
|
1293
1855
|
className
|
|
@@ -1296,52 +1858,126 @@ function SelectSeparator({
|
|
|
1296
1858
|
}
|
|
1297
1859
|
);
|
|
1298
1860
|
}
|
|
1299
|
-
|
|
1861
|
+
var comboboxChipsVariants = (0, import_class_variance_authority.cva)(
|
|
1862
|
+
[
|
|
1863
|
+
// Layout
|
|
1864
|
+
"flex w-full flex-wrap items-center",
|
|
1865
|
+
"py-1",
|
|
1866
|
+
// Appearance
|
|
1867
|
+
"border border-default surface-default shadow-xs",
|
|
1868
|
+
// Typography
|
|
1869
|
+
"text-default type-body-sm-regular",
|
|
1870
|
+
// Transition
|
|
1871
|
+
"transition-colors",
|
|
1872
|
+
// Focus (delegated from inner input)
|
|
1873
|
+
"focus-within:outline-none focus-within:border-strong focus-within:ring-2 focus-within:ring-focus-default",
|
|
1874
|
+
// Disabled (uses data attribute since children are consumer-controlled)
|
|
1875
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",
|
|
1876
|
+
// Error
|
|
1877
|
+
"has-[[aria-invalid=true]]:border-error",
|
|
1878
|
+
"has-[[aria-invalid=true]:focus-visible]:ring-2 has-[[aria-invalid=true]:focus-visible]:ring-focus-error has-[[aria-invalid=true]:focus-visible]:border-error",
|
|
1879
|
+
// When chips are present, tighten horizontal padding
|
|
1880
|
+
"has-data-[slot=combobox-chip]:px-1"
|
|
1881
|
+
],
|
|
1882
|
+
{
|
|
1883
|
+
variants: {
|
|
1884
|
+
size: {
|
|
1885
|
+
default: "min-h-9 gap-1 pl-3 pr-2 rounded-md",
|
|
1886
|
+
large: "min-h-10 gap-1.5 pl-4 pr-2 rounded-md",
|
|
1887
|
+
small: "min-h-8 gap-1 px-2 rounded-sm",
|
|
1888
|
+
mini: "min-h-6 gap-0.5 px-1.5 rounded-sm type-body-xs-regular"
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
defaultVariants: {
|
|
1892
|
+
size: "default"
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
);
|
|
1896
|
+
function ComboboxChips({
|
|
1300
1897
|
className,
|
|
1301
|
-
|
|
1898
|
+
children,
|
|
1899
|
+
size,
|
|
1900
|
+
showTrigger = true,
|
|
1901
|
+
disabled = false,
|
|
1302
1902
|
...props
|
|
1303
1903
|
}) {
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1305
|
-
|
|
1904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1905
|
+
import_react.Combobox.Chips,
|
|
1306
1906
|
{
|
|
1307
|
-
|
|
1907
|
+
"data-slot": "combobox-chips",
|
|
1908
|
+
"data-disabled": disabled || void 0,
|
|
1909
|
+
className: cn(comboboxChipsVariants({ size }), className),
|
|
1910
|
+
...props,
|
|
1911
|
+
children: [
|
|
1912
|
+
children,
|
|
1913
|
+
showTrigger && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ComboboxTrigger, { className: "ml-auto", disabled })
|
|
1914
|
+
]
|
|
1915
|
+
}
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
function ComboboxChip({
|
|
1919
|
+
className,
|
|
1920
|
+
children,
|
|
1921
|
+
showRemove = true,
|
|
1922
|
+
removeLabel = "Remove",
|
|
1923
|
+
...props
|
|
1924
|
+
}) {
|
|
1925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1926
|
+
import_react.Combobox.Chip,
|
|
1927
|
+
{
|
|
1928
|
+
"data-slot": "combobox-chip",
|
|
1308
1929
|
className: cn(
|
|
1309
|
-
|
|
1930
|
+
badgeVariants({ variant: "secondary" }),
|
|
1931
|
+
// Overrides for chip context
|
|
1932
|
+
"gap-1 whitespace-nowrap",
|
|
1933
|
+
// Disabled
|
|
1934
|
+
"has-[:disabled]:pointer-events-none has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50",
|
|
1310
1935
|
className
|
|
1311
1936
|
),
|
|
1312
1937
|
...props,
|
|
1313
|
-
children:
|
|
1938
|
+
children: [
|
|
1939
|
+
children,
|
|
1940
|
+
showRemove && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1941
|
+
import_react.Combobox.ChipRemove,
|
|
1942
|
+
{
|
|
1943
|
+
"data-slot": "combobox-chip-remove",
|
|
1944
|
+
"aria-label": removeLabel,
|
|
1945
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inline-flex cursor-pointer opacity-50 hover:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon, { size: 12, className: "pointer-events-none" }) })
|
|
1946
|
+
}
|
|
1947
|
+
)
|
|
1948
|
+
]
|
|
1314
1949
|
}
|
|
1315
1950
|
);
|
|
1316
1951
|
}
|
|
1317
|
-
function
|
|
1952
|
+
function ComboboxChipsInput({
|
|
1318
1953
|
className,
|
|
1319
|
-
ref,
|
|
1320
1954
|
...props
|
|
1321
1955
|
}) {
|
|
1322
|
-
return /* @__PURE__ */ (0,
|
|
1323
|
-
|
|
1956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1957
|
+
import_react.Combobox.Input,
|
|
1324
1958
|
{
|
|
1325
|
-
|
|
1959
|
+
"data-slot": "combobox-chip-input",
|
|
1326
1960
|
className: cn(
|
|
1327
|
-
"flex
|
|
1961
|
+
"flex-1 min-w-16 bg-transparent outline-none placeholder:text-secondary",
|
|
1328
1962
|
className
|
|
1329
1963
|
),
|
|
1330
|
-
...props
|
|
1331
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CaretDownIcon, { size: 14 })
|
|
1964
|
+
...props
|
|
1332
1965
|
}
|
|
1333
1966
|
);
|
|
1334
1967
|
}
|
|
1968
|
+
function useComboboxAnchor() {
|
|
1969
|
+
return React5.useRef(null);
|
|
1970
|
+
}
|
|
1335
1971
|
|
|
1336
1972
|
// src/components/ui/field.tsx
|
|
1337
|
-
var
|
|
1338
|
-
var
|
|
1973
|
+
var import_react2 = require("react");
|
|
1974
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1339
1975
|
|
|
1340
1976
|
// src/components/ui/label.tsx
|
|
1341
|
-
var
|
|
1977
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1342
1978
|
var labelClasses = "type-label-sm-medium flex flex-row items-center gap-2 text-default select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50";
|
|
1343
1979
|
function Label({ className, ref, ...props }) {
|
|
1344
|
-
return /* @__PURE__ */ (0,
|
|
1980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1345
1981
|
"label",
|
|
1346
1982
|
{
|
|
1347
1983
|
ref,
|
|
@@ -1353,9 +1989,9 @@ function Label({ className, ref, ...props }) {
|
|
|
1353
1989
|
}
|
|
1354
1990
|
|
|
1355
1991
|
// src/components/ui/field.tsx
|
|
1356
|
-
var
|
|
1992
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1357
1993
|
function FieldSet({ className, ...props }) {
|
|
1358
|
-
return /* @__PURE__ */ (0,
|
|
1994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1359
1995
|
"fieldset",
|
|
1360
1996
|
{
|
|
1361
1997
|
"data-slot": "field-set",
|
|
@@ -1373,7 +2009,7 @@ function FieldLegend({
|
|
|
1373
2009
|
variant = "legend",
|
|
1374
2010
|
...props
|
|
1375
2011
|
}) {
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
2012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1377
2013
|
"legend",
|
|
1378
2014
|
{
|
|
1379
2015
|
"data-slot": "field-legend",
|
|
@@ -1389,7 +2025,7 @@ function FieldLegend({
|
|
|
1389
2025
|
);
|
|
1390
2026
|
}
|
|
1391
2027
|
function FieldGroup({ className, ...props }) {
|
|
1392
|
-
return /* @__PURE__ */ (0,
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1393
2029
|
"div",
|
|
1394
2030
|
{
|
|
1395
2031
|
"data-slot": "field-group",
|
|
@@ -1401,7 +2037,7 @@ function FieldGroup({ className, ...props }) {
|
|
|
1401
2037
|
}
|
|
1402
2038
|
);
|
|
1403
2039
|
}
|
|
1404
|
-
var fieldVariants = (0,
|
|
2040
|
+
var fieldVariants = (0, import_class_variance_authority9.cva)(
|
|
1405
2041
|
"group/field data-[invalid=true]:text-error flex w-full gap-3",
|
|
1406
2042
|
{
|
|
1407
2043
|
variants: {
|
|
@@ -1429,7 +2065,7 @@ function Field({
|
|
|
1429
2065
|
orientation = "vertical",
|
|
1430
2066
|
...props
|
|
1431
2067
|
}) {
|
|
1432
|
-
return /* @__PURE__ */ (0,
|
|
2068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1433
2069
|
"div",
|
|
1434
2070
|
{
|
|
1435
2071
|
role: "group",
|
|
@@ -1441,7 +2077,7 @@ function Field({
|
|
|
1441
2077
|
);
|
|
1442
2078
|
}
|
|
1443
2079
|
function FieldContent({ className, ...props }) {
|
|
1444
|
-
return /* @__PURE__ */ (0,
|
|
2080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1445
2081
|
"div",
|
|
1446
2082
|
{
|
|
1447
2083
|
"data-slot": "field-content",
|
|
@@ -1457,7 +2093,7 @@ function FieldLabel({
|
|
|
1457
2093
|
className,
|
|
1458
2094
|
...props
|
|
1459
2095
|
}) {
|
|
1460
|
-
return /* @__PURE__ */ (0,
|
|
2096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1461
2097
|
Label,
|
|
1462
2098
|
{
|
|
1463
2099
|
"data-slot": "field-label",
|
|
@@ -1472,7 +2108,7 @@ function FieldLabel({
|
|
|
1472
2108
|
);
|
|
1473
2109
|
}
|
|
1474
2110
|
function FieldTitle({ className, ...props }) {
|
|
1475
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1476
2112
|
"div",
|
|
1477
2113
|
{
|
|
1478
2114
|
"data-slot": "field-label",
|
|
@@ -1485,7 +2121,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
1485
2121
|
);
|
|
1486
2122
|
}
|
|
1487
2123
|
function FieldDescription({ className, ...props }) {
|
|
1488
|
-
return /* @__PURE__ */ (0,
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1489
2125
|
"p",
|
|
1490
2126
|
{
|
|
1491
2127
|
"data-slot": "field-description",
|
|
@@ -1504,7 +2140,7 @@ function FieldSeparator({
|
|
|
1504
2140
|
className,
|
|
1505
2141
|
...props
|
|
1506
2142
|
}) {
|
|
1507
|
-
return /* @__PURE__ */ (0,
|
|
2143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1508
2144
|
"div",
|
|
1509
2145
|
{
|
|
1510
2146
|
"data-slot": "field-separator",
|
|
@@ -1515,8 +2151,8 @@ function FieldSeparator({
|
|
|
1515
2151
|
),
|
|
1516
2152
|
...props,
|
|
1517
2153
|
children: [
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1519
|
-
children && /* @__PURE__ */ (0,
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
2155
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1520
2156
|
"span",
|
|
1521
2157
|
{
|
|
1522
2158
|
className: "surface-default text-secondary relative mx-auto block w-fit px-2",
|
|
@@ -1534,7 +2170,7 @@ function FieldError({
|
|
|
1534
2170
|
errors,
|
|
1535
2171
|
...props
|
|
1536
2172
|
}) {
|
|
1537
|
-
const content = (0,
|
|
2173
|
+
const content = (0, import_react2.useMemo)(() => {
|
|
1538
2174
|
if (children) {
|
|
1539
2175
|
return children;
|
|
1540
2176
|
}
|
|
@@ -1544,14 +2180,14 @@ function FieldError({
|
|
|
1544
2180
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
1545
2181
|
return errors[0].message;
|
|
1546
2182
|
}
|
|
1547
|
-
return /* @__PURE__ */ (0,
|
|
1548
|
-
(error, index) => error?.message && /* @__PURE__ */ (0,
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
2184
|
+
(error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: error.message }, index)
|
|
1549
2185
|
) });
|
|
1550
2186
|
}, [children, errors]);
|
|
1551
2187
|
if (!content) {
|
|
1552
2188
|
return null;
|
|
1553
2189
|
}
|
|
1554
|
-
return /* @__PURE__ */ (0,
|
|
2190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1555
2191
|
"div",
|
|
1556
2192
|
{
|
|
1557
2193
|
role: "alert",
|
|
@@ -1564,19 +2200,19 @@ function FieldError({
|
|
|
1564
2200
|
}
|
|
1565
2201
|
|
|
1566
2202
|
// src/components/ui/dialog.tsx
|
|
1567
|
-
var
|
|
2203
|
+
var React6 = __toESM(require("react"));
|
|
1568
2204
|
var import_dialog = require("@base-ui/react/dialog");
|
|
1569
|
-
var
|
|
1570
|
-
var DialogChromeContext =
|
|
2205
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2206
|
+
var DialogChromeContext = React6.createContext(null);
|
|
1571
2207
|
function useDialogChrome() {
|
|
1572
|
-
return
|
|
2208
|
+
return React6.useContext(DialogChromeContext) ?? { showCloseButton: false };
|
|
1573
2209
|
}
|
|
1574
2210
|
function DialogCloseControl({
|
|
1575
2211
|
className,
|
|
1576
2212
|
ref,
|
|
1577
2213
|
...props
|
|
1578
2214
|
}) {
|
|
1579
|
-
return /* @__PURE__ */ (0,
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1580
2216
|
import_dialog.Dialog.Close,
|
|
1581
2217
|
{
|
|
1582
2218
|
ref,
|
|
@@ -1588,8 +2224,8 @@ function DialogCloseControl({
|
|
|
1588
2224
|
),
|
|
1589
2225
|
...props,
|
|
1590
2226
|
children: [
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CloseIcon, { size: 16, "aria-hidden": "true" }),
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1593
2229
|
]
|
|
1594
2230
|
}
|
|
1595
2231
|
);
|
|
@@ -1599,7 +2235,7 @@ var DIALOG_MOBILE_FRAME = "w-[320px] min-h-[240px] max-h-[min(640px,calc(100dvh-
|
|
|
1599
2235
|
var Dialog = import_dialog.Dialog.Root;
|
|
1600
2236
|
var DialogTrigger = import_dialog.Dialog.Trigger;
|
|
1601
2237
|
function DialogOverlay({ className, ref, ...props }) {
|
|
1602
|
-
return /* @__PURE__ */ (0,
|
|
2238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1603
2239
|
import_dialog.Dialog.Backdrop,
|
|
1604
2240
|
{
|
|
1605
2241
|
ref,
|
|
@@ -1619,9 +2255,9 @@ function DialogContent({
|
|
|
1619
2255
|
ref,
|
|
1620
2256
|
...props
|
|
1621
2257
|
}) {
|
|
1622
|
-
return /* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
2258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_dialog.Dialog.Portal, { children: [
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogOverlay, {}),
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dialog.Dialog.Viewport, { className: "fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:items-center sm:p-6", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1625
2261
|
import_dialog.Dialog.Popup,
|
|
1626
2262
|
{
|
|
1627
2263
|
ref,
|
|
@@ -1633,13 +2269,13 @@ function DialogContent({
|
|
|
1633
2269
|
className
|
|
1634
2270
|
),
|
|
1635
2271
|
...props,
|
|
1636
|
-
children: /* @__PURE__ */ (0,
|
|
2272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogChromeContext, { value: { showCloseButton }, children })
|
|
1637
2273
|
}
|
|
1638
2274
|
) })
|
|
1639
2275
|
] });
|
|
1640
2276
|
}
|
|
1641
2277
|
function DialogBody({ className, ref, ...props }) {
|
|
1642
|
-
return /* @__PURE__ */ (0,
|
|
2278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1643
2279
|
"div",
|
|
1644
2280
|
{
|
|
1645
2281
|
ref,
|
|
@@ -1653,7 +2289,7 @@ function DialogBody({ className, ref, ...props }) {
|
|
|
1653
2289
|
);
|
|
1654
2290
|
}
|
|
1655
2291
|
function DialogFooter({ className, ref, ...props }) {
|
|
1656
|
-
return /* @__PURE__ */ (0,
|
|
2292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1657
2293
|
"div",
|
|
1658
2294
|
{
|
|
1659
2295
|
ref,
|
|
@@ -1672,7 +2308,7 @@ function DialogHeader({
|
|
|
1672
2308
|
...props
|
|
1673
2309
|
}) {
|
|
1674
2310
|
const { showCloseButton } = useDialogChrome();
|
|
1675
|
-
return /* @__PURE__ */ (0,
|
|
2311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1676
2312
|
"div",
|
|
1677
2313
|
{
|
|
1678
2314
|
ref,
|
|
@@ -1682,14 +2318,14 @@ function DialogHeader({
|
|
|
1682
2318
|
),
|
|
1683
2319
|
...props,
|
|
1684
2320
|
children: [
|
|
1685
|
-
/* @__PURE__ */ (0,
|
|
1686
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
2321
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex min-w-0 flex-col gap-1", children }),
|
|
2322
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogCloseControl, {}) : null
|
|
1687
2323
|
]
|
|
1688
2324
|
}
|
|
1689
2325
|
);
|
|
1690
2326
|
}
|
|
1691
2327
|
function DialogTitle({ className, ref, ...props }) {
|
|
1692
|
-
return /* @__PURE__ */ (0,
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1693
2329
|
import_dialog.Dialog.Title,
|
|
1694
2330
|
{
|
|
1695
2331
|
ref,
|
|
@@ -1703,7 +2339,7 @@ function DialogDescription({
|
|
|
1703
2339
|
ref,
|
|
1704
2340
|
...props
|
|
1705
2341
|
}) {
|
|
1706
|
-
return /* @__PURE__ */ (0,
|
|
2342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1707
2343
|
import_dialog.Dialog.Description,
|
|
1708
2344
|
{
|
|
1709
2345
|
ref,
|
|
@@ -1715,15 +2351,18 @@ function DialogDescription({
|
|
|
1715
2351
|
var DialogClose = import_dialog.Dialog.Close;
|
|
1716
2352
|
|
|
1717
2353
|
// src/components/ui/drawer.tsx
|
|
1718
|
-
var
|
|
2354
|
+
var React7 = __toESM(require("react"));
|
|
1719
2355
|
var import_vaul = require("vaul");
|
|
1720
|
-
var
|
|
1721
|
-
var
|
|
2356
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2357
|
+
var DrawerContext = React7.createContext({
|
|
2358
|
+
direction: "bottom"
|
|
2359
|
+
});
|
|
2360
|
+
var Drawer = ({ direction = "bottom", ...props }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerContext.Provider, { value: { direction }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_vaul.Drawer.Root, { direction, ...props }) });
|
|
1722
2361
|
var DrawerTrigger = import_vaul.Drawer.Trigger;
|
|
1723
2362
|
var DrawerPortal = import_vaul.Drawer.Portal;
|
|
1724
2363
|
var DrawerClose = import_vaul.Drawer.Close;
|
|
1725
|
-
var DrawerOverlay =
|
|
1726
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2364
|
+
var DrawerOverlay = React7.forwardRef(
|
|
2365
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1727
2366
|
import_vaul.Drawer.Overlay,
|
|
1728
2367
|
{
|
|
1729
2368
|
ref,
|
|
@@ -1734,44 +2373,43 @@ var DrawerOverlay = React5.forwardRef(
|
|
|
1734
2373
|
)
|
|
1735
2374
|
);
|
|
1736
2375
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
1737
|
-
var DrawerContent =
|
|
1738
|
-
({ className, children, ...props }, ref) =>
|
|
1739
|
-
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
"
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-full data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:border-default data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
1755
|
-
className
|
|
1756
|
-
),
|
|
1757
|
-
...props,
|
|
1758
|
-
children: [
|
|
1759
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1760
|
-
"div",
|
|
1761
|
-
{
|
|
1762
|
-
"aria-hidden": "true",
|
|
1763
|
-
className: "mx-auto mt-2 hidden h-[3px] w-[50px] shrink-0 rounded-[2px] surface-inverse group-data-[vaul-drawer-direction=bottom]/drawer-content:block"
|
|
1764
|
-
}
|
|
2376
|
+
var DrawerContent = React7.forwardRef(
|
|
2377
|
+
({ className, children, ...props }, ref) => {
|
|
2378
|
+
const { direction } = React7.useContext(DrawerContext);
|
|
2379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerPortal, { children: [
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerOverlay, {}),
|
|
2381
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2382
|
+
import_vaul.Drawer.Content,
|
|
2383
|
+
{
|
|
2384
|
+
ref,
|
|
2385
|
+
"data-slot": "drawer-content",
|
|
2386
|
+
className: cn(
|
|
2387
|
+
"group/drawer-content fixed z-50 flex h-auto flex-col surface-default shadow-lg outline-none",
|
|
2388
|
+
direction === "bottom" && "inset-x-0 bottom-0 mt-24 max-h-[80vh] rounded-t-xl border-t border-default",
|
|
2389
|
+
direction === "top" && "inset-x-0 top-0 mb-24 max-h-[80vh] rounded-b-xl border-b border-default",
|
|
2390
|
+
direction === "left" && "inset-y-0 left-0 h-full w-3/4 rounded-r-xl border-r border-default",
|
|
2391
|
+
direction === "right" && "inset-y-0 right-0 h-full w-3/4 rounded-l-xl border-l border-default",
|
|
2392
|
+
className
|
|
1765
2393
|
),
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
2394
|
+
...props,
|
|
2395
|
+
children: [
|
|
2396
|
+
direction === "bottom" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2397
|
+
"div",
|
|
2398
|
+
{
|
|
2399
|
+
"aria-hidden": "true",
|
|
2400
|
+
className: "mx-auto mt-2 h-[3px] w-[50px] shrink-0 rounded-[2px] surface-inverse"
|
|
2401
|
+
}
|
|
2402
|
+
),
|
|
2403
|
+
children
|
|
2404
|
+
]
|
|
2405
|
+
}
|
|
2406
|
+
)
|
|
2407
|
+
] });
|
|
2408
|
+
}
|
|
1771
2409
|
);
|
|
1772
2410
|
DrawerContent.displayName = "DrawerContent";
|
|
1773
|
-
var DrawerTitle =
|
|
1774
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2411
|
+
var DrawerTitle = React7.forwardRef(
|
|
2412
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "shrink-0 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1775
2413
|
import_vaul.Drawer.Title,
|
|
1776
2414
|
{
|
|
1777
2415
|
ref,
|
|
@@ -1783,8 +2421,8 @@ var DrawerTitle = React5.forwardRef(
|
|
|
1783
2421
|
) })
|
|
1784
2422
|
);
|
|
1785
2423
|
DrawerTitle.displayName = "DrawerTitle";
|
|
1786
|
-
var DrawerBody =
|
|
1787
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2424
|
+
var DrawerBody = React7.forwardRef(
|
|
2425
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1788
2426
|
"div",
|
|
1789
2427
|
{
|
|
1790
2428
|
ref,
|
|
@@ -1798,7 +2436,7 @@ var DrawerBody = React5.forwardRef(
|
|
|
1798
2436
|
)
|
|
1799
2437
|
);
|
|
1800
2438
|
DrawerBody.displayName = "DrawerBody";
|
|
1801
|
-
var DrawerDescription =
|
|
2439
|
+
var DrawerDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1802
2440
|
import_vaul.Drawer.Description,
|
|
1803
2441
|
{
|
|
1804
2442
|
ref,
|
|
@@ -1808,8 +2446,8 @@ var DrawerDescription = React5.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1808
2446
|
}
|
|
1809
2447
|
));
|
|
1810
2448
|
DrawerDescription.displayName = "DrawerDescription";
|
|
1811
|
-
var DrawerFooter =
|
|
1812
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2449
|
+
var DrawerFooter = React7.forwardRef(
|
|
2450
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1813
2451
|
"div",
|
|
1814
2452
|
{
|
|
1815
2453
|
ref,
|
|
@@ -1827,9 +2465,9 @@ DrawerFooter.displayName = "DrawerFooter";
|
|
|
1827
2465
|
// src/components/ui/breadcrumb.tsx
|
|
1828
2466
|
var import_merge_props2 = require("@base-ui/react/merge-props");
|
|
1829
2467
|
var import_use_render2 = require("@base-ui/react/use-render");
|
|
1830
|
-
var
|
|
2468
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1831
2469
|
function Breadcrumb({ className, ref, ...props }) {
|
|
1832
|
-
return /* @__PURE__ */ (0,
|
|
2470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1833
2471
|
"nav",
|
|
1834
2472
|
{
|
|
1835
2473
|
"aria-label": "breadcrumb",
|
|
@@ -1841,7 +2479,7 @@ function Breadcrumb({ className, ref, ...props }) {
|
|
|
1841
2479
|
);
|
|
1842
2480
|
}
|
|
1843
2481
|
function BreadcrumbList({ className, ref, ...props }) {
|
|
1844
|
-
return /* @__PURE__ */ (0,
|
|
2482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1845
2483
|
"ol",
|
|
1846
2484
|
{
|
|
1847
2485
|
"data-slot": "breadcrumb-list",
|
|
@@ -1855,7 +2493,7 @@ function BreadcrumbList({ className, ref, ...props }) {
|
|
|
1855
2493
|
);
|
|
1856
2494
|
}
|
|
1857
2495
|
function BreadcrumbItem({ className, ref, ...props }) {
|
|
1858
|
-
return /* @__PURE__ */ (0,
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1859
2497
|
"li",
|
|
1860
2498
|
{
|
|
1861
2499
|
"data-slot": "breadcrumb-item",
|
|
@@ -1887,7 +2525,7 @@ function BreadcrumbLink({
|
|
|
1887
2525
|
});
|
|
1888
2526
|
}
|
|
1889
2527
|
function BreadcrumbPage({ className, ref, ...props }) {
|
|
1890
|
-
return /* @__PURE__ */ (0,
|
|
2528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1891
2529
|
"span",
|
|
1892
2530
|
{
|
|
1893
2531
|
"data-slot": "breadcrumb-page",
|
|
@@ -1906,7 +2544,7 @@ function BreadcrumbSeparator({
|
|
|
1906
2544
|
ref,
|
|
1907
2545
|
...props
|
|
1908
2546
|
}) {
|
|
1909
|
-
return /* @__PURE__ */ (0,
|
|
2547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1910
2548
|
"li",
|
|
1911
2549
|
{
|
|
1912
2550
|
"data-slot": "breadcrumb-separator",
|
|
@@ -1915,7 +2553,7 @@ function BreadcrumbSeparator({
|
|
|
1915
2553
|
className: cn("[&>svg]:size-3.5", className),
|
|
1916
2554
|
ref,
|
|
1917
2555
|
...props,
|
|
1918
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
2556
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CaretRightIcon, { className: "text-current cn-rtl-flip" })
|
|
1919
2557
|
}
|
|
1920
2558
|
);
|
|
1921
2559
|
}
|
|
@@ -1924,7 +2562,7 @@ function BreadcrumbEllipsis({
|
|
|
1924
2562
|
ref,
|
|
1925
2563
|
...props
|
|
1926
2564
|
}) {
|
|
1927
|
-
return /* @__PURE__ */ (0,
|
|
2565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1928
2566
|
"span",
|
|
1929
2567
|
{
|
|
1930
2568
|
"data-slot": "breadcrumb-ellipsis",
|
|
@@ -1937,8 +2575,8 @@ function BreadcrumbEllipsis({
|
|
|
1937
2575
|
ref,
|
|
1938
2576
|
...props,
|
|
1939
2577
|
children: [
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
2578
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MoreMenuIcon, { className: "text-current" }),
|
|
2579
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "More" })
|
|
1942
2580
|
]
|
|
1943
2581
|
}
|
|
1944
2582
|
);
|
|
@@ -1946,18 +2584,18 @@ function BreadcrumbEllipsis({
|
|
|
1946
2584
|
|
|
1947
2585
|
// src/components/ui/tooltip.tsx
|
|
1948
2586
|
var import_tooltip = require("@base-ui/react/tooltip");
|
|
1949
|
-
var
|
|
2587
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1950
2588
|
function TooltipProvider({
|
|
1951
2589
|
delay = 0,
|
|
1952
2590
|
...props
|
|
1953
2591
|
}) {
|
|
1954
|
-
return /* @__PURE__ */ (0,
|
|
2592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_tooltip.Tooltip.Provider, { delay, ...props });
|
|
1955
2593
|
}
|
|
1956
2594
|
function Tooltip({ ...props }) {
|
|
1957
|
-
return /* @__PURE__ */ (0,
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_tooltip.Tooltip.Root, { ...props });
|
|
1958
2596
|
}
|
|
1959
2597
|
function TooltipTrigger({ ...props }) {
|
|
1960
|
-
return /* @__PURE__ */ (0,
|
|
2598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_tooltip.Tooltip.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
1961
2599
|
}
|
|
1962
2600
|
function TooltipContent({
|
|
1963
2601
|
className,
|
|
@@ -1968,7 +2606,7 @@ function TooltipContent({
|
|
|
1968
2606
|
children,
|
|
1969
2607
|
...props
|
|
1970
2608
|
}) {
|
|
1971
|
-
return /* @__PURE__ */ (0,
|
|
2609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1972
2610
|
import_tooltip.Tooltip.Positioner,
|
|
1973
2611
|
{
|
|
1974
2612
|
align,
|
|
@@ -1976,7 +2614,7 @@ function TooltipContent({
|
|
|
1976
2614
|
side,
|
|
1977
2615
|
sideOffset,
|
|
1978
2616
|
className: "isolate z-50",
|
|
1979
|
-
children: /* @__PURE__ */ (0,
|
|
2617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1980
2618
|
import_tooltip.Tooltip.Popup,
|
|
1981
2619
|
{
|
|
1982
2620
|
"data-slot": "tooltip-content",
|
|
@@ -2000,7 +2638,7 @@ function TooltipContent({
|
|
|
2000
2638
|
...props,
|
|
2001
2639
|
children: [
|
|
2002
2640
|
children,
|
|
2003
|
-
/* @__PURE__ */ (0,
|
|
2641
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2004
2642
|
import_tooltip.Tooltip.Arrow,
|
|
2005
2643
|
{
|
|
2006
2644
|
className: cn(
|
|
@@ -2025,14 +2663,281 @@ function TooltipContent({
|
|
|
2025
2663
|
) });
|
|
2026
2664
|
}
|
|
2027
2665
|
|
|
2666
|
+
// src/components/ui/toast.tsx
|
|
2667
|
+
var import_toast = require("@base-ui/react/toast");
|
|
2668
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2669
|
+
var toastManager = import_toast.Toast.createToastManager();
|
|
2670
|
+
function emit(manager, type, title, options = {}) {
|
|
2671
|
+
const { description, duration, priority, action, id } = options;
|
|
2672
|
+
return manager.add({
|
|
2673
|
+
id,
|
|
2674
|
+
title,
|
|
2675
|
+
description,
|
|
2676
|
+
type,
|
|
2677
|
+
timeout: duration,
|
|
2678
|
+
priority: priority ?? (type === "error" ? "high" : "low"),
|
|
2679
|
+
actionProps: action ? { children: action.label, onClick: action.onClick } : void 0
|
|
2680
|
+
});
|
|
2681
|
+
}
|
|
2682
|
+
function makeToast(manager) {
|
|
2683
|
+
function base(title, options) {
|
|
2684
|
+
return emit(manager, "default", title, options);
|
|
2685
|
+
}
|
|
2686
|
+
return Object.assign(base, {
|
|
2687
|
+
success: (title, options) => emit(manager, "success", title, options),
|
|
2688
|
+
error: (title, options) => emit(manager, "error", title, options),
|
|
2689
|
+
info: (title, options) => emit(manager, "info", title, options),
|
|
2690
|
+
warning: (title, options) => emit(manager, "warning", title, options),
|
|
2691
|
+
/** Resolve/reject a promise into loading → success/error toasts. */
|
|
2692
|
+
promise: manager.promise,
|
|
2693
|
+
/** Dismiss a specific toast by id. */
|
|
2694
|
+
dismiss: (id) => manager.close(id),
|
|
2695
|
+
/** Imperatively update an existing toast. */
|
|
2696
|
+
update: manager.update
|
|
2697
|
+
});
|
|
2698
|
+
}
|
|
2699
|
+
var toast = makeToast(toastManager);
|
|
2700
|
+
var TYPE_ICON = {
|
|
2701
|
+
default: null,
|
|
2702
|
+
success: CheckmarkIcon,
|
|
2703
|
+
error: ExclamationIcon,
|
|
2704
|
+
info: InformationIcon,
|
|
2705
|
+
warning: WarningIcon
|
|
2706
|
+
};
|
|
2707
|
+
var TYPE_ICON_COLOR = {
|
|
2708
|
+
default: "",
|
|
2709
|
+
success: "text-success",
|
|
2710
|
+
error: "text-error",
|
|
2711
|
+
info: "text-info",
|
|
2712
|
+
warning: "text-warning"
|
|
2713
|
+
};
|
|
2714
|
+
var TYPE_SURFACE = {
|
|
2715
|
+
default: "surface-default border-default",
|
|
2716
|
+
success: "surface-success border-success",
|
|
2717
|
+
error: "surface-error border-error",
|
|
2718
|
+
info: "surface-info border-info",
|
|
2719
|
+
warning: "surface-warning border-warning"
|
|
2720
|
+
};
|
|
2721
|
+
var VIEWPORT_POSITION = {
|
|
2722
|
+
"top-left": "top-4 left-4 sm:top-8 sm:left-8",
|
|
2723
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2 sm:top-8",
|
|
2724
|
+
"top-right": "top-4 right-4 sm:top-8 sm:right-8",
|
|
2725
|
+
"bottom-left": "bottom-4 left-4 sm:bottom-8 sm:left-8",
|
|
2726
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2 sm:bottom-8",
|
|
2727
|
+
"bottom-right": "bottom-4 right-4 sm:bottom-8 sm:right-8"
|
|
2728
|
+
};
|
|
2729
|
+
function ToastList({ side }) {
|
|
2730
|
+
const { toasts } = import_toast.Toast.useToastManager();
|
|
2731
|
+
return toasts.map((item) => {
|
|
2732
|
+
const rawType = item.type;
|
|
2733
|
+
const type = rawType in TYPE_SURFACE ? rawType : "default";
|
|
2734
|
+
const Icon = TYPE_ICON[type] ?? null;
|
|
2735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2736
|
+
import_toast.Toast.Root,
|
|
2737
|
+
{
|
|
2738
|
+
toast: item,
|
|
2739
|
+
"data-slot": "toast",
|
|
2740
|
+
swipeDirection: side === "top" ? ["up", "right"] : ["down", "right"],
|
|
2741
|
+
style: { "--y-dir": side === "top" ? 1 : -1 },
|
|
2742
|
+
className: cn(
|
|
2743
|
+
// Stacking math (CSS variables provided by Base UI)
|
|
2744
|
+
"[--gap:0.75rem] [--peek:0.625rem]",
|
|
2745
|
+
"[--scale:calc(max(0,1-(var(--toast-index)*0.06)))] [--shrink:calc(1-var(--scale))]",
|
|
2746
|
+
"[--height:var(--toast-frontmost-height,var(--toast-height))]",
|
|
2747
|
+
"[--offset-y:calc((var(--toast-offset-y)*var(--y-dir))+(var(--toast-index)*var(--gap)*var(--y-dir))+var(--toast-swipe-movement-y))]",
|
|
2748
|
+
// Layout — anchored to the viewport edge, full width, stacked by z-index
|
|
2749
|
+
"absolute left-auto right-0 mr-0 w-full",
|
|
2750
|
+
"z-[calc(1000-var(--toast-index))] h-[var(--height)] data-expanded:h-[var(--toast-height)]",
|
|
2751
|
+
side === "top" ? "top-0 origin-top" : "bottom-0 origin-bottom",
|
|
2752
|
+
// Surface — variant-tinted to match the Alert component (default = neutral)
|
|
2753
|
+
TYPE_SURFACE[type],
|
|
2754
|
+
"rounded-lg border bg-clip-padding shadow-lg select-none",
|
|
2755
|
+
// Collapsed transform: peek + shrink each toast behind the front one
|
|
2756
|
+
"[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--y-dir)*((var(--toast-index)*var(--peek))+(var(--shrink)*var(--height))))))_scale(var(--scale))]",
|
|
2757
|
+
// Expanded (hover/focus) transform: fan out by real heights + gap
|
|
2758
|
+
"data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]",
|
|
2759
|
+
// Enter / exit
|
|
2760
|
+
"data-starting-style:[transform:translateY(calc(var(--y-dir)*-150%))]",
|
|
2761
|
+
"data-ending-style:opacity-0 data-limited:opacity-0",
|
|
2762
|
+
"[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(calc(var(--y-dir)*-150%))]",
|
|
2763
|
+
// Swipe-to-dismiss exits
|
|
2764
|
+
"data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]",
|
|
2765
|
+
"data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",
|
|
2766
|
+
"data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]",
|
|
2767
|
+
"data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]",
|
|
2768
|
+
// Invisible spacer keeps the hover target contiguous across the gap
|
|
2769
|
+
"after:absolute after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']",
|
|
2770
|
+
side === "top" ? "after:top-full" : "after:bottom-full",
|
|
2771
|
+
// Motion
|
|
2772
|
+
"[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.4s,height_0.15s]"
|
|
2773
|
+
),
|
|
2774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2775
|
+
import_toast.Toast.Content,
|
|
2776
|
+
{
|
|
2777
|
+
"data-slot": "toast-content",
|
|
2778
|
+
className: cn(
|
|
2779
|
+
"flex h-full items-start gap-3 p-4 overflow-hidden",
|
|
2780
|
+
"transition-opacity duration-[250ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
2781
|
+
"data-behind:opacity-0 data-expanded:opacity-100"
|
|
2782
|
+
),
|
|
2783
|
+
children: [
|
|
2784
|
+
Icon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2785
|
+
Icon,
|
|
2786
|
+
{
|
|
2787
|
+
className: cn("mt-0.5 size-4 shrink-0", TYPE_ICON_COLOR[type])
|
|
2788
|
+
}
|
|
2789
|
+
) : null,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2792
|
+
import_toast.Toast.Title,
|
|
2793
|
+
{
|
|
2794
|
+
"data-slot": "toast-title",
|
|
2795
|
+
className: "type-body-sm-medium text-default"
|
|
2796
|
+
}
|
|
2797
|
+
),
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2799
|
+
import_toast.Toast.Description,
|
|
2800
|
+
{
|
|
2801
|
+
"data-slot": "toast-description",
|
|
2802
|
+
className: "type-body-sm-regular text-secondary"
|
|
2803
|
+
}
|
|
2804
|
+
)
|
|
2805
|
+
] }),
|
|
2806
|
+
item.actionProps ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2807
|
+
import_toast.Toast.Action,
|
|
2808
|
+
{
|
|
2809
|
+
"data-slot": "toast-action",
|
|
2810
|
+
className: cn(
|
|
2811
|
+
"shrink-0 rounded-md border border-default px-2.5 py-1",
|
|
2812
|
+
"type-label-xs-medium text-default surface-default",
|
|
2813
|
+
"transition-colors hover:surface-secondary",
|
|
2814
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-default"
|
|
2815
|
+
)
|
|
2816
|
+
}
|
|
2817
|
+
) : null,
|
|
2818
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2819
|
+
import_toast.Toast.Close,
|
|
2820
|
+
{
|
|
2821
|
+
"data-slot": "toast-close",
|
|
2822
|
+
"aria-label": "Dismiss notification",
|
|
2823
|
+
className: cn(
|
|
2824
|
+
"shrink-0 rounded-md p-1 text-secondary",
|
|
2825
|
+
"transition-colors hover:surface-secondary hover:text-default",
|
|
2826
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-default"
|
|
2827
|
+
),
|
|
2828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon, { className: "size-4" })
|
|
2829
|
+
}
|
|
2830
|
+
)
|
|
2831
|
+
]
|
|
2832
|
+
}
|
|
2833
|
+
)
|
|
2834
|
+
},
|
|
2835
|
+
item.id
|
|
2836
|
+
);
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
function Toaster({
|
|
2840
|
+
position = "bottom-right",
|
|
2841
|
+
timeout,
|
|
2842
|
+
limit,
|
|
2843
|
+
className,
|
|
2844
|
+
toastManager: manager = toastManager
|
|
2845
|
+
}) {
|
|
2846
|
+
const side = position.startsWith("top") ? "top" : "bottom";
|
|
2847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2848
|
+
import_toast.Toast.Provider,
|
|
2849
|
+
{
|
|
2850
|
+
toastManager: manager,
|
|
2851
|
+
timeout,
|
|
2852
|
+
limit,
|
|
2853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_toast.Toast.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2854
|
+
import_toast.Toast.Viewport,
|
|
2855
|
+
{
|
|
2856
|
+
"data-slot": "toaster",
|
|
2857
|
+
className: cn(
|
|
2858
|
+
"fixed z-50 mx-auto flex w-[calc(100vw-2rem)] sm:w-[22.5rem]",
|
|
2859
|
+
VIEWPORT_POSITION[position],
|
|
2860
|
+
className
|
|
2861
|
+
),
|
|
2862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToastList, { side })
|
|
2863
|
+
}
|
|
2864
|
+
) })
|
|
2865
|
+
}
|
|
2866
|
+
);
|
|
2867
|
+
}
|
|
2868
|
+
function createToaster() {
|
|
2869
|
+
const manager = import_toast.Toast.createToastManager();
|
|
2870
|
+
const scopedToast = makeToast(manager);
|
|
2871
|
+
function ScopedToaster(props) {
|
|
2872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Toaster, { ...props, toastManager: manager });
|
|
2873
|
+
}
|
|
2874
|
+
return { toast: scopedToast, Toaster: ScopedToaster };
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
// src/components/ui/hover-card.tsx
|
|
2878
|
+
var import_preview_card = require("@base-ui/react/preview-card");
|
|
2879
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2880
|
+
function HoverCard({ ...props }) {
|
|
2881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_preview_card.PreviewCard.Root, { ...props });
|
|
2882
|
+
}
|
|
2883
|
+
HoverCard.displayName = "HoverCard";
|
|
2884
|
+
function HoverCardTrigger({ ...props }) {
|
|
2885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_preview_card.PreviewCard.Trigger, { "data-slot": "hover-card-trigger", ...props });
|
|
2886
|
+
}
|
|
2887
|
+
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
2888
|
+
function HoverCardContent({
|
|
2889
|
+
className,
|
|
2890
|
+
side = "bottom",
|
|
2891
|
+
sideOffset = 8,
|
|
2892
|
+
align = "center",
|
|
2893
|
+
alignOffset = 0,
|
|
2894
|
+
...props
|
|
2895
|
+
}) {
|
|
2896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_preview_card.PreviewCard.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2897
|
+
import_preview_card.PreviewCard.Positioner,
|
|
2898
|
+
{
|
|
2899
|
+
align,
|
|
2900
|
+
alignOffset,
|
|
2901
|
+
side,
|
|
2902
|
+
sideOffset,
|
|
2903
|
+
className: "isolate z-50",
|
|
2904
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2905
|
+
import_preview_card.PreviewCard.Popup,
|
|
2906
|
+
{
|
|
2907
|
+
"data-slot": "hover-card-content",
|
|
2908
|
+
className: cn(
|
|
2909
|
+
// Tokens
|
|
2910
|
+
"surface-default border-default text-default",
|
|
2911
|
+
// Layout
|
|
2912
|
+
"flex flex-col items-start w-fit max-w-xs origin-(--transform-origin) rounded-lg border p-4 shadow-md",
|
|
2913
|
+
// Side-based slide-in
|
|
2914
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
2915
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
2916
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
2917
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
2918
|
+
"data-[side=inline-start]:slide-in-from-right-2",
|
|
2919
|
+
"data-[side=inline-end]:slide-in-from-left-2",
|
|
2920
|
+
// Open / close animations
|
|
2921
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
2922
|
+
"data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2923
|
+
className
|
|
2924
|
+
),
|
|
2925
|
+
...props
|
|
2926
|
+
}
|
|
2927
|
+
)
|
|
2928
|
+
}
|
|
2929
|
+
) });
|
|
2930
|
+
}
|
|
2931
|
+
HoverCardContent.displayName = "HoverCardContent";
|
|
2932
|
+
|
|
2028
2933
|
// src/components/ui/popover.tsx
|
|
2029
2934
|
var import_popover = require("@base-ui/react/popover");
|
|
2030
|
-
var
|
|
2935
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2031
2936
|
function Popover({ ...props }) {
|
|
2032
|
-
return /* @__PURE__ */ (0,
|
|
2937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_popover.Popover.Root, { "data-slot": "popover", ...props });
|
|
2033
2938
|
}
|
|
2034
2939
|
function PopoverTrigger({ ...props }) {
|
|
2035
|
-
return /* @__PURE__ */ (0,
|
|
2940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_popover.Popover.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
2036
2941
|
}
|
|
2037
2942
|
function PopoverContent({
|
|
2038
2943
|
className,
|
|
@@ -2042,7 +2947,7 @@ function PopoverContent({
|
|
|
2042
2947
|
sideOffset = 4,
|
|
2043
2948
|
...props
|
|
2044
2949
|
}) {
|
|
2045
|
-
return /* @__PURE__ */ (0,
|
|
2950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2046
2951
|
import_popover.Popover.Positioner,
|
|
2047
2952
|
{
|
|
2048
2953
|
align,
|
|
@@ -2050,7 +2955,7 @@ function PopoverContent({
|
|
|
2050
2955
|
side,
|
|
2051
2956
|
sideOffset,
|
|
2052
2957
|
className: "isolate z-50",
|
|
2053
|
-
children: /* @__PURE__ */ (0,
|
|
2958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2054
2959
|
import_popover.Popover.Popup,
|
|
2055
2960
|
{
|
|
2056
2961
|
"data-slot": "popover-content",
|
|
@@ -2073,7 +2978,7 @@ function PopoverContent({
|
|
|
2073
2978
|
) });
|
|
2074
2979
|
}
|
|
2075
2980
|
function PopoverHeader({ className, ...props }) {
|
|
2076
|
-
return /* @__PURE__ */ (0,
|
|
2981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2077
2982
|
"div",
|
|
2078
2983
|
{
|
|
2079
2984
|
"data-slot": "popover-header",
|
|
@@ -2083,7 +2988,7 @@ function PopoverHeader({ className, ...props }) {
|
|
|
2083
2988
|
);
|
|
2084
2989
|
}
|
|
2085
2990
|
function PopoverTitle({ className, ...props }) {
|
|
2086
|
-
return /* @__PURE__ */ (0,
|
|
2991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2087
2992
|
import_popover.Popover.Title,
|
|
2088
2993
|
{
|
|
2089
2994
|
"data-slot": "popover-title",
|
|
@@ -2096,7 +3001,7 @@ function PopoverDescription({
|
|
|
2096
3001
|
className,
|
|
2097
3002
|
...props
|
|
2098
3003
|
}) {
|
|
2099
|
-
return /* @__PURE__ */ (0,
|
|
3004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2100
3005
|
import_popover.Popover.Description,
|
|
2101
3006
|
{
|
|
2102
3007
|
"data-slot": "popover-description",
|
|
@@ -2107,15 +3012,15 @@ function PopoverDescription({
|
|
|
2107
3012
|
}
|
|
2108
3013
|
|
|
2109
3014
|
// src/components/ui/sidebar.tsx
|
|
2110
|
-
var
|
|
2111
|
-
var
|
|
3015
|
+
var React8 = __toESM(require("react"));
|
|
3016
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2112
3017
|
var SIDEBAR_CONSTANTS = {
|
|
2113
3018
|
WIDTH: "144px",
|
|
2114
3019
|
WIDTH_ICON: "48px"
|
|
2115
3020
|
};
|
|
2116
|
-
var SidebarContext =
|
|
3021
|
+
var SidebarContext = React8.createContext(null);
|
|
2117
3022
|
function useSidebar() {
|
|
2118
|
-
const context =
|
|
3023
|
+
const context = React8.useContext(SidebarContext);
|
|
2119
3024
|
if (!context) {
|
|
2120
3025
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
2121
3026
|
}
|
|
@@ -2131,9 +3036,9 @@ function SidebarProvider({
|
|
|
2131
3036
|
ref,
|
|
2132
3037
|
...props
|
|
2133
3038
|
}) {
|
|
2134
|
-
const [_open, _setOpen] =
|
|
3039
|
+
const [_open, _setOpen] = React8.useState(defaultOpen);
|
|
2135
3040
|
const open = openProp ?? _open;
|
|
2136
|
-
const setOpen =
|
|
3041
|
+
const setOpen = React8.useCallback(
|
|
2137
3042
|
(value) => {
|
|
2138
3043
|
const openState = typeof value === "function" ? value(open) : value;
|
|
2139
3044
|
if (setOpenProp) {
|
|
@@ -2144,11 +3049,11 @@ function SidebarProvider({
|
|
|
2144
3049
|
},
|
|
2145
3050
|
[setOpenProp, open]
|
|
2146
3051
|
);
|
|
2147
|
-
const toggleSidebar =
|
|
3052
|
+
const toggleSidebar = React8.useCallback(() => {
|
|
2148
3053
|
return setOpen((open2) => !open2);
|
|
2149
3054
|
}, [setOpen]);
|
|
2150
3055
|
const state = open ? "expanded" : "collapsed";
|
|
2151
|
-
const contextValue =
|
|
3056
|
+
const contextValue = React8.useMemo(
|
|
2152
3057
|
() => ({
|
|
2153
3058
|
state,
|
|
2154
3059
|
open,
|
|
@@ -2157,7 +3062,7 @@ function SidebarProvider({
|
|
|
2157
3062
|
}),
|
|
2158
3063
|
[state, open, setOpen, toggleSidebar]
|
|
2159
3064
|
);
|
|
2160
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarContext, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2161
3066
|
"div",
|
|
2162
3067
|
{
|
|
2163
3068
|
style: {
|
|
@@ -2183,7 +3088,7 @@ function Sidebar({
|
|
|
2183
3088
|
...props
|
|
2184
3089
|
}) {
|
|
2185
3090
|
const { state } = useSidebar();
|
|
2186
|
-
return /* @__PURE__ */ (0,
|
|
3091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2187
3092
|
"aside",
|
|
2188
3093
|
{
|
|
2189
3094
|
ref,
|
|
@@ -2194,7 +3099,7 @@ function Sidebar({
|
|
|
2194
3099
|
"aria-expanded": state === "expanded",
|
|
2195
3100
|
role: "navigation",
|
|
2196
3101
|
children: [
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
3102
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2198
3103
|
"div",
|
|
2199
3104
|
{
|
|
2200
3105
|
className: cn(
|
|
@@ -2203,14 +3108,14 @@ function Sidebar({
|
|
|
2203
3108
|
)
|
|
2204
3109
|
}
|
|
2205
3110
|
),
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2207
3112
|
"div",
|
|
2208
3113
|
{
|
|
2209
3114
|
className: cn(
|
|
2210
3115
|
"fixed inset-y-0 z-10 h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear flex left-0",
|
|
2211
3116
|
"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]"
|
|
2212
3117
|
),
|
|
2213
|
-
children: /* @__PURE__ */ (0,
|
|
3118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2214
3119
|
"div",
|
|
2215
3120
|
{
|
|
2216
3121
|
"data-sidebar": "sidebar",
|
|
@@ -2229,7 +3134,7 @@ function Sidebar({
|
|
|
2229
3134
|
);
|
|
2230
3135
|
}
|
|
2231
3136
|
function SidebarInset({ className, ref, ...props }) {
|
|
2232
|
-
return /* @__PURE__ */ (0,
|
|
3137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2233
3138
|
"main",
|
|
2234
3139
|
{
|
|
2235
3140
|
ref,
|
|
@@ -2242,7 +3147,7 @@ function SidebarInset({ className, ref, ...props }) {
|
|
|
2242
3147
|
);
|
|
2243
3148
|
}
|
|
2244
3149
|
function SidebarHeader({ className, ref, ...props }) {
|
|
2245
|
-
return /* @__PURE__ */ (0,
|
|
3150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2246
3151
|
"div",
|
|
2247
3152
|
{
|
|
2248
3153
|
ref,
|
|
@@ -2257,7 +3162,7 @@ function SidebarHeader({ className, ref, ...props }) {
|
|
|
2257
3162
|
);
|
|
2258
3163
|
}
|
|
2259
3164
|
function SidebarFooter({ className, ref, ...props }) {
|
|
2260
|
-
return /* @__PURE__ */ (0,
|
|
3165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2261
3166
|
"div",
|
|
2262
3167
|
{
|
|
2263
3168
|
ref,
|
|
@@ -2268,7 +3173,7 @@ function SidebarFooter({ className, ref, ...props }) {
|
|
|
2268
3173
|
);
|
|
2269
3174
|
}
|
|
2270
3175
|
function SidebarContent({ className, ref, ...props }) {
|
|
2271
|
-
return /* @__PURE__ */ (0,
|
|
3176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2272
3177
|
"div",
|
|
2273
3178
|
{
|
|
2274
3179
|
ref,
|
|
@@ -2282,7 +3187,7 @@ function SidebarContent({ className, ref, ...props }) {
|
|
|
2282
3187
|
);
|
|
2283
3188
|
}
|
|
2284
3189
|
function SidebarGroup({ className, ref, ...props }) {
|
|
2285
|
-
return /* @__PURE__ */ (0,
|
|
3190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2286
3191
|
"div",
|
|
2287
3192
|
{
|
|
2288
3193
|
ref,
|
|
@@ -2297,7 +3202,7 @@ function SidebarGroupContent({
|
|
|
2297
3202
|
ref,
|
|
2298
3203
|
...props
|
|
2299
3204
|
}) {
|
|
2300
|
-
return /* @__PURE__ */ (0,
|
|
3205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2301
3206
|
"div",
|
|
2302
3207
|
{
|
|
2303
3208
|
ref,
|
|
@@ -2308,7 +3213,7 @@ function SidebarGroupContent({
|
|
|
2308
3213
|
);
|
|
2309
3214
|
}
|
|
2310
3215
|
function SidebarMenu({ className, ref, ...props }) {
|
|
2311
|
-
return /* @__PURE__ */ (0,
|
|
3216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2312
3217
|
"ul",
|
|
2313
3218
|
{
|
|
2314
3219
|
ref,
|
|
@@ -2319,7 +3224,7 @@ function SidebarMenu({ className, ref, ...props }) {
|
|
|
2319
3224
|
);
|
|
2320
3225
|
}
|
|
2321
3226
|
function SidebarMenuItem({ className, ref, ...props }) {
|
|
2322
|
-
return /* @__PURE__ */ (0,
|
|
3227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2323
3228
|
"li",
|
|
2324
3229
|
{
|
|
2325
3230
|
ref,
|
|
@@ -2338,7 +3243,7 @@ function SidebarMenuButton({
|
|
|
2338
3243
|
...props
|
|
2339
3244
|
}) {
|
|
2340
3245
|
const { state } = useSidebar();
|
|
2341
|
-
const button = /* @__PURE__ */ (0,
|
|
3246
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2342
3247
|
"button",
|
|
2343
3248
|
{
|
|
2344
3249
|
ref,
|
|
@@ -2357,16 +3262,16 @@ function SidebarMenuButton({
|
|
|
2357
3262
|
return button;
|
|
2358
3263
|
}
|
|
2359
3264
|
const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
2360
|
-
return /* @__PURE__ */ (0,
|
|
2361
|
-
/* @__PURE__ */ (0,
|
|
2362
|
-
/* @__PURE__ */ (0,
|
|
3265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipProvider, { delay: 0, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
3266
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { render: button }),
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "right", align: "center", ...tooltipProps })
|
|
2363
3268
|
] }) });
|
|
2364
3269
|
}
|
|
2365
3270
|
|
|
2366
3271
|
// src/components/ui/calendar.tsx
|
|
2367
|
-
var
|
|
3272
|
+
var React9 = __toESM(require("react"));
|
|
2368
3273
|
var import_react_day_picker = require("react-day-picker");
|
|
2369
|
-
var
|
|
3274
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2370
3275
|
function Calendar({
|
|
2371
3276
|
className,
|
|
2372
3277
|
classNames,
|
|
@@ -2379,7 +3284,7 @@ function Calendar({
|
|
|
2379
3284
|
...props
|
|
2380
3285
|
}) {
|
|
2381
3286
|
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
2382
|
-
return /* @__PURE__ */ (0,
|
|
3287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2383
3288
|
import_react_day_picker.DayPicker,
|
|
2384
3289
|
{
|
|
2385
3290
|
showOutsideDays,
|
|
@@ -2482,7 +3387,7 @@ function Calendar({
|
|
|
2482
3387
|
...classNames
|
|
2483
3388
|
},
|
|
2484
3389
|
components: {
|
|
2485
|
-
Root: ({ className: rootClassName, rootRef, ...rootProps }) => /* @__PURE__ */ (0,
|
|
3390
|
+
Root: ({ className: rootClassName, rootRef, ...rootProps }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2486
3391
|
"div",
|
|
2487
3392
|
{
|
|
2488
3393
|
"data-slot": "calendar",
|
|
@@ -2497,7 +3402,7 @@ function Calendar({
|
|
|
2497
3402
|
...chevronProps
|
|
2498
3403
|
}) => {
|
|
2499
3404
|
if (orientation === "left") {
|
|
2500
|
-
return /* @__PURE__ */ (0,
|
|
3405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2501
3406
|
ArrowLeftIcon,
|
|
2502
3407
|
{
|
|
2503
3408
|
className: cn("size-4", chevronClassName),
|
|
@@ -2506,7 +3411,7 @@ function Calendar({
|
|
|
2506
3411
|
);
|
|
2507
3412
|
}
|
|
2508
3413
|
if (orientation === "right") {
|
|
2509
|
-
return /* @__PURE__ */ (0,
|
|
3414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2510
3415
|
ArrowRightIcon,
|
|
2511
3416
|
{
|
|
2512
3417
|
className: cn("size-4", chevronClassName),
|
|
@@ -2514,7 +3419,7 @@ function Calendar({
|
|
|
2514
3419
|
}
|
|
2515
3420
|
);
|
|
2516
3421
|
}
|
|
2517
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2518
3423
|
CaretDownIcon,
|
|
2519
3424
|
{
|
|
2520
3425
|
className: cn("size-4", chevronClassName),
|
|
@@ -2522,8 +3427,8 @@ function Calendar({
|
|
|
2522
3427
|
}
|
|
2523
3428
|
);
|
|
2524
3429
|
},
|
|
2525
|
-
DayButton: (dayButtonProps) => /* @__PURE__ */ (0,
|
|
2526
|
-
WeekNumber: ({ children, ...weekNumberProps }) => /* @__PURE__ */ (0,
|
|
3430
|
+
DayButton: (dayButtonProps) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarDayButton, { locale, ...dayButtonProps }),
|
|
3431
|
+
WeekNumber: ({ children, ...weekNumberProps }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { ...weekNumberProps, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }),
|
|
2527
3432
|
...components
|
|
2528
3433
|
},
|
|
2529
3434
|
...props
|
|
@@ -2537,11 +3442,11 @@ function CalendarDayButton({
|
|
|
2537
3442
|
locale,
|
|
2538
3443
|
...props
|
|
2539
3444
|
}) {
|
|
2540
|
-
const ref =
|
|
2541
|
-
|
|
3445
|
+
const ref = React9.useRef(null);
|
|
3446
|
+
React9.useEffect(() => {
|
|
2542
3447
|
if (modifiers.focused) ref.current?.focus();
|
|
2543
3448
|
}, [modifiers.focused]);
|
|
2544
|
-
return /* @__PURE__ */ (0,
|
|
3449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2545
3450
|
Button,
|
|
2546
3451
|
{
|
|
2547
3452
|
ref,
|
|
@@ -2576,8 +3481,8 @@ Calendar.displayName = "Calendar";
|
|
|
2576
3481
|
CalendarDayButton.displayName = "CalendarDayButton";
|
|
2577
3482
|
|
|
2578
3483
|
// src/components/ui/date-picker.tsx
|
|
2579
|
-
var
|
|
2580
|
-
var
|
|
3484
|
+
var React10 = __toESM(require("react"));
|
|
3485
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2581
3486
|
function DatePickerTrigger({
|
|
2582
3487
|
label,
|
|
2583
3488
|
placeholder = "Pick a date",
|
|
@@ -2586,11 +3491,11 @@ function DatePickerTrigger({
|
|
|
2586
3491
|
ref,
|
|
2587
3492
|
...rest
|
|
2588
3493
|
}) {
|
|
2589
|
-
return /* @__PURE__ */ (0,
|
|
3494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2590
3495
|
PopoverTrigger,
|
|
2591
3496
|
{
|
|
2592
3497
|
disabled,
|
|
2593
|
-
render: /* @__PURE__ */ (0,
|
|
3498
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2594
3499
|
"button",
|
|
2595
3500
|
{
|
|
2596
3501
|
ref,
|
|
@@ -2615,7 +3520,7 @@ function DatePickerTrigger({
|
|
|
2615
3520
|
}
|
|
2616
3521
|
),
|
|
2617
3522
|
children: [
|
|
2618
|
-
/* @__PURE__ */ (0,
|
|
3523
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2619
3524
|
CalendarIcon,
|
|
2620
3525
|
{
|
|
2621
3526
|
size: 16,
|
|
@@ -2623,7 +3528,7 @@ function DatePickerTrigger({
|
|
|
2623
3528
|
"aria-hidden": "true"
|
|
2624
3529
|
}
|
|
2625
3530
|
),
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
3531
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate", children: label ?? placeholder })
|
|
2627
3532
|
]
|
|
2628
3533
|
}
|
|
2629
3534
|
);
|
|
@@ -2640,8 +3545,8 @@ function DatePicker(props) {
|
|
|
2640
3545
|
className,
|
|
2641
3546
|
ref
|
|
2642
3547
|
} = props;
|
|
2643
|
-
const [date, setDate] =
|
|
2644
|
-
const isControlled =
|
|
3548
|
+
const [date, setDate] = React10.useState(defaultValue);
|
|
3549
|
+
const isControlled = React10.useRef("value" in props).current;
|
|
2645
3550
|
const selected = isControlled ? value : date;
|
|
2646
3551
|
const handleSelect = (day) => {
|
|
2647
3552
|
if (!isControlled) setDate(day);
|
|
@@ -2652,8 +3557,8 @@ function DatePicker(props) {
|
|
|
2652
3557
|
month: "long",
|
|
2653
3558
|
day: "numeric"
|
|
2654
3559
|
}) : null;
|
|
2655
|
-
return /* @__PURE__ */ (0,
|
|
2656
|
-
/* @__PURE__ */ (0,
|
|
3560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Popover, { children: [
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2657
3562
|
DatePickerTrigger,
|
|
2658
3563
|
{
|
|
2659
3564
|
ref,
|
|
@@ -2663,7 +3568,7 @@ function DatePicker(props) {
|
|
|
2663
3568
|
className
|
|
2664
3569
|
}
|
|
2665
3570
|
),
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PopoverContent, { className: "w-auto p-0", align: "center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2667
3572
|
Calendar,
|
|
2668
3573
|
{
|
|
2669
3574
|
mode: "single",
|
|
@@ -2682,11 +3587,11 @@ function DatePicker(props) {
|
|
|
2682
3587
|
}
|
|
2683
3588
|
|
|
2684
3589
|
// src/components/ui/upload.tsx
|
|
2685
|
-
var
|
|
2686
|
-
var
|
|
2687
|
-
var
|
|
3590
|
+
var React11 = __toESM(require("react"));
|
|
3591
|
+
var import_class_variance_authority10 = require("class-variance-authority");
|
|
3592
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2688
3593
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2689
|
-
var uploadVariants = (0,
|
|
3594
|
+
var uploadVariants = (0, import_class_variance_authority10.cva)(
|
|
2690
3595
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden w-full p-16 min-h-[200px]",
|
|
2691
3596
|
{
|
|
2692
3597
|
variants: {
|
|
@@ -2721,8 +3626,8 @@ function Upload({
|
|
|
2721
3626
|
ref,
|
|
2722
3627
|
...props
|
|
2723
3628
|
}) {
|
|
2724
|
-
const fileInputRef =
|
|
2725
|
-
const [isDragOver, setIsDragOver] =
|
|
3629
|
+
const fileInputRef = React11.useRef(null);
|
|
3630
|
+
const [isDragOver, setIsDragOver] = React11.useState(false);
|
|
2726
3631
|
const getFileTypeDisplay = () => {
|
|
2727
3632
|
const typeMap = {
|
|
2728
3633
|
"application/pdf": "PDF",
|
|
@@ -2786,17 +3691,17 @@ function Upload({
|
|
|
2786
3691
|
const renderContent = () => {
|
|
2787
3692
|
switch (effectiveState) {
|
|
2788
3693
|
case "error":
|
|
2789
|
-
return /* @__PURE__ */ (0,
|
|
3694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2790
3695
|
"div",
|
|
2791
3696
|
{
|
|
2792
3697
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2793
3698
|
style: { gap: "32px" },
|
|
2794
3699
|
children: [
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
3700
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
|
|
3701
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "h5", children: "Upload fail" }),
|
|
3702
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
2798
3703
|
] }),
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2800
3705
|
Button,
|
|
2801
3706
|
{
|
|
2802
3707
|
variant: "destructive",
|
|
@@ -2810,22 +3715,22 @@ function Upload({
|
|
|
2810
3715
|
}
|
|
2811
3716
|
);
|
|
2812
3717
|
case "uploading":
|
|
2813
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2814
3719
|
"div",
|
|
2815
3720
|
{
|
|
2816
3721
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2817
3722
|
style: { gap: "32px" },
|
|
2818
3723
|
children: [
|
|
2819
|
-
/* @__PURE__ */ (0,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2821
|
-
/* @__PURE__ */ (0,
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "h5", className: "text-default", children: "Uploading files" }),
|
|
3725
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-full surface-secondary rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2822
3727
|
"div",
|
|
2823
3728
|
{
|
|
2824
3729
|
className: "interactive-accent h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2825
3730
|
style: { width: `${progress}%` }
|
|
2826
3731
|
}
|
|
2827
3732
|
) }),
|
|
2828
|
-
/* @__PURE__ */ (0,
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { variant: "body-sm", className: "text-secondary text-center", children: [
|
|
2829
3734
|
Math.round(progress),
|
|
2830
3735
|
"% complete"
|
|
2831
3736
|
] })
|
|
@@ -2834,29 +3739,29 @@ function Upload({
|
|
|
2834
3739
|
}
|
|
2835
3740
|
);
|
|
2836
3741
|
case "success":
|
|
2837
|
-
return /* @__PURE__ */ (0,
|
|
3742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2838
3743
|
"div",
|
|
2839
3744
|
{
|
|
2840
3745
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2841
3746
|
style: { gap: "32px" },
|
|
2842
|
-
children: /* @__PURE__ */ (0,
|
|
2843
|
-
/* @__PURE__ */ (0,
|
|
2844
|
-
selectedFiles.length > 0 && /* @__PURE__ */ (0,
|
|
3747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
|
|
3748
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "h5", className: "text-success", children: "Upload successful!" }),
|
|
3749
|
+
selectedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-center", children: selectedFiles.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "body-sm", children: file.name }, index)) })
|
|
2845
3750
|
] })
|
|
2846
3751
|
}
|
|
2847
3752
|
);
|
|
2848
3753
|
default:
|
|
2849
|
-
return /* @__PURE__ */ (0,
|
|
3754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2850
3755
|
"div",
|
|
2851
3756
|
{
|
|
2852
3757
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2853
3758
|
style: { gap: "32px" },
|
|
2854
3759
|
children: [
|
|
2855
|
-
/* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
3760
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
|
|
3761
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "h5", className: "text-default", children: "Drag & drop files here" }),
|
|
3762
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
2858
3763
|
] }),
|
|
2859
|
-
/* @__PURE__ */ (0,
|
|
3764
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2860
3765
|
Button,
|
|
2861
3766
|
{
|
|
2862
3767
|
variant: "default",
|
|
@@ -2870,10 +3775,10 @@ function Upload({
|
|
|
2870
3775
|
children: "Choose files"
|
|
2871
3776
|
}
|
|
2872
3777
|
),
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Text, { variant: "body-sm", className: "text-secondary", children: [
|
|
2874
3779
|
"Supported file: ",
|
|
2875
3780
|
getFileTypeDisplay(),
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("br", {}),
|
|
2877
3782
|
"Max: ",
|
|
2878
3783
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2879
3784
|
" MB each"
|
|
@@ -2883,7 +3788,7 @@ function Upload({
|
|
|
2883
3788
|
);
|
|
2884
3789
|
}
|
|
2885
3790
|
};
|
|
2886
|
-
return /* @__PURE__ */ (0,
|
|
3791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2887
3792
|
"div",
|
|
2888
3793
|
{
|
|
2889
3794
|
ref,
|
|
@@ -2902,7 +3807,7 @@ function Upload({
|
|
|
2902
3807
|
"aria-disabled": disabled,
|
|
2903
3808
|
...props,
|
|
2904
3809
|
children: [
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
3810
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2906
3811
|
"input",
|
|
2907
3812
|
{
|
|
2908
3813
|
ref: fileInputRef,
|
|
@@ -2921,9 +3826,9 @@ function Upload({
|
|
|
2921
3826
|
|
|
2922
3827
|
// src/components/ui/avatar.tsx
|
|
2923
3828
|
var import_avatar = require("@base-ui/react/avatar");
|
|
2924
|
-
var
|
|
2925
|
-
var
|
|
2926
|
-
var avatarVariants = (0,
|
|
3829
|
+
var import_class_variance_authority11 = require("class-variance-authority");
|
|
3830
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3831
|
+
var avatarVariants = (0, import_class_variance_authority11.cva)(
|
|
2927
3832
|
"relative flex shrink-0 overflow-hidden select-none",
|
|
2928
3833
|
{
|
|
2929
3834
|
variants: {
|
|
@@ -2951,7 +3856,7 @@ var avatarVariants = (0, import_class_variance_authority9.cva)(
|
|
|
2951
3856
|
}
|
|
2952
3857
|
);
|
|
2953
3858
|
function Avatar({ className, size, shape, ref, ...props }) {
|
|
2954
|
-
return /* @__PURE__ */ (0,
|
|
3859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2955
3860
|
import_avatar.Avatar.Root,
|
|
2956
3861
|
{
|
|
2957
3862
|
ref,
|
|
@@ -2967,7 +3872,7 @@ function AvatarImage({
|
|
|
2967
3872
|
ref,
|
|
2968
3873
|
...props
|
|
2969
3874
|
}) {
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
3875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2971
3876
|
import_avatar.Avatar.Image,
|
|
2972
3877
|
{
|
|
2973
3878
|
ref,
|
|
@@ -2982,7 +3887,7 @@ function AvatarFallback({
|
|
|
2982
3887
|
ref,
|
|
2983
3888
|
...props
|
|
2984
3889
|
}) {
|
|
2985
|
-
return /* @__PURE__ */ (0,
|
|
3890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2986
3891
|
import_avatar.Avatar.Fallback,
|
|
2987
3892
|
{
|
|
2988
3893
|
ref,
|
|
@@ -3007,7 +3912,7 @@ function AvatarGroup({
|
|
|
3007
3912
|
ref,
|
|
3008
3913
|
...props
|
|
3009
3914
|
}) {
|
|
3010
|
-
return /* @__PURE__ */ (0,
|
|
3915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3011
3916
|
"div",
|
|
3012
3917
|
{
|
|
3013
3918
|
ref,
|
|
@@ -3028,7 +3933,7 @@ function AvatarGroupCount({
|
|
|
3028
3933
|
ref,
|
|
3029
3934
|
...props
|
|
3030
3935
|
}) {
|
|
3031
|
-
return /* @__PURE__ */ (0,
|
|
3936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3032
3937
|
"div",
|
|
3033
3938
|
{
|
|
3034
3939
|
ref,
|
|
@@ -3050,9 +3955,9 @@ function AvatarGroupCount({
|
|
|
3050
3955
|
|
|
3051
3956
|
// src/components/ui/checkbox.tsx
|
|
3052
3957
|
var import_checkbox = require("@base-ui/react/checkbox");
|
|
3053
|
-
var
|
|
3054
|
-
var
|
|
3055
|
-
var checkboxVariants = (0,
|
|
3958
|
+
var import_class_variance_authority12 = require("class-variance-authority");
|
|
3959
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3960
|
+
var checkboxVariants = (0, import_class_variance_authority12.cva)([
|
|
3056
3961
|
// Base layout & appearance
|
|
3057
3962
|
"peer group relative size-4 shrink-0",
|
|
3058
3963
|
"rounded-xs border border-default surface-default shadow-xs",
|
|
@@ -3077,27 +3982,27 @@ var checkboxVariants = (0, import_class_variance_authority10.cva)([
|
|
|
3077
3982
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
3078
3983
|
]);
|
|
3079
3984
|
function Checkbox({ className, ref, ...props }) {
|
|
3080
|
-
return /* @__PURE__ */ (0,
|
|
3985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3081
3986
|
import_checkbox.Checkbox.Root,
|
|
3082
3987
|
{
|
|
3083
3988
|
"data-slot": "checkbox",
|
|
3084
3989
|
ref,
|
|
3085
3990
|
className: cn(checkboxVariants(), className),
|
|
3086
3991
|
...props,
|
|
3087
|
-
children: /* @__PURE__ */ (0,
|
|
3992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3088
3993
|
import_checkbox.Checkbox.Indicator,
|
|
3089
3994
|
{
|
|
3090
3995
|
"data-slot": "checkbox-indicator",
|
|
3091
3996
|
className: "absolute inset-0 flex items-center justify-center text-current",
|
|
3092
3997
|
children: [
|
|
3093
|
-
/* @__PURE__ */ (0,
|
|
3998
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3094
3999
|
CheckmarkIcon,
|
|
3095
4000
|
{
|
|
3096
4001
|
size: 14,
|
|
3097
4002
|
className: "text-current hidden group-data-[checked]:block"
|
|
3098
4003
|
}
|
|
3099
4004
|
),
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3101
4006
|
MinusIcon,
|
|
3102
4007
|
{
|
|
3103
4008
|
size: 14,
|
|
@@ -3111,11 +4016,143 @@ function Checkbox({ className, ref, ...props }) {
|
|
|
3111
4016
|
);
|
|
3112
4017
|
}
|
|
3113
4018
|
|
|
4019
|
+
// src/components/ui/radio-group.tsx
|
|
4020
|
+
var React12 = __toESM(require("react"));
|
|
4021
|
+
var import_radio_group = require("@base-ui/react/radio-group");
|
|
4022
|
+
var import_radio = require("@base-ui/react/radio");
|
|
4023
|
+
var import_class_variance_authority13 = require("class-variance-authority");
|
|
4024
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4025
|
+
var radioGroupVariants = (0, import_class_variance_authority13.cva)("flex", {
|
|
4026
|
+
variants: {
|
|
4027
|
+
orientation: {
|
|
4028
|
+
vertical: "flex-col gap-2",
|
|
4029
|
+
horizontal: "flex-row flex-wrap gap-4"
|
|
4030
|
+
},
|
|
4031
|
+
layout: {
|
|
4032
|
+
// Items shrink-wrap their content
|
|
4033
|
+
inline: "",
|
|
4034
|
+
// Items stretch to fill the container; labels take remaining space.
|
|
4035
|
+
// Requires each item to be wrapped in a single element:
|
|
4036
|
+
// RadioGroup > div > (RadioGroupItem + label)
|
|
4037
|
+
// Using RadioGroupCard satisfies this automatically.
|
|
4038
|
+
// Extra wrapper elements (Fragment, nested divs) will silently break this layout.
|
|
4039
|
+
block: "[&>*>label]:flex-1 [&>*>label]:min-w-0"
|
|
4040
|
+
}
|
|
4041
|
+
},
|
|
4042
|
+
compoundVariants: [
|
|
4043
|
+
// vertical + block: each item spans full container width
|
|
4044
|
+
{ orientation: "vertical", layout: "block", class: "[&>*]:w-full" },
|
|
4045
|
+
// horizontal + block: items share the row equally
|
|
4046
|
+
{ orientation: "horizontal", layout: "block", class: "[&>*]:flex-1" }
|
|
4047
|
+
],
|
|
4048
|
+
defaultVariants: {
|
|
4049
|
+
orientation: "vertical",
|
|
4050
|
+
layout: "inline"
|
|
4051
|
+
}
|
|
4052
|
+
});
|
|
4053
|
+
var radioItemVariants = (0, import_class_variance_authority13.cva)([
|
|
4054
|
+
// Base layout & appearance
|
|
4055
|
+
"peer group inline-flex relative size-4 shrink-0",
|
|
4056
|
+
"rounded-full border border-default surface-default shadow-xs",
|
|
4057
|
+
// Transitions & hover
|
|
4058
|
+
"transition-colors hover:interactive-hover",
|
|
4059
|
+
// Focus
|
|
4060
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-default",
|
|
4061
|
+
// Disabled — checked items are slightly more opaque per design
|
|
4062
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
4063
|
+
"data-[disabled]:data-[checked]:opacity-30",
|
|
4064
|
+
// Error (aria-invalid)
|
|
4065
|
+
"aria-invalid:border-error",
|
|
4066
|
+
"aria-invalid:focus-visible:ring-3 aria-invalid:focus-visible:ring-focus-error"
|
|
4067
|
+
]);
|
|
4068
|
+
function RadioGroup({
|
|
4069
|
+
className,
|
|
4070
|
+
orientation,
|
|
4071
|
+
layout,
|
|
4072
|
+
...props
|
|
4073
|
+
}) {
|
|
4074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4075
|
+
import_radio_group.RadioGroup,
|
|
4076
|
+
{
|
|
4077
|
+
"data-slot": "radio-group",
|
|
4078
|
+
className: cn(radioGroupVariants({ orientation, layout }), className),
|
|
4079
|
+
...props
|
|
4080
|
+
}
|
|
4081
|
+
);
|
|
4082
|
+
}
|
|
4083
|
+
function RadioGroupItem({ className, ...props }) {
|
|
4084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4085
|
+
import_radio.Radio.Root,
|
|
4086
|
+
{
|
|
4087
|
+
"data-slot": "radio-group-item",
|
|
4088
|
+
className: cn(radioItemVariants(), className),
|
|
4089
|
+
...props,
|
|
4090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4091
|
+
import_radio.Radio.Indicator,
|
|
4092
|
+
{
|
|
4093
|
+
"data-slot": "radio-group-indicator",
|
|
4094
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
4095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "size-2 rounded-full interactive-accent group-aria-invalid:interactive-destructive" })
|
|
4096
|
+
}
|
|
4097
|
+
)
|
|
4098
|
+
}
|
|
4099
|
+
);
|
|
4100
|
+
}
|
|
4101
|
+
function RadioGroupCard({
|
|
4102
|
+
className,
|
|
4103
|
+
label,
|
|
4104
|
+
description,
|
|
4105
|
+
flipped = false,
|
|
4106
|
+
id,
|
|
4107
|
+
ref,
|
|
4108
|
+
...props
|
|
4109
|
+
}) {
|
|
4110
|
+
const generatedId = React12.useId();
|
|
4111
|
+
const itemId = id ?? generatedId;
|
|
4112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4113
|
+
"label",
|
|
4114
|
+
{
|
|
4115
|
+
ref,
|
|
4116
|
+
"data-slot": "radio-group-card",
|
|
4117
|
+
"data-disabled": props.disabled ? "" : void 0,
|
|
4118
|
+
className: cn(
|
|
4119
|
+
"flex items-start gap-3 p-3 border border-default surface-default rounded-md cursor-pointer w-full",
|
|
4120
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
4121
|
+
className
|
|
4122
|
+
),
|
|
4123
|
+
children: [
|
|
4124
|
+
!flipped && // data-[disabled]:opacity-100 cancels the item-level opacity since
|
|
4125
|
+
// the card wrapper already applies opacity-50 for the whole card.
|
|
4126
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4127
|
+
RadioGroupItem,
|
|
4128
|
+
{
|
|
4129
|
+
id: itemId,
|
|
4130
|
+
className: "mt-[2.5px] data-[disabled]:opacity-100",
|
|
4131
|
+
...props
|
|
4132
|
+
}
|
|
4133
|
+
),
|
|
4134
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1.5 min-w-0 flex-1", children: [
|
|
4135
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "type-body-sm-medium text-default", children: label }),
|
|
4136
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "type-body-xs-regular text-secondary", children: description })
|
|
4137
|
+
] }),
|
|
4138
|
+
flipped && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4139
|
+
RadioGroupItem,
|
|
4140
|
+
{
|
|
4141
|
+
id: itemId,
|
|
4142
|
+
className: "mt-[2.5px] data-[disabled]:opacity-100",
|
|
4143
|
+
...props
|
|
4144
|
+
}
|
|
4145
|
+
)
|
|
4146
|
+
]
|
|
4147
|
+
}
|
|
4148
|
+
);
|
|
4149
|
+
}
|
|
4150
|
+
|
|
3114
4151
|
// src/components/ui/switch.tsx
|
|
3115
4152
|
var import_switch = require("@base-ui/react/switch");
|
|
3116
|
-
var
|
|
3117
|
-
var
|
|
3118
|
-
var switchVariants = (0,
|
|
4153
|
+
var import_class_variance_authority14 = require("class-variance-authority");
|
|
4154
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4155
|
+
var switchVariants = (0, import_class_variance_authority14.cva)(
|
|
3119
4156
|
"peer inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 relative focus-visible:ring-3 focus-visible:ring-focus-default aria-invalid:border-error aria-invalid:ring-3 aria-invalid:ring-focus-error data-checked:interactive-accent data-unchecked:interactive-secondary data-unchecked:border-default data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
3120
4157
|
{
|
|
3121
4158
|
variants: {
|
|
@@ -3129,7 +4166,7 @@ var switchVariants = (0, import_class_variance_authority11.cva)(
|
|
|
3129
4166
|
}
|
|
3130
4167
|
}
|
|
3131
4168
|
);
|
|
3132
|
-
var switchThumbVariants = (0,
|
|
4169
|
+
var switchThumbVariants = (0, import_class_variance_authority14.cva)(
|
|
3133
4170
|
"pointer-events-none block rounded-full surface-default shadow-sm ring-0 transition-transform",
|
|
3134
4171
|
{
|
|
3135
4172
|
variants: {
|
|
@@ -3144,14 +4181,14 @@ var switchThumbVariants = (0, import_class_variance_authority11.cva)(
|
|
|
3144
4181
|
}
|
|
3145
4182
|
);
|
|
3146
4183
|
function Switch({ className, size, ref, ...props }) {
|
|
3147
|
-
return /* @__PURE__ */ (0,
|
|
4184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3148
4185
|
import_switch.Switch.Root,
|
|
3149
4186
|
{
|
|
3150
4187
|
ref,
|
|
3151
4188
|
"data-slot": "switch",
|
|
3152
4189
|
className: cn(switchVariants({ size }), className),
|
|
3153
4190
|
...props,
|
|
3154
|
-
children: /* @__PURE__ */ (0,
|
|
4191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3155
4192
|
import_switch.Switch.Thumb,
|
|
3156
4193
|
{
|
|
3157
4194
|
"data-slot": "switch-thumb",
|
|
@@ -3162,11 +4199,116 @@ function Switch({ className, size, ref, ...props }) {
|
|
|
3162
4199
|
);
|
|
3163
4200
|
}
|
|
3164
4201
|
|
|
4202
|
+
// src/components/ui/slider.tsx
|
|
4203
|
+
var import_slider = require("@base-ui/react/slider");
|
|
4204
|
+
var import_class_variance_authority15 = require("class-variance-authority");
|
|
4205
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4206
|
+
var sliderControlVariants = (0, import_class_variance_authority15.cva)([
|
|
4207
|
+
// Base layout
|
|
4208
|
+
"relative flex w-full touch-none select-none items-center",
|
|
4209
|
+
// Disabled
|
|
4210
|
+
"data-[disabled]:opacity-50",
|
|
4211
|
+
// Vertical orientation
|
|
4212
|
+
"data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40",
|
|
4213
|
+
"data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col"
|
|
4214
|
+
]);
|
|
4215
|
+
var sliderTrackVariants = (0, import_class_variance_authority15.cva)([
|
|
4216
|
+
// Base layout & appearance
|
|
4217
|
+
"relative grow overflow-hidden rounded-full",
|
|
4218
|
+
"interactive-secondary",
|
|
4219
|
+
// Horizontal orientation
|
|
4220
|
+
"data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full",
|
|
4221
|
+
// Vertical orientation
|
|
4222
|
+
"data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-1"
|
|
4223
|
+
]);
|
|
4224
|
+
var sliderIndicatorVariants = (0, import_class_variance_authority15.cva)([
|
|
4225
|
+
// Background
|
|
4226
|
+
"interactive-accent",
|
|
4227
|
+
// Horizontal orientation
|
|
4228
|
+
"data-[orientation=horizontal]:h-full",
|
|
4229
|
+
// Vertical orientation
|
|
4230
|
+
"data-[orientation=vertical]:w-full"
|
|
4231
|
+
]);
|
|
4232
|
+
var sliderThumbVariants = (0, import_class_variance_authority15.cva)([
|
|
4233
|
+
// Base layout & appearance
|
|
4234
|
+
"relative block size-3 shrink-0",
|
|
4235
|
+
"rounded-full border border-[var(--color-interactive-accent)] interactive-default shadow-xs",
|
|
4236
|
+
// Transitions
|
|
4237
|
+
"transition-[color,box-shadow]",
|
|
4238
|
+
// Extended hit area
|
|
4239
|
+
"after:absolute after:-inset-2",
|
|
4240
|
+
// Hover & active
|
|
4241
|
+
"hover:ring-2 hover:ring-focus-default active:ring-2 active:ring-focus-default",
|
|
4242
|
+
// Focus (targets inner hidden input via :has)
|
|
4243
|
+
"has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus-default has-[:focus-visible]:outline-hidden",
|
|
4244
|
+
// Disabled
|
|
4245
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
4246
|
+
]);
|
|
4247
|
+
function Slider({
|
|
4248
|
+
className,
|
|
4249
|
+
defaultValue,
|
|
4250
|
+
value,
|
|
4251
|
+
min = 0,
|
|
4252
|
+
max = 100,
|
|
4253
|
+
thumbLabels,
|
|
4254
|
+
...props
|
|
4255
|
+
}) {
|
|
4256
|
+
const values = Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : typeof value === "number" ? [value] : typeof defaultValue === "number" ? [defaultValue] : [min];
|
|
4257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4258
|
+
import_slider.Slider.Root,
|
|
4259
|
+
{
|
|
4260
|
+
"data-slot": "slider",
|
|
4261
|
+
className: cn(
|
|
4262
|
+
"data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full",
|
|
4263
|
+
className
|
|
4264
|
+
),
|
|
4265
|
+
defaultValue,
|
|
4266
|
+
value,
|
|
4267
|
+
min,
|
|
4268
|
+
max,
|
|
4269
|
+
thumbAlignment: "edge",
|
|
4270
|
+
...props,
|
|
4271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4272
|
+
import_slider.Slider.Control,
|
|
4273
|
+
{
|
|
4274
|
+
"data-slot": "slider-control",
|
|
4275
|
+
className: sliderControlVariants(),
|
|
4276
|
+
children: [
|
|
4277
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4278
|
+
import_slider.Slider.Track,
|
|
4279
|
+
{
|
|
4280
|
+
"data-slot": "slider-track",
|
|
4281
|
+
className: sliderTrackVariants(),
|
|
4282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4283
|
+
import_slider.Slider.Indicator,
|
|
4284
|
+
{
|
|
4285
|
+
"data-slot": "slider-range",
|
|
4286
|
+
className: sliderIndicatorVariants()
|
|
4287
|
+
}
|
|
4288
|
+
)
|
|
4289
|
+
}
|
|
4290
|
+
),
|
|
4291
|
+
Array.from({ length: values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4292
|
+
import_slider.Slider.Thumb,
|
|
4293
|
+
{
|
|
4294
|
+
"data-slot": "slider-thumb",
|
|
4295
|
+
"aria-label": thumbLabels?.[index],
|
|
4296
|
+
className: sliderThumbVariants()
|
|
4297
|
+
},
|
|
4298
|
+
index
|
|
4299
|
+
))
|
|
4300
|
+
]
|
|
4301
|
+
}
|
|
4302
|
+
)
|
|
4303
|
+
}
|
|
4304
|
+
);
|
|
4305
|
+
}
|
|
4306
|
+
|
|
3165
4307
|
// src/components/ui/input.tsx
|
|
3166
4308
|
var import_input = require("@base-ui/react/input");
|
|
3167
|
-
var
|
|
3168
|
-
var
|
|
3169
|
-
var inputVariants = (0,
|
|
4309
|
+
var import_class_variance_authority16 = require("class-variance-authority");
|
|
4310
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4311
|
+
var inputVariants = (0, import_class_variance_authority16.cva)(
|
|
3170
4312
|
cn(
|
|
3171
4313
|
// Layout
|
|
3172
4314
|
"w-full min-w-0",
|
|
@@ -3204,7 +4346,7 @@ var inputVariants = (0, import_class_variance_authority12.cva)(
|
|
|
3204
4346
|
}
|
|
3205
4347
|
);
|
|
3206
4348
|
function Input({ className, size, roundness, ref, ...props }) {
|
|
3207
|
-
return /* @__PURE__ */ (0,
|
|
4349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3208
4350
|
import_input.Input,
|
|
3209
4351
|
{
|
|
3210
4352
|
"data-slot": "input",
|
|
@@ -3216,9 +4358,9 @@ function Input({ className, size, roundness, ref, ...props }) {
|
|
|
3216
4358
|
}
|
|
3217
4359
|
|
|
3218
4360
|
// src/components/ui/textarea.tsx
|
|
3219
|
-
var
|
|
4361
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3220
4362
|
function Textarea({ className, style, ref, ...props }) {
|
|
3221
|
-
return /* @__PURE__ */ (0,
|
|
4363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3222
4364
|
"textarea",
|
|
3223
4365
|
{
|
|
3224
4366
|
className: cn(
|
|
@@ -3233,9 +4375,9 @@ function Textarea({ className, style, ref, ...props }) {
|
|
|
3233
4375
|
}
|
|
3234
4376
|
|
|
3235
4377
|
// src/components/ui/input-group.tsx
|
|
3236
|
-
var
|
|
3237
|
-
var
|
|
3238
|
-
var inputGroupVariants = (0,
|
|
4378
|
+
var import_class_variance_authority17 = require("class-variance-authority");
|
|
4379
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4380
|
+
var inputGroupVariants = (0, import_class_variance_authority17.cva)(
|
|
3239
4381
|
cn(
|
|
3240
4382
|
// Layout
|
|
3241
4383
|
"group/input-group relative flex w-full min-w-0 items-center overflow-hidden",
|
|
@@ -3282,7 +4424,7 @@ function InputGroup({
|
|
|
3282
4424
|
ref,
|
|
3283
4425
|
...props
|
|
3284
4426
|
}) {
|
|
3285
|
-
return /* @__PURE__ */ (0,
|
|
4427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3286
4428
|
"div",
|
|
3287
4429
|
{
|
|
3288
4430
|
ref,
|
|
@@ -3294,7 +4436,7 @@ function InputGroup({
|
|
|
3294
4436
|
}
|
|
3295
4437
|
);
|
|
3296
4438
|
}
|
|
3297
|
-
var inputGroupAddonVariants = (0,
|
|
4439
|
+
var inputGroupAddonVariants = (0, import_class_variance_authority17.cva)(
|
|
3298
4440
|
"flex h-auto items-center justify-center gap-2 py-1.5 type-body-sm-regular group-data-[size=mini]/input-group:type-body-xs-regular text-secondary select-none [&>svg:not([class*='size-'])]:size-4",
|
|
3299
4441
|
{
|
|
3300
4442
|
variants: {
|
|
@@ -3316,7 +4458,7 @@ function InputGroupAddon({
|
|
|
3316
4458
|
ref,
|
|
3317
4459
|
...props
|
|
3318
4460
|
}) {
|
|
3319
|
-
return /* @__PURE__ */ (0,
|
|
4461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3320
4462
|
"div",
|
|
3321
4463
|
{
|
|
3322
4464
|
ref,
|
|
@@ -3331,7 +4473,7 @@ function InputGroupAddon({
|
|
|
3331
4473
|
}
|
|
3332
4474
|
);
|
|
3333
4475
|
}
|
|
3334
|
-
var inputGroupButtonVariants = (0,
|
|
4476
|
+
var inputGroupButtonVariants = (0, import_class_variance_authority17.cva)("shadow-none py-0", {
|
|
3335
4477
|
variants: {
|
|
3336
4478
|
size: {
|
|
3337
4479
|
xs: "h-6 gap-1 rounded-sm px-1.5 type-label-xs-medium [&>svg:not([class*='size-'])]:size-3.5",
|
|
@@ -3352,7 +4494,7 @@ function InputGroupButton({
|
|
|
3352
4494
|
ref,
|
|
3353
4495
|
...props
|
|
3354
4496
|
}) {
|
|
3355
|
-
return /* @__PURE__ */ (0,
|
|
4497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3356
4498
|
Button,
|
|
3357
4499
|
{
|
|
3358
4500
|
ref,
|
|
@@ -3364,7 +4506,7 @@ function InputGroupButton({
|
|
|
3364
4506
|
);
|
|
3365
4507
|
}
|
|
3366
4508
|
function InputGroupText({ className, ref, ...props }) {
|
|
3367
|
-
return /* @__PURE__ */ (0,
|
|
4509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3368
4510
|
"span",
|
|
3369
4511
|
{
|
|
3370
4512
|
ref,
|
|
@@ -3381,7 +4523,7 @@ function InputGroupInput({ className, ref, ...props }) {
|
|
|
3381
4523
|
// Most of these classes override Input's default border, background, shadow,
|
|
3382
4524
|
// and focus/error/disabled styles so that InputGroup owns all visual states
|
|
3383
4525
|
// via its own has-[...] selectors.
|
|
3384
|
-
/* @__PURE__ */ (0,
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3385
4527
|
Input,
|
|
3386
4528
|
{
|
|
3387
4529
|
ref,
|
|
@@ -3403,7 +4545,7 @@ function InputGroupTextarea({
|
|
|
3403
4545
|
return (
|
|
3404
4546
|
// Same overrides as InputGroupInput — strips Textarea's own border, background,
|
|
3405
4547
|
// shadow, and focus/error/disabled styles so InputGroup owns all visual states.
|
|
3406
|
-
/* @__PURE__ */ (0,
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3407
4549
|
Textarea,
|
|
3408
4550
|
{
|
|
3409
4551
|
ref,
|
|
@@ -3418,121 +4560,59 @@ function InputGroupTextarea({
|
|
|
3418
4560
|
);
|
|
3419
4561
|
}
|
|
3420
4562
|
|
|
3421
|
-
// src/components/ui/
|
|
3422
|
-
var
|
|
3423
|
-
var
|
|
3424
|
-
var
|
|
3425
|
-
var badgeVariants = (0, import_class_variance_authority14.cva)(
|
|
4563
|
+
// src/components/ui/tag.tsx
|
|
4564
|
+
var import_class_variance_authority18 = require("class-variance-authority");
|
|
4565
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4566
|
+
var tagVariants = (0, import_class_variance_authority18.cva)(
|
|
3426
4567
|
[
|
|
3427
4568
|
// Layout
|
|
3428
|
-
"inline-flex items-center justify-center
|
|
4569
|
+
"inline-flex items-center justify-center",
|
|
3429
4570
|
// Size
|
|
3430
|
-
"h-6 px-2",
|
|
4571
|
+
"h-6 px-2.5",
|
|
3431
4572
|
// Text
|
|
3432
4573
|
"whitespace-nowrap type-label-xs-medium",
|
|
3433
4574
|
// Shape
|
|
3434
|
-
"rounded-
|
|
3435
|
-
// Transitions
|
|
3436
|
-
"transition-colors",
|
|
3437
|
-
// Focus — flush ring, no gap
|
|
3438
|
-
"focus-visible:outline-none",
|
|
3439
|
-
"focus-visible:ring-2 focus-visible:ring-focus-default",
|
|
3440
|
-
// Icons
|
|
3441
|
-
"[&_svg]:pointer-events-none [&_svg]:size-3 [&_svg]:shrink-0"
|
|
4575
|
+
"rounded-full"
|
|
3442
4576
|
],
|
|
3443
|
-
{
|
|
3444
|
-
variants: {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
if (typeof node === "string" || typeof node === "number") {
|
|
3466
|
-
const trimmed = String(node).trim();
|
|
3467
|
-
return trimmed.length === 1;
|
|
3468
|
-
}
|
|
3469
|
-
if (Array.isArray(node)) {
|
|
3470
|
-
const parts = node.filter((x) => x != null && typeof x !== "boolean");
|
|
3471
|
-
if (parts.length !== 1) return false;
|
|
3472
|
-
return isSingleDisplayCharacter(parts[0]);
|
|
3473
|
-
}
|
|
3474
|
-
if (React10.isValidElement(node)) {
|
|
3475
|
-
return isSingleDisplayCharacter(
|
|
3476
|
-
node.props.children
|
|
3477
|
-
);
|
|
3478
|
-
}
|
|
3479
|
-
return false;
|
|
3480
|
-
}
|
|
3481
|
-
function Badge({
|
|
3482
|
-
className,
|
|
3483
|
-
variant,
|
|
3484
|
-
iconLeft,
|
|
3485
|
-
iconRight,
|
|
3486
|
-
onKeyDown,
|
|
3487
|
-
style,
|
|
3488
|
-
children,
|
|
3489
|
-
ref,
|
|
3490
|
-
...props
|
|
3491
|
-
}) {
|
|
3492
|
-
if (!variant) {
|
|
3493
|
-
return null;
|
|
3494
|
-
}
|
|
3495
|
-
const circle = isSingleDisplayCharacter(children) && !iconLeft && !iconRight;
|
|
3496
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3497
|
-
"span",
|
|
3498
|
-
{
|
|
3499
|
-
...props,
|
|
3500
|
-
role: "button",
|
|
3501
|
-
tabIndex: 0,
|
|
3502
|
-
onKeyDown: (e) => {
|
|
3503
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
3504
|
-
e.preventDefault();
|
|
3505
|
-
e.currentTarget.click();
|
|
3506
|
-
}
|
|
3507
|
-
onKeyDown?.(e);
|
|
3508
|
-
},
|
|
3509
|
-
className: cn(
|
|
3510
|
-
badgeVariants({ variant }),
|
|
3511
|
-
circle ? "size-5 shrink-0 p-0" : "",
|
|
3512
|
-
className
|
|
3513
|
-
),
|
|
3514
|
-
style,
|
|
4577
|
+
{
|
|
4578
|
+
variants: {
|
|
4579
|
+
color: {
|
|
4580
|
+
violet: "bg-violet-100 text-violet-800",
|
|
4581
|
+
cyan: "bg-cyan-100 text-cyan-900",
|
|
4582
|
+
indigo: "bg-indigo-100 text-indigo-800",
|
|
4583
|
+
orange: "bg-orange-100 text-orange-900",
|
|
4584
|
+
pink: "bg-pink-100 text-pink-900",
|
|
4585
|
+
verdant: "bg-verdant-100 text-verdant-800",
|
|
4586
|
+
stone: "bg-stone-200 text-stone-800"
|
|
4587
|
+
}
|
|
4588
|
+
},
|
|
4589
|
+
defaultVariants: {
|
|
4590
|
+
color: "stone"
|
|
4591
|
+
}
|
|
4592
|
+
}
|
|
4593
|
+
);
|
|
4594
|
+
function Tag({ className, color, ref, ...props }) {
|
|
4595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4596
|
+
"span",
|
|
4597
|
+
{
|
|
4598
|
+
className: cn(tagVariants({ color }), className),
|
|
3515
4599
|
ref,
|
|
3516
|
-
|
|
3517
|
-
iconLeft,
|
|
3518
|
-
children,
|
|
3519
|
-
iconRight
|
|
3520
|
-
]
|
|
4600
|
+
...props
|
|
3521
4601
|
}
|
|
3522
4602
|
);
|
|
3523
4603
|
}
|
|
3524
4604
|
|
|
3525
4605
|
// src/components/ui/alert-dialog.tsx
|
|
3526
4606
|
var import_alert_dialog = require("@base-ui/react/alert-dialog");
|
|
3527
|
-
var
|
|
4607
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3528
4608
|
function AlertDialog({ ...props }) {
|
|
3529
|
-
return /* @__PURE__ */ (0,
|
|
4609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_alert_dialog.AlertDialog.Root, { "data-slot": "alert-dialog", ...props });
|
|
3530
4610
|
}
|
|
3531
4611
|
function AlertDialogTrigger({
|
|
3532
4612
|
ref,
|
|
3533
4613
|
...props
|
|
3534
4614
|
}) {
|
|
3535
|
-
return /* @__PURE__ */ (0,
|
|
4615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3536
4616
|
import_alert_dialog.AlertDialog.Trigger,
|
|
3537
4617
|
{
|
|
3538
4618
|
ref,
|
|
@@ -3546,7 +4626,7 @@ function AlertDialogOverlay({
|
|
|
3546
4626
|
ref,
|
|
3547
4627
|
...props
|
|
3548
4628
|
}) {
|
|
3549
|
-
return /* @__PURE__ */ (0,
|
|
4629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3550
4630
|
import_alert_dialog.AlertDialog.Backdrop,
|
|
3551
4631
|
{
|
|
3552
4632
|
ref,
|
|
@@ -3568,9 +4648,9 @@ function AlertDialogContent({
|
|
|
3568
4648
|
ref,
|
|
3569
4649
|
...props
|
|
3570
4650
|
}) {
|
|
3571
|
-
return /* @__PURE__ */ (0,
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
4651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_alert_dialog.AlertDialog.Portal, { "data-slot": "alert-dialog-portal", children: [
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AlertDialogOverlay, {}),
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3574
4654
|
import_alert_dialog.AlertDialog.Popup,
|
|
3575
4655
|
{
|
|
3576
4656
|
ref,
|
|
@@ -3603,7 +4683,7 @@ function AlertDialogHeader({
|
|
|
3603
4683
|
ref,
|
|
3604
4684
|
...props
|
|
3605
4685
|
}) {
|
|
3606
|
-
return /* @__PURE__ */ (0,
|
|
4686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3607
4687
|
"div",
|
|
3608
4688
|
{
|
|
3609
4689
|
ref,
|
|
@@ -3623,7 +4703,7 @@ function AlertDialogFooter({
|
|
|
3623
4703
|
ref,
|
|
3624
4704
|
...props
|
|
3625
4705
|
}) {
|
|
3626
|
-
return /* @__PURE__ */ (0,
|
|
4706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3627
4707
|
"div",
|
|
3628
4708
|
{
|
|
3629
4709
|
ref,
|
|
@@ -3645,7 +4725,7 @@ function AlertDialogTitle({
|
|
|
3645
4725
|
ref,
|
|
3646
4726
|
...props
|
|
3647
4727
|
}) {
|
|
3648
|
-
return /* @__PURE__ */ (0,
|
|
4728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3649
4729
|
import_alert_dialog.AlertDialog.Title,
|
|
3650
4730
|
{
|
|
3651
4731
|
ref,
|
|
@@ -3660,7 +4740,7 @@ function AlertDialogDescription({
|
|
|
3660
4740
|
ref,
|
|
3661
4741
|
...props
|
|
3662
4742
|
}) {
|
|
3663
|
-
return /* @__PURE__ */ (0,
|
|
4743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3664
4744
|
import_alert_dialog.AlertDialog.Description,
|
|
3665
4745
|
{
|
|
3666
4746
|
ref,
|
|
@@ -3677,12 +4757,12 @@ function AlertDialogAction({
|
|
|
3677
4757
|
ref,
|
|
3678
4758
|
...props
|
|
3679
4759
|
}) {
|
|
3680
|
-
return /* @__PURE__ */ (0,
|
|
4760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3681
4761
|
import_alert_dialog.AlertDialog.Close,
|
|
3682
4762
|
{
|
|
3683
4763
|
ref,
|
|
3684
4764
|
"data-slot": "alert-dialog-action",
|
|
3685
|
-
render: /* @__PURE__ */ (0,
|
|
4765
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant, size }),
|
|
3686
4766
|
className,
|
|
3687
4767
|
...props
|
|
3688
4768
|
}
|
|
@@ -3695,12 +4775,12 @@ function AlertDialogCancel({
|
|
|
3695
4775
|
ref,
|
|
3696
4776
|
...props
|
|
3697
4777
|
}) {
|
|
3698
|
-
return /* @__PURE__ */ (0,
|
|
4778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3699
4779
|
import_alert_dialog.AlertDialog.Close,
|
|
3700
4780
|
{
|
|
3701
4781
|
ref,
|
|
3702
4782
|
"data-slot": "alert-dialog-cancel",
|
|
3703
|
-
render: /* @__PURE__ */ (0,
|
|
4783
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant, size }),
|
|
3704
4784
|
className,
|
|
3705
4785
|
...props
|
|
3706
4786
|
}
|
|
@@ -3708,14 +4788,14 @@ function AlertDialogCancel({
|
|
|
3708
4788
|
}
|
|
3709
4789
|
|
|
3710
4790
|
// src/components/ui/item.tsx
|
|
3711
|
-
var
|
|
4791
|
+
var React13 = __toESM(require("react"));
|
|
3712
4792
|
var import_merge_props3 = require("@base-ui/react/merge-props");
|
|
3713
4793
|
var import_use_render3 = require("@base-ui/react/use-render");
|
|
3714
|
-
var
|
|
3715
|
-
var
|
|
3716
|
-
var ItemGroupContext =
|
|
4794
|
+
var import_class_variance_authority19 = require("class-variance-authority");
|
|
4795
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4796
|
+
var ItemGroupContext = React13.createContext(false);
|
|
3717
4797
|
function ItemGroup({ className, ref, ...props }) {
|
|
3718
|
-
return /* @__PURE__ */ (0,
|
|
4798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemGroupContext, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3719
4799
|
"div",
|
|
3720
4800
|
{
|
|
3721
4801
|
ref,
|
|
@@ -3734,7 +4814,7 @@ function ItemSeparator({
|
|
|
3734
4814
|
ref,
|
|
3735
4815
|
...props
|
|
3736
4816
|
}) {
|
|
3737
|
-
return /* @__PURE__ */ (0,
|
|
4817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3738
4818
|
Separator,
|
|
3739
4819
|
{
|
|
3740
4820
|
ref,
|
|
@@ -3745,7 +4825,7 @@ function ItemSeparator({
|
|
|
3745
4825
|
}
|
|
3746
4826
|
);
|
|
3747
4827
|
}
|
|
3748
|
-
var itemVariants = (0,
|
|
4828
|
+
var itemVariants = (0, import_class_variance_authority19.cva)(
|
|
3749
4829
|
"surface-default rounded-md border group/item flex w-full flex-wrap transition-colors duration-100 outline-none [a]:relative [a]:isolate [a]:after:absolute [a]:after:inset-0 [a]:after:rounded-[inherit] [a]:after:-z-10 [a]:after:pointer-events-none [a]:after:transition-colors",
|
|
3750
4830
|
{
|
|
3751
4831
|
variants: {
|
|
@@ -3772,7 +4852,7 @@ var Item = ({
|
|
|
3772
4852
|
render,
|
|
3773
4853
|
...props
|
|
3774
4854
|
}) => {
|
|
3775
|
-
const insideGroup =
|
|
4855
|
+
const insideGroup = React13.useContext(ItemGroupContext);
|
|
3776
4856
|
return (0, import_use_render3.useRender)({
|
|
3777
4857
|
defaultTagName: "div",
|
|
3778
4858
|
props: (0, import_merge_props3.mergeProps)(
|
|
@@ -3790,7 +4870,7 @@ var Item = ({
|
|
|
3790
4870
|
}
|
|
3791
4871
|
});
|
|
3792
4872
|
};
|
|
3793
|
-
var itemMediaVariants = (0,
|
|
4873
|
+
var itemMediaVariants = (0, import_class_variance_authority19.cva)(
|
|
3794
4874
|
"gap-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none",
|
|
3795
4875
|
{
|
|
3796
4876
|
variants: {
|
|
@@ -3812,7 +4892,7 @@ function ItemMedia({
|
|
|
3812
4892
|
ref,
|
|
3813
4893
|
...props
|
|
3814
4894
|
}) {
|
|
3815
|
-
return /* @__PURE__ */ (0,
|
|
4895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3816
4896
|
"div",
|
|
3817
4897
|
{
|
|
3818
4898
|
ref,
|
|
@@ -3828,7 +4908,7 @@ function ItemContent({
|
|
|
3828
4908
|
ref,
|
|
3829
4909
|
...props
|
|
3830
4910
|
}) {
|
|
3831
|
-
return /* @__PURE__ */ (0,
|
|
4911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3832
4912
|
"div",
|
|
3833
4913
|
{
|
|
3834
4914
|
ref,
|
|
@@ -3842,7 +4922,7 @@ function ItemContent({
|
|
|
3842
4922
|
);
|
|
3843
4923
|
}
|
|
3844
4924
|
function ItemTitle({ className, ref, ...props }) {
|
|
3845
|
-
return /* @__PURE__ */ (0,
|
|
4925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3846
4926
|
"div",
|
|
3847
4927
|
{
|
|
3848
4928
|
ref,
|
|
@@ -3860,7 +4940,7 @@ function ItemDescription({
|
|
|
3860
4940
|
ref,
|
|
3861
4941
|
...props
|
|
3862
4942
|
}) {
|
|
3863
|
-
return /* @__PURE__ */ (0,
|
|
4943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3864
4944
|
"p",
|
|
3865
4945
|
{
|
|
3866
4946
|
ref,
|
|
@@ -3878,7 +4958,7 @@ function ItemActions({
|
|
|
3878
4958
|
ref,
|
|
3879
4959
|
...props
|
|
3880
4960
|
}) {
|
|
3881
|
-
return /* @__PURE__ */ (0,
|
|
4961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3882
4962
|
"div",
|
|
3883
4963
|
{
|
|
3884
4964
|
ref,
|
|
@@ -3889,7 +4969,7 @@ function ItemActions({
|
|
|
3889
4969
|
);
|
|
3890
4970
|
}
|
|
3891
4971
|
function ItemHeader({ className, ref, ...props }) {
|
|
3892
|
-
return /* @__PURE__ */ (0,
|
|
4972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3893
4973
|
"div",
|
|
3894
4974
|
{
|
|
3895
4975
|
ref,
|
|
@@ -3903,7 +4983,7 @@ function ItemHeader({ className, ref, ...props }) {
|
|
|
3903
4983
|
);
|
|
3904
4984
|
}
|
|
3905
4985
|
function ItemFooter({ className, ref, ...props }) {
|
|
3906
|
-
return /* @__PURE__ */ (0,
|
|
4986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3907
4987
|
"div",
|
|
3908
4988
|
{
|
|
3909
4989
|
ref,
|
|
@@ -3919,14 +4999,14 @@ function ItemFooter({ className, ref, ...props }) {
|
|
|
3919
4999
|
|
|
3920
5000
|
// src/components/ui/tabs.tsx
|
|
3921
5001
|
var import_tabs = require("@base-ui/react/tabs");
|
|
3922
|
-
var
|
|
3923
|
-
var
|
|
5002
|
+
var import_class_variance_authority20 = require("class-variance-authority");
|
|
5003
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3924
5004
|
function Tabs({
|
|
3925
5005
|
className,
|
|
3926
5006
|
orientation = "horizontal",
|
|
3927
5007
|
...props
|
|
3928
5008
|
}) {
|
|
3929
|
-
return /* @__PURE__ */ (0,
|
|
5009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3930
5010
|
import_tabs.Tabs.Root,
|
|
3931
5011
|
{
|
|
3932
5012
|
"data-slot": "tabs",
|
|
@@ -3940,7 +5020,7 @@ function Tabs({
|
|
|
3940
5020
|
}
|
|
3941
5021
|
);
|
|
3942
5022
|
}
|
|
3943
|
-
var tabsListVariants = (0,
|
|
5023
|
+
var tabsListVariants = (0, import_class_variance_authority20.cva)(
|
|
3944
5024
|
[
|
|
3945
5025
|
// base layout
|
|
3946
5026
|
"group/tabs-list inline-flex w-fit items-center p-1",
|
|
@@ -3968,7 +5048,7 @@ function TabsList({
|
|
|
3968
5048
|
variant = "default",
|
|
3969
5049
|
...props
|
|
3970
5050
|
}) {
|
|
3971
|
-
return /* @__PURE__ */ (0,
|
|
5051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3972
5052
|
import_tabs.Tabs.List,
|
|
3973
5053
|
{
|
|
3974
5054
|
"data-slot": "tabs-list",
|
|
@@ -3978,7 +5058,7 @@ function TabsList({
|
|
|
3978
5058
|
}
|
|
3979
5059
|
);
|
|
3980
5060
|
}
|
|
3981
|
-
var tabsTriggerVariants = (0,
|
|
5061
|
+
var tabsTriggerVariants = (0, import_class_variance_authority20.cva)(
|
|
3982
5062
|
[
|
|
3983
5063
|
// base layout
|
|
3984
5064
|
"relative inline-flex shrink-0 items-center justify-center whitespace-nowrap",
|
|
@@ -4032,7 +5112,7 @@ function TabsTrigger({
|
|
|
4032
5112
|
size = "regular",
|
|
4033
5113
|
...props
|
|
4034
5114
|
}) {
|
|
4035
|
-
return /* @__PURE__ */ (0,
|
|
5115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4036
5116
|
import_tabs.Tabs.Tab,
|
|
4037
5117
|
{
|
|
4038
5118
|
"data-slot": "tabs-trigger",
|
|
@@ -4042,7 +5122,7 @@ function TabsTrigger({
|
|
|
4042
5122
|
);
|
|
4043
5123
|
}
|
|
4044
5124
|
function TabsContent({ className, ...props }) {
|
|
4045
|
-
return /* @__PURE__ */ (0,
|
|
5125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4046
5126
|
import_tabs.Tabs.Panel,
|
|
4047
5127
|
{
|
|
4048
5128
|
"data-slot": "tabs-content",
|
|
@@ -4055,8 +5135,8 @@ function TabsContent({ className, ...props }) {
|
|
|
4055
5135
|
// src/components/ui/dropdown-menu.tsx
|
|
4056
5136
|
var import_menu = require("@base-ui/react/menu");
|
|
4057
5137
|
var import_separator5 = require("@base-ui/react/separator");
|
|
4058
|
-
var
|
|
4059
|
-
var
|
|
5138
|
+
var import_class_variance_authority21 = require("class-variance-authority");
|
|
5139
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4060
5140
|
var DropdownMenu = import_menu.Menu.Root;
|
|
4061
5141
|
var DropdownMenuGroup = import_menu.Menu.Group;
|
|
4062
5142
|
var DropdownMenuSub = import_menu.Menu.SubmenuRoot;
|
|
@@ -4066,7 +5146,7 @@ function DropdownMenuTrigger({
|
|
|
4066
5146
|
ref,
|
|
4067
5147
|
...props
|
|
4068
5148
|
}) {
|
|
4069
|
-
return /* @__PURE__ */ (0,
|
|
5149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4070
5150
|
import_menu.Menu.Trigger,
|
|
4071
5151
|
{
|
|
4072
5152
|
"data-slot": "dropdown-trigger",
|
|
@@ -4085,7 +5165,7 @@ function DropdownMenuContent({
|
|
|
4085
5165
|
ref,
|
|
4086
5166
|
...props
|
|
4087
5167
|
}) {
|
|
4088
|
-
return /* @__PURE__ */ (0,
|
|
5168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_menu.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4089
5169
|
import_menu.Menu.Positioner,
|
|
4090
5170
|
{
|
|
4091
5171
|
className: "isolate z-50 outline-none",
|
|
@@ -4093,7 +5173,7 @@ function DropdownMenuContent({
|
|
|
4093
5173
|
alignOffset,
|
|
4094
5174
|
side,
|
|
4095
5175
|
sideOffset,
|
|
4096
|
-
children: /* @__PURE__ */ (0,
|
|
5176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4097
5177
|
import_menu.Menu.Popup,
|
|
4098
5178
|
{
|
|
4099
5179
|
"data-slot": "dropdown-content",
|
|
@@ -4120,7 +5200,7 @@ function DropdownMenuSubTrigger({
|
|
|
4120
5200
|
ref,
|
|
4121
5201
|
...props
|
|
4122
5202
|
}) {
|
|
4123
|
-
return /* @__PURE__ */ (0,
|
|
5203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4124
5204
|
import_menu.Menu.SubmenuTrigger,
|
|
4125
5205
|
{
|
|
4126
5206
|
"data-slot": "dropdown-sub-trigger",
|
|
@@ -4139,7 +5219,7 @@ function DropdownMenuSubTrigger({
|
|
|
4139
5219
|
...props,
|
|
4140
5220
|
children: [
|
|
4141
5221
|
children,
|
|
4142
|
-
/* @__PURE__ */ (0,
|
|
5222
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ArrowRightIcon, { size: 16, className: "ml-auto text-secondary" })
|
|
4143
5223
|
]
|
|
4144
5224
|
}
|
|
4145
5225
|
);
|
|
@@ -4153,7 +5233,7 @@ function DropdownMenuSubContent({
|
|
|
4153
5233
|
ref,
|
|
4154
5234
|
...props
|
|
4155
5235
|
}) {
|
|
4156
|
-
return /* @__PURE__ */ (0,
|
|
5236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4157
5237
|
DropdownMenuContent,
|
|
4158
5238
|
{
|
|
4159
5239
|
"data-slot": "dropdown-sub-content",
|
|
@@ -4167,7 +5247,7 @@ function DropdownMenuSubContent({
|
|
|
4167
5247
|
}
|
|
4168
5248
|
);
|
|
4169
5249
|
}
|
|
4170
|
-
var dropdownMenuItemVariants = (0,
|
|
5250
|
+
var dropdownMenuItemVariants = (0, import_class_variance_authority21.cva)(
|
|
4171
5251
|
[
|
|
4172
5252
|
"relative flex w-full cursor-default select-none items-center gap-2",
|
|
4173
5253
|
"min-h-8 px-2 py-[5.5px] rounded-md",
|
|
@@ -4196,7 +5276,7 @@ function DropdownMenuItem({
|
|
|
4196
5276
|
ref,
|
|
4197
5277
|
...props
|
|
4198
5278
|
}) {
|
|
4199
|
-
return /* @__PURE__ */ (0,
|
|
5279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4200
5280
|
import_menu.Menu.Item,
|
|
4201
5281
|
{
|
|
4202
5282
|
"data-slot": "dropdown-item",
|
|
@@ -4218,7 +5298,7 @@ function DropdownMenuCheckboxItem({
|
|
|
4218
5298
|
ref,
|
|
4219
5299
|
...props
|
|
4220
5300
|
}) {
|
|
4221
|
-
return /* @__PURE__ */ (0,
|
|
5301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4222
5302
|
import_menu.Menu.CheckboxItem,
|
|
4223
5303
|
{
|
|
4224
5304
|
"data-slot": "dropdown-checkbox-item",
|
|
@@ -4236,7 +5316,7 @@ function DropdownMenuCheckboxItem({
|
|
|
4236
5316
|
checked,
|
|
4237
5317
|
...props,
|
|
4238
5318
|
children: [
|
|
4239
|
-
/* @__PURE__ */ (0,
|
|
5319
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_menu.Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CheckmarkIcon, { size: 16 }) }) }),
|
|
4240
5320
|
children
|
|
4241
5321
|
]
|
|
4242
5322
|
}
|
|
@@ -4249,7 +5329,7 @@ function DropdownMenuRadioItem({
|
|
|
4249
5329
|
ref,
|
|
4250
5330
|
...props
|
|
4251
5331
|
}) {
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
5332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4253
5333
|
import_menu.Menu.RadioItem,
|
|
4254
5334
|
{
|
|
4255
5335
|
"data-slot": "dropdown-radio-item",
|
|
@@ -4267,7 +5347,7 @@ function DropdownMenuRadioItem({
|
|
|
4267
5347
|
...props,
|
|
4268
5348
|
children: [
|
|
4269
5349
|
children,
|
|
4270
|
-
/* @__PURE__ */ (0,
|
|
5350
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "hidden size-2 rounded-full bg-[var(--color-interactive-accent)] group-data-[checked]:block" }) })
|
|
4271
5351
|
]
|
|
4272
5352
|
}
|
|
4273
5353
|
);
|
|
@@ -4277,7 +5357,7 @@ function DropdownMenuLabel({
|
|
|
4277
5357
|
ref,
|
|
4278
5358
|
...props
|
|
4279
5359
|
}) {
|
|
4280
|
-
return /* @__PURE__ */ (0,
|
|
5360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4281
5361
|
import_menu.Menu.GroupLabel,
|
|
4282
5362
|
{
|
|
4283
5363
|
"data-slot": "dropdown-label",
|
|
@@ -4295,7 +5375,7 @@ function DropdownMenuSeparator({
|
|
|
4295
5375
|
ref,
|
|
4296
5376
|
...props
|
|
4297
5377
|
}) {
|
|
4298
|
-
return /* @__PURE__ */ (0,
|
|
5378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4299
5379
|
import_separator5.Separator,
|
|
4300
5380
|
{
|
|
4301
5381
|
"data-slot": "dropdown-separator",
|
|
@@ -4312,7 +5392,7 @@ function DropdownMenuShortcut({
|
|
|
4312
5392
|
className,
|
|
4313
5393
|
...props
|
|
4314
5394
|
}) {
|
|
4315
|
-
return /* @__PURE__ */ (0,
|
|
5395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4316
5396
|
"span",
|
|
4317
5397
|
{
|
|
4318
5398
|
"data-slot": "dropdown-shortcut",
|
|
@@ -4326,15 +5406,462 @@ function DropdownMenuShortcut({
|
|
|
4326
5406
|
);
|
|
4327
5407
|
}
|
|
4328
5408
|
|
|
5409
|
+
// src/components/ui/chart.tsx
|
|
5410
|
+
var React14 = __toESM(require("react"));
|
|
5411
|
+
var RechartsPrimitive = __toESM(require("recharts"));
|
|
5412
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5413
|
+
var THEMES = { light: "", dark: ".dark" };
|
|
5414
|
+
var INITIAL_DIMENSION = { width: 320, height: 200 };
|
|
5415
|
+
var ChartContext = React14.createContext(null);
|
|
5416
|
+
function useChart() {
|
|
5417
|
+
const context = React14.useContext(ChartContext);
|
|
5418
|
+
if (!context) {
|
|
5419
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
5420
|
+
}
|
|
5421
|
+
return context;
|
|
5422
|
+
}
|
|
5423
|
+
function ChartContainer({
|
|
5424
|
+
id,
|
|
5425
|
+
className,
|
|
5426
|
+
children,
|
|
5427
|
+
config,
|
|
5428
|
+
initialDimension = INITIAL_DIMENSION,
|
|
5429
|
+
...props
|
|
5430
|
+
}) {
|
|
5431
|
+
const uniqueId = React14.useId();
|
|
5432
|
+
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
5433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5434
|
+
"div",
|
|
5435
|
+
{
|
|
5436
|
+
"data-slot": "chart",
|
|
5437
|
+
"data-chart": chartId,
|
|
5438
|
+
className: cn(
|
|
5439
|
+
// Layout
|
|
5440
|
+
"flex aspect-video justify-center text-xs",
|
|
5441
|
+
// Axis
|
|
5442
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-(--color-text-secondary)",
|
|
5443
|
+
// Grid
|
|
5444
|
+
"[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-(--color-border-default)/50",
|
|
5445
|
+
"[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-(--color-border-default)",
|
|
5446
|
+
"[&_.recharts-reference-line_[stroke='#ccc']]:stroke-(--color-border-default)",
|
|
5447
|
+
// Tooltip cursor
|
|
5448
|
+
"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-(--color-border-default)",
|
|
5449
|
+
"[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-(--color-surface-muted)",
|
|
5450
|
+
// Dots & sectors
|
|
5451
|
+
"[&_.recharts-dot[stroke='#fff']]:stroke-transparent",
|
|
5452
|
+
"[&_.recharts-sector]:outline-hidden",
|
|
5453
|
+
// Separate pie/donut slices with a stroke matching the surface behind the chart
|
|
5454
|
+
"[&_.recharts-sector[stroke='#fff']]:stroke-(--color-surface-default)",
|
|
5455
|
+
"[&_.recharts-sector[stroke='#fff']]:[stroke-width:2px]",
|
|
5456
|
+
"[&_.recharts-radial-bar-background-sector]:fill-(--color-surface-muted)",
|
|
5457
|
+
// Misc
|
|
5458
|
+
"[&_.recharts-layer]:outline-hidden",
|
|
5459
|
+
"[&_.recharts-surface]:outline-hidden",
|
|
5460
|
+
className
|
|
5461
|
+
),
|
|
5462
|
+
...props,
|
|
5463
|
+
children: [
|
|
5464
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartStyle, { id: chartId, config }),
|
|
5465
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5466
|
+
RechartsPrimitive.ResponsiveContainer,
|
|
5467
|
+
{
|
|
5468
|
+
initialDimension,
|
|
5469
|
+
children
|
|
5470
|
+
}
|
|
5471
|
+
)
|
|
5472
|
+
]
|
|
5473
|
+
}
|
|
5474
|
+
) });
|
|
5475
|
+
}
|
|
5476
|
+
var ChartStyle = ({ id, config }) => {
|
|
5477
|
+
const colorConfig = Object.entries(config).filter(
|
|
5478
|
+
([, item]) => item.theme ?? item.color
|
|
5479
|
+
);
|
|
5480
|
+
if (!colorConfig.length) {
|
|
5481
|
+
return null;
|
|
5482
|
+
}
|
|
5483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5484
|
+
"style",
|
|
5485
|
+
{
|
|
5486
|
+
dangerouslySetInnerHTML: {
|
|
5487
|
+
__html: Object.entries(THEMES).map(
|
|
5488
|
+
([theme, prefix]) => `
|
|
5489
|
+
${prefix} [data-chart=${id}] {
|
|
5490
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
5491
|
+
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
5492
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
5493
|
+
}).filter(Boolean).join("\n")}
|
|
5494
|
+
}
|
|
5495
|
+
`
|
|
5496
|
+
).join("\n")
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
);
|
|
5500
|
+
};
|
|
5501
|
+
var ChartTooltip = RechartsPrimitive.Tooltip;
|
|
5502
|
+
function ChartTooltipContent({
|
|
5503
|
+
active,
|
|
5504
|
+
payload,
|
|
5505
|
+
className,
|
|
5506
|
+
indicator = "dot",
|
|
5507
|
+
hideLabel = false,
|
|
5508
|
+
hideIndicator = false,
|
|
5509
|
+
label,
|
|
5510
|
+
labelFormatter,
|
|
5511
|
+
labelClassName,
|
|
5512
|
+
formatter,
|
|
5513
|
+
color,
|
|
5514
|
+
nameKey,
|
|
5515
|
+
labelKey
|
|
5516
|
+
}) {
|
|
5517
|
+
const { config } = useChart();
|
|
5518
|
+
const tooltipLabel = React14.useMemo(() => {
|
|
5519
|
+
if (hideLabel || !payload?.length) {
|
|
5520
|
+
return null;
|
|
5521
|
+
}
|
|
5522
|
+
const [item] = payload;
|
|
5523
|
+
const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
|
|
5524
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
5525
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
|
|
5526
|
+
if (labelFormatter) {
|
|
5527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("font-semibold text-default", labelClassName), children: labelFormatter(value, payload) });
|
|
5528
|
+
}
|
|
5529
|
+
if (!value) {
|
|
5530
|
+
return null;
|
|
5531
|
+
}
|
|
5532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("font-semibold text-default", labelClassName), children: value });
|
|
5533
|
+
}, [
|
|
5534
|
+
label,
|
|
5535
|
+
labelFormatter,
|
|
5536
|
+
payload,
|
|
5537
|
+
hideLabel,
|
|
5538
|
+
labelClassName,
|
|
5539
|
+
config,
|
|
5540
|
+
labelKey
|
|
5541
|
+
]);
|
|
5542
|
+
if (!active || !payload?.length) {
|
|
5543
|
+
return null;
|
|
5544
|
+
}
|
|
5545
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
5546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5547
|
+
"div",
|
|
5548
|
+
{
|
|
5549
|
+
className: cn(
|
|
5550
|
+
"grid min-w-[8rem] items-start gap-1.5 rounded-xl border border-muted surface-default px-3 py-2.5 text-xs text-secondary shadow-lg",
|
|
5551
|
+
className
|
|
5552
|
+
),
|
|
5553
|
+
children: [
|
|
5554
|
+
!nestLabel ? tooltipLabel : null,
|
|
5555
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
5556
|
+
const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
|
|
5557
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
5558
|
+
const indicatorColor = color ?? item.payload?.fill ?? item.color ?? (itemConfig && "color" in itemConfig ? itemConfig.color : void 0);
|
|
5559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5560
|
+
"div",
|
|
5561
|
+
{
|
|
5562
|
+
className: cn(
|
|
5563
|
+
"flex w-full flex-wrap items-stretch gap-1.5 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-secondary",
|
|
5564
|
+
indicator === "dot" && "items-center"
|
|
5565
|
+
),
|
|
5566
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
5567
|
+
itemConfig?.icon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5568
|
+
"div",
|
|
5569
|
+
{
|
|
5570
|
+
className: cn(
|
|
5571
|
+
"shrink-0 border-(--color-border) bg-(--color-bg)",
|
|
5572
|
+
{
|
|
5573
|
+
"h-3.5 w-3.5 rounded-[4px]": indicator === "dot",
|
|
5574
|
+
"w-1 rounded-full": indicator === "line",
|
|
5575
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
5576
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
5577
|
+
}
|
|
5578
|
+
),
|
|
5579
|
+
style: {
|
|
5580
|
+
"--color-bg": indicatorColor,
|
|
5581
|
+
"--color-border": indicatorColor
|
|
5582
|
+
}
|
|
5583
|
+
}
|
|
5584
|
+
),
|
|
5585
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5586
|
+
"div",
|
|
5587
|
+
{
|
|
5588
|
+
className: cn(
|
|
5589
|
+
"flex flex-1 justify-between leading-none",
|
|
5590
|
+
nestLabel ? "items-end" : "items-center"
|
|
5591
|
+
),
|
|
5592
|
+
children: [
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "grid gap-1.5", children: [
|
|
5594
|
+
nestLabel ? tooltipLabel : null,
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-secondary", children: itemConfig?.label ?? item.name })
|
|
5596
|
+
] }),
|
|
5597
|
+
item.value != null && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ml-3 font-semibold text-default tabular-nums", children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value) })
|
|
5598
|
+
]
|
|
5599
|
+
}
|
|
5600
|
+
)
|
|
5601
|
+
] })
|
|
5602
|
+
},
|
|
5603
|
+
index
|
|
5604
|
+
);
|
|
5605
|
+
}) })
|
|
5606
|
+
]
|
|
5607
|
+
}
|
|
5608
|
+
);
|
|
5609
|
+
}
|
|
5610
|
+
var ChartLegend = RechartsPrimitive.Legend;
|
|
5611
|
+
function ChartLegendContent({
|
|
5612
|
+
className,
|
|
5613
|
+
hideIcon = false,
|
|
5614
|
+
payload,
|
|
5615
|
+
verticalAlign = "bottom",
|
|
5616
|
+
nameKey
|
|
5617
|
+
}) {
|
|
5618
|
+
const { config } = useChart();
|
|
5619
|
+
if (!payload?.length) {
|
|
5620
|
+
return null;
|
|
5621
|
+
}
|
|
5622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5623
|
+
"div",
|
|
5624
|
+
{
|
|
5625
|
+
className: cn(
|
|
5626
|
+
"flex items-center justify-center gap-4",
|
|
5627
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
5628
|
+
className
|
|
5629
|
+
),
|
|
5630
|
+
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
5631
|
+
const key = `${nameKey ?? item.dataKey ?? "value"}`;
|
|
5632
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
5633
|
+
const indicatorColor = item.color ?? (itemConfig && "color" in itemConfig ? itemConfig.color : void 0);
|
|
5634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5635
|
+
"div",
|
|
5636
|
+
{
|
|
5637
|
+
className: cn(
|
|
5638
|
+
"flex items-center gap-1.5 text-secondary [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-secondary"
|
|
5639
|
+
),
|
|
5640
|
+
children: [
|
|
5641
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5642
|
+
"div",
|
|
5643
|
+
{
|
|
5644
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
5645
|
+
style: {
|
|
5646
|
+
backgroundColor: indicatorColor
|
|
5647
|
+
}
|
|
5648
|
+
}
|
|
5649
|
+
),
|
|
5650
|
+
itemConfig?.label
|
|
5651
|
+
]
|
|
5652
|
+
},
|
|
5653
|
+
index
|
|
5654
|
+
);
|
|
5655
|
+
})
|
|
5656
|
+
}
|
|
5657
|
+
);
|
|
5658
|
+
}
|
|
5659
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
5660
|
+
if (typeof payload !== "object" || payload === null) {
|
|
5661
|
+
return void 0;
|
|
5662
|
+
}
|
|
5663
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
5664
|
+
let configLabelKey = key;
|
|
5665
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
5666
|
+
configLabelKey = payload[key];
|
|
5667
|
+
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
5668
|
+
configLabelKey = payloadPayload[key];
|
|
5669
|
+
}
|
|
5670
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
5671
|
+
}
|
|
5672
|
+
|
|
5673
|
+
// src/components/ui/carousel.tsx
|
|
5674
|
+
var React15 = __toESM(require("react"));
|
|
5675
|
+
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
5676
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5677
|
+
var CarouselContext = React15.createContext(null);
|
|
5678
|
+
function useCarousel() {
|
|
5679
|
+
const context = React15.useContext(CarouselContext);
|
|
5680
|
+
if (!context) {
|
|
5681
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
5682
|
+
}
|
|
5683
|
+
return context;
|
|
5684
|
+
}
|
|
5685
|
+
function Carousel({
|
|
5686
|
+
opts,
|
|
5687
|
+
plugins,
|
|
5688
|
+
setApi,
|
|
5689
|
+
className,
|
|
5690
|
+
children,
|
|
5691
|
+
ref,
|
|
5692
|
+
...props
|
|
5693
|
+
}) {
|
|
5694
|
+
const [carouselRef, api] = (0, import_embla_carousel_react.default)({ ...opts }, plugins);
|
|
5695
|
+
const [canScrollPrev, setCanScrollPrev] = React15.useState(false);
|
|
5696
|
+
const [canScrollNext, setCanScrollNext] = React15.useState(false);
|
|
5697
|
+
const onSelect = React15.useCallback((emblaApi) => {
|
|
5698
|
+
if (!emblaApi) return;
|
|
5699
|
+
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
5700
|
+
setCanScrollNext(emblaApi.canScrollNext());
|
|
5701
|
+
}, []);
|
|
5702
|
+
const scrollPrev = React15.useCallback(() => {
|
|
5703
|
+
api?.scrollPrev();
|
|
5704
|
+
}, [api]);
|
|
5705
|
+
const scrollNext = React15.useCallback(() => {
|
|
5706
|
+
api?.scrollNext();
|
|
5707
|
+
}, [api]);
|
|
5708
|
+
const handleKeyDown = React15.useCallback(
|
|
5709
|
+
(event) => {
|
|
5710
|
+
if (event.key === "ArrowLeft") {
|
|
5711
|
+
event.preventDefault();
|
|
5712
|
+
scrollPrev();
|
|
5713
|
+
} else if (event.key === "ArrowRight") {
|
|
5714
|
+
event.preventDefault();
|
|
5715
|
+
scrollNext();
|
|
5716
|
+
}
|
|
5717
|
+
},
|
|
5718
|
+
[scrollPrev, scrollNext]
|
|
5719
|
+
);
|
|
5720
|
+
React15.useEffect(() => {
|
|
5721
|
+
if (!api || !setApi) return;
|
|
5722
|
+
setApi(api);
|
|
5723
|
+
}, [api, setApi]);
|
|
5724
|
+
React15.useEffect(() => {
|
|
5725
|
+
if (!api) return;
|
|
5726
|
+
onSelect(api);
|
|
5727
|
+
api.on("reInit", onSelect);
|
|
5728
|
+
api.on("select", onSelect);
|
|
5729
|
+
return () => {
|
|
5730
|
+
api.off("reInit", onSelect);
|
|
5731
|
+
api.off("select", onSelect);
|
|
5732
|
+
};
|
|
5733
|
+
}, [api, onSelect]);
|
|
5734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5735
|
+
CarouselContext.Provider,
|
|
5736
|
+
{
|
|
5737
|
+
value: {
|
|
5738
|
+
carouselRef,
|
|
5739
|
+
api,
|
|
5740
|
+
scrollPrev,
|
|
5741
|
+
scrollNext,
|
|
5742
|
+
canScrollPrev,
|
|
5743
|
+
canScrollNext
|
|
5744
|
+
},
|
|
5745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5746
|
+
"div",
|
|
5747
|
+
{
|
|
5748
|
+
...props,
|
|
5749
|
+
ref,
|
|
5750
|
+
className: cn("flex items-center gap-4", className),
|
|
5751
|
+
role: "region",
|
|
5752
|
+
"aria-roledescription": "carousel",
|
|
5753
|
+
"data-slot": "carousel",
|
|
5754
|
+
tabIndex: 0,
|
|
5755
|
+
onKeyDownCapture: (event) => {
|
|
5756
|
+
props.onKeyDownCapture?.(event);
|
|
5757
|
+
handleKeyDown(event);
|
|
5758
|
+
},
|
|
5759
|
+
children
|
|
5760
|
+
}
|
|
5761
|
+
)
|
|
5762
|
+
}
|
|
5763
|
+
);
|
|
5764
|
+
}
|
|
5765
|
+
function CarouselContent({ className, ref, ...props }) {
|
|
5766
|
+
const { carouselRef } = useCarousel();
|
|
5767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5768
|
+
"div",
|
|
5769
|
+
{
|
|
5770
|
+
ref: carouselRef,
|
|
5771
|
+
className: "overflow-hidden flex-1 min-w-0",
|
|
5772
|
+
"data-slot": "carousel-viewport",
|
|
5773
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5774
|
+
"div",
|
|
5775
|
+
{
|
|
5776
|
+
ref,
|
|
5777
|
+
"data-slot": "carousel-content",
|
|
5778
|
+
className: cn("flex -ml-4", className),
|
|
5779
|
+
...props
|
|
5780
|
+
}
|
|
5781
|
+
)
|
|
5782
|
+
}
|
|
5783
|
+
);
|
|
5784
|
+
}
|
|
5785
|
+
function CarouselItem({
|
|
5786
|
+
className,
|
|
5787
|
+
index,
|
|
5788
|
+
total,
|
|
5789
|
+
"aria-label": ariaLabel,
|
|
5790
|
+
ref,
|
|
5791
|
+
...props
|
|
5792
|
+
}) {
|
|
5793
|
+
const label = ariaLabel ?? (index !== void 0 && total !== void 0 ? `Slide ${index + 1} of ${total}` : void 0);
|
|
5794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5795
|
+
"div",
|
|
5796
|
+
{
|
|
5797
|
+
ref,
|
|
5798
|
+
role: "group",
|
|
5799
|
+
"aria-roledescription": "slide",
|
|
5800
|
+
"aria-label": label,
|
|
5801
|
+
"data-slot": "carousel-item",
|
|
5802
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full pl-4", className),
|
|
5803
|
+
...props
|
|
5804
|
+
}
|
|
5805
|
+
);
|
|
5806
|
+
}
|
|
5807
|
+
function CarouselPrevious({
|
|
5808
|
+
className,
|
|
5809
|
+
variant = "default",
|
|
5810
|
+
size = "default",
|
|
5811
|
+
ref,
|
|
5812
|
+
...props
|
|
5813
|
+
}) {
|
|
5814
|
+
const { scrollPrev, canScrollPrev } = useCarousel();
|
|
5815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5816
|
+
Button,
|
|
5817
|
+
{
|
|
5818
|
+
ref,
|
|
5819
|
+
"data-slot": "carousel-previous",
|
|
5820
|
+
variant,
|
|
5821
|
+
size,
|
|
5822
|
+
className: cn("size-9 shrink-0 rounded-md", className),
|
|
5823
|
+
disabled: !canScrollPrev,
|
|
5824
|
+
onClick: scrollPrev,
|
|
5825
|
+
"aria-label": "Previous slide",
|
|
5826
|
+
...props,
|
|
5827
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ArrowLeftIcon, { className: "size-4" })
|
|
5828
|
+
}
|
|
5829
|
+
);
|
|
5830
|
+
}
|
|
5831
|
+
function CarouselNext({
|
|
5832
|
+
className,
|
|
5833
|
+
variant = "default",
|
|
5834
|
+
size = "default",
|
|
5835
|
+
ref,
|
|
5836
|
+
...props
|
|
5837
|
+
}) {
|
|
5838
|
+
const { scrollNext, canScrollNext } = useCarousel();
|
|
5839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5840
|
+
Button,
|
|
5841
|
+
{
|
|
5842
|
+
ref,
|
|
5843
|
+
"data-slot": "carousel-next",
|
|
5844
|
+
variant,
|
|
5845
|
+
size,
|
|
5846
|
+
className: cn("size-9 shrink-0 rounded-md", className),
|
|
5847
|
+
disabled: !canScrollNext,
|
|
5848
|
+
onClick: scrollNext,
|
|
5849
|
+
"aria-label": "Next slide",
|
|
5850
|
+
...props,
|
|
5851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ArrowRightIcon, { className: "size-4" })
|
|
5852
|
+
}
|
|
5853
|
+
);
|
|
5854
|
+
}
|
|
5855
|
+
|
|
4329
5856
|
// src/components/ui/table.tsx
|
|
4330
|
-
var
|
|
5857
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4331
5858
|
function Table({ className, ref, ...props }) {
|
|
4332
|
-
return /* @__PURE__ */ (0,
|
|
5859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4333
5860
|
"div",
|
|
4334
5861
|
{
|
|
4335
5862
|
"data-slot": "table-container",
|
|
4336
5863
|
className: "relative w-full overflow-x-auto",
|
|
4337
|
-
children: /* @__PURE__ */ (0,
|
|
5864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4338
5865
|
"table",
|
|
4339
5866
|
{
|
|
4340
5867
|
ref,
|
|
@@ -4355,7 +5882,7 @@ function TableHeader({
|
|
|
4355
5882
|
ref,
|
|
4356
5883
|
...props
|
|
4357
5884
|
}) {
|
|
4358
|
-
return /* @__PURE__ */ (0,
|
|
5885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4359
5886
|
"thead",
|
|
4360
5887
|
{
|
|
4361
5888
|
ref,
|
|
@@ -4376,14 +5903,14 @@ function TableBody({
|
|
|
4376
5903
|
ref,
|
|
4377
5904
|
...props
|
|
4378
5905
|
}) {
|
|
4379
|
-
return /* @__PURE__ */ (0,
|
|
5906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("tbody", { ref, "data-slot": "table-body", className, ...props });
|
|
4380
5907
|
}
|
|
4381
5908
|
function TableFooter({
|
|
4382
5909
|
className,
|
|
4383
5910
|
ref,
|
|
4384
5911
|
...props
|
|
4385
5912
|
}) {
|
|
4386
|
-
return /* @__PURE__ */ (0,
|
|
5913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4387
5914
|
"tfoot",
|
|
4388
5915
|
{
|
|
4389
5916
|
ref,
|
|
@@ -4402,7 +5929,7 @@ function TableFooter({
|
|
|
4402
5929
|
);
|
|
4403
5930
|
}
|
|
4404
5931
|
function TableRow({ className, ref, ...props }) {
|
|
4405
|
-
return /* @__PURE__ */ (0,
|
|
5932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4406
5933
|
"tr",
|
|
4407
5934
|
{
|
|
4408
5935
|
ref,
|
|
@@ -4426,7 +5953,7 @@ function TableHead({
|
|
|
4426
5953
|
align = "left",
|
|
4427
5954
|
...props
|
|
4428
5955
|
}) {
|
|
4429
|
-
return /* @__PURE__ */ (0,
|
|
5956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4430
5957
|
"th",
|
|
4431
5958
|
{
|
|
4432
5959
|
ref,
|
|
@@ -4454,7 +5981,7 @@ function TableCell({
|
|
|
4454
5981
|
align = "left",
|
|
4455
5982
|
...props
|
|
4456
5983
|
}) {
|
|
4457
|
-
return /* @__PURE__ */ (0,
|
|
5984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4458
5985
|
"td",
|
|
4459
5986
|
{
|
|
4460
5987
|
ref,
|
|
@@ -4480,7 +6007,7 @@ function TableCaption({
|
|
|
4480
6007
|
ref,
|
|
4481
6008
|
...props
|
|
4482
6009
|
}) {
|
|
4483
|
-
return /* @__PURE__ */ (0,
|
|
6010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4484
6011
|
"caption",
|
|
4485
6012
|
{
|
|
4486
6013
|
ref,
|
|
@@ -4497,9 +6024,13 @@ function TableCaption({
|
|
|
4497
6024
|
);
|
|
4498
6025
|
}
|
|
4499
6026
|
|
|
6027
|
+
// src/components/ui/data-table/data-table.tsx
|
|
6028
|
+
var React16 = __toESM(require("react"));
|
|
6029
|
+
var import_react_table2 = require("@tanstack/react-table");
|
|
6030
|
+
|
|
4500
6031
|
// src/components/ui/data-table/data-table-view.tsx
|
|
4501
6032
|
var import_react_table = require("@tanstack/react-table");
|
|
4502
|
-
var
|
|
6033
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4503
6034
|
function DataTableView({
|
|
4504
6035
|
table,
|
|
4505
6036
|
emptyState = "No results.",
|
|
@@ -4508,15 +6039,15 @@ function DataTableView({
|
|
|
4508
6039
|
className,
|
|
4509
6040
|
...props
|
|
4510
6041
|
}) {
|
|
4511
|
-
return /* @__PURE__ */ (0,
|
|
6042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4512
6043
|
"div",
|
|
4513
6044
|
{
|
|
4514
6045
|
className: cn("relative", loading && "opacity-50 pointer-events-none"),
|
|
4515
6046
|
"aria-busy": loading || void 0,
|
|
4516
|
-
children: /* @__PURE__ */ (0,
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
6047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Table, { className, ...props, children: [
|
|
6048
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
|
|
4518
6049
|
const sorted = header.column.getIsSorted();
|
|
4519
|
-
return /* @__PURE__ */ (0,
|
|
6050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4520
6051
|
TableHead,
|
|
4521
6052
|
{
|
|
4522
6053
|
colSpan: header.colSpan,
|
|
@@ -4529,21 +6060,21 @@ function DataTableView({
|
|
|
4529
6060
|
header.id
|
|
4530
6061
|
);
|
|
4531
6062
|
}) }, headerGroup.id)) }),
|
|
4532
|
-
/* @__PURE__ */ (0,
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBody, { children: table.getRowModel().rows.length > 0 ? table.getRowModel().rows.map((row) => {
|
|
4533
6064
|
const rowProps = getRowProps?.(row);
|
|
4534
|
-
return /* @__PURE__ */ (0,
|
|
6065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4535
6066
|
TableRow,
|
|
4536
6067
|
{
|
|
4537
6068
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
4538
6069
|
...rowProps,
|
|
4539
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
6070
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableCell, { children: (0, import_react_table.flexRender)(
|
|
4540
6071
|
cell.column.columnDef.cell,
|
|
4541
6072
|
cell.getContext()
|
|
4542
6073
|
) }, cell.id))
|
|
4543
6074
|
},
|
|
4544
6075
|
row.id
|
|
4545
6076
|
);
|
|
4546
|
-
}) : /* @__PURE__ */ (0,
|
|
6077
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4547
6078
|
TableCell,
|
|
4548
6079
|
{
|
|
4549
6080
|
colSpan: table.getVisibleLeafColumns().length,
|
|
@@ -4557,7 +6088,7 @@ function DataTableView({
|
|
|
4557
6088
|
}
|
|
4558
6089
|
|
|
4559
6090
|
// src/components/ui/data-table/data-table-pagination.tsx
|
|
4560
|
-
var
|
|
6091
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4561
6092
|
function DataTablePagination({
|
|
4562
6093
|
table,
|
|
4563
6094
|
pageSizeOptions = [10, 20, 50, 100],
|
|
@@ -4569,7 +6100,7 @@ function DataTablePagination({
|
|
|
4569
6100
|
const from = totalRows > 0 ? pageIndex * pageSize + 1 : 0;
|
|
4570
6101
|
const to = Math.min((pageIndex + 1) * pageSize, totalRows);
|
|
4571
6102
|
const resolvedPageSizeOptions = pageSizeOptions.includes(pageSize) ? pageSizeOptions : [...pageSizeOptions, pageSize].sort((a, b) => a - b);
|
|
4572
|
-
return /* @__PURE__ */ (0,
|
|
6103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4573
6104
|
"div",
|
|
4574
6105
|
{
|
|
4575
6106
|
className: cn(
|
|
@@ -4578,7 +6109,7 @@ function DataTablePagination({
|
|
|
4578
6109
|
),
|
|
4579
6110
|
...props,
|
|
4580
6111
|
children: [
|
|
4581
|
-
/* @__PURE__ */ (0,
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4582
6113
|
Text,
|
|
4583
6114
|
{
|
|
4584
6115
|
variant: "body-sm",
|
|
@@ -4587,8 +6118,8 @@ function DataTablePagination({
|
|
|
4587
6118
|
children: totalRows > 0 ? `Showing ${from}\u2013${to} of ${totalRows}` : "No results"
|
|
4588
6119
|
}
|
|
4589
6120
|
),
|
|
4590
|
-
/* @__PURE__ */ (0,
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
6121
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6122
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4592
6123
|
Button,
|
|
4593
6124
|
{
|
|
4594
6125
|
variant: "ghost",
|
|
@@ -4596,10 +6127,10 @@ function DataTablePagination({
|
|
|
4596
6127
|
onClick: () => table.firstPage(),
|
|
4597
6128
|
disabled: !table.getCanPreviousPage(),
|
|
4598
6129
|
"aria-label": "Go to first page",
|
|
4599
|
-
children: /* @__PURE__ */ (0,
|
|
6130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ArrowLeftIcon, { "aria-hidden": "true" })
|
|
4600
6131
|
}
|
|
4601
6132
|
),
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
6133
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4603
6134
|
Button,
|
|
4604
6135
|
{
|
|
4605
6136
|
variant: "ghost",
|
|
@@ -4607,11 +6138,11 @@ function DataTablePagination({
|
|
|
4607
6138
|
onClick: () => table.previousPage(),
|
|
4608
6139
|
disabled: !table.getCanPreviousPage(),
|
|
4609
6140
|
"aria-label": "Go to previous page",
|
|
4610
|
-
children: /* @__PURE__ */ (0,
|
|
6141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CaretLeftIcon, { "aria-hidden": "true" })
|
|
4611
6142
|
}
|
|
4612
6143
|
),
|
|
4613
|
-
/* @__PURE__ */ (0,
|
|
4614
|
-
/* @__PURE__ */ (0,
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Text, { as: "span", variant: "body-sm", className: "px-2 whitespace-nowrap", children: table.getPageCount() > 0 ? `Page ${pageIndex + 1} of ${table.getPageCount()}` : "No pages" }),
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4615
6146
|
Button,
|
|
4616
6147
|
{
|
|
4617
6148
|
variant: "ghost",
|
|
@@ -4619,10 +6150,10 @@ function DataTablePagination({
|
|
|
4619
6150
|
onClick: () => table.nextPage(),
|
|
4620
6151
|
disabled: !table.getCanNextPage(),
|
|
4621
6152
|
"aria-label": "Go to next page",
|
|
4622
|
-
children: /* @__PURE__ */ (0,
|
|
6153
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CaretRightIcon, { "aria-hidden": "true" })
|
|
4623
6154
|
}
|
|
4624
6155
|
),
|
|
4625
|
-
/* @__PURE__ */ (0,
|
|
6156
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4626
6157
|
Button,
|
|
4627
6158
|
{
|
|
4628
6159
|
variant: "ghost",
|
|
@@ -4630,12 +6161,12 @@ function DataTablePagination({
|
|
|
4630
6161
|
onClick: () => table.lastPage(),
|
|
4631
6162
|
disabled: !table.getCanNextPage(),
|
|
4632
6163
|
"aria-label": "Go to last page",
|
|
4633
|
-
children: /* @__PURE__ */ (0,
|
|
6164
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ArrowRightIcon, { "aria-hidden": "true" })
|
|
4634
6165
|
}
|
|
4635
6166
|
)
|
|
4636
6167
|
] }),
|
|
4637
|
-
/* @__PURE__ */ (0,
|
|
4638
|
-
/* @__PURE__ */ (0,
|
|
6168
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6169
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4639
6170
|
Text,
|
|
4640
6171
|
{
|
|
4641
6172
|
as: "span",
|
|
@@ -4644,14 +6175,14 @@ function DataTablePagination({
|
|
|
4644
6175
|
children: "Rows per page"
|
|
4645
6176
|
}
|
|
4646
6177
|
),
|
|
4647
|
-
/* @__PURE__ */ (0,
|
|
6178
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4648
6179
|
Select,
|
|
4649
6180
|
{
|
|
4650
6181
|
value: pageSize.toString(),
|
|
4651
6182
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
4652
6183
|
children: [
|
|
4653
|
-
/* @__PURE__ */ (0,
|
|
4654
|
-
/* @__PURE__ */ (0,
|
|
6184
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SelectValue, {}) }),
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SelectContent, { children: resolvedPageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4655
6186
|
]
|
|
4656
6187
|
}
|
|
4657
6188
|
)
|
|
@@ -4662,7 +6193,7 @@ function DataTablePagination({
|
|
|
4662
6193
|
}
|
|
4663
6194
|
|
|
4664
6195
|
// src/components/ui/data-table/data-table-column-header.tsx
|
|
4665
|
-
var
|
|
6196
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4666
6197
|
function DataTableColumnHeader({
|
|
4667
6198
|
column,
|
|
4668
6199
|
title,
|
|
@@ -4670,7 +6201,7 @@ function DataTableColumnHeader({
|
|
|
4670
6201
|
...props
|
|
4671
6202
|
}) {
|
|
4672
6203
|
if (!column.getCanSort()) {
|
|
4673
|
-
return /* @__PURE__ */ (0,
|
|
6204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4674
6205
|
Text,
|
|
4675
6206
|
{
|
|
4676
6207
|
as: "div",
|
|
@@ -4682,9 +6213,9 @@ function DataTableColumnHeader({
|
|
|
4682
6213
|
);
|
|
4683
6214
|
}
|
|
4684
6215
|
const sorted = column.getIsSorted();
|
|
4685
|
-
return /* @__PURE__ */ (0,
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4687
|
-
/* @__PURE__ */ (0,
|
|
6216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("flex items-center gap-2", className), ...props, children: [
|
|
6217
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { as: "span", variant: "body-sm-medium", children: title }),
|
|
6218
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4688
6219
|
Button,
|
|
4689
6220
|
{
|
|
4690
6221
|
variant: "ghost",
|
|
@@ -4696,38 +6227,134 @@ function DataTableColumnHeader({
|
|
|
4696
6227
|
},
|
|
4697
6228
|
"aria-label": `Sort by ${title}`,
|
|
4698
6229
|
className: "text-secondary",
|
|
4699
|
-
children: sorted === "desc" ? /* @__PURE__ */ (0,
|
|
6230
|
+
children: sorted === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CaretDownIcon, { "aria-hidden": "true" }) : sorted === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CaretUpIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ArrowsDownUpIcon, { "aria-hidden": "true", size: 16 })
|
|
4700
6231
|
}
|
|
4701
6232
|
)
|
|
4702
6233
|
] });
|
|
4703
6234
|
}
|
|
4704
6235
|
|
|
6236
|
+
// src/components/ui/data-table/data-table.tsx
|
|
6237
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6238
|
+
function createSelectColumn() {
|
|
6239
|
+
return {
|
|
6240
|
+
id: "select",
|
|
6241
|
+
header: ({ table }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6242
|
+
Checkbox,
|
|
6243
|
+
{
|
|
6244
|
+
checked: table.getIsAllPageRowsSelected(),
|
|
6245
|
+
indeterminate: table.getIsSomePageRowsSelected() && !table.getIsAllPageRowsSelected(),
|
|
6246
|
+
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(!!checked),
|
|
6247
|
+
"aria-label": "Select all"
|
|
6248
|
+
}
|
|
6249
|
+
) }),
|
|
6250
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6251
|
+
Checkbox,
|
|
6252
|
+
{
|
|
6253
|
+
checked: row.getIsSelected(),
|
|
6254
|
+
onCheckedChange: (checked) => row.toggleSelected(!!checked),
|
|
6255
|
+
"aria-label": "Select row"
|
|
6256
|
+
}
|
|
6257
|
+
) }),
|
|
6258
|
+
enableSorting: false,
|
|
6259
|
+
enableHiding: false
|
|
6260
|
+
};
|
|
6261
|
+
}
|
|
6262
|
+
function DataTable({
|
|
6263
|
+
columns,
|
|
6264
|
+
data,
|
|
6265
|
+
getRowId,
|
|
6266
|
+
showPagination = true,
|
|
6267
|
+
pageSizeOptions,
|
|
6268
|
+
initialPageSize = 10,
|
|
6269
|
+
enableRowSelection = false,
|
|
6270
|
+
onRowSelectionChange: onRowSelectionChangeProp,
|
|
6271
|
+
enableSorting = true,
|
|
6272
|
+
emptyState,
|
|
6273
|
+
loading,
|
|
6274
|
+
...tableProps
|
|
6275
|
+
}) {
|
|
6276
|
+
const [sorting, setSorting] = React16.useState([]);
|
|
6277
|
+
const [rowSelection, setRowSelection] = React16.useState({});
|
|
6278
|
+
const handleRowSelectionChange = React16.useCallback(
|
|
6279
|
+
(updaterOrValue) => {
|
|
6280
|
+
const next = typeof updaterOrValue === "function" ? updaterOrValue(rowSelection) : updaterOrValue;
|
|
6281
|
+
setRowSelection(next);
|
|
6282
|
+
onRowSelectionChangeProp?.(next);
|
|
6283
|
+
},
|
|
6284
|
+
[rowSelection, onRowSelectionChangeProp]
|
|
6285
|
+
);
|
|
6286
|
+
const allColumns = React16.useMemo(
|
|
6287
|
+
() => enableRowSelection ? [createSelectColumn(), ...columns] : columns,
|
|
6288
|
+
[columns, enableRowSelection]
|
|
6289
|
+
);
|
|
6290
|
+
const resolvedColumns = React16.useMemo(
|
|
6291
|
+
() => enableSorting ? allColumns.map((col) => {
|
|
6292
|
+
if (col.id === "select" || col.id === "actions") return col;
|
|
6293
|
+
if (typeof col.header === "string") {
|
|
6294
|
+
const title = col.header;
|
|
6295
|
+
return {
|
|
6296
|
+
...col,
|
|
6297
|
+
header: ({ column }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DataTableColumnHeader, { column, title })
|
|
6298
|
+
};
|
|
6299
|
+
}
|
|
6300
|
+
return col;
|
|
6301
|
+
}) : allColumns,
|
|
6302
|
+
[allColumns, enableSorting]
|
|
6303
|
+
);
|
|
6304
|
+
const table = (0, import_react_table2.useReactTable)({
|
|
6305
|
+
data,
|
|
6306
|
+
columns: resolvedColumns,
|
|
6307
|
+
state: { sorting, rowSelection },
|
|
6308
|
+
onSortingChange: setSorting,
|
|
6309
|
+
onRowSelectionChange: enableRowSelection ? handleRowSelectionChange : void 0,
|
|
6310
|
+
getCoreRowModel: (0, import_react_table2.getCoreRowModel)(),
|
|
6311
|
+
getSortedRowModel: enableSorting ? (0, import_react_table2.getSortedRowModel)() : void 0,
|
|
6312
|
+
getPaginationRowModel: showPagination ? (0, import_react_table2.getPaginationRowModel)() : void 0,
|
|
6313
|
+
getRowId,
|
|
6314
|
+
...showPagination && {
|
|
6315
|
+
initialState: { pagination: { pageSize: initialPageSize } }
|
|
6316
|
+
}
|
|
6317
|
+
});
|
|
6318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
|
|
6319
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6320
|
+
DataTableView,
|
|
6321
|
+
{
|
|
6322
|
+
table,
|
|
6323
|
+
emptyState,
|
|
6324
|
+
loading,
|
|
6325
|
+
...tableProps
|
|
6326
|
+
}
|
|
6327
|
+
),
|
|
6328
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DataTablePagination, { table, pageSizeOptions })
|
|
6329
|
+
] });
|
|
6330
|
+
}
|
|
6331
|
+
|
|
4705
6332
|
// src/components/ui/data-table/data-table-view-options.tsx
|
|
4706
|
-
var
|
|
6333
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4707
6334
|
function DataTableViewOptions({
|
|
4708
6335
|
table,
|
|
4709
6336
|
...props
|
|
4710
6337
|
}) {
|
|
4711
|
-
return /* @__PURE__ */ (0,
|
|
4712
|
-
/* @__PURE__ */ (0,
|
|
6338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(DropdownMenu, { children: [
|
|
6339
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4713
6340
|
DropdownMenuTrigger,
|
|
4714
6341
|
{
|
|
4715
|
-
render: /* @__PURE__ */ (0,
|
|
6342
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4716
6343
|
Button,
|
|
4717
6344
|
{
|
|
4718
6345
|
variant: "ghost",
|
|
4719
6346
|
size: "sm",
|
|
4720
6347
|
...props,
|
|
4721
6348
|
"aria-label": "Table options",
|
|
4722
|
-
children: /* @__PURE__ */ (0,
|
|
6349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CogIcon, { "aria-hidden": "true" })
|
|
4723
6350
|
}
|
|
4724
6351
|
)
|
|
4725
6352
|
}
|
|
4726
6353
|
),
|
|
4727
|
-
/* @__PURE__ */ (0,
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4730
|
-
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => /* @__PURE__ */ (0,
|
|
6354
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
6355
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
6356
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DropdownMenuSeparator, {}),
|
|
6357
|
+
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4731
6358
|
DropdownMenuCheckboxItem,
|
|
4732
6359
|
{
|
|
4733
6360
|
checked: column.getIsVisible(),
|
|
@@ -4797,6 +6424,16 @@ function DataTableViewOptions({
|
|
|
4797
6424
|
CaretLeftIcon,
|
|
4798
6425
|
CaretRightIcon,
|
|
4799
6426
|
CaretUpIcon,
|
|
6427
|
+
Carousel,
|
|
6428
|
+
CarouselContent,
|
|
6429
|
+
CarouselItem,
|
|
6430
|
+
CarouselNext,
|
|
6431
|
+
CarouselPrevious,
|
|
6432
|
+
ChartContainer,
|
|
6433
|
+
ChartLegend,
|
|
6434
|
+
ChartLegendContent,
|
|
6435
|
+
ChartTooltip,
|
|
6436
|
+
ChartTooltipContent,
|
|
4800
6437
|
ChatIcon,
|
|
4801
6438
|
CheckIcon,
|
|
4802
6439
|
Checkbox,
|
|
@@ -4804,7 +6441,21 @@ function DataTableViewOptions({
|
|
|
4804
6441
|
CheckmarkSquareIcon,
|
|
4805
6442
|
CloseIcon,
|
|
4806
6443
|
CogIcon,
|
|
6444
|
+
Combobox,
|
|
6445
|
+
ComboboxChip,
|
|
6446
|
+
ComboboxChips,
|
|
6447
|
+
ComboboxChipsInput,
|
|
6448
|
+
ComboboxContent,
|
|
6449
|
+
ComboboxEmpty,
|
|
6450
|
+
ComboboxGroup,
|
|
6451
|
+
ComboboxInput,
|
|
6452
|
+
ComboboxItem,
|
|
6453
|
+
ComboboxLabel,
|
|
6454
|
+
ComboboxList,
|
|
6455
|
+
ComboboxSeparator,
|
|
6456
|
+
ComboboxTrigger,
|
|
4807
6457
|
CredentialsIcon,
|
|
6458
|
+
DataTable,
|
|
4808
6459
|
DataTableColumnHeader,
|
|
4809
6460
|
DataTablePagination,
|
|
4810
6461
|
DataTableView,
|
|
@@ -4849,6 +6500,12 @@ function DataTableViewOptions({
|
|
|
4849
6500
|
DropdownMenuSubTrigger,
|
|
4850
6501
|
DropdownMenuTrigger,
|
|
4851
6502
|
EditIcon,
|
|
6503
|
+
Empty,
|
|
6504
|
+
EmptyActions,
|
|
6505
|
+
EmptyContent,
|
|
6506
|
+
EmptyDescription,
|
|
6507
|
+
EmptyMedia,
|
|
6508
|
+
EmptyTitle,
|
|
4852
6509
|
EnvelopeIcon,
|
|
4853
6510
|
ExclamationIcon,
|
|
4854
6511
|
EyeClosedIcon,
|
|
@@ -4871,6 +6528,9 @@ function DataTableViewOptions({
|
|
|
4871
6528
|
GraphPieIcon,
|
|
4872
6529
|
HamburgerMenuIcon,
|
|
4873
6530
|
HomeIcon,
|
|
6531
|
+
HoverCard,
|
|
6532
|
+
HoverCardContent,
|
|
6533
|
+
HoverCardTrigger,
|
|
4874
6534
|
InformationIcon,
|
|
4875
6535
|
Input,
|
|
4876
6536
|
InputGroup,
|
|
@@ -4907,6 +6567,9 @@ function DataTableViewOptions({
|
|
|
4907
6567
|
PopoverTrigger,
|
|
4908
6568
|
PrintIcon,
|
|
4909
6569
|
QuestionCircleIcon,
|
|
6570
|
+
RadioGroup,
|
|
6571
|
+
RadioGroupCard,
|
|
6572
|
+
RadioGroupItem,
|
|
4910
6573
|
Select,
|
|
4911
6574
|
SelectContent,
|
|
4912
6575
|
SelectGroup,
|
|
@@ -4930,6 +6593,7 @@ function DataTableViewOptions({
|
|
|
4930
6593
|
SidebarMenuButton,
|
|
4931
6594
|
SidebarMenuItem,
|
|
4932
6595
|
SidebarProvider,
|
|
6596
|
+
Slider,
|
|
4933
6597
|
StarIcon,
|
|
4934
6598
|
StatementIcon,
|
|
4935
6599
|
Switch,
|
|
@@ -4946,8 +6610,10 @@ function DataTableViewOptions({
|
|
|
4946
6610
|
TabsContent,
|
|
4947
6611
|
TabsList,
|
|
4948
6612
|
TabsTrigger,
|
|
6613
|
+
Tag,
|
|
4949
6614
|
Text,
|
|
4950
6615
|
Textarea,
|
|
6616
|
+
Toaster,
|
|
4951
6617
|
Tooltip,
|
|
4952
6618
|
TooltipContent,
|
|
4953
6619
|
TooltipProvider,
|
|
@@ -4958,6 +6624,8 @@ function DataTableViewOptions({
|
|
|
4958
6624
|
UserMultiIcon,
|
|
4959
6625
|
WarningIcon,
|
|
4960
6626
|
WrenchIcon,
|
|
6627
|
+
ZoomInIcon,
|
|
6628
|
+
ZoomOutIcon,
|
|
4961
6629
|
alertVariants,
|
|
4962
6630
|
avatarVariants,
|
|
4963
6631
|
badgeVariants,
|
|
@@ -4965,18 +6633,34 @@ function DataTableViewOptions({
|
|
|
4965
6633
|
buttonGroupVariants,
|
|
4966
6634
|
buttonVariants,
|
|
4967
6635
|
checkboxVariants,
|
|
6636
|
+
cn,
|
|
6637
|
+
comboboxChipsVariants,
|
|
6638
|
+
comboboxInputVariants,
|
|
6639
|
+
createToaster,
|
|
6640
|
+
cva,
|
|
4968
6641
|
dropdownMenuItemVariants,
|
|
6642
|
+
emptyMediaVariants,
|
|
6643
|
+
emptyVariants,
|
|
4969
6644
|
inputGroupAddonVariants,
|
|
4970
6645
|
inputGroupButtonVariants,
|
|
4971
6646
|
inputGroupVariants,
|
|
4972
6647
|
inputVariants,
|
|
4973
6648
|
itemMediaVariants,
|
|
4974
6649
|
itemVariants,
|
|
6650
|
+
radioGroupVariants,
|
|
6651
|
+
radioItemVariants,
|
|
4975
6652
|
selectTriggerVariants,
|
|
4976
6653
|
switchVariants,
|
|
4977
6654
|
tabsListVariants,
|
|
4978
6655
|
tabsTriggerVariants,
|
|
6656
|
+
tagVariants,
|
|
4979
6657
|
textVariants,
|
|
6658
|
+
toast,
|
|
6659
|
+
toastManager,
|
|
4980
6660
|
uploadVariants,
|
|
6661
|
+
useCarousel,
|
|
6662
|
+
useChart,
|
|
6663
|
+
useComboboxAnchor,
|
|
6664
|
+
useComboboxFilter,
|
|
4981
6665
|
useSidebar
|
|
4982
6666
|
});
|