@krak-stack/registry 0.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/README.md +29 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/app-brand.d.ts +26 -0
- package/dist/components/ui/app-brand.js +78 -0
- package/dist/components/ui/attachment.d.ts +23 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/checkbox.d.ts +3 -0
- package/dist/components/ui/code-block.d.ts +14 -0
- package/dist/components/ui/code-block.js +224 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/copy-button.d.ts +18 -0
- package/dist/components/ui/copy-button.js +133 -0
- package/dist/components/ui/data-table.d.ts +264 -0
- package/dist/components/ui/data-table.js +3594 -0
- package/dist/components/ui/dialog.d.ts +13 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/editing-locale-switcher.d.ts +7 -0
- package/dist/components/ui/editing-locale-switcher.js +626 -0
- package/dist/components/ui/effect-form.d.ts +137 -0
- package/dist/components/ui/effect-form.js +2330 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/file-picker.d.ts +30 -0
- package/dist/components/ui/file-picker.js +811 -0
- package/dist/components/ui/form.d.ts +402 -0
- package/dist/components/ui/form.js +2245 -0
- package/dist/components/ui/google-map.d.ts +103 -0
- package/dist/components/ui/google-map.js +754 -0
- package/dist/components/ui/icon-input.d.ts +9 -0
- package/dist/components/ui/icon-input.js +971 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/loading.d.ts +7 -0
- package/dist/components/ui/loading.js +467 -0
- package/dist/components/ui/locale-switcher.d.ts +7 -0
- package/dist/components/ui/locale-switcher.js +632 -0
- package/dist/components/ui/pagination.d.ts +43 -0
- package/dist/components/ui/pagination.js +787 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/scroll-area.d.ts +4 -0
- package/dist/components/ui/search-menu.d.ts +34 -0
- package/dist/components/ui/search-menu.js +839 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sidebar-layout.d.ts +29 -0
- package/dist/components/ui/sidebar-layout.js +755 -0
- package/dist/components/ui/sidebar.d.ts +63 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/stats-card.d.ts +12 -0
- package/dist/components/ui/stats-card.js +125 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/theme-switcher.d.ts +29 -0
- package/dist/components/ui/theme-switcher.js +775 -0
- package/dist/components/ui/tooltip.d.ts +6 -0
- package/dist/components/ui/virtualized-combobox.d.ts +54 -0
- package/dist/components/ui/virtualized-combobox.js +821 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/lib/query.d.ts +49 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/paraglide/runtime.d.ts +978 -0
- package/dist/services/embedding.d.ts +2 -0
- package/dist/services/embedding.js +23 -0
- package/dist/services/notification/channels/index.d.ts +22 -0
- package/dist/services/notification/channels/index.js +11 -0
- package/dist/services/notification/channels/ses/index.d.ts +51 -0
- package/dist/services/notification/channels/ses/index.js +145 -0
- package/dist/services/notification/channels/ses/schema.d.ts +13 -0
- package/dist/services/notification/channels/ses/schema.js +35 -0
- package/dist/services/notification/index.d.ts +15 -0
- package/dist/services/notification/index.js +67 -0
- package/dist/services/notification/schema.d.ts +10 -0
- package/dist/services/notification/schema.js +30 -0
- package/dist/services/opentelemetry.d.ts +8 -0
- package/dist/services/opentelemetry.js +23 -0
- package/dist/services/s3/index.d.ts +62 -0
- package/dist/services/s3/index.js +208 -0
- package/dist/services/s3/schema.d.ts +18 -0
- package/dist/services/s3/schema.js +37 -0
- package/package.json +218 -0
- package/tailwind.css +1 -0
|
@@ -0,0 +1,2245 @@
|
|
|
1
|
+
// ../../src/components/ui/select.tsx
|
|
2
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
3
|
+
|
|
4
|
+
// ../../src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// ../../src/components/ui/select.tsx
|
|
12
|
+
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
13
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
14
|
+
"use client";
|
|
15
|
+
var Select = SelectPrimitive.Root;
|
|
16
|
+
function SelectGroup({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.Group, {
|
|
18
|
+
"data-slot": "select-group",
|
|
19
|
+
className: cn("scroll-my-1 p-1", className),
|
|
20
|
+
...props
|
|
21
|
+
}, undefined, false, undefined, this);
|
|
22
|
+
}
|
|
23
|
+
function SelectValue({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.Value, {
|
|
25
|
+
"data-slot": "select-value",
|
|
26
|
+
className: cn("flex flex-1 text-left", className),
|
|
27
|
+
...props
|
|
28
|
+
}, undefined, false, undefined, this);
|
|
29
|
+
}
|
|
30
|
+
function SelectTrigger({
|
|
31
|
+
className,
|
|
32
|
+
size = "default",
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.Trigger, {
|
|
37
|
+
"data-slot": "select-trigger",
|
|
38
|
+
"data-size": size,
|
|
39
|
+
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
40
|
+
...props,
|
|
41
|
+
children: [
|
|
42
|
+
children,
|
|
43
|
+
/* @__PURE__ */ jsxDEV(SelectPrimitive.Icon, {
|
|
44
|
+
render: /* @__PURE__ */ jsxDEV(ChevronDownIcon, {
|
|
45
|
+
className: "text-muted-foreground pointer-events-none size-4"
|
|
46
|
+
}, undefined, false, undefined, this)
|
|
47
|
+
}, undefined, false, undefined, this)
|
|
48
|
+
]
|
|
49
|
+
}, undefined, true, undefined, this);
|
|
50
|
+
}
|
|
51
|
+
function SelectContent({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
side = "bottom",
|
|
55
|
+
sideOffset = 4,
|
|
56
|
+
align = "center",
|
|
57
|
+
alignOffset = 0,
|
|
58
|
+
alignItemWithTrigger = true,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.Portal, {
|
|
62
|
+
children: /* @__PURE__ */ jsxDEV(SelectPrimitive.Positioner, {
|
|
63
|
+
side,
|
|
64
|
+
sideOffset,
|
|
65
|
+
align,
|
|
66
|
+
alignOffset,
|
|
67
|
+
alignItemWithTrigger,
|
|
68
|
+
className: "isolate z-50",
|
|
69
|
+
children: /* @__PURE__ */ jsxDEV(SelectPrimitive.Popup, {
|
|
70
|
+
"data-slot": "select-content",
|
|
71
|
+
"data-align-trigger": alignItemWithTrigger,
|
|
72
|
+
className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
73
|
+
...props,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsxDEV(SelectScrollUpButton, {}, undefined, false, undefined, this),
|
|
76
|
+
/* @__PURE__ */ jsxDEV(SelectPrimitive.List, {
|
|
77
|
+
children
|
|
78
|
+
}, undefined, false, undefined, this),
|
|
79
|
+
/* @__PURE__ */ jsxDEV(SelectScrollDownButton, {}, undefined, false, undefined, this)
|
|
80
|
+
]
|
|
81
|
+
}, undefined, true, undefined, this)
|
|
82
|
+
}, undefined, false, undefined, this)
|
|
83
|
+
}, undefined, false, undefined, this);
|
|
84
|
+
}
|
|
85
|
+
function SelectItem({
|
|
86
|
+
className,
|
|
87
|
+
children,
|
|
88
|
+
...props
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.Item, {
|
|
91
|
+
"data-slot": "select-item",
|
|
92
|
+
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
93
|
+
...props,
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsxDEV(SelectPrimitive.ItemText, {
|
|
96
|
+
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
97
|
+
children
|
|
98
|
+
}, undefined, false, undefined, this),
|
|
99
|
+
/* @__PURE__ */ jsxDEV(SelectPrimitive.ItemIndicator, {
|
|
100
|
+
render: /* @__PURE__ */ jsxDEV("span", {
|
|
101
|
+
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
|
|
102
|
+
}, undefined, false, undefined, this),
|
|
103
|
+
children: /* @__PURE__ */ jsxDEV(CheckIcon, {
|
|
104
|
+
className: "pointer-events-none"
|
|
105
|
+
}, undefined, false, undefined, this)
|
|
106
|
+
}, undefined, false, undefined, this)
|
|
107
|
+
]
|
|
108
|
+
}, undefined, true, undefined, this);
|
|
109
|
+
}
|
|
110
|
+
function SelectScrollUpButton({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.ScrollUpArrow, {
|
|
115
|
+
"data-slot": "select-scroll-up-button",
|
|
116
|
+
className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
117
|
+
...props,
|
|
118
|
+
children: /* @__PURE__ */ jsxDEV(ChevronUpIcon, {}, undefined, false, undefined, this)
|
|
119
|
+
}, undefined, false, undefined, this);
|
|
120
|
+
}
|
|
121
|
+
function SelectScrollDownButton({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}) {
|
|
125
|
+
return /* @__PURE__ */ jsxDEV(SelectPrimitive.ScrollDownArrow, {
|
|
126
|
+
"data-slot": "select-scroll-down-button",
|
|
127
|
+
className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
128
|
+
...props,
|
|
129
|
+
children: /* @__PURE__ */ jsxDEV(ChevronDownIcon, {}, undefined, false, undefined, this)
|
|
130
|
+
}, undefined, false, undefined, this);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ../../src/components/ui/form.tsx
|
|
134
|
+
import {
|
|
135
|
+
createFormHook,
|
|
136
|
+
createFormHookContexts,
|
|
137
|
+
useStore
|
|
138
|
+
} from "@tanstack/react-form";
|
|
139
|
+
import { Block } from "@tanstack/react-router";
|
|
140
|
+
import { Loader2, Plus, Trash, Languages } from "lucide-react";
|
|
141
|
+
|
|
142
|
+
// ../../src/components/ui/alert-dialog.tsx
|
|
143
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
144
|
+
|
|
145
|
+
// ../../src/components/ui/button.tsx
|
|
146
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
147
|
+
import { cva } from "class-variance-authority";
|
|
148
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
149
|
+
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
150
|
+
variants: {
|
|
151
|
+
variant: {
|
|
152
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
153
|
+
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
154
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
155
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
156
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
157
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
158
|
+
},
|
|
159
|
+
size: {
|
|
160
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
161
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
162
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
163
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
164
|
+
icon: "size-9",
|
|
165
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
166
|
+
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
167
|
+
"icon-lg": "size-10"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
defaultVariants: {
|
|
171
|
+
variant: "default",
|
|
172
|
+
size: "default"
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
function Button({
|
|
176
|
+
className,
|
|
177
|
+
variant = "default",
|
|
178
|
+
size = "default",
|
|
179
|
+
...props
|
|
180
|
+
}) {
|
|
181
|
+
return /* @__PURE__ */ jsxDEV2(ButtonPrimitive, {
|
|
182
|
+
"data-slot": "button",
|
|
183
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
184
|
+
...props
|
|
185
|
+
}, undefined, false, undefined, this);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ../../src/components/ui/alert-dialog.tsx
|
|
189
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
190
|
+
"use client";
|
|
191
|
+
function AlertDialog({ ...props }) {
|
|
192
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Root, {
|
|
193
|
+
"data-slot": "alert-dialog",
|
|
194
|
+
...props
|
|
195
|
+
}, undefined, false, undefined, this);
|
|
196
|
+
}
|
|
197
|
+
function AlertDialogPortal({ ...props }) {
|
|
198
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Portal, {
|
|
199
|
+
"data-slot": "alert-dialog-portal",
|
|
200
|
+
...props
|
|
201
|
+
}, undefined, false, undefined, this);
|
|
202
|
+
}
|
|
203
|
+
function AlertDialogOverlay({
|
|
204
|
+
className,
|
|
205
|
+
...props
|
|
206
|
+
}) {
|
|
207
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Backdrop, {
|
|
208
|
+
"data-slot": "alert-dialog-overlay",
|
|
209
|
+
className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
210
|
+
...props
|
|
211
|
+
}, undefined, false, undefined, this);
|
|
212
|
+
}
|
|
213
|
+
function AlertDialogContent({
|
|
214
|
+
className,
|
|
215
|
+
size = "default",
|
|
216
|
+
...props
|
|
217
|
+
}) {
|
|
218
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPortal, {
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ jsxDEV3(AlertDialogOverlay, {}, undefined, false, undefined, this),
|
|
221
|
+
/* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Popup, {
|
|
222
|
+
"data-slot": "alert-dialog-content",
|
|
223
|
+
"data-size": size,
|
|
224
|
+
className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
225
|
+
...props
|
|
226
|
+
}, undefined, false, undefined, this)
|
|
227
|
+
]
|
|
228
|
+
}, undefined, true, undefined, this);
|
|
229
|
+
}
|
|
230
|
+
function AlertDialogHeader({
|
|
231
|
+
className,
|
|
232
|
+
...props
|
|
233
|
+
}) {
|
|
234
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
235
|
+
"data-slot": "alert-dialog-header",
|
|
236
|
+
className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
|
|
237
|
+
...props
|
|
238
|
+
}, undefined, false, undefined, this);
|
|
239
|
+
}
|
|
240
|
+
function AlertDialogFooter({
|
|
241
|
+
className,
|
|
242
|
+
...props
|
|
243
|
+
}) {
|
|
244
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
245
|
+
"data-slot": "alert-dialog-footer",
|
|
246
|
+
className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
|
|
247
|
+
...props
|
|
248
|
+
}, undefined, false, undefined, this);
|
|
249
|
+
}
|
|
250
|
+
function AlertDialogTitle({
|
|
251
|
+
className,
|
|
252
|
+
...props
|
|
253
|
+
}) {
|
|
254
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Title, {
|
|
255
|
+
"data-slot": "alert-dialog-title",
|
|
256
|
+
className: cn("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
257
|
+
...props
|
|
258
|
+
}, undefined, false, undefined, this);
|
|
259
|
+
}
|
|
260
|
+
function AlertDialogDescription({
|
|
261
|
+
className,
|
|
262
|
+
...props
|
|
263
|
+
}) {
|
|
264
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Description, {
|
|
265
|
+
"data-slot": "alert-dialog-description",
|
|
266
|
+
className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
267
|
+
...props
|
|
268
|
+
}, undefined, false, undefined, this);
|
|
269
|
+
}
|
|
270
|
+
function AlertDialogAction({
|
|
271
|
+
className,
|
|
272
|
+
...props
|
|
273
|
+
}) {
|
|
274
|
+
return /* @__PURE__ */ jsxDEV3(Button, {
|
|
275
|
+
"data-slot": "alert-dialog-action",
|
|
276
|
+
className: cn(className),
|
|
277
|
+
...props
|
|
278
|
+
}, undefined, false, undefined, this);
|
|
279
|
+
}
|
|
280
|
+
function AlertDialogCancel({
|
|
281
|
+
className,
|
|
282
|
+
variant = "outline",
|
|
283
|
+
size = "default",
|
|
284
|
+
...props
|
|
285
|
+
}) {
|
|
286
|
+
return /* @__PURE__ */ jsxDEV3(AlertDialogPrimitive.Close, {
|
|
287
|
+
"data-slot": "alert-dialog-cancel",
|
|
288
|
+
className: cn(className),
|
|
289
|
+
render: /* @__PURE__ */ jsxDEV3(Button, {
|
|
290
|
+
variant,
|
|
291
|
+
size
|
|
292
|
+
}, undefined, false, undefined, this),
|
|
293
|
+
...props
|
|
294
|
+
}, undefined, false, undefined, this);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// ../../src/components/ui/checkbox.tsx
|
|
298
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
299
|
+
import { CheckIcon as CheckIcon2 } from "lucide-react";
|
|
300
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
301
|
+
"use client";
|
|
302
|
+
function Checkbox({ className, ...props }) {
|
|
303
|
+
return /* @__PURE__ */ jsxDEV4(CheckboxPrimitive.Root, {
|
|
304
|
+
"data-slot": "checkbox",
|
|
305
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className),
|
|
306
|
+
...props,
|
|
307
|
+
children: /* @__PURE__ */ jsxDEV4(CheckboxPrimitive.Indicator, {
|
|
308
|
+
"data-slot": "checkbox-indicator",
|
|
309
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
310
|
+
children: /* @__PURE__ */ jsxDEV4(CheckIcon2, {}, undefined, false, undefined, this)
|
|
311
|
+
}, undefined, false, undefined, this)
|
|
312
|
+
}, undefined, false, undefined, this);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// ../../src/components/ui/input.tsx
|
|
316
|
+
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
317
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
318
|
+
function Input({ className, type, ...props }) {
|
|
319
|
+
return /* @__PURE__ */ jsxDEV5(InputPrimitive, {
|
|
320
|
+
type,
|
|
321
|
+
"data-slot": "input",
|
|
322
|
+
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
323
|
+
...props
|
|
324
|
+
}, undefined, false, undefined, this);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// ../../src/components/ui/file-picker.tsx
|
|
328
|
+
import {
|
|
329
|
+
useEffect,
|
|
330
|
+
useMemo,
|
|
331
|
+
useRef,
|
|
332
|
+
useState
|
|
333
|
+
} from "react";
|
|
334
|
+
import { CloudUpload, FileIcon, FileUp, RefreshCw, Trash2 } from "lucide-react";
|
|
335
|
+
|
|
336
|
+
// ../../src/components/ui/attachment.tsx
|
|
337
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
338
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
339
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
340
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
341
|
+
var attachmentVariants = cva2("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
|
|
342
|
+
variants: {
|
|
343
|
+
size: {
|
|
344
|
+
default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
345
|
+
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
346
|
+
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
|
|
347
|
+
},
|
|
348
|
+
orientation: {
|
|
349
|
+
horizontal: "min-w-40 items-center",
|
|
350
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
function Attachment({
|
|
355
|
+
className,
|
|
356
|
+
state = "done",
|
|
357
|
+
size = "default",
|
|
358
|
+
orientation = "horizontal",
|
|
359
|
+
...props
|
|
360
|
+
}) {
|
|
361
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
362
|
+
"data-slot": "attachment",
|
|
363
|
+
"data-state": state,
|
|
364
|
+
"data-size": size,
|
|
365
|
+
"data-orientation": orientation,
|
|
366
|
+
className: cn(attachmentVariants({ size, orientation }), className),
|
|
367
|
+
...props
|
|
368
|
+
}, undefined, false, undefined, this);
|
|
369
|
+
}
|
|
370
|
+
var attachmentMediaVariants = cva2("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
|
|
371
|
+
variants: {
|
|
372
|
+
variant: {
|
|
373
|
+
icon: "",
|
|
374
|
+
image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
defaultVariants: {
|
|
378
|
+
variant: "icon"
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
function AttachmentMedia({
|
|
382
|
+
className,
|
|
383
|
+
variant = "icon",
|
|
384
|
+
...props
|
|
385
|
+
}) {
|
|
386
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
387
|
+
"data-slot": "attachment-media",
|
|
388
|
+
"data-variant": variant,
|
|
389
|
+
className: cn(attachmentMediaVariants({ variant }), className),
|
|
390
|
+
...props
|
|
391
|
+
}, undefined, false, undefined, this);
|
|
392
|
+
}
|
|
393
|
+
function AttachmentContent({
|
|
394
|
+
className,
|
|
395
|
+
...props
|
|
396
|
+
}) {
|
|
397
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
398
|
+
"data-slot": "attachment-content",
|
|
399
|
+
className: cn("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className),
|
|
400
|
+
...props
|
|
401
|
+
}, undefined, false, undefined, this);
|
|
402
|
+
}
|
|
403
|
+
function AttachmentTitle({
|
|
404
|
+
className,
|
|
405
|
+
...props
|
|
406
|
+
}) {
|
|
407
|
+
return /* @__PURE__ */ jsxDEV6("span", {
|
|
408
|
+
"data-slot": "attachment-title",
|
|
409
|
+
className: cn("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer", className),
|
|
410
|
+
...props
|
|
411
|
+
}, undefined, false, undefined, this);
|
|
412
|
+
}
|
|
413
|
+
function AttachmentDescription({
|
|
414
|
+
className,
|
|
415
|
+
...props
|
|
416
|
+
}) {
|
|
417
|
+
return /* @__PURE__ */ jsxDEV6("span", {
|
|
418
|
+
"data-slot": "attachment-description",
|
|
419
|
+
className: cn("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", "max-w-full", className),
|
|
420
|
+
...props
|
|
421
|
+
}, undefined, false, undefined, this);
|
|
422
|
+
}
|
|
423
|
+
function AttachmentActions({
|
|
424
|
+
className,
|
|
425
|
+
...props
|
|
426
|
+
}) {
|
|
427
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
428
|
+
"data-slot": "attachment-actions",
|
|
429
|
+
className: cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", className),
|
|
430
|
+
...props
|
|
431
|
+
}, undefined, false, undefined, this);
|
|
432
|
+
}
|
|
433
|
+
function AttachmentAction({
|
|
434
|
+
className,
|
|
435
|
+
variant,
|
|
436
|
+
size = "icon-xs",
|
|
437
|
+
...props
|
|
438
|
+
}) {
|
|
439
|
+
return /* @__PURE__ */ jsxDEV6(Button, {
|
|
440
|
+
"data-slot": "attachment-action",
|
|
441
|
+
variant: variant ?? "ghost",
|
|
442
|
+
size,
|
|
443
|
+
className: cn(className),
|
|
444
|
+
...props
|
|
445
|
+
}, undefined, false, undefined, this);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// ../../src/paraglide/runtime.js
|
|
449
|
+
import"@inlang/paraglide-js/urlpattern-polyfill";
|
|
450
|
+
var baseLocale = "en";
|
|
451
|
+
var locales = ["en", "fr"];
|
|
452
|
+
var cookieName = "locale";
|
|
453
|
+
var cookieMaxAge = 34560000;
|
|
454
|
+
var cookieDomain = "";
|
|
455
|
+
var localStorageKey = "PARAGLIDE_LOCALE";
|
|
456
|
+
var strategy = [
|
|
457
|
+
"url",
|
|
458
|
+
"cookie",
|
|
459
|
+
"preferredLanguage",
|
|
460
|
+
"baseLocale"
|
|
461
|
+
];
|
|
462
|
+
var routeStrategies = [
|
|
463
|
+
{
|
|
464
|
+
match: "/api/:path(.*)?",
|
|
465
|
+
exclude: true
|
|
466
|
+
}
|
|
467
|
+
];
|
|
468
|
+
var urlPatterns = [
|
|
469
|
+
{
|
|
470
|
+
pattern: "/:path(.*)?",
|
|
471
|
+
localized: [
|
|
472
|
+
[
|
|
473
|
+
"en",
|
|
474
|
+
"/en/:path(.*)?"
|
|
475
|
+
],
|
|
476
|
+
[
|
|
477
|
+
"fr",
|
|
478
|
+
"/fr/:path(.*)?"
|
|
479
|
+
]
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
];
|
|
483
|
+
var cachedRouteStrategyUrl;
|
|
484
|
+
var cachedRouteStrategy;
|
|
485
|
+
function findMatchingRouteStrategy(url) {
|
|
486
|
+
if (routeStrategies.length === 0) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const urlString = typeof url === "string" ? url : url.href;
|
|
490
|
+
if (cachedRouteStrategyUrl === urlString) {
|
|
491
|
+
return cachedRouteStrategy;
|
|
492
|
+
}
|
|
493
|
+
const urlObject = new URL(urlString, "http://dummy.com");
|
|
494
|
+
let match;
|
|
495
|
+
for (const routeStrategy of routeStrategies) {
|
|
496
|
+
const pattern = new URLPattern(routeStrategy.match, urlObject.href);
|
|
497
|
+
if (pattern.exec(urlObject.href)) {
|
|
498
|
+
match = routeStrategy;
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
cachedRouteStrategyUrl = urlString;
|
|
503
|
+
cachedRouteStrategy = match;
|
|
504
|
+
return match;
|
|
505
|
+
}
|
|
506
|
+
function getStrategyForUrl(url) {
|
|
507
|
+
const routeStrategy = findMatchingRouteStrategy(url);
|
|
508
|
+
if (routeStrategy && routeStrategy.exclude !== true && Array.isArray(routeStrategy.strategy)) {
|
|
509
|
+
return routeStrategy.strategy;
|
|
510
|
+
}
|
|
511
|
+
return strategy;
|
|
512
|
+
}
|
|
513
|
+
var serverAsyncLocalStorage = undefined;
|
|
514
|
+
var isServer = import.meta.env?.SSR ?? typeof window === "undefined";
|
|
515
|
+
var experimentalStaticLocale = undefined;
|
|
516
|
+
var TREE_SHAKE_COOKIE_STRATEGY_USED = true;
|
|
517
|
+
var TREE_SHAKE_URL_STRATEGY_USED = true;
|
|
518
|
+
var TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = false;
|
|
519
|
+
var TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = true;
|
|
520
|
+
var TREE_SHAKE_DEFAULT_URL_PATTERN_USED = false;
|
|
521
|
+
var TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;
|
|
522
|
+
globalThis.__paraglide = globalThis.__paraglide ?? {};
|
|
523
|
+
globalThis.__paraglide.ssr = globalThis.__paraglide.ssr ?? {};
|
|
524
|
+
var _locale;
|
|
525
|
+
var localeInitiallySet = false;
|
|
526
|
+
var getLocale = () => {
|
|
527
|
+
if (experimentalStaticLocale !== undefined) {
|
|
528
|
+
return experimentalStaticLocale;
|
|
529
|
+
}
|
|
530
|
+
if (serverAsyncLocalStorage) {
|
|
531
|
+
const locale = serverAsyncLocalStorage?.getStore()?.locale;
|
|
532
|
+
if (locale) {
|
|
533
|
+
return locale;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
let strategyToUse = strategy;
|
|
537
|
+
if (!isServer && typeof window !== "undefined" && window.location?.href) {
|
|
538
|
+
strategyToUse = getStrategyForUrl(window.location.href);
|
|
539
|
+
}
|
|
540
|
+
const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== "undefined" ? window.location?.href : undefined);
|
|
541
|
+
if (resolved) {
|
|
542
|
+
if (!localeInitiallySet) {
|
|
543
|
+
_locale = resolved;
|
|
544
|
+
localeInitiallySet = true;
|
|
545
|
+
setLocale(resolved, { reload: false });
|
|
546
|
+
}
|
|
547
|
+
return resolved;
|
|
548
|
+
}
|
|
549
|
+
throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
|
|
550
|
+
};
|
|
551
|
+
function resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {
|
|
552
|
+
let locale;
|
|
553
|
+
for (const strat of strategyToUse) {
|
|
554
|
+
if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
555
|
+
locale = extractLocaleFromCookie();
|
|
556
|
+
} else if (strat === "baseLocale") {
|
|
557
|
+
locale = baseLocale;
|
|
558
|
+
} else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && !isServer && typeof urlForUrlStrategy === "string") {
|
|
559
|
+
locale = extractLocaleFromUrl(urlForUrlStrategy);
|
|
560
|
+
} else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable" && _locale !== undefined) {
|
|
561
|
+
locale = _locale;
|
|
562
|
+
} else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED && strat === "preferredLanguage" && !isServer) {
|
|
563
|
+
locale = extractLocaleFromNavigator();
|
|
564
|
+
} else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && !isServer) {
|
|
565
|
+
locale = localStorage.getItem(localStorageKey) ?? undefined;
|
|
566
|
+
} else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
567
|
+
const handler = customClientStrategies.get(strat);
|
|
568
|
+
if (handler) {
|
|
569
|
+
const result = handler.getLocale();
|
|
570
|
+
if (result instanceof Promise) {
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
if (result !== undefined) {
|
|
574
|
+
return assertIsLocale(result);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
const matchedLocale = toLocale(locale);
|
|
579
|
+
if (matchedLocale) {
|
|
580
|
+
return matchedLocale;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
var rtlLanguages = new Set([
|
|
586
|
+
"ar",
|
|
587
|
+
"dv",
|
|
588
|
+
"fa",
|
|
589
|
+
"he",
|
|
590
|
+
"ks",
|
|
591
|
+
"ku",
|
|
592
|
+
"ps",
|
|
593
|
+
"sd",
|
|
594
|
+
"ug",
|
|
595
|
+
"ur",
|
|
596
|
+
"yi"
|
|
597
|
+
]);
|
|
598
|
+
var navigateOrReload = (newLocation) => {
|
|
599
|
+
if (newLocation) {
|
|
600
|
+
window.location.href = newLocation;
|
|
601
|
+
} else {
|
|
602
|
+
window.location.reload();
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
var setLocale = (newLocale, options) => {
|
|
606
|
+
const optionsWithDefaults = {
|
|
607
|
+
reload: true,
|
|
608
|
+
...options
|
|
609
|
+
};
|
|
610
|
+
let currentLocale;
|
|
611
|
+
try {
|
|
612
|
+
currentLocale = getLocale();
|
|
613
|
+
} catch {}
|
|
614
|
+
const customSetLocalePromises = [];
|
|
615
|
+
let newLocation = undefined;
|
|
616
|
+
let strategyToUse = strategy;
|
|
617
|
+
if (!isServer && typeof window !== "undefined" && window.location?.href) {
|
|
618
|
+
strategyToUse = getStrategyForUrl(window.location.href);
|
|
619
|
+
}
|
|
620
|
+
for (const strat of strategyToUse) {
|
|
621
|
+
if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable") {
|
|
622
|
+
_locale = newLocale;
|
|
623
|
+
} else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
624
|
+
if (isServer || typeof document === "undefined" || typeof window === "undefined") {
|
|
625
|
+
continue;
|
|
626
|
+
}
|
|
627
|
+
const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;
|
|
628
|
+
document.cookie = cookieDomain ? `${cookieString}; domain=${cookieDomain}` : cookieString;
|
|
629
|
+
} else if (strat === "baseLocale") {
|
|
630
|
+
continue;
|
|
631
|
+
} else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && typeof window !== "undefined") {
|
|
632
|
+
newLocation = localizeUrl(window.location.href, {
|
|
633
|
+
locale: newLocale
|
|
634
|
+
}).href;
|
|
635
|
+
} else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && typeof window !== "undefined") {
|
|
636
|
+
localStorage.setItem(localStorageKey, newLocale);
|
|
637
|
+
} else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
638
|
+
const handler = customClientStrategies.get(strat);
|
|
639
|
+
if (handler) {
|
|
640
|
+
let result = handler.setLocale(newLocale);
|
|
641
|
+
if (result instanceof Promise) {
|
|
642
|
+
result = result.catch((error) => {
|
|
643
|
+
throw new Error(`Custom strategy "${strat}" setLocale failed.`, {
|
|
644
|
+
cause: error
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
customSetLocalePromises.push(result);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
const runReload = () => {
|
|
653
|
+
if (!isServer && optionsWithDefaults.reload && window.location && newLocale !== currentLocale) {
|
|
654
|
+
navigateOrReload(newLocation);
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
if (customSetLocalePromises.length) {
|
|
658
|
+
return Promise.all(customSetLocalePromises).then(() => {
|
|
659
|
+
runReload();
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
runReload();
|
|
663
|
+
return;
|
|
664
|
+
};
|
|
665
|
+
var getUrlOrigin = () => {
|
|
666
|
+
if (serverAsyncLocalStorage) {
|
|
667
|
+
return serverAsyncLocalStorage.getStore()?.origin ?? "http://fallback.com";
|
|
668
|
+
} else if (typeof window !== "undefined") {
|
|
669
|
+
return window.location.origin;
|
|
670
|
+
}
|
|
671
|
+
return "http://fallback.com";
|
|
672
|
+
};
|
|
673
|
+
function toLocale(value) {
|
|
674
|
+
if (typeof value !== "string") {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
const lowerValue = value.toLowerCase();
|
|
678
|
+
for (const locale of locales) {
|
|
679
|
+
if (locale.toLowerCase() === lowerValue) {
|
|
680
|
+
return locale;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
function assertIsLocale(input) {
|
|
686
|
+
const locale = toLocale(input);
|
|
687
|
+
if (locale)
|
|
688
|
+
return locale;
|
|
689
|
+
throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(", ")}`);
|
|
690
|
+
}
|
|
691
|
+
function extractLocaleFromCookie() {
|
|
692
|
+
if (typeof document === "undefined" || !document.cookie) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
const match = document.cookie.match(new RegExp(`(^| )${cookieName}=([^;]+)`));
|
|
696
|
+
const locale = match?.[2];
|
|
697
|
+
return toLocale(locale);
|
|
698
|
+
}
|
|
699
|
+
function extractLocaleFromNavigator() {
|
|
700
|
+
if (!navigator?.languages?.length) {
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
const languages = navigator.languages.map((lang) => ({
|
|
704
|
+
fullTag: lang,
|
|
705
|
+
baseTag: lang.split("-")[0]
|
|
706
|
+
}));
|
|
707
|
+
for (const lang of languages) {
|
|
708
|
+
const fullLocale = toLocale(lang.fullTag);
|
|
709
|
+
if (fullLocale) {
|
|
710
|
+
return fullLocale;
|
|
711
|
+
}
|
|
712
|
+
const baseLocale2 = toLocale(lang.baseTag);
|
|
713
|
+
if (baseLocale2) {
|
|
714
|
+
return baseLocale2;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
var cachedUrl;
|
|
720
|
+
var cachedLocale;
|
|
721
|
+
function extractLocaleFromUrl(url) {
|
|
722
|
+
const urlString = typeof url === "string" ? url : url.href;
|
|
723
|
+
if (cachedUrl === urlString) {
|
|
724
|
+
return cachedLocale;
|
|
725
|
+
}
|
|
726
|
+
let result;
|
|
727
|
+
if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
|
|
728
|
+
result = defaultUrlPatternExtractLocale(url);
|
|
729
|
+
} else {
|
|
730
|
+
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
731
|
+
for (const element of urlPatterns) {
|
|
732
|
+
for (const [locale, localizedPattern] of element.localized) {
|
|
733
|
+
const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
|
|
734
|
+
if (match) {
|
|
735
|
+
result = locale;
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
if (result)
|
|
740
|
+
break;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
cachedUrl = urlString;
|
|
744
|
+
cachedLocale = result;
|
|
745
|
+
return result;
|
|
746
|
+
}
|
|
747
|
+
function defaultUrlPatternExtractLocale(url) {
|
|
748
|
+
const urlObj = new URL(url, "http://dummy.com");
|
|
749
|
+
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
750
|
+
return toLocale(pathSegments[0]) || baseLocale;
|
|
751
|
+
}
|
|
752
|
+
function localizeUrl(url, options) {
|
|
753
|
+
const targetLocale = options?.locale ? assertIsLocale(options?.locale) : getLocale();
|
|
754
|
+
if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
|
|
755
|
+
return localizeUrlDefaultPattern(url, targetLocale);
|
|
756
|
+
}
|
|
757
|
+
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
758
|
+
for (const element of urlPatterns) {
|
|
759
|
+
for (const [, localizedPattern] of element.localized) {
|
|
760
|
+
const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
|
|
761
|
+
if (!match) {
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
|
|
765
|
+
if (!targetPattern) {
|
|
766
|
+
continue;
|
|
767
|
+
}
|
|
768
|
+
const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);
|
|
769
|
+
return fillMissingUrlParts(localizedUrl, match);
|
|
770
|
+
}
|
|
771
|
+
const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);
|
|
772
|
+
if (unlocalizedMatch) {
|
|
773
|
+
const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
|
|
774
|
+
if (targetPattern) {
|
|
775
|
+
const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);
|
|
776
|
+
return fillMissingUrlParts(localizedUrl, unlocalizedMatch);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return urlObj;
|
|
781
|
+
}
|
|
782
|
+
function localizeUrlDefaultPattern(url, locale) {
|
|
783
|
+
const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
|
|
784
|
+
const currentLocale = extractLocaleFromUrl(urlObj);
|
|
785
|
+
if (currentLocale === locale) {
|
|
786
|
+
return urlObj;
|
|
787
|
+
}
|
|
788
|
+
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
789
|
+
if (pathSegments.length > 0 && toLocale(pathSegments[0])) {
|
|
790
|
+
pathSegments.shift();
|
|
791
|
+
}
|
|
792
|
+
if (locale === baseLocale) {
|
|
793
|
+
urlObj.pathname = "/" + pathSegments.join("/");
|
|
794
|
+
} else {
|
|
795
|
+
urlObj.pathname = "/" + locale + "/" + pathSegments.join("/");
|
|
796
|
+
}
|
|
797
|
+
return urlObj;
|
|
798
|
+
}
|
|
799
|
+
function fillMissingUrlParts(url, match) {
|
|
800
|
+
if (match.protocol.groups["0"]) {
|
|
801
|
+
url.protocol = match.protocol.groups["0"] ?? "";
|
|
802
|
+
}
|
|
803
|
+
if (match.hostname.groups["0"]) {
|
|
804
|
+
url.hostname = match.hostname.groups["0"] ?? "";
|
|
805
|
+
}
|
|
806
|
+
if (match.username.groups["0"]) {
|
|
807
|
+
url.username = match.username.groups["0"] ?? "";
|
|
808
|
+
}
|
|
809
|
+
if (match.password.groups["0"]) {
|
|
810
|
+
url.password = match.password.groups["0"] ?? "";
|
|
811
|
+
}
|
|
812
|
+
if (match.port.groups["0"]) {
|
|
813
|
+
url.port = match.port.groups["0"] ?? "";
|
|
814
|
+
}
|
|
815
|
+
if (match.pathname.groups["0"]) {
|
|
816
|
+
url.pathname = match.pathname.groups["0"] ?? "";
|
|
817
|
+
}
|
|
818
|
+
if (match.search.groups["0"]) {
|
|
819
|
+
url.search = match.search.groups["0"] ?? "";
|
|
820
|
+
}
|
|
821
|
+
if (match.hash.groups["0"]) {
|
|
822
|
+
url.hash = match.hash.groups["0"] ?? "";
|
|
823
|
+
}
|
|
824
|
+
return url;
|
|
825
|
+
}
|
|
826
|
+
function fillPattern(pattern, values, origin) {
|
|
827
|
+
let processedPattern = pattern.replace(/(https?:\/\/[^:/]+):(\d+)(\/|$)/g, (_, protocol, port, slash) => {
|
|
828
|
+
return `${protocol}#PORT-${port}#${slash}`;
|
|
829
|
+
});
|
|
830
|
+
let processedGroupDelimiters = processedPattern.replace(/\{([^{}]*)\}([?+*]?)/g, (_, content, modifier) => {
|
|
831
|
+
if (modifier === "?") {
|
|
832
|
+
return content;
|
|
833
|
+
}
|
|
834
|
+
return content;
|
|
835
|
+
});
|
|
836
|
+
let filled = processedGroupDelimiters.replace(/(\/?):([a-zA-Z0-9_]+)(\([^)]*\))?([?+*]?)/g, (_, slash, name, __, modifier) => {
|
|
837
|
+
const value = values[name];
|
|
838
|
+
if (value === null) {
|
|
839
|
+
return "";
|
|
840
|
+
}
|
|
841
|
+
if (modifier === "?") {
|
|
842
|
+
return value !== undefined ? `${slash}${value}` : "";
|
|
843
|
+
}
|
|
844
|
+
if (modifier === "+" || modifier === "*") {
|
|
845
|
+
if (value === undefined && modifier === "+") {
|
|
846
|
+
throw new Error(`Missing value for "${name}" (one or more required)`);
|
|
847
|
+
}
|
|
848
|
+
return value ? `${slash}${value}` : "";
|
|
849
|
+
}
|
|
850
|
+
if (value === undefined) {
|
|
851
|
+
throw new Error(`Missing value for "${name}"`);
|
|
852
|
+
}
|
|
853
|
+
return `${slash}${value}`;
|
|
854
|
+
});
|
|
855
|
+
filled = filled.replace(/#PORT-(\d+)#/g, ":$1");
|
|
856
|
+
return new URL(filled, origin);
|
|
857
|
+
}
|
|
858
|
+
function aggregateGroups(match) {
|
|
859
|
+
return {
|
|
860
|
+
...match.hash.groups,
|
|
861
|
+
...match.hostname.groups,
|
|
862
|
+
...match.password.groups,
|
|
863
|
+
...match.pathname.groups,
|
|
864
|
+
...match.port.groups,
|
|
865
|
+
...match.protocol.groups,
|
|
866
|
+
...match.search.groups,
|
|
867
|
+
...match.username.groups
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
var customServerStrategies = new Map;
|
|
871
|
+
var customClientStrategies = new Map;
|
|
872
|
+
function isCustomStrategy(strategy2) {
|
|
873
|
+
return typeof strategy2 === "string" && /^custom-[A-Za-z0-9_-]+$/.test(strategy2);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// ../../src/components/ui/file-picker.tsx
|
|
877
|
+
import { jsxDEV as jsxDEV7, Fragment } from "react/jsx-dev-runtime";
|
|
878
|
+
"use client";
|
|
879
|
+
var messages = {
|
|
880
|
+
en: {
|
|
881
|
+
accepts: (accepts) => `Accepts: ${accepts}`,
|
|
882
|
+
chooseFile: "Choose file",
|
|
883
|
+
deleteFile: "Delete",
|
|
884
|
+
dropFile: "Drag and drop a file here",
|
|
885
|
+
replaceFile: "Replace file"
|
|
886
|
+
},
|
|
887
|
+
fr: {
|
|
888
|
+
accepts: (accepts) => `Accepte : ${accepts}`,
|
|
889
|
+
chooseFile: "Choisir un fichier",
|
|
890
|
+
deleteFile: "Supprimer",
|
|
891
|
+
dropFile: "Glissez-déposez un fichier ici",
|
|
892
|
+
replaceFile: "Remplacer le fichier"
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
var filePickerMessages = (overrides) => ({
|
|
896
|
+
...getLocale().startsWith("fr") ? messages.fr : messages.en,
|
|
897
|
+
...overrides
|
|
898
|
+
});
|
|
899
|
+
var formatBytes = (bytes) => {
|
|
900
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
901
|
+
if (bytes === 0)
|
|
902
|
+
return "0 Bytes";
|
|
903
|
+
const index = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), sizes.length - 1);
|
|
904
|
+
if (index === 0)
|
|
905
|
+
return `${bytes} ${sizes[index]}`;
|
|
906
|
+
return `${(bytes / 1024 ** index).toFixed(1)} ${sizes[index]}`;
|
|
907
|
+
};
|
|
908
|
+
var fileDescription = (file) => [
|
|
909
|
+
file.type || file.name.split(".").pop()?.toUpperCase(),
|
|
910
|
+
formatBytes(file.size)
|
|
911
|
+
].filter(Boolean).join(" · ");
|
|
912
|
+
var FilePicker = ({
|
|
913
|
+
accept = "",
|
|
914
|
+
canClear = false,
|
|
915
|
+
file,
|
|
916
|
+
id,
|
|
917
|
+
image,
|
|
918
|
+
invalid = false,
|
|
919
|
+
messages: messages2,
|
|
920
|
+
name,
|
|
921
|
+
onBlur,
|
|
922
|
+
onChange,
|
|
923
|
+
onClear,
|
|
924
|
+
required,
|
|
925
|
+
title
|
|
926
|
+
}) => {
|
|
927
|
+
const labels = filePickerMessages(messages2);
|
|
928
|
+
const inputRef = useRef(null);
|
|
929
|
+
const dragDepthRef = useRef(0);
|
|
930
|
+
const [dragging, setDragging] = useState(false);
|
|
931
|
+
const imageEnabled = image !== undefined;
|
|
932
|
+
const objectUrl = useMemo(() => file && imageEnabled ? URL.createObjectURL(file) : undefined, [file, imageEnabled]);
|
|
933
|
+
useEffect(() => () => {
|
|
934
|
+
if (objectUrl)
|
|
935
|
+
URL.revokeObjectURL(objectUrl);
|
|
936
|
+
}, [objectUrl]);
|
|
937
|
+
const imageUrl = objectUrl ?? image?.src;
|
|
938
|
+
const selected = Boolean(file || imageUrl);
|
|
939
|
+
const selectFile = (nextFile) => {
|
|
940
|
+
if (nextFile)
|
|
941
|
+
onChange(nextFile);
|
|
942
|
+
};
|
|
943
|
+
const handleDrop = (event) => {
|
|
944
|
+
event.preventDefault();
|
|
945
|
+
dragDepthRef.current = 0;
|
|
946
|
+
setDragging(false);
|
|
947
|
+
if (inputRef.current)
|
|
948
|
+
inputRef.current.files = event.dataTransfer.files;
|
|
949
|
+
selectFile(event.dataTransfer.files[0]);
|
|
950
|
+
onBlur?.();
|
|
951
|
+
};
|
|
952
|
+
const clear = () => {
|
|
953
|
+
onClear();
|
|
954
|
+
if (inputRef.current)
|
|
955
|
+
inputRef.current.value = "";
|
|
956
|
+
};
|
|
957
|
+
const input = /* @__PURE__ */ jsxDEV7(Input, {
|
|
958
|
+
ref: inputRef,
|
|
959
|
+
className: "sr-only",
|
|
960
|
+
id,
|
|
961
|
+
name,
|
|
962
|
+
type: "file",
|
|
963
|
+
accept,
|
|
964
|
+
required,
|
|
965
|
+
onBlur,
|
|
966
|
+
onChange: (event) => selectFile(event.target.files?.[0]),
|
|
967
|
+
"aria-invalid": invalid
|
|
968
|
+
}, undefined, false, undefined, this);
|
|
969
|
+
if (!selected) {
|
|
970
|
+
return /* @__PURE__ */ jsxDEV7("div", {
|
|
971
|
+
className: "bg-muted/30 data-[dragging=true]:bg-muted flex min-h-32 flex-col items-center justify-center gap-3 rounded-xl border border-dashed p-6 text-center transition-colors",
|
|
972
|
+
"data-dragging": dragging,
|
|
973
|
+
onDragEnter: (event) => {
|
|
974
|
+
event.preventDefault();
|
|
975
|
+
dragDepthRef.current += 1;
|
|
976
|
+
setDragging(true);
|
|
977
|
+
},
|
|
978
|
+
onDragLeave: (event) => {
|
|
979
|
+
event.preventDefault();
|
|
980
|
+
dragDepthRef.current -= 1;
|
|
981
|
+
if (dragDepthRef.current <= 0) {
|
|
982
|
+
dragDepthRef.current = 0;
|
|
983
|
+
setDragging(false);
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
onDragOver: (event) => event.preventDefault(),
|
|
987
|
+
onDrop: handleDrop,
|
|
988
|
+
children: [
|
|
989
|
+
/* @__PURE__ */ jsxDEV7(CloudUpload, {
|
|
990
|
+
className: "text-muted-foreground size-6"
|
|
991
|
+
}, undefined, false, undefined, this),
|
|
992
|
+
/* @__PURE__ */ jsxDEV7("div", {
|
|
993
|
+
children: [
|
|
994
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
995
|
+
className: "text-sm font-medium",
|
|
996
|
+
children: labels.dropFile
|
|
997
|
+
}, undefined, false, undefined, this),
|
|
998
|
+
/* @__PURE__ */ jsxDEV7("p", {
|
|
999
|
+
className: "text-muted-foreground text-xs",
|
|
1000
|
+
children: labels.accepts(accept)
|
|
1001
|
+
}, undefined, false, undefined, this)
|
|
1002
|
+
]
|
|
1003
|
+
}, undefined, true, undefined, this),
|
|
1004
|
+
/* @__PURE__ */ jsxDEV7(Button, {
|
|
1005
|
+
type: "button",
|
|
1006
|
+
variant: "outline",
|
|
1007
|
+
onClick: () => inputRef.current?.click(),
|
|
1008
|
+
children: [
|
|
1009
|
+
/* @__PURE__ */ jsxDEV7(FileUp, {
|
|
1010
|
+
"data-icon": "inline-start"
|
|
1011
|
+
}, undefined, false, undefined, this),
|
|
1012
|
+
labels.chooseFile
|
|
1013
|
+
]
|
|
1014
|
+
}, undefined, true, undefined, this),
|
|
1015
|
+
input
|
|
1016
|
+
]
|
|
1017
|
+
}, undefined, true, undefined, this);
|
|
1018
|
+
}
|
|
1019
|
+
return /* @__PURE__ */ jsxDEV7(Fragment, {
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ jsxDEV7(Attachment, {
|
|
1022
|
+
className: image ? "w-fit max-w-full" : "w-full",
|
|
1023
|
+
orientation: image ? "vertical" : "horizontal",
|
|
1024
|
+
state: invalid ? "error" : "done",
|
|
1025
|
+
children: [
|
|
1026
|
+
/* @__PURE__ */ jsxDEV7(AttachmentMedia, {
|
|
1027
|
+
variant: image ? "image" : "icon",
|
|
1028
|
+
className: image ? "aspect-auto w-full max-w-full [&_img]:aspect-auto! [&_img]:object-contain!" : undefined,
|
|
1029
|
+
children: image && imageUrl ? /* @__PURE__ */ jsxDEV7("img", {
|
|
1030
|
+
src: imageUrl,
|
|
1031
|
+
alt: image.alt,
|
|
1032
|
+
width: image.width,
|
|
1033
|
+
height: image.height,
|
|
1034
|
+
className: "h-auto max-w-full object-contain",
|
|
1035
|
+
style: { maxHeight: image.height }
|
|
1036
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV7(FileIcon, {}, undefined, false, undefined, this)
|
|
1037
|
+
}, undefined, false, undefined, this),
|
|
1038
|
+
/* @__PURE__ */ jsxDEV7(AttachmentContent, {
|
|
1039
|
+
className: image ? "w-full" : undefined,
|
|
1040
|
+
children: [
|
|
1041
|
+
/* @__PURE__ */ jsxDEV7(AttachmentTitle, {
|
|
1042
|
+
children: title
|
|
1043
|
+
}, undefined, false, undefined, this),
|
|
1044
|
+
file ? /* @__PURE__ */ jsxDEV7(AttachmentDescription, {
|
|
1045
|
+
children: fileDescription(file)
|
|
1046
|
+
}, undefined, false, undefined, this) : null
|
|
1047
|
+
]
|
|
1048
|
+
}, undefined, true, undefined, this),
|
|
1049
|
+
/* @__PURE__ */ jsxDEV7(AttachmentActions, {
|
|
1050
|
+
children: [
|
|
1051
|
+
/* @__PURE__ */ jsxDEV7(AttachmentAction, {
|
|
1052
|
+
type: "button",
|
|
1053
|
+
"aria-label": labels.replaceFile,
|
|
1054
|
+
onClick: () => inputRef.current?.click(),
|
|
1055
|
+
children: /* @__PURE__ */ jsxDEV7(RefreshCw, {}, undefined, false, undefined, this)
|
|
1056
|
+
}, undefined, false, undefined, this),
|
|
1057
|
+
canClear ? /* @__PURE__ */ jsxDEV7(AttachmentAction, {
|
|
1058
|
+
type: "button",
|
|
1059
|
+
"aria-label": `${labels.deleteFile} ${typeof title === "string" ? title : ""}`,
|
|
1060
|
+
onClick: clear,
|
|
1061
|
+
children: /* @__PURE__ */ jsxDEV7(Trash2, {}, undefined, false, undefined, this)
|
|
1062
|
+
}, undefined, false, undefined, this) : null
|
|
1063
|
+
]
|
|
1064
|
+
}, undefined, true, undefined, this)
|
|
1065
|
+
]
|
|
1066
|
+
}, undefined, true, undefined, this),
|
|
1067
|
+
input
|
|
1068
|
+
]
|
|
1069
|
+
}, undefined, true, undefined, this);
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
// ../../src/components/ui/field.tsx
|
|
1073
|
+
import { useMemo as useMemo2 } from "react";
|
|
1074
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
1075
|
+
|
|
1076
|
+
// ../../src/components/ui/label.tsx
|
|
1077
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
1078
|
+
"use client";
|
|
1079
|
+
function Label({ className, ...props }) {
|
|
1080
|
+
return /* @__PURE__ */ jsxDEV8("label", {
|
|
1081
|
+
"data-slot": "label",
|
|
1082
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
1083
|
+
...props
|
|
1084
|
+
}, undefined, false, undefined, this);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
// ../../src/components/ui/separator.tsx
|
|
1088
|
+
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
1089
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
1090
|
+
|
|
1091
|
+
// ../../src/components/ui/field.tsx
|
|
1092
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
1093
|
+
function FieldSet({ className, ...props }) {
|
|
1094
|
+
return /* @__PURE__ */ jsxDEV10("fieldset", {
|
|
1095
|
+
"data-slot": "field-set",
|
|
1096
|
+
className: cn("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
1097
|
+
...props
|
|
1098
|
+
}, undefined, false, undefined, this);
|
|
1099
|
+
}
|
|
1100
|
+
function FieldLegend({
|
|
1101
|
+
className,
|
|
1102
|
+
variant = "legend",
|
|
1103
|
+
...props
|
|
1104
|
+
}) {
|
|
1105
|
+
return /* @__PURE__ */ jsxDEV10("legend", {
|
|
1106
|
+
"data-slot": "field-legend",
|
|
1107
|
+
"data-variant": variant,
|
|
1108
|
+
className: cn("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className),
|
|
1109
|
+
...props
|
|
1110
|
+
}, undefined, false, undefined, this);
|
|
1111
|
+
}
|
|
1112
|
+
function FieldGroup({ className, ...props }) {
|
|
1113
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
|
1114
|
+
"data-slot": "field-group",
|
|
1115
|
+
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
1116
|
+
...props
|
|
1117
|
+
}, undefined, false, undefined, this);
|
|
1118
|
+
}
|
|
1119
|
+
var fieldVariants = cva3("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
1120
|
+
variants: {
|
|
1121
|
+
orientation: {
|
|
1122
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
1123
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
1124
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
defaultVariants: {
|
|
1128
|
+
orientation: "vertical"
|
|
1129
|
+
}
|
|
1130
|
+
});
|
|
1131
|
+
function Field({
|
|
1132
|
+
className,
|
|
1133
|
+
orientation = "vertical",
|
|
1134
|
+
...props
|
|
1135
|
+
}) {
|
|
1136
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
|
1137
|
+
role: "group",
|
|
1138
|
+
"data-slot": "field",
|
|
1139
|
+
"data-orientation": orientation,
|
|
1140
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
1141
|
+
...props
|
|
1142
|
+
}, undefined, false, undefined, this);
|
|
1143
|
+
}
|
|
1144
|
+
function FieldLabel({
|
|
1145
|
+
className,
|
|
1146
|
+
...props
|
|
1147
|
+
}) {
|
|
1148
|
+
return /* @__PURE__ */ jsxDEV10(Label, {
|
|
1149
|
+
"data-slot": "field-label",
|
|
1150
|
+
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
1151
|
+
...props
|
|
1152
|
+
}, undefined, false, undefined, this);
|
|
1153
|
+
}
|
|
1154
|
+
function FieldDescription({ className, ...props }) {
|
|
1155
|
+
return /* @__PURE__ */ jsxDEV10("p", {
|
|
1156
|
+
"data-slot": "field-description",
|
|
1157
|
+
className: cn("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
1158
|
+
...props
|
|
1159
|
+
}, undefined, false, undefined, this);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
// ../../src/components/ui/textarea.tsx
|
|
1163
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
|
1164
|
+
function Textarea({ className, ...props }) {
|
|
1165
|
+
return /* @__PURE__ */ jsxDEV11("textarea", {
|
|
1166
|
+
"data-slot": "textarea",
|
|
1167
|
+
className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
1168
|
+
...props
|
|
1169
|
+
}, undefined, false, undefined, this);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// ../../src/components/ui/badge.tsx
|
|
1173
|
+
import { mergeProps as mergeProps2 } from "@base-ui/react/merge-props";
|
|
1174
|
+
import { useRender as useRender2 } from "@base-ui/react/use-render";
|
|
1175
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1176
|
+
var badgeVariants = cva4("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
1177
|
+
variants: {
|
|
1178
|
+
variant: {
|
|
1179
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
1180
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
1181
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
1182
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
1183
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
1184
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
defaultVariants: {
|
|
1188
|
+
variant: "default"
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
function Badge({
|
|
1192
|
+
className,
|
|
1193
|
+
variant = "default",
|
|
1194
|
+
render,
|
|
1195
|
+
...props
|
|
1196
|
+
}) {
|
|
1197
|
+
return useRender2({
|
|
1198
|
+
defaultTagName: "span",
|
|
1199
|
+
props: mergeProps2({
|
|
1200
|
+
className: cn(badgeVariants({ variant }), className)
|
|
1201
|
+
}, props),
|
|
1202
|
+
render,
|
|
1203
|
+
state: {
|
|
1204
|
+
slot: "badge",
|
|
1205
|
+
variant
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// ../../src/components/ui/virtualized-combobox.tsx
|
|
1211
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
1212
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
1213
|
+
import { Check, ChevronsUpDown } from "lucide-react";
|
|
1214
|
+
import {
|
|
1215
|
+
useCallback,
|
|
1216
|
+
useImperativeHandle,
|
|
1217
|
+
useRef as useRef2
|
|
1218
|
+
} from "react";
|
|
1219
|
+
|
|
1220
|
+
// ../../src/components/ui/input-group.tsx
|
|
1221
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1222
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
1223
|
+
function InputGroup({ className, ...props }) {
|
|
1224
|
+
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1225
|
+
"data-slot": "input-group",
|
|
1226
|
+
role: "group",
|
|
1227
|
+
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
1228
|
+
...props
|
|
1229
|
+
}, undefined, false, undefined, this);
|
|
1230
|
+
}
|
|
1231
|
+
var inputGroupAddonVariants = cva5("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
1232
|
+
variants: {
|
|
1233
|
+
align: {
|
|
1234
|
+
"inline-start": "order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]",
|
|
1235
|
+
"inline-end": "order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]",
|
|
1236
|
+
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
1237
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
defaultVariants: { align: "inline-start" }
|
|
1241
|
+
});
|
|
1242
|
+
var inputGroupButtonVariants = cva5("flex items-center gap-2 text-sm shadow-none", {
|
|
1243
|
+
variants: {
|
|
1244
|
+
size: {
|
|
1245
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
1246
|
+
sm: "",
|
|
1247
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
1248
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
defaultVariants: { size: "xs" }
|
|
1252
|
+
});
|
|
1253
|
+
function InputGroupInput({
|
|
1254
|
+
className,
|
|
1255
|
+
...props
|
|
1256
|
+
}) {
|
|
1257
|
+
return /* @__PURE__ */ jsxDEV12(Input, {
|
|
1258
|
+
"data-slot": "input-group-control",
|
|
1259
|
+
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
1260
|
+
...props
|
|
1261
|
+
}, undefined, false, undefined, this);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
// ../../src/components/ui/virtualized-combobox.tsx
|
|
1265
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
|
1266
|
+
"use client";
|
|
1267
|
+
var messages2 = {
|
|
1268
|
+
en: {
|
|
1269
|
+
search: "Search...",
|
|
1270
|
+
selected: (count) => `${count} selected`,
|
|
1271
|
+
selectMore: "Select more"
|
|
1272
|
+
},
|
|
1273
|
+
fr: {
|
|
1274
|
+
search: "Rechercher...",
|
|
1275
|
+
selected: (count) => `${count} sélectionnés`,
|
|
1276
|
+
selectMore: "Sélectionner davantage"
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
var virtualizedComboboxMessages = (overrides) => ({
|
|
1280
|
+
...getLocale().startsWith("fr") ? messages2.fr : messages2.en,
|
|
1281
|
+
...overrides
|
|
1282
|
+
});
|
|
1283
|
+
var optionEquals = (item, selected) => item.value === selected.value;
|
|
1284
|
+
var VirtualizedComboboxList = ({
|
|
1285
|
+
emptyLabel,
|
|
1286
|
+
groupSelections,
|
|
1287
|
+
messages: messageOverrides,
|
|
1288
|
+
renderItem,
|
|
1289
|
+
selectedValues,
|
|
1290
|
+
virtualizerRef
|
|
1291
|
+
}) => {
|
|
1292
|
+
const filteredItems = ComboboxPrimitive.useFilteredItems();
|
|
1293
|
+
const labels = virtualizedComboboxMessages(messageOverrides);
|
|
1294
|
+
const entries = filteredItems.flatMap((item, index) => {
|
|
1295
|
+
if (!groupSelections)
|
|
1296
|
+
return [{ kind: "item", item, index }];
|
|
1297
|
+
const selected = selectedValues.has(item.value);
|
|
1298
|
+
const previous = filteredItems[index - 1];
|
|
1299
|
+
const startsGroup = index === 0 || selectedValues.has(previous?.value ?? "") !== selected;
|
|
1300
|
+
const itemEntry = { kind: "item", item, index };
|
|
1301
|
+
return startsGroup ? [
|
|
1302
|
+
{
|
|
1303
|
+
kind: "group",
|
|
1304
|
+
key: selected ? "selected" : "available",
|
|
1305
|
+
label: selected ? labels.selected(selectedValues.size) : labels.selectMore
|
|
1306
|
+
},
|
|
1307
|
+
itemEntry
|
|
1308
|
+
] : [itemEntry];
|
|
1309
|
+
});
|
|
1310
|
+
const scrollRef = useRef2(null);
|
|
1311
|
+
const virtualizer = useVirtualizer({
|
|
1312
|
+
count: entries.length,
|
|
1313
|
+
getScrollElement: () => scrollRef.current,
|
|
1314
|
+
getItemKey: (index) => {
|
|
1315
|
+
const entry = entries[index];
|
|
1316
|
+
return entry?.kind === "group" ? `group-${entry.key}` : entry?.item.value ?? index;
|
|
1317
|
+
},
|
|
1318
|
+
estimateSize: () => 36,
|
|
1319
|
+
overscan: 8
|
|
1320
|
+
});
|
|
1321
|
+
useImperativeHandle(virtualizerRef, () => virtualizer, [virtualizer]);
|
|
1322
|
+
const handleScrollElementRef = useCallback((element) => {
|
|
1323
|
+
scrollRef.current = element;
|
|
1324
|
+
if (element)
|
|
1325
|
+
virtualizer.measure();
|
|
1326
|
+
}, [virtualizer]);
|
|
1327
|
+
if (filteredItems.length === 0) {
|
|
1328
|
+
return /* @__PURE__ */ jsxDEV13("div", {
|
|
1329
|
+
className: "text-muted-foreground py-6 text-center text-sm",
|
|
1330
|
+
children: emptyLabel
|
|
1331
|
+
}, undefined, false, undefined, this);
|
|
1332
|
+
}
|
|
1333
|
+
return /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.List, {
|
|
1334
|
+
className: "scroll-py-1 overflow-auto overscroll-contain p-1",
|
|
1335
|
+
ref: handleScrollElementRef,
|
|
1336
|
+
style: {
|
|
1337
|
+
height: Math.min(virtualizer.getTotalSize() + 8, 288),
|
|
1338
|
+
maxHeight: "var(--available-height)"
|
|
1339
|
+
},
|
|
1340
|
+
children: /* @__PURE__ */ jsxDEV13("div", {
|
|
1341
|
+
className: "relative w-full",
|
|
1342
|
+
role: "presentation",
|
|
1343
|
+
style: { height: virtualizer.getTotalSize() },
|
|
1344
|
+
children: virtualizer.getVirtualItems().map((virtualItem) => {
|
|
1345
|
+
const entry = entries[virtualItem.index];
|
|
1346
|
+
if (!entry)
|
|
1347
|
+
return null;
|
|
1348
|
+
const style = {
|
|
1349
|
+
height: virtualItem.size,
|
|
1350
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
1351
|
+
};
|
|
1352
|
+
if (entry.kind === "group") {
|
|
1353
|
+
return /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Group, {
|
|
1354
|
+
className: "contents",
|
|
1355
|
+
children: /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.GroupLabel, {
|
|
1356
|
+
className: "text-muted-foreground absolute top-0 left-0 w-full px-2 pt-3 pb-1 text-xs",
|
|
1357
|
+
"data-index": virtualItem.index,
|
|
1358
|
+
ref: virtualizer.measureElement,
|
|
1359
|
+
style,
|
|
1360
|
+
children: entry.label
|
|
1361
|
+
}, undefined, false, undefined, this)
|
|
1362
|
+
}, entry.key, false, undefined, this);
|
|
1363
|
+
}
|
|
1364
|
+
return /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Item, {
|
|
1365
|
+
"aria-posinset": entry.index + 1,
|
|
1366
|
+
"aria-setsize": filteredItems.length,
|
|
1367
|
+
className: "data-highlighted:bg-accent data-highlighted:text-accent-foreground absolute top-0 left-0 flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1368
|
+
"data-index": virtualItem.index,
|
|
1369
|
+
index: entry.index,
|
|
1370
|
+
ref: virtualizer.measureElement,
|
|
1371
|
+
style,
|
|
1372
|
+
value: entry.item,
|
|
1373
|
+
children: [
|
|
1374
|
+
renderItem?.(entry.item) ?? /* @__PURE__ */ jsxDEV13("span", {
|
|
1375
|
+
className: "min-w-0 truncate",
|
|
1376
|
+
children: entry.item.label
|
|
1377
|
+
}, undefined, false, undefined, this),
|
|
1378
|
+
/* @__PURE__ */ jsxDEV13(ComboboxPrimitive.ItemIndicator, {
|
|
1379
|
+
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
1380
|
+
children: /* @__PURE__ */ jsxDEV13(Check, {}, undefined, false, undefined, this)
|
|
1381
|
+
}, undefined, false, undefined, this)
|
|
1382
|
+
]
|
|
1383
|
+
}, entry.item.value, true, undefined, this);
|
|
1384
|
+
})
|
|
1385
|
+
}, undefined, false, undefined, this)
|
|
1386
|
+
}, undefined, false, undefined, this);
|
|
1387
|
+
};
|
|
1388
|
+
var VirtualizedComboboxContent = ({
|
|
1389
|
+
contentClassName,
|
|
1390
|
+
emptyLabel,
|
|
1391
|
+
groupSelections,
|
|
1392
|
+
messages: messageOverrides,
|
|
1393
|
+
renderItem,
|
|
1394
|
+
selectedValues,
|
|
1395
|
+
virtualizerRef
|
|
1396
|
+
}) => {
|
|
1397
|
+
const labels = virtualizedComboboxMessages(messageOverrides);
|
|
1398
|
+
return /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Portal, {
|
|
1399
|
+
children: /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Positioner, {
|
|
1400
|
+
align: "start",
|
|
1401
|
+
className: "isolate z-50",
|
|
1402
|
+
side: "bottom",
|
|
1403
|
+
sideOffset: 6,
|
|
1404
|
+
children: /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Popup, {
|
|
1405
|
+
className: cn("relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-in-95", contentClassName),
|
|
1406
|
+
children: [
|
|
1407
|
+
/* @__PURE__ */ jsxDEV13("div", {
|
|
1408
|
+
className: "min-w-0 p-1 pb-0",
|
|
1409
|
+
children: /* @__PURE__ */ jsxDEV13(InputGroup, {
|
|
1410
|
+
className: "border-input/30 bg-input/30 h-8 w-full min-w-0 shadow-none",
|
|
1411
|
+
children: /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Input, {
|
|
1412
|
+
placeholder: labels.search,
|
|
1413
|
+
render: /* @__PURE__ */ jsxDEV13(InputGroupInput, {}, undefined, false, undefined, this)
|
|
1414
|
+
}, undefined, false, undefined, this)
|
|
1415
|
+
}, undefined, false, undefined, this)
|
|
1416
|
+
}, undefined, false, undefined, this),
|
|
1417
|
+
/* @__PURE__ */ jsxDEV13(VirtualizedComboboxList, {
|
|
1418
|
+
emptyLabel,
|
|
1419
|
+
groupSelections,
|
|
1420
|
+
messages: messageOverrides,
|
|
1421
|
+
renderItem,
|
|
1422
|
+
selectedValues,
|
|
1423
|
+
virtualizerRef
|
|
1424
|
+
}, undefined, false, undefined, this)
|
|
1425
|
+
]
|
|
1426
|
+
}, undefined, true, undefined, this)
|
|
1427
|
+
}, undefined, false, undefined, this)
|
|
1428
|
+
}, undefined, false, undefined, this);
|
|
1429
|
+
};
|
|
1430
|
+
var defaultTrigger = (ariaLabel, ariaInvalid, disabled, label, triggerId) => /* @__PURE__ */ jsxDEV13(Button, {
|
|
1431
|
+
"aria-label": ariaLabel,
|
|
1432
|
+
"aria-invalid": ariaInvalid,
|
|
1433
|
+
className: "w-full max-w-full min-w-0 justify-between overflow-hidden",
|
|
1434
|
+
disabled,
|
|
1435
|
+
id: triggerId,
|
|
1436
|
+
type: "button",
|
|
1437
|
+
variant: "outline",
|
|
1438
|
+
children: [
|
|
1439
|
+
/* @__PURE__ */ jsxDEV13("span", {
|
|
1440
|
+
className: "min-w-0 truncate text-left",
|
|
1441
|
+
children: label
|
|
1442
|
+
}, undefined, false, undefined, this),
|
|
1443
|
+
/* @__PURE__ */ jsxDEV13(ChevronsUpDown, {
|
|
1444
|
+
className: "text-muted-foreground shrink-0 opacity-70"
|
|
1445
|
+
}, undefined, false, undefined, this)
|
|
1446
|
+
]
|
|
1447
|
+
}, undefined, true, undefined, this);
|
|
1448
|
+
var selectedLabel = (value, placeholder) => {
|
|
1449
|
+
if (Array.isArray(value)) {
|
|
1450
|
+
return value.length > 0 ? value.map(({ label }) => label).join(", ") : placeholder;
|
|
1451
|
+
}
|
|
1452
|
+
return value && "label" in value ? value.label : placeholder;
|
|
1453
|
+
};
|
|
1454
|
+
var useComboboxVirtualizerRef = (providedRef) => {
|
|
1455
|
+
const localRef = useRef2(null);
|
|
1456
|
+
return providedRef ?? localRef;
|
|
1457
|
+
};
|
|
1458
|
+
var VirtualizedComboboxSingle = (props) => {
|
|
1459
|
+
const virtualizerRef = useComboboxVirtualizerRef(props.virtualizerRef);
|
|
1460
|
+
return /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Root, {
|
|
1461
|
+
disabled: props.disabled,
|
|
1462
|
+
inputValue: props.searchValue,
|
|
1463
|
+
items: [...props.items],
|
|
1464
|
+
itemToStringLabel: (item) => item.label,
|
|
1465
|
+
isItemEqualToValue: optionEquals,
|
|
1466
|
+
onInputValueChange: (value) => props.onSearchValueChange?.(value),
|
|
1467
|
+
onItemHighlighted: (_, { index, reason }) => {
|
|
1468
|
+
if (reason === "keyboard" && index >= 0) {
|
|
1469
|
+
virtualizerRef.current?.scrollToIndex(index, { align: "auto" });
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
onOpenChange: (open) => props.onOpenChange?.(open),
|
|
1473
|
+
onValueChange: (value) => props.onValueChange(value),
|
|
1474
|
+
open: props.open,
|
|
1475
|
+
value: props.value,
|
|
1476
|
+
virtualized: true,
|
|
1477
|
+
children: [
|
|
1478
|
+
/* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Trigger, {
|
|
1479
|
+
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
1480
|
+
}, undefined, false, undefined, this),
|
|
1481
|
+
/* @__PURE__ */ jsxDEV13(VirtualizedComboboxContent, {
|
|
1482
|
+
...props,
|
|
1483
|
+
groupSelections: false,
|
|
1484
|
+
selectedValues: new Set(props.value ? [props.value.value] : []),
|
|
1485
|
+
virtualizerRef
|
|
1486
|
+
}, undefined, false, undefined, this)
|
|
1487
|
+
]
|
|
1488
|
+
}, undefined, true, undefined, this);
|
|
1489
|
+
};
|
|
1490
|
+
var VirtualizedComboboxMultiple = (props) => {
|
|
1491
|
+
const virtualizerRef = useComboboxVirtualizerRef(props.virtualizerRef);
|
|
1492
|
+
return /* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Root, {
|
|
1493
|
+
disabled: props.disabled,
|
|
1494
|
+
inputValue: props.searchValue,
|
|
1495
|
+
items: [...props.items],
|
|
1496
|
+
itemToStringLabel: (item) => item.label,
|
|
1497
|
+
isItemEqualToValue: optionEquals,
|
|
1498
|
+
multiple: true,
|
|
1499
|
+
onInputValueChange: (value) => props.onSearchValueChange?.(value),
|
|
1500
|
+
onItemHighlighted: (_, { index, reason }) => {
|
|
1501
|
+
if (reason === "keyboard" && index >= 0) {
|
|
1502
|
+
virtualizerRef.current?.scrollToIndex(index, { align: "auto" });
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
onOpenChange: (open) => props.onOpenChange?.(open),
|
|
1506
|
+
onValueChange: (value) => props.onValueChange(value),
|
|
1507
|
+
open: props.open,
|
|
1508
|
+
value: [...props.value],
|
|
1509
|
+
virtualized: true,
|
|
1510
|
+
children: [
|
|
1511
|
+
/* @__PURE__ */ jsxDEV13(ComboboxPrimitive.Trigger, {
|
|
1512
|
+
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
1513
|
+
}, undefined, false, undefined, this),
|
|
1514
|
+
/* @__PURE__ */ jsxDEV13(VirtualizedComboboxContent, {
|
|
1515
|
+
...props,
|
|
1516
|
+
groupSelections: true,
|
|
1517
|
+
selectedValues: new Set(props.value.map(({ value }) => value)),
|
|
1518
|
+
virtualizerRef
|
|
1519
|
+
}, undefined, false, undefined, this)
|
|
1520
|
+
]
|
|
1521
|
+
}, undefined, true, undefined, this);
|
|
1522
|
+
};
|
|
1523
|
+
function VirtualizedCombobox(props) {
|
|
1524
|
+
return props.multiple ? /* @__PURE__ */ jsxDEV13(VirtualizedComboboxMultiple, {
|
|
1525
|
+
...props
|
|
1526
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13(VirtualizedComboboxSingle, {
|
|
1527
|
+
...props
|
|
1528
|
+
}, undefined, false, undefined, this);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
// ../../src/components/ui/form.tsx
|
|
1532
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
|
1533
|
+
var messages3 = {
|
|
1534
|
+
en: {
|
|
1535
|
+
keyValueKey: "Key",
|
|
1536
|
+
keyValueValue: "Value",
|
|
1537
|
+
keyValueDelete: "Delete",
|
|
1538
|
+
keyValueAdd: "Add",
|
|
1539
|
+
accepts: (accepts) => `Accepts: ${accepts}`,
|
|
1540
|
+
delete: "Delete",
|
|
1541
|
+
suggestedImageSize: (width, height) => `Suggested image size: ${width} x ${height}`,
|
|
1542
|
+
blockNavigationTitle: "Leave without saving?",
|
|
1543
|
+
blockNavigationDescription: "Your changes have not been saved. If you leave, you will lose your changes.",
|
|
1544
|
+
blockNavigationCancel: "Cancel",
|
|
1545
|
+
blockNavigationConfirm: "Confirm",
|
|
1546
|
+
submit: "Submit",
|
|
1547
|
+
revert: "Revert to default"
|
|
1548
|
+
},
|
|
1549
|
+
fr: {
|
|
1550
|
+
keyValueKey: "Clé",
|
|
1551
|
+
keyValueValue: "Valeur",
|
|
1552
|
+
keyValueDelete: "Supprimer",
|
|
1553
|
+
keyValueAdd: "Ajouter",
|
|
1554
|
+
accepts: (accepts) => `Accepte : ${accepts}`,
|
|
1555
|
+
delete: "Supprimer",
|
|
1556
|
+
suggestedImageSize: (width, height) => `Taille de l'image suggérée : ${width} x ${height}`,
|
|
1557
|
+
blockNavigationTitle: "Quitter sans sauvegarder?",
|
|
1558
|
+
blockNavigationDescription: "Vos modifications n'ont pas été sauvegardés. Si vous quittez, vous perdrez vos modifications.",
|
|
1559
|
+
blockNavigationCancel: "Annuler",
|
|
1560
|
+
blockNavigationConfirm: "Confirmer",
|
|
1561
|
+
submit: "Soumettre",
|
|
1562
|
+
revert: "Revenir aux paramètres par défaut"
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
var formMessages = (overrides) => ({
|
|
1566
|
+
...getLocale().startsWith("fr") ? messages3.fr : messages3.en,
|
|
1567
|
+
...overrides
|
|
1568
|
+
});
|
|
1569
|
+
var ErrorMessage = ({ text }) => {
|
|
1570
|
+
return /* @__PURE__ */ jsxDEV14("em", {
|
|
1571
|
+
role: "alert",
|
|
1572
|
+
className: "text-destructive text-sm",
|
|
1573
|
+
children: text
|
|
1574
|
+
}, undefined, false, undefined, this);
|
|
1575
|
+
};
|
|
1576
|
+
function FieldError({ errors = [] }) {
|
|
1577
|
+
return errors?.length > 0 ? /* @__PURE__ */ jsxDEV14(ErrorMessage, {
|
|
1578
|
+
text: errors.map((error) => {
|
|
1579
|
+
return error.message?.toString().split(" ").map((word) => {
|
|
1580
|
+
if (word.startsWith("t:"))
|
|
1581
|
+
return word.slice(2);
|
|
1582
|
+
return word;
|
|
1583
|
+
}).join(" ");
|
|
1584
|
+
}).join(", ")
|
|
1585
|
+
}, undefined, false, undefined, this) : null;
|
|
1586
|
+
}
|
|
1587
|
+
var { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts();
|
|
1588
|
+
var TextField = ({
|
|
1589
|
+
children,
|
|
1590
|
+
...props
|
|
1591
|
+
}) => {
|
|
1592
|
+
const field = useFieldContext();
|
|
1593
|
+
const invalid = !field.state.meta.isValid;
|
|
1594
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
1595
|
+
className: "min-w-0",
|
|
1596
|
+
"data-invalid": invalid,
|
|
1597
|
+
children: [
|
|
1598
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
1599
|
+
className: "flex w-full items-center gap-2",
|
|
1600
|
+
children: [
|
|
1601
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
1602
|
+
htmlFor: field.name,
|
|
1603
|
+
children: props.label
|
|
1604
|
+
}, undefined, false, undefined, this),
|
|
1605
|
+
children
|
|
1606
|
+
]
|
|
1607
|
+
}, undefined, true, undefined, this),
|
|
1608
|
+
/* @__PURE__ */ jsxDEV14(Input, {
|
|
1609
|
+
id: field.name,
|
|
1610
|
+
value: field.state.value ?? "",
|
|
1611
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
1612
|
+
...props,
|
|
1613
|
+
"aria-invalid": invalid
|
|
1614
|
+
}, undefined, false, undefined, this),
|
|
1615
|
+
props.description && /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
1616
|
+
children: props.description
|
|
1617
|
+
}, undefined, false, undefined, this),
|
|
1618
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
1619
|
+
errors: field.getMeta().errors
|
|
1620
|
+
}, undefined, false, undefined, this)
|
|
1621
|
+
]
|
|
1622
|
+
}, undefined, true, undefined, this);
|
|
1623
|
+
};
|
|
1624
|
+
var TextAreaField = ({
|
|
1625
|
+
children,
|
|
1626
|
+
...props
|
|
1627
|
+
}) => {
|
|
1628
|
+
const field = useFieldContext();
|
|
1629
|
+
const invalid = !field.state.meta.isValid;
|
|
1630
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
1631
|
+
className: "min-w-0",
|
|
1632
|
+
"data-invalid": invalid,
|
|
1633
|
+
children: [
|
|
1634
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
1635
|
+
className: "flex w-full items-center gap-2",
|
|
1636
|
+
children: [
|
|
1637
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
1638
|
+
htmlFor: field.name,
|
|
1639
|
+
children: props.label
|
|
1640
|
+
}, undefined, false, undefined, this),
|
|
1641
|
+
children
|
|
1642
|
+
]
|
|
1643
|
+
}, undefined, true, undefined, this),
|
|
1644
|
+
/* @__PURE__ */ jsxDEV14(Textarea, {
|
|
1645
|
+
id: field.name,
|
|
1646
|
+
value: field.state.value ?? "",
|
|
1647
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
1648
|
+
...props,
|
|
1649
|
+
"aria-invalid": invalid
|
|
1650
|
+
}, undefined, false, undefined, this),
|
|
1651
|
+
props.description && /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
1652
|
+
children: props.description
|
|
1653
|
+
}, undefined, false, undefined, this),
|
|
1654
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
1655
|
+
errors: field.getMeta().errors
|
|
1656
|
+
}, undefined, false, undefined, this)
|
|
1657
|
+
]
|
|
1658
|
+
}, undefined, true, undefined, this);
|
|
1659
|
+
};
|
|
1660
|
+
var CheckboxField = (props) => {
|
|
1661
|
+
const field = useFieldContext();
|
|
1662
|
+
const invalid = !field.state.meta.isValid;
|
|
1663
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
1664
|
+
"data-invalid": invalid,
|
|
1665
|
+
children: [
|
|
1666
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
1667
|
+
className: "flex flex-row items-center gap-2",
|
|
1668
|
+
children: [
|
|
1669
|
+
/* @__PURE__ */ jsxDEV14(Checkbox, {
|
|
1670
|
+
id: field.name,
|
|
1671
|
+
name: field.name,
|
|
1672
|
+
checked: field.state.value ?? false,
|
|
1673
|
+
onBlur: field.handleBlur,
|
|
1674
|
+
onCheckedChange: (checked) => field.handleChange(checked),
|
|
1675
|
+
"aria-invalid": invalid
|
|
1676
|
+
}, undefined, false, undefined, this),
|
|
1677
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
1678
|
+
htmlFor: field.name,
|
|
1679
|
+
children: props.label
|
|
1680
|
+
}, undefined, false, undefined, this)
|
|
1681
|
+
]
|
|
1682
|
+
}, undefined, true, undefined, this),
|
|
1683
|
+
props.description && /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
1684
|
+
children: props.description
|
|
1685
|
+
}, undefined, false, undefined, this),
|
|
1686
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
1687
|
+
errors: field.getMeta().errors
|
|
1688
|
+
}, undefined, false, undefined, this)
|
|
1689
|
+
]
|
|
1690
|
+
}, undefined, true, undefined, this);
|
|
1691
|
+
};
|
|
1692
|
+
var SingleSelectControl = ({
|
|
1693
|
+
invalid,
|
|
1694
|
+
options,
|
|
1695
|
+
placeholder
|
|
1696
|
+
}) => {
|
|
1697
|
+
const field = useFieldContext();
|
|
1698
|
+
return /* @__PURE__ */ jsxDEV14(Select, {
|
|
1699
|
+
items: [...options],
|
|
1700
|
+
required: true,
|
|
1701
|
+
onValueChange: (value) => field.handleChange(value ?? ""),
|
|
1702
|
+
defaultValue: field.state.value,
|
|
1703
|
+
children: [
|
|
1704
|
+
/* @__PURE__ */ jsxDEV14(SelectTrigger, {
|
|
1705
|
+
className: "gap-1",
|
|
1706
|
+
id: field.name,
|
|
1707
|
+
"aria-invalid": invalid,
|
|
1708
|
+
children: /* @__PURE__ */ jsxDEV14(SelectValue, {
|
|
1709
|
+
placeholder
|
|
1710
|
+
}, undefined, false, undefined, this)
|
|
1711
|
+
}, undefined, false, undefined, this),
|
|
1712
|
+
/* @__PURE__ */ jsxDEV14(SelectOptions, {
|
|
1713
|
+
options
|
|
1714
|
+
}, undefined, false, undefined, this)
|
|
1715
|
+
]
|
|
1716
|
+
}, undefined, true, undefined, this);
|
|
1717
|
+
};
|
|
1718
|
+
var MultipleSelectControl = ({
|
|
1719
|
+
invalid,
|
|
1720
|
+
options,
|
|
1721
|
+
placeholder
|
|
1722
|
+
}) => {
|
|
1723
|
+
const field = useFieldContext();
|
|
1724
|
+
return /* @__PURE__ */ jsxDEV14(Select, {
|
|
1725
|
+
items: [...options],
|
|
1726
|
+
onValueChange: (value) => field.handleChange(value ?? []),
|
|
1727
|
+
multiple: true,
|
|
1728
|
+
value: field.state.value ?? [],
|
|
1729
|
+
children: [
|
|
1730
|
+
/* @__PURE__ */ jsxDEV14(SelectTrigger, {
|
|
1731
|
+
className: "gap-1",
|
|
1732
|
+
id: field.name,
|
|
1733
|
+
"aria-invalid": invalid,
|
|
1734
|
+
children: /* @__PURE__ */ jsxDEV14(SelectValue, {
|
|
1735
|
+
placeholder
|
|
1736
|
+
}, undefined, false, undefined, this)
|
|
1737
|
+
}, undefined, false, undefined, this),
|
|
1738
|
+
/* @__PURE__ */ jsxDEV14(SelectOptions, {
|
|
1739
|
+
options
|
|
1740
|
+
}, undefined, false, undefined, this)
|
|
1741
|
+
]
|
|
1742
|
+
}, undefined, true, undefined, this);
|
|
1743
|
+
};
|
|
1744
|
+
var SelectOptions = ({
|
|
1745
|
+
options
|
|
1746
|
+
}) => /* @__PURE__ */ jsxDEV14(SelectContent, {
|
|
1747
|
+
children: /* @__PURE__ */ jsxDEV14(SelectGroup, {
|
|
1748
|
+
children: options.map((option) => /* @__PURE__ */ jsxDEV14(SelectItem, {
|
|
1749
|
+
value: option.value,
|
|
1750
|
+
children: option.label
|
|
1751
|
+
}, option.label, false, undefined, this))
|
|
1752
|
+
}, undefined, false, undefined, this)
|
|
1753
|
+
}, undefined, false, undefined, this);
|
|
1754
|
+
var SelectField = ({
|
|
1755
|
+
description,
|
|
1756
|
+
label,
|
|
1757
|
+
multiple,
|
|
1758
|
+
options,
|
|
1759
|
+
placeholder
|
|
1760
|
+
}) => {
|
|
1761
|
+
const field = useFieldContext();
|
|
1762
|
+
const invalid = !field.state.meta.isValid;
|
|
1763
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
1764
|
+
"data-invalid": invalid,
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
1767
|
+
htmlFor: field.name,
|
|
1768
|
+
children: label
|
|
1769
|
+
}, undefined, false, undefined, this),
|
|
1770
|
+
multiple ? /* @__PURE__ */ jsxDEV14(MultipleSelectControl, {
|
|
1771
|
+
invalid,
|
|
1772
|
+
options,
|
|
1773
|
+
placeholder
|
|
1774
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14(SingleSelectControl, {
|
|
1775
|
+
invalid,
|
|
1776
|
+
options,
|
|
1777
|
+
placeholder
|
|
1778
|
+
}, undefined, false, undefined, this),
|
|
1779
|
+
description ? /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
1780
|
+
children: description
|
|
1781
|
+
}, undefined, false, undefined, this) : null,
|
|
1782
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
1783
|
+
errors: field.getMeta().errors
|
|
1784
|
+
}, undefined, false, undefined, this)
|
|
1785
|
+
]
|
|
1786
|
+
}, undefined, true, undefined, this);
|
|
1787
|
+
};
|
|
1788
|
+
var KeyValueField = (props) => {
|
|
1789
|
+
const labels = formMessages(props.messages);
|
|
1790
|
+
const field = useFieldContext();
|
|
1791
|
+
const invalid = !field.state.meta.isValid;
|
|
1792
|
+
const keyValues = Object.entries(field.state.value ?? {});
|
|
1793
|
+
const updateKeyValue = (key, value, index) => {
|
|
1794
|
+
return Object.fromEntries(Object.entries(field.state.value).map(([k, v], i) => {
|
|
1795
|
+
if (index === i) {
|
|
1796
|
+
return [key, value];
|
|
1797
|
+
}
|
|
1798
|
+
return [k, v];
|
|
1799
|
+
}));
|
|
1800
|
+
};
|
|
1801
|
+
const deleteKeyValue = (index) => {
|
|
1802
|
+
return Object.fromEntries(Object.entries(field.state.value).filter((_, i) => {
|
|
1803
|
+
if (index === i) {
|
|
1804
|
+
return false;
|
|
1805
|
+
}
|
|
1806
|
+
return true;
|
|
1807
|
+
}));
|
|
1808
|
+
};
|
|
1809
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
1810
|
+
"data-invalid": invalid,
|
|
1811
|
+
children: [
|
|
1812
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
1813
|
+
htmlFor: field.name,
|
|
1814
|
+
children: props.label
|
|
1815
|
+
}, undefined, false, undefined, this),
|
|
1816
|
+
keyValues.map(([key, value], index) => /* @__PURE__ */ jsxDEV14("div", {
|
|
1817
|
+
className: "flex w-full flex-row items-center gap-2",
|
|
1818
|
+
children: [
|
|
1819
|
+
/* @__PURE__ */ jsxDEV14(Input, {
|
|
1820
|
+
id: field.name,
|
|
1821
|
+
placeholder: labels.keyValueKey,
|
|
1822
|
+
name: field.name,
|
|
1823
|
+
type: "text",
|
|
1824
|
+
className: "w-auto",
|
|
1825
|
+
value: key,
|
|
1826
|
+
onChange: (e) => {
|
|
1827
|
+
field.handleChange(updateKeyValue(e.target.value, value, index));
|
|
1828
|
+
}
|
|
1829
|
+
}, undefined, false, undefined, this),
|
|
1830
|
+
/* @__PURE__ */ jsxDEV14(Input, {
|
|
1831
|
+
id: field.name,
|
|
1832
|
+
name: field.name,
|
|
1833
|
+
type: "text",
|
|
1834
|
+
className: "w-auto flex-1",
|
|
1835
|
+
placeholder: labels.keyValueValue,
|
|
1836
|
+
value,
|
|
1837
|
+
onChange: (e) => {
|
|
1838
|
+
field.handleChange(updateKeyValue(key, e.target.value, index));
|
|
1839
|
+
}
|
|
1840
|
+
}, undefined, false, undefined, this),
|
|
1841
|
+
/* @__PURE__ */ jsxDEV14(Button, {
|
|
1842
|
+
type: "button",
|
|
1843
|
+
variant: "secondary",
|
|
1844
|
+
onClick: (e) => {
|
|
1845
|
+
e.preventDefault();
|
|
1846
|
+
field.handleChange(deleteKeyValue(index));
|
|
1847
|
+
},
|
|
1848
|
+
children: [
|
|
1849
|
+
/* @__PURE__ */ jsxDEV14(Trash, {}, undefined, false, undefined, this),
|
|
1850
|
+
labels.keyValueDelete
|
|
1851
|
+
]
|
|
1852
|
+
}, undefined, true, undefined, this)
|
|
1853
|
+
]
|
|
1854
|
+
}, index, true, undefined, this)),
|
|
1855
|
+
/* @__PURE__ */ jsxDEV14("div", {
|
|
1856
|
+
className: "flex flex-row items-center gap-2",
|
|
1857
|
+
children: /* @__PURE__ */ jsxDEV14(Button, {
|
|
1858
|
+
size: "sm",
|
|
1859
|
+
className: "mt-2",
|
|
1860
|
+
onClick: (e) => {
|
|
1861
|
+
e.preventDefault();
|
|
1862
|
+
field.setValue({
|
|
1863
|
+
...field.state.value,
|
|
1864
|
+
"": ""
|
|
1865
|
+
});
|
|
1866
|
+
},
|
|
1867
|
+
children: [
|
|
1868
|
+
/* @__PURE__ */ jsxDEV14(Plus, {}, undefined, false, undefined, this),
|
|
1869
|
+
labels.keyValueAdd
|
|
1870
|
+
]
|
|
1871
|
+
}, undefined, true, undefined, this)
|
|
1872
|
+
}, undefined, false, undefined, this),
|
|
1873
|
+
props.description && /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
1874
|
+
children: props.description
|
|
1875
|
+
}, undefined, false, undefined, this),
|
|
1876
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
1877
|
+
errors: field.getMeta().errors
|
|
1878
|
+
}, undefined, false, undefined, this)
|
|
1879
|
+
]
|
|
1880
|
+
}, undefined, true, undefined, this);
|
|
1881
|
+
};
|
|
1882
|
+
var MultiSelectField = (props) => /* @__PURE__ */ jsxDEV14(SelectField, {
|
|
1883
|
+
...props,
|
|
1884
|
+
multiple: true
|
|
1885
|
+
}, undefined, false, undefined, this);
|
|
1886
|
+
var getSearchableSelectItems = (values, initialItems, items) => {
|
|
1887
|
+
const itemsByValue = new Map([...initialItems, ...items].map((item) => [item.value, item]));
|
|
1888
|
+
const selectedItems = values.map((value) => itemsByValue.get(value) ?? { value, label: value });
|
|
1889
|
+
const selectedValues = new Set(values);
|
|
1890
|
+
return {
|
|
1891
|
+
selectedItems,
|
|
1892
|
+
mergedItems: [
|
|
1893
|
+
...selectedItems,
|
|
1894
|
+
...items.filter(({ value }) => !selectedValues.has(value))
|
|
1895
|
+
]
|
|
1896
|
+
};
|
|
1897
|
+
};
|
|
1898
|
+
var SingleSearchableSelectControl = ({
|
|
1899
|
+
ariaLabel,
|
|
1900
|
+
emptyLabel,
|
|
1901
|
+
initialItems = [],
|
|
1902
|
+
invalid,
|
|
1903
|
+
items,
|
|
1904
|
+
messages: messages4,
|
|
1905
|
+
name,
|
|
1906
|
+
onSearchValueChange,
|
|
1907
|
+
placeholder,
|
|
1908
|
+
renderItem,
|
|
1909
|
+
searchValue
|
|
1910
|
+
}) => {
|
|
1911
|
+
const field = useFieldContext();
|
|
1912
|
+
const { selectedItems, mergedItems } = getSearchableSelectItems(field.state.value ? [field.state.value] : [], initialItems, items);
|
|
1913
|
+
return /* @__PURE__ */ jsxDEV14(VirtualizedCombobox, {
|
|
1914
|
+
ariaInvalid: invalid,
|
|
1915
|
+
ariaLabel,
|
|
1916
|
+
emptyLabel,
|
|
1917
|
+
items: mergedItems,
|
|
1918
|
+
...messages4 ? { messages: messages4 } : {},
|
|
1919
|
+
onValueChange: (option) => field.handleChange(option?.value ?? ""),
|
|
1920
|
+
placeholder,
|
|
1921
|
+
triggerId: name,
|
|
1922
|
+
value: selectedItems[0] ?? null,
|
|
1923
|
+
...onSearchValueChange ? { onSearchValueChange } : {},
|
|
1924
|
+
...renderItem ? { renderItem } : {},
|
|
1925
|
+
...searchValue === undefined ? {} : { searchValue }
|
|
1926
|
+
}, undefined, false, undefined, this);
|
|
1927
|
+
};
|
|
1928
|
+
var MultipleSearchableSelectControl = ({
|
|
1929
|
+
ariaLabel,
|
|
1930
|
+
emptyLabel,
|
|
1931
|
+
initialItems = [],
|
|
1932
|
+
invalid,
|
|
1933
|
+
items,
|
|
1934
|
+
messages: messages4,
|
|
1935
|
+
name,
|
|
1936
|
+
onSearchValueChange,
|
|
1937
|
+
placeholder,
|
|
1938
|
+
renderItem,
|
|
1939
|
+
searchValue
|
|
1940
|
+
}) => {
|
|
1941
|
+
const field = useFieldContext();
|
|
1942
|
+
const { selectedItems, mergedItems } = getSearchableSelectItems(field.state.value ?? [], initialItems, items);
|
|
1943
|
+
return /* @__PURE__ */ jsxDEV14(VirtualizedCombobox, {
|
|
1944
|
+
ariaInvalid: invalid,
|
|
1945
|
+
ariaLabel,
|
|
1946
|
+
emptyLabel,
|
|
1947
|
+
items: mergedItems,
|
|
1948
|
+
...messages4 ? { messages: messages4 } : {},
|
|
1949
|
+
multiple: true,
|
|
1950
|
+
onValueChange: (options) => field.handleChange(options.map(({ value }) => value)),
|
|
1951
|
+
placeholder,
|
|
1952
|
+
triggerId: name,
|
|
1953
|
+
value: selectedItems,
|
|
1954
|
+
...onSearchValueChange ? { onSearchValueChange } : {},
|
|
1955
|
+
...renderItem ? { renderItem } : {},
|
|
1956
|
+
...searchValue === undefined ? {} : { searchValue }
|
|
1957
|
+
}, undefined, false, undefined, this);
|
|
1958
|
+
};
|
|
1959
|
+
var SearchableSelectField = ({
|
|
1960
|
+
description,
|
|
1961
|
+
label,
|
|
1962
|
+
multiple,
|
|
1963
|
+
...props
|
|
1964
|
+
}) => {
|
|
1965
|
+
const field = useFieldContext();
|
|
1966
|
+
const labels = virtualizedComboboxMessages(props.messages);
|
|
1967
|
+
const invalid = !field.state.meta.isValid;
|
|
1968
|
+
const ariaLabel = typeof label === "string" ? label : labels.search;
|
|
1969
|
+
const controlProps = {
|
|
1970
|
+
...props,
|
|
1971
|
+
ariaLabel,
|
|
1972
|
+
invalid,
|
|
1973
|
+
name: field.name
|
|
1974
|
+
};
|
|
1975
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
1976
|
+
className: "min-w-0",
|
|
1977
|
+
"data-invalid": invalid,
|
|
1978
|
+
children: [
|
|
1979
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
1980
|
+
htmlFor: field.name,
|
|
1981
|
+
children: label
|
|
1982
|
+
}, undefined, false, undefined, this),
|
|
1983
|
+
multiple ? /* @__PURE__ */ jsxDEV14(MultipleSearchableSelectControl, {
|
|
1984
|
+
...controlProps
|
|
1985
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14(SingleSearchableSelectControl, {
|
|
1986
|
+
...controlProps
|
|
1987
|
+
}, undefined, false, undefined, this),
|
|
1988
|
+
description ? /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
1989
|
+
children: description
|
|
1990
|
+
}, undefined, false, undefined, this) : null,
|
|
1991
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
1992
|
+
errors: field.getMeta().errors
|
|
1993
|
+
}, undefined, false, undefined, this)
|
|
1994
|
+
]
|
|
1995
|
+
}, undefined, true, undefined, this);
|
|
1996
|
+
};
|
|
1997
|
+
var FileField = ({
|
|
1998
|
+
label,
|
|
1999
|
+
accept,
|
|
2000
|
+
messages: messages4,
|
|
2001
|
+
onFileChange,
|
|
2002
|
+
required = false
|
|
2003
|
+
}) => {
|
|
2004
|
+
const labels = formMessages(messages4);
|
|
2005
|
+
const field = useFieldContext();
|
|
2006
|
+
const invalid = !field.state.meta.isValid;
|
|
2007
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
2008
|
+
"data-invalid": invalid,
|
|
2009
|
+
children: [
|
|
2010
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
2011
|
+
htmlFor: field.name,
|
|
2012
|
+
children: label
|
|
2013
|
+
}, undefined, false, undefined, this),
|
|
2014
|
+
/* @__PURE__ */ jsxDEV14(FilePicker, {
|
|
2015
|
+
accept,
|
|
2016
|
+
canClear: field.state.value instanceof File,
|
|
2017
|
+
...field.state.value instanceof File ? { file: field.state.value } : {},
|
|
2018
|
+
id: field.name,
|
|
2019
|
+
invalid,
|
|
2020
|
+
messages: { accepts: labels.accepts, deleteFile: labels.delete },
|
|
2021
|
+
name: field.name,
|
|
2022
|
+
onBlur: field.handleBlur,
|
|
2023
|
+
onChange: (file) => {
|
|
2024
|
+
field.handleChange(file);
|
|
2025
|
+
onFileChange?.(file);
|
|
2026
|
+
},
|
|
2027
|
+
onClear: () => {
|
|
2028
|
+
field.handleChange("");
|
|
2029
|
+
onFileChange?.("");
|
|
2030
|
+
},
|
|
2031
|
+
required,
|
|
2032
|
+
title: field.state.value instanceof File ? field.state.value.name : label
|
|
2033
|
+
}, undefined, false, undefined, this),
|
|
2034
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
2035
|
+
errors: field.getMeta().errors
|
|
2036
|
+
}, undefined, false, undefined, this)
|
|
2037
|
+
]
|
|
2038
|
+
}, undefined, true, undefined, this);
|
|
2039
|
+
};
|
|
2040
|
+
var ImageField = ({
|
|
2041
|
+
label,
|
|
2042
|
+
messages: messages4,
|
|
2043
|
+
size
|
|
2044
|
+
}) => {
|
|
2045
|
+
const labels = formMessages(messages4);
|
|
2046
|
+
const field = useFieldContext();
|
|
2047
|
+
const invalid = !field.state.meta.isValid;
|
|
2048
|
+
const imageUrl = typeof field.state.value === "string" ? field.state.value : undefined;
|
|
2049
|
+
return /* @__PURE__ */ jsxDEV14(Field, {
|
|
2050
|
+
"data-invalid": invalid,
|
|
2051
|
+
children: [
|
|
2052
|
+
/* @__PURE__ */ jsxDEV14(FieldLabel, {
|
|
2053
|
+
htmlFor: field.name,
|
|
2054
|
+
children: label
|
|
2055
|
+
}, undefined, false, undefined, this),
|
|
2056
|
+
/* @__PURE__ */ jsxDEV14(FilePicker, {
|
|
2057
|
+
accept: "image/*",
|
|
2058
|
+
canClear: Boolean(field.state.value),
|
|
2059
|
+
...field.state.value instanceof File ? { file: field.state.value } : {},
|
|
2060
|
+
id: field.name,
|
|
2061
|
+
image: {
|
|
2062
|
+
alt: label,
|
|
2063
|
+
height: size.height,
|
|
2064
|
+
...imageUrl ? { src: imageUrl } : {},
|
|
2065
|
+
width: size.width
|
|
2066
|
+
},
|
|
2067
|
+
invalid,
|
|
2068
|
+
messages: { accepts: labels.accepts, deleteFile: labels.delete },
|
|
2069
|
+
name: field.name,
|
|
2070
|
+
onBlur: field.handleBlur,
|
|
2071
|
+
onChange: field.handleChange,
|
|
2072
|
+
onClear: () => field.handleChange(null),
|
|
2073
|
+
title: field.state.value instanceof File ? field.state.value.name : label
|
|
2074
|
+
}, undefined, false, undefined, this),
|
|
2075
|
+
size.suggestedWidth && size.suggestedHeight && /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
2076
|
+
children: labels.suggestedImageSize(String(size.suggestedWidth), String(size.suggestedHeight))
|
|
2077
|
+
}, undefined, false, undefined, this),
|
|
2078
|
+
/* @__PURE__ */ jsxDEV14(FieldError, {
|
|
2079
|
+
errors: field.getMeta().errors
|
|
2080
|
+
}, undefined, false, undefined, this)
|
|
2081
|
+
]
|
|
2082
|
+
}, undefined, true, undefined, this);
|
|
2083
|
+
};
|
|
2084
|
+
var BlockNavigation = ({
|
|
2085
|
+
messages: messages4
|
|
2086
|
+
}) => {
|
|
2087
|
+
const labels = formMessages(messages4);
|
|
2088
|
+
const form = useFormContext();
|
|
2089
|
+
const shouldBlock = useStore(form.store, (formState) => formState.isDirty && !(formState.isSubmitting || formState.isSubmitted));
|
|
2090
|
+
return /* @__PURE__ */ jsxDEV14(Block, {
|
|
2091
|
+
enableBeforeUnload: () => shouldBlock,
|
|
2092
|
+
shouldBlockFn: () => shouldBlock,
|
|
2093
|
+
withResolver: true,
|
|
2094
|
+
children: ({ status, proceed, reset }) => /* @__PURE__ */ jsxDEV14(AlertDialog, {
|
|
2095
|
+
open: status === "blocked",
|
|
2096
|
+
children: /* @__PURE__ */ jsxDEV14(AlertDialogContent, {
|
|
2097
|
+
children: [
|
|
2098
|
+
/* @__PURE__ */ jsxDEV14(AlertDialogHeader, {
|
|
2099
|
+
children: [
|
|
2100
|
+
/* @__PURE__ */ jsxDEV14(AlertDialogTitle, {
|
|
2101
|
+
children: labels.blockNavigationTitle
|
|
2102
|
+
}, undefined, false, undefined, this),
|
|
2103
|
+
/* @__PURE__ */ jsxDEV14(AlertDialogDescription, {
|
|
2104
|
+
children: labels.blockNavigationDescription
|
|
2105
|
+
}, undefined, false, undefined, this)
|
|
2106
|
+
]
|
|
2107
|
+
}, undefined, true, undefined, this),
|
|
2108
|
+
/* @__PURE__ */ jsxDEV14(AlertDialogFooter, {
|
|
2109
|
+
children: [
|
|
2110
|
+
/* @__PURE__ */ jsxDEV14(AlertDialogCancel, {
|
|
2111
|
+
onClick: reset,
|
|
2112
|
+
children: labels.blockNavigationCancel
|
|
2113
|
+
}, undefined, false, undefined, this),
|
|
2114
|
+
/* @__PURE__ */ jsxDEV14(AlertDialogAction, {
|
|
2115
|
+
onClick: proceed,
|
|
2116
|
+
children: labels.blockNavigationConfirm
|
|
2117
|
+
}, undefined, false, undefined, this)
|
|
2118
|
+
]
|
|
2119
|
+
}, undefined, true, undefined, this)
|
|
2120
|
+
]
|
|
2121
|
+
}, undefined, true, undefined, this)
|
|
2122
|
+
}, undefined, false, undefined, this)
|
|
2123
|
+
}, undefined, false, undefined, this);
|
|
2124
|
+
};
|
|
2125
|
+
var SubmitButton = ({
|
|
2126
|
+
children,
|
|
2127
|
+
messages: messages4
|
|
2128
|
+
}) => {
|
|
2129
|
+
const labels = formMessages(messages4);
|
|
2130
|
+
const form = useFormContext();
|
|
2131
|
+
return /* @__PURE__ */ jsxDEV14(form.Subscribe, {
|
|
2132
|
+
selector: (formState) => [formState.isSubmitting],
|
|
2133
|
+
children: ([isSubmitting]) => /* @__PURE__ */ jsxDEV14(Button, {
|
|
2134
|
+
type: "submit",
|
|
2135
|
+
disabled: isSubmitting,
|
|
2136
|
+
className: "self-start",
|
|
2137
|
+
children: [
|
|
2138
|
+
isSubmitting && /* @__PURE__ */ jsxDEV14(Loader2, {
|
|
2139
|
+
className: "animate-spin"
|
|
2140
|
+
}, undefined, false, undefined, this),
|
|
2141
|
+
children ?? labels.submit
|
|
2142
|
+
]
|
|
2143
|
+
}, undefined, true, undefined, this)
|
|
2144
|
+
}, undefined, false, undefined, this);
|
|
2145
|
+
};
|
|
2146
|
+
var getFormErrorText = (error) => {
|
|
2147
|
+
if (!error)
|
|
2148
|
+
return;
|
|
2149
|
+
if (typeof error === "object" && "form" in error) {
|
|
2150
|
+
const formError = error.form;
|
|
2151
|
+
return formError ? String(formError) : undefined;
|
|
2152
|
+
}
|
|
2153
|
+
return String(error);
|
|
2154
|
+
};
|
|
2155
|
+
var FormError = () => {
|
|
2156
|
+
const form = useFormContext();
|
|
2157
|
+
return /* @__PURE__ */ jsxDEV14(form.Subscribe, {
|
|
2158
|
+
selector: (formState) => getFormErrorText(formState.errorMap.onSubmit),
|
|
2159
|
+
children: (error) => error ? /* @__PURE__ */ jsxDEV14(ErrorMessage, {
|
|
2160
|
+
text: error
|
|
2161
|
+
}, undefined, false, undefined, this) : null
|
|
2162
|
+
}, undefined, false, undefined, this);
|
|
2163
|
+
};
|
|
2164
|
+
var FieldWrapper = ({
|
|
2165
|
+
children,
|
|
2166
|
+
legend,
|
|
2167
|
+
localized = true,
|
|
2168
|
+
description,
|
|
2169
|
+
locales: locales2,
|
|
2170
|
+
editingLocale
|
|
2171
|
+
}) => {
|
|
2172
|
+
return /* @__PURE__ */ jsxDEV14(FieldSet, {
|
|
2173
|
+
children: [
|
|
2174
|
+
legend && /* @__PURE__ */ jsxDEV14(FieldLegend, {
|
|
2175
|
+
className: "flex items-center gap-2",
|
|
2176
|
+
children: [
|
|
2177
|
+
legend,
|
|
2178
|
+
localized && editingLocale && locales2 && /* @__PURE__ */ jsxDEV14(Badge, {
|
|
2179
|
+
variant: "outline",
|
|
2180
|
+
children: [
|
|
2181
|
+
/* @__PURE__ */ jsxDEV14(Languages, {}, undefined, false, undefined, this),
|
|
2182
|
+
locales2.find((l) => l.value === editingLocale).label
|
|
2183
|
+
]
|
|
2184
|
+
}, undefined, true, undefined, this)
|
|
2185
|
+
]
|
|
2186
|
+
}, undefined, true, undefined, this),
|
|
2187
|
+
description && /* @__PURE__ */ jsxDEV14(FieldDescription, {
|
|
2188
|
+
children: description
|
|
2189
|
+
}, undefined, false, undefined, this),
|
|
2190
|
+
/* @__PURE__ */ jsxDEV14(FieldGroup, {
|
|
2191
|
+
children
|
|
2192
|
+
}, undefined, false, undefined, this)
|
|
2193
|
+
]
|
|
2194
|
+
}, undefined, true, undefined, this);
|
|
2195
|
+
};
|
|
2196
|
+
var RevertButton = ({
|
|
2197
|
+
messages: messages4,
|
|
2198
|
+
original
|
|
2199
|
+
}) => {
|
|
2200
|
+
const labels = formMessages(messages4);
|
|
2201
|
+
const field = useFieldContext();
|
|
2202
|
+
if (field.state.value !== original) {
|
|
2203
|
+
return /* @__PURE__ */ jsxDEV14("div", {
|
|
2204
|
+
className: "flex flex-1 justify-end",
|
|
2205
|
+
children: /* @__PURE__ */ jsxDEV14(Button, {
|
|
2206
|
+
variant: "link",
|
|
2207
|
+
className: "-mr-4 h-auto py-0",
|
|
2208
|
+
onClick: () => field.handleChange(original),
|
|
2209
|
+
children: labels.revert
|
|
2210
|
+
}, undefined, false, undefined, this)
|
|
2211
|
+
}, undefined, false, undefined, this);
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
var { useAppForm, withForm, withFieldGroup } = createFormHook({
|
|
2215
|
+
fieldContext,
|
|
2216
|
+
formContext,
|
|
2217
|
+
fieldComponents: {
|
|
2218
|
+
TextField,
|
|
2219
|
+
TextAreaField,
|
|
2220
|
+
SelectField,
|
|
2221
|
+
MultiSelectField,
|
|
2222
|
+
SearchableSelectField,
|
|
2223
|
+
CheckboxField,
|
|
2224
|
+
FileField,
|
|
2225
|
+
KeyValueField,
|
|
2226
|
+
ImageField,
|
|
2227
|
+
RevertButton
|
|
2228
|
+
},
|
|
2229
|
+
formComponents: {
|
|
2230
|
+
SubmitButton,
|
|
2231
|
+
FormError,
|
|
2232
|
+
FieldWrapper,
|
|
2233
|
+
BlockNavigation
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
export {
|
|
2237
|
+
withForm,
|
|
2238
|
+
withFieldGroup,
|
|
2239
|
+
useAppForm,
|
|
2240
|
+
formMessages,
|
|
2241
|
+
FieldWrapper,
|
|
2242
|
+
FieldError,
|
|
2243
|
+
ErrorMessage,
|
|
2244
|
+
BlockNavigation
|
|
2245
|
+
};
|