@elqnt/react 1.0.11 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.mts +3 -26
- package/dist/components/index.d.ts +3 -26
- package/dist/components/index.js +928 -1397
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +972 -1440
- package/dist/components/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -8
- package/dist/index.d.ts +2 -8
- package/dist/index.js +928 -1484
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +967 -1521
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -7
package/dist/index.js
CHANGED
|
@@ -53,7 +53,6 @@ __export(index_exports, {
|
|
|
53
53
|
DurationInput: () => DurationInput,
|
|
54
54
|
EloquentActionBar: () => EloquentActionBar,
|
|
55
55
|
FilterCombobox: () => FilterCombobox,
|
|
56
|
-
FilterDialog: () => FilterDialog,
|
|
57
56
|
Form: () => Form,
|
|
58
57
|
FormCombobox: () => FormCombobox,
|
|
59
58
|
FormControl: () => FormControl,
|
|
@@ -65,15 +64,12 @@ __export(index_exports, {
|
|
|
65
64
|
FormMessage: () => FormMessage,
|
|
66
65
|
FormRow: () => FormRow,
|
|
67
66
|
FormWithActionButtons: () => FormWithActionButtons,
|
|
68
|
-
Icon: () =>
|
|
67
|
+
Icon: () => Icon,
|
|
69
68
|
IconButton: () => IconButton,
|
|
70
69
|
Input: () => Input2,
|
|
71
|
-
KnowledgeGraphWordCloud: () => KnowledgeGraphWordCloud,
|
|
72
|
-
LeftNav: () => LeftNav,
|
|
73
70
|
MarkdownRenderer: () => MarkdownRenderer,
|
|
74
71
|
MultiSelect: () => MultiSelect,
|
|
75
72
|
MultiStepProcess: () => MultiStepProcess,
|
|
76
|
-
OrgSelector: () => OrgSelector,
|
|
77
73
|
PageHeader: () => PageHeader,
|
|
78
74
|
Popover: () => Popover2,
|
|
79
75
|
ProfileMenu: () => ProfileMenu,
|
|
@@ -99,11 +95,13 @@ __export(index_exports, {
|
|
|
99
95
|
getFieldType: () => getFieldType,
|
|
100
96
|
getFileIcon: () => getFileIcon,
|
|
101
97
|
getFileName: () => getFileName,
|
|
102
|
-
useFileUpload: () => useFileUpload,
|
|
103
98
|
useFormField: () => useFormField
|
|
104
99
|
});
|
|
105
100
|
module.exports = __toCommonJS(index_exports);
|
|
106
101
|
|
|
102
|
+
// components/form-controls/button.tsx
|
|
103
|
+
var React2 = __toESM(require("react"));
|
|
104
|
+
|
|
107
105
|
// components/ui/button.tsx
|
|
108
106
|
var React = __toESM(require("react"));
|
|
109
107
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
@@ -161,516 +159,12 @@ var Button = React.forwardRef(
|
|
|
161
159
|
);
|
|
162
160
|
Button.displayName = "Button";
|
|
163
161
|
|
|
164
|
-
// components/ui/dialog.tsx
|
|
165
|
-
var React2 = __toESM(require("react"));
|
|
166
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
167
|
-
var import_react_icons = require("@radix-ui/react-icons");
|
|
168
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
169
|
-
var Dialog = DialogPrimitive.Root;
|
|
170
|
-
var DialogTrigger = DialogPrimitive.Trigger;
|
|
171
|
-
var DialogPortal = DialogPrimitive.Portal;
|
|
172
|
-
var DialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
173
|
-
DialogPrimitive.Overlay,
|
|
174
|
-
{
|
|
175
|
-
ref,
|
|
176
|
-
className: cn(
|
|
177
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
178
|
-
className
|
|
179
|
-
),
|
|
180
|
-
...props
|
|
181
|
-
}
|
|
182
|
-
));
|
|
183
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
184
|
-
var DialogContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(DialogPortal, { children: [
|
|
185
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogOverlay, {}),
|
|
186
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
187
|
-
DialogPrimitive.Content,
|
|
188
|
-
{
|
|
189
|
-
ref,
|
|
190
|
-
className: cn(
|
|
191
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
192
|
-
className
|
|
193
|
-
),
|
|
194
|
-
...props,
|
|
195
|
-
children: [
|
|
196
|
-
children,
|
|
197
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
198
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_icons.Cross2Icon, { className: "h-4 w-4" }),
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Close" })
|
|
200
|
-
] })
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
] }));
|
|
205
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
206
|
-
var DialogHeader = ({
|
|
207
|
-
className,
|
|
208
|
-
...props
|
|
209
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
210
|
-
"div",
|
|
211
|
-
{
|
|
212
|
-
className: cn(
|
|
213
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
214
|
-
className
|
|
215
|
-
),
|
|
216
|
-
...props
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
DialogHeader.displayName = "DialogHeader";
|
|
220
|
-
var DialogFooter = ({
|
|
221
|
-
className,
|
|
222
|
-
...props
|
|
223
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
224
|
-
"div",
|
|
225
|
-
{
|
|
226
|
-
className: cn(
|
|
227
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
228
|
-
className
|
|
229
|
-
),
|
|
230
|
-
...props
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
DialogFooter.displayName = "DialogFooter";
|
|
234
|
-
var DialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
235
|
-
DialogPrimitive.Title,
|
|
236
|
-
{
|
|
237
|
-
ref,
|
|
238
|
-
className: cn(
|
|
239
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
240
|
-
className
|
|
241
|
-
),
|
|
242
|
-
...props
|
|
243
|
-
}
|
|
244
|
-
));
|
|
245
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
246
|
-
var DialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
247
|
-
DialogPrimitive.Description,
|
|
248
|
-
{
|
|
249
|
-
ref,
|
|
250
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
251
|
-
...props
|
|
252
|
-
}
|
|
253
|
-
));
|
|
254
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
255
|
-
|
|
256
|
-
// components/ui/input.tsx
|
|
257
|
-
var React3 = __toESM(require("react"));
|
|
258
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
259
|
-
var Input = React3.forwardRef(
|
|
260
|
-
({ className, type, ...props }, ref) => {
|
|
261
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
262
|
-
"input",
|
|
263
|
-
{
|
|
264
|
-
type,
|
|
265
|
-
className: cn(
|
|
266
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
267
|
-
className
|
|
268
|
-
),
|
|
269
|
-
ref,
|
|
270
|
-
...props
|
|
271
|
-
}
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
Input.displayName = "Input";
|
|
276
|
-
|
|
277
|
-
// components/ui/select.tsx
|
|
278
|
-
var React4 = __toESM(require("react"));
|
|
279
|
-
var import_react_icons2 = require("@radix-ui/react-icons");
|
|
280
|
-
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
281
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
282
|
-
var Select = SelectPrimitive.Root;
|
|
283
|
-
var SelectValue = SelectPrimitive.Value;
|
|
284
|
-
var SelectTrigger = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
285
|
-
SelectPrimitive.Trigger,
|
|
286
|
-
{
|
|
287
|
-
ref,
|
|
288
|
-
className: cn(
|
|
289
|
-
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
290
|
-
className
|
|
291
|
-
),
|
|
292
|
-
...props,
|
|
293
|
-
children: [
|
|
294
|
-
children,
|
|
295
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.CaretSortIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
));
|
|
299
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
300
|
-
var SelectScrollUpButton = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
301
|
-
SelectPrimitive.ScrollUpButton,
|
|
302
|
-
{
|
|
303
|
-
ref,
|
|
304
|
-
className: cn(
|
|
305
|
-
"flex cursor-default items-center justify-center py-1",
|
|
306
|
-
className
|
|
307
|
-
),
|
|
308
|
-
...props,
|
|
309
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.ChevronUpIcon, {})
|
|
310
|
-
}
|
|
311
|
-
));
|
|
312
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
313
|
-
var SelectScrollDownButton = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
314
|
-
SelectPrimitive.ScrollDownButton,
|
|
315
|
-
{
|
|
316
|
-
ref,
|
|
317
|
-
className: cn(
|
|
318
|
-
"flex cursor-default items-center justify-center py-1",
|
|
319
|
-
className
|
|
320
|
-
),
|
|
321
|
-
...props,
|
|
322
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.ChevronDownIcon, {})
|
|
323
|
-
}
|
|
324
|
-
));
|
|
325
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
326
|
-
var SelectContent = React4.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
327
|
-
SelectPrimitive.Content,
|
|
328
|
-
{
|
|
329
|
-
ref,
|
|
330
|
-
className: cn(
|
|
331
|
-
"relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
332
|
-
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
333
|
-
className
|
|
334
|
-
),
|
|
335
|
-
position,
|
|
336
|
-
...props,
|
|
337
|
-
children: [
|
|
338
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectScrollUpButton, {}),
|
|
339
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
340
|
-
SelectPrimitive.Viewport,
|
|
341
|
-
{
|
|
342
|
-
className: cn(
|
|
343
|
-
"p-1",
|
|
344
|
-
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
345
|
-
),
|
|
346
|
-
children
|
|
347
|
-
}
|
|
348
|
-
),
|
|
349
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectScrollDownButton, {})
|
|
350
|
-
]
|
|
351
|
-
}
|
|
352
|
-
) }));
|
|
353
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
354
|
-
var SelectLabel = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
355
|
-
SelectPrimitive.Label,
|
|
356
|
-
{
|
|
357
|
-
ref,
|
|
358
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
359
|
-
...props
|
|
360
|
-
}
|
|
361
|
-
));
|
|
362
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
363
|
-
var SelectItem = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
364
|
-
SelectPrimitive.Item,
|
|
365
|
-
{
|
|
366
|
-
ref,
|
|
367
|
-
className: cn(
|
|
368
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
369
|
-
className
|
|
370
|
-
),
|
|
371
|
-
...props,
|
|
372
|
-
children: [
|
|
373
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
374
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPrimitive.ItemText, { children })
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
));
|
|
378
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
379
|
-
var SelectSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
380
|
-
SelectPrimitive.Separator,
|
|
381
|
-
{
|
|
382
|
-
ref,
|
|
383
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
384
|
-
...props
|
|
385
|
-
}
|
|
386
|
-
));
|
|
387
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
388
|
-
|
|
389
|
-
// components/entities/filter-dialog.tsx
|
|
390
|
-
var import_entity = require("@elqnt/entity");
|
|
391
|
-
|
|
392
|
-
// components/ui/badge.tsx
|
|
393
|
-
var import_class_variance_authority2 = require("class-variance-authority");
|
|
394
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
395
|
-
var badgeVariants = (0, import_class_variance_authority2.cva)(
|
|
396
|
-
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
397
|
-
{
|
|
398
|
-
variants: {
|
|
399
|
-
variant: {
|
|
400
|
-
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
401
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
402
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
403
|
-
outline: "text-foreground"
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
defaultVariants: {
|
|
407
|
-
variant: "default"
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
);
|
|
411
|
-
function Badge({ className, variant, ...props }) {
|
|
412
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// components/entities/filter-dialog.tsx
|
|
416
|
-
var import_lucide_react = require("lucide-react");
|
|
417
|
-
var import_react = require("react");
|
|
418
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
419
|
-
var OPERATORS = {
|
|
420
|
-
string: ["eq", "ne", "contains", "startsWith", "endsWith"],
|
|
421
|
-
text: ["contains", "startsWith", "endsWith"],
|
|
422
|
-
int: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
423
|
-
float: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
424
|
-
date: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
425
|
-
datetime: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
426
|
-
dropdown: ["eq", "ne", "in", "nin"],
|
|
427
|
-
multiselect: ["in", "nin", "contains"],
|
|
428
|
-
boolean: ["eq", "ne"]
|
|
429
|
-
};
|
|
430
|
-
var OPERATOR_LABELS = {
|
|
431
|
-
eq: "Equals",
|
|
432
|
-
ne: "Not equals",
|
|
433
|
-
gt: "Greater than",
|
|
434
|
-
gte: "Greater than or equal",
|
|
435
|
-
lt: "Less than",
|
|
436
|
-
lte: "Less than or equal",
|
|
437
|
-
in: "In",
|
|
438
|
-
nin: "Not in",
|
|
439
|
-
contains: "Contains",
|
|
440
|
-
startsWith: "Starts with",
|
|
441
|
-
endsWith: "Ends with",
|
|
442
|
-
between: "Between"
|
|
443
|
-
};
|
|
444
|
-
var DEFAULT_CONDITION = {
|
|
445
|
-
field: "",
|
|
446
|
-
operator: "",
|
|
447
|
-
value: ""
|
|
448
|
-
};
|
|
449
|
-
function FilterDialog({ open, onOpenChange }) {
|
|
450
|
-
const { selectedDefinition } = (0, import_entity.useEntityDefinitionContext)();
|
|
451
|
-
const { updateParams, params } = (0, import_entity.useEntityRecordContext)();
|
|
452
|
-
const [conditions, setConditions] = (0, import_react.useState)([
|
|
453
|
-
DEFAULT_CONDITION
|
|
454
|
-
]);
|
|
455
|
-
const [hasActiveFilters, setHasActiveFilters] = (0, import_react.useState)(false);
|
|
456
|
-
(0, import_react.useEffect)(() => {
|
|
457
|
-
const hasFilters = params.filters && Object.keys(params.filters).length > 0;
|
|
458
|
-
setHasActiveFilters(hasFilters);
|
|
459
|
-
}, [params.filters]);
|
|
460
|
-
const fields = [];
|
|
461
|
-
const getOperatorsForField = (fieldType) => {
|
|
462
|
-
return OPERATORS[fieldType] || OPERATORS.string;
|
|
463
|
-
};
|
|
464
|
-
const handleAddCondition = () => {
|
|
465
|
-
setConditions([...conditions, { ...DEFAULT_CONDITION }]);
|
|
466
|
-
};
|
|
467
|
-
const handleRemoveCondition = (index) => {
|
|
468
|
-
setConditions(conditions.filter((_, i) => i !== index));
|
|
469
|
-
};
|
|
470
|
-
const handleFieldChange = (index, fieldName) => {
|
|
471
|
-
const newConditions = [...conditions];
|
|
472
|
-
newConditions[index] = {
|
|
473
|
-
...newConditions[index],
|
|
474
|
-
field: fieldName,
|
|
475
|
-
operator: "",
|
|
476
|
-
value: ""
|
|
477
|
-
};
|
|
478
|
-
setConditions(newConditions);
|
|
479
|
-
};
|
|
480
|
-
const handleOperatorChange = (index, operator) => {
|
|
481
|
-
const newConditions = [...conditions];
|
|
482
|
-
newConditions[index] = {
|
|
483
|
-
...newConditions[index],
|
|
484
|
-
operator
|
|
485
|
-
};
|
|
486
|
-
setConditions(newConditions);
|
|
487
|
-
};
|
|
488
|
-
const handleValueChange = (index, value) => {
|
|
489
|
-
const newConditions = [...conditions];
|
|
490
|
-
newConditions[index] = {
|
|
491
|
-
...newConditions[index],
|
|
492
|
-
value
|
|
493
|
-
};
|
|
494
|
-
setConditions(newConditions);
|
|
495
|
-
};
|
|
496
|
-
const handleClearFilters = () => {
|
|
497
|
-
setConditions([{ ...DEFAULT_CONDITION }]);
|
|
498
|
-
updateParams({ filters: {} });
|
|
499
|
-
setHasActiveFilters(false);
|
|
500
|
-
};
|
|
501
|
-
const handleApplyFilters = () => {
|
|
502
|
-
const validConditions = conditions.filter(
|
|
503
|
-
(c) => c.field && c.operator && c.value
|
|
504
|
-
);
|
|
505
|
-
if (validConditions.length === 0) {
|
|
506
|
-
updateParams({ filters: {} });
|
|
507
|
-
setHasActiveFilters(false);
|
|
508
|
-
onOpenChange(false);
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
const filters = {};
|
|
512
|
-
validConditions.forEach(({ field, operator, value }) => {
|
|
513
|
-
const fieldPath = `fields.${field}.valueString`;
|
|
514
|
-
switch (operator) {
|
|
515
|
-
case "contains":
|
|
516
|
-
filters[fieldPath] = { $regex: value, $options: "i" };
|
|
517
|
-
break;
|
|
518
|
-
case "startsWith":
|
|
519
|
-
filters[fieldPath] = { $regex: `^${value}`, $options: "i" };
|
|
520
|
-
break;
|
|
521
|
-
case "endsWith":
|
|
522
|
-
filters[fieldPath] = { $regex: `${value}$`, $options: "i" };
|
|
523
|
-
break;
|
|
524
|
-
default:
|
|
525
|
-
filters[fieldPath] = { [`$${operator}`]: value };
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
const query = {
|
|
529
|
-
filters: validConditions.length > 1 ? { $and: Object.entries(filters).map(([k, v]) => ({ [k]: v })) } : filters
|
|
530
|
-
};
|
|
531
|
-
updateParams(query);
|
|
532
|
-
setHasActiveFilters(true);
|
|
533
|
-
onOpenChange(false);
|
|
534
|
-
};
|
|
535
|
-
const getFieldByName = (fieldName) => {
|
|
536
|
-
return fields.find((f) => f.name === fieldName);
|
|
537
|
-
};
|
|
538
|
-
const activeFilterCount = conditions.filter(
|
|
539
|
-
(c) => c.field && c.operator && c.value
|
|
540
|
-
).length;
|
|
541
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
542
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center", children: [
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
544
|
-
Button,
|
|
545
|
-
{
|
|
546
|
-
onClick: () => onOpenChange(true),
|
|
547
|
-
variant: hasActiveFilters ? "secondary" : "outline",
|
|
548
|
-
className: cn("relative group", hasActiveFilters && "rounded-r-none"),
|
|
549
|
-
children: [
|
|
550
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.Filter, { className: "w-4 h-4 mr-2" }),
|
|
551
|
-
"Filter",
|
|
552
|
-
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
553
|
-
Badge,
|
|
554
|
-
{
|
|
555
|
-
variant: "secondary",
|
|
556
|
-
className: "ml-2 bg-primary text-primary-foreground",
|
|
557
|
-
children: activeFilterCount
|
|
558
|
-
}
|
|
559
|
-
)
|
|
560
|
-
]
|
|
561
|
-
}
|
|
562
|
-
),
|
|
563
|
-
hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
564
|
-
Button,
|
|
565
|
-
{
|
|
566
|
-
variant: "secondary",
|
|
567
|
-
size: "icon",
|
|
568
|
-
onClick: handleClearFilters,
|
|
569
|
-
className: "text-muted-foreground -ml-2 rounded-l-none",
|
|
570
|
-
title: "Clear filters",
|
|
571
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.Paintbrush, { className: "h-4 w-4" })
|
|
572
|
-
}
|
|
573
|
-
)
|
|
574
|
-
] }),
|
|
575
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(DialogContent, { className: "max-w-3xl", children: [
|
|
576
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
577
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(DialogTitle, { children: [
|
|
578
|
-
"Filter ",
|
|
579
|
-
selectedDefinition?.displayName
|
|
580
|
-
] }),
|
|
581
|
-
hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
582
|
-
Button,
|
|
583
|
-
{
|
|
584
|
-
variant: "ghost",
|
|
585
|
-
size: "sm",
|
|
586
|
-
onClick: handleClearFilters,
|
|
587
|
-
className: "text-muted-foreground hover:text-primary",
|
|
588
|
-
children: [
|
|
589
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.XCircle, { className: "w-4 h-4 mr-2" }),
|
|
590
|
-
"Clear Filters"
|
|
591
|
-
]
|
|
592
|
-
}
|
|
593
|
-
)
|
|
594
|
-
] }) }),
|
|
595
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-4", children: [
|
|
596
|
-
conditions.map((condition, index) => {
|
|
597
|
-
const selectedField = getFieldByName(condition.field);
|
|
598
|
-
const operators = selectedField ? getOperatorsForField(selectedField.type) : [];
|
|
599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
600
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
601
|
-
Select,
|
|
602
|
-
{
|
|
603
|
-
value: condition.field,
|
|
604
|
-
onValueChange: (value) => handleFieldChange(index, value),
|
|
605
|
-
children: [
|
|
606
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectTrigger, { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectValue, { placeholder: "Select field" }) }),
|
|
607
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectContent, { children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectItem, { value: field.name, children: field.displayName }, field.name)) })
|
|
608
|
-
]
|
|
609
|
-
}
|
|
610
|
-
),
|
|
611
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
612
|
-
Select,
|
|
613
|
-
{
|
|
614
|
-
value: condition.operator,
|
|
615
|
-
onValueChange: (value) => handleOperatorChange(index, value),
|
|
616
|
-
disabled: !condition.field,
|
|
617
|
-
children: [
|
|
618
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectTrigger, { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectValue, { placeholder: "Select operator" }) }),
|
|
619
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectContent, { children: operators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectItem, { value: op, children: OPERATOR_LABELS[op] }, op)) })
|
|
620
|
-
]
|
|
621
|
-
}
|
|
622
|
-
),
|
|
623
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
624
|
-
Input,
|
|
625
|
-
{
|
|
626
|
-
placeholder: "Value",
|
|
627
|
-
value: condition.value,
|
|
628
|
-
onChange: (e) => handleValueChange(index, e.target.value),
|
|
629
|
-
disabled: !condition.operator,
|
|
630
|
-
className: "flex-1"
|
|
631
|
-
}
|
|
632
|
-
),
|
|
633
|
-
conditions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
634
|
-
Button,
|
|
635
|
-
{
|
|
636
|
-
variant: "ghost",
|
|
637
|
-
size: "icon",
|
|
638
|
-
onClick: () => handleRemoveCondition(index),
|
|
639
|
-
className: "text-muted-foreground hover:text-destructive",
|
|
640
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.X, { className: "h-4 w-4" })
|
|
641
|
-
}
|
|
642
|
-
)
|
|
643
|
-
] }, index);
|
|
644
|
-
}),
|
|
645
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
646
|
-
Button,
|
|
647
|
-
{
|
|
648
|
-
variant: "outline",
|
|
649
|
-
size: "sm",
|
|
650
|
-
className: "w-full",
|
|
651
|
-
onClick: handleAddCondition,
|
|
652
|
-
children: [
|
|
653
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.Plus, { className: "h-4 w-4 mr-2" }),
|
|
654
|
-
"Add Condition"
|
|
655
|
-
]
|
|
656
|
-
}
|
|
657
|
-
)
|
|
658
|
-
] }),
|
|
659
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(DialogFooter, { children: [
|
|
660
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
661
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { onClick: handleApplyFilters, children: "Apply Filters" })
|
|
662
|
-
] })
|
|
663
|
-
] }) })
|
|
664
|
-
] });
|
|
665
|
-
}
|
|
666
|
-
|
|
667
162
|
// components/form-controls/button.tsx
|
|
668
|
-
var
|
|
669
|
-
var
|
|
670
|
-
var Button2 = React5.forwardRef(
|
|
163
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
164
|
+
var Button2 = React2.forwardRef(
|
|
671
165
|
({ children, variant = "default", className = "", type, ...props }, ref) => {
|
|
672
166
|
const buttonClass = `${variant === "secondary" ? "button-secondary" : ""} ${className}`;
|
|
673
|
-
return /* @__PURE__ */ (0,
|
|
167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
674
168
|
Button,
|
|
675
169
|
{
|
|
676
170
|
className: buttonClass,
|
|
@@ -686,22 +180,22 @@ var Button2 = React5.forwardRef(
|
|
|
686
180
|
Button2.displayName = "Button";
|
|
687
181
|
|
|
688
182
|
// components/form-controls/action-bar/back-button.tsx
|
|
689
|
-
var
|
|
183
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
690
184
|
function BackButton() {
|
|
691
|
-
return /* @__PURE__ */ (0,
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button2, { onClick: () => {
|
|
692
186
|
}, children: "Back" });
|
|
693
187
|
}
|
|
694
188
|
|
|
695
189
|
// components/form-controls/icon.tsx
|
|
696
|
-
var
|
|
697
|
-
var
|
|
698
|
-
var
|
|
699
|
-
var
|
|
700
|
-
const IconComponent =
|
|
190
|
+
var import_lucide_react = require("lucide-react");
|
|
191
|
+
var import_react = require("react");
|
|
192
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
193
|
+
var Icon = (0, import_react.memo)(({ name, className, strokeWidth, size }) => {
|
|
194
|
+
const IconComponent = import_lucide_react.icons[name];
|
|
701
195
|
if (!IconComponent) {
|
|
702
196
|
return null;
|
|
703
197
|
}
|
|
704
|
-
return /* @__PURE__ */ (0,
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
705
199
|
IconComponent,
|
|
706
200
|
{
|
|
707
201
|
className: cn(className),
|
|
@@ -710,37 +204,37 @@ var Icon2 = (0, import_react2.memo)(({ name, className, strokeWidth, size }) =>
|
|
|
710
204
|
}
|
|
711
205
|
);
|
|
712
206
|
});
|
|
713
|
-
|
|
207
|
+
Icon.displayName = "Icon";
|
|
714
208
|
|
|
715
209
|
// components/form-controls/action-bar/action-bar-button.tsx
|
|
716
|
-
var
|
|
210
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
717
211
|
function ActionBarButton({
|
|
718
212
|
label,
|
|
719
213
|
onClick,
|
|
720
214
|
icon
|
|
721
215
|
}) {
|
|
722
|
-
return /* @__PURE__ */ (0,
|
|
723
|
-
/* @__PURE__ */ (0,
|
|
216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Button2, { onClick, className: "flex items-center gap-2", children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: icon, size: 20, strokeWidth: 1 }),
|
|
724
218
|
label
|
|
725
219
|
] });
|
|
726
220
|
}
|
|
727
221
|
|
|
728
222
|
// components/form-controls/action-bar/action-bar.tsx
|
|
729
|
-
var
|
|
223
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
730
224
|
var ActionBar = ({ actions }) => {
|
|
731
225
|
function backHandler() {
|
|
732
226
|
window.history.back();
|
|
733
227
|
}
|
|
734
|
-
return /* @__PURE__ */ (0,
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
736
|
-
actions.map((item) => /* @__PURE__ */ (0,
|
|
228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-center gap-4 bg-primary text-primary-foreground shadow rounded-md text-sm font-medium w-fit divide-solid divide-x", children: [
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cursor-pointer pl-4 py-2", onClick: backHandler, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "ArrowBigLeft" }) }),
|
|
230
|
+
actions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
737
231
|
"div",
|
|
738
232
|
{
|
|
739
233
|
className: "flex items-center justify-center gap-2 cursor-pointer py-2 px-4",
|
|
740
234
|
onClick: item.onClick,
|
|
741
235
|
children: [
|
|
742
|
-
/* @__PURE__ */ (0,
|
|
743
|
-
/* @__PURE__ */ (0,
|
|
236
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: item.icon }),
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: item.label })
|
|
744
238
|
]
|
|
745
239
|
},
|
|
746
240
|
item.label
|
|
@@ -749,10 +243,10 @@ var ActionBar = ({ actions }) => {
|
|
|
749
243
|
};
|
|
750
244
|
|
|
751
245
|
// components/ui/alert.tsx
|
|
752
|
-
var
|
|
753
|
-
var
|
|
754
|
-
var
|
|
755
|
-
var alertVariants = (0,
|
|
246
|
+
var React3 = __toESM(require("react"));
|
|
247
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
248
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
249
|
+
var alertVariants = (0, import_class_variance_authority2.cva)(
|
|
756
250
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
757
251
|
{
|
|
758
252
|
variants: {
|
|
@@ -766,7 +260,7 @@ var alertVariants = (0, import_class_variance_authority3.cva)(
|
|
|
766
260
|
}
|
|
767
261
|
}
|
|
768
262
|
);
|
|
769
|
-
var Alert =
|
|
263
|
+
var Alert = React3.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
770
264
|
"div",
|
|
771
265
|
{
|
|
772
266
|
ref,
|
|
@@ -776,7 +270,7 @@ var Alert = React6.forwardRef(({ className, variant, ...props }, ref) => /* @__P
|
|
|
776
270
|
}
|
|
777
271
|
));
|
|
778
272
|
Alert.displayName = "Alert";
|
|
779
|
-
var AlertTitle =
|
|
273
|
+
var AlertTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
780
274
|
"h5",
|
|
781
275
|
{
|
|
782
276
|
ref,
|
|
@@ -785,7 +279,7 @@ var AlertTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
785
279
|
}
|
|
786
280
|
));
|
|
787
281
|
AlertTitle.displayName = "AlertTitle";
|
|
788
|
-
var AlertDescription =
|
|
282
|
+
var AlertDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
789
283
|
"div",
|
|
790
284
|
{
|
|
791
285
|
ref,
|
|
@@ -796,21 +290,21 @@ var AlertDescription = React6.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
796
290
|
AlertDescription.displayName = "AlertDescription";
|
|
797
291
|
|
|
798
292
|
// components/form-controls/alert.tsx
|
|
799
|
-
var
|
|
800
|
-
var
|
|
293
|
+
var import_react_icons = require("@radix-ui/react-icons");
|
|
294
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
801
295
|
var Alert2 = ({ title, description }) => {
|
|
802
|
-
return /* @__PURE__ */ (0,
|
|
803
|
-
/* @__PURE__ */ (0,
|
|
804
|
-
/* @__PURE__ */ (0,
|
|
805
|
-
/* @__PURE__ */ (0,
|
|
296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Alert, { children: [
|
|
297
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_icons.RocketIcon, { className: "h-4 w-4" }),
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AlertTitle, { children: title }),
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AlertDescription, { children: description })
|
|
806
300
|
] });
|
|
807
301
|
};
|
|
808
302
|
|
|
809
303
|
// components/ui/avatar.tsx
|
|
810
|
-
var
|
|
304
|
+
var React4 = __toESM(require("react"));
|
|
811
305
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
812
|
-
var
|
|
813
|
-
var Avatar =
|
|
306
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
307
|
+
var Avatar = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
814
308
|
AvatarPrimitive.Root,
|
|
815
309
|
{
|
|
816
310
|
ref,
|
|
@@ -822,7 +316,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
822
316
|
}
|
|
823
317
|
));
|
|
824
318
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
825
|
-
var AvatarImage =
|
|
319
|
+
var AvatarImage = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
826
320
|
AvatarPrimitive.Image,
|
|
827
321
|
{
|
|
828
322
|
ref,
|
|
@@ -831,7 +325,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
831
325
|
}
|
|
832
326
|
));
|
|
833
327
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
834
|
-
var AvatarFallback =
|
|
328
|
+
var AvatarFallback = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
835
329
|
AvatarPrimitive.Fallback,
|
|
836
330
|
{
|
|
837
331
|
ref,
|
|
@@ -845,25 +339,25 @@ var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
845
339
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
846
340
|
|
|
847
341
|
// components/form-controls/avatar.tsx
|
|
848
|
-
var
|
|
342
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
849
343
|
var Avatar2 = ({ image, fallback }) => {
|
|
850
|
-
return /* @__PURE__ */ (0,
|
|
851
|
-
/* @__PURE__ */ (0,
|
|
852
|
-
/* @__PURE__ */ (0,
|
|
344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Avatar, { className: "w-fit", children: [
|
|
345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AvatarImage, { src: image }),
|
|
346
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AvatarFallback, { children: fallback })
|
|
853
347
|
] });
|
|
854
348
|
};
|
|
855
349
|
|
|
856
350
|
// components/form-controls/breadcrumb.tsx
|
|
857
|
-
var
|
|
351
|
+
var import_react2 = require("react");
|
|
858
352
|
|
|
859
353
|
// components/ui/breadcrumb.tsx
|
|
860
|
-
var
|
|
861
|
-
var
|
|
354
|
+
var React5 = __toESM(require("react"));
|
|
355
|
+
var import_react_icons2 = require("@radix-ui/react-icons");
|
|
862
356
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
863
|
-
var
|
|
864
|
-
var Breadcrumb =
|
|
357
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
358
|
+
var Breadcrumb = React5.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
865
359
|
Breadcrumb.displayName = "Breadcrumb";
|
|
866
|
-
var BreadcrumbList =
|
|
360
|
+
var BreadcrumbList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
867
361
|
"ol",
|
|
868
362
|
{
|
|
869
363
|
ref,
|
|
@@ -875,7 +369,7 @@ var BreadcrumbList = React8.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
875
369
|
}
|
|
876
370
|
));
|
|
877
371
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
878
|
-
var BreadcrumbItem =
|
|
372
|
+
var BreadcrumbItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
879
373
|
"li",
|
|
880
374
|
{
|
|
881
375
|
ref,
|
|
@@ -884,9 +378,9 @@ var BreadcrumbItem = React8.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
884
378
|
}
|
|
885
379
|
));
|
|
886
380
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
887
|
-
var BreadcrumbLink =
|
|
381
|
+
var BreadcrumbLink = React5.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
888
382
|
const Comp = asChild ? import_react_slot2.Slot : "a";
|
|
889
|
-
return /* @__PURE__ */ (0,
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
890
384
|
Comp,
|
|
891
385
|
{
|
|
892
386
|
ref,
|
|
@@ -896,7 +390,7 @@ var BreadcrumbLink = React8.forwardRef(({ asChild, className, ...props }, ref) =
|
|
|
896
390
|
);
|
|
897
391
|
});
|
|
898
392
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
899
|
-
var BreadcrumbPage =
|
|
393
|
+
var BreadcrumbPage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
900
394
|
"span",
|
|
901
395
|
{
|
|
902
396
|
ref,
|
|
@@ -912,21 +406,21 @@ var BreadcrumbSeparator = ({
|
|
|
912
406
|
children,
|
|
913
407
|
className,
|
|
914
408
|
...props
|
|
915
|
-
}) => /* @__PURE__ */ (0,
|
|
409
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
916
410
|
"li",
|
|
917
411
|
{
|
|
918
412
|
role: "presentation",
|
|
919
413
|
"aria-hidden": "true",
|
|
920
414
|
className: cn("[&>svg]:size-3.5", className),
|
|
921
415
|
...props,
|
|
922
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
416
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_icons2.ChevronRightIcon, {})
|
|
923
417
|
}
|
|
924
418
|
);
|
|
925
419
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
926
420
|
var BreadcrumbEllipsis = ({
|
|
927
421
|
className,
|
|
928
422
|
...props
|
|
929
|
-
}) => /* @__PURE__ */ (0,
|
|
423
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
930
424
|
"span",
|
|
931
425
|
{
|
|
932
426
|
role: "presentation",
|
|
@@ -934,26 +428,26 @@ var BreadcrumbEllipsis = ({
|
|
|
934
428
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
935
429
|
...props,
|
|
936
430
|
children: [
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
431
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_icons2.DotsHorizontalIcon, { className: "h-4 w-4" }),
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "More" })
|
|
939
433
|
]
|
|
940
434
|
}
|
|
941
435
|
);
|
|
942
436
|
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
943
437
|
|
|
944
438
|
// components/form-controls/breadcrumb.tsx
|
|
945
|
-
var
|
|
439
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
946
440
|
var Breadcrumb2 = ({ breadcrumb }) => {
|
|
947
|
-
return /* @__PURE__ */ (0,
|
|
948
|
-
/* @__PURE__ */ (0,
|
|
949
|
-
index < breadcrumb.length - 1 && /* @__PURE__ */ (0,
|
|
441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Breadcrumb, { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BreadcrumbList, { children: breadcrumb.map(({ href, label }, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react2.Fragment, { children: [
|
|
442
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BreadcrumbItem, { children: index !== breadcrumb.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BreadcrumbLink, { className: "cursor-pointer", href, children: label.replace(/-/g, " ") }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BreadcrumbPage, { children: label.replace(/-/g, " ") }) }),
|
|
443
|
+
index < breadcrumb.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BreadcrumbSeparator, {})
|
|
950
444
|
] }, index)) }) });
|
|
951
445
|
};
|
|
952
446
|
|
|
953
447
|
// components/ui/card.tsx
|
|
954
|
-
var
|
|
955
|
-
var
|
|
956
|
-
var Card =
|
|
448
|
+
var React6 = __toESM(require("react"));
|
|
449
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
450
|
+
var Card = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
957
451
|
"div",
|
|
958
452
|
{
|
|
959
453
|
ref,
|
|
@@ -965,7 +459,7 @@ var Card = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (
|
|
|
965
459
|
}
|
|
966
460
|
));
|
|
967
461
|
Card.displayName = "Card";
|
|
968
|
-
var CardHeader =
|
|
462
|
+
var CardHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
969
463
|
"div",
|
|
970
464
|
{
|
|
971
465
|
ref,
|
|
@@ -974,7 +468,7 @@ var CardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
974
468
|
}
|
|
975
469
|
));
|
|
976
470
|
CardHeader.displayName = "CardHeader";
|
|
977
|
-
var CardTitle =
|
|
471
|
+
var CardTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
978
472
|
"h3",
|
|
979
473
|
{
|
|
980
474
|
ref,
|
|
@@ -983,7 +477,7 @@ var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
983
477
|
}
|
|
984
478
|
));
|
|
985
479
|
CardTitle.displayName = "CardTitle";
|
|
986
|
-
var CardDescription =
|
|
480
|
+
var CardDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
987
481
|
"p",
|
|
988
482
|
{
|
|
989
483
|
ref,
|
|
@@ -992,9 +486,9 @@ var CardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
992
486
|
}
|
|
993
487
|
));
|
|
994
488
|
CardDescription.displayName = "CardDescription";
|
|
995
|
-
var CardContent =
|
|
489
|
+
var CardContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
996
490
|
CardContent.displayName = "CardContent";
|
|
997
|
-
var CardFooter =
|
|
491
|
+
var CardFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
998
492
|
"div",
|
|
999
493
|
{
|
|
1000
494
|
ref,
|
|
@@ -1005,27 +499,27 @@ var CardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1005
499
|
CardFooter.displayName = "CardFooter";
|
|
1006
500
|
|
|
1007
501
|
// components/form-controls/card.tsx
|
|
1008
|
-
var
|
|
502
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1009
503
|
var Card2 = ({ title, description, content, footer }) => {
|
|
1010
|
-
return /* @__PURE__ */ (0,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
description && /* @__PURE__ */ (0,
|
|
504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Card, { children: [
|
|
505
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(CardHeader, { children: [
|
|
506
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CardTitle, { children: title }),
|
|
507
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CardDescription, { children: description })
|
|
1014
508
|
] }),
|
|
1015
|
-
/* @__PURE__ */ (0,
|
|
1016
|
-
footer && /* @__PURE__ */ (0,
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: content }) }),
|
|
510
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CardFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: footer }) })
|
|
1017
511
|
] });
|
|
1018
512
|
};
|
|
1019
513
|
|
|
1020
514
|
// components/form-controls/checkbox.tsx
|
|
1021
|
-
var
|
|
515
|
+
var React10 = __toESM(require("react"));
|
|
1022
516
|
|
|
1023
517
|
// components/ui/checkbox.tsx
|
|
1024
|
-
var
|
|
518
|
+
var React7 = __toESM(require("react"));
|
|
1025
519
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1026
|
-
var
|
|
1027
|
-
var
|
|
1028
|
-
var Checkbox =
|
|
520
|
+
var import_react_icons3 = require("@radix-ui/react-icons");
|
|
521
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
522
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1029
523
|
CheckboxPrimitive.Root,
|
|
1030
524
|
{
|
|
1031
525
|
ref,
|
|
@@ -1034,11 +528,11 @@ var Checkbox = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1034
528
|
className
|
|
1035
529
|
),
|
|
1036
530
|
...props,
|
|
1037
|
-
children: /* @__PURE__ */ (0,
|
|
531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1038
532
|
CheckboxPrimitive.Indicator,
|
|
1039
533
|
{
|
|
1040
534
|
className: cn("flex items-center justify-center text-current"),
|
|
1041
|
-
children: /* @__PURE__ */ (0,
|
|
535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_icons3.CheckIcon, { className: "h-4 w-4" })
|
|
1042
536
|
}
|
|
1043
537
|
)
|
|
1044
538
|
}
|
|
@@ -1046,19 +540,19 @@ var Checkbox = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1046
540
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
1047
541
|
|
|
1048
542
|
// components/ui/form.tsx
|
|
1049
|
-
var
|
|
543
|
+
var React9 = __toESM(require("react"));
|
|
1050
544
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
1051
545
|
var import_react_hook_form = require("react-hook-form");
|
|
1052
546
|
|
|
1053
547
|
// components/ui/label.tsx
|
|
1054
|
-
var
|
|
548
|
+
var React8 = __toESM(require("react"));
|
|
1055
549
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
1056
|
-
var
|
|
1057
|
-
var
|
|
1058
|
-
var labelVariants = (0,
|
|
550
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
551
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
552
|
+
var labelVariants = (0, import_class_variance_authority3.cva)(
|
|
1059
553
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1060
554
|
);
|
|
1061
|
-
var
|
|
555
|
+
var Label = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1062
556
|
LabelPrimitive.Root,
|
|
1063
557
|
{
|
|
1064
558
|
ref,
|
|
@@ -1066,22 +560,22 @@ var Label2 = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
1066
560
|
...props
|
|
1067
561
|
}
|
|
1068
562
|
));
|
|
1069
|
-
|
|
563
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
1070
564
|
|
|
1071
565
|
// components/ui/form.tsx
|
|
1072
|
-
var
|
|
566
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1073
567
|
var Form = import_react_hook_form.FormProvider;
|
|
1074
|
-
var FormFieldContext =
|
|
568
|
+
var FormFieldContext = React9.createContext(
|
|
1075
569
|
{}
|
|
1076
570
|
);
|
|
1077
571
|
var FormField = ({
|
|
1078
572
|
...props
|
|
1079
573
|
}) => {
|
|
1080
|
-
return /* @__PURE__ */ (0,
|
|
574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_hook_form.Controller, { ...props }) });
|
|
1081
575
|
};
|
|
1082
576
|
var useFormField = () => {
|
|
1083
|
-
const fieldContext =
|
|
1084
|
-
const itemContext =
|
|
577
|
+
const fieldContext = React9.useContext(FormFieldContext);
|
|
578
|
+
const itemContext = React9.useContext(FormItemContext);
|
|
1085
579
|
const { getFieldState, formState } = (0, import_react_hook_form.useFormContext)();
|
|
1086
580
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
1087
581
|
if (!fieldContext) {
|
|
@@ -1097,18 +591,18 @@ var useFormField = () => {
|
|
|
1097
591
|
...fieldState
|
|
1098
592
|
};
|
|
1099
593
|
};
|
|
1100
|
-
var FormItemContext =
|
|
594
|
+
var FormItemContext = React9.createContext(
|
|
1101
595
|
{}
|
|
1102
596
|
);
|
|
1103
|
-
var FormItem =
|
|
1104
|
-
const id =
|
|
1105
|
-
return /* @__PURE__ */ (0,
|
|
597
|
+
var FormItem = React9.forwardRef(({ className, ...props }, ref) => {
|
|
598
|
+
const id = React9.useId();
|
|
599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
1106
600
|
});
|
|
1107
601
|
FormItem.displayName = "FormItem";
|
|
1108
|
-
var FormLabel =
|
|
602
|
+
var FormLabel = React9.forwardRef(({ className, ...props }, ref) => {
|
|
1109
603
|
const { error, formItemId } = useFormField();
|
|
1110
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
-
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
605
|
+
Label,
|
|
1112
606
|
{
|
|
1113
607
|
ref,
|
|
1114
608
|
className: cn(error && "text-destructive", className),
|
|
@@ -1118,9 +612,9 @@ var FormLabel = React12.forwardRef(({ className, ...props }, ref) => {
|
|
|
1118
612
|
);
|
|
1119
613
|
});
|
|
1120
614
|
FormLabel.displayName = "FormLabel";
|
|
1121
|
-
var FormControl =
|
|
615
|
+
var FormControl = React9.forwardRef(({ ...props }, ref) => {
|
|
1122
616
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1123
|
-
return /* @__PURE__ */ (0,
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1124
618
|
import_react_slot3.Slot,
|
|
1125
619
|
{
|
|
1126
620
|
ref,
|
|
@@ -1132,9 +626,9 @@ var FormControl = React12.forwardRef(({ ...props }, ref) => {
|
|
|
1132
626
|
);
|
|
1133
627
|
});
|
|
1134
628
|
FormControl.displayName = "FormControl";
|
|
1135
|
-
var FormDescription =
|
|
629
|
+
var FormDescription = React9.forwardRef(({ className, ...props }, ref) => {
|
|
1136
630
|
const { formDescriptionId } = useFormField();
|
|
1137
|
-
return /* @__PURE__ */ (0,
|
|
631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1138
632
|
"p",
|
|
1139
633
|
{
|
|
1140
634
|
ref,
|
|
@@ -1145,13 +639,13 @@ var FormDescription = React12.forwardRef(({ className, ...props }, ref) => {
|
|
|
1145
639
|
);
|
|
1146
640
|
});
|
|
1147
641
|
FormDescription.displayName = "FormDescription";
|
|
1148
|
-
var FormMessage =
|
|
642
|
+
var FormMessage = React9.forwardRef(({ className, children, ...props }, ref) => {
|
|
1149
643
|
const { error, formMessageId } = useFormField();
|
|
1150
644
|
const body = error ? String(error?.message) : children;
|
|
1151
645
|
if (!body) {
|
|
1152
646
|
return null;
|
|
1153
647
|
}
|
|
1154
|
-
return /* @__PURE__ */ (0,
|
|
648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1155
649
|
"p",
|
|
1156
650
|
{
|
|
1157
651
|
ref,
|
|
@@ -1165,16 +659,16 @@ var FormMessage = React12.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1165
659
|
FormMessage.displayName = "FormMessage";
|
|
1166
660
|
|
|
1167
661
|
// components/form-controls/checkbox.tsx
|
|
1168
|
-
var
|
|
1169
|
-
var Checkbox2 =
|
|
1170
|
-
({ className, title, name, control, isFormField, ...props }, ref) => isFormField ? /* @__PURE__ */ (0,
|
|
662
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
663
|
+
var Checkbox2 = React10.forwardRef(
|
|
664
|
+
({ className, title, name, control, isFormField, ...props }, ref) => isFormField ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1171
665
|
FormField,
|
|
1172
666
|
{
|
|
1173
667
|
control,
|
|
1174
668
|
name,
|
|
1175
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
1176
|
-
/* @__PURE__ */ (0,
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
669
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(FormItem, { children: [
|
|
670
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FormLabel, { children: title }),
|
|
671
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1178
672
|
Checkbox,
|
|
1179
673
|
{
|
|
1180
674
|
className,
|
|
@@ -1182,23 +676,117 @@ var Checkbox2 = React13.forwardRef(
|
|
|
1182
676
|
onCheckedChange: field.onChange
|
|
1183
677
|
}
|
|
1184
678
|
) }),
|
|
1185
|
-
/* @__PURE__ */ (0,
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FormMessage, {})
|
|
1186
680
|
] })
|
|
1187
681
|
}
|
|
1188
|
-
) : /* @__PURE__ */ (0,
|
|
682
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Checkbox, { ref, className, ...props })
|
|
1189
683
|
);
|
|
1190
684
|
Checkbox2.displayName = "Checkbox";
|
|
1191
685
|
|
|
1192
686
|
// components/form-controls/combobox.tsx
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
687
|
+
var import_lucide_react2 = require("lucide-react");
|
|
688
|
+
var import_react3 = require("react");
|
|
1195
689
|
|
|
1196
690
|
// components/ui/command.tsx
|
|
1197
|
-
var
|
|
1198
|
-
var
|
|
691
|
+
var React12 = __toESM(require("react"));
|
|
692
|
+
var import_react_icons5 = require("@radix-ui/react-icons");
|
|
1199
693
|
var import_cmdk = require("cmdk");
|
|
1200
|
-
|
|
1201
|
-
|
|
694
|
+
|
|
695
|
+
// components/ui/dialog.tsx
|
|
696
|
+
var React11 = __toESM(require("react"));
|
|
697
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
698
|
+
var import_react_icons4 = require("@radix-ui/react-icons");
|
|
699
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
700
|
+
var Dialog = DialogPrimitive.Root;
|
|
701
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
702
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
703
|
+
var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
704
|
+
DialogPrimitive.Overlay,
|
|
705
|
+
{
|
|
706
|
+
ref,
|
|
707
|
+
className: cn(
|
|
708
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
709
|
+
className
|
|
710
|
+
),
|
|
711
|
+
...props
|
|
712
|
+
}
|
|
713
|
+
));
|
|
714
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
715
|
+
var DialogContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogPortal, { children: [
|
|
716
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogOverlay, {}),
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
718
|
+
DialogPrimitive.Content,
|
|
719
|
+
{
|
|
720
|
+
ref,
|
|
721
|
+
className: cn(
|
|
722
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
723
|
+
className
|
|
724
|
+
),
|
|
725
|
+
...props,
|
|
726
|
+
children: [
|
|
727
|
+
children,
|
|
728
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_icons4.Cross2Icon, { className: "h-4 w-4" }),
|
|
730
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: "Close" })
|
|
731
|
+
] })
|
|
732
|
+
]
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
] }));
|
|
736
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
737
|
+
var DialogHeader = ({
|
|
738
|
+
className,
|
|
739
|
+
...props
|
|
740
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
741
|
+
"div",
|
|
742
|
+
{
|
|
743
|
+
className: cn(
|
|
744
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
745
|
+
className
|
|
746
|
+
),
|
|
747
|
+
...props
|
|
748
|
+
}
|
|
749
|
+
);
|
|
750
|
+
DialogHeader.displayName = "DialogHeader";
|
|
751
|
+
var DialogFooter = ({
|
|
752
|
+
className,
|
|
753
|
+
...props
|
|
754
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
755
|
+
"div",
|
|
756
|
+
{
|
|
757
|
+
className: cn(
|
|
758
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
759
|
+
className
|
|
760
|
+
),
|
|
761
|
+
...props
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
DialogFooter.displayName = "DialogFooter";
|
|
765
|
+
var DialogTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
766
|
+
DialogPrimitive.Title,
|
|
767
|
+
{
|
|
768
|
+
ref,
|
|
769
|
+
className: cn(
|
|
770
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
771
|
+
className
|
|
772
|
+
),
|
|
773
|
+
...props
|
|
774
|
+
}
|
|
775
|
+
));
|
|
776
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
777
|
+
var DialogDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
778
|
+
DialogPrimitive.Description,
|
|
779
|
+
{
|
|
780
|
+
ref,
|
|
781
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
782
|
+
...props
|
|
783
|
+
}
|
|
784
|
+
));
|
|
785
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
786
|
+
|
|
787
|
+
// components/ui/command.tsx
|
|
788
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
789
|
+
var Command = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1202
790
|
import_cmdk.Command,
|
|
1203
791
|
{
|
|
1204
792
|
ref,
|
|
@@ -1210,9 +798,9 @@ var Command = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1210
798
|
}
|
|
1211
799
|
));
|
|
1212
800
|
Command.displayName = import_cmdk.Command.displayName;
|
|
1213
|
-
var CommandInput =
|
|
1214
|
-
/* @__PURE__ */ (0,
|
|
1215
|
-
/* @__PURE__ */ (0,
|
|
801
|
+
var CommandInput = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
802
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_icons5.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1216
804
|
import_cmdk.Command.Input,
|
|
1217
805
|
{
|
|
1218
806
|
ref,
|
|
@@ -1225,7 +813,7 @@ var CommandInput = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1225
813
|
)
|
|
1226
814
|
] }));
|
|
1227
815
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
1228
|
-
var CommandList =
|
|
816
|
+
var CommandList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1229
817
|
import_cmdk.Command.List,
|
|
1230
818
|
{
|
|
1231
819
|
ref,
|
|
@@ -1234,7 +822,7 @@ var CommandList = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1234
822
|
}
|
|
1235
823
|
));
|
|
1236
824
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
1237
|
-
var CommandEmpty =
|
|
825
|
+
var CommandEmpty = React12.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1238
826
|
import_cmdk.Command.Empty,
|
|
1239
827
|
{
|
|
1240
828
|
ref,
|
|
@@ -1243,7 +831,7 @@ var CommandEmpty = React14.forwardRef((props, ref) => /* @__PURE__ */ (0, import
|
|
|
1243
831
|
}
|
|
1244
832
|
));
|
|
1245
833
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
1246
|
-
var CommandGroup =
|
|
834
|
+
var CommandGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1247
835
|
import_cmdk.Command.Group,
|
|
1248
836
|
{
|
|
1249
837
|
ref,
|
|
@@ -1255,7 +843,7 @@ var CommandGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1255
843
|
}
|
|
1256
844
|
));
|
|
1257
845
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
1258
|
-
var CommandSeparator =
|
|
846
|
+
var CommandSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1259
847
|
import_cmdk.Command.Separator,
|
|
1260
848
|
{
|
|
1261
849
|
ref,
|
|
@@ -1264,7 +852,7 @@ var CommandSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1264
852
|
}
|
|
1265
853
|
));
|
|
1266
854
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
1267
|
-
var CommandItem =
|
|
855
|
+
var CommandItem = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1268
856
|
import_cmdk.Command.Item,
|
|
1269
857
|
{
|
|
1270
858
|
ref,
|
|
@@ -1280,7 +868,7 @@ var CommandShortcut = ({
|
|
|
1280
868
|
className,
|
|
1281
869
|
...props
|
|
1282
870
|
}) => {
|
|
1283
|
-
return /* @__PURE__ */ (0,
|
|
871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1284
872
|
"span",
|
|
1285
873
|
{
|
|
1286
874
|
className: cn(
|
|
@@ -1294,12 +882,12 @@ var CommandShortcut = ({
|
|
|
1294
882
|
CommandShortcut.displayName = "CommandShortcut";
|
|
1295
883
|
|
|
1296
884
|
// components/ui/popover.tsx
|
|
1297
|
-
var
|
|
885
|
+
var React13 = __toESM(require("react"));
|
|
1298
886
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
1299
|
-
var
|
|
887
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1300
888
|
var Popover = PopoverPrimitive.Root;
|
|
1301
889
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1302
|
-
var PopoverContent =
|
|
890
|
+
var PopoverContent = React13.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1303
891
|
PopoverPrimitive.Content,
|
|
1304
892
|
{
|
|
1305
893
|
ref,
|
|
@@ -1315,7 +903,7 @@ var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffs
|
|
|
1315
903
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1316
904
|
|
|
1317
905
|
// components/form-controls/combobox.tsx
|
|
1318
|
-
var
|
|
906
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1319
907
|
function Combobox({
|
|
1320
908
|
label,
|
|
1321
909
|
options,
|
|
@@ -1325,14 +913,14 @@ function Combobox({
|
|
|
1325
913
|
control,
|
|
1326
914
|
name
|
|
1327
915
|
}) {
|
|
1328
|
-
const [open, setOpen] = (0,
|
|
1329
|
-
const [value, setValue] = (0,
|
|
1330
|
-
(0,
|
|
916
|
+
const [open, setOpen] = (0, import_react3.useState)(false);
|
|
917
|
+
const [value, setValue] = (0, import_react3.useState)(defaultValue);
|
|
918
|
+
(0, import_react3.useEffect)(() => {
|
|
1331
919
|
setValue(defaultValue);
|
|
1332
920
|
}, [defaultValue]);
|
|
1333
921
|
if (!isFormField) {
|
|
1334
|
-
return /* @__PURE__ */ (0,
|
|
1335
|
-
/* @__PURE__ */ (0,
|
|
922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1336
924
|
Button,
|
|
1337
925
|
{
|
|
1338
926
|
variant: "outline",
|
|
@@ -1341,14 +929,14 @@ function Combobox({
|
|
|
1341
929
|
className: "w-full justify-between capitalize",
|
|
1342
930
|
children: [
|
|
1343
931
|
value ? options.find((option) => option.value === value)?.label || label : label,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react2.ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1345
933
|
]
|
|
1346
934
|
}
|
|
1347
935
|
) }),
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1351
|
-
/* @__PURE__ */ (0,
|
|
936
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverContent, { className: "w-full p-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Command, { children: [
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandInput, { placeholder: "Search..." }),
|
|
938
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandEmpty, { children: "No item found." }),
|
|
939
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandList, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandGroup, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1352
940
|
CommandItem,
|
|
1353
941
|
{
|
|
1354
942
|
value: option.value,
|
|
@@ -1358,8 +946,8 @@ function Combobox({
|
|
|
1358
946
|
setOpen(false);
|
|
1359
947
|
},
|
|
1360
948
|
children: [
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
950
|
+
import_lucide_react2.Check,
|
|
1363
951
|
{
|
|
1364
952
|
className: cn(
|
|
1365
953
|
"mr-2 h-4 w-4",
|
|
@@ -1375,15 +963,15 @@ function Combobox({
|
|
|
1375
963
|
] }) })
|
|
1376
964
|
] });
|
|
1377
965
|
}
|
|
1378
|
-
return /* @__PURE__ */ (0,
|
|
966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1379
967
|
FormField,
|
|
1380
968
|
{
|
|
1381
969
|
control,
|
|
1382
970
|
name,
|
|
1383
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
1384
|
-
/* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
971
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(FormItem, { children: [
|
|
972
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormLabel, { children: label }),
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
974
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1387
975
|
Button,
|
|
1388
976
|
{
|
|
1389
977
|
variant: "outline",
|
|
@@ -1392,14 +980,14 @@ function Combobox({
|
|
|
1392
980
|
className: "w-full justify-between capitalize",
|
|
1393
981
|
children: [
|
|
1394
982
|
field.value ? options.find((option) => option.value === field.value)?.label || label : label,
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react2.ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1396
984
|
]
|
|
1397
985
|
}
|
|
1398
986
|
) }),
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1402
|
-
/* @__PURE__ */ (0,
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverContent, { className: "w-full p-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Command, { children: [
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandInput, { placeholder: "Search..." }),
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandEmpty, { children: "No item found." }),
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandList, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CommandGroup, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1403
991
|
CommandItem,
|
|
1404
992
|
{
|
|
1405
993
|
value: option.value,
|
|
@@ -1410,8 +998,8 @@ function Combobox({
|
|
|
1410
998
|
setOpen(false);
|
|
1411
999
|
},
|
|
1412
1000
|
children: [
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1414
|
-
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1002
|
+
import_lucide_react2.Check,
|
|
1415
1003
|
{
|
|
1416
1004
|
className: cn(
|
|
1417
1005
|
"mr-2 h-4 w-4",
|
|
@@ -1426,22 +1014,22 @@ function Combobox({
|
|
|
1426
1014
|
)) }) })
|
|
1427
1015
|
] }) })
|
|
1428
1016
|
] }) }),
|
|
1429
|
-
/* @__PURE__ */ (0,
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormMessage, {})
|
|
1430
1018
|
] })
|
|
1431
1019
|
}
|
|
1432
1020
|
);
|
|
1433
1021
|
}
|
|
1434
1022
|
|
|
1435
1023
|
// components/form-controls/command.tsx
|
|
1436
|
-
var
|
|
1437
|
-
var
|
|
1438
|
-
var Command2 =
|
|
1439
|
-
/* @__PURE__ */ (0,
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1442
|
-
commandGroup.map((group, index) => /* @__PURE__ */ (0,
|
|
1443
|
-
/* @__PURE__ */ (0,
|
|
1444
|
-
commandGroup.length - 1 !== index && /* @__PURE__ */ (0,
|
|
1024
|
+
var React14 = __toESM(require("react"));
|
|
1025
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1026
|
+
var Command2 = React14.forwardRef(({ className, placeholder, commandGroup, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Command, { ...props, ref, className, children: [
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CommandInput, { placeholder }),
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(CommandList, { children: [
|
|
1029
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CommandEmpty, { children: "No results found." }),
|
|
1030
|
+
commandGroup.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React14.Fragment, { children: [
|
|
1031
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CommandGroup, { heading: group.header, children: group.items.map((item, itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CommandItem, { children: item }, itemIndex)) }, index),
|
|
1032
|
+
commandGroup.length - 1 !== index && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CommandSeparator, {})
|
|
1445
1033
|
] }, index))
|
|
1446
1034
|
] })
|
|
1447
1035
|
] }));
|
|
@@ -1450,17 +1038,17 @@ Command2.displayName = "Command";
|
|
|
1450
1038
|
// components/form-controls/data-table.tsx
|
|
1451
1039
|
var import_react_icons8 = require("@radix-ui/react-icons");
|
|
1452
1040
|
var import_react_table = require("@tanstack/react-table");
|
|
1453
|
-
var
|
|
1041
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1454
1042
|
var React19 = __toESM(require("react"));
|
|
1455
1043
|
|
|
1456
1044
|
// components/ui/dropdown-menu.tsx
|
|
1457
|
-
var
|
|
1045
|
+
var React15 = __toESM(require("react"));
|
|
1458
1046
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1459
|
-
var
|
|
1460
|
-
var
|
|
1047
|
+
var import_react_icons6 = require("@radix-ui/react-icons");
|
|
1048
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1461
1049
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1462
1050
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1463
|
-
var DropdownMenuSubTrigger =
|
|
1051
|
+
var DropdownMenuSubTrigger = React15.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1464
1052
|
DropdownMenuPrimitive.SubTrigger,
|
|
1465
1053
|
{
|
|
1466
1054
|
ref,
|
|
@@ -1472,12 +1060,12 @@ var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, .
|
|
|
1472
1060
|
...props,
|
|
1473
1061
|
children: [
|
|
1474
1062
|
children,
|
|
1475
|
-
/* @__PURE__ */ (0,
|
|
1063
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons6.ChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
1476
1064
|
]
|
|
1477
1065
|
}
|
|
1478
1066
|
));
|
|
1479
1067
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1480
|
-
var DropdownMenuSubContent =
|
|
1068
|
+
var DropdownMenuSubContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1481
1069
|
DropdownMenuPrimitive.SubContent,
|
|
1482
1070
|
{
|
|
1483
1071
|
ref,
|
|
@@ -1489,7 +1077,7 @@ var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) =
|
|
|
1489
1077
|
}
|
|
1490
1078
|
));
|
|
1491
1079
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1492
|
-
var DropdownMenuContent =
|
|
1080
|
+
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1493
1081
|
DropdownMenuPrimitive.Content,
|
|
1494
1082
|
{
|
|
1495
1083
|
ref,
|
|
@@ -1503,7 +1091,7 @@ var DropdownMenuContent = React17.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
1503
1091
|
}
|
|
1504
1092
|
) }));
|
|
1505
1093
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1506
|
-
var DropdownMenuItem =
|
|
1094
|
+
var DropdownMenuItem = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1507
1095
|
DropdownMenuPrimitive.Item,
|
|
1508
1096
|
{
|
|
1509
1097
|
ref,
|
|
@@ -1516,7 +1104,7 @@ var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1516
1104
|
}
|
|
1517
1105
|
));
|
|
1518
1106
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1519
|
-
var DropdownMenuCheckboxItem =
|
|
1107
|
+
var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1520
1108
|
DropdownMenuPrimitive.CheckboxItem,
|
|
1521
1109
|
{
|
|
1522
1110
|
ref,
|
|
@@ -1527,13 +1115,13 @@ var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, checke
|
|
|
1527
1115
|
checked,
|
|
1528
1116
|
...props,
|
|
1529
1117
|
children: [
|
|
1530
|
-
/* @__PURE__ */ (0,
|
|
1118
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons6.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1531
1119
|
children
|
|
1532
1120
|
]
|
|
1533
1121
|
}
|
|
1534
1122
|
));
|
|
1535
1123
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1536
|
-
var DropdownMenuRadioItem =
|
|
1124
|
+
var DropdownMenuRadioItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1537
1125
|
DropdownMenuPrimitive.RadioItem,
|
|
1538
1126
|
{
|
|
1539
1127
|
ref,
|
|
@@ -1543,13 +1131,13 @@ var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props
|
|
|
1543
1131
|
),
|
|
1544
1132
|
...props,
|
|
1545
1133
|
children: [
|
|
1546
|
-
/* @__PURE__ */ (0,
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_icons6.DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
1547
1135
|
children
|
|
1548
1136
|
]
|
|
1549
1137
|
}
|
|
1550
1138
|
));
|
|
1551
1139
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1552
|
-
var DropdownMenuLabel =
|
|
1140
|
+
var DropdownMenuLabel = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1553
1141
|
DropdownMenuPrimitive.Label,
|
|
1554
1142
|
{
|
|
1555
1143
|
ref,
|
|
@@ -1562,7 +1150,7 @@ var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1562
1150
|
}
|
|
1563
1151
|
));
|
|
1564
1152
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1565
|
-
var DropdownMenuSeparator =
|
|
1153
|
+
var DropdownMenuSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1566
1154
|
DropdownMenuPrimitive.Separator,
|
|
1567
1155
|
{
|
|
1568
1156
|
ref,
|
|
@@ -1575,7 +1163,7 @@ var DropdownMenuShortcut = ({
|
|
|
1575
1163
|
className,
|
|
1576
1164
|
...props
|
|
1577
1165
|
}) => {
|
|
1578
|
-
return /* @__PURE__ */ (0,
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1579
1167
|
"span",
|
|
1580
1168
|
{
|
|
1581
1169
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -1585,10 +1173,143 @@ var DropdownMenuShortcut = ({
|
|
|
1585
1173
|
};
|
|
1586
1174
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1587
1175
|
|
|
1176
|
+
// components/ui/input.tsx
|
|
1177
|
+
var React16 = __toESM(require("react"));
|
|
1178
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1179
|
+
var Input = React16.forwardRef(
|
|
1180
|
+
({ className, type, ...props }, ref) => {
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1182
|
+
"input",
|
|
1183
|
+
{
|
|
1184
|
+
type,
|
|
1185
|
+
className: cn(
|
|
1186
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
1187
|
+
className
|
|
1188
|
+
),
|
|
1189
|
+
ref,
|
|
1190
|
+
...props
|
|
1191
|
+
}
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
);
|
|
1195
|
+
Input.displayName = "Input";
|
|
1196
|
+
|
|
1197
|
+
// components/ui/select.tsx
|
|
1198
|
+
var React17 = __toESM(require("react"));
|
|
1199
|
+
var import_react_icons7 = require("@radix-ui/react-icons");
|
|
1200
|
+
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
1201
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1202
|
+
var Select = SelectPrimitive.Root;
|
|
1203
|
+
var SelectValue = SelectPrimitive.Value;
|
|
1204
|
+
var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1205
|
+
SelectPrimitive.Trigger,
|
|
1206
|
+
{
|
|
1207
|
+
ref,
|
|
1208
|
+
className: cn(
|
|
1209
|
+
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
1210
|
+
className
|
|
1211
|
+
),
|
|
1212
|
+
...props,
|
|
1213
|
+
children: [
|
|
1214
|
+
children,
|
|
1215
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons7.CaretSortIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
1216
|
+
]
|
|
1217
|
+
}
|
|
1218
|
+
));
|
|
1219
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1220
|
+
var SelectScrollUpButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1221
|
+
SelectPrimitive.ScrollUpButton,
|
|
1222
|
+
{
|
|
1223
|
+
ref,
|
|
1224
|
+
className: cn(
|
|
1225
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1226
|
+
className
|
|
1227
|
+
),
|
|
1228
|
+
...props,
|
|
1229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons7.ChevronUpIcon, {})
|
|
1230
|
+
}
|
|
1231
|
+
));
|
|
1232
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1233
|
+
var SelectScrollDownButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1234
|
+
SelectPrimitive.ScrollDownButton,
|
|
1235
|
+
{
|
|
1236
|
+
ref,
|
|
1237
|
+
className: cn(
|
|
1238
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1239
|
+
className
|
|
1240
|
+
),
|
|
1241
|
+
...props,
|
|
1242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons7.ChevronDownIcon, {})
|
|
1243
|
+
}
|
|
1244
|
+
));
|
|
1245
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1246
|
+
var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1247
|
+
SelectPrimitive.Content,
|
|
1248
|
+
{
|
|
1249
|
+
ref,
|
|
1250
|
+
className: cn(
|
|
1251
|
+
"relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1252
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1253
|
+
className
|
|
1254
|
+
),
|
|
1255
|
+
position,
|
|
1256
|
+
...props,
|
|
1257
|
+
children: [
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectScrollUpButton, {}),
|
|
1259
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1260
|
+
SelectPrimitive.Viewport,
|
|
1261
|
+
{
|
|
1262
|
+
className: cn(
|
|
1263
|
+
"p-1",
|
|
1264
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
1265
|
+
),
|
|
1266
|
+
children
|
|
1267
|
+
}
|
|
1268
|
+
),
|
|
1269
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectScrollDownButton, {})
|
|
1270
|
+
]
|
|
1271
|
+
}
|
|
1272
|
+
) }));
|
|
1273
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1274
|
+
var SelectLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1275
|
+
SelectPrimitive.Label,
|
|
1276
|
+
{
|
|
1277
|
+
ref,
|
|
1278
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
1279
|
+
...props
|
|
1280
|
+
}
|
|
1281
|
+
));
|
|
1282
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1283
|
+
var SelectItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1284
|
+
SelectPrimitive.Item,
|
|
1285
|
+
{
|
|
1286
|
+
ref,
|
|
1287
|
+
className: cn(
|
|
1288
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1289
|
+
className
|
|
1290
|
+
),
|
|
1291
|
+
...props,
|
|
1292
|
+
children: [
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons7.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1294
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectPrimitive.ItemText, { children })
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
));
|
|
1298
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1299
|
+
var SelectSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1300
|
+
SelectPrimitive.Separator,
|
|
1301
|
+
{
|
|
1302
|
+
ref,
|
|
1303
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1304
|
+
...props
|
|
1305
|
+
}
|
|
1306
|
+
));
|
|
1307
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1308
|
+
|
|
1588
1309
|
// components/ui/table.tsx
|
|
1589
1310
|
var React18 = __toESM(require("react"));
|
|
1590
|
-
var
|
|
1591
|
-
var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1311
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1312
|
+
var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1592
1313
|
"table",
|
|
1593
1314
|
{
|
|
1594
1315
|
ref,
|
|
@@ -1597,9 +1318,9 @@ var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1597
1318
|
}
|
|
1598
1319
|
) }));
|
|
1599
1320
|
Table.displayName = "Table";
|
|
1600
|
-
var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1321
|
+
var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1601
1322
|
TableHeader.displayName = "TableHeader";
|
|
1602
|
-
var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1323
|
+
var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1603
1324
|
"tbody",
|
|
1604
1325
|
{
|
|
1605
1326
|
ref,
|
|
@@ -1608,7 +1329,7 @@ var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1608
1329
|
}
|
|
1609
1330
|
));
|
|
1610
1331
|
TableBody.displayName = "TableBody";
|
|
1611
|
-
var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1332
|
+
var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1612
1333
|
"tfoot",
|
|
1613
1334
|
{
|
|
1614
1335
|
ref,
|
|
@@ -1620,7 +1341,7 @@ var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1620
1341
|
}
|
|
1621
1342
|
));
|
|
1622
1343
|
TableFooter.displayName = "TableFooter";
|
|
1623
|
-
var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1344
|
+
var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1624
1345
|
"tr",
|
|
1625
1346
|
{
|
|
1626
1347
|
ref,
|
|
@@ -1632,7 +1353,7 @@ var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1632
1353
|
}
|
|
1633
1354
|
));
|
|
1634
1355
|
TableRow.displayName = "TableRow";
|
|
1635
|
-
var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1356
|
+
var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1636
1357
|
"th",
|
|
1637
1358
|
{
|
|
1638
1359
|
ref,
|
|
@@ -1644,7 +1365,7 @@ var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1644
1365
|
}
|
|
1645
1366
|
));
|
|
1646
1367
|
TableHead.displayName = "TableHead";
|
|
1647
|
-
var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1368
|
+
var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1648
1369
|
"td",
|
|
1649
1370
|
{
|
|
1650
1371
|
ref,
|
|
@@ -1656,7 +1377,7 @@ var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1656
1377
|
}
|
|
1657
1378
|
));
|
|
1658
1379
|
TableCell.displayName = "TableCell";
|
|
1659
|
-
var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1380
|
+
var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1660
1381
|
"caption",
|
|
1661
1382
|
{
|
|
1662
1383
|
ref,
|
|
@@ -1667,7 +1388,7 @@ var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1667
1388
|
TableCaption.displayName = "TableCaption";
|
|
1668
1389
|
|
|
1669
1390
|
// components/form-controls/data-table.tsx
|
|
1670
|
-
var
|
|
1391
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1671
1392
|
function DataTable({
|
|
1672
1393
|
data,
|
|
1673
1394
|
columns,
|
|
@@ -1699,10 +1420,10 @@ function DataTable({
|
|
|
1699
1420
|
rowSelection
|
|
1700
1421
|
}
|
|
1701
1422
|
});
|
|
1702
|
-
return /* @__PURE__ */ (0,
|
|
1703
|
-
isLoading && /* @__PURE__ */ (0,
|
|
1704
|
-
filterField && /* @__PURE__ */ (0,
|
|
1705
|
-
/* @__PURE__ */ (0,
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full mt-4 relative", children: [
|
|
1424
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react3.Loader2, { className: "h-4 w-4 animate-spin absolute top-2 right-32" }),
|
|
1425
|
+
filterField && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1706
1427
|
Input,
|
|
1707
1428
|
{
|
|
1708
1429
|
placeholder: `Filter by ${filterField}...`,
|
|
@@ -1711,15 +1432,15 @@ function DataTable({
|
|
|
1711
1432
|
className: "max-w-sm"
|
|
1712
1433
|
}
|
|
1713
1434
|
),
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
1715
|
-
refresh && /* @__PURE__ */ (0,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1717
|
-
/* @__PURE__ */ (0,
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center space-x-4", children: [
|
|
1436
|
+
refresh && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "outline", onClick: refresh, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "RotateCcw", strokeWidth: 2, size: 20 }) }),
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DropdownMenu, { children: [
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Button, { variant: "outline", children: [
|
|
1718
1439
|
"Columns ",
|
|
1719
|
-
/* @__PURE__ */ (0,
|
|
1440
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons8.ChevronDownIcon, { className: "ml-2 h-4 w-4" })
|
|
1720
1441
|
] }) }),
|
|
1721
|
-
/* @__PURE__ */ (0,
|
|
1722
|
-
return /* @__PURE__ */ (0,
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DropdownMenuContent, { align: "end", children: table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
|
1443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1723
1444
|
DropdownMenuCheckboxItem,
|
|
1724
1445
|
{
|
|
1725
1446
|
className: "capitalize",
|
|
@@ -1733,24 +1454,24 @@ function DataTable({
|
|
|
1733
1454
|
] })
|
|
1734
1455
|
] })
|
|
1735
1456
|
] }),
|
|
1736
|
-
/* @__PURE__ */ (0,
|
|
1737
|
-
/* @__PURE__ */ (0,
|
|
1738
|
-
return /* @__PURE__ */ (0,
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "rounded-md border mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Table, { children: [
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
|
|
1459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableHead, { children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
|
1739
1460
|
header.column.columnDef.header,
|
|
1740
1461
|
header.getContext()
|
|
1741
1462
|
) }, header.id);
|
|
1742
1463
|
}) }, headerGroup.id)) }),
|
|
1743
|
-
/* @__PURE__ */ (0,
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableBody, { children: table.getRowModel().rows?.length > 0 ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1744
1465
|
TableRow,
|
|
1745
1466
|
{
|
|
1746
1467
|
"data-state": row.getIsSelected() && "selected",
|
|
1747
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
1468
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableCell, { children: (0, import_react_table.flexRender)(
|
|
1748
1469
|
cell.column.columnDef.cell,
|
|
1749
1470
|
cell.getContext()
|
|
1750
1471
|
) }, cell.id))
|
|
1751
1472
|
},
|
|
1752
1473
|
row.id
|
|
1753
|
-
)) : /* @__PURE__ */ (0,
|
|
1474
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1754
1475
|
TableCell,
|
|
1755
1476
|
{
|
|
1756
1477
|
colSpan: columns.length,
|
|
@@ -1758,18 +1479,18 @@ function DataTable({
|
|
|
1758
1479
|
}
|
|
1759
1480
|
) }) })
|
|
1760
1481
|
] }) }),
|
|
1761
|
-
/* @__PURE__ */ (0,
|
|
1762
|
-
table.getAllColumns().some((col) => col.id === "select") && /* @__PURE__ */ (0,
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-end space-x-2 py-4", children: [
|
|
1483
|
+
table.getAllColumns().some((col) => col.id === "select") && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 text-sm text-muted-foreground", children: [
|
|
1763
1484
|
table.getFilteredSelectedRowModel().rows.length,
|
|
1764
1485
|
" of",
|
|
1765
1486
|
" ",
|
|
1766
1487
|
table.getFilteredRowModel().rows.length,
|
|
1767
1488
|
" row(s) selected."
|
|
1768
1489
|
] }),
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1771
|
-
/* @__PURE__ */ (0,
|
|
1772
|
-
/* @__PURE__ */ (0,
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm font-medium", children: "Rows per page" }),
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1773
1494
|
Select,
|
|
1774
1495
|
{
|
|
1775
1496
|
value: `${table.getState().pagination.pageSize}`,
|
|
@@ -1777,26 +1498,26 @@ function DataTable({
|
|
|
1777
1498
|
table.setPageSize(Number(value));
|
|
1778
1499
|
},
|
|
1779
1500
|
children: [
|
|
1780
|
-
/* @__PURE__ */ (0,
|
|
1501
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1781
1502
|
SelectValue,
|
|
1782
1503
|
{
|
|
1783
1504
|
placeholder: table.getState().pagination.pageSize
|
|
1784
1505
|
}
|
|
1785
1506
|
) }),
|
|
1786
|
-
/* @__PURE__ */ (0,
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
|
|
1787
1508
|
]
|
|
1788
1509
|
}
|
|
1789
1510
|
)
|
|
1790
1511
|
] }),
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1512
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
1792
1513
|
"Page ",
|
|
1793
1514
|
table.getState().pagination.pageIndex + 1,
|
|
1794
1515
|
" of",
|
|
1795
1516
|
" ",
|
|
1796
1517
|
table.getPageCount()
|
|
1797
1518
|
] }),
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1519
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
1520
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1800
1521
|
Button,
|
|
1801
1522
|
{
|
|
1802
1523
|
variant: "outline",
|
|
@@ -1804,12 +1525,12 @@ function DataTable({
|
|
|
1804
1525
|
onClick: () => table.setPageIndex(0),
|
|
1805
1526
|
disabled: !table.getCanPreviousPage(),
|
|
1806
1527
|
children: [
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
1808
|
-
/* @__PURE__ */ (0,
|
|
1528
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sr-only", children: "Go to first page" }),
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons8.DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
1809
1530
|
]
|
|
1810
1531
|
}
|
|
1811
1532
|
),
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1533
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1813
1534
|
Button,
|
|
1814
1535
|
{
|
|
1815
1536
|
variant: "outline",
|
|
@@ -1817,12 +1538,12 @@ function DataTable({
|
|
|
1817
1538
|
onClick: () => table.previousPage(),
|
|
1818
1539
|
disabled: !table.getCanPreviousPage(),
|
|
1819
1540
|
children: [
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sr-only", children: "Go to previous page" }),
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons8.ChevronLeftIcon, { className: "h-4 w-4" })
|
|
1822
1543
|
]
|
|
1823
1544
|
}
|
|
1824
1545
|
),
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1546
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1826
1547
|
Button,
|
|
1827
1548
|
{
|
|
1828
1549
|
variant: "outline",
|
|
@@ -1830,12 +1551,12 @@ function DataTable({
|
|
|
1830
1551
|
onClick: () => table.nextPage(),
|
|
1831
1552
|
disabled: !table.getCanNextPage(),
|
|
1832
1553
|
children: [
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sr-only", children: "Go to next page" }),
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons8.ChevronRightIcon, { className: "h-4 w-4" })
|
|
1835
1556
|
]
|
|
1836
1557
|
}
|
|
1837
1558
|
),
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1839
1560
|
Button,
|
|
1840
1561
|
{
|
|
1841
1562
|
variant: "outline",
|
|
@@ -1843,8 +1564,8 @@ function DataTable({
|
|
|
1843
1564
|
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
1844
1565
|
disabled: !table.getCanNextPage(),
|
|
1845
1566
|
children: [
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1847
|
-
/* @__PURE__ */ (0,
|
|
1567
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sr-only", children: "Go to last page" }),
|
|
1568
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons8.DoubleArrowRightIcon, { className: "h-4 w-4" })
|
|
1848
1569
|
]
|
|
1849
1570
|
}
|
|
1850
1571
|
)
|
|
@@ -3428,14 +3149,14 @@ function cleanEscapedString(input) {
|
|
|
3428
3149
|
|
|
3429
3150
|
// components/ui/calendar.tsx
|
|
3430
3151
|
var import_react_day_picker = require("react-day-picker");
|
|
3431
|
-
var
|
|
3152
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3432
3153
|
function Calendar({
|
|
3433
3154
|
className,
|
|
3434
3155
|
classNames,
|
|
3435
3156
|
showOutsideDays = true,
|
|
3436
3157
|
...props
|
|
3437
3158
|
}) {
|
|
3438
|
-
return /* @__PURE__ */ (0,
|
|
3159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3439
3160
|
import_react_day_picker.DayPicker,
|
|
3440
3161
|
{
|
|
3441
3162
|
showOutsideDays,
|
|
@@ -3485,10 +3206,10 @@ function Calendar({
|
|
|
3485
3206
|
Calendar.displayName = "Calendar";
|
|
3486
3207
|
|
|
3487
3208
|
// components/form-controls/date-filter.tsx
|
|
3488
|
-
var
|
|
3209
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3489
3210
|
function DateFilter({ className, date, setDate }) {
|
|
3490
|
-
return /* @__PURE__ */ (0,
|
|
3491
|
-
/* @__PURE__ */ (0,
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn("grid gap-2", className), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Popover, { children: [
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3492
3213
|
Button,
|
|
3493
3214
|
{
|
|
3494
3215
|
id: "date",
|
|
@@ -3498,17 +3219,17 @@ function DateFilter({ className, date, setDate }) {
|
|
|
3498
3219
|
!date && "text-muted-foreground"
|
|
3499
3220
|
),
|
|
3500
3221
|
children: [
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
date?.from ? date.to ? /* @__PURE__ */ (0,
|
|
3222
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_icons9.CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
3223
|
+
date?.from ? date.to ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3503
3224
|
format(date.from, "LLL dd, y"),
|
|
3504
3225
|
" -",
|
|
3505
3226
|
" ",
|
|
3506
3227
|
format(date.to, "LLL dd, y")
|
|
3507
|
-
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ (0,
|
|
3228
|
+
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Pick a date" })
|
|
3508
3229
|
]
|
|
3509
3230
|
}
|
|
3510
3231
|
) }),
|
|
3511
|
-
/* @__PURE__ */ (0,
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3512
3233
|
Calendar,
|
|
3513
3234
|
{
|
|
3514
3235
|
initialFocus: true,
|
|
@@ -3523,8 +3244,8 @@ function DateFilter({ className, date, setDate }) {
|
|
|
3523
3244
|
}
|
|
3524
3245
|
|
|
3525
3246
|
// components/form-controls/dialog.tsx
|
|
3526
|
-
var
|
|
3527
|
-
var
|
|
3247
|
+
var import_lucide_react4 = require("lucide-react");
|
|
3248
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3528
3249
|
var Dialog2 = ({
|
|
3529
3250
|
title,
|
|
3530
3251
|
description,
|
|
@@ -3537,14 +3258,14 @@ var Dialog2 = ({
|
|
|
3537
3258
|
iconClassName,
|
|
3538
3259
|
actions
|
|
3539
3260
|
}) => {
|
|
3540
|
-
const IconComponent = icon ?
|
|
3541
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
-
/* @__PURE__ */ (0,
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3547
|
-
IconComponent && /* @__PURE__ */ (0,
|
|
3261
|
+
const IconComponent = icon ? import_lucide_react4.icons[icon] : null;
|
|
3262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Dialog, { open, onOpenChange, children: [
|
|
3263
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DialogTrigger, { children: trigger }),
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DialogContent, { className, children: [
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DialogHeader, { children: [
|
|
3266
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DialogTitle, { className: "capitalize flex items-center gap-2 justify-between pr-8", children: [
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3268
|
+
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3548
3269
|
IconComponent,
|
|
3549
3270
|
{
|
|
3550
3271
|
size: 20,
|
|
@@ -3554,7 +3275,7 @@ var Dialog2 = ({
|
|
|
3554
3275
|
),
|
|
3555
3276
|
title
|
|
3556
3277
|
] }),
|
|
3557
|
-
actions && /* @__PURE__ */ (0,
|
|
3278
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center gap-2", children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3558
3279
|
Button2,
|
|
3559
3280
|
{
|
|
3560
3281
|
variant: action.type,
|
|
@@ -3563,8 +3284,8 @@ var Dialog2 = ({
|
|
|
3563
3284
|
disabled: action.disabled,
|
|
3564
3285
|
children: [
|
|
3565
3286
|
action.label,
|
|
3566
|
-
action.icon && /* @__PURE__ */ (0,
|
|
3567
|
-
|
|
3287
|
+
action.icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3288
|
+
Icon,
|
|
3568
3289
|
{
|
|
3569
3290
|
name: action.icon,
|
|
3570
3291
|
className: cn(action.iconClassName),
|
|
@@ -3577,7 +3298,7 @@ var Dialog2 = ({
|
|
|
3577
3298
|
action.label
|
|
3578
3299
|
)) })
|
|
3579
3300
|
] }),
|
|
3580
|
-
/* @__PURE__ */ (0,
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DialogDescription, { children: description })
|
|
3581
3302
|
] }),
|
|
3582
3303
|
children
|
|
3583
3304
|
] })
|
|
@@ -3587,11 +3308,11 @@ var Dialog2 = ({
|
|
|
3587
3308
|
// components/ui/drawer.tsx
|
|
3588
3309
|
var React20 = __toESM(require("react"));
|
|
3589
3310
|
var import_vaul = require("vaul");
|
|
3590
|
-
var
|
|
3311
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3591
3312
|
var Drawer = ({
|
|
3592
3313
|
shouldScaleBackground = true,
|
|
3593
3314
|
...props
|
|
3594
|
-
}) => /* @__PURE__ */ (0,
|
|
3315
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3595
3316
|
import_vaul.Drawer.Root,
|
|
3596
3317
|
{
|
|
3597
3318
|
shouldScaleBackground,
|
|
@@ -3602,7 +3323,7 @@ Drawer.displayName = "Drawer";
|
|
|
3602
3323
|
var DrawerTrigger = import_vaul.Drawer.Trigger;
|
|
3603
3324
|
var DrawerPortal = import_vaul.Drawer.Portal;
|
|
3604
3325
|
var DrawerClose = import_vaul.Drawer.Close;
|
|
3605
|
-
var DrawerOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3326
|
+
var DrawerOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3606
3327
|
import_vaul.Drawer.Overlay,
|
|
3607
3328
|
{
|
|
3608
3329
|
ref,
|
|
@@ -3611,9 +3332,9 @@ var DrawerOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
3611
3332
|
}
|
|
3612
3333
|
));
|
|
3613
3334
|
DrawerOverlay.displayName = import_vaul.Drawer.Overlay.displayName;
|
|
3614
|
-
var DrawerContent = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3615
|
-
/* @__PURE__ */ (0,
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
3335
|
+
var DrawerContent = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(DrawerPortal, { children: [
|
|
3336
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DrawerOverlay, {}),
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3617
3338
|
import_vaul.Drawer.Content,
|
|
3618
3339
|
{
|
|
3619
3340
|
ref,
|
|
@@ -3623,7 +3344,7 @@ var DrawerContent = React20.forwardRef(({ className, children, ...props }, ref)
|
|
|
3623
3344
|
),
|
|
3624
3345
|
...props,
|
|
3625
3346
|
children: [
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
3347
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
3627
3348
|
children
|
|
3628
3349
|
]
|
|
3629
3350
|
}
|
|
@@ -3633,7 +3354,7 @@ DrawerContent.displayName = "DrawerContent";
|
|
|
3633
3354
|
var DrawerHeader = ({
|
|
3634
3355
|
className,
|
|
3635
3356
|
...props
|
|
3636
|
-
}) => /* @__PURE__ */ (0,
|
|
3357
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3637
3358
|
"div",
|
|
3638
3359
|
{
|
|
3639
3360
|
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
|
|
@@ -3644,7 +3365,7 @@ DrawerHeader.displayName = "DrawerHeader";
|
|
|
3644
3365
|
var DrawerFooter = ({
|
|
3645
3366
|
className,
|
|
3646
3367
|
...props
|
|
3647
|
-
}) => /* @__PURE__ */ (0,
|
|
3368
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3648
3369
|
"div",
|
|
3649
3370
|
{
|
|
3650
3371
|
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
@@ -3652,7 +3373,7 @@ var DrawerFooter = ({
|
|
|
3652
3373
|
}
|
|
3653
3374
|
);
|
|
3654
3375
|
DrawerFooter.displayName = "DrawerFooter";
|
|
3655
|
-
var DrawerTitle = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3376
|
+
var DrawerTitle = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3656
3377
|
import_vaul.Drawer.Title,
|
|
3657
3378
|
{
|
|
3658
3379
|
ref,
|
|
@@ -3664,7 +3385,7 @@ var DrawerTitle = React20.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3664
3385
|
}
|
|
3665
3386
|
));
|
|
3666
3387
|
DrawerTitle.displayName = import_vaul.Drawer.Title.displayName;
|
|
3667
|
-
var DrawerDescription = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3388
|
+
var DrawerDescription = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3668
3389
|
import_vaul.Drawer.Description,
|
|
3669
3390
|
{
|
|
3670
3391
|
ref,
|
|
@@ -3677,22 +3398,22 @@ DrawerDescription.displayName = import_vaul.Drawer.Description.displayName;
|
|
|
3677
3398
|
// components/ui/scroll-area.tsx
|
|
3678
3399
|
var React21 = __toESM(require("react"));
|
|
3679
3400
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
|
|
3680
|
-
var
|
|
3681
|
-
var ScrollArea = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3401
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3402
|
+
var ScrollArea = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3682
3403
|
ScrollAreaPrimitive.Root,
|
|
3683
3404
|
{
|
|
3684
3405
|
ref,
|
|
3685
3406
|
className: cn("relative overflow-hidden", className),
|
|
3686
3407
|
...props,
|
|
3687
3408
|
children: [
|
|
3688
|
-
/* @__PURE__ */ (0,
|
|
3689
|
-
/* @__PURE__ */ (0,
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
3409
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
3410
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ScrollBar, {}),
|
|
3411
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
3691
3412
|
]
|
|
3692
3413
|
}
|
|
3693
3414
|
));
|
|
3694
3415
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
3695
|
-
var ScrollBar = React21.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3416
|
+
var ScrollBar = React21.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3696
3417
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3697
3418
|
{
|
|
3698
3419
|
ref,
|
|
@@ -3704,13 +3425,13 @@ var ScrollBar = React21.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
3704
3425
|
className
|
|
3705
3426
|
),
|
|
3706
3427
|
...props,
|
|
3707
|
-
children: /* @__PURE__ */ (0,
|
|
3428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
3708
3429
|
}
|
|
3709
3430
|
));
|
|
3710
3431
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
3711
3432
|
|
|
3712
3433
|
// components/form-controls/drawer.tsx
|
|
3713
|
-
var
|
|
3434
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3714
3435
|
var Drawer2 = ({
|
|
3715
3436
|
title,
|
|
3716
3437
|
trigger,
|
|
@@ -3720,7 +3441,7 @@ var Drawer2 = ({
|
|
|
3720
3441
|
setOpenDrawer,
|
|
3721
3442
|
...props
|
|
3722
3443
|
}) => {
|
|
3723
|
-
return /* @__PURE__ */ (0,
|
|
3444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3724
3445
|
Drawer,
|
|
3725
3446
|
{
|
|
3726
3447
|
direction: "right",
|
|
@@ -3728,11 +3449,11 @@ var Drawer2 = ({
|
|
|
3728
3449
|
onOpenChange: setOpenDrawer,
|
|
3729
3450
|
...props,
|
|
3730
3451
|
children: [
|
|
3731
|
-
trigger && /* @__PURE__ */ (0,
|
|
3732
|
-
/* @__PURE__ */ (0,
|
|
3733
|
-
/* @__PURE__ */ (0,
|
|
3734
|
-
/* @__PURE__ */ (0,
|
|
3735
|
-
/* @__PURE__ */ (0,
|
|
3452
|
+
trigger && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DrawerTrigger, { children: trigger }),
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DrawerContent, { className: "h-screen top-0 right-0 left-auto mt-0 w-[500px] rounded-none", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ScrollArea, { className: "h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mx-auto w-full p-5", children: [
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(DrawerHeader, { children: [
|
|
3455
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DrawerTitle, { children: title }),
|
|
3456
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DrawerDescription, { children: description })
|
|
3736
3457
|
] }),
|
|
3737
3458
|
children
|
|
3738
3459
|
] }) }) })
|
|
@@ -3742,16 +3463,16 @@ var Drawer2 = ({
|
|
|
3742
3463
|
};
|
|
3743
3464
|
|
|
3744
3465
|
// components/form-controls/dropdown-menu.tsx
|
|
3745
|
-
var
|
|
3466
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3746
3467
|
var DropdownMenu2 = ({
|
|
3747
3468
|
trigger,
|
|
3748
3469
|
items,
|
|
3749
3470
|
className = "",
|
|
3750
3471
|
onClick
|
|
3751
3472
|
}) => {
|
|
3752
|
-
return /* @__PURE__ */ (0,
|
|
3753
|
-
/* @__PURE__ */ (0,
|
|
3754
|
-
/* @__PURE__ */ (0,
|
|
3473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(DropdownMenu, { children: [
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className, children: trigger }) }),
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuContent, { className: "cursor-pointer", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3755
3476
|
DropdownMenuItem,
|
|
3756
3477
|
{
|
|
3757
3478
|
className: "cursor-pointer!",
|
|
@@ -3764,8 +3485,8 @@ var DropdownMenu2 = ({
|
|
|
3764
3485
|
};
|
|
3765
3486
|
|
|
3766
3487
|
// components/form-controls/duration-input.tsx
|
|
3767
|
-
var
|
|
3768
|
-
var
|
|
3488
|
+
var import_react4 = require("react");
|
|
3489
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3769
3490
|
var unitOptions = [
|
|
3770
3491
|
{ label: "Seconds", value: "s", ns: 1e9 },
|
|
3771
3492
|
{ label: "Minutes", value: "m", ns: 6e10 },
|
|
@@ -3796,10 +3517,10 @@ function toGoCompatibleDuration(amount, unit) {
|
|
|
3796
3517
|
}
|
|
3797
3518
|
}
|
|
3798
3519
|
function DurationInput({ value, onChange }) {
|
|
3799
|
-
const [amount, setAmount] = (0,
|
|
3800
|
-
const [unit, setUnit] = (0,
|
|
3801
|
-
const [userInteracted, setUserInteracted] = (0,
|
|
3802
|
-
(0,
|
|
3520
|
+
const [amount, setAmount] = (0, import_react4.useState)("");
|
|
3521
|
+
const [unit, setUnit] = (0, import_react4.useState)("h");
|
|
3522
|
+
const [userInteracted, setUserInteracted] = (0, import_react4.useState)(false);
|
|
3523
|
+
(0, import_react4.useEffect)(() => {
|
|
3803
3524
|
if (userInteracted) return;
|
|
3804
3525
|
if (value === void 0 || value === null || value === "") {
|
|
3805
3526
|
setAmount("");
|
|
@@ -3848,8 +3569,8 @@ function DurationInput({ value, onChange }) {
|
|
|
3848
3569
|
onChange("");
|
|
3849
3570
|
}
|
|
3850
3571
|
};
|
|
3851
|
-
return /* @__PURE__ */ (0,
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3853
3574
|
Input,
|
|
3854
3575
|
{
|
|
3855
3576
|
type: "number",
|
|
@@ -3859,23 +3580,46 @@ function DurationInput({ value, onChange }) {
|
|
|
3859
3580
|
className: "w-20"
|
|
3860
3581
|
}
|
|
3861
3582
|
),
|
|
3862
|
-
/* @__PURE__ */ (0,
|
|
3863
|
-
/* @__PURE__ */ (0,
|
|
3864
|
-
/* @__PURE__ */ (0,
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Select, { value: unit, onValueChange: handleUnitChange, children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectTrigger, { className: "w-24", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectValue, {}) }),
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectContent, { children: unitOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
3865
3586
|
] })
|
|
3866
3587
|
] });
|
|
3867
3588
|
}
|
|
3868
3589
|
|
|
3869
3590
|
// components/form-controls/filter-combobox.tsx
|
|
3870
|
-
var
|
|
3591
|
+
var import_react5 = require("react");
|
|
3871
3592
|
var import_react_icons10 = require("@radix-ui/react-icons");
|
|
3872
3593
|
|
|
3594
|
+
// components/ui/badge.tsx
|
|
3595
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
3596
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3597
|
+
var badgeVariants = (0, import_class_variance_authority4.cva)(
|
|
3598
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
3599
|
+
{
|
|
3600
|
+
variants: {
|
|
3601
|
+
variant: {
|
|
3602
|
+
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
3603
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3604
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
3605
|
+
outline: "text-foreground"
|
|
3606
|
+
}
|
|
3607
|
+
},
|
|
3608
|
+
defaultVariants: {
|
|
3609
|
+
variant: "default"
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
);
|
|
3613
|
+
function Badge({ className, variant, ...props }) {
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3873
3617
|
// components/ui/separator.tsx
|
|
3874
3618
|
var React22 = __toESM(require("react"));
|
|
3875
3619
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
3876
|
-
var
|
|
3620
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3877
3621
|
var Separator3 = React22.forwardRef(
|
|
3878
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3622
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3879
3623
|
SeparatorPrimitive.Root,
|
|
3880
3624
|
{
|
|
3881
3625
|
ref,
|
|
@@ -3893,9 +3637,9 @@ var Separator3 = React22.forwardRef(
|
|
|
3893
3637
|
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
3894
3638
|
|
|
3895
3639
|
// components/form-controls/filter-combobox.tsx
|
|
3896
|
-
var
|
|
3640
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3897
3641
|
function FilterCombobox({ title, options, clearLabel }) {
|
|
3898
|
-
const [selectedValues, setSelectedValues] = (0,
|
|
3642
|
+
const [selectedValues, setSelectedValues] = (0, import_react5.useState)([]);
|
|
3899
3643
|
const handleValueSelect = (value) => {
|
|
3900
3644
|
if (selectedValues.some((v) => v.value === value.value)) {
|
|
3901
3645
|
setSelectedValues(selectedValues.filter((v) => v.value !== value.value));
|
|
@@ -3903,13 +3647,13 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3903
3647
|
setSelectedValues([...selectedValues, value]);
|
|
3904
3648
|
}
|
|
3905
3649
|
};
|
|
3906
|
-
return /* @__PURE__ */ (0,
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
3908
|
-
/* @__PURE__ */ (0,
|
|
3650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Popover, { children: [
|
|
3651
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverTrigger, { asChild: true, className: "w-fit", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Button, { variant: "outline", size: "sm", className: "h-8 border-dashed", children: [
|
|
3652
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: "CirclePlus", className: "h-4 w-4 mr-2" }),
|
|
3909
3653
|
title,
|
|
3910
|
-
selectedValues?.length > 0 && /* @__PURE__ */ (0,
|
|
3911
|
-
/* @__PURE__ */ (0,
|
|
3912
|
-
/* @__PURE__ */ (0,
|
|
3654
|
+
selectedValues?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2 ml-2", children: [
|
|
3655
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Separator3, { orientation: "vertical", className: "h-4" }),
|
|
3656
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: selectedValues.length > 2 ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3913
3657
|
Badge,
|
|
3914
3658
|
{
|
|
3915
3659
|
variant: "secondary",
|
|
@@ -3921,7 +3665,7 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3921
3665
|
}
|
|
3922
3666
|
) : options.filter(
|
|
3923
3667
|
(option) => selectedValues.some((item) => item.value === option.value)
|
|
3924
|
-
).map((option) => /* @__PURE__ */ (0,
|
|
3668
|
+
).map((option) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3925
3669
|
Badge,
|
|
3926
3670
|
{
|
|
3927
3671
|
variant: "secondary",
|
|
@@ -3932,40 +3676,40 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3932
3676
|
)) })
|
|
3933
3677
|
] })
|
|
3934
3678
|
] }) }),
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
3936
|
-
/* @__PURE__ */ (0,
|
|
3937
|
-
/* @__PURE__ */ (0,
|
|
3938
|
-
/* @__PURE__ */ (0,
|
|
3939
|
-
/* @__PURE__ */ (0,
|
|
3679
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverContent, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Command, { children: [
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CommandInput, { placeholder: title }),
|
|
3681
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(CommandList, { children: [
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CommandEmpty, { children: "No results found." }),
|
|
3683
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CommandGroup, { children: options.map((option) => {
|
|
3940
3684
|
const isSelected = selectedValues.some(
|
|
3941
3685
|
(item) => item.value === option.value
|
|
3942
3686
|
);
|
|
3943
|
-
return /* @__PURE__ */ (0,
|
|
3687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3944
3688
|
CommandItem,
|
|
3945
3689
|
{
|
|
3946
3690
|
onSelect: () => handleValueSelect(option),
|
|
3947
3691
|
className: "cursor-pointer",
|
|
3948
3692
|
children: [
|
|
3949
|
-
/* @__PURE__ */ (0,
|
|
3693
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3950
3694
|
"div",
|
|
3951
3695
|
{
|
|
3952
3696
|
className: cn(
|
|
3953
3697
|
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
|
|
3954
3698
|
isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
|
|
3955
3699
|
),
|
|
3956
|
-
children: /* @__PURE__ */ (0,
|
|
3700
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_icons10.CheckIcon, { className: cn("h-4 w-4") })
|
|
3957
3701
|
}
|
|
3958
3702
|
),
|
|
3959
|
-
option?.icon && /* @__PURE__ */ (0,
|
|
3960
|
-
/* @__PURE__ */ (0,
|
|
3703
|
+
option?.icon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: option?.icon, className: "mr-2 h-4 w-4 text-muted-foreground" }),
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: option.label })
|
|
3961
3705
|
]
|
|
3962
3706
|
},
|
|
3963
3707
|
option.value
|
|
3964
3708
|
);
|
|
3965
3709
|
}) }),
|
|
3966
|
-
selectedValues.length > 0 && /* @__PURE__ */ (0,
|
|
3967
|
-
/* @__PURE__ */ (0,
|
|
3968
|
-
/* @__PURE__ */ (0,
|
|
3710
|
+
selectedValues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
3711
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CommandSeparator, {}),
|
|
3712
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CommandGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3969
3713
|
CommandItem,
|
|
3970
3714
|
{
|
|
3971
3715
|
onSelect: () => setSelectedValues([]),
|
|
@@ -3980,7 +3724,7 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3980
3724
|
}
|
|
3981
3725
|
|
|
3982
3726
|
// components/form-controls/form-combobox.tsx
|
|
3983
|
-
var
|
|
3727
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3984
3728
|
function FormCombobox({
|
|
3985
3729
|
title,
|
|
3986
3730
|
name,
|
|
@@ -3989,15 +3733,15 @@ function FormCombobox({
|
|
|
3989
3733
|
data,
|
|
3990
3734
|
label
|
|
3991
3735
|
}) {
|
|
3992
|
-
return /* @__PURE__ */ (0,
|
|
3736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3993
3737
|
FormField,
|
|
3994
3738
|
{
|
|
3995
3739
|
control,
|
|
3996
3740
|
name,
|
|
3997
3741
|
rules,
|
|
3998
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
3999
|
-
title && /* @__PURE__ */ (0,
|
|
4000
|
-
/* @__PURE__ */ (0,
|
|
3742
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(FormItem, { children: [
|
|
3743
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormLabel, { children: title }),
|
|
3744
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4001
3745
|
Combobox,
|
|
4002
3746
|
{
|
|
4003
3747
|
label,
|
|
@@ -4006,7 +3750,7 @@ function FormCombobox({
|
|
|
4006
3750
|
onChange: (value) => field.onChange(value)
|
|
4007
3751
|
}
|
|
4008
3752
|
) }),
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
3753
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormMessage, {})
|
|
4010
3754
|
] })
|
|
4011
3755
|
}
|
|
4012
3756
|
);
|
|
@@ -4014,7 +3758,7 @@ function FormCombobox({
|
|
|
4014
3758
|
|
|
4015
3759
|
// components/form-controls/form-layout.tsx
|
|
4016
3760
|
var import_react_hook_form2 = require("react-hook-form");
|
|
4017
|
-
var
|
|
3761
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4018
3762
|
function FormLayout({
|
|
4019
3763
|
children,
|
|
4020
3764
|
formTitle,
|
|
@@ -4026,34 +3770,34 @@ function FormLayout({
|
|
|
4026
3770
|
PrimaryActionText,
|
|
4027
3771
|
CancelText
|
|
4028
3772
|
}) {
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
4030
|
-
/* @__PURE__ */ (0,
|
|
4031
|
-
/* @__PURE__ */ (0,
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4033
|
-
/* @__PURE__ */ (0,
|
|
3773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_hook_form2.FormProvider, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { onSubmit: onSave, className: `flex flex-col gap-6 ${className}`, children: [
|
|
3774
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between w-full border-b pb-6 border-border", children: [
|
|
3775
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col", children: [
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "font-semibold text-lg", children: formTitle }),
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-gray-500", children: formDescription })
|
|
4034
3778
|
] }),
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button2, { type: "button", onClick: onCanel, variant: "secondary", children: CancelText }),
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button2, { type: "submit", children: PrimaryActionText })
|
|
4038
3782
|
] })
|
|
4039
3783
|
] }),
|
|
4040
3784
|
children,
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4042
|
-
/* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button2, { type: "button", onClick: onCanel, variant: "secondary", children: CancelText }),
|
|
3787
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button2, { type: "submit", children: PrimaryActionText })
|
|
4044
3788
|
] })
|
|
4045
3789
|
] }) });
|
|
4046
3790
|
}
|
|
4047
3791
|
|
|
4048
3792
|
// components/form-controls/form-row.tsx
|
|
4049
|
-
var
|
|
3793
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4050
3794
|
function FormRow({ children, title, description }) {
|
|
4051
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
-
/* @__PURE__ */ (0,
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4054
|
-
/* @__PURE__ */ (0,
|
|
3795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid grid-cols-3 w-full border-b pb-6 border-border", children: [
|
|
3796
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col", children: [
|
|
3797
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "font-medium", children: title }),
|
|
3798
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-gray-500 text-sm", children: description })
|
|
4055
3799
|
] }),
|
|
4056
|
-
/* @__PURE__ */ (0,
|
|
3800
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "col-span-2 w-[80%]", children })
|
|
4057
3801
|
] });
|
|
4058
3802
|
}
|
|
4059
3803
|
|
|
@@ -4061,9 +3805,9 @@ function FormRow({ children, title, description }) {
|
|
|
4061
3805
|
var React23 = __toESM(require("react"));
|
|
4062
3806
|
var import_react_icons11 = require("@radix-ui/react-icons");
|
|
4063
3807
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"));
|
|
4064
|
-
var
|
|
3808
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4065
3809
|
var RadioGroup2 = React23.forwardRef(({ className, ...props }, ref) => {
|
|
4066
|
-
return /* @__PURE__ */ (0,
|
|
3810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4067
3811
|
RadioGroupPrimitive.Root,
|
|
4068
3812
|
{
|
|
4069
3813
|
className: cn("grid gap-2", className),
|
|
@@ -4074,7 +3818,7 @@ var RadioGroup2 = React23.forwardRef(({ className, ...props }, ref) => {
|
|
|
4074
3818
|
});
|
|
4075
3819
|
RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4076
3820
|
var RadioGroupItem = React23.forwardRef(({ className, ...props }, ref) => {
|
|
4077
|
-
return /* @__PURE__ */ (0,
|
|
3821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4078
3822
|
RadioGroupPrimitive.Item,
|
|
4079
3823
|
{
|
|
4080
3824
|
ref,
|
|
@@ -4083,7 +3827,7 @@ var RadioGroupItem = React23.forwardRef(({ className, ...props }, ref) => {
|
|
|
4083
3827
|
className
|
|
4084
3828
|
),
|
|
4085
3829
|
...props,
|
|
4086
|
-
children: /* @__PURE__ */ (0,
|
|
3830
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_icons11.CheckIcon, { className: "h-3.5 w-3.5 fill-primary" }) })
|
|
4087
3831
|
}
|
|
4088
3832
|
);
|
|
4089
3833
|
});
|
|
@@ -4094,11 +3838,11 @@ var React24 = __toESM(require("react"));
|
|
|
4094
3838
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
4095
3839
|
var import_react_icons12 = require("@radix-ui/react-icons");
|
|
4096
3840
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
4097
|
-
var
|
|
3841
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4098
3842
|
var Sheet = SheetPrimitive.Root;
|
|
4099
3843
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
4100
3844
|
var SheetPortal = SheetPrimitive.Portal;
|
|
4101
|
-
var SheetOverlay = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3845
|
+
var SheetOverlay = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4102
3846
|
SheetPrimitive.Overlay,
|
|
4103
3847
|
{
|
|
4104
3848
|
className: cn(
|
|
@@ -4126,18 +3870,18 @@ var sheetVariants = (0, import_class_variance_authority5.cva)(
|
|
|
4126
3870
|
}
|
|
4127
3871
|
}
|
|
4128
3872
|
);
|
|
4129
|
-
var SheetContent = React24.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4130
|
-
/* @__PURE__ */ (0,
|
|
4131
|
-
/* @__PURE__ */ (0,
|
|
3873
|
+
var SheetContent = React24.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(SheetPortal, { children: [
|
|
3874
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SheetOverlay, {}),
|
|
3875
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4132
3876
|
SheetPrimitive.Content,
|
|
4133
3877
|
{
|
|
4134
3878
|
ref,
|
|
4135
3879
|
className: cn(sheetVariants({ side }), className),
|
|
4136
3880
|
...props,
|
|
4137
3881
|
children: [
|
|
4138
|
-
/* @__PURE__ */ (0,
|
|
4139
|
-
/* @__PURE__ */ (0,
|
|
4140
|
-
/* @__PURE__ */ (0,
|
|
3882
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_icons12.Cross2Icon, { className: "h-4 w-4" }),
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: "Close" })
|
|
4141
3885
|
] }),
|
|
4142
3886
|
children
|
|
4143
3887
|
]
|
|
@@ -4148,7 +3892,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
4148
3892
|
var SheetHeader = ({
|
|
4149
3893
|
className,
|
|
4150
3894
|
...props
|
|
4151
|
-
}) => /* @__PURE__ */ (0,
|
|
3895
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4152
3896
|
"div",
|
|
4153
3897
|
{
|
|
4154
3898
|
className: cn(
|
|
@@ -4162,7 +3906,7 @@ SheetHeader.displayName = "SheetHeader";
|
|
|
4162
3906
|
var SheetFooter = ({
|
|
4163
3907
|
className,
|
|
4164
3908
|
...props
|
|
4165
|
-
}) => /* @__PURE__ */ (0,
|
|
3909
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4166
3910
|
"div",
|
|
4167
3911
|
{
|
|
4168
3912
|
className: cn(
|
|
@@ -4173,7 +3917,7 @@ var SheetFooter = ({
|
|
|
4173
3917
|
}
|
|
4174
3918
|
);
|
|
4175
3919
|
SheetFooter.displayName = "SheetFooter";
|
|
4176
|
-
var SheetTitle = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3920
|
+
var SheetTitle = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4177
3921
|
SheetPrimitive.Title,
|
|
4178
3922
|
{
|
|
4179
3923
|
ref,
|
|
@@ -4182,7 +3926,7 @@ var SheetTitle = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4182
3926
|
}
|
|
4183
3927
|
));
|
|
4184
3928
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
4185
|
-
var SheetDescription = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3929
|
+
var SheetDescription = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4186
3930
|
SheetPrimitive.Description,
|
|
4187
3931
|
{
|
|
4188
3932
|
ref,
|
|
@@ -4194,10 +3938,10 @@ SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
|
4194
3938
|
|
|
4195
3939
|
// components/ui/textarea.tsx
|
|
4196
3940
|
var React25 = __toESM(require("react"));
|
|
4197
|
-
var
|
|
3941
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4198
3942
|
var Textarea = React25.forwardRef(
|
|
4199
3943
|
({ className, ...props }, ref) => {
|
|
4200
|
-
return /* @__PURE__ */ (0,
|
|
3944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4201
3945
|
"textarea",
|
|
4202
3946
|
{
|
|
4203
3947
|
className: cn(
|
|
@@ -4215,11 +3959,11 @@ Textarea.displayName = "Textarea";
|
|
|
4215
3959
|
// components/ui/tooltip.tsx
|
|
4216
3960
|
var React26 = __toESM(require("react"));
|
|
4217
3961
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
4218
|
-
var
|
|
3962
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4219
3963
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4220
3964
|
var Tooltip = TooltipPrimitive.Root;
|
|
4221
3965
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4222
|
-
var TooltipContent = React26.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3966
|
+
var TooltipContent = React26.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4223
3967
|
TooltipPrimitive.Content,
|
|
4224
3968
|
{
|
|
4225
3969
|
ref,
|
|
@@ -4236,7 +3980,7 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
|
4236
3980
|
// components/ui/chart.tsx
|
|
4237
3981
|
var React27 = __toESM(require("react"));
|
|
4238
3982
|
var RechartsPrimitive = __toESM(require("recharts"));
|
|
4239
|
-
var
|
|
3983
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4240
3984
|
var THEMES = { light: "", dark: ".dark" };
|
|
4241
3985
|
var ChartContext = React27.createContext(null);
|
|
4242
3986
|
function useChart() {
|
|
@@ -4249,7 +3993,7 @@ function useChart() {
|
|
|
4249
3993
|
var ChartContainer = React27.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
4250
3994
|
const uniqueId = React27.useId();
|
|
4251
3995
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
3996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4253
3997
|
"div",
|
|
4254
3998
|
{
|
|
4255
3999
|
"data-chart": chartId,
|
|
@@ -4260,8 +4004,8 @@ var ChartContainer = React27.forwardRef(({ id, className, children, config, ...p
|
|
|
4260
4004
|
),
|
|
4261
4005
|
...props,
|
|
4262
4006
|
children: [
|
|
4263
|
-
/* @__PURE__ */ (0,
|
|
4264
|
-
/* @__PURE__ */ (0,
|
|
4007
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ChartStyle, { id: chartId, config }),
|
|
4008
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RechartsPrimitive.ResponsiveContainer, { children })
|
|
4265
4009
|
]
|
|
4266
4010
|
}
|
|
4267
4011
|
) });
|
|
@@ -4274,7 +4018,7 @@ var ChartStyle = ({ id, config }) => {
|
|
|
4274
4018
|
if (!colorConfig.length) {
|
|
4275
4019
|
return null;
|
|
4276
4020
|
}
|
|
4277
|
-
return /* @__PURE__ */ (0,
|
|
4021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4278
4022
|
"style",
|
|
4279
4023
|
{
|
|
4280
4024
|
dangerouslySetInnerHTML: {
|
|
@@ -4318,12 +4062,12 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4318
4062
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
4319
4063
|
const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
|
|
4320
4064
|
if (labelFormatter) {
|
|
4321
|
-
return /* @__PURE__ */ (0,
|
|
4065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
4322
4066
|
}
|
|
4323
4067
|
if (!value) {
|
|
4324
4068
|
return null;
|
|
4325
4069
|
}
|
|
4326
|
-
return /* @__PURE__ */ (0,
|
|
4070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("font-medium", labelClassName), children: value });
|
|
4327
4071
|
}, [
|
|
4328
4072
|
label,
|
|
4329
4073
|
labelFormatter,
|
|
@@ -4337,7 +4081,7 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4337
4081
|
return null;
|
|
4338
4082
|
}
|
|
4339
4083
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
4340
|
-
return /* @__PURE__ */ (0,
|
|
4084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4341
4085
|
"div",
|
|
4342
4086
|
{
|
|
4343
4087
|
ref,
|
|
@@ -4347,19 +4091,19 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4347
4091
|
),
|
|
4348
4092
|
children: [
|
|
4349
4093
|
!nestLabel ? tooltipLabel : null,
|
|
4350
|
-
/* @__PURE__ */ (0,
|
|
4094
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
4351
4095
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
4352
4096
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
4353
4097
|
const indicatorColor = color || item.payload.fill || item.color;
|
|
4354
|
-
return /* @__PURE__ */ (0,
|
|
4098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4355
4099
|
"div",
|
|
4356
4100
|
{
|
|
4357
4101
|
className: cn(
|
|
4358
4102
|
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
4359
4103
|
indicator === "dot" && "items-center"
|
|
4360
4104
|
),
|
|
4361
|
-
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0,
|
|
4362
|
-
itemConfig?.icon ? /* @__PURE__ */ (0,
|
|
4105
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
4106
|
+
itemConfig?.icon ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4363
4107
|
"div",
|
|
4364
4108
|
{
|
|
4365
4109
|
className: cn(
|
|
@@ -4377,7 +4121,7 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4377
4121
|
}
|
|
4378
4122
|
}
|
|
4379
4123
|
),
|
|
4380
|
-
/* @__PURE__ */ (0,
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4381
4125
|
"div",
|
|
4382
4126
|
{
|
|
4383
4127
|
className: cn(
|
|
@@ -4385,11 +4129,11 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4385
4129
|
nestLabel ? "items-end" : "items-center"
|
|
4386
4130
|
),
|
|
4387
4131
|
children: [
|
|
4388
|
-
/* @__PURE__ */ (0,
|
|
4132
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "grid gap-1.5", children: [
|
|
4389
4133
|
nestLabel ? tooltipLabel : null,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4134
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })
|
|
4391
4135
|
] }),
|
|
4392
|
-
item.value && /* @__PURE__ */ (0,
|
|
4136
|
+
item.value && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-mono font-medium tabular-nums text-foreground", children: item.value.toLocaleString() })
|
|
4393
4137
|
]
|
|
4394
4138
|
}
|
|
4395
4139
|
)
|
|
@@ -4410,7 +4154,7 @@ var ChartLegendContent = React27.forwardRef(
|
|
|
4410
4154
|
if (!payload?.length) {
|
|
4411
4155
|
return null;
|
|
4412
4156
|
}
|
|
4413
|
-
return /* @__PURE__ */ (0,
|
|
4157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4414
4158
|
"div",
|
|
4415
4159
|
{
|
|
4416
4160
|
ref,
|
|
@@ -4422,14 +4166,14 @@ var ChartLegendContent = React27.forwardRef(
|
|
|
4422
4166
|
children: payload.map((item) => {
|
|
4423
4167
|
const key = `${nameKey || item.dataKey || "value"}`;
|
|
4424
4168
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
4425
|
-
return /* @__PURE__ */ (0,
|
|
4169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4426
4170
|
"div",
|
|
4427
4171
|
{
|
|
4428
4172
|
className: cn(
|
|
4429
4173
|
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
|
|
4430
4174
|
),
|
|
4431
4175
|
children: [
|
|
4432
|
-
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0,
|
|
4176
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4433
4177
|
"div",
|
|
4434
4178
|
{
|
|
4435
4179
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
@@ -4466,8 +4210,8 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
4466
4210
|
// components/ui/slider.tsx
|
|
4467
4211
|
var React28 = __toESM(require("react"));
|
|
4468
4212
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"));
|
|
4469
|
-
var
|
|
4470
|
-
var Slider = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4213
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4214
|
+
var Slider = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4471
4215
|
SliderPrimitive.Root,
|
|
4472
4216
|
{
|
|
4473
4217
|
ref,
|
|
@@ -4477,15 +4221,15 @@ var Slider = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
4477
4221
|
),
|
|
4478
4222
|
...props,
|
|
4479
4223
|
children: [
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4481
|
-
/* @__PURE__ */ (0,
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SliderPrimitive.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })
|
|
4482
4226
|
]
|
|
4483
4227
|
}
|
|
4484
4228
|
));
|
|
4485
4229
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
4486
4230
|
|
|
4487
4231
|
// components/form-controls/form-with-action-buttons.tsx
|
|
4488
|
-
var
|
|
4232
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4489
4233
|
var FormWithActionButtons = ({
|
|
4490
4234
|
children,
|
|
4491
4235
|
form,
|
|
@@ -4496,10 +4240,10 @@ var FormWithActionButtons = ({
|
|
|
4496
4240
|
secondaryButtonAction,
|
|
4497
4241
|
showSecondaryButton = false
|
|
4498
4242
|
}) => {
|
|
4499
|
-
return /* @__PURE__ */ (0,
|
|
4243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
4500
4244
|
children,
|
|
4501
|
-
/* @__PURE__ */ (0,
|
|
4502
|
-
showSecondaryButton && /* @__PURE__ */ (0,
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
4246
|
+
showSecondaryButton && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4503
4247
|
Button,
|
|
4504
4248
|
{
|
|
4505
4249
|
variant: "link",
|
|
@@ -4508,29 +4252,29 @@ var FormWithActionButtons = ({
|
|
|
4508
4252
|
children: secondaryButtonText
|
|
4509
4253
|
}
|
|
4510
4254
|
),
|
|
4511
|
-
/* @__PURE__ */ (0,
|
|
4255
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "default", type: "submit", children: primaryButtonText })
|
|
4512
4256
|
] })
|
|
4513
4257
|
] }) });
|
|
4514
4258
|
};
|
|
4515
4259
|
|
|
4516
4260
|
// components/form-controls/helpers.tsx
|
|
4517
|
-
var
|
|
4518
|
-
var
|
|
4261
|
+
var import_lucide_react5 = require("lucide-react");
|
|
4262
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4519
4263
|
var getFileIcon = (fileName) => {
|
|
4520
4264
|
const extensionMatch = fileName.match(/\.([^.]+)$/);
|
|
4521
4265
|
const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;
|
|
4522
|
-
if (!extension) return /* @__PURE__ */ (0,
|
|
4266
|
+
if (!extension) return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react5.File, { className: "w-8 h-8 text-gray-500" });
|
|
4523
4267
|
switch (extension) {
|
|
4524
4268
|
case "pdf":
|
|
4525
|
-
return /* @__PURE__ */ (0,
|
|
4269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react5.File, { className: "w-8 h-8 text-red-500" });
|
|
4526
4270
|
case "doc":
|
|
4527
4271
|
case "docx":
|
|
4528
|
-
return /* @__PURE__ */ (0,
|
|
4272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react5.FileText, { className: "w-8 h-8 text-blue-500" });
|
|
4529
4273
|
case "xls":
|
|
4530
4274
|
case "xlsx":
|
|
4531
|
-
return /* @__PURE__ */ (0,
|
|
4275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react5.FileSpreadsheet, { className: "w-8 h-8 text-green-500" });
|
|
4532
4276
|
default:
|
|
4533
|
-
return /* @__PURE__ */ (0,
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react5.File, { className: "w-8 h-8 text-gray-500" });
|
|
4534
4278
|
}
|
|
4535
4279
|
};
|
|
4536
4280
|
var getFileName = (url) => {
|
|
@@ -4540,14 +4284,14 @@ var getFileName = (url) => {
|
|
|
4540
4284
|
};
|
|
4541
4285
|
|
|
4542
4286
|
// components/form-controls/icon-button.tsx
|
|
4543
|
-
var
|
|
4287
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4544
4288
|
var IconButton = ({
|
|
4545
4289
|
item,
|
|
4546
4290
|
variant,
|
|
4547
4291
|
onClick,
|
|
4548
4292
|
...props
|
|
4549
4293
|
}) => {
|
|
4550
|
-
return /* @__PURE__ */ (0,
|
|
4294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4551
4295
|
Button,
|
|
4552
4296
|
{
|
|
4553
4297
|
type: "button",
|
|
@@ -4556,8 +4300,8 @@ var IconButton = ({
|
|
|
4556
4300
|
onClick,
|
|
4557
4301
|
...props,
|
|
4558
4302
|
children: [
|
|
4559
|
-
/* @__PURE__ */ (0,
|
|
4560
|
-
/* @__PURE__ */ (0,
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "w-4 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: item.icon, size: 20, strokeWidth: 1 }) }),
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-sm", children: item.title })
|
|
4561
4305
|
]
|
|
4562
4306
|
}
|
|
4563
4307
|
);
|
|
@@ -4565,7 +4309,7 @@ var IconButton = ({
|
|
|
4565
4309
|
|
|
4566
4310
|
// components/form-controls/input.tsx
|
|
4567
4311
|
var React29 = __toESM(require("react"));
|
|
4568
|
-
var
|
|
4312
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4569
4313
|
var Input2 = React29.forwardRef(
|
|
4570
4314
|
({
|
|
4571
4315
|
variant = "default",
|
|
@@ -4577,79 +4321,28 @@ var Input2 = React29.forwardRef(
|
|
|
4577
4321
|
rules,
|
|
4578
4322
|
...props
|
|
4579
4323
|
}, ref) => {
|
|
4580
|
-
return isFormField ? /* @__PURE__ */ (0,
|
|
4324
|
+
return isFormField ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4581
4325
|
FormField,
|
|
4582
4326
|
{
|
|
4583
4327
|
control,
|
|
4584
4328
|
name,
|
|
4585
4329
|
rules,
|
|
4586
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
4587
|
-
title && /* @__PURE__ */ (0,
|
|
4588
|
-
/* @__PURE__ */ (0,
|
|
4589
|
-
/* @__PURE__ */ (0,
|
|
4330
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(FormItem, { children: [
|
|
4331
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FormLabel, { children: title }),
|
|
4332
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Input, { className, ...props, ...field }) }),
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FormMessage, {})
|
|
4590
4334
|
] })
|
|
4591
4335
|
}
|
|
4592
|
-
) : /* @__PURE__ */ (0,
|
|
4336
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Input, { className, ref, ...props });
|
|
4593
4337
|
}
|
|
4594
4338
|
);
|
|
4595
4339
|
Input2.displayName = "Input";
|
|
4596
4340
|
|
|
4597
|
-
// components/form-controls/knowledge-graph-word-cloud.tsx
|
|
4598
|
-
var import_kg = require("@elqnt/kg");
|
|
4599
|
-
var import_lucide_react7 = require("lucide-react");
|
|
4600
|
-
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4601
|
-
function KnowledgeGraphWordCloud() {
|
|
4602
|
-
const { labels } = (0, import_kg.useKnowledgeGraphContext)();
|
|
4603
|
-
if (!labels || !(labels instanceof Array)) {
|
|
4604
|
-
return null;
|
|
4605
|
-
}
|
|
4606
|
-
const data = labels?.map((item) => {
|
|
4607
|
-
return { text: item?.label, value: item?.count };
|
|
4608
|
-
});
|
|
4609
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "rounded-xl border bg-card h-full shadow relative p-5", children: [
|
|
4610
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "capitalize mb-10 font-semibold text-xl", children: "Graph Distribution" }),
|
|
4611
|
-
!data ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "absolute w-full flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react7.Loader2, { className: "animate-spin" }) }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_jsx_runtime54.Fragment, {})
|
|
4612
|
-
] });
|
|
4613
|
-
}
|
|
4614
|
-
|
|
4615
|
-
// components/form-controls/layout/org-selector.tsx
|
|
4616
|
-
var import_auth = require("@elqnt/auth");
|
|
4617
|
-
var import_react7 = require("react");
|
|
4618
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4619
|
-
function OrgSelector() {
|
|
4620
|
-
const { user, selectedOrgId, setSelectedOrgId } = (0, import_auth.useUserContext)();
|
|
4621
|
-
const [orgAccess, setOrgAccess] = (0, import_react7.useState)([]);
|
|
4622
|
-
(0, import_react7.useEffect)(() => {
|
|
4623
|
-
if (user?.orgAccess) {
|
|
4624
|
-
const formattedOrgAccess = user.orgAccess.filter((org) => org.orgId && org.orgTitle).map((org) => ({
|
|
4625
|
-
value: org.orgId,
|
|
4626
|
-
label: org.orgTitle
|
|
4627
|
-
}));
|
|
4628
|
-
setOrgAccess(formattedOrgAccess);
|
|
4629
|
-
}
|
|
4630
|
-
}, [user]);
|
|
4631
|
-
const handleOrgIdChange = (value) => {
|
|
4632
|
-
setSelectedOrgId?.(value);
|
|
4633
|
-
};
|
|
4634
|
-
if (!user) {
|
|
4635
|
-
return null;
|
|
4636
|
-
}
|
|
4637
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4638
|
-
Combobox,
|
|
4639
|
-
{
|
|
4640
|
-
defaultValue: selectedOrgId,
|
|
4641
|
-
options: orgAccess,
|
|
4642
|
-
onChange: handleOrgIdChange,
|
|
4643
|
-
label: "Select an Organization"
|
|
4644
|
-
}
|
|
4645
|
-
);
|
|
4646
|
-
}
|
|
4647
|
-
|
|
4648
4341
|
// components/form-controls/layout/page-header.tsx
|
|
4649
|
-
var
|
|
4342
|
+
var import_lucide_react6 = require("lucide-react");
|
|
4650
4343
|
var import_link = __toESM(require("next/link"));
|
|
4651
4344
|
var import_navigation = require("next/navigation");
|
|
4652
|
-
var
|
|
4345
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4653
4346
|
function PageHeader({
|
|
4654
4347
|
title,
|
|
4655
4348
|
description,
|
|
@@ -4687,7 +4380,7 @@ function PageHeader({
|
|
|
4687
4380
|
return "justify-between";
|
|
4688
4381
|
}
|
|
4689
4382
|
}
|
|
4690
|
-
return /* @__PURE__ */ (0,
|
|
4383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4691
4384
|
"div",
|
|
4692
4385
|
{
|
|
4693
4386
|
className: cn(
|
|
@@ -4695,25 +4388,25 @@ function PageHeader({
|
|
|
4695
4388
|
getJustifyClass()
|
|
4696
4389
|
),
|
|
4697
4390
|
children: [
|
|
4698
|
-
/* @__PURE__ */ (0,
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4700
|
-
goBackLink && /* @__PURE__ */ (0,
|
|
4701
|
-
showBack && !goBackLink && /* @__PURE__ */ (0,
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
|
|
4392
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4393
|
+
goBackLink && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_link.default, { href: goBackLink, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react6.ChevronLeft, { className: "h-4 w-4" }) }),
|
|
4394
|
+
showBack && !goBackLink && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4702
4395
|
"button",
|
|
4703
4396
|
{
|
|
4704
4397
|
onClick: handleBack,
|
|
4705
4398
|
className: "h-8 w-8 p-0 flex items-center justify-center rounded-md border border-gray-200 hover:bg-gray-50 transition-colors",
|
|
4706
|
-
children: /* @__PURE__ */ (0,
|
|
4399
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react6.ChevronLeft, { className: "h-4 w-4" })
|
|
4707
4400
|
}
|
|
4708
4401
|
),
|
|
4709
|
-
titleComponent ?? (title && /* @__PURE__ */ (0,
|
|
4402
|
+
titleComponent ?? (title && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { className: "font-semibold text-lg text-primary p-0 m-0", children: title }))
|
|
4710
4403
|
] }) }),
|
|
4711
|
-
description && /* @__PURE__ */ (0,
|
|
4404
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-gray-500", children: description })
|
|
4712
4405
|
] }),
|
|
4713
|
-
/* @__PURE__ */ (0,
|
|
4406
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex gap-2 items-center", children: [
|
|
4714
4407
|
rightSideComponent,
|
|
4715
4408
|
actions?.map(
|
|
4716
|
-
(action, index) => action.href ? /* @__PURE__ */ (0,
|
|
4409
|
+
(action, index) => action.href ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_link.default, { href: action.href, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button2, { variant: action.type, children: action.label }) }, index) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button2, { variant: action.type, onClick: action.onAction, children: action.label }, index)
|
|
4717
4410
|
)
|
|
4718
4411
|
] })
|
|
4719
4412
|
]
|
|
@@ -4721,21 +4414,15 @@ function PageHeader({
|
|
|
4721
4414
|
);
|
|
4722
4415
|
}
|
|
4723
4416
|
|
|
4724
|
-
// components/form-controls/layout/left-nav.tsx
|
|
4725
|
-
var import_auth2 = require("@elqnt/auth");
|
|
4726
|
-
var import_link3 = __toESM(require("next/link"));
|
|
4727
|
-
var import_navigation3 = require("next/navigation");
|
|
4728
|
-
var import_react9 = require("react");
|
|
4729
|
-
|
|
4730
4417
|
// components/form-controls/layout/profile-menu.tsx
|
|
4731
|
-
var
|
|
4418
|
+
var import_react6 = require("next-auth/react");
|
|
4732
4419
|
var import_link2 = __toESM(require("next/link"));
|
|
4733
4420
|
var import_navigation2 = require("next/navigation");
|
|
4734
|
-
var
|
|
4421
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4735
4422
|
function ProfileMenu({ children, pathName }) {
|
|
4736
4423
|
const router = (0, import_navigation2.useRouter)();
|
|
4737
4424
|
const handleSignOut = async () => {
|
|
4738
|
-
await (0,
|
|
4425
|
+
await (0, import_react6.signOut)({ redirect: false });
|
|
4739
4426
|
router.push("/");
|
|
4740
4427
|
};
|
|
4741
4428
|
const links = [
|
|
@@ -4753,9 +4440,9 @@ function ProfileMenu({ children, pathName }) {
|
|
|
4753
4440
|
onClick: handleSignOut
|
|
4754
4441
|
}
|
|
4755
4442
|
];
|
|
4756
|
-
return /* @__PURE__ */ (0,
|
|
4757
|
-
/* @__PURE__ */ (0,
|
|
4758
|
-
/* @__PURE__ */ (0,
|
|
4443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Popover, { children: [
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PopoverContent, { className: "p-0! flex flex-col", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4759
4446
|
import_link2.default,
|
|
4760
4447
|
{
|
|
4761
4448
|
href: link?.href,
|
|
@@ -4763,7 +4450,7 @@ function ProfileMenu({ children, pathName }) {
|
|
|
4763
4450
|
className: `cursor-pointer w-full hover:bg-primary/10 hover:text-primary p-4 flex items-center gap-4 text-gray-500
|
|
4764
4451
|
${pathName.includes(link?.href) && "bg-primary/10 text-primary"}`,
|
|
4765
4452
|
children: [
|
|
4766
|
-
/* @__PURE__ */ (0,
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { name: link?.icon, size: 20 }),
|
|
4767
4454
|
link?.title
|
|
4768
4455
|
]
|
|
4769
4456
|
},
|
|
@@ -4772,188 +4459,10 @@ function ProfileMenu({ children, pathName }) {
|
|
|
4772
4459
|
] });
|
|
4773
4460
|
}
|
|
4774
4461
|
|
|
4775
|
-
// components/form-controls/layout/left-nav.tsx
|
|
4776
|
-
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4777
|
-
var articles = [
|
|
4778
|
-
{ key: "getting-started", title: "Getting Started", href: "#" },
|
|
4779
|
-
{ key: "helpdesk", title: "Helpdesk", href: "#" }
|
|
4780
|
-
];
|
|
4781
|
-
function LeftNav({
|
|
4782
|
-
fullMenuItems,
|
|
4783
|
-
menuItems,
|
|
4784
|
-
pageTitle,
|
|
4785
|
-
ExpandedLogo,
|
|
4786
|
-
Logo
|
|
4787
|
-
}) {
|
|
4788
|
-
const router = (0, import_navigation3.useRouter)();
|
|
4789
|
-
const pathName = (0, import_navigation3.usePathname)();
|
|
4790
|
-
const { user, selectedOrgId, selectedOrg } = (0, import_auth2.useUserContext)();
|
|
4791
|
-
const [isExpanded, setIsExpanded] = (0, import_react9.useState)(() => {
|
|
4792
|
-
const stored = localStorage.getItem("isExpanded");
|
|
4793
|
-
return stored === null ? true : stored === "true";
|
|
4794
|
-
});
|
|
4795
|
-
const [apps, setApps] = (0, import_react9.useState)([]);
|
|
4796
|
-
const [items, setItems] = (0, import_react9.useState)(menuItems);
|
|
4797
|
-
(0, import_react9.useEffect)(() => {
|
|
4798
|
-
setItems(menuItems);
|
|
4799
|
-
}, [menuItems]);
|
|
4800
|
-
(0, import_react9.useEffect)(() => {
|
|
4801
|
-
if (!user || !selectedOrgId || !selectedOrg) return;
|
|
4802
|
-
const orgAccess = user.orgAccess?.find(
|
|
4803
|
-
(org) => org.orgId === selectedOrgId
|
|
4804
|
-
);
|
|
4805
|
-
if (!orgAccess) return;
|
|
4806
|
-
const apps2 = fullMenuItems?.filter(
|
|
4807
|
-
(item) => selectedOrg.apps?.includes(item.key)
|
|
4808
|
-
);
|
|
4809
|
-
setApps(apps2);
|
|
4810
|
-
}, [user, selectedOrgId, selectedOrg]);
|
|
4811
|
-
(0, import_react9.useEffect)(() => {
|
|
4812
|
-
localStorage.setItem("isExpanded", isExpanded.toString());
|
|
4813
|
-
}, [isExpanded]);
|
|
4814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4815
|
-
"div",
|
|
4816
|
-
{
|
|
4817
|
-
style: { height: "calc(100vh - 32px)" },
|
|
4818
|
-
className: `relative pt-4 ${isExpanded ? "min-w-72" : "min-w-16"} transition-width duration-300 rounded-lg text-gray-500 sticky top-4 bg-white`,
|
|
4819
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "absolute top-0 flex flex-col gap-8 justify-between h-full w-full duration-300 ease-in-out sc-card bg-white! p-3 overflow-y-scroll hide-scrollbar", children: [
|
|
4820
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4821
|
-
"div",
|
|
4822
|
-
{
|
|
4823
|
-
className: `flex flex-col gap-1 ${!isExpanded && "items-center"}`,
|
|
4824
|
-
children: [
|
|
4825
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "cursor-pointer flex items-center justify-between mb-4 w-full", children: [
|
|
4826
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4827
|
-
"div",
|
|
4828
|
-
{
|
|
4829
|
-
onClick: () => isExpanded ? router.push("/") : setIsExpanded(true),
|
|
4830
|
-
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ExpandedLogo, {}) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Logo, {})
|
|
4831
|
-
}
|
|
4832
|
-
),
|
|
4833
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { onClick: () => setIsExpanded(false), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: "ChevronsLeftRight" }) })
|
|
4834
|
-
] }),
|
|
4835
|
-
items ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
4836
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4837
|
-
"div",
|
|
4838
|
-
{
|
|
4839
|
-
onClick: () => setItems(void 0),
|
|
4840
|
-
className: "flex items-center px-1 gap-2 cursor-pointer mb-4 text-lg",
|
|
4841
|
-
children: [
|
|
4842
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: "ArrowLeft", size: 19 }),
|
|
4843
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: pageTitle })
|
|
4844
|
-
]
|
|
4845
|
-
}
|
|
4846
|
-
),
|
|
4847
|
-
menuItems?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4848
|
-
import_link3.default,
|
|
4849
|
-
{
|
|
4850
|
-
href: item.href,
|
|
4851
|
-
className: `flex items-center gap-2 cursor-pointer w-full text-sm rounded-lg py-3 ${isExpanded ? "pl-2 hover:bg-primary/10 hover:text-primary" : "pl-0 justify-center"}
|
|
4852
|
-
${item.href && (item.href?.split("/").length > 2 ? pathName?.includes(item.href) ?? "" : pathName === item.href) && isExpanded ? "bg-primary/10 text-primary" : ""}
|
|
4853
|
-
`,
|
|
4854
|
-
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
4855
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: item.icon, size: 19 }),
|
|
4856
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: item.title })
|
|
4857
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Tooltip, { delayDuration: 0, children: [
|
|
4858
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: item.icon }) }),
|
|
4859
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipContent, { side: "right", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { children: item.title }) })
|
|
4860
|
-
] })
|
|
4861
|
-
},
|
|
4862
|
-
item.title
|
|
4863
|
-
))
|
|
4864
|
-
] }) : isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
4865
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { id: "menu-row", children: [
|
|
4866
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xl font-semibold", children: "Apps" }),
|
|
4867
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "grid grid-cols-2 gap-2 mt-6", children: apps.filter((item) => item.key !== "home").map((item) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4868
|
-
IconButton,
|
|
4869
|
-
{
|
|
4870
|
-
item,
|
|
4871
|
-
variant: "ghost",
|
|
4872
|
-
onClick: () => {
|
|
4873
|
-
router.push(item.href);
|
|
4874
|
-
setItems(menuItems);
|
|
4875
|
-
}
|
|
4876
|
-
},
|
|
4877
|
-
item.key
|
|
4878
|
-
)) })
|
|
4879
|
-
] }),
|
|
4880
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { id: "help-row", className: "mt-12 ml-2", children: [
|
|
4881
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xl font-semibold", children: "Help" }),
|
|
4882
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mt-6", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Input, { placeholder: "Search help content" }) }),
|
|
4883
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "mt-6 ml-4 list-disc", children: articles.map((item) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4884
|
-
import_link3.default,
|
|
4885
|
-
{
|
|
4886
|
-
href: item.href,
|
|
4887
|
-
className: "block mb-2 underline",
|
|
4888
|
-
onClick: () => setIsExpanded(false),
|
|
4889
|
-
children: item.title
|
|
4890
|
-
}
|
|
4891
|
-
) }, item.key)) })
|
|
4892
|
-
] })
|
|
4893
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex flex-col gap-6 mt-2", children: apps?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Tooltip, { delayDuration: 0, children: [
|
|
4894
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4895
|
-
"div",
|
|
4896
|
-
{
|
|
4897
|
-
onClick: () => {
|
|
4898
|
-
router.push(item.href);
|
|
4899
|
-
setItems(menuItems);
|
|
4900
|
-
},
|
|
4901
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: item.icon })
|
|
4902
|
-
}
|
|
4903
|
-
) }),
|
|
4904
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipContent, { side: "right", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { children: item.title }) })
|
|
4905
|
-
] }, item.key)) })
|
|
4906
|
-
]
|
|
4907
|
-
}
|
|
4908
|
-
),
|
|
4909
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
4910
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(OrgSelector, {}) }),
|
|
4911
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4912
|
-
import_link3.default,
|
|
4913
|
-
{
|
|
4914
|
-
href: "/admin/settings",
|
|
4915
|
-
className: `flex items-center gap-4 cursor-pointer w-full rounded-lg py-2 mb-1 ${isExpanded ? "pl-2 hover:bg-primary/10 hover:text-primary" : "pl-0"}
|
|
4916
|
-
${pathName?.includes("/settings") && isExpanded ? "bg-primary/10 text-primary" : ""}
|
|
4917
|
-
`,
|
|
4918
|
-
children: [
|
|
4919
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: "Settings" }),
|
|
4920
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: "Settings" })
|
|
4921
|
-
]
|
|
4922
|
-
}
|
|
4923
|
-
),
|
|
4924
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4925
|
-
import_link3.default,
|
|
4926
|
-
{
|
|
4927
|
-
href: "/admin/help",
|
|
4928
|
-
className: `flex items-center gap-4 cursor-pointer w-full rounded-lg py-2 mb-1 ${isExpanded ? "pl-2 hover:bg-primary/10 hover:text-primary" : "pl-0"}
|
|
4929
|
-
${pathName?.includes("/help") && isExpanded ? "bg-primary/10 text-primary" : ""}
|
|
4930
|
-
`,
|
|
4931
|
-
children: [
|
|
4932
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: "HeartHandshake" }),
|
|
4933
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: "Help" })
|
|
4934
|
-
]
|
|
4935
|
-
}
|
|
4936
|
-
),
|
|
4937
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ProfileMenu, { pathName: pathName ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4938
|
-
"div",
|
|
4939
|
-
{
|
|
4940
|
-
className: `flex items-center gap-4 cursor-pointer w-full rounded-lg py-2 ${isExpanded ? "pl-2 hover:bg-primary/10 hover:text-primary" : "pl-0"}`,
|
|
4941
|
-
children: [
|
|
4942
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon2, { name: "User" }),
|
|
4943
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: user?.firstName })
|
|
4944
|
-
]
|
|
4945
|
-
}
|
|
4946
|
-
) })
|
|
4947
|
-
] })
|
|
4948
|
-
] }) })
|
|
4949
|
-
}
|
|
4950
|
-
);
|
|
4951
|
-
}
|
|
4952
|
-
|
|
4953
4462
|
// components/form-controls/multi-select.tsx
|
|
4954
|
-
var
|
|
4955
|
-
var
|
|
4956
|
-
var
|
|
4463
|
+
var import_lucide_react7 = require("lucide-react");
|
|
4464
|
+
var import_react7 = require("react");
|
|
4465
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4957
4466
|
var MultiSelect = ({
|
|
4958
4467
|
defaultValue = [],
|
|
4959
4468
|
placeholder,
|
|
@@ -4961,8 +4470,8 @@ var MultiSelect = ({
|
|
|
4961
4470
|
className = "",
|
|
4962
4471
|
onValueChange
|
|
4963
4472
|
}) => {
|
|
4964
|
-
const [open, setOpen] = (0,
|
|
4965
|
-
const [selectedValues, setSelectedValues] = (0,
|
|
4473
|
+
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
4474
|
+
const [selectedValues, setSelectedValues] = (0, import_react7.useState)(defaultValue);
|
|
4966
4475
|
const handleSelect = (value) => {
|
|
4967
4476
|
let updatedValues;
|
|
4968
4477
|
if (selectedValues.includes(value)) {
|
|
@@ -4979,17 +4488,17 @@ var MultiSelect = ({
|
|
|
4979
4488
|
setSelectedValues(updatedValues);
|
|
4980
4489
|
onValueChange(updatedValues);
|
|
4981
4490
|
};
|
|
4982
|
-
return /* @__PURE__ */ (0,
|
|
4983
|
-
/* @__PURE__ */ (0,
|
|
4491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
4492
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4984
4493
|
Button,
|
|
4985
4494
|
{
|
|
4986
4495
|
variant: "outline",
|
|
4987
4496
|
role: "combobox",
|
|
4988
4497
|
"aria-expanded": open,
|
|
4989
4498
|
className: cn("min-h-10 h-auto w-full justify-between", className),
|
|
4990
|
-
children: /* @__PURE__ */ (0,
|
|
4499
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
4991
4500
|
selectedValues.length === 0 && placeholder,
|
|
4992
|
-
selectedValues.map((value) => /* @__PURE__ */ (0,
|
|
4501
|
+
selectedValues.map((value) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4993
4502
|
Badge,
|
|
4994
4503
|
{
|
|
4995
4504
|
variant: "secondary",
|
|
@@ -4997,7 +4506,7 @@ var MultiSelect = ({
|
|
|
4997
4506
|
onClick: (e) => handleClear(value, e),
|
|
4998
4507
|
children: [
|
|
4999
4508
|
options.find((opt) => opt.value === value)?.label,
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
4509
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react7.X, { className: "ml-1 h-3 w-3" })
|
|
5001
4510
|
]
|
|
5002
4511
|
},
|
|
5003
4512
|
value
|
|
@@ -5005,13 +4514,13 @@ var MultiSelect = ({
|
|
|
5005
4514
|
] })
|
|
5006
4515
|
}
|
|
5007
4516
|
) }),
|
|
5008
|
-
/* @__PURE__ */ (0,
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PopoverContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Command, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(CommandGroup, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
5009
4518
|
CommandItem,
|
|
5010
4519
|
{
|
|
5011
4520
|
onSelect: () => handleSelect(option.value),
|
|
5012
4521
|
children: [
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5014
|
-
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4523
|
+
import_lucide_react7.Check,
|
|
5015
4524
|
{
|
|
5016
4525
|
className: cn(
|
|
5017
4526
|
"mr-2 h-4 w-4",
|
|
@@ -5028,18 +4537,18 @@ var MultiSelect = ({
|
|
|
5028
4537
|
};
|
|
5029
4538
|
|
|
5030
4539
|
// components/form-controls/multi-step-process.tsx
|
|
5031
|
-
var
|
|
5032
|
-
var
|
|
5033
|
-
var
|
|
4540
|
+
var import_lucide_react8 = require("lucide-react");
|
|
4541
|
+
var import_react8 = require("react");
|
|
4542
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5034
4543
|
var MultiStepProcess = ({
|
|
5035
4544
|
initialSteps,
|
|
5036
4545
|
onFinish,
|
|
5037
4546
|
finishButtonText
|
|
5038
4547
|
}) => {
|
|
5039
|
-
const [steps, setSteps] = (0,
|
|
4548
|
+
const [steps, setSteps] = (0, import_react8.useState)(
|
|
5040
4549
|
initialSteps.map((step) => ({ ...step, isValid: false, isComplete: false }))
|
|
5041
4550
|
);
|
|
5042
|
-
const [currentStepIndex, setCurrentStepIndex] = (0,
|
|
4551
|
+
const [currentStepIndex, setCurrentStepIndex] = (0, import_react8.useState)(0);
|
|
5043
4552
|
const updateStep = (stepIndex, updates) => {
|
|
5044
4553
|
setSteps(
|
|
5045
4554
|
(prevSteps) => prevSteps.map(
|
|
@@ -5066,7 +4575,7 @@ var MultiStepProcess = ({
|
|
|
5066
4575
|
}
|
|
5067
4576
|
updateStep(currentStepIndex, { isLoading: false });
|
|
5068
4577
|
};
|
|
5069
|
-
(0,
|
|
4578
|
+
(0, import_react8.useEffect)(() => {
|
|
5070
4579
|
const currentStep = steps[currentStepIndex];
|
|
5071
4580
|
if (currentStep.isComplete) {
|
|
5072
4581
|
goToNextStep();
|
|
@@ -5079,7 +4588,7 @@ var MultiStepProcess = ({
|
|
|
5079
4588
|
};
|
|
5080
4589
|
const renderStepComponent = (step, index) => {
|
|
5081
4590
|
const StepComponent = step.component;
|
|
5082
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5083
4592
|
StepComponent,
|
|
5084
4593
|
{
|
|
5085
4594
|
step,
|
|
@@ -5089,23 +4598,23 @@ var MultiStepProcess = ({
|
|
|
5089
4598
|
};
|
|
5090
4599
|
const isLastStep = currentStepIndex === steps.length - 1;
|
|
5091
4600
|
const currentStepData = steps[currentStepIndex];
|
|
5092
|
-
return /* @__PURE__ */ (0,
|
|
5093
|
-
/* @__PURE__ */ (0,
|
|
5094
|
-
/* @__PURE__ */ (0,
|
|
4601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Card, { className: "p-6", children: [
|
|
4602
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "mb-8", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex justify-between items-start", children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5095
4604
|
"div",
|
|
5096
4605
|
{
|
|
5097
4606
|
className: `
|
|
5098
4607
|
w-10 h-10 rounded-full flex items-center justify-center mb-2
|
|
5099
4608
|
${i < currentStepIndex ? "bg-green-500 text-white" : i === currentStepIndex ? "bg-blue-500 text-white" : "bg-gray-200 text-gray-500"}
|
|
5100
4609
|
`,
|
|
5101
|
-
children: i < currentStepIndex ? /* @__PURE__ */ (0,
|
|
4610
|
+
children: i < currentStepIndex ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react8.Check, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: step.id })
|
|
5102
4611
|
}
|
|
5103
4612
|
),
|
|
5104
|
-
/* @__PURE__ */ (0,
|
|
4613
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-sm text-center max-w-[100px]", children: step.title })
|
|
5105
4614
|
] }, i)) }) }),
|
|
5106
|
-
/* @__PURE__ */ (0,
|
|
5107
|
-
/* @__PURE__ */ (0,
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
4615
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "mb-3", children: renderStepComponent(currentStepData, currentStepIndex) }),
|
|
4616
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex justify-between", children: [
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5109
4618
|
Button,
|
|
5110
4619
|
{
|
|
5111
4620
|
onClick: goToPreviousStep,
|
|
@@ -5114,12 +4623,12 @@ var MultiStepProcess = ({
|
|
|
5114
4623
|
children: "Previous"
|
|
5115
4624
|
}
|
|
5116
4625
|
),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5118
4627
|
Button,
|
|
5119
4628
|
{
|
|
5120
4629
|
onClick: goToNextStep,
|
|
5121
4630
|
disabled: !currentStepData.isValid || currentStepData.isLoading,
|
|
5122
|
-
children: currentStepData.isLoading ? /* @__PURE__ */ (0,
|
|
4631
|
+
children: currentStepData.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react8.Loader2, { className: "h-6 w-6 animate-spin" }) : isLastStep ? finishButtonText ?? "Finish" : "Next"
|
|
5123
4632
|
}
|
|
5124
4633
|
)
|
|
5125
4634
|
] })
|
|
@@ -5127,7 +4636,7 @@ var MultiStepProcess = ({
|
|
|
5127
4636
|
};
|
|
5128
4637
|
|
|
5129
4638
|
// components/form-controls/popover.tsx
|
|
5130
|
-
var
|
|
4639
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5131
4640
|
var Popover2 = ({
|
|
5132
4641
|
trigger,
|
|
5133
4642
|
children,
|
|
@@ -5135,9 +4644,9 @@ var Popover2 = ({
|
|
|
5135
4644
|
align = "center",
|
|
5136
4645
|
sideOffset = 4
|
|
5137
4646
|
}) => {
|
|
5138
|
-
return /* @__PURE__ */ (0,
|
|
5139
|
-
/* @__PURE__ */ (0,
|
|
5140
|
-
/* @__PURE__ */ (0,
|
|
4647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Popover, { children: [
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className, children: trigger }) }),
|
|
4649
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5141
4650
|
PopoverContent,
|
|
5142
4651
|
{
|
|
5143
4652
|
align,
|
|
@@ -5151,34 +4660,34 @@ var Popover2 = ({
|
|
|
5151
4660
|
|
|
5152
4661
|
// components/form-controls/radio-group.tsx
|
|
5153
4662
|
var React31 = __toESM(require("react"));
|
|
5154
|
-
var
|
|
4663
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5155
4664
|
var RadioGroup3 = React31.forwardRef(({ className, options, defaultValue, title, name, control, isFormField, ...props }, ref) => {
|
|
5156
4665
|
if (!isFormField) {
|
|
5157
|
-
return /* @__PURE__ */ (0,
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
4666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(RadioGroup2, { defaultValue, ...props, ref, children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(RadioGroupItem, { value: option.value, id: option.value }),
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { htmlFor: option.value, children: option.label })
|
|
5160
4669
|
] }, option.value)) });
|
|
5161
4670
|
}
|
|
5162
|
-
return /* @__PURE__ */ (0,
|
|
4671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5163
4672
|
FormField,
|
|
5164
4673
|
{
|
|
5165
4674
|
control,
|
|
5166
4675
|
name,
|
|
5167
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5168
|
-
title && /* @__PURE__ */ (0,
|
|
5169
|
-
/* @__PURE__ */ (0,
|
|
4676
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(FormItem, { children: [
|
|
4677
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormLabel, { children: title }),
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5170
4679
|
RadioGroup2,
|
|
5171
4680
|
{
|
|
5172
4681
|
onValueChange: field.onChange,
|
|
5173
4682
|
defaultValue: field.value,
|
|
5174
4683
|
...props,
|
|
5175
|
-
children: options?.map((option) => /* @__PURE__ */ (0,
|
|
5176
|
-
/* @__PURE__ */ (0,
|
|
5177
|
-
/* @__PURE__ */ (0,
|
|
4684
|
+
children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
4685
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(RadioGroupItem, { value: option.value, id: option.value }),
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { htmlFor: option.value, children: option.label })
|
|
5178
4687
|
] }, option.value))
|
|
5179
4688
|
}
|
|
5180
4689
|
) }),
|
|
5181
|
-
/* @__PURE__ */ (0,
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormMessage, {})
|
|
5182
4691
|
] })
|
|
5183
4692
|
}
|
|
5184
4693
|
);
|
|
@@ -5188,22 +4697,22 @@ RadioGroup3.displayName = "RadioGroup";
|
|
|
5188
4697
|
// components/form-controls/scroll-area.tsx
|
|
5189
4698
|
var React32 = __toESM(require("react"));
|
|
5190
4699
|
var import_react_scroll_area = require("@radix-ui/react-scroll-area");
|
|
5191
|
-
var
|
|
5192
|
-
var ScrollArea2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4700
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4701
|
+
var ScrollArea2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5193
4702
|
import_react_scroll_area.ScrollArea,
|
|
5194
4703
|
{
|
|
5195
4704
|
ref,
|
|
5196
4705
|
className: cn("relative overflow-hidden", className),
|
|
5197
4706
|
...props,
|
|
5198
4707
|
children: [
|
|
5199
|
-
/* @__PURE__ */ (0,
|
|
5200
|
-
/* @__PURE__ */ (0,
|
|
5201
|
-
/* @__PURE__ */ (0,
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_scroll_area.ScrollAreaViewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ScrollBar2, {}),
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_scroll_area.ScrollAreaCorner, {})
|
|
5202
4711
|
]
|
|
5203
4712
|
}
|
|
5204
4713
|
));
|
|
5205
4714
|
ScrollArea2.displayName = import_react_scroll_area.ScrollArea.displayName;
|
|
5206
|
-
var ScrollBar2 = React32.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0,
|
|
4715
|
+
var ScrollBar2 = React32.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5207
4716
|
import_react_scroll_area.ScrollAreaScrollbar,
|
|
5208
4717
|
{
|
|
5209
4718
|
ref,
|
|
@@ -5215,13 +4724,13 @@ var ScrollBar2 = React32.forwardRef(({ className, orientation = "vertical", ...p
|
|
|
5215
4724
|
className
|
|
5216
4725
|
),
|
|
5217
4726
|
...props,
|
|
5218
|
-
children: /* @__PURE__ */ (0,
|
|
4727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_scroll_area.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
5219
4728
|
}
|
|
5220
4729
|
));
|
|
5221
4730
|
ScrollBar2.displayName = import_react_scroll_area.ScrollAreaScrollbar.displayName;
|
|
5222
4731
|
|
|
5223
4732
|
// components/form-controls/select.tsx
|
|
5224
|
-
var
|
|
4733
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5225
4734
|
var Select2 = ({
|
|
5226
4735
|
defaultValue,
|
|
5227
4736
|
placeholder,
|
|
@@ -5229,9 +4738,9 @@ var Select2 = ({
|
|
|
5229
4738
|
className = "",
|
|
5230
4739
|
onValueChange
|
|
5231
4740
|
}) => {
|
|
5232
|
-
return /* @__PURE__ */ (0,
|
|
5233
|
-
/* @__PURE__ */ (0,
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
4741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Select, { value: defaultValue, onValueChange, children: [
|
|
4742
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectTrigger, { className, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectValue, { placeholder }) }),
|
|
4743
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectContent, { children: options?.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectItem, { value: option.value, children: option.label }, i)) })
|
|
5235
4744
|
] });
|
|
5236
4745
|
};
|
|
5237
4746
|
|
|
@@ -5243,8 +4752,8 @@ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
|
5243
4752
|
// components/ui/progress.tsx
|
|
5244
4753
|
var React33 = __toESM(require("react"));
|
|
5245
4754
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
5246
|
-
var
|
|
5247
|
-
var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4755
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4756
|
+
var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5248
4757
|
ProgressPrimitive.Root,
|
|
5249
4758
|
{
|
|
5250
4759
|
ref,
|
|
@@ -5253,7 +4762,7 @@ var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
|
5253
4762
|
className
|
|
5254
4763
|
),
|
|
5255
4764
|
...props,
|
|
5256
|
-
children: /* @__PURE__ */ (0,
|
|
4765
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5257
4766
|
ProgressPrimitive.Indicator,
|
|
5258
4767
|
{
|
|
5259
4768
|
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
@@ -5265,27 +4774,27 @@ var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
|
5265
4774
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
5266
4775
|
|
|
5267
4776
|
// components/form-controls/setup-guide.tsx
|
|
5268
|
-
var
|
|
5269
|
-
var
|
|
5270
|
-
var
|
|
4777
|
+
var import_lucide_react9 = require("lucide-react");
|
|
4778
|
+
var import_react9 = require("react");
|
|
4779
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5271
4780
|
var SetupGuide = ({
|
|
5272
4781
|
onDismiss,
|
|
5273
4782
|
onStepComplete,
|
|
5274
4783
|
items
|
|
5275
4784
|
}) => {
|
|
5276
|
-
const [expanded, setExpanded] = (0,
|
|
4785
|
+
const [expanded, setExpanded] = (0, import_react9.useState)(
|
|
5277
4786
|
items.findIndex((item) => !item.complete)
|
|
5278
4787
|
);
|
|
5279
|
-
const [isGuideOpen, setIsGuideOpen] = (0,
|
|
5280
|
-
const accessId = (0,
|
|
4788
|
+
const [isGuideOpen, setIsGuideOpen] = (0, import_react9.useState)(true);
|
|
4789
|
+
const accessId = (0, import_react9.useId)();
|
|
5281
4790
|
const completedItemsLength = items.filter((item) => item.complete).length;
|
|
5282
|
-
return /* @__PURE__ */ (0,
|
|
5283
|
-
/* @__PURE__ */ (0,
|
|
5284
|
-
completedItemsLength === items.length ? /* @__PURE__ */ (0,
|
|
5285
|
-
/* @__PURE__ */ (0,
|
|
5286
|
-
/* @__PURE__ */ (0,
|
|
5287
|
-
] }) : /* @__PURE__ */ (0,
|
|
5288
|
-
completedItemsLength !== items.length && /* @__PURE__ */ (0,
|
|
4791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "p-0", children: [
|
|
4792
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "px-4 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4793
|
+
completedItemsLength === items.length ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4794
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react9.Check, { className: "h-4 w-4 text-gray-400" }),
|
|
4795
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-sm text-gray-400", children: "Done" })
|
|
4796
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-sm", children: `${completedItemsLength} / ${items.length} completed` }),
|
|
4797
|
+
completedItemsLength !== items.length && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "w-24", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5289
4798
|
Progress,
|
|
5290
4799
|
{
|
|
5291
4800
|
value: completedItemsLength / items.length * 100,
|
|
@@ -5293,7 +4802,7 @@ var SetupGuide = ({
|
|
|
5293
4802
|
}
|
|
5294
4803
|
) })
|
|
5295
4804
|
] }) }) }) }),
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Collapsible, { open: isGuideOpen, id: accessId, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CollapsibleContent2, { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "space-y-1", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5297
4806
|
SetupItem,
|
|
5298
4807
|
{
|
|
5299
4808
|
expanded: expanded === item.id,
|
|
@@ -5303,7 +4812,7 @@ var SetupGuide = ({
|
|
|
5303
4812
|
},
|
|
5304
4813
|
item.id
|
|
5305
4814
|
)) }) }) }),
|
|
5306
|
-
completedItemsLength === items.length && /* @__PURE__ */ (0,
|
|
4815
|
+
completedItemsLength === items.length && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "border-t border-gray-200 bg-gray-50 p-3", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { onClick: onDismiss, children: "Dismiss Guide" }) }) })
|
|
5307
4816
|
] });
|
|
5308
4817
|
};
|
|
5309
4818
|
var SetupItem = ({
|
|
@@ -5318,44 +4827,44 @@ var SetupItem = ({
|
|
|
5318
4827
|
secondaryButton,
|
|
5319
4828
|
id
|
|
5320
4829
|
}) => {
|
|
5321
|
-
const [loading, setLoading] = (0,
|
|
4830
|
+
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
5322
4831
|
const completeItem = async () => {
|
|
5323
4832
|
setLoading(true);
|
|
5324
4833
|
await onComplete(id);
|
|
5325
4834
|
setLoading(false);
|
|
5326
4835
|
};
|
|
5327
|
-
return /* @__PURE__ */ (0,
|
|
5328
|
-
/* @__PURE__ */ (0,
|
|
5329
|
-
/* @__PURE__ */ (0,
|
|
4836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: `rounded ${expanded ? "bg-gray-100" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: `p-2 ${expanded ? "" : "hover:bg-gray-50"}`, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex gap-2 items-start", children: [
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Tooltip, { children: [
|
|
4838
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5330
4839
|
Button,
|
|
5331
4840
|
{
|
|
5332
4841
|
variant: "ghost",
|
|
5333
4842
|
size: "icon",
|
|
5334
4843
|
className: "mt-0.5",
|
|
5335
4844
|
onClick: completeItem,
|
|
5336
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
4845
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }) : complete ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "h-5 w-5 rounded-full bg-gray-900 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react9.Check, { className: "h-3 w-3 text-white" }) }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "h-5 w-5 rounded-full border-2 border-gray-300" })
|
|
5337
4846
|
}
|
|
5338
4847
|
) }),
|
|
5339
|
-
/* @__PURE__ */ (0,
|
|
4848
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TooltipContent, { children: complete ? "Mark as not done" : "Mark as done" })
|
|
5340
4849
|
] }) }),
|
|
5341
|
-
/* @__PURE__ */ (0,
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5342
4851
|
"div",
|
|
5343
4852
|
{
|
|
5344
4853
|
className: `grow ${expanded ? "" : "cursor-pointer"}`,
|
|
5345
4854
|
onClick: expanded ? void 0 : setExpanded,
|
|
5346
|
-
children: /* @__PURE__ */ (0,
|
|
5347
|
-
/* @__PURE__ */ (0,
|
|
5348
|
-
/* @__PURE__ */ (0,
|
|
5349
|
-
/* @__PURE__ */ (0,
|
|
5350
|
-
(primaryButton || secondaryButton) && /* @__PURE__ */ (0,
|
|
5351
|
-
primaryButton && /* @__PURE__ */ (0,
|
|
5352
|
-
secondaryButton && /* @__PURE__ */ (0,
|
|
4855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "space-y-3", id: id.toString(), children: [
|
|
4856
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("h4", { className: expanded ? "text-sm font-semibold" : "text-sm", children: title }),
|
|
4857
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Collapsible, { open: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CollapsibleContent2, { className: "pb-2 pr-2", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "space-y-4", children: [
|
|
4858
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-sm text-gray-600", children: description }),
|
|
4859
|
+
(primaryButton || secondaryButton) && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "space-x-3", children: [
|
|
4860
|
+
primaryButton && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { ...primaryButton.props, children: primaryButton.content }),
|
|
4861
|
+
secondaryButton && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { variant: "outline", ...secondaryButton.props, children: secondaryButton.content })
|
|
5353
4862
|
] })
|
|
5354
4863
|
] }) }) })
|
|
5355
4864
|
] })
|
|
5356
4865
|
}
|
|
5357
4866
|
),
|
|
5358
|
-
image && expanded && /* @__PURE__ */ (0,
|
|
4867
|
+
image && expanded && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5359
4868
|
"img",
|
|
5360
4869
|
{
|
|
5361
4870
|
src: image.url,
|
|
@@ -5367,7 +4876,7 @@ var SetupItem = ({
|
|
|
5367
4876
|
};
|
|
5368
4877
|
|
|
5369
4878
|
// components/form-controls/sheet.tsx
|
|
5370
|
-
var
|
|
4879
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5371
4880
|
var Sheet2 = ({
|
|
5372
4881
|
title,
|
|
5373
4882
|
trigger,
|
|
@@ -5375,20 +4884,20 @@ var Sheet2 = ({
|
|
|
5375
4884
|
children,
|
|
5376
4885
|
...props
|
|
5377
4886
|
}) => {
|
|
5378
|
-
return /* @__PURE__ */ (0,
|
|
5379
|
-
trigger && /* @__PURE__ */ (0,
|
|
5380
|
-
/* @__PURE__ */ (0,
|
|
5381
|
-
/* @__PURE__ */ (0,
|
|
5382
|
-
/* @__PURE__ */ (0,
|
|
4887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Sheet, { ...props, children: [
|
|
4888
|
+
trigger && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SheetTrigger, { children: trigger }),
|
|
4889
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SheetContent, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(SheetHeader, { children: [
|
|
4890
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SheetTitle, { children: title }),
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SheetDescription, { children: description }),
|
|
5383
4892
|
children
|
|
5384
4893
|
] }) })
|
|
5385
4894
|
] });
|
|
5386
4895
|
};
|
|
5387
4896
|
|
|
5388
4897
|
// components/form-controls/tags-input.tsx
|
|
5389
|
-
var
|
|
4898
|
+
var import_lucide_react10 = require("lucide-react");
|
|
5390
4899
|
var React35 = __toESM(require("react"));
|
|
5391
|
-
var
|
|
4900
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5392
4901
|
var TagsInput = React35.forwardRef(
|
|
5393
4902
|
({ variant = "default", className, value, onChange, ...props }, ref) => {
|
|
5394
4903
|
const [inputValue, setInputValue] = React35.useState("");
|
|
@@ -5407,15 +4916,15 @@ var TagsInput = React35.forwardRef(
|
|
|
5407
4916
|
const removeTag = (index) => {
|
|
5408
4917
|
onChange(value.filter((_, i) => i !== index));
|
|
5409
4918
|
};
|
|
5410
|
-
return /* @__PURE__ */ (0,
|
|
5411
|
-
value.map((tag, index) => /* @__PURE__ */ (0,
|
|
4919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex flex-wrap gap-2 p-2 border rounded", children: [
|
|
4920
|
+
value.map((tag, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5412
4921
|
"span",
|
|
5413
4922
|
{
|
|
5414
4923
|
className: "bg-gray-200 px-2 py-1 rounded flex items-center",
|
|
5415
4924
|
children: [
|
|
5416
4925
|
tag,
|
|
5417
|
-
/* @__PURE__ */ (0,
|
|
5418
|
-
|
|
4926
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4927
|
+
import_lucide_react10.X,
|
|
5419
4928
|
{
|
|
5420
4929
|
className: "ml-1 w-4 h-4 cursor-pointer",
|
|
5421
4930
|
onClick: () => removeTag(index)
|
|
@@ -5425,7 +4934,7 @@ var TagsInput = React35.forwardRef(
|
|
|
5425
4934
|
},
|
|
5426
4935
|
index
|
|
5427
4936
|
)),
|
|
5428
|
-
/* @__PURE__ */ (0,
|
|
4937
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5429
4938
|
"input",
|
|
5430
4939
|
{
|
|
5431
4940
|
className: "grow border-none focus:ring-0",
|
|
@@ -5443,7 +4952,7 @@ TagsInput.displayName = "TagsInput";
|
|
|
5443
4952
|
|
|
5444
4953
|
// components/form-controls/textarea.tsx
|
|
5445
4954
|
var React36 = __toESM(require("react"));
|
|
5446
|
-
var
|
|
4955
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5447
4956
|
var Textarea2 = React36.forwardRef(
|
|
5448
4957
|
({
|
|
5449
4958
|
variant = "default",
|
|
@@ -5455,15 +4964,15 @@ var Textarea2 = React36.forwardRef(
|
|
|
5455
4964
|
rules,
|
|
5456
4965
|
...props
|
|
5457
4966
|
}, ref) => {
|
|
5458
|
-
return isFormField ? /* @__PURE__ */ (0,
|
|
4967
|
+
return isFormField ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5459
4968
|
FormField,
|
|
5460
4969
|
{
|
|
5461
4970
|
control,
|
|
5462
4971
|
name,
|
|
5463
4972
|
rules,
|
|
5464
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5465
|
-
title && /* @__PURE__ */ (0,
|
|
5466
|
-
/* @__PURE__ */ (0,
|
|
4973
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(FormItem, { children: [
|
|
4974
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FormLabel, { children: title }),
|
|
4975
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5467
4976
|
Textarea,
|
|
5468
4977
|
{
|
|
5469
4978
|
className: `${className} resize-none`,
|
|
@@ -5471,10 +4980,10 @@ var Textarea2 = React36.forwardRef(
|
|
|
5471
4980
|
...props
|
|
5472
4981
|
}
|
|
5473
4982
|
) }),
|
|
5474
|
-
/* @__PURE__ */ (0,
|
|
4983
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FormMessage, {})
|
|
5475
4984
|
] })
|
|
5476
4985
|
}
|
|
5477
|
-
) : /* @__PURE__ */ (0,
|
|
4986
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5478
4987
|
Textarea,
|
|
5479
4988
|
{
|
|
5480
4989
|
className: `${className} resize-none`,
|
|
@@ -5487,9 +4996,9 @@ var Textarea2 = React36.forwardRef(
|
|
|
5487
4996
|
Textarea2.displayName = "Textarea";
|
|
5488
4997
|
|
|
5489
4998
|
// components/form-controls/time-picker.tsx
|
|
5490
|
-
var
|
|
5491
|
-
var
|
|
5492
|
-
var
|
|
4999
|
+
var import_lucide_react11 = require("lucide-react");
|
|
5000
|
+
var import_react10 = require("react");
|
|
5001
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5493
5002
|
var TimePicker = ({
|
|
5494
5003
|
value,
|
|
5495
5004
|
onValueChange,
|
|
@@ -5497,7 +5006,7 @@ var TimePicker = ({
|
|
|
5497
5006
|
className = "",
|
|
5498
5007
|
disabled = false
|
|
5499
5008
|
}) => {
|
|
5500
|
-
const [open, setOpen] = (0,
|
|
5009
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
5501
5010
|
const hours = Array.from({ length: 24 }, (_, i) => ({
|
|
5502
5011
|
value: i.toString().padStart(2, "0"),
|
|
5503
5012
|
label: i.toString().padStart(2, "0")
|
|
@@ -5513,21 +5022,21 @@ var TimePicker = ({
|
|
|
5513
5022
|
const handleMinuteChange = (newMinute) => {
|
|
5514
5023
|
onValueChange(`${hour}:${newMinute}`);
|
|
5515
5024
|
};
|
|
5516
|
-
return /* @__PURE__ */ (0,
|
|
5517
|
-
/* @__PURE__ */ (0,
|
|
5025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
5026
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5518
5027
|
Button,
|
|
5519
5028
|
{
|
|
5520
5029
|
variant: "outline",
|
|
5521
5030
|
className: `w-full justify-start text-left font-normal ${className}`,
|
|
5522
5031
|
disabled,
|
|
5523
5032
|
children: [
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react11.Clock, { className: "mr-2 h-4 w-4" }),
|
|
5525
5034
|
value || placeholder
|
|
5526
5035
|
]
|
|
5527
5036
|
}
|
|
5528
5037
|
) }),
|
|
5529
|
-
/* @__PURE__ */ (0,
|
|
5530
|
-
/* @__PURE__ */ (0,
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PopoverContent, { className: "w-auto p-4", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5039
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5531
5040
|
Select2,
|
|
5532
5041
|
{
|
|
5533
5042
|
defaultValue: hour,
|
|
@@ -5537,8 +5046,8 @@ var TimePicker = ({
|
|
|
5537
5046
|
className: "w-[80px]"
|
|
5538
5047
|
}
|
|
5539
5048
|
),
|
|
5540
|
-
/* @__PURE__ */ (0,
|
|
5541
|
-
/* @__PURE__ */ (0,
|
|
5049
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-lg", children: ":" }),
|
|
5050
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5542
5051
|
Select2,
|
|
5543
5052
|
{
|
|
5544
5053
|
defaultValue: minute,
|
|
@@ -5553,19 +5062,19 @@ var TimePicker = ({
|
|
|
5553
5062
|
};
|
|
5554
5063
|
|
|
5555
5064
|
// components/form-controls/tooltip.tsx
|
|
5556
|
-
var
|
|
5065
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5557
5066
|
var Tooltip3 = ({ children, tipContent }) => {
|
|
5558
|
-
return /* @__PURE__ */ (0,
|
|
5559
|
-
/* @__PURE__ */ (0,
|
|
5560
|
-
/* @__PURE__ */ (0,
|
|
5067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Tooltip, { delayDuration: 0, children: [
|
|
5068
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TooltipTrigger, { children }),
|
|
5069
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { children: tipContent }) })
|
|
5561
5070
|
] }) });
|
|
5562
5071
|
};
|
|
5563
5072
|
|
|
5564
5073
|
// components/form-controls/upload-widget.tsx
|
|
5565
|
-
var
|
|
5074
|
+
var import_lucide_react12 = require("lucide-react");
|
|
5566
5075
|
var import_react_dropzone = require("react-dropzone");
|
|
5567
5076
|
var import_sonner = require("sonner");
|
|
5568
|
-
var
|
|
5077
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5569
5078
|
function UploadWidget({
|
|
5570
5079
|
accept,
|
|
5571
5080
|
maxSize,
|
|
@@ -5597,18 +5106,18 @@ function UploadWidget({
|
|
|
5597
5106
|
maxFiles
|
|
5598
5107
|
};
|
|
5599
5108
|
const { getRootProps, getInputProps, isDragActive } = (0, import_react_dropzone.useDropzone)(dropzoneOptions);
|
|
5600
|
-
return /* @__PURE__ */ (0,
|
|
5109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5601
5110
|
"div",
|
|
5602
5111
|
{
|
|
5603
5112
|
...getRootProps(),
|
|
5604
5113
|
className: "relative border-2 border-dashed border-gray-300 rounded-lg p-6 text-center cursor-pointer min-h-[160px]",
|
|
5605
5114
|
children: [
|
|
5606
|
-
isUploading && /* @__PURE__ */ (0,
|
|
5607
|
-
/* @__PURE__ */ (0,
|
|
5608
|
-
isDragActive ? /* @__PURE__ */ (0,
|
|
5609
|
-
/* @__PURE__ */ (0,
|
|
5610
|
-
/* @__PURE__ */ (0,
|
|
5611
|
-
/* @__PURE__ */ (0,
|
|
5115
|
+
isUploading && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react12.Loader2, { className: "animate-spin h-6 w-6 text-primary" }) }),
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("input", { ...getInputProps() }),
|
|
5117
|
+
isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { children: "Drop the files here ..." }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { children: [
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react12.Upload, { className: "mx-auto h-12 w-12 text-gray-400" }),
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { children: "Drag n drop some files here, or click to select files" }),
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("p", { className: "text-sm text-gray-500", children: [
|
|
5612
5121
|
"Only ",
|
|
5613
5122
|
acceptedTypes,
|
|
5614
5123
|
" files up to ",
|
|
@@ -5616,11 +5125,11 @@ function UploadWidget({
|
|
|
5616
5125
|
"MB are accepted"
|
|
5617
5126
|
] })
|
|
5618
5127
|
] }),
|
|
5619
|
-
fileUrls.length > 0 && /* @__PURE__ */ (0,
|
|
5128
|
+
fileUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mt-4 border-t border-gray-300 pt-4", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("ul", { className: "flex flex-wrap gap-2", children: fileUrls.map((url, i) => {
|
|
5620
5129
|
const fileName = getFileName(url);
|
|
5621
|
-
return /* @__PURE__ */ (0,
|
|
5622
|
-
/* @__PURE__ */ (0,
|
|
5623
|
-
/* @__PURE__ */ (0,
|
|
5130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("li", { className: "flex items-center space-x-2 text-sm", children: [
|
|
5131
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { children: getFileIcon(fileName) }),
|
|
5132
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: fileName })
|
|
5624
5133
|
] }, i);
|
|
5625
5134
|
}) }) })
|
|
5626
5135
|
]
|
|
@@ -5631,15 +5140,15 @@ function UploadWidget({
|
|
|
5631
5140
|
// components/general/markdown-renderer.tsx
|
|
5632
5141
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
5633
5142
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
5634
|
-
var
|
|
5143
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5635
5144
|
function MarkdownRenderer({ content }) {
|
|
5636
|
-
return /* @__PURE__ */ (0,
|
|
5145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5637
5146
|
import_react_markdown.default,
|
|
5638
5147
|
{
|
|
5639
5148
|
remarkPlugins: [import_remark_gfm.default],
|
|
5640
5149
|
className: "text-primary-900",
|
|
5641
5150
|
components: {
|
|
5642
|
-
a: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5151
|
+
a: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5643
5152
|
"a",
|
|
5644
5153
|
{
|
|
5645
5154
|
target: "_blank",
|
|
@@ -5648,20 +5157,20 @@ function MarkdownRenderer({ content }) {
|
|
|
5648
5157
|
...props
|
|
5649
5158
|
}
|
|
5650
5159
|
),
|
|
5651
|
-
h1: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5652
|
-
h2: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5653
|
-
h3: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5654
|
-
code: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5160
|
+
h1: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("h1", { className: "text-2xl font-bold mt-6 mb-4", ...props }),
|
|
5161
|
+
h2: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("h2", { className: "text-xl font-semibold mt-5 mb-3", ...props }),
|
|
5162
|
+
h3: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("h3", { className: "text-lg font-semibold mt-4 mb-2", ...props }),
|
|
5163
|
+
code: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5655
5164
|
"code",
|
|
5656
5165
|
{
|
|
5657
5166
|
className: "block bg-stone-100 p-3 rounded font-mono",
|
|
5658
5167
|
...props
|
|
5659
5168
|
}
|
|
5660
5169
|
),
|
|
5661
|
-
ul: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5662
|
-
ol: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5663
|
-
p: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5664
|
-
blockquote: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
5170
|
+
ul: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("ul", { className: "list-disc pl-6 my-4", ...props }),
|
|
5171
|
+
ol: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("ol", { className: "list-decimal pl-6 my-4", ...props }),
|
|
5172
|
+
p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "my-4", ...props }),
|
|
5173
|
+
blockquote: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5665
5174
|
"blockquote",
|
|
5666
5175
|
{
|
|
5667
5176
|
className: "border-l-4 border-stone-200 pl-4 my-4 italic",
|
|
@@ -5675,9 +5184,9 @@ function MarkdownRenderer({ content }) {
|
|
|
5675
5184
|
}
|
|
5676
5185
|
|
|
5677
5186
|
// components/general/chat-loading.tsx
|
|
5678
|
-
var
|
|
5187
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5679
5188
|
function ChatLoading() {
|
|
5680
|
-
return /* @__PURE__ */ (0,
|
|
5189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
5681
5190
|
"svg",
|
|
5682
5191
|
{
|
|
5683
5192
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5685,7 +5194,7 @@ function ChatLoading() {
|
|
|
5685
5194
|
width: "60",
|
|
5686
5195
|
height: "15",
|
|
5687
5196
|
children: [
|
|
5688
|
-
/* @__PURE__ */ (0,
|
|
5197
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("circle", { cx: "7.5", cy: "7.5", r: "3.5", fill: "#444444", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5689
5198
|
"animate",
|
|
5690
5199
|
{
|
|
5691
5200
|
attributeName: "cy",
|
|
@@ -5698,7 +5207,7 @@ function ChatLoading() {
|
|
|
5698
5207
|
values: "7.5;3.5;7.5"
|
|
5699
5208
|
}
|
|
5700
5209
|
) }),
|
|
5701
|
-
/* @__PURE__ */ (0,
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("circle", { cx: "30", cy: "7.5", r: "3.5", fill: "#444444", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5702
5211
|
"animate",
|
|
5703
5212
|
{
|
|
5704
5213
|
attributeName: "cy",
|
|
@@ -5711,7 +5220,7 @@ function ChatLoading() {
|
|
|
5711
5220
|
values: "7.5;3.5;7.5"
|
|
5712
5221
|
}
|
|
5713
5222
|
) }),
|
|
5714
|
-
/* @__PURE__ */ (0,
|
|
5223
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("circle", { cx: "52.5", cy: "7.5", r: "3.5", fill: "#444444", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5715
5224
|
"animate",
|
|
5716
5225
|
{
|
|
5717
5226
|
attributeName: "cy",
|
|
@@ -5730,10 +5239,10 @@ function ChatLoading() {
|
|
|
5730
5239
|
}
|
|
5731
5240
|
|
|
5732
5241
|
// components/layout/action-bar.tsx
|
|
5733
|
-
var
|
|
5734
|
-
var
|
|
5735
|
-
var
|
|
5736
|
-
var
|
|
5242
|
+
var import_lucide_react13 = require("lucide-react");
|
|
5243
|
+
var import_navigation3 = require("next/navigation");
|
|
5244
|
+
var import_react11 = __toESM(require("react"));
|
|
5245
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5737
5246
|
var colorStyles = {
|
|
5738
5247
|
red: "bg-red-50 hover:bg-red-100 text-red-600",
|
|
5739
5248
|
blue: "bg-blue-50 hover:bg-blue-100 text-blue-600",
|
|
@@ -5747,50 +5256,50 @@ function EloquentActionBar({
|
|
|
5747
5256
|
buttons,
|
|
5748
5257
|
title
|
|
5749
5258
|
}) {
|
|
5750
|
-
const router = (0,
|
|
5751
|
-
const LucideIcons =
|
|
5752
|
-
return /* @__PURE__ */ (0,
|
|
5753
|
-
showBack && /* @__PURE__ */ (0,
|
|
5754
|
-
/* @__PURE__ */ (0,
|
|
5259
|
+
const router = (0, import_navigation3.useRouter)();
|
|
5260
|
+
const LucideIcons = import_lucide_react13.icons;
|
|
5261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex bg-white border-gray-200 border-b border-x rounded-t-lg items-center", children: [
|
|
5262
|
+
showBack && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
|
|
5263
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
5755
5264
|
"button",
|
|
5756
5265
|
{
|
|
5757
5266
|
onClick: () => router.back(),
|
|
5758
5267
|
className: "flex items-center px-3 py-2 hover:bg-gray-100 transition-colors",
|
|
5759
5268
|
children: [
|
|
5760
|
-
/* @__PURE__ */ (0,
|
|
5761
|
-
/* @__PURE__ */ (0,
|
|
5269
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react13.ArrowLeft, { className: "w-5 h-5 mr-2 text-gray-600" }),
|
|
5270
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-gray-600 font-medium", children: "Back" })
|
|
5762
5271
|
]
|
|
5763
5272
|
}
|
|
5764
5273
|
),
|
|
5765
|
-
/* @__PURE__ */ (0,
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Separator3, { orientation: "vertical", className: "h-full" })
|
|
5766
5275
|
] }),
|
|
5767
|
-
/* @__PURE__ */ (0,
|
|
5276
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "flex items-center", children: buttons.map((button, index) => {
|
|
5768
5277
|
const Icon3 = LucideIcons[button.icon];
|
|
5769
|
-
return /* @__PURE__ */ (0,
|
|
5770
|
-
/* @__PURE__ */ (0,
|
|
5278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_react11.default.Fragment, { children: [
|
|
5279
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
5771
5280
|
"button",
|
|
5772
5281
|
{
|
|
5773
5282
|
onClick: button.action,
|
|
5774
5283
|
disabled: button.isLoading,
|
|
5775
5284
|
className: `flex items-center px-4 py-2 transition-colors ${colorStyles[button.color]} ${button.isLoading ? "opacity-70 cursor-not-allowed" : ""}`,
|
|
5776
5285
|
children: [
|
|
5777
|
-
button.isLoading ? /* @__PURE__ */ (0,
|
|
5778
|
-
/* @__PURE__ */ (0,
|
|
5286
|
+
button.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react13.Loader2, { className: "w-5 h-5 mr-2 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Icon3, { className: "w-5 h-5 mr-2" }),
|
|
5287
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "font-medium", children: button.label })
|
|
5779
5288
|
]
|
|
5780
5289
|
}
|
|
5781
5290
|
),
|
|
5782
|
-
index < buttons.length - 1 && /* @__PURE__ */ (0,
|
|
5291
|
+
index < buttons.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Separator3, { orientation: "vertical", className: "h-full" })
|
|
5783
5292
|
] }, button.label);
|
|
5784
5293
|
}) }),
|
|
5785
|
-
title && /* @__PURE__ */ (0,
|
|
5294
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-lg", children: title })
|
|
5786
5295
|
] });
|
|
5787
5296
|
}
|
|
5788
5297
|
|
|
5789
5298
|
// components/schema-fields/dropdown-field.tsx
|
|
5790
|
-
var
|
|
5299
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5791
5300
|
function ColorDot({ color }) {
|
|
5792
5301
|
if (!color) return null;
|
|
5793
|
-
return /* @__PURE__ */ (0,
|
|
5302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5794
5303
|
"div",
|
|
5795
5304
|
{
|
|
5796
5305
|
className: "w-3 h-3 rounded-full mr-2 inline-block",
|
|
@@ -5807,25 +5316,25 @@ function DropdownField({ schema, value, onChange }) {
|
|
|
5807
5316
|
const renderSelectedValue = () => {
|
|
5808
5317
|
const selectedOption = options?.find((opt) => opt.value === value);
|
|
5809
5318
|
if (!selectedOption) return null;
|
|
5810
|
-
return /* @__PURE__ */ (0,
|
|
5811
|
-
/* @__PURE__ */ (0,
|
|
5319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex items-center", children: [
|
|
5320
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorDot, { color: selectedOption.color }),
|
|
5812
5321
|
selectedOption.label
|
|
5813
5322
|
] });
|
|
5814
5323
|
};
|
|
5815
|
-
return /* @__PURE__ */ (0,
|
|
5324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
5816
5325
|
Select,
|
|
5817
5326
|
{
|
|
5818
5327
|
value: value ?? "",
|
|
5819
5328
|
onValueChange: onChange,
|
|
5820
5329
|
children: [
|
|
5821
|
-
/* @__PURE__ */ (0,
|
|
5822
|
-
/* @__PURE__ */ (0,
|
|
5330
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SelectValue, { children: renderSelectedValue() }) }),
|
|
5331
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SelectContent, { children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
5823
5332
|
SelectItem,
|
|
5824
5333
|
{
|
|
5825
5334
|
value: option.value,
|
|
5826
5335
|
className: "flex items-center",
|
|
5827
5336
|
children: [
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5337
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorDot, { color: option.color }),
|
|
5829
5338
|
option.label
|
|
5830
5339
|
]
|
|
5831
5340
|
},
|
|
@@ -5837,7 +5346,7 @@ function DropdownField({ schema, value, onChange }) {
|
|
|
5837
5346
|
}
|
|
5838
5347
|
|
|
5839
5348
|
// components/schema-fields/string-field.tsx
|
|
5840
|
-
var
|
|
5349
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5841
5350
|
function StringField({
|
|
5842
5351
|
name,
|
|
5843
5352
|
schema,
|
|
@@ -5869,7 +5378,7 @@ function StringField({
|
|
|
5869
5378
|
return "text";
|
|
5870
5379
|
}
|
|
5871
5380
|
};
|
|
5872
|
-
return /* @__PURE__ */ (0,
|
|
5381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5873
5382
|
Input,
|
|
5874
5383
|
{
|
|
5875
5384
|
value: value || "",
|
|
@@ -5888,14 +5397,14 @@ function StringField({
|
|
|
5888
5397
|
}
|
|
5889
5398
|
|
|
5890
5399
|
// components/schema-fields/string-multi-line-field.tsx
|
|
5891
|
-
var
|
|
5400
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5892
5401
|
function StringMultiLineField({
|
|
5893
5402
|
name,
|
|
5894
5403
|
schema,
|
|
5895
5404
|
value,
|
|
5896
5405
|
onChange
|
|
5897
5406
|
}) {
|
|
5898
|
-
return /* @__PURE__ */ (0,
|
|
5407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5899
5408
|
Textarea,
|
|
5900
5409
|
{
|
|
5901
5410
|
value: value || "",
|
|
@@ -5908,11 +5417,11 @@ function StringMultiLineField({
|
|
|
5908
5417
|
}
|
|
5909
5418
|
|
|
5910
5419
|
// components/schema-fields/text-field.tsx
|
|
5911
|
-
var
|
|
5912
|
-
var
|
|
5913
|
-
var
|
|
5420
|
+
var import_react12 = require("@remixicon/react");
|
|
5421
|
+
var import_react13 = require("react");
|
|
5422
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5914
5423
|
function TextField({ schema, value, onChange }) {
|
|
5915
|
-
return /* @__PURE__ */ (0,
|
|
5424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "rounded-lg border bg-background flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5916
5425
|
Input,
|
|
5917
5426
|
{
|
|
5918
5427
|
value,
|
|
@@ -5923,7 +5432,7 @@ function TextField({ schema, value, onChange }) {
|
|
|
5923
5432
|
}
|
|
5924
5433
|
|
|
5925
5434
|
// components/schema-fields/schema-field.tsx
|
|
5926
|
-
var
|
|
5435
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5927
5436
|
function getFieldType(schema) {
|
|
5928
5437
|
if (schema.enum) return "dropdown";
|
|
5929
5438
|
if (schema.format === "richtext") return "text";
|
|
@@ -5945,38 +5454,63 @@ function SchemaField(props) {
|
|
|
5945
5454
|
case "email":
|
|
5946
5455
|
case "phone":
|
|
5947
5456
|
case "url":
|
|
5948
|
-
return /* @__PURE__ */ (0,
|
|
5457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(StringField, { ...props });
|
|
5949
5458
|
case "stringMultiline":
|
|
5950
|
-
return /* @__PURE__ */ (0,
|
|
5459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(StringMultiLineField, { ...props });
|
|
5951
5460
|
case "text":
|
|
5952
|
-
return /* @__PURE__ */ (0,
|
|
5461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextField, { ...props });
|
|
5953
5462
|
case "dropdown":
|
|
5954
|
-
return /* @__PURE__ */ (0,
|
|
5463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DropdownField, { ...props });
|
|
5955
5464
|
default:
|
|
5956
|
-
return /* @__PURE__ */ (0,
|
|
5465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "text-red-500", children: [
|
|
5957
5466
|
"Unsupported field type: ",
|
|
5958
5467
|
fieldType
|
|
5959
5468
|
] });
|
|
5960
5469
|
}
|
|
5961
5470
|
};
|
|
5962
|
-
return /* @__PURE__ */ (0,
|
|
5963
|
-
/* @__PURE__ */ (0,
|
|
5471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: cn("space-y-2", getColspanBySchema(schema)), children: [
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Label, { children: [
|
|
5964
5473
|
label ?? schema.title ?? name,
|
|
5965
|
-
schema.required && /* @__PURE__ */ (0,
|
|
5474
|
+
schema.required && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "text-red-500", children: "*" })
|
|
5966
5475
|
] }),
|
|
5967
5476
|
renderField(),
|
|
5968
|
-
schema.description && /* @__PURE__ */ (0,
|
|
5477
|
+
schema.description && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("p", { className: "text-sm text-gray-500", children: schema.description })
|
|
5969
5478
|
] });
|
|
5970
5479
|
}
|
|
5971
5480
|
|
|
5481
|
+
// ../docs/dist/index.mjs
|
|
5482
|
+
var import_lucide_react14 = require("lucide-react");
|
|
5483
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5484
|
+
var getFileIcon2 = (fileName) => {
|
|
5485
|
+
const extensionMatch = fileName.match(/\.([^.]+)$/);
|
|
5486
|
+
const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;
|
|
5487
|
+
if (!extension) return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react14.File, { className: "w-8 h-8 text-gray-500" });
|
|
5488
|
+
switch (extension) {
|
|
5489
|
+
case "pdf":
|
|
5490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react14.File, { className: "w-8 h-8 text-red-500" });
|
|
5491
|
+
case "doc":
|
|
5492
|
+
case "docx":
|
|
5493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react14.FileText, { className: "w-8 h-8 text-blue-500" });
|
|
5494
|
+
case "xls":
|
|
5495
|
+
case "xlsx":
|
|
5496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react14.FileSpreadsheet, { className: "w-8 h-8 text-green-500" });
|
|
5497
|
+
default:
|
|
5498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react14.File, { className: "w-8 h-8 text-gray-500" });
|
|
5499
|
+
}
|
|
5500
|
+
};
|
|
5501
|
+
var getFileName2 = (url) => {
|
|
5502
|
+
const fileName = decodeURIComponent(url.split("/").pop() ?? "");
|
|
5503
|
+
const cleanFileName = fileName.replace(/%28(\d+)%29/g, "($1)").replace(/[^\w\s().-]/g, "").replace(/\s+/g, "_").replace(/-\d+(?=\.pdf)/g, "");
|
|
5504
|
+
return cleanFileName;
|
|
5505
|
+
};
|
|
5506
|
+
|
|
5972
5507
|
// components/upload/upload-widget-v2.tsx
|
|
5973
|
-
var
|
|
5974
|
-
var
|
|
5975
|
-
var import_react17 = require("react");
|
|
5508
|
+
var import_lucide_react15 = require("lucide-react");
|
|
5509
|
+
var import_react14 = require("react");
|
|
5976
5510
|
var import_react_dropzone2 = require("react-dropzone");
|
|
5977
5511
|
var import_sonner2 = require("sonner");
|
|
5978
5512
|
var import_upload_actions = require("./upload/upload-actions");
|
|
5979
|
-
var
|
|
5513
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5980
5514
|
function UploadWidgetV2({
|
|
5981
5515
|
accept,
|
|
5982
5516
|
maxSize,
|
|
@@ -5986,8 +5520,8 @@ function UploadWidgetV2({
|
|
|
5986
5520
|
uploadDestination = "azure",
|
|
5987
5521
|
hideUploadedFiles = false
|
|
5988
5522
|
}) {
|
|
5989
|
-
const [isUploading, setIsUploading] = (0,
|
|
5990
|
-
const [fileUrls, setFileUrls] = (0,
|
|
5523
|
+
const [isUploading, setIsUploading] = (0, import_react14.useState)(false);
|
|
5524
|
+
const [fileUrls, setFileUrls] = (0, import_react14.useState)([]);
|
|
5991
5525
|
const fileMaxSizeMB = maxSize / 1024 / 1024;
|
|
5992
5526
|
const acceptedTypes = accept ? Object.values(accept).flat().join(", ") : "";
|
|
5993
5527
|
const handleUpload = async (files) => {
|
|
@@ -6034,7 +5568,7 @@ function UploadWidgetV2({
|
|
|
6034
5568
|
maxSize,
|
|
6035
5569
|
maxFiles
|
|
6036
5570
|
});
|
|
6037
|
-
return /* @__PURE__ */ (0,
|
|
5571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
6038
5572
|
"div",
|
|
6039
5573
|
{
|
|
6040
5574
|
...getRootProps(),
|
|
@@ -6043,12 +5577,12 @@ function UploadWidgetV2({
|
|
|
6043
5577
|
className
|
|
6044
5578
|
),
|
|
6045
5579
|
children: [
|
|
6046
|
-
isUploading && /* @__PURE__ */ (0,
|
|
6047
|
-
/* @__PURE__ */ (0,
|
|
6048
|
-
isDragActive ? /* @__PURE__ */ (0,
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6050
|
-
/* @__PURE__ */ (0,
|
|
6051
|
-
/* @__PURE__ */ (0,
|
|
5580
|
+
isUploading && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react15.Loader2, { className: "animate-spin h-6 w-6 text-primary" }) }),
|
|
5581
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("input", { ...getInputProps() }),
|
|
5582
|
+
isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { children: "Drop the files here ..." }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { children: [
|
|
5583
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react15.UploadCloud, { className: "mx-auto h-12 w-12 text-gray-400" }),
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { children: "Drag n drop some files here, or click to select files" }),
|
|
5585
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("p", { className: "text-sm text-gray-500", children: [
|
|
6052
5586
|
"Only ",
|
|
6053
5587
|
acceptedTypes,
|
|
6054
5588
|
" files up to ",
|
|
@@ -6056,102 +5590,17 @@ function UploadWidgetV2({
|
|
|
6056
5590
|
"MB are accepted"
|
|
6057
5591
|
] })
|
|
6058
5592
|
] }),
|
|
6059
|
-
!hideUploadedFiles && fileUrls.length > 0 && /* @__PURE__ */ (0,
|
|
6060
|
-
const fileName = (
|
|
6061
|
-
return /* @__PURE__ */ (0,
|
|
6062
|
-
/* @__PURE__ */ (0,
|
|
6063
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
!hideUploadedFiles && fileUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "mt-4 border-t border-gray-300 pt-4", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("ul", { className: "flex flex-wrap gap-2", children: fileUrls.map((url, i) => {
|
|
5594
|
+
const fileName = getFileName2(url);
|
|
5595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("li", { className: "flex items-center space-x-2 text-sm", children: [
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: getFileIcon2(fileName) }),
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: fileName })
|
|
6064
5598
|
] }, i);
|
|
6065
5599
|
}) }) })
|
|
6066
5600
|
]
|
|
6067
5601
|
}
|
|
6068
5602
|
);
|
|
6069
5603
|
}
|
|
6070
|
-
|
|
6071
|
-
// hooks/use-file-upload.ts
|
|
6072
|
-
var import_nats = require("@elqnt/nats");
|
|
6073
|
-
var import_react18 = require("react");
|
|
6074
|
-
var import_react_hook_form3 = require("react-hook-form");
|
|
6075
|
-
function convertDataUrlToUint8Array(dataURL) {
|
|
6076
|
-
const base64String = dataURL.split(",")[1];
|
|
6077
|
-
const binaryString = atob(base64String);
|
|
6078
|
-
const len = binaryString.length;
|
|
6079
|
-
const bytes = new Uint8Array(len);
|
|
6080
|
-
for (let i = 0; i < len; i++) {
|
|
6081
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
6082
|
-
}
|
|
6083
|
-
return bytes;
|
|
6084
|
-
}
|
|
6085
|
-
var JS_OS_FILE_UPLOAD = "file-upload";
|
|
6086
|
-
var useFileUpload = (formFieldName) => {
|
|
6087
|
-
const files = (0, import_react_hook_form3.useWatch)({ name: formFieldName });
|
|
6088
|
-
const [fileUrls, setFileUrls] = (0, import_react18.useState)([]);
|
|
6089
|
-
const [isUploading, setIsUploading] = (0, import_react18.useState)(false);
|
|
6090
|
-
const { request, ObjectStore } = (0, import_nats.useNatsContext)();
|
|
6091
|
-
(0, import_react18.useEffect)(() => {
|
|
6092
|
-
if (!files || files.length === 0) return;
|
|
6093
|
-
const uploadFiles = async () => {
|
|
6094
|
-
setIsUploading(true);
|
|
6095
|
-
const bucket = JS_OS_FILE_UPLOAD;
|
|
6096
|
-
const filesArray = Array.from(files);
|
|
6097
|
-
for (const file of filesArray) {
|
|
6098
|
-
const reader = new FileReader();
|
|
6099
|
-
reader.readAsDataURL(file);
|
|
6100
|
-
try {
|
|
6101
|
-
await new Promise((resolve, reject) => {
|
|
6102
|
-
reader.onloadend = async () => {
|
|
6103
|
-
const dataURL = reader.result;
|
|
6104
|
-
const uint8Array = convertDataUrlToUint8Array(dataURL);
|
|
6105
|
-
const os = await ObjectStore(bucket);
|
|
6106
|
-
if (os instanceof Error) {
|
|
6107
|
-
console.error(os);
|
|
6108
|
-
reject(os);
|
|
6109
|
-
return;
|
|
6110
|
-
}
|
|
6111
|
-
const extension = file.name.match(/\.[^/.]+$/)?.[0];
|
|
6112
|
-
const name = file.name.replace(/\.[^/.]+$/, "") + "-" + Date.now() + extension;
|
|
6113
|
-
const meta = {
|
|
6114
|
-
"Content-Type": file.type,
|
|
6115
|
-
name
|
|
6116
|
-
};
|
|
6117
|
-
const result = await os.putBlob(meta, uint8Array);
|
|
6118
|
-
if (result instanceof Error) {
|
|
6119
|
-
console.error(result);
|
|
6120
|
-
reject(result);
|
|
6121
|
-
return;
|
|
6122
|
-
}
|
|
6123
|
-
const res = await request("entities.uploadFile", {
|
|
6124
|
-
fileName: name,
|
|
6125
|
-
mimeType: file.type
|
|
6126
|
-
});
|
|
6127
|
-
if (res instanceof Error) {
|
|
6128
|
-
console.error(res);
|
|
6129
|
-
reject(res);
|
|
6130
|
-
return;
|
|
6131
|
-
}
|
|
6132
|
-
const { url } = res;
|
|
6133
|
-
const deleteRes = await os.delete(name);
|
|
6134
|
-
if (deleteRes instanceof Error) {
|
|
6135
|
-
console.error(deleteRes);
|
|
6136
|
-
reject(deleteRes);
|
|
6137
|
-
return;
|
|
6138
|
-
}
|
|
6139
|
-
console.log("file uploaded successfully", url);
|
|
6140
|
-
setFileUrls((prevUrls) => [...prevUrls, url]);
|
|
6141
|
-
resolve();
|
|
6142
|
-
};
|
|
6143
|
-
});
|
|
6144
|
-
} catch (error) {
|
|
6145
|
-
console.error("Error uploading file:", error);
|
|
6146
|
-
continue;
|
|
6147
|
-
}
|
|
6148
|
-
}
|
|
6149
|
-
setIsUploading(false);
|
|
6150
|
-
};
|
|
6151
|
-
uploadFiles();
|
|
6152
|
-
}, [files]);
|
|
6153
|
-
return { fileUrls, isUploading };
|
|
6154
|
-
};
|
|
6155
5604
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6156
5605
|
0 && (module.exports = {
|
|
6157
5606
|
ActionBar,
|
|
@@ -6176,7 +5625,6 @@ var useFileUpload = (formFieldName) => {
|
|
|
6176
5625
|
DurationInput,
|
|
6177
5626
|
EloquentActionBar,
|
|
6178
5627
|
FilterCombobox,
|
|
6179
|
-
FilterDialog,
|
|
6180
5628
|
Form,
|
|
6181
5629
|
FormCombobox,
|
|
6182
5630
|
FormControl,
|
|
@@ -6191,12 +5639,9 @@ var useFileUpload = (formFieldName) => {
|
|
|
6191
5639
|
Icon,
|
|
6192
5640
|
IconButton,
|
|
6193
5641
|
Input,
|
|
6194
|
-
KnowledgeGraphWordCloud,
|
|
6195
|
-
LeftNav,
|
|
6196
5642
|
MarkdownRenderer,
|
|
6197
5643
|
MultiSelect,
|
|
6198
5644
|
MultiStepProcess,
|
|
6199
|
-
OrgSelector,
|
|
6200
5645
|
PageHeader,
|
|
6201
5646
|
Popover,
|
|
6202
5647
|
ProfileMenu,
|
|
@@ -6222,7 +5667,6 @@ var useFileUpload = (formFieldName) => {
|
|
|
6222
5667
|
getFieldType,
|
|
6223
5668
|
getFileIcon,
|
|
6224
5669
|
getFileName,
|
|
6225
|
-
useFileUpload,
|
|
6226
5670
|
useFormField
|
|
6227
5671
|
});
|
|
6228
5672
|
//# sourceMappingURL=index.js.map
|