@akira-io/ui 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -10
- package/dist/blocks.d.ts +162 -9
- package/dist/blocks.js +1410 -36
- package/dist/blocks.js.map +1 -1
- package/dist/button-Bj6My68b.d.ts +17 -0
- package/dist/chunk-2WIIRDHT.js +83 -0
- package/dist/chunk-2WIIRDHT.js.map +1 -0
- package/dist/{chunk-A2SIZOEA.js → chunk-4SOQAVUP.js} +125 -45
- package/dist/chunk-4SOQAVUP.js.map +1 -0
- package/dist/chunk-5AJFQ6C4.js +35 -0
- package/dist/chunk-5AJFQ6C4.js.map +1 -0
- package/dist/chunk-CFDDAFPJ.js +1243 -0
- package/dist/chunk-CFDDAFPJ.js.map +1 -0
- package/dist/chunk-FWQFB37J.js +45 -0
- package/dist/chunk-FWQFB37J.js.map +1 -0
- package/dist/chunk-IQMRJXEO.js +59 -0
- package/dist/chunk-IQMRJXEO.js.map +1 -0
- package/dist/chunk-L2H5GIF7.js +22 -0
- package/dist/chunk-L2H5GIF7.js.map +1 -0
- package/dist/chunk-ODYCBCKS.js +290 -0
- package/dist/chunk-ODYCBCKS.js.map +1 -0
- package/dist/{chunk-5MQWJVM2.js → chunk-QHZWW55M.js} +383 -326
- package/dist/chunk-QHZWW55M.js.map +1 -0
- package/dist/chunk-RPCL7VFQ.js +123 -0
- package/dist/chunk-RPCL7VFQ.js.map +1 -0
- package/dist/chunk-T2INZOCM.js +165 -0
- package/dist/chunk-T2INZOCM.js.map +1 -0
- package/dist/chunk-TGF54WAO.js +29 -0
- package/dist/chunk-TGF54WAO.js.map +1 -0
- package/dist/chunk-XZCC6MTE.js +26 -0
- package/dist/chunk-XZCC6MTE.js.map +1 -0
- package/dist/{chunk-UXL33CZ4.js → chunk-YOVY3KT6.js} +13 -11
- package/dist/chunk-YOVY3KT6.js.map +1 -0
- package/dist/code.d.ts +9 -0
- package/dist/code.js +650 -0
- package/dist/code.js.map +1 -0
- package/dist/context-YWbxMH0C.d.ts +383 -0
- package/dist/editor.d.ts +128 -0
- package/dist/editor.js +450 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.d.ts +298 -222
- package/dist/index.js +1300 -670
- package/dist/index.js.map +1 -1
- package/dist/inertia.d.ts +47 -2
- package/dist/inertia.js +138 -7
- package/dist/inertia.js.map +1 -1
- package/dist/input-Dpi7pXeR.d.ts +6 -0
- package/dist/json-viewer-BARA2RCW.d.ts +51 -0
- package/dist/{language-Bft6rBBt.d.ts → language-Dgjr9bm3.d.ts} +1 -1
- package/dist/locales/pt.d.ts +26 -4
- package/dist/locales/pt.js +127 -1
- package/dist/locales/pt.js.map +1 -1
- package/dist/password-input-DcXX7SG9.d.ts +51 -0
- package/dist/shells.d.ts +45 -7
- package/dist/shells.js +96 -60
- package/dist/shells.js.map +1 -1
- package/dist/sidebar-DqkFRUxQ.d.ts +81 -0
- package/dist/types-B-eGPoFD.d.ts +111 -0
- package/dist/types-cmBL8zOc.d.ts +51 -0
- package/package.json +170 -130
- package/theme.css +20 -0
- package/themes/nosferry.css +4 -0
- package/dist/chunk-42BJBH56.js +0 -786
- package/dist/chunk-42BJBH56.js.map +0 -1
- package/dist/chunk-5MQWJVM2.js.map +0 -1
- package/dist/chunk-A2SIZOEA.js.map +0 -1
- package/dist/chunk-POE7OYET.js +0 -96
- package/dist/chunk-POE7OYET.js.map +0 -1
- package/dist/chunk-UXL33CZ4.js.map +0 -1
- package/dist/date-range-filter-QEa8fhUM.d.ts +0 -149
- package/dist/sidebar-BDhG9SUU.d.ts +0 -88
- package/dist/types-Cno1_Ijx.d.ts +0 -40
- package/dist/types-cOieac8G.d.ts +0 -77
|
@@ -0,0 +1,1243 @@
|
|
|
1
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Label, DialogFooter } from './chunk-T2INZOCM.js';
|
|
2
|
+
import { useUiLabels } from './chunk-5AJFQ6C4.js';
|
|
3
|
+
import { Input } from './chunk-XZCC6MTE.js';
|
|
4
|
+
import { elevatedSurface, cn, panelSurface, glassControl, controlFill, focusRing, nestedSurfaceReset, fieldSurface, Button, buttonVariants, modalSurface, menuSurface } from './chunk-ODYCBCKS.js';
|
|
5
|
+
import { Minus, AlertCircle, ChevronRight, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, SearchIcon, SearchXIcon, CheckIcon, ChevronUpIcon, ArrowLeftIcon, XIcon } from 'lucide-react';
|
|
6
|
+
import * as React6 from 'react';
|
|
7
|
+
import { useId, useState, useEffect } from 'react';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
import { cva } from 'class-variance-authority';
|
|
10
|
+
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
11
|
+
import { Command as Command$1 } from 'cmdk';
|
|
12
|
+
import { Popover as Popover$1 } from 'radix-ui';
|
|
13
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
14
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
15
|
+
import { createPortal } from 'react-dom';
|
|
16
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
17
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
18
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
19
|
+
|
|
20
|
+
var confirmDialogDefaultLabels = {
|
|
21
|
+
title: "Confirm Action",
|
|
22
|
+
description: "Are you sure you want to continue? This action cannot be undone.",
|
|
23
|
+
confirmText: "Confirm",
|
|
24
|
+
cancelText: "Cancel"
|
|
25
|
+
};
|
|
26
|
+
function ConfirmDialog({
|
|
27
|
+
open,
|
|
28
|
+
onOpenChange,
|
|
29
|
+
title,
|
|
30
|
+
description,
|
|
31
|
+
confirmText,
|
|
32
|
+
cancelText,
|
|
33
|
+
variant = "destructive",
|
|
34
|
+
processing = false,
|
|
35
|
+
requiredValue,
|
|
36
|
+
requiredValueLabel = "Type {{value}} to confirm",
|
|
37
|
+
onConfirm,
|
|
38
|
+
onCancel,
|
|
39
|
+
slotName = "confirm-dialog"
|
|
40
|
+
}) {
|
|
41
|
+
const labels = useUiLabels("confirmDialog", confirmDialogDefaultLabels, {
|
|
42
|
+
title,
|
|
43
|
+
confirmText,
|
|
44
|
+
cancelText
|
|
45
|
+
});
|
|
46
|
+
const resolvedDescription = description ?? labels.description;
|
|
47
|
+
const inputId = useId();
|
|
48
|
+
const [typedValue, setTypedValue] = useState("");
|
|
49
|
+
const unlocked = requiredValue === void 0 || typedValue === requiredValue;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!open) {
|
|
52
|
+
setTypedValue("");
|
|
53
|
+
}
|
|
54
|
+
}, [open]);
|
|
55
|
+
const handleConfirm = () => {
|
|
56
|
+
if (processing || !unlocked) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
onConfirm();
|
|
60
|
+
onOpenChange(false);
|
|
61
|
+
};
|
|
62
|
+
const handleCancel = () => {
|
|
63
|
+
if (processing) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
onCancel?.();
|
|
67
|
+
onOpenChange(false);
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-md p-0", slotName, children: [
|
|
70
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "p-6 md:p-8", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: cn(
|
|
75
|
+
"size-16 rounded-3xl shadow-xl flex items-center justify-center",
|
|
76
|
+
variant === "destructive" ? "bg-destructive text-destructive-foreground shadow-destructive/20" : "bg-primary text-primary-foreground shadow-primary/20"
|
|
77
|
+
),
|
|
78
|
+
children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8" })
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: labels.title }),
|
|
82
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: resolvedDescription })
|
|
83
|
+
] }),
|
|
84
|
+
requiredValue !== void 0 && /* @__PURE__ */ jsxs(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "confirm-dialog-gate",
|
|
88
|
+
className: "gap-2 px-6 md:px-8 flex flex-col",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: inputId, children: requiredValueLabel.replace(
|
|
91
|
+
"{{value}}",
|
|
92
|
+
requiredValue
|
|
93
|
+
) }),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
Input,
|
|
96
|
+
{
|
|
97
|
+
id: inputId,
|
|
98
|
+
value: typedValue,
|
|
99
|
+
autoComplete: "off",
|
|
100
|
+
disabled: processing,
|
|
101
|
+
onChange: (event) => setTypedValue(event.target.value)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ jsx(DialogFooter, { className: "p-6 md:p-8", children: /* @__PURE__ */ jsxs("div", { className: "gap-4 sm:grid-cols-2 grid w-full", children: [
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
Button,
|
|
110
|
+
{
|
|
111
|
+
type: "button",
|
|
112
|
+
variant: "ghost",
|
|
113
|
+
disabled: processing,
|
|
114
|
+
onClick: handleCancel,
|
|
115
|
+
className: "text-muted-foreground",
|
|
116
|
+
children: labels.cancelText
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ jsxs(
|
|
120
|
+
Button,
|
|
121
|
+
{
|
|
122
|
+
variant,
|
|
123
|
+
disabled: processing || !unlocked,
|
|
124
|
+
onClick: handleConfirm,
|
|
125
|
+
children: [
|
|
126
|
+
labels.confirmText,
|
|
127
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-2 h-5 w-5" })
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] }) })
|
|
132
|
+
] }) });
|
|
133
|
+
}
|
|
134
|
+
var alertVariants = cva(
|
|
135
|
+
`${elevatedSurface} relative w-full px-5 py-4 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,
|
|
136
|
+
{
|
|
137
|
+
variants: {
|
|
138
|
+
variant: {
|
|
139
|
+
default: "bg-card/60 text-card-foreground",
|
|
140
|
+
destructive: "border-destructive/30 bg-destructive/10 text-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/80"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
defaultVariants: {
|
|
144
|
+
variant: "default"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
function Alert({
|
|
149
|
+
className,
|
|
150
|
+
variant,
|
|
151
|
+
slotName = "alert",
|
|
152
|
+
...props
|
|
153
|
+
}) {
|
|
154
|
+
return /* @__PURE__ */ jsx(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
role: "alert",
|
|
158
|
+
className: cn(alertVariants({ variant }), className),
|
|
159
|
+
...props,
|
|
160
|
+
"data-slot": slotName
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function AlertTitle({
|
|
165
|
+
className,
|
|
166
|
+
slotName = "alert-title",
|
|
167
|
+
...props
|
|
168
|
+
}) {
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
className: cn(
|
|
173
|
+
"min-h-4 font-medium tracking-tight col-start-2 line-clamp-1",
|
|
174
|
+
className
|
|
175
|
+
),
|
|
176
|
+
...props,
|
|
177
|
+
"data-slot": slotName
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
function AlertDescription({
|
|
182
|
+
className,
|
|
183
|
+
slotName = "alert-description",
|
|
184
|
+
...props
|
|
185
|
+
}) {
|
|
186
|
+
return /* @__PURE__ */ jsx(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
className: cn(
|
|
190
|
+
"gap-1 text-sm [&_p]:leading-relaxed col-start-2 grid justify-items-start text-muted-foreground",
|
|
191
|
+
className
|
|
192
|
+
),
|
|
193
|
+
...props,
|
|
194
|
+
"data-slot": slotName
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function Calendar({
|
|
199
|
+
className,
|
|
200
|
+
classNames,
|
|
201
|
+
showOutsideDays = true,
|
|
202
|
+
captionLayout = "label",
|
|
203
|
+
buttonVariant = "ghost",
|
|
204
|
+
formatters,
|
|
205
|
+
components,
|
|
206
|
+
slotName = "calendar",
|
|
207
|
+
...props
|
|
208
|
+
}) {
|
|
209
|
+
const defaultClassNames = getDefaultClassNames();
|
|
210
|
+
return /* @__PURE__ */ jsx(
|
|
211
|
+
DayPicker,
|
|
212
|
+
{
|
|
213
|
+
showOutsideDays,
|
|
214
|
+
className: cn(
|
|
215
|
+
elevatedSurface,
|
|
216
|
+
nestedSurfaceReset,
|
|
217
|
+
"group/calendar p-4 [--cell-size:--spacing(8)] bg-card",
|
|
218
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
219
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
220
|
+
className
|
|
221
|
+
),
|
|
222
|
+
captionLayout,
|
|
223
|
+
formatters: {
|
|
224
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
225
|
+
...formatters
|
|
226
|
+
},
|
|
227
|
+
classNames: {
|
|
228
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
229
|
+
months: cn(
|
|
230
|
+
"gap-4 md:flex-row relative flex flex-col",
|
|
231
|
+
defaultClassNames.months
|
|
232
|
+
),
|
|
233
|
+
month: cn(
|
|
234
|
+
"gap-4 flex w-full flex-col",
|
|
235
|
+
defaultClassNames.month
|
|
236
|
+
),
|
|
237
|
+
nav: cn(
|
|
238
|
+
"inset-x-0 top-0 gap-1 absolute flex w-full items-center justify-between",
|
|
239
|
+
defaultClassNames.nav
|
|
240
|
+
),
|
|
241
|
+
button_previous: cn(
|
|
242
|
+
buttonVariants({ variant: buttonVariant }),
|
|
243
|
+
"p-0 size-(--cell-size) select-none aria-disabled:opacity-50",
|
|
244
|
+
defaultClassNames.button_previous
|
|
245
|
+
),
|
|
246
|
+
button_next: cn(
|
|
247
|
+
buttonVariants({ variant: buttonVariant }),
|
|
248
|
+
"p-0 size-(--cell-size) select-none aria-disabled:opacity-50",
|
|
249
|
+
defaultClassNames.button_next
|
|
250
|
+
),
|
|
251
|
+
month_caption: cn(
|
|
252
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
253
|
+
defaultClassNames.month_caption
|
|
254
|
+
),
|
|
255
|
+
dropdowns: cn(
|
|
256
|
+
"gap-1.5 text-sm font-medium flex h-(--cell-size) w-full items-center justify-center",
|
|
257
|
+
defaultClassNames.dropdowns
|
|
258
|
+
),
|
|
259
|
+
dropdown_root: cn(
|
|
260
|
+
"shadow-xs rounded-xl relative border border-border has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
261
|
+
defaultClassNames.dropdown_root
|
|
262
|
+
),
|
|
263
|
+
dropdown: cn(
|
|
264
|
+
"inset-0 absolute bg-popover opacity-0",
|
|
265
|
+
defaultClassNames.dropdown
|
|
266
|
+
),
|
|
267
|
+
caption_label: cn(
|
|
268
|
+
"font-medium select-none",
|
|
269
|
+
captionLayout === "label" ? "text-sm" : "h-8 gap-1 pr-1 pl-2 text-sm [&>svg]:size-3.5 rounded-xl flex items-center [&>svg]:text-muted-foreground",
|
|
270
|
+
defaultClassNames.caption_label
|
|
271
|
+
),
|
|
272
|
+
month_grid: cn(
|
|
273
|
+
"w-full border-collapse",
|
|
274
|
+
defaultClassNames.month_grid
|
|
275
|
+
),
|
|
276
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
277
|
+
weekday: cn(
|
|
278
|
+
"font-normal rounded-xl flex-1 text-[0.8rem] text-muted-foreground select-none",
|
|
279
|
+
defaultClassNames.weekday
|
|
280
|
+
),
|
|
281
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
282
|
+
week_number_header: cn(
|
|
283
|
+
"w-(--cell-size) select-none",
|
|
284
|
+
defaultClassNames.week_number_header
|
|
285
|
+
),
|
|
286
|
+
week_number: cn(
|
|
287
|
+
"text-[0.8rem] text-muted-foreground select-none",
|
|
288
|
+
defaultClassNames.week_number
|
|
289
|
+
),
|
|
290
|
+
day: cn(
|
|
291
|
+
"group/day p-0 [&:last-child[data-selected=true]_button]:rounded-r-xl relative aspect-square h-full w-full text-center select-none",
|
|
292
|
+
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-xl" : "[&:first-child[data-selected=true]_button]:rounded-l-xl",
|
|
293
|
+
defaultClassNames.day
|
|
294
|
+
),
|
|
295
|
+
range_start: cn(
|
|
296
|
+
"rounded-l-xl bg-accent",
|
|
297
|
+
defaultClassNames.range_start
|
|
298
|
+
),
|
|
299
|
+
range_middle: cn(
|
|
300
|
+
"rounded-none",
|
|
301
|
+
defaultClassNames.range_middle
|
|
302
|
+
),
|
|
303
|
+
range_end: cn(
|
|
304
|
+
"rounded-r-xl bg-accent",
|
|
305
|
+
defaultClassNames.range_end
|
|
306
|
+
),
|
|
307
|
+
today: cn(
|
|
308
|
+
"rounded-xl bg-accent text-accent-foreground data-[selected=true]:rounded-none",
|
|
309
|
+
defaultClassNames.today
|
|
310
|
+
),
|
|
311
|
+
outside: cn(
|
|
312
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
313
|
+
defaultClassNames.outside
|
|
314
|
+
),
|
|
315
|
+
disabled: cn(
|
|
316
|
+
"text-muted-foreground opacity-50",
|
|
317
|
+
defaultClassNames.disabled
|
|
318
|
+
),
|
|
319
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
320
|
+
...classNames
|
|
321
|
+
},
|
|
322
|
+
components: {
|
|
323
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
324
|
+
return /* @__PURE__ */ jsx(
|
|
325
|
+
"div",
|
|
326
|
+
{
|
|
327
|
+
ref: rootRef,
|
|
328
|
+
className: cn(className2),
|
|
329
|
+
...props2,
|
|
330
|
+
"data-slot": slotName
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
},
|
|
334
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
335
|
+
if (orientation === "left") {
|
|
336
|
+
return /* @__PURE__ */ jsx(
|
|
337
|
+
ChevronLeftIcon,
|
|
338
|
+
{
|
|
339
|
+
className: cn("size-4", className2),
|
|
340
|
+
...props2
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
if (orientation === "right") {
|
|
345
|
+
return /* @__PURE__ */ jsx(
|
|
346
|
+
ChevronRightIcon,
|
|
347
|
+
{
|
|
348
|
+
className: cn("size-4", className2),
|
|
349
|
+
...props2
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
return /* @__PURE__ */ jsx(
|
|
354
|
+
ChevronDownIcon,
|
|
355
|
+
{
|
|
356
|
+
className: cn("size-4", className2),
|
|
357
|
+
...props2
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
},
|
|
361
|
+
DayButton: CalendarDayButton,
|
|
362
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
363
|
+
return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
364
|
+
},
|
|
365
|
+
...components
|
|
366
|
+
},
|
|
367
|
+
...props
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
function CalendarDayButton({
|
|
372
|
+
className,
|
|
373
|
+
day,
|
|
374
|
+
modifiers,
|
|
375
|
+
...props
|
|
376
|
+
}) {
|
|
377
|
+
const defaultClassNames = getDefaultClassNames();
|
|
378
|
+
const ref = React6.useRef(null);
|
|
379
|
+
React6.useEffect(() => {
|
|
380
|
+
if (modifiers.focused) ref.current?.focus();
|
|
381
|
+
}, [modifiers.focused]);
|
|
382
|
+
return /* @__PURE__ */ jsx(
|
|
383
|
+
Button,
|
|
384
|
+
{
|
|
385
|
+
ref,
|
|
386
|
+
variant: "ghost",
|
|
387
|
+
size: "icon",
|
|
388
|
+
"data-day": day.date.toLocaleDateString(),
|
|
389
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
390
|
+
"data-range-start": modifiers.range_start,
|
|
391
|
+
"data-range-end": modifiers.range_end,
|
|
392
|
+
"data-range-middle": modifiers.range_middle,
|
|
393
|
+
className: cn(
|
|
394
|
+
"gap-1 font-normal [&>span]:text-xs data-[range-end=true]:rounded-xl data-[range-end=true]:rounded-r-xl data-[range-start=true]:rounded-xl data-[range-start=true]:rounded-l-xl flex aspect-square size-auto w-full min-w-(--cell-size) flex-col leading-none group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:opacity-70",
|
|
395
|
+
defaultClassNames.day,
|
|
396
|
+
className
|
|
397
|
+
),
|
|
398
|
+
...props
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
function Command({
|
|
403
|
+
className,
|
|
404
|
+
slotName = "command",
|
|
405
|
+
...props
|
|
406
|
+
}) {
|
|
407
|
+
return /* @__PURE__ */ jsx(
|
|
408
|
+
Command$1,
|
|
409
|
+
{
|
|
410
|
+
className: cn(
|
|
411
|
+
elevatedSurface,
|
|
412
|
+
nestedSurfaceReset,
|
|
413
|
+
"flex h-full w-full flex-col overflow-hidden bg-card text-card-foreground",
|
|
414
|
+
className
|
|
415
|
+
),
|
|
416
|
+
...props,
|
|
417
|
+
"data-slot": slotName
|
|
418
|
+
}
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
function CommandDialog({
|
|
422
|
+
title = "Command Palette",
|
|
423
|
+
description = "Search for a command to run...",
|
|
424
|
+
children,
|
|
425
|
+
className,
|
|
426
|
+
hideCloseButton = true,
|
|
427
|
+
...props
|
|
428
|
+
}) {
|
|
429
|
+
return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
|
|
430
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
|
|
431
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
432
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
433
|
+
] }),
|
|
434
|
+
/* @__PURE__ */ jsx(
|
|
435
|
+
DialogContent,
|
|
436
|
+
{
|
|
437
|
+
className: cn(
|
|
438
|
+
`${modalSurface} gap-0 p-0 overflow-hidden`,
|
|
439
|
+
className
|
|
440
|
+
),
|
|
441
|
+
hideCloseButton,
|
|
442
|
+
children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-item]]:py-2.5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
443
|
+
}
|
|
444
|
+
)
|
|
445
|
+
] });
|
|
446
|
+
}
|
|
447
|
+
function CommandInput({
|
|
448
|
+
className,
|
|
449
|
+
slotName = "command-input",
|
|
450
|
+
...props
|
|
451
|
+
}) {
|
|
452
|
+
return /* @__PURE__ */ jsx("div", { className: "shrink-0 border-b border-border", children: /* @__PURE__ */ jsxs(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
"data-slot": "command-input-wrapper",
|
|
456
|
+
className: cn(
|
|
457
|
+
fieldSurface,
|
|
458
|
+
"h-11 gap-3 px-4 m-3 flex items-center"
|
|
459
|
+
),
|
|
460
|
+
children: [
|
|
461
|
+
/* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
462
|
+
/* @__PURE__ */ jsx(
|
|
463
|
+
Command$1.Input,
|
|
464
|
+
{
|
|
465
|
+
className: cn(
|
|
466
|
+
"h-11 text-sm font-medium flex w-full bg-transparent outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
467
|
+
className
|
|
468
|
+
),
|
|
469
|
+
...props,
|
|
470
|
+
"data-slot": slotName
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
) });
|
|
476
|
+
}
|
|
477
|
+
function CommandList({
|
|
478
|
+
className,
|
|
479
|
+
slotName = "command-list",
|
|
480
|
+
...props
|
|
481
|
+
}) {
|
|
482
|
+
return /* @__PURE__ */ jsx(
|
|
483
|
+
Command$1.List,
|
|
484
|
+
{
|
|
485
|
+
className: cn(
|
|
486
|
+
"scroll-py-1 max-h-[300px] overflow-x-hidden overflow-y-auto",
|
|
487
|
+
className
|
|
488
|
+
),
|
|
489
|
+
...props,
|
|
490
|
+
"data-slot": slotName
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
function CommandEmpty({
|
|
495
|
+
className,
|
|
496
|
+
children,
|
|
497
|
+
slotName = "command-empty",
|
|
498
|
+
...props
|
|
499
|
+
}) {
|
|
500
|
+
return /* @__PURE__ */ jsxs(
|
|
501
|
+
Command$1.Empty,
|
|
502
|
+
{
|
|
503
|
+
className: cn(
|
|
504
|
+
"gap-3 px-6 py-10 flex flex-col items-center justify-center text-center",
|
|
505
|
+
className
|
|
506
|
+
),
|
|
507
|
+
...props,
|
|
508
|
+
"data-slot": slotName,
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ jsx("span", { className: "size-10 flex items-center justify-center rounded-full bg-surface-recessed text-muted-foreground", children: /* @__PURE__ */ jsx(SearchXIcon, { className: "size-5" }) }),
|
|
511
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children })
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
function CommandGroup({
|
|
517
|
+
className,
|
|
518
|
+
slotName = "command-group",
|
|
519
|
+
...props
|
|
520
|
+
}) {
|
|
521
|
+
return /* @__PURE__ */ jsx(
|
|
522
|
+
Command$1.Group,
|
|
523
|
+
{
|
|
524
|
+
className: cn(
|
|
525
|
+
"p-3 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium overflow-hidden text-foreground [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
526
|
+
className
|
|
527
|
+
),
|
|
528
|
+
...props,
|
|
529
|
+
"data-slot": slotName
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
function CommandSeparator({
|
|
534
|
+
className,
|
|
535
|
+
slotName = "command-separator",
|
|
536
|
+
...props
|
|
537
|
+
}) {
|
|
538
|
+
return /* @__PURE__ */ jsx(
|
|
539
|
+
Command$1.Separator,
|
|
540
|
+
{
|
|
541
|
+
className: cn("mx-3 h-px bg-border", className),
|
|
542
|
+
...props,
|
|
543
|
+
"data-slot": slotName
|
|
544
|
+
}
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
function CommandItem({
|
|
548
|
+
className,
|
|
549
|
+
slotName = "command-item",
|
|
550
|
+
...props
|
|
551
|
+
}) {
|
|
552
|
+
return /* @__PURE__ */ jsx(
|
|
553
|
+
Command$1.Item,
|
|
554
|
+
{
|
|
555
|
+
className: cn(
|
|
556
|
+
"gap-2 px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 rounded-xl relative flex cursor-default items-center outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
557
|
+
className
|
|
558
|
+
),
|
|
559
|
+
...props,
|
|
560
|
+
"data-slot": slotName
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
function CommandShortcut({
|
|
565
|
+
className,
|
|
566
|
+
slotName = "command-shortcut",
|
|
567
|
+
...props
|
|
568
|
+
}) {
|
|
569
|
+
return /* @__PURE__ */ jsx(
|
|
570
|
+
"span",
|
|
571
|
+
{
|
|
572
|
+
className: cn(
|
|
573
|
+
"text-xs tracking-widest ml-auto text-muted-foreground",
|
|
574
|
+
className
|
|
575
|
+
),
|
|
576
|
+
...props,
|
|
577
|
+
"data-slot": slotName
|
|
578
|
+
}
|
|
579
|
+
);
|
|
580
|
+
}
|
|
581
|
+
var Popover = Popover$1.Root;
|
|
582
|
+
var PopoverTrigger = Popover$1.Trigger;
|
|
583
|
+
var PopoverAnchor = Popover$1.Anchor;
|
|
584
|
+
var PopoverContent = React6.forwardRef(
|
|
585
|
+
({
|
|
586
|
+
className,
|
|
587
|
+
align = "center",
|
|
588
|
+
sideOffset = 4,
|
|
589
|
+
slotName = "popover-content",
|
|
590
|
+
...props
|
|
591
|
+
}, ref) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
592
|
+
Popover$1.Content,
|
|
593
|
+
{
|
|
594
|
+
ref,
|
|
595
|
+
align,
|
|
596
|
+
sideOffset,
|
|
597
|
+
className: cn(
|
|
598
|
+
`${panelSurface} p-4 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-full origin-[--radix-popover-content-transform-origin] bg-popover/90 outline-none`,
|
|
599
|
+
className
|
|
600
|
+
),
|
|
601
|
+
...props,
|
|
602
|
+
"data-slot": slotName
|
|
603
|
+
}
|
|
604
|
+
) })
|
|
605
|
+
);
|
|
606
|
+
PopoverContent.displayName = Popover$1.Content.displayName;
|
|
607
|
+
function Select({
|
|
608
|
+
slotName = "select",
|
|
609
|
+
...props
|
|
610
|
+
}) {
|
|
611
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { ...props, "data-slot": slotName });
|
|
612
|
+
}
|
|
613
|
+
function SelectGroup({
|
|
614
|
+
slotName = "select-group",
|
|
615
|
+
...props
|
|
616
|
+
}) {
|
|
617
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { ...props, "data-slot": slotName });
|
|
618
|
+
}
|
|
619
|
+
function SelectValue({
|
|
620
|
+
slotName = "select-value",
|
|
621
|
+
...props
|
|
622
|
+
}) {
|
|
623
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { ...props, "data-slot": slotName });
|
|
624
|
+
}
|
|
625
|
+
function SelectTrigger({
|
|
626
|
+
className,
|
|
627
|
+
children,
|
|
628
|
+
slotName = "select-trigger",
|
|
629
|
+
...props
|
|
630
|
+
}) {
|
|
631
|
+
return /* @__PURE__ */ jsxs(
|
|
632
|
+
SelectPrimitive.Trigger,
|
|
633
|
+
{
|
|
634
|
+
className: cn(
|
|
635
|
+
`${fieldSurface} h-11 px-4 text-sm font-medium *:data-[slot=select-value]:gap-2 [&_svg:not([class*='size-'])]:size-4 flex w-full items-center justify-between transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>span]:line-clamp-1 ${focusRing}`,
|
|
636
|
+
className
|
|
637
|
+
),
|
|
638
|
+
...props,
|
|
639
|
+
"data-slot": slotName,
|
|
640
|
+
children: [
|
|
641
|
+
children,
|
|
642
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
function SelectContent({
|
|
648
|
+
className,
|
|
649
|
+
children,
|
|
650
|
+
position = "popper",
|
|
651
|
+
slotName = "select-content",
|
|
652
|
+
...props
|
|
653
|
+
}) {
|
|
654
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
655
|
+
SelectPrimitive.Content,
|
|
656
|
+
{
|
|
657
|
+
className: cn(
|
|
658
|
+
`${menuSurface} max-h-96 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 relative z-50 min-w-[8rem] overflow-hidden bg-popover/95`,
|
|
659
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
660
|
+
className
|
|
661
|
+
),
|
|
662
|
+
position,
|
|
663
|
+
...props,
|
|
664
|
+
"data-slot": slotName,
|
|
665
|
+
children: [
|
|
666
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
667
|
+
/* @__PURE__ */ jsx(
|
|
668
|
+
SelectPrimitive.Viewport,
|
|
669
|
+
{
|
|
670
|
+
className: cn(
|
|
671
|
+
"p-1",
|
|
672
|
+
position === "popper" && "scroll-my-1 h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
673
|
+
),
|
|
674
|
+
children
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
) });
|
|
681
|
+
}
|
|
682
|
+
function SelectLabel({
|
|
683
|
+
className,
|
|
684
|
+
slotName = "select-label",
|
|
685
|
+
...props
|
|
686
|
+
}) {
|
|
687
|
+
return /* @__PURE__ */ jsx(
|
|
688
|
+
SelectPrimitive.Label,
|
|
689
|
+
{
|
|
690
|
+
className: cn(
|
|
691
|
+
"px-2 py-1.5 text-xs font-medium tracking-wider text-muted-foreground uppercase",
|
|
692
|
+
className
|
|
693
|
+
),
|
|
694
|
+
...props,
|
|
695
|
+
"data-slot": slotName
|
|
696
|
+
}
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
function SelectItem({
|
|
700
|
+
className,
|
|
701
|
+
children,
|
|
702
|
+
slotName = "select-item",
|
|
703
|
+
...props
|
|
704
|
+
}) {
|
|
705
|
+
return /* @__PURE__ */ jsxs(
|
|
706
|
+
SelectPrimitive.Item,
|
|
707
|
+
{
|
|
708
|
+
className: cn(
|
|
709
|
+
"gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:gap-2 focus:font-semibold relative flex w-full cursor-default items-center outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center",
|
|
710
|
+
className
|
|
711
|
+
),
|
|
712
|
+
...props,
|
|
713
|
+
"data-slot": slotName,
|
|
714
|
+
children: [
|
|
715
|
+
/* @__PURE__ */ jsx("span", { className: "right-2 size-3.5 absolute flex items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
716
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
717
|
+
]
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
function SelectSeparator({
|
|
722
|
+
className,
|
|
723
|
+
slotName = "select-separator",
|
|
724
|
+
...props
|
|
725
|
+
}) {
|
|
726
|
+
return /* @__PURE__ */ jsx(
|
|
727
|
+
SelectPrimitive.Separator,
|
|
728
|
+
{
|
|
729
|
+
className: cn(
|
|
730
|
+
"-mx-1 my-1 pointer-events-none h-px bg-border",
|
|
731
|
+
className
|
|
732
|
+
),
|
|
733
|
+
...props,
|
|
734
|
+
"data-slot": slotName
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
function SelectScrollUpButton({
|
|
739
|
+
className,
|
|
740
|
+
slotName = "select-scroll-up-button",
|
|
741
|
+
...props
|
|
742
|
+
}) {
|
|
743
|
+
return /* @__PURE__ */ jsx(
|
|
744
|
+
SelectPrimitive.ScrollUpButton,
|
|
745
|
+
{
|
|
746
|
+
className: cn(
|
|
747
|
+
"py-1 flex cursor-default items-center justify-center",
|
|
748
|
+
className
|
|
749
|
+
),
|
|
750
|
+
...props,
|
|
751
|
+
"data-slot": slotName,
|
|
752
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
753
|
+
}
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
function SelectScrollDownButton({
|
|
757
|
+
className,
|
|
758
|
+
slotName = "select-scroll-down-button",
|
|
759
|
+
...props
|
|
760
|
+
}) {
|
|
761
|
+
return /* @__PURE__ */ jsx(
|
|
762
|
+
SelectPrimitive.ScrollDownButton,
|
|
763
|
+
{
|
|
764
|
+
className: cn(
|
|
765
|
+
"py-1 flex cursor-default items-center justify-center",
|
|
766
|
+
className
|
|
767
|
+
),
|
|
768
|
+
...props,
|
|
769
|
+
"data-slot": slotName,
|
|
770
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
var FieldContext = React6.createContext(null);
|
|
775
|
+
function useOptionalField() {
|
|
776
|
+
return React6.useContext(FieldContext);
|
|
777
|
+
}
|
|
778
|
+
function useField() {
|
|
779
|
+
const field = useOptionalField();
|
|
780
|
+
if (!field) {
|
|
781
|
+
throw new Error("Field parts must be rendered inside a Field.");
|
|
782
|
+
}
|
|
783
|
+
return field;
|
|
784
|
+
}
|
|
785
|
+
function FieldError({
|
|
786
|
+
message,
|
|
787
|
+
className,
|
|
788
|
+
slotName = "field-error",
|
|
789
|
+
...props
|
|
790
|
+
}) {
|
|
791
|
+
const field = useOptionalField();
|
|
792
|
+
if (!message) {
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
795
|
+
return /* @__PURE__ */ jsx(
|
|
796
|
+
"p",
|
|
797
|
+
{
|
|
798
|
+
id: field?.errorId,
|
|
799
|
+
className: cn(
|
|
800
|
+
"ml-1 text-xs font-medium text-destructive group-data-[orientation=horizontal]/field:col-span-2 group-data-[orientation=horizontal]/field:row-start-3",
|
|
801
|
+
className
|
|
802
|
+
),
|
|
803
|
+
...props,
|
|
804
|
+
"data-slot": slotName,
|
|
805
|
+
children: message
|
|
806
|
+
}
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
var floatingSheetDefaultLabels = {
|
|
810
|
+
backLabel: "Back",
|
|
811
|
+
closeLabel: "Close"
|
|
812
|
+
};
|
|
813
|
+
var FLOATING_SHEET_OFFSET_LIMIT = 3;
|
|
814
|
+
var FloatingSheetStackContext = React6.createContext(null);
|
|
815
|
+
function useFloatingSheetStack() {
|
|
816
|
+
const context = React6.useContext(FloatingSheetStackContext);
|
|
817
|
+
if (!context) {
|
|
818
|
+
throw new Error(
|
|
819
|
+
"FloatingSheet must be rendered inside a FloatingSheetStack."
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
return context;
|
|
823
|
+
}
|
|
824
|
+
function FloatingSheetStack({
|
|
825
|
+
children,
|
|
826
|
+
labels,
|
|
827
|
+
slotName = "floating-sheet-stack"
|
|
828
|
+
}) {
|
|
829
|
+
const { backLabel, closeLabel } = useUiLabels(
|
|
830
|
+
"floatingSheet",
|
|
831
|
+
floatingSheetDefaultLabels,
|
|
832
|
+
labels
|
|
833
|
+
);
|
|
834
|
+
const [entries, setEntries] = React6.useState([]);
|
|
835
|
+
const [container, setContainer] = React6.useState(null);
|
|
836
|
+
const register = React6.useCallback((entry) => {
|
|
837
|
+
setEntries(
|
|
838
|
+
(current) => current.some((item) => item.id === entry.id) ? current.map((item) => item.id === entry.id ? entry : item) : [...current, entry]
|
|
839
|
+
);
|
|
840
|
+
}, []);
|
|
841
|
+
const unregister = React6.useCallback((id) => {
|
|
842
|
+
setEntries((current) => current.filter((item) => item.id !== id));
|
|
843
|
+
}, []);
|
|
844
|
+
const closeAll = React6.useCallback(() => {
|
|
845
|
+
for (const entry of [...entries].reverse()) {
|
|
846
|
+
entry.close();
|
|
847
|
+
}
|
|
848
|
+
}, [entries]);
|
|
849
|
+
const value = React6.useMemo(
|
|
850
|
+
() => ({
|
|
851
|
+
labels: { backLabel, closeLabel },
|
|
852
|
+
container,
|
|
853
|
+
entries,
|
|
854
|
+
register,
|
|
855
|
+
unregister,
|
|
856
|
+
closeAll
|
|
857
|
+
}),
|
|
858
|
+
[
|
|
859
|
+
backLabel,
|
|
860
|
+
closeLabel,
|
|
861
|
+
container,
|
|
862
|
+
entries,
|
|
863
|
+
register,
|
|
864
|
+
unregister,
|
|
865
|
+
closeAll
|
|
866
|
+
]
|
|
867
|
+
);
|
|
868
|
+
const top = entries.at(-1);
|
|
869
|
+
return /* @__PURE__ */ jsxs(FloatingSheetStackContext.Provider, { value, children: [
|
|
870
|
+
children,
|
|
871
|
+
/* @__PURE__ */ jsx(
|
|
872
|
+
DialogPrimitive.Root,
|
|
873
|
+
{
|
|
874
|
+
open: entries.length > 0,
|
|
875
|
+
onOpenChange: (open) => {
|
|
876
|
+
if (!open) {
|
|
877
|
+
closeAll();
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
|
|
881
|
+
/* @__PURE__ */ jsx(
|
|
882
|
+
DialogPrimitive.Overlay,
|
|
883
|
+
{
|
|
884
|
+
"data-slot": "floating-sheet-overlay",
|
|
885
|
+
className: "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 inset-0 bg-black/60 backdrop-blur-sm fixed z-50"
|
|
886
|
+
}
|
|
887
|
+
),
|
|
888
|
+
/* @__PURE__ */ jsxs(
|
|
889
|
+
DialogPrimitive.Content,
|
|
890
|
+
{
|
|
891
|
+
"aria-describedby": void 0,
|
|
892
|
+
onEscapeKeyDown: (event) => {
|
|
893
|
+
event.preventDefault();
|
|
894
|
+
if (!top?.persistent) {
|
|
895
|
+
top?.close();
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
onInteractOutside: (event) => {
|
|
899
|
+
if (top?.persistent) {
|
|
900
|
+
event.preventDefault();
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
904
|
+
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
905
|
+
className: "inset-y-0 right-0 sm:inset-y-4 sm:right-4 sm:w-[calc(100vw-2rem)] sm:max-w-lg fixed z-50 w-full outline-none",
|
|
906
|
+
"data-slot": slotName,
|
|
907
|
+
children: [
|
|
908
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: top?.title }),
|
|
909
|
+
/* @__PURE__ */ jsx(
|
|
910
|
+
"div",
|
|
911
|
+
{
|
|
912
|
+
ref: setContainer,
|
|
913
|
+
"data-slot": "floating-sheet-panels",
|
|
914
|
+
className: "relative h-full w-full"
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
]
|
|
918
|
+
}
|
|
919
|
+
)
|
|
920
|
+
] })
|
|
921
|
+
}
|
|
922
|
+
)
|
|
923
|
+
] });
|
|
924
|
+
}
|
|
925
|
+
function FloatingSheet({
|
|
926
|
+
open,
|
|
927
|
+
onOpenChange,
|
|
928
|
+
title,
|
|
929
|
+
description,
|
|
930
|
+
persistent = false,
|
|
931
|
+
className,
|
|
932
|
+
children,
|
|
933
|
+
slotName = "floating-sheet",
|
|
934
|
+
...props
|
|
935
|
+
}) {
|
|
936
|
+
const { labels, container, entries, register, unregister, closeAll } = useFloatingSheetStack();
|
|
937
|
+
const id = React6.useId();
|
|
938
|
+
const titleId = `${id}-title`;
|
|
939
|
+
const descriptionId = `${id}-description`;
|
|
940
|
+
const close = React6.useCallback(() => onOpenChange(false), [onOpenChange]);
|
|
941
|
+
const closeRef = React6.useRef(close);
|
|
942
|
+
const titleRef = React6.useRef(title);
|
|
943
|
+
const openerRef = React6.useRef(null);
|
|
944
|
+
const panelRef = React6.useRef(null);
|
|
945
|
+
const focusedRef = React6.useRef(false);
|
|
946
|
+
React6.useEffect(() => {
|
|
947
|
+
closeRef.current = close;
|
|
948
|
+
titleRef.current = title;
|
|
949
|
+
});
|
|
950
|
+
React6.useEffect(() => {
|
|
951
|
+
if (!open) {
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
register({
|
|
955
|
+
id,
|
|
956
|
+
title: titleRef.current,
|
|
957
|
+
persistent,
|
|
958
|
+
close: () => closeRef.current()
|
|
959
|
+
});
|
|
960
|
+
}, [open, id, persistent, register]);
|
|
961
|
+
React6.useEffect(() => {
|
|
962
|
+
if (!open) {
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
return () => unregister(id);
|
|
966
|
+
}, [open, id, unregister]);
|
|
967
|
+
const index = entries.findIndex((entry) => entry.id === id);
|
|
968
|
+
const depth = index === -1 ? 0 : entries.length - 1 - index;
|
|
969
|
+
const isTop = index !== -1 && depth === 0;
|
|
970
|
+
React6.useEffect(() => {
|
|
971
|
+
if (open) {
|
|
972
|
+
openerRef.current = document.activeElement;
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
975
|
+
const opener = openerRef.current;
|
|
976
|
+
openerRef.current = null;
|
|
977
|
+
if (opener instanceof HTMLElement && document.contains(opener)) {
|
|
978
|
+
opener.focus();
|
|
979
|
+
}
|
|
980
|
+
}, [open]);
|
|
981
|
+
React6.useEffect(() => {
|
|
982
|
+
if (!open) {
|
|
983
|
+
focusedRef.current = false;
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
if (!isTop || focusedRef.current) {
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
focusedRef.current = true;
|
|
990
|
+
const frame = requestAnimationFrame(() => panelRef.current?.focus());
|
|
991
|
+
return () => cancelAnimationFrame(frame);
|
|
992
|
+
}, [open, isTop]);
|
|
993
|
+
if (!open || !container) {
|
|
994
|
+
return null;
|
|
995
|
+
}
|
|
996
|
+
const offset = Math.min(depth, FLOATING_SHEET_OFFSET_LIMIT);
|
|
997
|
+
return createPortal(
|
|
998
|
+
/* @__PURE__ */ jsxs(
|
|
999
|
+
"section",
|
|
1000
|
+
{
|
|
1001
|
+
ref: panelRef,
|
|
1002
|
+
"data-depth": depth,
|
|
1003
|
+
role: "dialog",
|
|
1004
|
+
"aria-labelledby": titleId,
|
|
1005
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
1006
|
+
tabIndex: -1,
|
|
1007
|
+
inert: !isTop,
|
|
1008
|
+
style: {
|
|
1009
|
+
transform: `translateX(-${offset * 26}px) scale(${1 - offset * 0.035})`,
|
|
1010
|
+
zIndex: index
|
|
1011
|
+
},
|
|
1012
|
+
className: cn(
|
|
1013
|
+
`${modalSurface} inset-0 ease-out absolute flex flex-col overflow-hidden transition-transform duration-300 outline-none`,
|
|
1014
|
+
depth > 0 && "max-sm:hidden pointer-events-none",
|
|
1015
|
+
depth > FLOATING_SHEET_OFFSET_LIMIT && "hidden",
|
|
1016
|
+
className
|
|
1017
|
+
),
|
|
1018
|
+
...props,
|
|
1019
|
+
"data-slot": slotName,
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ jsxs(
|
|
1022
|
+
"header",
|
|
1023
|
+
{
|
|
1024
|
+
"data-slot": "floating-sheet-header",
|
|
1025
|
+
className: "gap-1 p-5 flex flex-col border-b border-border",
|
|
1026
|
+
children: [
|
|
1027
|
+
index > 0 ? /* @__PURE__ */ jsxs(
|
|
1028
|
+
"button",
|
|
1029
|
+
{
|
|
1030
|
+
type: "button",
|
|
1031
|
+
"data-slot": "floating-sheet-back",
|
|
1032
|
+
onClick: close,
|
|
1033
|
+
className: cn(
|
|
1034
|
+
"gap-2 h-8 -ml-2 px-2 text-sm font-medium inline-flex w-fit items-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
1035
|
+
focusRing
|
|
1036
|
+
),
|
|
1037
|
+
children: [
|
|
1038
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, { className: "size-4" }),
|
|
1039
|
+
labels.backLabel
|
|
1040
|
+
]
|
|
1041
|
+
}
|
|
1042
|
+
) : null,
|
|
1043
|
+
/* @__PURE__ */ jsx(
|
|
1044
|
+
"h2",
|
|
1045
|
+
{
|
|
1046
|
+
id: titleId,
|
|
1047
|
+
"data-slot": "floating-sheet-title",
|
|
1048
|
+
className: "pr-10 text-lg font-semibold text-foreground",
|
|
1049
|
+
children: title
|
|
1050
|
+
}
|
|
1051
|
+
),
|
|
1052
|
+
description ? /* @__PURE__ */ jsx(
|
|
1053
|
+
"p",
|
|
1054
|
+
{
|
|
1055
|
+
id: descriptionId,
|
|
1056
|
+
"data-slot": "floating-sheet-description",
|
|
1057
|
+
className: "text-sm text-muted-foreground",
|
|
1058
|
+
children: description
|
|
1059
|
+
}
|
|
1060
|
+
) : null
|
|
1061
|
+
]
|
|
1062
|
+
}
|
|
1063
|
+
),
|
|
1064
|
+
children,
|
|
1065
|
+
/* @__PURE__ */ jsx(
|
|
1066
|
+
"button",
|
|
1067
|
+
{
|
|
1068
|
+
type: "button",
|
|
1069
|
+
"data-slot": "floating-sheet-close",
|
|
1070
|
+
"aria-label": labels.closeLabel,
|
|
1071
|
+
onClick: closeAll,
|
|
1072
|
+
className: cn(
|
|
1073
|
+
"top-4 right-4 size-9 shadow-xs absolute flex items-center justify-center rounded-full border border-border bg-muted text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none",
|
|
1074
|
+
focusRing
|
|
1075
|
+
),
|
|
1076
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" })
|
|
1077
|
+
}
|
|
1078
|
+
)
|
|
1079
|
+
]
|
|
1080
|
+
}
|
|
1081
|
+
),
|
|
1082
|
+
container
|
|
1083
|
+
);
|
|
1084
|
+
}
|
|
1085
|
+
function FloatingSheetBody({
|
|
1086
|
+
className,
|
|
1087
|
+
slotName = "floating-sheet-body",
|
|
1088
|
+
...props
|
|
1089
|
+
}) {
|
|
1090
|
+
return /* @__PURE__ */ jsx(
|
|
1091
|
+
"div",
|
|
1092
|
+
{
|
|
1093
|
+
className: cn("p-5 flex-1 overflow-y-auto", className),
|
|
1094
|
+
...props,
|
|
1095
|
+
"data-slot": slotName
|
|
1096
|
+
}
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
function FloatingSheetFooter({
|
|
1100
|
+
className,
|
|
1101
|
+
slotName = "floating-sheet-footer",
|
|
1102
|
+
...props
|
|
1103
|
+
}) {
|
|
1104
|
+
return /* @__PURE__ */ jsx(
|
|
1105
|
+
"div",
|
|
1106
|
+
{
|
|
1107
|
+
className: cn(
|
|
1108
|
+
"gap-2 p-5 mt-auto flex items-center justify-end border-t border-border",
|
|
1109
|
+
className
|
|
1110
|
+
),
|
|
1111
|
+
...props,
|
|
1112
|
+
"data-slot": slotName
|
|
1113
|
+
}
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
var InputOTP = React6.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1117
|
+
OTPInput,
|
|
1118
|
+
{
|
|
1119
|
+
ref,
|
|
1120
|
+
containerClassName: cn(
|
|
1121
|
+
"gap-2 flex items-center has-[:disabled]:opacity-50",
|
|
1122
|
+
containerClassName
|
|
1123
|
+
),
|
|
1124
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
1125
|
+
...props
|
|
1126
|
+
}
|
|
1127
|
+
));
|
|
1128
|
+
InputOTP.displayName = "InputOTP";
|
|
1129
|
+
var InputOTPGroup = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1130
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1131
|
+
var InputOTPSlot = React6.forwardRef(({ index, className, slotName = "input-otp-slot", ...props }, ref) => {
|
|
1132
|
+
const inputOTPContext = React6.useContext(OTPInputContext);
|
|
1133
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1134
|
+
return /* @__PURE__ */ jsxs(
|
|
1135
|
+
"div",
|
|
1136
|
+
{
|
|
1137
|
+
ref,
|
|
1138
|
+
className: cn(
|
|
1139
|
+
glassControl,
|
|
1140
|
+
controlFill,
|
|
1141
|
+
"size-11 text-sm font-medium first:rounded-l-2xl last:rounded-r-2xl relative flex items-center justify-center rounded-none transition-all",
|
|
1142
|
+
isActive && "z-10 ring-[3px] ring-ring/50",
|
|
1143
|
+
className
|
|
1144
|
+
),
|
|
1145
|
+
...props,
|
|
1146
|
+
"data-slot": slotName,
|
|
1147
|
+
children: [
|
|
1148
|
+
char,
|
|
1149
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "inset-0 pointer-events-none absolute flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-4 animate-caret-blink w-px bg-foreground duration-1000" }) })
|
|
1150
|
+
]
|
|
1151
|
+
}
|
|
1152
|
+
);
|
|
1153
|
+
});
|
|
1154
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1155
|
+
var InputOTPSeparator = React6.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(Minus, {}) }));
|
|
1156
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
1157
|
+
var Switch = React6.forwardRef(({ className, slotName = "switch", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1158
|
+
SwitchPrimitives.Root,
|
|
1159
|
+
{
|
|
1160
|
+
className: cn(
|
|
1161
|
+
`peer h-6 w-11 shadow-sm inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input ${focusRing}`,
|
|
1162
|
+
className
|
|
1163
|
+
),
|
|
1164
|
+
...props,
|
|
1165
|
+
ref,
|
|
1166
|
+
"data-slot": slotName,
|
|
1167
|
+
children: /* @__PURE__ */ jsx(
|
|
1168
|
+
SwitchPrimitives.Thumb,
|
|
1169
|
+
{
|
|
1170
|
+
"data-slot": "switch-thumb",
|
|
1171
|
+
className: cn(
|
|
1172
|
+
"size-5 shadow-lg data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 pointer-events-none block rounded-full bg-background ring-0 transition-transform"
|
|
1173
|
+
)
|
|
1174
|
+
}
|
|
1175
|
+
)
|
|
1176
|
+
}
|
|
1177
|
+
));
|
|
1178
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
1179
|
+
var Tabs = React6.forwardRef(({ slotName = "tabs", ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, ...props, "data-slot": slotName }));
|
|
1180
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
1181
|
+
var TabsList = React6.forwardRef(({ className, slotName = "tabs-list", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1182
|
+
TabsPrimitive.List,
|
|
1183
|
+
{
|
|
1184
|
+
ref,
|
|
1185
|
+
className: cn(
|
|
1186
|
+
"h-11 p-1.5 rounded-2xl inline-flex items-center justify-center bg-muted text-muted-foreground",
|
|
1187
|
+
className
|
|
1188
|
+
),
|
|
1189
|
+
...props,
|
|
1190
|
+
"data-slot": slotName
|
|
1191
|
+
}
|
|
1192
|
+
));
|
|
1193
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
1194
|
+
var TabsTrigger = React6.forwardRef(({ className, slotName = "tabs-trigger", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1195
|
+
TabsPrimitive.Trigger,
|
|
1196
|
+
{
|
|
1197
|
+
ref,
|
|
1198
|
+
className: cn(
|
|
1199
|
+
`px-4 text-sm font-medium data-[state=active]:shadow-sm h-8 rounded-xl data-[state=active]:font-semibold inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground ${focusRing}`,
|
|
1200
|
+
className
|
|
1201
|
+
),
|
|
1202
|
+
...props,
|
|
1203
|
+
"data-slot": slotName
|
|
1204
|
+
}
|
|
1205
|
+
));
|
|
1206
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
1207
|
+
var TabsContent = React6.forwardRef(({ className, slotName = "tabs-content", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1208
|
+
TabsPrimitive.Content,
|
|
1209
|
+
{
|
|
1210
|
+
ref,
|
|
1211
|
+
className: cn(
|
|
1212
|
+
elevatedSurface,
|
|
1213
|
+
nestedSurfaceReset,
|
|
1214
|
+
`mt-2 p-5 bg-card ${focusRing}`,
|
|
1215
|
+
className
|
|
1216
|
+
),
|
|
1217
|
+
...props,
|
|
1218
|
+
"data-slot": slotName
|
|
1219
|
+
}
|
|
1220
|
+
));
|
|
1221
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
1222
|
+
var Textarea = React6.forwardRef(({ className, slotName = "textarea", ...props }, ref) => {
|
|
1223
|
+
return /* @__PURE__ */ jsx(
|
|
1224
|
+
"textarea",
|
|
1225
|
+
{
|
|
1226
|
+
className: cn(
|
|
1227
|
+
fieldSurface,
|
|
1228
|
+
"px-4 py-3 text-sm font-medium min-h-24 flex w-full resize-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1229
|
+
focusRing,
|
|
1230
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
1231
|
+
className
|
|
1232
|
+
),
|
|
1233
|
+
ref,
|
|
1234
|
+
...props,
|
|
1235
|
+
"data-slot": slotName
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1238
|
+
});
|
|
1239
|
+
Textarea.displayName = "Textarea";
|
|
1240
|
+
|
|
1241
|
+
export { Alert, AlertDescription, AlertTitle, Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, FieldContext, FieldError, FloatingSheet, FloatingSheetBody, FloatingSheetFooter, FloatingSheetStack, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, confirmDialogDefaultLabels, floatingSheetDefaultLabels, useField };
|
|
1242
|
+
//# sourceMappingURL=chunk-CFDDAFPJ.js.map
|
|
1243
|
+
//# sourceMappingURL=chunk-CFDDAFPJ.js.map
|