@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.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
// components/form-controls/button.tsx
|
|
4
|
+
import * as React2 from "react";
|
|
5
|
+
|
|
3
6
|
// components/ui/button.tsx
|
|
4
7
|
import * as React from "react";
|
|
5
8
|
import { Slot } from "@radix-ui/react-slot";
|
|
@@ -57,524 +60,12 @@ var Button = React.forwardRef(
|
|
|
57
60
|
);
|
|
58
61
|
Button.displayName = "Button";
|
|
59
62
|
|
|
60
|
-
// components/ui/dialog.tsx
|
|
61
|
-
import * as React2 from "react";
|
|
62
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
63
|
-
import { Cross2Icon } from "@radix-ui/react-icons";
|
|
64
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
65
|
-
var Dialog = DialogPrimitive.Root;
|
|
66
|
-
var DialogTrigger = DialogPrimitive.Trigger;
|
|
67
|
-
var DialogPortal = DialogPrimitive.Portal;
|
|
68
|
-
var DialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
69
|
-
DialogPrimitive.Overlay,
|
|
70
|
-
{
|
|
71
|
-
ref,
|
|
72
|
-
className: cn(
|
|
73
|
-
"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",
|
|
74
|
-
className
|
|
75
|
-
),
|
|
76
|
-
...props
|
|
77
|
-
}
|
|
78
|
-
));
|
|
79
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
80
|
-
var DialogContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
81
|
-
/* @__PURE__ */ jsx2(DialogOverlay, {}),
|
|
82
|
-
/* @__PURE__ */ jsxs(
|
|
83
|
-
DialogPrimitive.Content,
|
|
84
|
-
{
|
|
85
|
-
ref,
|
|
86
|
-
className: cn(
|
|
87
|
-
"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",
|
|
88
|
-
className
|
|
89
|
-
),
|
|
90
|
-
...props,
|
|
91
|
-
children: [
|
|
92
|
-
children,
|
|
93
|
-
/* @__PURE__ */ 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: [
|
|
94
|
-
/* @__PURE__ */ jsx2(Cross2Icon, { className: "h-4 w-4" }),
|
|
95
|
-
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Close" })
|
|
96
|
-
] })
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
] }));
|
|
101
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
102
|
-
var DialogHeader = ({
|
|
103
|
-
className,
|
|
104
|
-
...props
|
|
105
|
-
}) => /* @__PURE__ */ jsx2(
|
|
106
|
-
"div",
|
|
107
|
-
{
|
|
108
|
-
className: cn(
|
|
109
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
110
|
-
className
|
|
111
|
-
),
|
|
112
|
-
...props
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
DialogHeader.displayName = "DialogHeader";
|
|
116
|
-
var DialogFooter = ({
|
|
117
|
-
className,
|
|
118
|
-
...props
|
|
119
|
-
}) => /* @__PURE__ */ jsx2(
|
|
120
|
-
"div",
|
|
121
|
-
{
|
|
122
|
-
className: cn(
|
|
123
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
124
|
-
className
|
|
125
|
-
),
|
|
126
|
-
...props
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
DialogFooter.displayName = "DialogFooter";
|
|
130
|
-
var DialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
131
|
-
DialogPrimitive.Title,
|
|
132
|
-
{
|
|
133
|
-
ref,
|
|
134
|
-
className: cn(
|
|
135
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
136
|
-
className
|
|
137
|
-
),
|
|
138
|
-
...props
|
|
139
|
-
}
|
|
140
|
-
));
|
|
141
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
142
|
-
var DialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
143
|
-
DialogPrimitive.Description,
|
|
144
|
-
{
|
|
145
|
-
ref,
|
|
146
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
147
|
-
...props
|
|
148
|
-
}
|
|
149
|
-
));
|
|
150
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
151
|
-
|
|
152
|
-
// components/ui/input.tsx
|
|
153
|
-
import * as React3 from "react";
|
|
154
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
155
|
-
var Input = React3.forwardRef(
|
|
156
|
-
({ className, type, ...props }, ref) => {
|
|
157
|
-
return /* @__PURE__ */ jsx3(
|
|
158
|
-
"input",
|
|
159
|
-
{
|
|
160
|
-
type,
|
|
161
|
-
className: cn(
|
|
162
|
-
"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",
|
|
163
|
-
className
|
|
164
|
-
),
|
|
165
|
-
ref,
|
|
166
|
-
...props
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
Input.displayName = "Input";
|
|
172
|
-
|
|
173
|
-
// components/ui/select.tsx
|
|
174
|
-
import * as React4 from "react";
|
|
175
|
-
import {
|
|
176
|
-
CaretSortIcon,
|
|
177
|
-
CheckIcon,
|
|
178
|
-
ChevronDownIcon,
|
|
179
|
-
ChevronUpIcon
|
|
180
|
-
} from "@radix-ui/react-icons";
|
|
181
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
182
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
183
|
-
var Select = SelectPrimitive.Root;
|
|
184
|
-
var SelectValue = SelectPrimitive.Value;
|
|
185
|
-
var SelectTrigger = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
186
|
-
SelectPrimitive.Trigger,
|
|
187
|
-
{
|
|
188
|
-
ref,
|
|
189
|
-
className: cn(
|
|
190
|
-
"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",
|
|
191
|
-
className
|
|
192
|
-
),
|
|
193
|
-
...props,
|
|
194
|
-
children: [
|
|
195
|
-
children,
|
|
196
|
-
/* @__PURE__ */ jsx4(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx4(CaretSortIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
));
|
|
200
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
201
|
-
var SelectScrollUpButton = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
202
|
-
SelectPrimitive.ScrollUpButton,
|
|
203
|
-
{
|
|
204
|
-
ref,
|
|
205
|
-
className: cn(
|
|
206
|
-
"flex cursor-default items-center justify-center py-1",
|
|
207
|
-
className
|
|
208
|
-
),
|
|
209
|
-
...props,
|
|
210
|
-
children: /* @__PURE__ */ jsx4(ChevronUpIcon, {})
|
|
211
|
-
}
|
|
212
|
-
));
|
|
213
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
214
|
-
var SelectScrollDownButton = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
215
|
-
SelectPrimitive.ScrollDownButton,
|
|
216
|
-
{
|
|
217
|
-
ref,
|
|
218
|
-
className: cn(
|
|
219
|
-
"flex cursor-default items-center justify-center py-1",
|
|
220
|
-
className
|
|
221
|
-
),
|
|
222
|
-
...props,
|
|
223
|
-
children: /* @__PURE__ */ jsx4(ChevronDownIcon, {})
|
|
224
|
-
}
|
|
225
|
-
));
|
|
226
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
227
|
-
var SelectContent = React4.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx4(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
|
|
228
|
-
SelectPrimitive.Content,
|
|
229
|
-
{
|
|
230
|
-
ref,
|
|
231
|
-
className: cn(
|
|
232
|
-
"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",
|
|
233
|
-
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",
|
|
234
|
-
className
|
|
235
|
-
),
|
|
236
|
-
position,
|
|
237
|
-
...props,
|
|
238
|
-
children: [
|
|
239
|
-
/* @__PURE__ */ jsx4(SelectScrollUpButton, {}),
|
|
240
|
-
/* @__PURE__ */ jsx4(
|
|
241
|
-
SelectPrimitive.Viewport,
|
|
242
|
-
{
|
|
243
|
-
className: cn(
|
|
244
|
-
"p-1",
|
|
245
|
-
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
246
|
-
),
|
|
247
|
-
children
|
|
248
|
-
}
|
|
249
|
-
),
|
|
250
|
-
/* @__PURE__ */ jsx4(SelectScrollDownButton, {})
|
|
251
|
-
]
|
|
252
|
-
}
|
|
253
|
-
) }));
|
|
254
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
255
|
-
var SelectLabel = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
256
|
-
SelectPrimitive.Label,
|
|
257
|
-
{
|
|
258
|
-
ref,
|
|
259
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
260
|
-
...props
|
|
261
|
-
}
|
|
262
|
-
));
|
|
263
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
264
|
-
var SelectItem = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
|
|
265
|
-
SelectPrimitive.Item,
|
|
266
|
-
{
|
|
267
|
-
ref,
|
|
268
|
-
className: cn(
|
|
269
|
-
"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",
|
|
270
|
-
className
|
|
271
|
-
),
|
|
272
|
-
...props,
|
|
273
|
-
children: [
|
|
274
|
-
/* @__PURE__ */ jsx4("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx4(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx4(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
275
|
-
/* @__PURE__ */ jsx4(SelectPrimitive.ItemText, { children })
|
|
276
|
-
]
|
|
277
|
-
}
|
|
278
|
-
));
|
|
279
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
280
|
-
var SelectSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
281
|
-
SelectPrimitive.Separator,
|
|
282
|
-
{
|
|
283
|
-
ref,
|
|
284
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
285
|
-
...props
|
|
286
|
-
}
|
|
287
|
-
));
|
|
288
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
289
|
-
|
|
290
|
-
// components/entities/filter-dialog.tsx
|
|
291
|
-
import {
|
|
292
|
-
useEntityDefinitionContext,
|
|
293
|
-
useEntityRecordContext
|
|
294
|
-
} from "@elqnt/entity";
|
|
295
|
-
|
|
296
|
-
// components/ui/badge.tsx
|
|
297
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
298
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
299
|
-
var badgeVariants = cva2(
|
|
300
|
-
"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",
|
|
301
|
-
{
|
|
302
|
-
variants: {
|
|
303
|
-
variant: {
|
|
304
|
-
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
305
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
306
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
307
|
-
outline: "text-foreground"
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
defaultVariants: {
|
|
311
|
-
variant: "default"
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
);
|
|
315
|
-
function Badge({ className, variant, ...props }) {
|
|
316
|
-
return /* @__PURE__ */ jsx5("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// components/entities/filter-dialog.tsx
|
|
320
|
-
import { Filter, Paintbrush, Plus, X, XCircle } from "lucide-react";
|
|
321
|
-
import { useEffect, useState } from "react";
|
|
322
|
-
import { Fragment, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
323
|
-
var OPERATORS = {
|
|
324
|
-
string: ["eq", "ne", "contains", "startsWith", "endsWith"],
|
|
325
|
-
text: ["contains", "startsWith", "endsWith"],
|
|
326
|
-
int: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
327
|
-
float: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
328
|
-
date: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
329
|
-
datetime: ["eq", "ne", "gt", "gte", "lt", "lte", "between"],
|
|
330
|
-
dropdown: ["eq", "ne", "in", "nin"],
|
|
331
|
-
multiselect: ["in", "nin", "contains"],
|
|
332
|
-
boolean: ["eq", "ne"]
|
|
333
|
-
};
|
|
334
|
-
var OPERATOR_LABELS = {
|
|
335
|
-
eq: "Equals",
|
|
336
|
-
ne: "Not equals",
|
|
337
|
-
gt: "Greater than",
|
|
338
|
-
gte: "Greater than or equal",
|
|
339
|
-
lt: "Less than",
|
|
340
|
-
lte: "Less than or equal",
|
|
341
|
-
in: "In",
|
|
342
|
-
nin: "Not in",
|
|
343
|
-
contains: "Contains",
|
|
344
|
-
startsWith: "Starts with",
|
|
345
|
-
endsWith: "Ends with",
|
|
346
|
-
between: "Between"
|
|
347
|
-
};
|
|
348
|
-
var DEFAULT_CONDITION = {
|
|
349
|
-
field: "",
|
|
350
|
-
operator: "",
|
|
351
|
-
value: ""
|
|
352
|
-
};
|
|
353
|
-
function FilterDialog({ open, onOpenChange }) {
|
|
354
|
-
const { selectedDefinition } = useEntityDefinitionContext();
|
|
355
|
-
const { updateParams, params } = useEntityRecordContext();
|
|
356
|
-
const [conditions, setConditions] = useState([
|
|
357
|
-
DEFAULT_CONDITION
|
|
358
|
-
]);
|
|
359
|
-
const [hasActiveFilters, setHasActiveFilters] = useState(false);
|
|
360
|
-
useEffect(() => {
|
|
361
|
-
const hasFilters = params.filters && Object.keys(params.filters).length > 0;
|
|
362
|
-
setHasActiveFilters(hasFilters);
|
|
363
|
-
}, [params.filters]);
|
|
364
|
-
const fields = [];
|
|
365
|
-
const getOperatorsForField = (fieldType) => {
|
|
366
|
-
return OPERATORS[fieldType] || OPERATORS.string;
|
|
367
|
-
};
|
|
368
|
-
const handleAddCondition = () => {
|
|
369
|
-
setConditions([...conditions, { ...DEFAULT_CONDITION }]);
|
|
370
|
-
};
|
|
371
|
-
const handleRemoveCondition = (index) => {
|
|
372
|
-
setConditions(conditions.filter((_, i) => i !== index));
|
|
373
|
-
};
|
|
374
|
-
const handleFieldChange = (index, fieldName) => {
|
|
375
|
-
const newConditions = [...conditions];
|
|
376
|
-
newConditions[index] = {
|
|
377
|
-
...newConditions[index],
|
|
378
|
-
field: fieldName,
|
|
379
|
-
operator: "",
|
|
380
|
-
value: ""
|
|
381
|
-
};
|
|
382
|
-
setConditions(newConditions);
|
|
383
|
-
};
|
|
384
|
-
const handleOperatorChange = (index, operator) => {
|
|
385
|
-
const newConditions = [...conditions];
|
|
386
|
-
newConditions[index] = {
|
|
387
|
-
...newConditions[index],
|
|
388
|
-
operator
|
|
389
|
-
};
|
|
390
|
-
setConditions(newConditions);
|
|
391
|
-
};
|
|
392
|
-
const handleValueChange = (index, value) => {
|
|
393
|
-
const newConditions = [...conditions];
|
|
394
|
-
newConditions[index] = {
|
|
395
|
-
...newConditions[index],
|
|
396
|
-
value
|
|
397
|
-
};
|
|
398
|
-
setConditions(newConditions);
|
|
399
|
-
};
|
|
400
|
-
const handleClearFilters = () => {
|
|
401
|
-
setConditions([{ ...DEFAULT_CONDITION }]);
|
|
402
|
-
updateParams({ filters: {} });
|
|
403
|
-
setHasActiveFilters(false);
|
|
404
|
-
};
|
|
405
|
-
const handleApplyFilters = () => {
|
|
406
|
-
const validConditions = conditions.filter(
|
|
407
|
-
(c) => c.field && c.operator && c.value
|
|
408
|
-
);
|
|
409
|
-
if (validConditions.length === 0) {
|
|
410
|
-
updateParams({ filters: {} });
|
|
411
|
-
setHasActiveFilters(false);
|
|
412
|
-
onOpenChange(false);
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
const filters = {};
|
|
416
|
-
validConditions.forEach(({ field, operator, value }) => {
|
|
417
|
-
const fieldPath = `fields.${field}.valueString`;
|
|
418
|
-
switch (operator) {
|
|
419
|
-
case "contains":
|
|
420
|
-
filters[fieldPath] = { $regex: value, $options: "i" };
|
|
421
|
-
break;
|
|
422
|
-
case "startsWith":
|
|
423
|
-
filters[fieldPath] = { $regex: `^${value}`, $options: "i" };
|
|
424
|
-
break;
|
|
425
|
-
case "endsWith":
|
|
426
|
-
filters[fieldPath] = { $regex: `${value}$`, $options: "i" };
|
|
427
|
-
break;
|
|
428
|
-
default:
|
|
429
|
-
filters[fieldPath] = { [`$${operator}`]: value };
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
const query = {
|
|
433
|
-
filters: validConditions.length > 1 ? { $and: Object.entries(filters).map(([k, v]) => ({ [k]: v })) } : filters
|
|
434
|
-
};
|
|
435
|
-
updateParams(query);
|
|
436
|
-
setHasActiveFilters(true);
|
|
437
|
-
onOpenChange(false);
|
|
438
|
-
};
|
|
439
|
-
const getFieldByName = (fieldName) => {
|
|
440
|
-
return fields.find((f) => f.name === fieldName);
|
|
441
|
-
};
|
|
442
|
-
const activeFilterCount = conditions.filter(
|
|
443
|
-
(c) => c.field && c.operator && c.value
|
|
444
|
-
).length;
|
|
445
|
-
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
446
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center", children: [
|
|
447
|
-
/* @__PURE__ */ jsxs3(
|
|
448
|
-
Button,
|
|
449
|
-
{
|
|
450
|
-
onClick: () => onOpenChange(true),
|
|
451
|
-
variant: hasActiveFilters ? "secondary" : "outline",
|
|
452
|
-
className: cn("relative group", hasActiveFilters && "rounded-r-none"),
|
|
453
|
-
children: [
|
|
454
|
-
/* @__PURE__ */ jsx6(Filter, { className: "w-4 h-4 mr-2" }),
|
|
455
|
-
"Filter",
|
|
456
|
-
activeFilterCount > 0 && /* @__PURE__ */ jsx6(
|
|
457
|
-
Badge,
|
|
458
|
-
{
|
|
459
|
-
variant: "secondary",
|
|
460
|
-
className: "ml-2 bg-primary text-primary-foreground",
|
|
461
|
-
children: activeFilterCount
|
|
462
|
-
}
|
|
463
|
-
)
|
|
464
|
-
]
|
|
465
|
-
}
|
|
466
|
-
),
|
|
467
|
-
hasActiveFilters && /* @__PURE__ */ jsx6(
|
|
468
|
-
Button,
|
|
469
|
-
{
|
|
470
|
-
variant: "secondary",
|
|
471
|
-
size: "icon",
|
|
472
|
-
onClick: handleClearFilters,
|
|
473
|
-
className: "text-muted-foreground -ml-2 rounded-l-none",
|
|
474
|
-
title: "Clear filters",
|
|
475
|
-
children: /* @__PURE__ */ jsx6(Paintbrush, { className: "h-4 w-4" })
|
|
476
|
-
}
|
|
477
|
-
)
|
|
478
|
-
] }),
|
|
479
|
-
/* @__PURE__ */ jsx6(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs3(DialogContent, { className: "max-w-3xl", children: [
|
|
480
|
-
/* @__PURE__ */ jsx6(DialogHeader, { children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
|
|
481
|
-
/* @__PURE__ */ jsxs3(DialogTitle, { children: [
|
|
482
|
-
"Filter ",
|
|
483
|
-
selectedDefinition?.displayName
|
|
484
|
-
] }),
|
|
485
|
-
hasActiveFilters && /* @__PURE__ */ jsxs3(
|
|
486
|
-
Button,
|
|
487
|
-
{
|
|
488
|
-
variant: "ghost",
|
|
489
|
-
size: "sm",
|
|
490
|
-
onClick: handleClearFilters,
|
|
491
|
-
className: "text-muted-foreground hover:text-primary",
|
|
492
|
-
children: [
|
|
493
|
-
/* @__PURE__ */ jsx6(XCircle, { className: "w-4 h-4 mr-2" }),
|
|
494
|
-
"Clear Filters"
|
|
495
|
-
]
|
|
496
|
-
}
|
|
497
|
-
)
|
|
498
|
-
] }) }),
|
|
499
|
-
/* @__PURE__ */ jsxs3("div", { className: "space-y-4", children: [
|
|
500
|
-
conditions.map((condition, index) => {
|
|
501
|
-
const selectedField = getFieldByName(condition.field);
|
|
502
|
-
const operators = selectedField ? getOperatorsForField(selectedField.type) : [];
|
|
503
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
504
|
-
/* @__PURE__ */ jsxs3(
|
|
505
|
-
Select,
|
|
506
|
-
{
|
|
507
|
-
value: condition.field,
|
|
508
|
-
onValueChange: (value) => handleFieldChange(index, value),
|
|
509
|
-
children: [
|
|
510
|
-
/* @__PURE__ */ jsx6(SelectTrigger, { className: "w-[200px]", children: /* @__PURE__ */ jsx6(SelectValue, { placeholder: "Select field" }) }),
|
|
511
|
-
/* @__PURE__ */ jsx6(SelectContent, { children: fields.map((field) => /* @__PURE__ */ jsx6(SelectItem, { value: field.name, children: field.displayName }, field.name)) })
|
|
512
|
-
]
|
|
513
|
-
}
|
|
514
|
-
),
|
|
515
|
-
/* @__PURE__ */ jsxs3(
|
|
516
|
-
Select,
|
|
517
|
-
{
|
|
518
|
-
value: condition.operator,
|
|
519
|
-
onValueChange: (value) => handleOperatorChange(index, value),
|
|
520
|
-
disabled: !condition.field,
|
|
521
|
-
children: [
|
|
522
|
-
/* @__PURE__ */ jsx6(SelectTrigger, { className: "w-[200px]", children: /* @__PURE__ */ jsx6(SelectValue, { placeholder: "Select operator" }) }),
|
|
523
|
-
/* @__PURE__ */ jsx6(SelectContent, { children: operators.map((op) => /* @__PURE__ */ jsx6(SelectItem, { value: op, children: OPERATOR_LABELS[op] }, op)) })
|
|
524
|
-
]
|
|
525
|
-
}
|
|
526
|
-
),
|
|
527
|
-
/* @__PURE__ */ jsx6(
|
|
528
|
-
Input,
|
|
529
|
-
{
|
|
530
|
-
placeholder: "Value",
|
|
531
|
-
value: condition.value,
|
|
532
|
-
onChange: (e) => handleValueChange(index, e.target.value),
|
|
533
|
-
disabled: !condition.operator,
|
|
534
|
-
className: "flex-1"
|
|
535
|
-
}
|
|
536
|
-
),
|
|
537
|
-
conditions.length > 1 && /* @__PURE__ */ jsx6(
|
|
538
|
-
Button,
|
|
539
|
-
{
|
|
540
|
-
variant: "ghost",
|
|
541
|
-
size: "icon",
|
|
542
|
-
onClick: () => handleRemoveCondition(index),
|
|
543
|
-
className: "text-muted-foreground hover:text-destructive",
|
|
544
|
-
children: /* @__PURE__ */ jsx6(X, { className: "h-4 w-4" })
|
|
545
|
-
}
|
|
546
|
-
)
|
|
547
|
-
] }, index);
|
|
548
|
-
}),
|
|
549
|
-
/* @__PURE__ */ jsxs3(
|
|
550
|
-
Button,
|
|
551
|
-
{
|
|
552
|
-
variant: "outline",
|
|
553
|
-
size: "sm",
|
|
554
|
-
className: "w-full",
|
|
555
|
-
onClick: handleAddCondition,
|
|
556
|
-
children: [
|
|
557
|
-
/* @__PURE__ */ jsx6(Plus, { className: "h-4 w-4 mr-2" }),
|
|
558
|
-
"Add Condition"
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
)
|
|
562
|
-
] }),
|
|
563
|
-
/* @__PURE__ */ jsxs3(DialogFooter, { children: [
|
|
564
|
-
/* @__PURE__ */ jsx6(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
565
|
-
/* @__PURE__ */ jsx6(Button, { onClick: handleApplyFilters, children: "Apply Filters" })
|
|
566
|
-
] })
|
|
567
|
-
] }) })
|
|
568
|
-
] });
|
|
569
|
-
}
|
|
570
|
-
|
|
571
63
|
// components/form-controls/button.tsx
|
|
572
|
-
import
|
|
573
|
-
|
|
574
|
-
var Button2 = React5.forwardRef(
|
|
64
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
65
|
+
var Button2 = React2.forwardRef(
|
|
575
66
|
({ children, variant = "default", className = "", type, ...props }, ref) => {
|
|
576
67
|
const buttonClass = `${variant === "secondary" ? "button-secondary" : ""} ${className}`;
|
|
577
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ jsx2(
|
|
578
69
|
Button,
|
|
579
70
|
{
|
|
580
71
|
className: buttonClass,
|
|
@@ -590,22 +81,22 @@ var Button2 = React5.forwardRef(
|
|
|
590
81
|
Button2.displayName = "Button";
|
|
591
82
|
|
|
592
83
|
// components/form-controls/action-bar/back-button.tsx
|
|
593
|
-
import { jsx as
|
|
84
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
594
85
|
function BackButton() {
|
|
595
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ jsx3(Button2, { onClick: () => {
|
|
596
87
|
}, children: "Back" });
|
|
597
88
|
}
|
|
598
89
|
|
|
599
90
|
// components/form-controls/icon.tsx
|
|
600
91
|
import { icons } from "lucide-react";
|
|
601
92
|
import { memo } from "react";
|
|
602
|
-
import { jsx as
|
|
603
|
-
var
|
|
93
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
94
|
+
var Icon = memo(({ name, className, strokeWidth, size }) => {
|
|
604
95
|
const IconComponent = icons[name];
|
|
605
96
|
if (!IconComponent) {
|
|
606
97
|
return null;
|
|
607
98
|
}
|
|
608
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ jsx4(
|
|
609
100
|
IconComponent,
|
|
610
101
|
{
|
|
611
102
|
className: cn(className),
|
|
@@ -614,37 +105,37 @@ var Icon2 = memo(({ name, className, strokeWidth, size }) => {
|
|
|
614
105
|
}
|
|
615
106
|
);
|
|
616
107
|
});
|
|
617
|
-
|
|
108
|
+
Icon.displayName = "Icon";
|
|
618
109
|
|
|
619
110
|
// components/form-controls/action-bar/action-bar-button.tsx
|
|
620
|
-
import { jsx as
|
|
111
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
621
112
|
function ActionBarButton({
|
|
622
113
|
label,
|
|
623
114
|
onClick,
|
|
624
115
|
icon
|
|
625
116
|
}) {
|
|
626
|
-
return /* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ jsxs(Button2, { onClick, className: "flex items-center gap-2", children: [
|
|
118
|
+
/* @__PURE__ */ jsx5(Icon, { name: icon, size: 20, strokeWidth: 1 }),
|
|
628
119
|
label
|
|
629
120
|
] });
|
|
630
121
|
}
|
|
631
122
|
|
|
632
123
|
// components/form-controls/action-bar/action-bar.tsx
|
|
633
|
-
import { jsx as
|
|
124
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
634
125
|
var ActionBar = ({ actions }) => {
|
|
635
126
|
function backHandler() {
|
|
636
127
|
window.history.back();
|
|
637
128
|
}
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
actions.map((item) => /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsxs2("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: [
|
|
130
|
+
/* @__PURE__ */ jsx6("div", { className: "cursor-pointer pl-4 py-2", onClick: backHandler, children: /* @__PURE__ */ jsx6(Icon, { name: "ArrowBigLeft" }) }),
|
|
131
|
+
actions.map((item) => /* @__PURE__ */ jsxs2(
|
|
641
132
|
"div",
|
|
642
133
|
{
|
|
643
134
|
className: "flex items-center justify-center gap-2 cursor-pointer py-2 px-4",
|
|
644
135
|
onClick: item.onClick,
|
|
645
136
|
children: [
|
|
646
|
-
/* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ jsx6(Icon, { name: item.icon }),
|
|
138
|
+
/* @__PURE__ */ jsx6("p", { children: item.label })
|
|
648
139
|
]
|
|
649
140
|
},
|
|
650
141
|
item.label
|
|
@@ -653,10 +144,10 @@ var ActionBar = ({ actions }) => {
|
|
|
653
144
|
};
|
|
654
145
|
|
|
655
146
|
// components/ui/alert.tsx
|
|
656
|
-
import * as
|
|
657
|
-
import { cva as
|
|
658
|
-
import { jsx as
|
|
659
|
-
var alertVariants =
|
|
147
|
+
import * as React3 from "react";
|
|
148
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
149
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
150
|
+
var alertVariants = cva2(
|
|
660
151
|
"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",
|
|
661
152
|
{
|
|
662
153
|
variants: {
|
|
@@ -670,7 +161,7 @@ var alertVariants = cva3(
|
|
|
670
161
|
}
|
|
671
162
|
}
|
|
672
163
|
);
|
|
673
|
-
var Alert =
|
|
164
|
+
var Alert = React3.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
674
165
|
"div",
|
|
675
166
|
{
|
|
676
167
|
ref,
|
|
@@ -680,7 +171,7 @@ var Alert = React6.forwardRef(({ className, variant, ...props }, ref) => /* @__P
|
|
|
680
171
|
}
|
|
681
172
|
));
|
|
682
173
|
Alert.displayName = "Alert";
|
|
683
|
-
var AlertTitle =
|
|
174
|
+
var AlertTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
684
175
|
"h5",
|
|
685
176
|
{
|
|
686
177
|
ref,
|
|
@@ -689,7 +180,7 @@ var AlertTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
689
180
|
}
|
|
690
181
|
));
|
|
691
182
|
AlertTitle.displayName = "AlertTitle";
|
|
692
|
-
var AlertDescription =
|
|
183
|
+
var AlertDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
693
184
|
"div",
|
|
694
185
|
{
|
|
695
186
|
ref,
|
|
@@ -701,20 +192,20 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
701
192
|
|
|
702
193
|
// components/form-controls/alert.tsx
|
|
703
194
|
import { RocketIcon } from "@radix-ui/react-icons";
|
|
704
|
-
import { jsx as
|
|
195
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
705
196
|
var Alert2 = ({ title, description }) => {
|
|
706
|
-
return /* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
-
/* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ jsxs3(Alert, { children: [
|
|
198
|
+
/* @__PURE__ */ jsx8(RocketIcon, { className: "h-4 w-4" }),
|
|
199
|
+
/* @__PURE__ */ jsx8(AlertTitle, { children: title }),
|
|
200
|
+
/* @__PURE__ */ jsx8(AlertDescription, { children: description })
|
|
710
201
|
] });
|
|
711
202
|
};
|
|
712
203
|
|
|
713
204
|
// components/ui/avatar.tsx
|
|
714
|
-
import * as
|
|
205
|
+
import * as React4 from "react";
|
|
715
206
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
716
|
-
import { jsx as
|
|
717
|
-
var Avatar =
|
|
207
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
208
|
+
var Avatar = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
718
209
|
AvatarPrimitive.Root,
|
|
719
210
|
{
|
|
720
211
|
ref,
|
|
@@ -726,7 +217,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
726
217
|
}
|
|
727
218
|
));
|
|
728
219
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
729
|
-
var AvatarImage =
|
|
220
|
+
var AvatarImage = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
730
221
|
AvatarPrimitive.Image,
|
|
731
222
|
{
|
|
732
223
|
ref,
|
|
@@ -735,7 +226,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
735
226
|
}
|
|
736
227
|
));
|
|
737
228
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
738
|
-
var AvatarFallback =
|
|
229
|
+
var AvatarFallback = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
739
230
|
AvatarPrimitive.Fallback,
|
|
740
231
|
{
|
|
741
232
|
ref,
|
|
@@ -749,25 +240,25 @@ var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
749
240
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
750
241
|
|
|
751
242
|
// components/form-controls/avatar.tsx
|
|
752
|
-
import { jsx as
|
|
243
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
753
244
|
var Avatar2 = ({ image, fallback }) => {
|
|
754
|
-
return /* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
/* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ jsxs4(Avatar, { className: "w-fit", children: [
|
|
246
|
+
/* @__PURE__ */ jsx10(AvatarImage, { src: image }),
|
|
247
|
+
/* @__PURE__ */ jsx10(AvatarFallback, { children: fallback })
|
|
757
248
|
] });
|
|
758
249
|
};
|
|
759
250
|
|
|
760
251
|
// components/form-controls/breadcrumb.tsx
|
|
761
|
-
import { Fragment
|
|
252
|
+
import { Fragment } from "react";
|
|
762
253
|
|
|
763
254
|
// components/ui/breadcrumb.tsx
|
|
764
|
-
import * as
|
|
255
|
+
import * as React5 from "react";
|
|
765
256
|
import { ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui/react-icons";
|
|
766
257
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
767
|
-
import { jsx as
|
|
768
|
-
var Breadcrumb =
|
|
258
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
259
|
+
var Breadcrumb = React5.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx11("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
769
260
|
Breadcrumb.displayName = "Breadcrumb";
|
|
770
|
-
var BreadcrumbList =
|
|
261
|
+
var BreadcrumbList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
771
262
|
"ol",
|
|
772
263
|
{
|
|
773
264
|
ref,
|
|
@@ -779,7 +270,7 @@ var BreadcrumbList = React8.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
779
270
|
}
|
|
780
271
|
));
|
|
781
272
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
782
|
-
var BreadcrumbItem =
|
|
273
|
+
var BreadcrumbItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
783
274
|
"li",
|
|
784
275
|
{
|
|
785
276
|
ref,
|
|
@@ -788,9 +279,9 @@ var BreadcrumbItem = React8.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
788
279
|
}
|
|
789
280
|
));
|
|
790
281
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
791
|
-
var BreadcrumbLink =
|
|
282
|
+
var BreadcrumbLink = React5.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
792
283
|
const Comp = asChild ? Slot2 : "a";
|
|
793
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ jsx11(
|
|
794
285
|
Comp,
|
|
795
286
|
{
|
|
796
287
|
ref,
|
|
@@ -800,7 +291,7 @@ var BreadcrumbLink = React8.forwardRef(({ asChild, className, ...props }, ref) =
|
|
|
800
291
|
);
|
|
801
292
|
});
|
|
802
293
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
803
|
-
var BreadcrumbPage =
|
|
294
|
+
var BreadcrumbPage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
804
295
|
"span",
|
|
805
296
|
{
|
|
806
297
|
ref,
|
|
@@ -816,21 +307,21 @@ var BreadcrumbSeparator = ({
|
|
|
816
307
|
children,
|
|
817
308
|
className,
|
|
818
309
|
...props
|
|
819
|
-
}) => /* @__PURE__ */
|
|
310
|
+
}) => /* @__PURE__ */ jsx11(
|
|
820
311
|
"li",
|
|
821
312
|
{
|
|
822
313
|
role: "presentation",
|
|
823
314
|
"aria-hidden": "true",
|
|
824
315
|
className: cn("[&>svg]:size-3.5", className),
|
|
825
316
|
...props,
|
|
826
|
-
children: children ?? /* @__PURE__ */
|
|
317
|
+
children: children ?? /* @__PURE__ */ jsx11(ChevronRightIcon, {})
|
|
827
318
|
}
|
|
828
319
|
);
|
|
829
320
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
830
321
|
var BreadcrumbEllipsis = ({
|
|
831
322
|
className,
|
|
832
323
|
...props
|
|
833
|
-
}) => /* @__PURE__ */
|
|
324
|
+
}) => /* @__PURE__ */ jsxs5(
|
|
834
325
|
"span",
|
|
835
326
|
{
|
|
836
327
|
role: "presentation",
|
|
@@ -838,26 +329,26 @@ var BreadcrumbEllipsis = ({
|
|
|
838
329
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
839
330
|
...props,
|
|
840
331
|
children: [
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ jsx11(DotsHorizontalIcon, { className: "h-4 w-4" }),
|
|
333
|
+
/* @__PURE__ */ jsx11("span", { className: "sr-only", children: "More" })
|
|
843
334
|
]
|
|
844
335
|
}
|
|
845
336
|
);
|
|
846
337
|
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
847
338
|
|
|
848
339
|
// components/form-controls/breadcrumb.tsx
|
|
849
|
-
import { jsx as
|
|
340
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
850
341
|
var Breadcrumb2 = ({ breadcrumb }) => {
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
index < breadcrumb.length - 1 && /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ jsx12(Breadcrumb, { className: "p-4", children: /* @__PURE__ */ jsx12(BreadcrumbList, { children: breadcrumb.map(({ href, label }, index) => /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
343
|
+
/* @__PURE__ */ jsx12(BreadcrumbItem, { children: index !== breadcrumb.length - 1 ? /* @__PURE__ */ jsx12(BreadcrumbLink, { className: "cursor-pointer", href, children: label.replace(/-/g, " ") }) : /* @__PURE__ */ jsx12(BreadcrumbPage, { children: label.replace(/-/g, " ") }) }),
|
|
344
|
+
index < breadcrumb.length - 1 && /* @__PURE__ */ jsx12(BreadcrumbSeparator, {})
|
|
854
345
|
] }, index)) }) });
|
|
855
346
|
};
|
|
856
347
|
|
|
857
348
|
// components/ui/card.tsx
|
|
858
|
-
import * as
|
|
859
|
-
import { jsx as
|
|
860
|
-
var Card =
|
|
349
|
+
import * as React6 from "react";
|
|
350
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
351
|
+
var Card = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
861
352
|
"div",
|
|
862
353
|
{
|
|
863
354
|
ref,
|
|
@@ -869,7 +360,7 @@ var Card = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
869
360
|
}
|
|
870
361
|
));
|
|
871
362
|
Card.displayName = "Card";
|
|
872
|
-
var CardHeader =
|
|
363
|
+
var CardHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
873
364
|
"div",
|
|
874
365
|
{
|
|
875
366
|
ref,
|
|
@@ -878,7 +369,7 @@ var CardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
878
369
|
}
|
|
879
370
|
));
|
|
880
371
|
CardHeader.displayName = "CardHeader";
|
|
881
|
-
var CardTitle =
|
|
372
|
+
var CardTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
882
373
|
"h3",
|
|
883
374
|
{
|
|
884
375
|
ref,
|
|
@@ -887,7 +378,7 @@ var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
887
378
|
}
|
|
888
379
|
));
|
|
889
380
|
CardTitle.displayName = "CardTitle";
|
|
890
|
-
var CardDescription =
|
|
381
|
+
var CardDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
891
382
|
"p",
|
|
892
383
|
{
|
|
893
384
|
ref,
|
|
@@ -896,9 +387,9 @@ var CardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
896
387
|
}
|
|
897
388
|
));
|
|
898
389
|
CardDescription.displayName = "CardDescription";
|
|
899
|
-
var CardContent =
|
|
390
|
+
var CardContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
900
391
|
CardContent.displayName = "CardContent";
|
|
901
|
-
var CardFooter =
|
|
392
|
+
var CardFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
902
393
|
"div",
|
|
903
394
|
{
|
|
904
395
|
ref,
|
|
@@ -909,27 +400,27 @@ var CardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
909
400
|
CardFooter.displayName = "CardFooter";
|
|
910
401
|
|
|
911
402
|
// components/form-controls/card.tsx
|
|
912
|
-
import { jsx as
|
|
403
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
913
404
|
var Card2 = ({ title, description, content, footer }) => {
|
|
914
|
-
return /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
description && /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ jsxs7(Card, { children: [
|
|
406
|
+
/* @__PURE__ */ jsxs7(CardHeader, { children: [
|
|
407
|
+
/* @__PURE__ */ jsx14(CardTitle, { children: title }),
|
|
408
|
+
description && /* @__PURE__ */ jsx14(CardDescription, { children: description })
|
|
918
409
|
] }),
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
footer && /* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsx14(CardContent, { children: /* @__PURE__ */ jsx14("p", { children: content }) }),
|
|
411
|
+
footer && /* @__PURE__ */ jsx14(CardFooter, { children: /* @__PURE__ */ jsx14("p", { children: footer }) })
|
|
921
412
|
] });
|
|
922
413
|
};
|
|
923
414
|
|
|
924
415
|
// components/form-controls/checkbox.tsx
|
|
925
|
-
import * as
|
|
416
|
+
import * as React10 from "react";
|
|
926
417
|
|
|
927
418
|
// components/ui/checkbox.tsx
|
|
928
|
-
import * as
|
|
419
|
+
import * as React7 from "react";
|
|
929
420
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
930
|
-
import { CheckIcon
|
|
931
|
-
import { jsx as
|
|
932
|
-
var Checkbox =
|
|
421
|
+
import { CheckIcon } from "@radix-ui/react-icons";
|
|
422
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
423
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
933
424
|
CheckboxPrimitive.Root,
|
|
934
425
|
{
|
|
935
426
|
ref,
|
|
@@ -938,11 +429,11 @@ var Checkbox = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
938
429
|
className
|
|
939
430
|
),
|
|
940
431
|
...props,
|
|
941
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ jsx15(
|
|
942
433
|
CheckboxPrimitive.Indicator,
|
|
943
434
|
{
|
|
944
435
|
className: cn("flex items-center justify-center text-current"),
|
|
945
|
-
children: /* @__PURE__ */
|
|
436
|
+
children: /* @__PURE__ */ jsx15(CheckIcon, { className: "h-4 w-4" })
|
|
946
437
|
}
|
|
947
438
|
)
|
|
948
439
|
}
|
|
@@ -950,7 +441,7 @@ var Checkbox = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
950
441
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
951
442
|
|
|
952
443
|
// components/ui/form.tsx
|
|
953
|
-
import * as
|
|
444
|
+
import * as React9 from "react";
|
|
954
445
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
955
446
|
import {
|
|
956
447
|
Controller,
|
|
@@ -959,14 +450,14 @@ import {
|
|
|
959
450
|
} from "react-hook-form";
|
|
960
451
|
|
|
961
452
|
// components/ui/label.tsx
|
|
962
|
-
import * as
|
|
453
|
+
import * as React8 from "react";
|
|
963
454
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
964
|
-
import { cva as
|
|
965
|
-
import { jsx as
|
|
966
|
-
var labelVariants =
|
|
455
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
456
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
457
|
+
var labelVariants = cva3(
|
|
967
458
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
968
459
|
);
|
|
969
|
-
var
|
|
460
|
+
var Label = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
970
461
|
LabelPrimitive.Root,
|
|
971
462
|
{
|
|
972
463
|
ref,
|
|
@@ -974,22 +465,22 @@ var Label2 = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
974
465
|
...props
|
|
975
466
|
}
|
|
976
467
|
));
|
|
977
|
-
|
|
468
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
978
469
|
|
|
979
470
|
// components/ui/form.tsx
|
|
980
|
-
import { jsx as
|
|
471
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
981
472
|
var Form = FormProvider;
|
|
982
|
-
var FormFieldContext =
|
|
473
|
+
var FormFieldContext = React9.createContext(
|
|
983
474
|
{}
|
|
984
475
|
);
|
|
985
476
|
var FormField = ({
|
|
986
477
|
...props
|
|
987
478
|
}) => {
|
|
988
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ jsx17(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx17(Controller, { ...props }) });
|
|
989
480
|
};
|
|
990
481
|
var useFormField = () => {
|
|
991
|
-
const fieldContext =
|
|
992
|
-
const itemContext =
|
|
482
|
+
const fieldContext = React9.useContext(FormFieldContext);
|
|
483
|
+
const itemContext = React9.useContext(FormItemContext);
|
|
993
484
|
const { getFieldState, formState } = useFormContext();
|
|
994
485
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
995
486
|
if (!fieldContext) {
|
|
@@ -1005,18 +496,18 @@ var useFormField = () => {
|
|
|
1005
496
|
...fieldState
|
|
1006
497
|
};
|
|
1007
498
|
};
|
|
1008
|
-
var FormItemContext =
|
|
499
|
+
var FormItemContext = React9.createContext(
|
|
1009
500
|
{}
|
|
1010
501
|
);
|
|
1011
|
-
var FormItem =
|
|
1012
|
-
const id =
|
|
1013
|
-
return /* @__PURE__ */
|
|
502
|
+
var FormItem = React9.forwardRef(({ className, ...props }, ref) => {
|
|
503
|
+
const id = React9.useId();
|
|
504
|
+
return /* @__PURE__ */ jsx17(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx17("div", { ref, className: cn("space-y-2", className), ...props }) });
|
|
1014
505
|
});
|
|
1015
506
|
FormItem.displayName = "FormItem";
|
|
1016
|
-
var FormLabel =
|
|
507
|
+
var FormLabel = React9.forwardRef(({ className, ...props }, ref) => {
|
|
1017
508
|
const { error, formItemId } = useFormField();
|
|
1018
|
-
return /* @__PURE__ */
|
|
1019
|
-
|
|
509
|
+
return /* @__PURE__ */ jsx17(
|
|
510
|
+
Label,
|
|
1020
511
|
{
|
|
1021
512
|
ref,
|
|
1022
513
|
className: cn(error && "text-destructive", className),
|
|
@@ -1026,9 +517,9 @@ var FormLabel = React12.forwardRef(({ className, ...props }, ref) => {
|
|
|
1026
517
|
);
|
|
1027
518
|
});
|
|
1028
519
|
FormLabel.displayName = "FormLabel";
|
|
1029
|
-
var FormControl =
|
|
520
|
+
var FormControl = React9.forwardRef(({ ...props }, ref) => {
|
|
1030
521
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1031
|
-
return /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ jsx17(
|
|
1032
523
|
Slot3,
|
|
1033
524
|
{
|
|
1034
525
|
ref,
|
|
@@ -1040,9 +531,9 @@ var FormControl = React12.forwardRef(({ ...props }, ref) => {
|
|
|
1040
531
|
);
|
|
1041
532
|
});
|
|
1042
533
|
FormControl.displayName = "FormControl";
|
|
1043
|
-
var FormDescription =
|
|
534
|
+
var FormDescription = React9.forwardRef(({ className, ...props }, ref) => {
|
|
1044
535
|
const { formDescriptionId } = useFormField();
|
|
1045
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ jsx17(
|
|
1046
537
|
"p",
|
|
1047
538
|
{
|
|
1048
539
|
ref,
|
|
@@ -1053,13 +544,13 @@ var FormDescription = React12.forwardRef(({ className, ...props }, ref) => {
|
|
|
1053
544
|
);
|
|
1054
545
|
});
|
|
1055
546
|
FormDescription.displayName = "FormDescription";
|
|
1056
|
-
var FormMessage =
|
|
547
|
+
var FormMessage = React9.forwardRef(({ className, children, ...props }, ref) => {
|
|
1057
548
|
const { error, formMessageId } = useFormField();
|
|
1058
549
|
const body = error ? String(error?.message) : children;
|
|
1059
550
|
if (!body) {
|
|
1060
551
|
return null;
|
|
1061
552
|
}
|
|
1062
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ jsx17(
|
|
1063
554
|
"p",
|
|
1064
555
|
{
|
|
1065
556
|
ref,
|
|
@@ -1073,16 +564,16 @@ var FormMessage = React12.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1073
564
|
FormMessage.displayName = "FormMessage";
|
|
1074
565
|
|
|
1075
566
|
// components/form-controls/checkbox.tsx
|
|
1076
|
-
import { jsx as
|
|
1077
|
-
var Checkbox2 =
|
|
1078
|
-
({ className, title, name, control, isFormField, ...props }, ref) => isFormField ? /* @__PURE__ */
|
|
567
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
568
|
+
var Checkbox2 = React10.forwardRef(
|
|
569
|
+
({ className, title, name, control, isFormField, ...props }, ref) => isFormField ? /* @__PURE__ */ jsx18(
|
|
1079
570
|
FormField,
|
|
1080
571
|
{
|
|
1081
572
|
control,
|
|
1082
573
|
name,
|
|
1083
|
-
render: ({ field }) => /* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
574
|
+
render: ({ field }) => /* @__PURE__ */ jsxs8(FormItem, { children: [
|
|
575
|
+
/* @__PURE__ */ jsx18(FormLabel, { children: title }),
|
|
576
|
+
/* @__PURE__ */ jsx18(FormControl, { children: /* @__PURE__ */ jsx18(
|
|
1086
577
|
Checkbox,
|
|
1087
578
|
{
|
|
1088
579
|
className,
|
|
@@ -1090,23 +581,117 @@ var Checkbox2 = React13.forwardRef(
|
|
|
1090
581
|
onCheckedChange: field.onChange
|
|
1091
582
|
}
|
|
1092
583
|
) }),
|
|
1093
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ jsx18(FormMessage, {})
|
|
1094
585
|
] })
|
|
1095
586
|
}
|
|
1096
|
-
) : /* @__PURE__ */
|
|
587
|
+
) : /* @__PURE__ */ jsx18(Checkbox, { ref, className, ...props })
|
|
1097
588
|
);
|
|
1098
589
|
Checkbox2.displayName = "Checkbox";
|
|
1099
590
|
|
|
1100
591
|
// components/form-controls/combobox.tsx
|
|
1101
592
|
import { Check, ChevronsUpDown } from "lucide-react";
|
|
1102
|
-
import { useEffect
|
|
593
|
+
import { useEffect, useState } from "react";
|
|
1103
594
|
|
|
1104
595
|
// components/ui/command.tsx
|
|
1105
|
-
import * as
|
|
596
|
+
import * as React12 from "react";
|
|
1106
597
|
import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
|
|
1107
598
|
import { Command as CommandPrimitive } from "cmdk";
|
|
1108
|
-
|
|
1109
|
-
|
|
599
|
+
|
|
600
|
+
// components/ui/dialog.tsx
|
|
601
|
+
import * as React11 from "react";
|
|
602
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
603
|
+
import { Cross2Icon } from "@radix-ui/react-icons";
|
|
604
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
605
|
+
var Dialog = DialogPrimitive.Root;
|
|
606
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
607
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
608
|
+
var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
609
|
+
DialogPrimitive.Overlay,
|
|
610
|
+
{
|
|
611
|
+
ref,
|
|
612
|
+
className: cn(
|
|
613
|
+
"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",
|
|
614
|
+
className
|
|
615
|
+
),
|
|
616
|
+
...props
|
|
617
|
+
}
|
|
618
|
+
));
|
|
619
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
620
|
+
var DialogContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs9(DialogPortal, { children: [
|
|
621
|
+
/* @__PURE__ */ jsx19(DialogOverlay, {}),
|
|
622
|
+
/* @__PURE__ */ jsxs9(
|
|
623
|
+
DialogPrimitive.Content,
|
|
624
|
+
{
|
|
625
|
+
ref,
|
|
626
|
+
className: cn(
|
|
627
|
+
"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",
|
|
628
|
+
className
|
|
629
|
+
),
|
|
630
|
+
...props,
|
|
631
|
+
children: [
|
|
632
|
+
children,
|
|
633
|
+
/* @__PURE__ */ jsxs9(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: [
|
|
634
|
+
/* @__PURE__ */ jsx19(Cross2Icon, { className: "h-4 w-4" }),
|
|
635
|
+
/* @__PURE__ */ jsx19("span", { className: "sr-only", children: "Close" })
|
|
636
|
+
] })
|
|
637
|
+
]
|
|
638
|
+
}
|
|
639
|
+
)
|
|
640
|
+
] }));
|
|
641
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
642
|
+
var DialogHeader = ({
|
|
643
|
+
className,
|
|
644
|
+
...props
|
|
645
|
+
}) => /* @__PURE__ */ jsx19(
|
|
646
|
+
"div",
|
|
647
|
+
{
|
|
648
|
+
className: cn(
|
|
649
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
650
|
+
className
|
|
651
|
+
),
|
|
652
|
+
...props
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
DialogHeader.displayName = "DialogHeader";
|
|
656
|
+
var DialogFooter = ({
|
|
657
|
+
className,
|
|
658
|
+
...props
|
|
659
|
+
}) => /* @__PURE__ */ jsx19(
|
|
660
|
+
"div",
|
|
661
|
+
{
|
|
662
|
+
className: cn(
|
|
663
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
664
|
+
className
|
|
665
|
+
),
|
|
666
|
+
...props
|
|
667
|
+
}
|
|
668
|
+
);
|
|
669
|
+
DialogFooter.displayName = "DialogFooter";
|
|
670
|
+
var DialogTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
671
|
+
DialogPrimitive.Title,
|
|
672
|
+
{
|
|
673
|
+
ref,
|
|
674
|
+
className: cn(
|
|
675
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
676
|
+
className
|
|
677
|
+
),
|
|
678
|
+
...props
|
|
679
|
+
}
|
|
680
|
+
));
|
|
681
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
682
|
+
var DialogDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
683
|
+
DialogPrimitive.Description,
|
|
684
|
+
{
|
|
685
|
+
ref,
|
|
686
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
687
|
+
...props
|
|
688
|
+
}
|
|
689
|
+
));
|
|
690
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
691
|
+
|
|
692
|
+
// components/ui/command.tsx
|
|
693
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
694
|
+
var Command = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1110
695
|
CommandPrimitive,
|
|
1111
696
|
{
|
|
1112
697
|
ref,
|
|
@@ -1118,9 +703,9 @@ var Command = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1118
703
|
}
|
|
1119
704
|
));
|
|
1120
705
|
Command.displayName = CommandPrimitive.displayName;
|
|
1121
|
-
var CommandInput =
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
706
|
+
var CommandInput = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs10("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
707
|
+
/* @__PURE__ */ jsx20(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
708
|
+
/* @__PURE__ */ jsx20(
|
|
1124
709
|
CommandPrimitive.Input,
|
|
1125
710
|
{
|
|
1126
711
|
ref,
|
|
@@ -1133,7 +718,7 @@ var CommandInput = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1133
718
|
)
|
|
1134
719
|
] }));
|
|
1135
720
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
1136
|
-
var CommandList =
|
|
721
|
+
var CommandList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1137
722
|
CommandPrimitive.List,
|
|
1138
723
|
{
|
|
1139
724
|
ref,
|
|
@@ -1142,7 +727,7 @@ var CommandList = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1142
727
|
}
|
|
1143
728
|
));
|
|
1144
729
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
1145
|
-
var CommandEmpty =
|
|
730
|
+
var CommandEmpty = React12.forwardRef((props, ref) => /* @__PURE__ */ jsx20(
|
|
1146
731
|
CommandPrimitive.Empty,
|
|
1147
732
|
{
|
|
1148
733
|
ref,
|
|
@@ -1151,7 +736,7 @@ var CommandEmpty = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx24(
|
|
|
1151
736
|
}
|
|
1152
737
|
));
|
|
1153
738
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
1154
|
-
var CommandGroup =
|
|
739
|
+
var CommandGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1155
740
|
CommandPrimitive.Group,
|
|
1156
741
|
{
|
|
1157
742
|
ref,
|
|
@@ -1163,7 +748,7 @@ var CommandGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1163
748
|
}
|
|
1164
749
|
));
|
|
1165
750
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
1166
|
-
var CommandSeparator =
|
|
751
|
+
var CommandSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1167
752
|
CommandPrimitive.Separator,
|
|
1168
753
|
{
|
|
1169
754
|
ref,
|
|
@@ -1172,7 +757,7 @@ var CommandSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1172
757
|
}
|
|
1173
758
|
));
|
|
1174
759
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
1175
|
-
var CommandItem =
|
|
760
|
+
var CommandItem = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1176
761
|
CommandPrimitive.Item,
|
|
1177
762
|
{
|
|
1178
763
|
ref,
|
|
@@ -1188,7 +773,7 @@ var CommandShortcut = ({
|
|
|
1188
773
|
className,
|
|
1189
774
|
...props
|
|
1190
775
|
}) => {
|
|
1191
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ jsx20(
|
|
1192
777
|
"span",
|
|
1193
778
|
{
|
|
1194
779
|
className: cn(
|
|
@@ -1202,12 +787,12 @@ var CommandShortcut = ({
|
|
|
1202
787
|
CommandShortcut.displayName = "CommandShortcut";
|
|
1203
788
|
|
|
1204
789
|
// components/ui/popover.tsx
|
|
1205
|
-
import * as
|
|
790
|
+
import * as React13 from "react";
|
|
1206
791
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1207
|
-
import { jsx as
|
|
792
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1208
793
|
var Popover = PopoverPrimitive.Root;
|
|
1209
794
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1210
|
-
var PopoverContent =
|
|
795
|
+
var PopoverContent = React13.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx21(
|
|
1211
796
|
PopoverPrimitive.Content,
|
|
1212
797
|
{
|
|
1213
798
|
ref,
|
|
@@ -1223,7 +808,7 @@ var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffs
|
|
|
1223
808
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1224
809
|
|
|
1225
810
|
// components/form-controls/combobox.tsx
|
|
1226
|
-
import { jsx as
|
|
811
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1227
812
|
function Combobox({
|
|
1228
813
|
label,
|
|
1229
814
|
options,
|
|
@@ -1233,14 +818,14 @@ function Combobox({
|
|
|
1233
818
|
control,
|
|
1234
819
|
name
|
|
1235
820
|
}) {
|
|
1236
|
-
const [open, setOpen] =
|
|
1237
|
-
const [value, setValue] =
|
|
1238
|
-
|
|
821
|
+
const [open, setOpen] = useState(false);
|
|
822
|
+
const [value, setValue] = useState(defaultValue);
|
|
823
|
+
useEffect(() => {
|
|
1239
824
|
setValue(defaultValue);
|
|
1240
825
|
}, [defaultValue]);
|
|
1241
826
|
if (!isFormField) {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ jsxs11(Popover, { open, onOpenChange: setOpen, children: [
|
|
828
|
+
/* @__PURE__ */ jsx22(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs11(
|
|
1244
829
|
Button,
|
|
1245
830
|
{
|
|
1246
831
|
variant: "outline",
|
|
@@ -1249,14 +834,14 @@ function Combobox({
|
|
|
1249
834
|
className: "w-full justify-between capitalize",
|
|
1250
835
|
children: [
|
|
1251
836
|
value ? options.find((option) => option.value === value)?.label || label : label,
|
|
1252
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ jsx22(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1253
838
|
]
|
|
1254
839
|
}
|
|
1255
840
|
) }),
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ jsx22(PopoverContent, { className: "w-full p-0", children: /* @__PURE__ */ jsxs11(Command, { children: [
|
|
842
|
+
/* @__PURE__ */ jsx22(CommandInput, { placeholder: "Search..." }),
|
|
843
|
+
/* @__PURE__ */ jsx22(CommandEmpty, { children: "No item found." }),
|
|
844
|
+
/* @__PURE__ */ jsx22(CommandList, { children: /* @__PURE__ */ jsx22(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs11(
|
|
1260
845
|
CommandItem,
|
|
1261
846
|
{
|
|
1262
847
|
value: option.value,
|
|
@@ -1266,7 +851,7 @@ function Combobox({
|
|
|
1266
851
|
setOpen(false);
|
|
1267
852
|
},
|
|
1268
853
|
children: [
|
|
1269
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ jsx22(
|
|
1270
855
|
Check,
|
|
1271
856
|
{
|
|
1272
857
|
className: cn(
|
|
@@ -1283,15 +868,15 @@ function Combobox({
|
|
|
1283
868
|
] }) })
|
|
1284
869
|
] });
|
|
1285
870
|
}
|
|
1286
|
-
return /* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ jsx22(
|
|
1287
872
|
FormField,
|
|
1288
873
|
{
|
|
1289
874
|
control,
|
|
1290
875
|
name,
|
|
1291
|
-
render: ({ field }) => /* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
876
|
+
render: ({ field }) => /* @__PURE__ */ jsxs11(FormItem, { children: [
|
|
877
|
+
/* @__PURE__ */ jsx22(FormLabel, { children: label }),
|
|
878
|
+
/* @__PURE__ */ jsx22(FormControl, { children: /* @__PURE__ */ jsxs11(Popover, { open, onOpenChange: setOpen, children: [
|
|
879
|
+
/* @__PURE__ */ jsx22(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs11(
|
|
1295
880
|
Button,
|
|
1296
881
|
{
|
|
1297
882
|
variant: "outline",
|
|
@@ -1300,14 +885,14 @@ function Combobox({
|
|
|
1300
885
|
className: "w-full justify-between capitalize",
|
|
1301
886
|
children: [
|
|
1302
887
|
field.value ? options.find((option) => option.value === field.value)?.label || label : label,
|
|
1303
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ jsx22(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1304
889
|
]
|
|
1305
890
|
}
|
|
1306
891
|
) }),
|
|
1307
|
-
/* @__PURE__ */
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ jsx22(PopoverContent, { className: "w-full p-0", children: /* @__PURE__ */ jsxs11(Command, { children: [
|
|
893
|
+
/* @__PURE__ */ jsx22(CommandInput, { placeholder: "Search..." }),
|
|
894
|
+
/* @__PURE__ */ jsx22(CommandEmpty, { children: "No item found." }),
|
|
895
|
+
/* @__PURE__ */ jsx22(CommandList, { children: /* @__PURE__ */ jsx22(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs11(
|
|
1311
896
|
CommandItem,
|
|
1312
897
|
{
|
|
1313
898
|
value: option.value,
|
|
@@ -1318,7 +903,7 @@ function Combobox({
|
|
|
1318
903
|
setOpen(false);
|
|
1319
904
|
},
|
|
1320
905
|
children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ jsx22(
|
|
1322
907
|
Check,
|
|
1323
908
|
{
|
|
1324
909
|
className: cn(
|
|
@@ -1334,22 +919,22 @@ function Combobox({
|
|
|
1334
919
|
)) }) })
|
|
1335
920
|
] }) })
|
|
1336
921
|
] }) }),
|
|
1337
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ jsx22(FormMessage, {})
|
|
1338
923
|
] })
|
|
1339
924
|
}
|
|
1340
925
|
);
|
|
1341
926
|
}
|
|
1342
927
|
|
|
1343
928
|
// components/form-controls/command.tsx
|
|
1344
|
-
import * as
|
|
1345
|
-
import { jsx as
|
|
1346
|
-
var Command2 =
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
commandGroup.map((group, index) => /* @__PURE__ */
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
commandGroup.length - 1 !== index && /* @__PURE__ */
|
|
929
|
+
import * as React14 from "react";
|
|
930
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
931
|
+
var Command2 = React14.forwardRef(({ className, placeholder, commandGroup, ...props }, ref) => /* @__PURE__ */ jsxs12(Command, { ...props, ref, className, children: [
|
|
932
|
+
/* @__PURE__ */ jsx23(CommandInput, { placeholder }),
|
|
933
|
+
/* @__PURE__ */ jsxs12(CommandList, { children: [
|
|
934
|
+
/* @__PURE__ */ jsx23(CommandEmpty, { children: "No results found." }),
|
|
935
|
+
commandGroup.map((group, index) => /* @__PURE__ */ jsxs12(React14.Fragment, { children: [
|
|
936
|
+
/* @__PURE__ */ jsx23(CommandGroup, { heading: group.header, children: group.items.map((item, itemIndex) => /* @__PURE__ */ jsx23(CommandItem, { children: item }, itemIndex)) }, index),
|
|
937
|
+
commandGroup.length - 1 !== index && /* @__PURE__ */ jsx23(CommandSeparator, {})
|
|
1353
938
|
] }, index))
|
|
1354
939
|
] })
|
|
1355
940
|
] }));
|
|
@@ -1375,17 +960,17 @@ import { Loader2 } from "lucide-react";
|
|
|
1375
960
|
import * as React19 from "react";
|
|
1376
961
|
|
|
1377
962
|
// components/ui/dropdown-menu.tsx
|
|
1378
|
-
import * as
|
|
963
|
+
import * as React15 from "react";
|
|
1379
964
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1380
965
|
import {
|
|
1381
|
-
CheckIcon as
|
|
966
|
+
CheckIcon as CheckIcon2,
|
|
1382
967
|
ChevronRightIcon as ChevronRightIcon2,
|
|
1383
968
|
DotFilledIcon
|
|
1384
969
|
} from "@radix-ui/react-icons";
|
|
1385
|
-
import { jsx as
|
|
970
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1386
971
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1387
972
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1388
|
-
var DropdownMenuSubTrigger =
|
|
973
|
+
var DropdownMenuSubTrigger = React15.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
|
|
1389
974
|
DropdownMenuPrimitive.SubTrigger,
|
|
1390
975
|
{
|
|
1391
976
|
ref,
|
|
@@ -1397,123 +982,261 @@ var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, .
|
|
|
1397
982
|
...props,
|
|
1398
983
|
children: [
|
|
1399
984
|
children,
|
|
1400
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ jsx24(ChevronRightIcon2, { className: "ml-auto h-4 w-4" })
|
|
986
|
+
]
|
|
987
|
+
}
|
|
988
|
+
));
|
|
989
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
990
|
+
var DropdownMenuSubContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
991
|
+
DropdownMenuPrimitive.SubContent,
|
|
992
|
+
{
|
|
993
|
+
ref,
|
|
994
|
+
className: cn(
|
|
995
|
+
"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
996
|
+
className
|
|
997
|
+
),
|
|
998
|
+
...props
|
|
999
|
+
}
|
|
1000
|
+
));
|
|
1001
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1002
|
+
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx24(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx24(
|
|
1003
|
+
DropdownMenuPrimitive.Content,
|
|
1004
|
+
{
|
|
1005
|
+
ref,
|
|
1006
|
+
sideOffset,
|
|
1007
|
+
className: cn(
|
|
1008
|
+
"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1009
|
+
"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",
|
|
1010
|
+
className
|
|
1011
|
+
),
|
|
1012
|
+
...props
|
|
1013
|
+
}
|
|
1014
|
+
) }));
|
|
1015
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1016
|
+
var DropdownMenuItem = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1017
|
+
DropdownMenuPrimitive.Item,
|
|
1018
|
+
{
|
|
1019
|
+
ref,
|
|
1020
|
+
className: cn(
|
|
1021
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1022
|
+
inset && "pl-8",
|
|
1023
|
+
className
|
|
1024
|
+
),
|
|
1025
|
+
...props
|
|
1026
|
+
}
|
|
1027
|
+
));
|
|
1028
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1029
|
+
var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs13(
|
|
1030
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
1031
|
+
{
|
|
1032
|
+
ref,
|
|
1033
|
+
className: cn(
|
|
1034
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1035
|
+
className
|
|
1036
|
+
),
|
|
1037
|
+
checked,
|
|
1038
|
+
...props,
|
|
1039
|
+
children: [
|
|
1040
|
+
/* @__PURE__ */ jsx24("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx24(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(CheckIcon2, { className: "h-4 w-4" }) }) }),
|
|
1041
|
+
children
|
|
1042
|
+
]
|
|
1043
|
+
}
|
|
1044
|
+
));
|
|
1045
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1046
|
+
var DropdownMenuRadioItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
|
|
1047
|
+
DropdownMenuPrimitive.RadioItem,
|
|
1048
|
+
{
|
|
1049
|
+
ref,
|
|
1050
|
+
className: cn(
|
|
1051
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1052
|
+
className
|
|
1053
|
+
),
|
|
1054
|
+
...props,
|
|
1055
|
+
children: [
|
|
1056
|
+
/* @__PURE__ */ jsx24("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx24(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
1057
|
+
children
|
|
1058
|
+
]
|
|
1059
|
+
}
|
|
1060
|
+
));
|
|
1061
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1062
|
+
var DropdownMenuLabel = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1063
|
+
DropdownMenuPrimitive.Label,
|
|
1064
|
+
{
|
|
1065
|
+
ref,
|
|
1066
|
+
className: cn(
|
|
1067
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
1068
|
+
inset && "pl-8",
|
|
1069
|
+
className
|
|
1070
|
+
),
|
|
1071
|
+
...props
|
|
1072
|
+
}
|
|
1073
|
+
));
|
|
1074
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1075
|
+
var DropdownMenuSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
1076
|
+
DropdownMenuPrimitive.Separator,
|
|
1077
|
+
{
|
|
1078
|
+
ref,
|
|
1079
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1080
|
+
...props
|
|
1081
|
+
}
|
|
1082
|
+
));
|
|
1083
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1084
|
+
var DropdownMenuShortcut = ({
|
|
1085
|
+
className,
|
|
1086
|
+
...props
|
|
1087
|
+
}) => {
|
|
1088
|
+
return /* @__PURE__ */ jsx24(
|
|
1089
|
+
"span",
|
|
1090
|
+
{
|
|
1091
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
1092
|
+
...props
|
|
1093
|
+
}
|
|
1094
|
+
);
|
|
1095
|
+
};
|
|
1096
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1097
|
+
|
|
1098
|
+
// components/ui/input.tsx
|
|
1099
|
+
import * as React16 from "react";
|
|
1100
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1101
|
+
var Input = React16.forwardRef(
|
|
1102
|
+
({ className, type, ...props }, ref) => {
|
|
1103
|
+
return /* @__PURE__ */ jsx25(
|
|
1104
|
+
"input",
|
|
1105
|
+
{
|
|
1106
|
+
type,
|
|
1107
|
+
className: cn(
|
|
1108
|
+
"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",
|
|
1109
|
+
className
|
|
1110
|
+
),
|
|
1111
|
+
ref,
|
|
1112
|
+
...props
|
|
1113
|
+
}
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
Input.displayName = "Input";
|
|
1118
|
+
|
|
1119
|
+
// components/ui/select.tsx
|
|
1120
|
+
import * as React17 from "react";
|
|
1121
|
+
import {
|
|
1122
|
+
CaretSortIcon,
|
|
1123
|
+
CheckIcon as CheckIcon3,
|
|
1124
|
+
ChevronDownIcon,
|
|
1125
|
+
ChevronUpIcon
|
|
1126
|
+
} from "@radix-ui/react-icons";
|
|
1127
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1128
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1129
|
+
var Select = SelectPrimitive.Root;
|
|
1130
|
+
var SelectValue = SelectPrimitive.Value;
|
|
1131
|
+
var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs14(
|
|
1132
|
+
SelectPrimitive.Trigger,
|
|
1133
|
+
{
|
|
1134
|
+
ref,
|
|
1135
|
+
className: cn(
|
|
1136
|
+
"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",
|
|
1137
|
+
className
|
|
1138
|
+
),
|
|
1139
|
+
...props,
|
|
1140
|
+
children: [
|
|
1141
|
+
children,
|
|
1142
|
+
/* @__PURE__ */ jsx26(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx26(CaretSortIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
1401
1143
|
]
|
|
1402
1144
|
}
|
|
1403
1145
|
));
|
|
1404
|
-
|
|
1405
|
-
var
|
|
1406
|
-
|
|
1146
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1147
|
+
var SelectScrollUpButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1148
|
+
SelectPrimitive.ScrollUpButton,
|
|
1407
1149
|
{
|
|
1408
1150
|
ref,
|
|
1409
1151
|
className: cn(
|
|
1410
|
-
"
|
|
1152
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1411
1153
|
className
|
|
1412
1154
|
),
|
|
1413
|
-
...props
|
|
1155
|
+
...props,
|
|
1156
|
+
children: /* @__PURE__ */ jsx26(ChevronUpIcon, {})
|
|
1414
1157
|
}
|
|
1415
1158
|
));
|
|
1416
|
-
|
|
1417
|
-
var
|
|
1418
|
-
|
|
1419
|
-
{
|
|
1420
|
-
ref,
|
|
1421
|
-
sideOffset,
|
|
1422
|
-
className: cn(
|
|
1423
|
-
"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1424
|
-
"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",
|
|
1425
|
-
className
|
|
1426
|
-
),
|
|
1427
|
-
...props
|
|
1428
|
-
}
|
|
1429
|
-
) }));
|
|
1430
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1431
|
-
var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1432
|
-
DropdownMenuPrimitive.Item,
|
|
1159
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1160
|
+
var SelectScrollDownButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1161
|
+
SelectPrimitive.ScrollDownButton,
|
|
1433
1162
|
{
|
|
1434
1163
|
ref,
|
|
1435
1164
|
className: cn(
|
|
1436
|
-
"
|
|
1437
|
-
inset && "pl-8",
|
|
1165
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1438
1166
|
className
|
|
1439
1167
|
),
|
|
1440
|
-
...props
|
|
1168
|
+
...props,
|
|
1169
|
+
children: /* @__PURE__ */ jsx26(ChevronDownIcon, {})
|
|
1441
1170
|
}
|
|
1442
1171
|
));
|
|
1443
|
-
|
|
1444
|
-
var
|
|
1445
|
-
|
|
1172
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1173
|
+
var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx26(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs14(
|
|
1174
|
+
SelectPrimitive.Content,
|
|
1446
1175
|
{
|
|
1447
1176
|
ref,
|
|
1448
1177
|
className: cn(
|
|
1449
|
-
"relative
|
|
1178
|
+
"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",
|
|
1179
|
+
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",
|
|
1450
1180
|
className
|
|
1451
1181
|
),
|
|
1452
|
-
|
|
1182
|
+
position,
|
|
1453
1183
|
...props,
|
|
1454
1184
|
children: [
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
-
|
|
1185
|
+
/* @__PURE__ */ jsx26(SelectScrollUpButton, {}),
|
|
1186
|
+
/* @__PURE__ */ jsx26(
|
|
1187
|
+
SelectPrimitive.Viewport,
|
|
1188
|
+
{
|
|
1189
|
+
className: cn(
|
|
1190
|
+
"p-1",
|
|
1191
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
|
1192
|
+
),
|
|
1193
|
+
children
|
|
1194
|
+
}
|
|
1195
|
+
),
|
|
1196
|
+
/* @__PURE__ */ jsx26(SelectScrollDownButton, {})
|
|
1457
1197
|
]
|
|
1458
1198
|
}
|
|
1459
|
-
));
|
|
1460
|
-
|
|
1461
|
-
var
|
|
1462
|
-
|
|
1199
|
+
) }));
|
|
1200
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1201
|
+
var SelectLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1202
|
+
SelectPrimitive.Label,
|
|
1463
1203
|
{
|
|
1464
1204
|
ref,
|
|
1465
|
-
className: cn(
|
|
1466
|
-
|
|
1467
|
-
className
|
|
1468
|
-
),
|
|
1469
|
-
...props,
|
|
1470
|
-
children: [
|
|
1471
|
-
/* @__PURE__ */ jsx28("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx28(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx28(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
1472
|
-
children
|
|
1473
|
-
]
|
|
1205
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
1206
|
+
...props
|
|
1474
1207
|
}
|
|
1475
1208
|
));
|
|
1476
|
-
|
|
1477
|
-
var
|
|
1478
|
-
|
|
1209
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1210
|
+
var SelectItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs14(
|
|
1211
|
+
SelectPrimitive.Item,
|
|
1479
1212
|
{
|
|
1480
1213
|
ref,
|
|
1481
1214
|
className: cn(
|
|
1482
|
-
"
|
|
1483
|
-
inset && "pl-8",
|
|
1215
|
+
"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",
|
|
1484
1216
|
className
|
|
1485
1217
|
),
|
|
1486
|
-
...props
|
|
1218
|
+
...props,
|
|
1219
|
+
children: [
|
|
1220
|
+
/* @__PURE__ */ jsx26("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx26(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx26(CheckIcon3, { className: "h-4 w-4" }) }) }),
|
|
1221
|
+
/* @__PURE__ */ jsx26(SelectPrimitive.ItemText, { children })
|
|
1222
|
+
]
|
|
1487
1223
|
}
|
|
1488
1224
|
));
|
|
1489
|
-
|
|
1490
|
-
var
|
|
1491
|
-
|
|
1225
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1226
|
+
var SelectSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1227
|
+
SelectPrimitive.Separator,
|
|
1492
1228
|
{
|
|
1493
1229
|
ref,
|
|
1494
1230
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1495
1231
|
...props
|
|
1496
1232
|
}
|
|
1497
1233
|
));
|
|
1498
|
-
|
|
1499
|
-
var DropdownMenuShortcut = ({
|
|
1500
|
-
className,
|
|
1501
|
-
...props
|
|
1502
|
-
}) => {
|
|
1503
|
-
return /* @__PURE__ */ jsx28(
|
|
1504
|
-
"span",
|
|
1505
|
-
{
|
|
1506
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
1507
|
-
...props
|
|
1508
|
-
}
|
|
1509
|
-
);
|
|
1510
|
-
};
|
|
1511
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1234
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1512
1235
|
|
|
1513
1236
|
// components/ui/table.tsx
|
|
1514
1237
|
import * as React18 from "react";
|
|
1515
|
-
import { jsx as
|
|
1516
|
-
var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1238
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1239
|
+
var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx27(
|
|
1517
1240
|
"table",
|
|
1518
1241
|
{
|
|
1519
1242
|
ref,
|
|
@@ -1522,9 +1245,9 @@ var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1522
1245
|
}
|
|
1523
1246
|
) }));
|
|
1524
1247
|
Table.displayName = "Table";
|
|
1525
|
-
var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1248
|
+
var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1526
1249
|
TableHeader.displayName = "TableHeader";
|
|
1527
|
-
var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1250
|
+
var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1528
1251
|
"tbody",
|
|
1529
1252
|
{
|
|
1530
1253
|
ref,
|
|
@@ -1533,7 +1256,7 @@ var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1533
1256
|
}
|
|
1534
1257
|
));
|
|
1535
1258
|
TableBody.displayName = "TableBody";
|
|
1536
|
-
var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1259
|
+
var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1537
1260
|
"tfoot",
|
|
1538
1261
|
{
|
|
1539
1262
|
ref,
|
|
@@ -1545,7 +1268,7 @@ var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1545
1268
|
}
|
|
1546
1269
|
));
|
|
1547
1270
|
TableFooter.displayName = "TableFooter";
|
|
1548
|
-
var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1271
|
+
var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1549
1272
|
"tr",
|
|
1550
1273
|
{
|
|
1551
1274
|
ref,
|
|
@@ -1557,7 +1280,7 @@ var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1557
1280
|
}
|
|
1558
1281
|
));
|
|
1559
1282
|
TableRow.displayName = "TableRow";
|
|
1560
|
-
var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1283
|
+
var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1561
1284
|
"th",
|
|
1562
1285
|
{
|
|
1563
1286
|
ref,
|
|
@@ -1569,7 +1292,7 @@ var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1569
1292
|
}
|
|
1570
1293
|
));
|
|
1571
1294
|
TableHead.displayName = "TableHead";
|
|
1572
|
-
var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1295
|
+
var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1573
1296
|
"td",
|
|
1574
1297
|
{
|
|
1575
1298
|
ref,
|
|
@@ -1581,7 +1304,7 @@ var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1581
1304
|
}
|
|
1582
1305
|
));
|
|
1583
1306
|
TableCell.displayName = "TableCell";
|
|
1584
|
-
var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1307
|
+
var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1585
1308
|
"caption",
|
|
1586
1309
|
{
|
|
1587
1310
|
ref,
|
|
@@ -1592,7 +1315,7 @@ var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1592
1315
|
TableCaption.displayName = "TableCaption";
|
|
1593
1316
|
|
|
1594
1317
|
// components/form-controls/data-table.tsx
|
|
1595
|
-
import { jsx as
|
|
1318
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1596
1319
|
function DataTable({
|
|
1597
1320
|
data,
|
|
1598
1321
|
columns,
|
|
@@ -1624,10 +1347,10 @@ function DataTable({
|
|
|
1624
1347
|
rowSelection
|
|
1625
1348
|
}
|
|
1626
1349
|
});
|
|
1627
|
-
return /* @__PURE__ */
|
|
1628
|
-
isLoading && /* @__PURE__ */
|
|
1629
|
-
filterField && /* @__PURE__ */
|
|
1630
|
-
/* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ jsxs15("div", { className: "w-full mt-4 relative", children: [
|
|
1351
|
+
isLoading && /* @__PURE__ */ jsx28(Loader2, { className: "h-4 w-4 animate-spin absolute top-2 right-32" }),
|
|
1352
|
+
filterField && /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
1353
|
+
/* @__PURE__ */ jsx28(
|
|
1631
1354
|
Input,
|
|
1632
1355
|
{
|
|
1633
1356
|
placeholder: `Filter by ${filterField}...`,
|
|
@@ -1636,15 +1359,15 @@ function DataTable({
|
|
|
1636
1359
|
className: "max-w-sm"
|
|
1637
1360
|
}
|
|
1638
1361
|
),
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
refresh && /* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center space-x-4", children: [
|
|
1363
|
+
refresh && /* @__PURE__ */ jsx28(Button, { variant: "outline", onClick: refresh, children: /* @__PURE__ */ jsx28(Icon, { name: "RotateCcw", strokeWidth: 2, size: 20 }) }),
|
|
1364
|
+
/* @__PURE__ */ jsxs15(DropdownMenu, { children: [
|
|
1365
|
+
/* @__PURE__ */ jsx28(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(Button, { variant: "outline", children: [
|
|
1643
1366
|
"Columns ",
|
|
1644
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ jsx28(ChevronDownIcon2, { className: "ml-2 h-4 w-4" })
|
|
1645
1368
|
] }) }),
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
return /* @__PURE__ */
|
|
1369
|
+
/* @__PURE__ */ jsx28(DropdownMenuContent, { align: "end", children: table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
|
1370
|
+
return /* @__PURE__ */ jsx28(
|
|
1648
1371
|
DropdownMenuCheckboxItem,
|
|
1649
1372
|
{
|
|
1650
1373
|
className: "capitalize",
|
|
@@ -1658,24 +1381,24 @@ function DataTable({
|
|
|
1658
1381
|
] })
|
|
1659
1382
|
] })
|
|
1660
1383
|
] }),
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
return /* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ jsx28("div", { className: "rounded-md border mt-4", children: /* @__PURE__ */ jsxs15(Table, { children: [
|
|
1385
|
+
/* @__PURE__ */ jsx28(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx28(TableRow, { children: headerGroup.headers.map((header) => {
|
|
1386
|
+
return /* @__PURE__ */ jsx28(TableHead, { children: header.isPlaceholder ? null : flexRender(
|
|
1664
1387
|
header.column.columnDef.header,
|
|
1665
1388
|
header.getContext()
|
|
1666
1389
|
) }, header.id);
|
|
1667
1390
|
}) }, headerGroup.id)) }),
|
|
1668
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ jsx28(TableBody, { children: table.getRowModel().rows?.length > 0 ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx28(
|
|
1669
1392
|
TableRow,
|
|
1670
1393
|
{
|
|
1671
1394
|
"data-state": row.getIsSelected() && "selected",
|
|
1672
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
1395
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx28(TableCell, { children: flexRender(
|
|
1673
1396
|
cell.column.columnDef.cell,
|
|
1674
1397
|
cell.getContext()
|
|
1675
1398
|
) }, cell.id))
|
|
1676
1399
|
},
|
|
1677
1400
|
row.id
|
|
1678
|
-
)) : /* @__PURE__ */
|
|
1401
|
+
)) : /* @__PURE__ */ jsx28(TableRow, { children: /* @__PURE__ */ jsx28(
|
|
1679
1402
|
TableCell,
|
|
1680
1403
|
{
|
|
1681
1404
|
colSpan: columns.length,
|
|
@@ -1683,18 +1406,18 @@ function DataTable({
|
|
|
1683
1406
|
}
|
|
1684
1407
|
) }) })
|
|
1685
1408
|
] }) }),
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
table.getAllColumns().some((col) => col.id === "select") && /* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-end space-x-2 py-4", children: [
|
|
1410
|
+
table.getAllColumns().some((col) => col.id === "select") && /* @__PURE__ */ jsxs15("div", { className: "flex-1 text-sm text-muted-foreground", children: [
|
|
1688
1411
|
table.getFilteredSelectedRowModel().rows.length,
|
|
1689
1412
|
" of",
|
|
1690
1413
|
" ",
|
|
1691
1414
|
table.getFilteredRowModel().rows.length,
|
|
1692
1415
|
" row(s) selected."
|
|
1693
1416
|
] }),
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
1418
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center space-x-2", children: [
|
|
1419
|
+
/* @__PURE__ */ jsx28("p", { className: "text-sm font-medium", children: "Rows per page" }),
|
|
1420
|
+
/* @__PURE__ */ jsxs15(
|
|
1698
1421
|
Select,
|
|
1699
1422
|
{
|
|
1700
1423
|
value: `${table.getState().pagination.pageSize}`,
|
|
@@ -1702,26 +1425,26 @@ function DataTable({
|
|
|
1702
1425
|
table.setPageSize(Number(value));
|
|
1703
1426
|
},
|
|
1704
1427
|
children: [
|
|
1705
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ jsx28(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx28(
|
|
1706
1429
|
SelectValue,
|
|
1707
1430
|
{
|
|
1708
1431
|
placeholder: table.getState().pagination.pageSize
|
|
1709
1432
|
}
|
|
1710
1433
|
) }),
|
|
1711
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ jsx28(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsx28(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
|
|
1712
1435
|
]
|
|
1713
1436
|
}
|
|
1714
1437
|
)
|
|
1715
1438
|
] }),
|
|
1716
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
1717
1440
|
"Page ",
|
|
1718
1441
|
table.getState().pagination.pageIndex + 1,
|
|
1719
1442
|
" of",
|
|
1720
1443
|
" ",
|
|
1721
1444
|
table.getPageCount()
|
|
1722
1445
|
] }),
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center space-x-2", children: [
|
|
1447
|
+
/* @__PURE__ */ jsxs15(
|
|
1725
1448
|
Button,
|
|
1726
1449
|
{
|
|
1727
1450
|
variant: "outline",
|
|
@@ -1729,12 +1452,12 @@ function DataTable({
|
|
|
1729
1452
|
onClick: () => table.setPageIndex(0),
|
|
1730
1453
|
disabled: !table.getCanPreviousPage(),
|
|
1731
1454
|
children: [
|
|
1732
|
-
/* @__PURE__ */
|
|
1733
|
-
/* @__PURE__ */
|
|
1455
|
+
/* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Go to first page" }),
|
|
1456
|
+
/* @__PURE__ */ jsx28(DoubleArrowLeftIcon, { className: "h-4 w-4" })
|
|
1734
1457
|
]
|
|
1735
1458
|
}
|
|
1736
1459
|
),
|
|
1737
|
-
/* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ jsxs15(
|
|
1738
1461
|
Button,
|
|
1739
1462
|
{
|
|
1740
1463
|
variant: "outline",
|
|
@@ -1742,12 +1465,12 @@ function DataTable({
|
|
|
1742
1465
|
onClick: () => table.previousPage(),
|
|
1743
1466
|
disabled: !table.getCanPreviousPage(),
|
|
1744
1467
|
children: [
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Go to previous page" }),
|
|
1469
|
+
/* @__PURE__ */ jsx28(ChevronLeftIcon, { className: "h-4 w-4" })
|
|
1747
1470
|
]
|
|
1748
1471
|
}
|
|
1749
1472
|
),
|
|
1750
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ jsxs15(
|
|
1751
1474
|
Button,
|
|
1752
1475
|
{
|
|
1753
1476
|
variant: "outline",
|
|
@@ -1755,12 +1478,12 @@ function DataTable({
|
|
|
1755
1478
|
onClick: () => table.nextPage(),
|
|
1756
1479
|
disabled: !table.getCanNextPage(),
|
|
1757
1480
|
children: [
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Go to next page" }),
|
|
1482
|
+
/* @__PURE__ */ jsx28(ChevronRightIcon3, { className: "h-4 w-4" })
|
|
1760
1483
|
]
|
|
1761
1484
|
}
|
|
1762
1485
|
),
|
|
1763
|
-
/* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ jsxs15(
|
|
1764
1487
|
Button,
|
|
1765
1488
|
{
|
|
1766
1489
|
variant: "outline",
|
|
@@ -1768,8 +1491,8 @@ function DataTable({
|
|
|
1768
1491
|
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
1769
1492
|
disabled: !table.getCanNextPage(),
|
|
1770
1493
|
children: [
|
|
1771
|
-
/* @__PURE__ */
|
|
1772
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Go to last page" }),
|
|
1495
|
+
/* @__PURE__ */ jsx28(DoubleArrowRightIcon, { className: "h-4 w-4" })
|
|
1773
1496
|
]
|
|
1774
1497
|
}
|
|
1775
1498
|
)
|
|
@@ -3353,14 +3076,14 @@ function cleanEscapedString(input) {
|
|
|
3353
3076
|
|
|
3354
3077
|
// components/ui/calendar.tsx
|
|
3355
3078
|
import { DayPicker } from "react-day-picker";
|
|
3356
|
-
import { jsx as
|
|
3079
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3357
3080
|
function Calendar({
|
|
3358
3081
|
className,
|
|
3359
3082
|
classNames,
|
|
3360
3083
|
showOutsideDays = true,
|
|
3361
3084
|
...props
|
|
3362
3085
|
}) {
|
|
3363
|
-
return /* @__PURE__ */
|
|
3086
|
+
return /* @__PURE__ */ jsx29(
|
|
3364
3087
|
DayPicker,
|
|
3365
3088
|
{
|
|
3366
3089
|
showOutsideDays,
|
|
@@ -3410,10 +3133,10 @@ function Calendar({
|
|
|
3410
3133
|
Calendar.displayName = "Calendar";
|
|
3411
3134
|
|
|
3412
3135
|
// components/form-controls/date-filter.tsx
|
|
3413
|
-
import { Fragment as
|
|
3136
|
+
import { Fragment as Fragment3, jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3414
3137
|
function DateFilter({ className, date, setDate }) {
|
|
3415
|
-
return /* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx30("div", { className: cn("grid gap-2", className), children: /* @__PURE__ */ jsxs16(Popover, { children: [
|
|
3139
|
+
/* @__PURE__ */ jsx30(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
3417
3140
|
Button,
|
|
3418
3141
|
{
|
|
3419
3142
|
id: "date",
|
|
@@ -3423,17 +3146,17 @@ function DateFilter({ className, date, setDate }) {
|
|
|
3423
3146
|
!date && "text-muted-foreground"
|
|
3424
3147
|
),
|
|
3425
3148
|
children: [
|
|
3426
|
-
/* @__PURE__ */
|
|
3427
|
-
date?.from ? date.to ? /* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ jsx30(CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
3150
|
+
date?.from ? date.to ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3428
3151
|
format(date.from, "LLL dd, y"),
|
|
3429
3152
|
" -",
|
|
3430
3153
|
" ",
|
|
3431
3154
|
format(date.to, "LLL dd, y")
|
|
3432
|
-
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */
|
|
3155
|
+
] }) : format(date.from, "LLL dd, y") : /* @__PURE__ */ jsx30("span", { children: "Pick a date" })
|
|
3433
3156
|
]
|
|
3434
3157
|
}
|
|
3435
3158
|
) }),
|
|
3436
|
-
/* @__PURE__ */
|
|
3159
|
+
/* @__PURE__ */ jsx30(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx30(
|
|
3437
3160
|
Calendar,
|
|
3438
3161
|
{
|
|
3439
3162
|
initialFocus: true,
|
|
@@ -3449,7 +3172,7 @@ function DateFilter({ className, date, setDate }) {
|
|
|
3449
3172
|
|
|
3450
3173
|
// components/form-controls/dialog.tsx
|
|
3451
3174
|
import { icons as icons2 } from "lucide-react";
|
|
3452
|
-
import { jsx as
|
|
3175
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3453
3176
|
var Dialog2 = ({
|
|
3454
3177
|
title,
|
|
3455
3178
|
description,
|
|
@@ -3463,13 +3186,13 @@ var Dialog2 = ({
|
|
|
3463
3186
|
actions
|
|
3464
3187
|
}) => {
|
|
3465
3188
|
const IconComponent = icon ? icons2[icon] : null;
|
|
3466
|
-
return /* @__PURE__ */
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
/* @__PURE__ */
|
|
3469
|
-
/* @__PURE__ */
|
|
3470
|
-
/* @__PURE__ */
|
|
3471
|
-
/* @__PURE__ */
|
|
3472
|
-
IconComponent && /* @__PURE__ */
|
|
3189
|
+
return /* @__PURE__ */ jsxs17(Dialog, { open, onOpenChange, children: [
|
|
3190
|
+
/* @__PURE__ */ jsx31(DialogTrigger, { children: trigger }),
|
|
3191
|
+
/* @__PURE__ */ jsxs17(DialogContent, { className, children: [
|
|
3192
|
+
/* @__PURE__ */ jsxs17(DialogHeader, { children: [
|
|
3193
|
+
/* @__PURE__ */ jsxs17(DialogTitle, { className: "capitalize flex items-center gap-2 justify-between pr-8", children: [
|
|
3194
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
3195
|
+
IconComponent && /* @__PURE__ */ jsx31(
|
|
3473
3196
|
IconComponent,
|
|
3474
3197
|
{
|
|
3475
3198
|
size: 20,
|
|
@@ -3479,7 +3202,7 @@ var Dialog2 = ({
|
|
|
3479
3202
|
),
|
|
3480
3203
|
title
|
|
3481
3204
|
] }),
|
|
3482
|
-
actions && /* @__PURE__ */
|
|
3205
|
+
actions && /* @__PURE__ */ jsx31("div", { className: "flex items-center gap-2", children: actions.map((action) => /* @__PURE__ */ jsxs17(
|
|
3483
3206
|
Button2,
|
|
3484
3207
|
{
|
|
3485
3208
|
variant: action.type,
|
|
@@ -3488,8 +3211,8 @@ var Dialog2 = ({
|
|
|
3488
3211
|
disabled: action.disabled,
|
|
3489
3212
|
children: [
|
|
3490
3213
|
action.label,
|
|
3491
|
-
action.icon && /* @__PURE__ */
|
|
3492
|
-
|
|
3214
|
+
action.icon && /* @__PURE__ */ jsx31(
|
|
3215
|
+
Icon,
|
|
3493
3216
|
{
|
|
3494
3217
|
name: action.icon,
|
|
3495
3218
|
className: cn(action.iconClassName),
|
|
@@ -3502,7 +3225,7 @@ var Dialog2 = ({
|
|
|
3502
3225
|
action.label
|
|
3503
3226
|
)) })
|
|
3504
3227
|
] }),
|
|
3505
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ jsx31(DialogDescription, { children: description })
|
|
3506
3229
|
] }),
|
|
3507
3230
|
children
|
|
3508
3231
|
] })
|
|
@@ -3512,11 +3235,11 @@ var Dialog2 = ({
|
|
|
3512
3235
|
// components/ui/drawer.tsx
|
|
3513
3236
|
import * as React20 from "react";
|
|
3514
3237
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3515
|
-
import { jsx as
|
|
3238
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3516
3239
|
var Drawer = ({
|
|
3517
3240
|
shouldScaleBackground = true,
|
|
3518
3241
|
...props
|
|
3519
|
-
}) => /* @__PURE__ */
|
|
3242
|
+
}) => /* @__PURE__ */ jsx32(
|
|
3520
3243
|
DrawerPrimitive.Root,
|
|
3521
3244
|
{
|
|
3522
3245
|
shouldScaleBackground,
|
|
@@ -3527,7 +3250,7 @@ Drawer.displayName = "Drawer";
|
|
|
3527
3250
|
var DrawerTrigger = DrawerPrimitive.Trigger;
|
|
3528
3251
|
var DrawerPortal = DrawerPrimitive.Portal;
|
|
3529
3252
|
var DrawerClose = DrawerPrimitive.Close;
|
|
3530
|
-
var DrawerOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3253
|
+
var DrawerOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
3531
3254
|
DrawerPrimitive.Overlay,
|
|
3532
3255
|
{
|
|
3533
3256
|
ref,
|
|
@@ -3536,9 +3259,9 @@ var DrawerOverlay = React20.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
3536
3259
|
}
|
|
3537
3260
|
));
|
|
3538
3261
|
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
3539
|
-
var DrawerContent = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
/* @__PURE__ */
|
|
3262
|
+
var DrawerContent = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs18(DrawerPortal, { children: [
|
|
3263
|
+
/* @__PURE__ */ jsx32(DrawerOverlay, {}),
|
|
3264
|
+
/* @__PURE__ */ jsxs18(
|
|
3542
3265
|
DrawerPrimitive.Content,
|
|
3543
3266
|
{
|
|
3544
3267
|
ref,
|
|
@@ -3548,7 +3271,7 @@ var DrawerContent = React20.forwardRef(({ className, children, ...props }, ref)
|
|
|
3548
3271
|
),
|
|
3549
3272
|
...props,
|
|
3550
3273
|
children: [
|
|
3551
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ jsx32("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
3552
3275
|
children
|
|
3553
3276
|
]
|
|
3554
3277
|
}
|
|
@@ -3558,7 +3281,7 @@ DrawerContent.displayName = "DrawerContent";
|
|
|
3558
3281
|
var DrawerHeader = ({
|
|
3559
3282
|
className,
|
|
3560
3283
|
...props
|
|
3561
|
-
}) => /* @__PURE__ */
|
|
3284
|
+
}) => /* @__PURE__ */ jsx32(
|
|
3562
3285
|
"div",
|
|
3563
3286
|
{
|
|
3564
3287
|
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
|
|
@@ -3569,7 +3292,7 @@ DrawerHeader.displayName = "DrawerHeader";
|
|
|
3569
3292
|
var DrawerFooter = ({
|
|
3570
3293
|
className,
|
|
3571
3294
|
...props
|
|
3572
|
-
}) => /* @__PURE__ */
|
|
3295
|
+
}) => /* @__PURE__ */ jsx32(
|
|
3573
3296
|
"div",
|
|
3574
3297
|
{
|
|
3575
3298
|
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
@@ -3577,7 +3300,7 @@ var DrawerFooter = ({
|
|
|
3577
3300
|
}
|
|
3578
3301
|
);
|
|
3579
3302
|
DrawerFooter.displayName = "DrawerFooter";
|
|
3580
|
-
var DrawerTitle = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3303
|
+
var DrawerTitle = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
3581
3304
|
DrawerPrimitive.Title,
|
|
3582
3305
|
{
|
|
3583
3306
|
ref,
|
|
@@ -3589,7 +3312,7 @@ var DrawerTitle = React20.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3589
3312
|
}
|
|
3590
3313
|
));
|
|
3591
3314
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
3592
|
-
var DrawerDescription = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3315
|
+
var DrawerDescription = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
3593
3316
|
DrawerPrimitive.Description,
|
|
3594
3317
|
{
|
|
3595
3318
|
ref,
|
|
@@ -3602,22 +3325,22 @@ DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
|
3602
3325
|
// components/ui/scroll-area.tsx
|
|
3603
3326
|
import * as React21 from "react";
|
|
3604
3327
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3605
|
-
import { jsx as
|
|
3606
|
-
var ScrollArea = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3328
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3329
|
+
var ScrollArea = React21.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs19(
|
|
3607
3330
|
ScrollAreaPrimitive.Root,
|
|
3608
3331
|
{
|
|
3609
3332
|
ref,
|
|
3610
3333
|
className: cn("relative overflow-hidden", className),
|
|
3611
3334
|
...props,
|
|
3612
3335
|
children: [
|
|
3613
|
-
/* @__PURE__ */
|
|
3614
|
-
/* @__PURE__ */
|
|
3615
|
-
/* @__PURE__ */
|
|
3336
|
+
/* @__PURE__ */ jsx33(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
3337
|
+
/* @__PURE__ */ jsx33(ScrollBar, {}),
|
|
3338
|
+
/* @__PURE__ */ jsx33(ScrollAreaPrimitive.Corner, {})
|
|
3616
3339
|
]
|
|
3617
3340
|
}
|
|
3618
3341
|
));
|
|
3619
3342
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
3620
|
-
var ScrollBar = React21.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
3343
|
+
var ScrollBar = React21.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
3621
3344
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3622
3345
|
{
|
|
3623
3346
|
ref,
|
|
@@ -3629,13 +3352,13 @@ var ScrollBar = React21.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
3629
3352
|
className
|
|
3630
3353
|
),
|
|
3631
3354
|
...props,
|
|
3632
|
-
children: /* @__PURE__ */
|
|
3355
|
+
children: /* @__PURE__ */ jsx33(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
3633
3356
|
}
|
|
3634
3357
|
));
|
|
3635
3358
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
3636
3359
|
|
|
3637
3360
|
// components/form-controls/drawer.tsx
|
|
3638
|
-
import { jsx as
|
|
3361
|
+
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3639
3362
|
var Drawer2 = ({
|
|
3640
3363
|
title,
|
|
3641
3364
|
trigger,
|
|
@@ -3645,7 +3368,7 @@ var Drawer2 = ({
|
|
|
3645
3368
|
setOpenDrawer,
|
|
3646
3369
|
...props
|
|
3647
3370
|
}) => {
|
|
3648
|
-
return /* @__PURE__ */
|
|
3371
|
+
return /* @__PURE__ */ jsxs20(
|
|
3649
3372
|
Drawer,
|
|
3650
3373
|
{
|
|
3651
3374
|
direction: "right",
|
|
@@ -3653,11 +3376,11 @@ var Drawer2 = ({
|
|
|
3653
3376
|
onOpenChange: setOpenDrawer,
|
|
3654
3377
|
...props,
|
|
3655
3378
|
children: [
|
|
3656
|
-
trigger && /* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3379
|
+
trigger && /* @__PURE__ */ jsx34(DrawerTrigger, { children: trigger }),
|
|
3380
|
+
/* @__PURE__ */ jsx34(DrawerContent, { className: "h-screen top-0 right-0 left-auto mt-0 w-[500px] rounded-none", children: /* @__PURE__ */ jsx34(ScrollArea, { className: "h-screen", children: /* @__PURE__ */ jsxs20("div", { className: "mx-auto w-full p-5", children: [
|
|
3381
|
+
/* @__PURE__ */ jsxs20(DrawerHeader, { children: [
|
|
3382
|
+
/* @__PURE__ */ jsx34(DrawerTitle, { children: title }),
|
|
3383
|
+
/* @__PURE__ */ jsx34(DrawerDescription, { children: description })
|
|
3661
3384
|
] }),
|
|
3662
3385
|
children
|
|
3663
3386
|
] }) }) })
|
|
@@ -3667,16 +3390,16 @@ var Drawer2 = ({
|
|
|
3667
3390
|
};
|
|
3668
3391
|
|
|
3669
3392
|
// components/form-controls/dropdown-menu.tsx
|
|
3670
|
-
import { jsx as
|
|
3393
|
+
import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3671
3394
|
var DropdownMenu2 = ({
|
|
3672
3395
|
trigger,
|
|
3673
3396
|
items,
|
|
3674
3397
|
className = "",
|
|
3675
3398
|
onClick
|
|
3676
3399
|
}) => {
|
|
3677
|
-
return /* @__PURE__ */
|
|
3678
|
-
/* @__PURE__ */
|
|
3679
|
-
/* @__PURE__ */
|
|
3400
|
+
return /* @__PURE__ */ jsxs21(DropdownMenu, { children: [
|
|
3401
|
+
/* @__PURE__ */ jsx35(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx35("div", { className, children: trigger }) }),
|
|
3402
|
+
/* @__PURE__ */ jsx35(DropdownMenuContent, { className: "cursor-pointer", children: items.map((item, index) => /* @__PURE__ */ jsx35(
|
|
3680
3403
|
DropdownMenuItem,
|
|
3681
3404
|
{
|
|
3682
3405
|
className: "cursor-pointer!",
|
|
@@ -3689,8 +3412,8 @@ var DropdownMenu2 = ({
|
|
|
3689
3412
|
};
|
|
3690
3413
|
|
|
3691
3414
|
// components/form-controls/duration-input.tsx
|
|
3692
|
-
import { useEffect as
|
|
3693
|
-
import { jsx as
|
|
3415
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
3416
|
+
import { jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3694
3417
|
var unitOptions = [
|
|
3695
3418
|
{ label: "Seconds", value: "s", ns: 1e9 },
|
|
3696
3419
|
{ label: "Minutes", value: "m", ns: 6e10 },
|
|
@@ -3721,10 +3444,10 @@ function toGoCompatibleDuration(amount, unit) {
|
|
|
3721
3444
|
}
|
|
3722
3445
|
}
|
|
3723
3446
|
function DurationInput({ value, onChange }) {
|
|
3724
|
-
const [amount, setAmount] =
|
|
3725
|
-
const [unit, setUnit] =
|
|
3726
|
-
const [userInteracted, setUserInteracted] =
|
|
3727
|
-
|
|
3447
|
+
const [amount, setAmount] = useState3("");
|
|
3448
|
+
const [unit, setUnit] = useState3("h");
|
|
3449
|
+
const [userInteracted, setUserInteracted] = useState3(false);
|
|
3450
|
+
useEffect2(() => {
|
|
3728
3451
|
if (userInteracted) return;
|
|
3729
3452
|
if (value === void 0 || value === null || value === "") {
|
|
3730
3453
|
setAmount("");
|
|
@@ -3773,8 +3496,8 @@ function DurationInput({ value, onChange }) {
|
|
|
3773
3496
|
onChange("");
|
|
3774
3497
|
}
|
|
3775
3498
|
};
|
|
3776
|
-
return /* @__PURE__ */
|
|
3777
|
-
/* @__PURE__ */
|
|
3499
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2", children: [
|
|
3500
|
+
/* @__PURE__ */ jsx36(
|
|
3778
3501
|
Input,
|
|
3779
3502
|
{
|
|
3780
3503
|
type: "number",
|
|
@@ -3784,23 +3507,46 @@ function DurationInput({ value, onChange }) {
|
|
|
3784
3507
|
className: "w-20"
|
|
3785
3508
|
}
|
|
3786
3509
|
),
|
|
3787
|
-
/* @__PURE__ */
|
|
3788
|
-
/* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsxs22(Select, { value: unit, onValueChange: handleUnitChange, children: [
|
|
3511
|
+
/* @__PURE__ */ jsx36(SelectTrigger, { className: "w-24", children: /* @__PURE__ */ jsx36(SelectValue, {}) }),
|
|
3512
|
+
/* @__PURE__ */ jsx36(SelectContent, { children: unitOptions.map((opt) => /* @__PURE__ */ jsx36(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
3790
3513
|
] })
|
|
3791
3514
|
] });
|
|
3792
3515
|
}
|
|
3793
3516
|
|
|
3794
3517
|
// components/form-controls/filter-combobox.tsx
|
|
3795
|
-
import { useState as
|
|
3518
|
+
import { useState as useState4 } from "react";
|
|
3796
3519
|
import { CheckIcon as CheckIcon4 } from "@radix-ui/react-icons";
|
|
3797
3520
|
|
|
3521
|
+
// components/ui/badge.tsx
|
|
3522
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
3523
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3524
|
+
var badgeVariants = cva4(
|
|
3525
|
+
"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",
|
|
3526
|
+
{
|
|
3527
|
+
variants: {
|
|
3528
|
+
variant: {
|
|
3529
|
+
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
3530
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3531
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
3532
|
+
outline: "text-foreground"
|
|
3533
|
+
}
|
|
3534
|
+
},
|
|
3535
|
+
defaultVariants: {
|
|
3536
|
+
variant: "default"
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
);
|
|
3540
|
+
function Badge({ className, variant, ...props }) {
|
|
3541
|
+
return /* @__PURE__ */ jsx37("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3798
3544
|
// components/ui/separator.tsx
|
|
3799
3545
|
import * as React22 from "react";
|
|
3800
3546
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3801
|
-
import { jsx as
|
|
3547
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3802
3548
|
var Separator3 = React22.forwardRef(
|
|
3803
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */
|
|
3549
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3804
3550
|
SeparatorPrimitive.Root,
|
|
3805
3551
|
{
|
|
3806
3552
|
ref,
|
|
@@ -3818,9 +3564,9 @@ var Separator3 = React22.forwardRef(
|
|
|
3818
3564
|
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
3819
3565
|
|
|
3820
3566
|
// components/form-controls/filter-combobox.tsx
|
|
3821
|
-
import { Fragment as
|
|
3567
|
+
import { Fragment as Fragment4, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3822
3568
|
function FilterCombobox({ title, options, clearLabel }) {
|
|
3823
|
-
const [selectedValues, setSelectedValues] =
|
|
3569
|
+
const [selectedValues, setSelectedValues] = useState4([]);
|
|
3824
3570
|
const handleValueSelect = (value) => {
|
|
3825
3571
|
if (selectedValues.some((v) => v.value === value.value)) {
|
|
3826
3572
|
setSelectedValues(selectedValues.filter((v) => v.value !== value.value));
|
|
@@ -3828,13 +3574,13 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3828
3574
|
setSelectedValues([...selectedValues, value]);
|
|
3829
3575
|
}
|
|
3830
3576
|
};
|
|
3831
|
-
return /* @__PURE__ */
|
|
3832
|
-
/* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
3577
|
+
return /* @__PURE__ */ jsxs23(Popover, { children: [
|
|
3578
|
+
/* @__PURE__ */ jsx39(PopoverTrigger, { asChild: true, className: "w-fit", children: /* @__PURE__ */ jsxs23(Button, { variant: "outline", size: "sm", className: "h-8 border-dashed", children: [
|
|
3579
|
+
/* @__PURE__ */ jsx39(Icon, { name: "CirclePlus", className: "h-4 w-4 mr-2" }),
|
|
3834
3580
|
title,
|
|
3835
|
-
selectedValues?.length > 0 && /* @__PURE__ */
|
|
3836
|
-
/* @__PURE__ */
|
|
3837
|
-
/* @__PURE__ */
|
|
3581
|
+
selectedValues?.length > 0 && /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2 ml-2", children: [
|
|
3582
|
+
/* @__PURE__ */ jsx39(Separator3, { orientation: "vertical", className: "h-4" }),
|
|
3583
|
+
/* @__PURE__ */ jsx39(Fragment4, { children: selectedValues.length > 2 ? /* @__PURE__ */ jsxs23(
|
|
3838
3584
|
Badge,
|
|
3839
3585
|
{
|
|
3840
3586
|
variant: "secondary",
|
|
@@ -3846,7 +3592,7 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3846
3592
|
}
|
|
3847
3593
|
) : options.filter(
|
|
3848
3594
|
(option) => selectedValues.some((item) => item.value === option.value)
|
|
3849
|
-
).map((option) => /* @__PURE__ */
|
|
3595
|
+
).map((option) => /* @__PURE__ */ jsx39(
|
|
3850
3596
|
Badge,
|
|
3851
3597
|
{
|
|
3852
3598
|
variant: "secondary",
|
|
@@ -3857,40 +3603,40 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3857
3603
|
)) })
|
|
3858
3604
|
] })
|
|
3859
3605
|
] }) }),
|
|
3860
|
-
/* @__PURE__ */
|
|
3861
|
-
/* @__PURE__ */
|
|
3862
|
-
/* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */
|
|
3864
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ jsx39(PopoverContent, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ jsxs23(Command, { children: [
|
|
3607
|
+
/* @__PURE__ */ jsx39(CommandInput, { placeholder: title }),
|
|
3608
|
+
/* @__PURE__ */ jsxs23(CommandList, { children: [
|
|
3609
|
+
/* @__PURE__ */ jsx39(CommandEmpty, { children: "No results found." }),
|
|
3610
|
+
/* @__PURE__ */ jsx39(CommandGroup, { children: options.map((option) => {
|
|
3865
3611
|
const isSelected = selectedValues.some(
|
|
3866
3612
|
(item) => item.value === option.value
|
|
3867
3613
|
);
|
|
3868
|
-
return /* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ jsxs23(
|
|
3869
3615
|
CommandItem,
|
|
3870
3616
|
{
|
|
3871
3617
|
onSelect: () => handleValueSelect(option),
|
|
3872
3618
|
className: "cursor-pointer",
|
|
3873
3619
|
children: [
|
|
3874
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsx39(
|
|
3875
3621
|
"div",
|
|
3876
3622
|
{
|
|
3877
3623
|
className: cn(
|
|
3878
3624
|
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
|
|
3879
3625
|
isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
|
|
3880
3626
|
),
|
|
3881
|
-
children: /* @__PURE__ */
|
|
3627
|
+
children: /* @__PURE__ */ jsx39(CheckIcon4, { className: cn("h-4 w-4") })
|
|
3882
3628
|
}
|
|
3883
3629
|
),
|
|
3884
|
-
option?.icon && /* @__PURE__ */
|
|
3885
|
-
/* @__PURE__ */
|
|
3630
|
+
option?.icon && /* @__PURE__ */ jsx39(Icon, { name: option?.icon, className: "mr-2 h-4 w-4 text-muted-foreground" }),
|
|
3631
|
+
/* @__PURE__ */ jsx39("span", { children: option.label })
|
|
3886
3632
|
]
|
|
3887
3633
|
},
|
|
3888
3634
|
option.value
|
|
3889
3635
|
);
|
|
3890
3636
|
}) }),
|
|
3891
|
-
selectedValues.length > 0 && /* @__PURE__ */
|
|
3892
|
-
/* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
3637
|
+
selectedValues.length > 0 && /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
3638
|
+
/* @__PURE__ */ jsx39(CommandSeparator, {}),
|
|
3639
|
+
/* @__PURE__ */ jsx39(CommandGroup, { children: /* @__PURE__ */ jsx39(
|
|
3894
3640
|
CommandItem,
|
|
3895
3641
|
{
|
|
3896
3642
|
onSelect: () => setSelectedValues([]),
|
|
@@ -3905,7 +3651,7 @@ function FilterCombobox({ title, options, clearLabel }) {
|
|
|
3905
3651
|
}
|
|
3906
3652
|
|
|
3907
3653
|
// components/form-controls/form-combobox.tsx
|
|
3908
|
-
import { jsx as
|
|
3654
|
+
import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3909
3655
|
function FormCombobox({
|
|
3910
3656
|
title,
|
|
3911
3657
|
name,
|
|
@@ -3914,15 +3660,15 @@ function FormCombobox({
|
|
|
3914
3660
|
data,
|
|
3915
3661
|
label
|
|
3916
3662
|
}) {
|
|
3917
|
-
return /* @__PURE__ */
|
|
3663
|
+
return /* @__PURE__ */ jsx40(
|
|
3918
3664
|
FormField,
|
|
3919
3665
|
{
|
|
3920
3666
|
control,
|
|
3921
3667
|
name,
|
|
3922
3668
|
rules,
|
|
3923
|
-
render: ({ field }) => /* @__PURE__ */
|
|
3924
|
-
title && /* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
3669
|
+
render: ({ field }) => /* @__PURE__ */ jsxs24(FormItem, { children: [
|
|
3670
|
+
title && /* @__PURE__ */ jsx40(FormLabel, { children: title }),
|
|
3671
|
+
/* @__PURE__ */ jsx40(FormControl, { children: /* @__PURE__ */ jsx40(
|
|
3926
3672
|
Combobox,
|
|
3927
3673
|
{
|
|
3928
3674
|
label,
|
|
@@ -3931,7 +3677,7 @@ function FormCombobox({
|
|
|
3931
3677
|
onChange: (value) => field.onChange(value)
|
|
3932
3678
|
}
|
|
3933
3679
|
) }),
|
|
3934
|
-
/* @__PURE__ */
|
|
3680
|
+
/* @__PURE__ */ jsx40(FormMessage, {})
|
|
3935
3681
|
] })
|
|
3936
3682
|
}
|
|
3937
3683
|
);
|
|
@@ -3939,7 +3685,7 @@ function FormCombobox({
|
|
|
3939
3685
|
|
|
3940
3686
|
// components/form-controls/form-layout.tsx
|
|
3941
3687
|
import { FormProvider as FormProvider2 } from "react-hook-form";
|
|
3942
|
-
import { jsx as
|
|
3688
|
+
import { jsx as jsx41, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3943
3689
|
function FormLayout({
|
|
3944
3690
|
children,
|
|
3945
3691
|
formTitle,
|
|
@@ -3951,34 +3697,34 @@ function FormLayout({
|
|
|
3951
3697
|
PrimaryActionText,
|
|
3952
3698
|
CancelText
|
|
3953
3699
|
}) {
|
|
3954
|
-
return /* @__PURE__ */
|
|
3955
|
-
/* @__PURE__ */
|
|
3956
|
-
/* @__PURE__ */
|
|
3957
|
-
/* @__PURE__ */
|
|
3958
|
-
/* @__PURE__ */
|
|
3700
|
+
return /* @__PURE__ */ jsx41(FormProvider2, { ...form, children: /* @__PURE__ */ jsxs25("form", { onSubmit: onSave, className: `flex flex-col gap-6 ${className}`, children: [
|
|
3701
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between w-full border-b pb-6 border-border", children: [
|
|
3702
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-col", children: [
|
|
3703
|
+
/* @__PURE__ */ jsx41("p", { className: "font-semibold text-lg", children: formTitle }),
|
|
3704
|
+
/* @__PURE__ */ jsx41("p", { className: "text-gray-500", children: formDescription })
|
|
3959
3705
|
] }),
|
|
3960
|
-
/* @__PURE__ */
|
|
3961
|
-
/* @__PURE__ */
|
|
3962
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
3707
|
+
/* @__PURE__ */ jsx41(Button2, { type: "button", onClick: onCanel, variant: "secondary", children: CancelText }),
|
|
3708
|
+
/* @__PURE__ */ jsx41(Button2, { type: "submit", children: PrimaryActionText })
|
|
3963
3709
|
] })
|
|
3964
3710
|
] }),
|
|
3965
3711
|
children,
|
|
3966
|
-
/* @__PURE__ */
|
|
3967
|
-
/* @__PURE__ */
|
|
3968
|
-
/* @__PURE__ */
|
|
3712
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
3713
|
+
/* @__PURE__ */ jsx41(Button2, { type: "button", onClick: onCanel, variant: "secondary", children: CancelText }),
|
|
3714
|
+
/* @__PURE__ */ jsx41(Button2, { type: "submit", children: PrimaryActionText })
|
|
3969
3715
|
] })
|
|
3970
3716
|
] }) });
|
|
3971
3717
|
}
|
|
3972
3718
|
|
|
3973
3719
|
// components/form-controls/form-row.tsx
|
|
3974
|
-
import { jsx as
|
|
3720
|
+
import { jsx as jsx42, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3975
3721
|
function FormRow({ children, title, description }) {
|
|
3976
|
-
return /* @__PURE__ */
|
|
3977
|
-
/* @__PURE__ */
|
|
3978
|
-
/* @__PURE__ */
|
|
3979
|
-
/* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ jsxs26("div", { className: "grid grid-cols-3 w-full border-b pb-6 border-border", children: [
|
|
3723
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col", children: [
|
|
3724
|
+
/* @__PURE__ */ jsx42("p", { className: "font-medium", children: title }),
|
|
3725
|
+
/* @__PURE__ */ jsx42("p", { className: "text-gray-500 text-sm", children: description })
|
|
3980
3726
|
] }),
|
|
3981
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ jsx42("div", { className: "col-span-2 w-[80%]", children })
|
|
3982
3728
|
] });
|
|
3983
3729
|
}
|
|
3984
3730
|
|
|
@@ -3986,9 +3732,9 @@ function FormRow({ children, title, description }) {
|
|
|
3986
3732
|
import * as React23 from "react";
|
|
3987
3733
|
import { CheckIcon as CheckIcon5 } from "@radix-ui/react-icons";
|
|
3988
3734
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3989
|
-
import { jsx as
|
|
3735
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3990
3736
|
var RadioGroup2 = React23.forwardRef(({ className, ...props }, ref) => {
|
|
3991
|
-
return /* @__PURE__ */
|
|
3737
|
+
return /* @__PURE__ */ jsx43(
|
|
3992
3738
|
RadioGroupPrimitive.Root,
|
|
3993
3739
|
{
|
|
3994
3740
|
className: cn("grid gap-2", className),
|
|
@@ -3999,7 +3745,7 @@ var RadioGroup2 = React23.forwardRef(({ className, ...props }, ref) => {
|
|
|
3999
3745
|
});
|
|
4000
3746
|
RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4001
3747
|
var RadioGroupItem = React23.forwardRef(({ className, ...props }, ref) => {
|
|
4002
|
-
return /* @__PURE__ */
|
|
3748
|
+
return /* @__PURE__ */ jsx43(
|
|
4003
3749
|
RadioGroupPrimitive.Item,
|
|
4004
3750
|
{
|
|
4005
3751
|
ref,
|
|
@@ -4008,7 +3754,7 @@ var RadioGroupItem = React23.forwardRef(({ className, ...props }, ref) => {
|
|
|
4008
3754
|
className
|
|
4009
3755
|
),
|
|
4010
3756
|
...props,
|
|
4011
|
-
children: /* @__PURE__ */
|
|
3757
|
+
children: /* @__PURE__ */ jsx43(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx43(CheckIcon5, { className: "h-3.5 w-3.5 fill-primary" }) })
|
|
4012
3758
|
}
|
|
4013
3759
|
);
|
|
4014
3760
|
});
|
|
@@ -4019,11 +3765,11 @@ import * as React24 from "react";
|
|
|
4019
3765
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4020
3766
|
import { Cross2Icon as Cross2Icon2 } from "@radix-ui/react-icons";
|
|
4021
3767
|
import { cva as cva5 } from "class-variance-authority";
|
|
4022
|
-
import { jsx as
|
|
3768
|
+
import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4023
3769
|
var Sheet = SheetPrimitive.Root;
|
|
4024
3770
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
4025
3771
|
var SheetPortal = SheetPrimitive.Portal;
|
|
4026
|
-
var SheetOverlay = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3772
|
+
var SheetOverlay = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
4027
3773
|
SheetPrimitive.Overlay,
|
|
4028
3774
|
{
|
|
4029
3775
|
className: cn(
|
|
@@ -4051,18 +3797,18 @@ var sheetVariants = cva5(
|
|
|
4051
3797
|
}
|
|
4052
3798
|
}
|
|
4053
3799
|
);
|
|
4054
|
-
var SheetContent = React24.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */
|
|
4055
|
-
/* @__PURE__ */
|
|
4056
|
-
/* @__PURE__ */
|
|
3800
|
+
var SheetContent = React24.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs27(SheetPortal, { children: [
|
|
3801
|
+
/* @__PURE__ */ jsx44(SheetOverlay, {}),
|
|
3802
|
+
/* @__PURE__ */ jsxs27(
|
|
4057
3803
|
SheetPrimitive.Content,
|
|
4058
3804
|
{
|
|
4059
3805
|
ref,
|
|
4060
3806
|
className: cn(sheetVariants({ side }), className),
|
|
4061
3807
|
...props,
|
|
4062
3808
|
children: [
|
|
4063
|
-
/* @__PURE__ */
|
|
4064
|
-
/* @__PURE__ */
|
|
4065
|
-
/* @__PURE__ */
|
|
3809
|
+
/* @__PURE__ */ jsxs27(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: [
|
|
3810
|
+
/* @__PURE__ */ jsx44(Cross2Icon2, { className: "h-4 w-4" }),
|
|
3811
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "Close" })
|
|
4066
3812
|
] }),
|
|
4067
3813
|
children
|
|
4068
3814
|
]
|
|
@@ -4073,7 +3819,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
4073
3819
|
var SheetHeader = ({
|
|
4074
3820
|
className,
|
|
4075
3821
|
...props
|
|
4076
|
-
}) => /* @__PURE__ */
|
|
3822
|
+
}) => /* @__PURE__ */ jsx44(
|
|
4077
3823
|
"div",
|
|
4078
3824
|
{
|
|
4079
3825
|
className: cn(
|
|
@@ -4087,7 +3833,7 @@ SheetHeader.displayName = "SheetHeader";
|
|
|
4087
3833
|
var SheetFooter = ({
|
|
4088
3834
|
className,
|
|
4089
3835
|
...props
|
|
4090
|
-
}) => /* @__PURE__ */
|
|
3836
|
+
}) => /* @__PURE__ */ jsx44(
|
|
4091
3837
|
"div",
|
|
4092
3838
|
{
|
|
4093
3839
|
className: cn(
|
|
@@ -4098,7 +3844,7 @@ var SheetFooter = ({
|
|
|
4098
3844
|
}
|
|
4099
3845
|
);
|
|
4100
3846
|
SheetFooter.displayName = "SheetFooter";
|
|
4101
|
-
var SheetTitle = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3847
|
+
var SheetTitle = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
4102
3848
|
SheetPrimitive.Title,
|
|
4103
3849
|
{
|
|
4104
3850
|
ref,
|
|
@@ -4107,7 +3853,7 @@ var SheetTitle = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
4107
3853
|
}
|
|
4108
3854
|
));
|
|
4109
3855
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
4110
|
-
var SheetDescription = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3856
|
+
var SheetDescription = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
4111
3857
|
SheetPrimitive.Description,
|
|
4112
3858
|
{
|
|
4113
3859
|
ref,
|
|
@@ -4119,10 +3865,10 @@ SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
|
4119
3865
|
|
|
4120
3866
|
// components/ui/textarea.tsx
|
|
4121
3867
|
import * as React25 from "react";
|
|
4122
|
-
import { jsx as
|
|
3868
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4123
3869
|
var Textarea = React25.forwardRef(
|
|
4124
3870
|
({ className, ...props }, ref) => {
|
|
4125
|
-
return /* @__PURE__ */
|
|
3871
|
+
return /* @__PURE__ */ jsx45(
|
|
4126
3872
|
"textarea",
|
|
4127
3873
|
{
|
|
4128
3874
|
className: cn(
|
|
@@ -4140,11 +3886,11 @@ Textarea.displayName = "Textarea";
|
|
|
4140
3886
|
// components/ui/tooltip.tsx
|
|
4141
3887
|
import * as React26 from "react";
|
|
4142
3888
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4143
|
-
import { jsx as
|
|
3889
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4144
3890
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4145
3891
|
var Tooltip = TooltipPrimitive.Root;
|
|
4146
3892
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4147
|
-
var TooltipContent = React26.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
3893
|
+
var TooltipContent = React26.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4148
3894
|
TooltipPrimitive.Content,
|
|
4149
3895
|
{
|
|
4150
3896
|
ref,
|
|
@@ -4161,7 +3907,7 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
|
4161
3907
|
// components/ui/chart.tsx
|
|
4162
3908
|
import * as React27 from "react";
|
|
4163
3909
|
import * as RechartsPrimitive from "recharts";
|
|
4164
|
-
import { Fragment as
|
|
3910
|
+
import { Fragment as Fragment5, jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4165
3911
|
var THEMES = { light: "", dark: ".dark" };
|
|
4166
3912
|
var ChartContext = React27.createContext(null);
|
|
4167
3913
|
function useChart() {
|
|
@@ -4174,7 +3920,7 @@ function useChart() {
|
|
|
4174
3920
|
var ChartContainer = React27.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
4175
3921
|
const uniqueId = React27.useId();
|
|
4176
3922
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
4177
|
-
return /* @__PURE__ */
|
|
3923
|
+
return /* @__PURE__ */ jsx47(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs28(
|
|
4178
3924
|
"div",
|
|
4179
3925
|
{
|
|
4180
3926
|
"data-chart": chartId,
|
|
@@ -4185,8 +3931,8 @@ var ChartContainer = React27.forwardRef(({ id, className, children, config, ...p
|
|
|
4185
3931
|
),
|
|
4186
3932
|
...props,
|
|
4187
3933
|
children: [
|
|
4188
|
-
/* @__PURE__ */
|
|
4189
|
-
/* @__PURE__ */
|
|
3934
|
+
/* @__PURE__ */ jsx47(ChartStyle, { id: chartId, config }),
|
|
3935
|
+
/* @__PURE__ */ jsx47(RechartsPrimitive.ResponsiveContainer, { children })
|
|
4190
3936
|
]
|
|
4191
3937
|
}
|
|
4192
3938
|
) });
|
|
@@ -4199,7 +3945,7 @@ var ChartStyle = ({ id, config }) => {
|
|
|
4199
3945
|
if (!colorConfig.length) {
|
|
4200
3946
|
return null;
|
|
4201
3947
|
}
|
|
4202
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsx47(
|
|
4203
3949
|
"style",
|
|
4204
3950
|
{
|
|
4205
3951
|
dangerouslySetInnerHTML: {
|
|
@@ -4243,12 +3989,12 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4243
3989
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
4244
3990
|
const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
|
|
4245
3991
|
if (labelFormatter) {
|
|
4246
|
-
return /* @__PURE__ */
|
|
3992
|
+
return /* @__PURE__ */ jsx47("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
4247
3993
|
}
|
|
4248
3994
|
if (!value) {
|
|
4249
3995
|
return null;
|
|
4250
3996
|
}
|
|
4251
|
-
return /* @__PURE__ */
|
|
3997
|
+
return /* @__PURE__ */ jsx47("div", { className: cn("font-medium", labelClassName), children: value });
|
|
4252
3998
|
}, [
|
|
4253
3999
|
label,
|
|
4254
4000
|
labelFormatter,
|
|
@@ -4262,7 +4008,7 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4262
4008
|
return null;
|
|
4263
4009
|
}
|
|
4264
4010
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
4265
|
-
return /* @__PURE__ */
|
|
4011
|
+
return /* @__PURE__ */ jsxs28(
|
|
4266
4012
|
"div",
|
|
4267
4013
|
{
|
|
4268
4014
|
ref,
|
|
@@ -4272,19 +4018,19 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4272
4018
|
),
|
|
4273
4019
|
children: [
|
|
4274
4020
|
!nestLabel ? tooltipLabel : null,
|
|
4275
|
-
/* @__PURE__ */
|
|
4021
|
+
/* @__PURE__ */ jsx47("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
4276
4022
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
4277
4023
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
4278
4024
|
const indicatorColor = color || item.payload.fill || item.color;
|
|
4279
|
-
return /* @__PURE__ */
|
|
4025
|
+
return /* @__PURE__ */ jsx47(
|
|
4280
4026
|
"div",
|
|
4281
4027
|
{
|
|
4282
4028
|
className: cn(
|
|
4283
4029
|
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
4284
4030
|
indicator === "dot" && "items-center"
|
|
4285
4031
|
),
|
|
4286
|
-
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */
|
|
4287
|
-
itemConfig?.icon ? /* @__PURE__ */
|
|
4032
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs28(Fragment5, { children: [
|
|
4033
|
+
itemConfig?.icon ? /* @__PURE__ */ jsx47(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx47(
|
|
4288
4034
|
"div",
|
|
4289
4035
|
{
|
|
4290
4036
|
className: cn(
|
|
@@ -4302,7 +4048,7 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4302
4048
|
}
|
|
4303
4049
|
}
|
|
4304
4050
|
),
|
|
4305
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsxs28(
|
|
4306
4052
|
"div",
|
|
4307
4053
|
{
|
|
4308
4054
|
className: cn(
|
|
@@ -4310,11 +4056,11 @@ var ChartTooltipContent = React27.forwardRef(
|
|
|
4310
4056
|
nestLabel ? "items-end" : "items-center"
|
|
4311
4057
|
),
|
|
4312
4058
|
children: [
|
|
4313
|
-
/* @__PURE__ */
|
|
4059
|
+
/* @__PURE__ */ jsxs28("div", { className: "grid gap-1.5", children: [
|
|
4314
4060
|
nestLabel ? tooltipLabel : null,
|
|
4315
|
-
/* @__PURE__ */
|
|
4061
|
+
/* @__PURE__ */ jsx47("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })
|
|
4316
4062
|
] }),
|
|
4317
|
-
item.value && /* @__PURE__ */
|
|
4063
|
+
item.value && /* @__PURE__ */ jsx47("span", { className: "font-mono font-medium tabular-nums text-foreground", children: item.value.toLocaleString() })
|
|
4318
4064
|
]
|
|
4319
4065
|
}
|
|
4320
4066
|
)
|
|
@@ -4335,7 +4081,7 @@ var ChartLegendContent = React27.forwardRef(
|
|
|
4335
4081
|
if (!payload?.length) {
|
|
4336
4082
|
return null;
|
|
4337
4083
|
}
|
|
4338
|
-
return /* @__PURE__ */
|
|
4084
|
+
return /* @__PURE__ */ jsx47(
|
|
4339
4085
|
"div",
|
|
4340
4086
|
{
|
|
4341
4087
|
ref,
|
|
@@ -4347,14 +4093,14 @@ var ChartLegendContent = React27.forwardRef(
|
|
|
4347
4093
|
children: payload.map((item) => {
|
|
4348
4094
|
const key = `${nameKey || item.dataKey || "value"}`;
|
|
4349
4095
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
4350
|
-
return /* @__PURE__ */
|
|
4096
|
+
return /* @__PURE__ */ jsxs28(
|
|
4351
4097
|
"div",
|
|
4352
4098
|
{
|
|
4353
4099
|
className: cn(
|
|
4354
4100
|
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
|
|
4355
4101
|
),
|
|
4356
4102
|
children: [
|
|
4357
|
-
itemConfig?.icon && !hideIcon ? /* @__PURE__ */
|
|
4103
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx47(itemConfig.icon, {}) : /* @__PURE__ */ jsx47(
|
|
4358
4104
|
"div",
|
|
4359
4105
|
{
|
|
4360
4106
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
@@ -4391,8 +4137,8 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
4391
4137
|
// components/ui/slider.tsx
|
|
4392
4138
|
import * as React28 from "react";
|
|
4393
4139
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4394
|
-
import { jsx as
|
|
4395
|
-
var Slider = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
4140
|
+
import { jsx as jsx48, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4141
|
+
var Slider = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs29(
|
|
4396
4142
|
SliderPrimitive.Root,
|
|
4397
4143
|
{
|
|
4398
4144
|
ref,
|
|
@@ -4402,15 +4148,15 @@ var Slider = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
4402
4148
|
),
|
|
4403
4149
|
...props,
|
|
4404
4150
|
children: [
|
|
4405
|
-
/* @__PURE__ */
|
|
4406
|
-
/* @__PURE__ */
|
|
4151
|
+
/* @__PURE__ */ jsx48(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20", children: /* @__PURE__ */ jsx48(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
4152
|
+
/* @__PURE__ */ jsx48(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" })
|
|
4407
4153
|
]
|
|
4408
4154
|
}
|
|
4409
4155
|
));
|
|
4410
4156
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
4411
4157
|
|
|
4412
4158
|
// components/form-controls/form-with-action-buttons.tsx
|
|
4413
|
-
import { jsx as
|
|
4159
|
+
import { jsx as jsx49, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4414
4160
|
var FormWithActionButtons = ({
|
|
4415
4161
|
children,
|
|
4416
4162
|
form,
|
|
@@ -4421,10 +4167,10 @@ var FormWithActionButtons = ({
|
|
|
4421
4167
|
secondaryButtonAction,
|
|
4422
4168
|
showSecondaryButton = false
|
|
4423
4169
|
}) => {
|
|
4424
|
-
return /* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ jsx49(Form, { ...form, children: /* @__PURE__ */ jsxs30("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
4425
4171
|
children,
|
|
4426
|
-
/* @__PURE__ */
|
|
4427
|
-
showSecondaryButton && /* @__PURE__ */
|
|
4172
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex justify-end gap-2", children: [
|
|
4173
|
+
showSecondaryButton && /* @__PURE__ */ jsx49(
|
|
4428
4174
|
Button,
|
|
4429
4175
|
{
|
|
4430
4176
|
variant: "link",
|
|
@@ -4433,29 +4179,29 @@ var FormWithActionButtons = ({
|
|
|
4433
4179
|
children: secondaryButtonText
|
|
4434
4180
|
}
|
|
4435
4181
|
),
|
|
4436
|
-
/* @__PURE__ */
|
|
4182
|
+
/* @__PURE__ */ jsx49(Button, { variant: "default", type: "submit", children: primaryButtonText })
|
|
4437
4183
|
] })
|
|
4438
4184
|
] }) });
|
|
4439
4185
|
};
|
|
4440
4186
|
|
|
4441
4187
|
// components/form-controls/helpers.tsx
|
|
4442
4188
|
import { File, FileSpreadsheet, FileText } from "lucide-react";
|
|
4443
|
-
import { jsx as
|
|
4189
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4444
4190
|
var getFileIcon = (fileName) => {
|
|
4445
4191
|
const extensionMatch = fileName.match(/\.([^.]+)$/);
|
|
4446
4192
|
const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;
|
|
4447
|
-
if (!extension) return /* @__PURE__ */
|
|
4193
|
+
if (!extension) return /* @__PURE__ */ jsx50(File, { className: "w-8 h-8 text-gray-500" });
|
|
4448
4194
|
switch (extension) {
|
|
4449
4195
|
case "pdf":
|
|
4450
|
-
return /* @__PURE__ */
|
|
4196
|
+
return /* @__PURE__ */ jsx50(File, { className: "w-8 h-8 text-red-500" });
|
|
4451
4197
|
case "doc":
|
|
4452
4198
|
case "docx":
|
|
4453
|
-
return /* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsx50(FileText, { className: "w-8 h-8 text-blue-500" });
|
|
4454
4200
|
case "xls":
|
|
4455
4201
|
case "xlsx":
|
|
4456
|
-
return /* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ jsx50(FileSpreadsheet, { className: "w-8 h-8 text-green-500" });
|
|
4457
4203
|
default:
|
|
4458
|
-
return /* @__PURE__ */
|
|
4204
|
+
return /* @__PURE__ */ jsx50(File, { className: "w-8 h-8 text-gray-500" });
|
|
4459
4205
|
}
|
|
4460
4206
|
};
|
|
4461
4207
|
var getFileName = (url) => {
|
|
@@ -4465,14 +4211,14 @@ var getFileName = (url) => {
|
|
|
4465
4211
|
};
|
|
4466
4212
|
|
|
4467
4213
|
// components/form-controls/icon-button.tsx
|
|
4468
|
-
import { jsx as
|
|
4214
|
+
import { jsx as jsx51, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4469
4215
|
var IconButton = ({
|
|
4470
4216
|
item,
|
|
4471
4217
|
variant,
|
|
4472
4218
|
onClick,
|
|
4473
4219
|
...props
|
|
4474
4220
|
}) => {
|
|
4475
|
-
return /* @__PURE__ */
|
|
4221
|
+
return /* @__PURE__ */ jsxs31(
|
|
4476
4222
|
Button,
|
|
4477
4223
|
{
|
|
4478
4224
|
type: "button",
|
|
@@ -4481,8 +4227,8 @@ var IconButton = ({
|
|
|
4481
4227
|
onClick,
|
|
4482
4228
|
...props,
|
|
4483
4229
|
children: [
|
|
4484
|
-
/* @__PURE__ */
|
|
4485
|
-
/* @__PURE__ */
|
|
4230
|
+
/* @__PURE__ */ jsx51("span", { className: "w-4 flex items-center justify-center", children: /* @__PURE__ */ jsx51(Icon, { name: item.icon, size: 20, strokeWidth: 1 }) }),
|
|
4231
|
+
/* @__PURE__ */ jsx51("span", { className: "text-sm", children: item.title })
|
|
4486
4232
|
]
|
|
4487
4233
|
}
|
|
4488
4234
|
);
|
|
@@ -4490,7 +4236,7 @@ var IconButton = ({
|
|
|
4490
4236
|
|
|
4491
4237
|
// components/form-controls/input.tsx
|
|
4492
4238
|
import * as React29 from "react";
|
|
4493
|
-
import { jsx as
|
|
4239
|
+
import { jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4494
4240
|
var Input2 = React29.forwardRef(
|
|
4495
4241
|
({
|
|
4496
4242
|
variant = "default",
|
|
@@ -4502,79 +4248,28 @@ var Input2 = React29.forwardRef(
|
|
|
4502
4248
|
rules,
|
|
4503
4249
|
...props
|
|
4504
4250
|
}, ref) => {
|
|
4505
|
-
return isFormField ? /* @__PURE__ */
|
|
4251
|
+
return isFormField ? /* @__PURE__ */ jsx52(
|
|
4506
4252
|
FormField,
|
|
4507
4253
|
{
|
|
4508
4254
|
control,
|
|
4509
4255
|
name,
|
|
4510
4256
|
rules,
|
|
4511
|
-
render: ({ field }) => /* @__PURE__ */
|
|
4512
|
-
title && /* @__PURE__ */
|
|
4513
|
-
/* @__PURE__ */
|
|
4514
|
-
/* @__PURE__ */
|
|
4257
|
+
render: ({ field }) => /* @__PURE__ */ jsxs32(FormItem, { children: [
|
|
4258
|
+
title && /* @__PURE__ */ jsx52(FormLabel, { children: title }),
|
|
4259
|
+
/* @__PURE__ */ jsx52(FormControl, { children: /* @__PURE__ */ jsx52(Input, { className, ...props, ...field }) }),
|
|
4260
|
+
/* @__PURE__ */ jsx52(FormMessage, {})
|
|
4515
4261
|
] })
|
|
4516
4262
|
}
|
|
4517
|
-
) : /* @__PURE__ */
|
|
4263
|
+
) : /* @__PURE__ */ jsx52(Input, { className, ref, ...props });
|
|
4518
4264
|
}
|
|
4519
4265
|
);
|
|
4520
4266
|
Input2.displayName = "Input";
|
|
4521
4267
|
|
|
4522
|
-
// components/form-controls/knowledge-graph-word-cloud.tsx
|
|
4523
|
-
import { useKnowledgeGraphContext } from "@elqnt/kg";
|
|
4524
|
-
import { Loader2 as Loader22 } from "lucide-react";
|
|
4525
|
-
import { Fragment as Fragment7, jsx as jsx54, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4526
|
-
function KnowledgeGraphWordCloud() {
|
|
4527
|
-
const { labels } = useKnowledgeGraphContext();
|
|
4528
|
-
if (!labels || !(labels instanceof Array)) {
|
|
4529
|
-
return null;
|
|
4530
|
-
}
|
|
4531
|
-
const data = labels?.map((item) => {
|
|
4532
|
-
return { text: item?.label, value: item?.count };
|
|
4533
|
-
});
|
|
4534
|
-
return /* @__PURE__ */ jsxs34("div", { className: "rounded-xl border bg-card h-full shadow relative p-5", children: [
|
|
4535
|
-
/* @__PURE__ */ jsx54("p", { className: "capitalize mb-10 font-semibold text-xl", children: "Graph Distribution" }),
|
|
4536
|
-
!data ? /* @__PURE__ */ jsx54("div", { className: "absolute w-full flex justify-end", children: /* @__PURE__ */ jsx54(Loader22, { className: "animate-spin" }) }) : /* @__PURE__ */ jsx54(Fragment7, {})
|
|
4537
|
-
] });
|
|
4538
|
-
}
|
|
4539
|
-
|
|
4540
|
-
// components/form-controls/layout/org-selector.tsx
|
|
4541
|
-
import { useUserContext } from "@elqnt/auth";
|
|
4542
|
-
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
4543
|
-
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4544
|
-
function OrgSelector() {
|
|
4545
|
-
const { user, selectedOrgId, setSelectedOrgId } = useUserContext();
|
|
4546
|
-
const [orgAccess, setOrgAccess] = useState6([]);
|
|
4547
|
-
useEffect4(() => {
|
|
4548
|
-
if (user?.orgAccess) {
|
|
4549
|
-
const formattedOrgAccess = user.orgAccess.filter((org) => org.orgId && org.orgTitle).map((org) => ({
|
|
4550
|
-
value: org.orgId,
|
|
4551
|
-
label: org.orgTitle
|
|
4552
|
-
}));
|
|
4553
|
-
setOrgAccess(formattedOrgAccess);
|
|
4554
|
-
}
|
|
4555
|
-
}, [user]);
|
|
4556
|
-
const handleOrgIdChange = (value) => {
|
|
4557
|
-
setSelectedOrgId?.(value);
|
|
4558
|
-
};
|
|
4559
|
-
if (!user) {
|
|
4560
|
-
return null;
|
|
4561
|
-
}
|
|
4562
|
-
return /* @__PURE__ */ jsx55(
|
|
4563
|
-
Combobox,
|
|
4564
|
-
{
|
|
4565
|
-
defaultValue: selectedOrgId,
|
|
4566
|
-
options: orgAccess,
|
|
4567
|
-
onChange: handleOrgIdChange,
|
|
4568
|
-
label: "Select an Organization"
|
|
4569
|
-
}
|
|
4570
|
-
);
|
|
4571
|
-
}
|
|
4572
|
-
|
|
4573
4268
|
// components/form-controls/layout/page-header.tsx
|
|
4574
4269
|
import { ChevronLeft } from "lucide-react";
|
|
4575
4270
|
import Link from "next/link";
|
|
4576
4271
|
import { useRouter } from "next/navigation";
|
|
4577
|
-
import { jsx as
|
|
4272
|
+
import { jsx as jsx53, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4578
4273
|
function PageHeader({
|
|
4579
4274
|
title,
|
|
4580
4275
|
description,
|
|
@@ -4612,7 +4307,7 @@ function PageHeader({
|
|
|
4612
4307
|
return "justify-between";
|
|
4613
4308
|
}
|
|
4614
4309
|
}
|
|
4615
|
-
return /* @__PURE__ */
|
|
4310
|
+
return /* @__PURE__ */ jsxs33(
|
|
4616
4311
|
"div",
|
|
4617
4312
|
{
|
|
4618
4313
|
className: cn(
|
|
@@ -4620,25 +4315,25 @@ function PageHeader({
|
|
|
4620
4315
|
getJustifyClass()
|
|
4621
4316
|
),
|
|
4622
4317
|
children: [
|
|
4623
|
-
/* @__PURE__ */
|
|
4624
|
-
/* @__PURE__ */
|
|
4625
|
-
goBackLink && /* @__PURE__ */
|
|
4626
|
-
showBack && !goBackLink && /* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ jsxs33("div", { children: [
|
|
4319
|
+
/* @__PURE__ */ jsx53("div", { children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
4320
|
+
goBackLink && /* @__PURE__ */ jsx53(Link, { href: goBackLink, children: /* @__PURE__ */ jsx53(ChevronLeft, { className: "h-4 w-4" }) }),
|
|
4321
|
+
showBack && !goBackLink && /* @__PURE__ */ jsx53(
|
|
4627
4322
|
"button",
|
|
4628
4323
|
{
|
|
4629
4324
|
onClick: handleBack,
|
|
4630
4325
|
className: "h-8 w-8 p-0 flex items-center justify-center rounded-md border border-gray-200 hover:bg-gray-50 transition-colors",
|
|
4631
|
-
children: /* @__PURE__ */
|
|
4326
|
+
children: /* @__PURE__ */ jsx53(ChevronLeft, { className: "h-4 w-4" })
|
|
4632
4327
|
}
|
|
4633
4328
|
),
|
|
4634
|
-
titleComponent ?? (title && /* @__PURE__ */
|
|
4329
|
+
titleComponent ?? (title && /* @__PURE__ */ jsx53("h2", { className: "font-semibold text-lg text-primary p-0 m-0", children: title }))
|
|
4635
4330
|
] }) }),
|
|
4636
|
-
description && /* @__PURE__ */
|
|
4331
|
+
description && /* @__PURE__ */ jsx53("p", { className: "text-sm text-gray-500", children: description })
|
|
4637
4332
|
] }),
|
|
4638
|
-
/* @__PURE__ */
|
|
4333
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex gap-2 items-center", children: [
|
|
4639
4334
|
rightSideComponent,
|
|
4640
4335
|
actions?.map(
|
|
4641
|
-
(action, index) => action.href ? /* @__PURE__ */
|
|
4336
|
+
(action, index) => action.href ? /* @__PURE__ */ jsx53(Link, { href: action.href, children: /* @__PURE__ */ jsx53(Button2, { variant: action.type, children: action.label }) }, index) : /* @__PURE__ */ jsx53(Button2, { variant: action.type, onClick: action.onAction, children: action.label }, index)
|
|
4642
4337
|
)
|
|
4643
4338
|
] })
|
|
4644
4339
|
]
|
|
@@ -4646,17 +4341,11 @@ function PageHeader({
|
|
|
4646
4341
|
);
|
|
4647
4342
|
}
|
|
4648
4343
|
|
|
4649
|
-
// components/form-controls/layout/left-nav.tsx
|
|
4650
|
-
import { useUserContext as useUserContext2 } from "@elqnt/auth";
|
|
4651
|
-
import Link3 from "next/link";
|
|
4652
|
-
import { usePathname, useRouter as useRouter3 } from "next/navigation";
|
|
4653
|
-
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
4654
|
-
|
|
4655
4344
|
// components/form-controls/layout/profile-menu.tsx
|
|
4656
4345
|
import { signOut } from "next-auth/react";
|
|
4657
4346
|
import Link2 from "next/link";
|
|
4658
4347
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
4659
|
-
import { jsx as
|
|
4348
|
+
import { jsx as jsx54, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4660
4349
|
function ProfileMenu({ children, pathName }) {
|
|
4661
4350
|
const router = useRouter2();
|
|
4662
4351
|
const handleSignOut = async () => {
|
|
@@ -4678,9 +4367,9 @@ function ProfileMenu({ children, pathName }) {
|
|
|
4678
4367
|
onClick: handleSignOut
|
|
4679
4368
|
}
|
|
4680
4369
|
];
|
|
4681
|
-
return /* @__PURE__ */
|
|
4682
|
-
/* @__PURE__ */
|
|
4683
|
-
/* @__PURE__ */
|
|
4370
|
+
return /* @__PURE__ */ jsxs34(Popover, { children: [
|
|
4371
|
+
/* @__PURE__ */ jsx54(PopoverTrigger, { asChild: true, children }),
|
|
4372
|
+
/* @__PURE__ */ jsx54(PopoverContent, { className: "p-0! flex flex-col", children: links.map((link) => /* @__PURE__ */ jsxs34(
|
|
4684
4373
|
Link2,
|
|
4685
4374
|
{
|
|
4686
4375
|
href: link?.href,
|
|
@@ -4688,7 +4377,7 @@ function ProfileMenu({ children, pathName }) {
|
|
|
4688
4377
|
className: `cursor-pointer w-full hover:bg-primary/10 hover:text-primary p-4 flex items-center gap-4 text-gray-500
|
|
4689
4378
|
${pathName.includes(link?.href) && "bg-primary/10 text-primary"}`,
|
|
4690
4379
|
children: [
|
|
4691
|
-
/* @__PURE__ */
|
|
4380
|
+
/* @__PURE__ */ jsx54(Icon, { name: link?.icon, size: 20 }),
|
|
4692
4381
|
link?.title
|
|
4693
4382
|
]
|
|
4694
4383
|
},
|
|
@@ -4697,188 +4386,10 @@ function ProfileMenu({ children, pathName }) {
|
|
|
4697
4386
|
] });
|
|
4698
4387
|
}
|
|
4699
4388
|
|
|
4700
|
-
// components/form-controls/layout/left-nav.tsx
|
|
4701
|
-
import { Fragment as Fragment8, jsx as jsx58, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4702
|
-
var articles = [
|
|
4703
|
-
{ key: "getting-started", title: "Getting Started", href: "#" },
|
|
4704
|
-
{ key: "helpdesk", title: "Helpdesk", href: "#" }
|
|
4705
|
-
];
|
|
4706
|
-
function LeftNav({
|
|
4707
|
-
fullMenuItems,
|
|
4708
|
-
menuItems,
|
|
4709
|
-
pageTitle,
|
|
4710
|
-
ExpandedLogo,
|
|
4711
|
-
Logo
|
|
4712
|
-
}) {
|
|
4713
|
-
const router = useRouter3();
|
|
4714
|
-
const pathName = usePathname();
|
|
4715
|
-
const { user, selectedOrgId, selectedOrg } = useUserContext2();
|
|
4716
|
-
const [isExpanded, setIsExpanded] = useState7(() => {
|
|
4717
|
-
const stored = localStorage.getItem("isExpanded");
|
|
4718
|
-
return stored === null ? true : stored === "true";
|
|
4719
|
-
});
|
|
4720
|
-
const [apps, setApps] = useState7([]);
|
|
4721
|
-
const [items, setItems] = useState7(menuItems);
|
|
4722
|
-
useEffect5(() => {
|
|
4723
|
-
setItems(menuItems);
|
|
4724
|
-
}, [menuItems]);
|
|
4725
|
-
useEffect5(() => {
|
|
4726
|
-
if (!user || !selectedOrgId || !selectedOrg) return;
|
|
4727
|
-
const orgAccess = user.orgAccess?.find(
|
|
4728
|
-
(org) => org.orgId === selectedOrgId
|
|
4729
|
-
);
|
|
4730
|
-
if (!orgAccess) return;
|
|
4731
|
-
const apps2 = fullMenuItems?.filter(
|
|
4732
|
-
(item) => selectedOrg.apps?.includes(item.key)
|
|
4733
|
-
);
|
|
4734
|
-
setApps(apps2);
|
|
4735
|
-
}, [user, selectedOrgId, selectedOrg]);
|
|
4736
|
-
useEffect5(() => {
|
|
4737
|
-
localStorage.setItem("isExpanded", isExpanded.toString());
|
|
4738
|
-
}, [isExpanded]);
|
|
4739
|
-
return /* @__PURE__ */ jsx58(
|
|
4740
|
-
"div",
|
|
4741
|
-
{
|
|
4742
|
-
style: { height: "calc(100vh - 32px)" },
|
|
4743
|
-
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`,
|
|
4744
|
-
children: /* @__PURE__ */ jsx58(TooltipProvider, { children: /* @__PURE__ */ jsxs37("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: [
|
|
4745
|
-
/* @__PURE__ */ jsxs37(
|
|
4746
|
-
"div",
|
|
4747
|
-
{
|
|
4748
|
-
className: `flex flex-col gap-1 ${!isExpanded && "items-center"}`,
|
|
4749
|
-
children: [
|
|
4750
|
-
/* @__PURE__ */ jsxs37("div", { className: "cursor-pointer flex items-center justify-between mb-4 w-full", children: [
|
|
4751
|
-
/* @__PURE__ */ jsx58(
|
|
4752
|
-
"div",
|
|
4753
|
-
{
|
|
4754
|
-
onClick: () => isExpanded ? router.push("/") : setIsExpanded(true),
|
|
4755
|
-
children: isExpanded ? /* @__PURE__ */ jsx58(ExpandedLogo, {}) : /* @__PURE__ */ jsx58(Logo, {})
|
|
4756
|
-
}
|
|
4757
|
-
),
|
|
4758
|
-
isExpanded && /* @__PURE__ */ jsx58("span", { onClick: () => setIsExpanded(false), children: /* @__PURE__ */ jsx58(Icon2, { name: "ChevronsLeftRight" }) })
|
|
4759
|
-
] }),
|
|
4760
|
-
items ? /* @__PURE__ */ jsxs37(Fragment8, { children: [
|
|
4761
|
-
/* @__PURE__ */ jsxs37(
|
|
4762
|
-
"div",
|
|
4763
|
-
{
|
|
4764
|
-
onClick: () => setItems(void 0),
|
|
4765
|
-
className: "flex items-center px-1 gap-2 cursor-pointer mb-4 text-lg",
|
|
4766
|
-
children: [
|
|
4767
|
-
/* @__PURE__ */ jsx58(Icon2, { name: "ArrowLeft", size: 19 }),
|
|
4768
|
-
isExpanded && /* @__PURE__ */ jsx58("span", { children: pageTitle })
|
|
4769
|
-
]
|
|
4770
|
-
}
|
|
4771
|
-
),
|
|
4772
|
-
menuItems?.map((item) => /* @__PURE__ */ jsx58(
|
|
4773
|
-
Link3,
|
|
4774
|
-
{
|
|
4775
|
-
href: item.href,
|
|
4776
|
-
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"}
|
|
4777
|
-
${item.href && (item.href?.split("/").length > 2 ? pathName?.includes(item.href) ?? "" : pathName === item.href) && isExpanded ? "bg-primary/10 text-primary" : ""}
|
|
4778
|
-
`,
|
|
4779
|
-
children: isExpanded ? /* @__PURE__ */ jsxs37(Fragment8, { children: [
|
|
4780
|
-
/* @__PURE__ */ jsx58(Icon2, { name: item.icon, size: 19 }),
|
|
4781
|
-
/* @__PURE__ */ jsx58("span", { children: item.title })
|
|
4782
|
-
] }) : /* @__PURE__ */ jsxs37(Tooltip, { delayDuration: 0, children: [
|
|
4783
|
-
/* @__PURE__ */ jsx58(TooltipTrigger, { children: /* @__PURE__ */ jsx58(Icon2, { name: item.icon }) }),
|
|
4784
|
-
/* @__PURE__ */ jsx58(TooltipContent, { side: "right", children: /* @__PURE__ */ jsx58("p", { children: item.title }) })
|
|
4785
|
-
] })
|
|
4786
|
-
},
|
|
4787
|
-
item.title
|
|
4788
|
-
))
|
|
4789
|
-
] }) : isExpanded ? /* @__PURE__ */ jsxs37(Fragment8, { children: [
|
|
4790
|
-
/* @__PURE__ */ jsxs37("div", { id: "menu-row", children: [
|
|
4791
|
-
/* @__PURE__ */ jsx58("h2", { className: "text-xl font-semibold", children: "Apps" }),
|
|
4792
|
-
/* @__PURE__ */ jsx58("div", { className: "grid grid-cols-2 gap-2 mt-6", children: apps.filter((item) => item.key !== "home").map((item) => /* @__PURE__ */ jsx58(
|
|
4793
|
-
IconButton,
|
|
4794
|
-
{
|
|
4795
|
-
item,
|
|
4796
|
-
variant: "ghost",
|
|
4797
|
-
onClick: () => {
|
|
4798
|
-
router.push(item.href);
|
|
4799
|
-
setItems(menuItems);
|
|
4800
|
-
}
|
|
4801
|
-
},
|
|
4802
|
-
item.key
|
|
4803
|
-
)) })
|
|
4804
|
-
] }),
|
|
4805
|
-
/* @__PURE__ */ jsxs37("div", { id: "help-row", className: "mt-12 ml-2", children: [
|
|
4806
|
-
/* @__PURE__ */ jsx58("h2", { className: "text-xl font-semibold", children: "Help" }),
|
|
4807
|
-
/* @__PURE__ */ jsx58("div", { className: "mt-6", children: /* @__PURE__ */ jsx58(Input, { placeholder: "Search help content" }) }),
|
|
4808
|
-
/* @__PURE__ */ jsx58("ul", { className: "mt-6 ml-4 list-disc", children: articles.map((item) => /* @__PURE__ */ jsx58("li", { children: /* @__PURE__ */ jsx58(
|
|
4809
|
-
Link3,
|
|
4810
|
-
{
|
|
4811
|
-
href: item.href,
|
|
4812
|
-
className: "block mb-2 underline",
|
|
4813
|
-
onClick: () => setIsExpanded(false),
|
|
4814
|
-
children: item.title
|
|
4815
|
-
}
|
|
4816
|
-
) }, item.key)) })
|
|
4817
|
-
] })
|
|
4818
|
-
] }) : /* @__PURE__ */ jsx58("div", { className: "flex flex-col gap-6 mt-2", children: apps?.map((item) => /* @__PURE__ */ jsxs37(Tooltip, { delayDuration: 0, children: [
|
|
4819
|
-
/* @__PURE__ */ jsx58(TooltipTrigger, { children: /* @__PURE__ */ jsx58(
|
|
4820
|
-
"div",
|
|
4821
|
-
{
|
|
4822
|
-
onClick: () => {
|
|
4823
|
-
router.push(item.href);
|
|
4824
|
-
setItems(menuItems);
|
|
4825
|
-
},
|
|
4826
|
-
children: /* @__PURE__ */ jsx58(Icon2, { name: item.icon })
|
|
4827
|
-
}
|
|
4828
|
-
) }),
|
|
4829
|
-
/* @__PURE__ */ jsx58(TooltipContent, { side: "right", children: /* @__PURE__ */ jsx58("p", { children: item.title }) })
|
|
4830
|
-
] }, item.key)) })
|
|
4831
|
-
]
|
|
4832
|
-
}
|
|
4833
|
-
),
|
|
4834
|
-
/* @__PURE__ */ jsxs37("div", { children: [
|
|
4835
|
-
isExpanded && /* @__PURE__ */ jsx58("div", { className: "mb-2", children: /* @__PURE__ */ jsx58(OrgSelector, {}) }),
|
|
4836
|
-
/* @__PURE__ */ jsxs37(
|
|
4837
|
-
Link3,
|
|
4838
|
-
{
|
|
4839
|
-
href: "/admin/settings",
|
|
4840
|
-
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"}
|
|
4841
|
-
${pathName?.includes("/settings") && isExpanded ? "bg-primary/10 text-primary" : ""}
|
|
4842
|
-
`,
|
|
4843
|
-
children: [
|
|
4844
|
-
/* @__PURE__ */ jsx58(Icon2, { name: "Settings" }),
|
|
4845
|
-
isExpanded && /* @__PURE__ */ jsx58("span", { children: "Settings" })
|
|
4846
|
-
]
|
|
4847
|
-
}
|
|
4848
|
-
),
|
|
4849
|
-
/* @__PURE__ */ jsxs37(
|
|
4850
|
-
Link3,
|
|
4851
|
-
{
|
|
4852
|
-
href: "/admin/help",
|
|
4853
|
-
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"}
|
|
4854
|
-
${pathName?.includes("/help") && isExpanded ? "bg-primary/10 text-primary" : ""}
|
|
4855
|
-
`,
|
|
4856
|
-
children: [
|
|
4857
|
-
/* @__PURE__ */ jsx58(Icon2, { name: "HeartHandshake" }),
|
|
4858
|
-
isExpanded && /* @__PURE__ */ jsx58("span", { children: "Help" })
|
|
4859
|
-
]
|
|
4860
|
-
}
|
|
4861
|
-
),
|
|
4862
|
-
/* @__PURE__ */ jsx58(ProfileMenu, { pathName: pathName ?? "", children: /* @__PURE__ */ jsxs37(
|
|
4863
|
-
"div",
|
|
4864
|
-
{
|
|
4865
|
-
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"}`,
|
|
4866
|
-
children: [
|
|
4867
|
-
/* @__PURE__ */ jsx58(Icon2, { name: "User" }),
|
|
4868
|
-
isExpanded && /* @__PURE__ */ jsx58("span", { children: user?.firstName })
|
|
4869
|
-
]
|
|
4870
|
-
}
|
|
4871
|
-
) })
|
|
4872
|
-
] })
|
|
4873
|
-
] }) })
|
|
4874
|
-
}
|
|
4875
|
-
);
|
|
4876
|
-
}
|
|
4877
|
-
|
|
4878
4389
|
// components/form-controls/multi-select.tsx
|
|
4879
|
-
import { Check as Check2, X
|
|
4880
|
-
import { useState as
|
|
4881
|
-
import { jsx as
|
|
4390
|
+
import { Check as Check2, X } from "lucide-react";
|
|
4391
|
+
import { useState as useState5 } from "react";
|
|
4392
|
+
import { jsx as jsx55, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4882
4393
|
var MultiSelect = ({
|
|
4883
4394
|
defaultValue = [],
|
|
4884
4395
|
placeholder,
|
|
@@ -4886,8 +4397,8 @@ var MultiSelect = ({
|
|
|
4886
4397
|
className = "",
|
|
4887
4398
|
onValueChange
|
|
4888
4399
|
}) => {
|
|
4889
|
-
const [open, setOpen] =
|
|
4890
|
-
const [selectedValues, setSelectedValues] =
|
|
4400
|
+
const [open, setOpen] = useState5(false);
|
|
4401
|
+
const [selectedValues, setSelectedValues] = useState5(defaultValue);
|
|
4891
4402
|
const handleSelect = (value) => {
|
|
4892
4403
|
let updatedValues;
|
|
4893
4404
|
if (selectedValues.includes(value)) {
|
|
@@ -4904,17 +4415,17 @@ var MultiSelect = ({
|
|
|
4904
4415
|
setSelectedValues(updatedValues);
|
|
4905
4416
|
onValueChange(updatedValues);
|
|
4906
4417
|
};
|
|
4907
|
-
return /* @__PURE__ */
|
|
4908
|
-
/* @__PURE__ */
|
|
4418
|
+
return /* @__PURE__ */ jsxs35(Popover, { open, onOpenChange: setOpen, children: [
|
|
4419
|
+
/* @__PURE__ */ jsx55(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
4909
4420
|
Button,
|
|
4910
4421
|
{
|
|
4911
4422
|
variant: "outline",
|
|
4912
4423
|
role: "combobox",
|
|
4913
4424
|
"aria-expanded": open,
|
|
4914
4425
|
className: cn("min-h-10 h-auto w-full justify-between", className),
|
|
4915
|
-
children: /* @__PURE__ */
|
|
4426
|
+
children: /* @__PURE__ */ jsxs35("div", { className: "flex flex-wrap gap-1", children: [
|
|
4916
4427
|
selectedValues.length === 0 && placeholder,
|
|
4917
|
-
selectedValues.map((value) => /* @__PURE__ */
|
|
4428
|
+
selectedValues.map((value) => /* @__PURE__ */ jsxs35(
|
|
4918
4429
|
Badge,
|
|
4919
4430
|
{
|
|
4920
4431
|
variant: "secondary",
|
|
@@ -4922,7 +4433,7 @@ var MultiSelect = ({
|
|
|
4922
4433
|
onClick: (e) => handleClear(value, e),
|
|
4923
4434
|
children: [
|
|
4924
4435
|
options.find((opt) => opt.value === value)?.label,
|
|
4925
|
-
/* @__PURE__ */
|
|
4436
|
+
/* @__PURE__ */ jsx55(X, { className: "ml-1 h-3 w-3" })
|
|
4926
4437
|
]
|
|
4927
4438
|
},
|
|
4928
4439
|
value
|
|
@@ -4930,12 +4441,12 @@ var MultiSelect = ({
|
|
|
4930
4441
|
] })
|
|
4931
4442
|
}
|
|
4932
4443
|
) }),
|
|
4933
|
-
/* @__PURE__ */
|
|
4444
|
+
/* @__PURE__ */ jsx55(PopoverContent, { className: "p-0", children: /* @__PURE__ */ jsx55(Command, { children: /* @__PURE__ */ jsx55(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs35(
|
|
4934
4445
|
CommandItem,
|
|
4935
4446
|
{
|
|
4936
4447
|
onSelect: () => handleSelect(option.value),
|
|
4937
4448
|
children: [
|
|
4938
|
-
/* @__PURE__ */
|
|
4449
|
+
/* @__PURE__ */ jsx55(
|
|
4939
4450
|
Check2,
|
|
4940
4451
|
{
|
|
4941
4452
|
className: cn(
|
|
@@ -4953,18 +4464,18 @@ var MultiSelect = ({
|
|
|
4953
4464
|
};
|
|
4954
4465
|
|
|
4955
4466
|
// components/form-controls/multi-step-process.tsx
|
|
4956
|
-
import { Check as Check3, Loader2 as
|
|
4957
|
-
import { useEffect as
|
|
4958
|
-
import { jsx as
|
|
4467
|
+
import { Check as Check3, Loader2 as Loader22 } from "lucide-react";
|
|
4468
|
+
import { useEffect as useEffect3, useState as useState6 } from "react";
|
|
4469
|
+
import { jsx as jsx56, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4959
4470
|
var MultiStepProcess = ({
|
|
4960
4471
|
initialSteps,
|
|
4961
4472
|
onFinish,
|
|
4962
4473
|
finishButtonText
|
|
4963
4474
|
}) => {
|
|
4964
|
-
const [steps, setSteps] =
|
|
4475
|
+
const [steps, setSteps] = useState6(
|
|
4965
4476
|
initialSteps.map((step) => ({ ...step, isValid: false, isComplete: false }))
|
|
4966
4477
|
);
|
|
4967
|
-
const [currentStepIndex, setCurrentStepIndex] =
|
|
4478
|
+
const [currentStepIndex, setCurrentStepIndex] = useState6(0);
|
|
4968
4479
|
const updateStep = (stepIndex, updates) => {
|
|
4969
4480
|
setSteps(
|
|
4970
4481
|
(prevSteps) => prevSteps.map(
|
|
@@ -4991,7 +4502,7 @@ var MultiStepProcess = ({
|
|
|
4991
4502
|
}
|
|
4992
4503
|
updateStep(currentStepIndex, { isLoading: false });
|
|
4993
4504
|
};
|
|
4994
|
-
|
|
4505
|
+
useEffect3(() => {
|
|
4995
4506
|
const currentStep = steps[currentStepIndex];
|
|
4996
4507
|
if (currentStep.isComplete) {
|
|
4997
4508
|
goToNextStep();
|
|
@@ -5004,7 +4515,7 @@ var MultiStepProcess = ({
|
|
|
5004
4515
|
};
|
|
5005
4516
|
const renderStepComponent = (step, index) => {
|
|
5006
4517
|
const StepComponent = step.component;
|
|
5007
|
-
return /* @__PURE__ */
|
|
4518
|
+
return /* @__PURE__ */ jsx56(
|
|
5008
4519
|
StepComponent,
|
|
5009
4520
|
{
|
|
5010
4521
|
step,
|
|
@@ -5014,23 +4525,23 @@ var MultiStepProcess = ({
|
|
|
5014
4525
|
};
|
|
5015
4526
|
const isLastStep = currentStepIndex === steps.length - 1;
|
|
5016
4527
|
const currentStepData = steps[currentStepIndex];
|
|
5017
|
-
return /* @__PURE__ */
|
|
5018
|
-
/* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
4528
|
+
return /* @__PURE__ */ jsxs36(Card, { className: "p-6", children: [
|
|
4529
|
+
/* @__PURE__ */ jsx56("div", { className: "mb-8", children: /* @__PURE__ */ jsx56("div", { className: "flex justify-between items-start", children: steps.map((step, i) => /* @__PURE__ */ jsxs36("div", { className: "flex flex-col items-center", children: [
|
|
4530
|
+
/* @__PURE__ */ jsx56(
|
|
5020
4531
|
"div",
|
|
5021
4532
|
{
|
|
5022
4533
|
className: `
|
|
5023
4534
|
w-10 h-10 rounded-full flex items-center justify-center mb-2
|
|
5024
4535
|
${i < currentStepIndex ? "bg-green-500 text-white" : i === currentStepIndex ? "bg-blue-500 text-white" : "bg-gray-200 text-gray-500"}
|
|
5025
4536
|
`,
|
|
5026
|
-
children: i < currentStepIndex ? /* @__PURE__ */
|
|
4537
|
+
children: i < currentStepIndex ? /* @__PURE__ */ jsx56(Check3, { className: "w-6 h-6" }) : /* @__PURE__ */ jsx56("span", { children: step.id })
|
|
5027
4538
|
}
|
|
5028
4539
|
),
|
|
5029
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ jsx56("span", { className: "text-sm text-center max-w-[100px]", children: step.title })
|
|
5030
4541
|
] }, i)) }) }),
|
|
5031
|
-
/* @__PURE__ */
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx56("div", { className: "mb-3", children: renderStepComponent(currentStepData, currentStepIndex) }),
|
|
4543
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex justify-between", children: [
|
|
4544
|
+
/* @__PURE__ */ jsx56(
|
|
5034
4545
|
Button,
|
|
5035
4546
|
{
|
|
5036
4547
|
onClick: goToPreviousStep,
|
|
@@ -5039,12 +4550,12 @@ var MultiStepProcess = ({
|
|
|
5039
4550
|
children: "Previous"
|
|
5040
4551
|
}
|
|
5041
4552
|
),
|
|
5042
|
-
/* @__PURE__ */
|
|
4553
|
+
/* @__PURE__ */ jsx56(
|
|
5043
4554
|
Button,
|
|
5044
4555
|
{
|
|
5045
4556
|
onClick: goToNextStep,
|
|
5046
4557
|
disabled: !currentStepData.isValid || currentStepData.isLoading,
|
|
5047
|
-
children: currentStepData.isLoading ? /* @__PURE__ */
|
|
4558
|
+
children: currentStepData.isLoading ? /* @__PURE__ */ jsx56(Loader22, { className: "h-6 w-6 animate-spin" }) : isLastStep ? finishButtonText ?? "Finish" : "Next"
|
|
5048
4559
|
}
|
|
5049
4560
|
)
|
|
5050
4561
|
] })
|
|
@@ -5052,7 +4563,7 @@ var MultiStepProcess = ({
|
|
|
5052
4563
|
};
|
|
5053
4564
|
|
|
5054
4565
|
// components/form-controls/popover.tsx
|
|
5055
|
-
import { jsx as
|
|
4566
|
+
import { jsx as jsx57, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5056
4567
|
var Popover2 = ({
|
|
5057
4568
|
trigger,
|
|
5058
4569
|
children,
|
|
@@ -5060,9 +4571,9 @@ var Popover2 = ({
|
|
|
5060
4571
|
align = "center",
|
|
5061
4572
|
sideOffset = 4
|
|
5062
4573
|
}) => {
|
|
5063
|
-
return /* @__PURE__ */
|
|
5064
|
-
/* @__PURE__ */
|
|
5065
|
-
/* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ jsxs37(Popover, { children: [
|
|
4575
|
+
/* @__PURE__ */ jsx57(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx57("div", { className, children: trigger }) }),
|
|
4576
|
+
/* @__PURE__ */ jsx57(
|
|
5066
4577
|
PopoverContent,
|
|
5067
4578
|
{
|
|
5068
4579
|
align,
|
|
@@ -5076,34 +4587,34 @@ var Popover2 = ({
|
|
|
5076
4587
|
|
|
5077
4588
|
// components/form-controls/radio-group.tsx
|
|
5078
4589
|
import * as React31 from "react";
|
|
5079
|
-
import { jsx as
|
|
4590
|
+
import { jsx as jsx58, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5080
4591
|
var RadioGroup3 = React31.forwardRef(({ className, options, defaultValue, title, name, control, isFormField, ...props }, ref) => {
|
|
5081
4592
|
if (!isFormField) {
|
|
5082
|
-
return /* @__PURE__ */
|
|
5083
|
-
/* @__PURE__ */
|
|
5084
|
-
/* @__PURE__ */
|
|
4593
|
+
return /* @__PURE__ */ jsx58(RadioGroup2, { defaultValue, ...props, ref, children: options?.map((option) => /* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
4594
|
+
/* @__PURE__ */ jsx58(RadioGroupItem, { value: option.value, id: option.value }),
|
|
4595
|
+
/* @__PURE__ */ jsx58("label", { htmlFor: option.value, children: option.label })
|
|
5085
4596
|
] }, option.value)) });
|
|
5086
4597
|
}
|
|
5087
|
-
return /* @__PURE__ */
|
|
4598
|
+
return /* @__PURE__ */ jsx58(
|
|
5088
4599
|
FormField,
|
|
5089
4600
|
{
|
|
5090
4601
|
control,
|
|
5091
4602
|
name,
|
|
5092
|
-
render: ({ field }) => /* @__PURE__ */
|
|
5093
|
-
title && /* @__PURE__ */
|
|
5094
|
-
/* @__PURE__ */
|
|
4603
|
+
render: ({ field }) => /* @__PURE__ */ jsxs38(FormItem, { children: [
|
|
4604
|
+
title && /* @__PURE__ */ jsx58(FormLabel, { children: title }),
|
|
4605
|
+
/* @__PURE__ */ jsx58(FormControl, { children: /* @__PURE__ */ jsx58(
|
|
5095
4606
|
RadioGroup2,
|
|
5096
4607
|
{
|
|
5097
4608
|
onValueChange: field.onChange,
|
|
5098
4609
|
defaultValue: field.value,
|
|
5099
4610
|
...props,
|
|
5100
|
-
children: options?.map((option) => /* @__PURE__ */
|
|
5101
|
-
/* @__PURE__ */
|
|
5102
|
-
/* @__PURE__ */
|
|
4611
|
+
children: options?.map((option) => /* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
4612
|
+
/* @__PURE__ */ jsx58(RadioGroupItem, { value: option.value, id: option.value }),
|
|
4613
|
+
/* @__PURE__ */ jsx58("label", { htmlFor: option.value, children: option.label })
|
|
5103
4614
|
] }, option.value))
|
|
5104
4615
|
}
|
|
5105
4616
|
) }),
|
|
5106
|
-
/* @__PURE__ */
|
|
4617
|
+
/* @__PURE__ */ jsx58(FormMessage, {})
|
|
5107
4618
|
] })
|
|
5108
4619
|
}
|
|
5109
4620
|
);
|
|
@@ -5119,22 +4630,22 @@ import {
|
|
|
5119
4630
|
ScrollAreaThumb as ShadcnScrollAreaThumb,
|
|
5120
4631
|
ScrollAreaCorner as ShadcnScrollAreaCorner
|
|
5121
4632
|
} from "@radix-ui/react-scroll-area";
|
|
5122
|
-
import { jsx as
|
|
5123
|
-
var ScrollArea2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
4633
|
+
import { jsx as jsx59, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4634
|
+
var ScrollArea2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs39(
|
|
5124
4635
|
ShadcnScrollArea,
|
|
5125
4636
|
{
|
|
5126
4637
|
ref,
|
|
5127
4638
|
className: cn("relative overflow-hidden", className),
|
|
5128
4639
|
...props,
|
|
5129
4640
|
children: [
|
|
5130
|
-
/* @__PURE__ */
|
|
5131
|
-
/* @__PURE__ */
|
|
5132
|
-
/* @__PURE__ */
|
|
4641
|
+
/* @__PURE__ */ jsx59(ShadcnScrollAreaViewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
4642
|
+
/* @__PURE__ */ jsx59(ScrollBar2, {}),
|
|
4643
|
+
/* @__PURE__ */ jsx59(ShadcnScrollAreaCorner, {})
|
|
5133
4644
|
]
|
|
5134
4645
|
}
|
|
5135
4646
|
));
|
|
5136
4647
|
ScrollArea2.displayName = ShadcnScrollArea.displayName;
|
|
5137
|
-
var ScrollBar2 = React32.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
4648
|
+
var ScrollBar2 = React32.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx59(
|
|
5138
4649
|
ShadcnScrollAreaScrollbar,
|
|
5139
4650
|
{
|
|
5140
4651
|
ref,
|
|
@@ -5146,13 +4657,13 @@ var ScrollBar2 = React32.forwardRef(({ className, orientation = "vertical", ...p
|
|
|
5146
4657
|
className
|
|
5147
4658
|
),
|
|
5148
4659
|
...props,
|
|
5149
|
-
children: /* @__PURE__ */
|
|
4660
|
+
children: /* @__PURE__ */ jsx59(ShadcnScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
5150
4661
|
}
|
|
5151
4662
|
));
|
|
5152
4663
|
ScrollBar2.displayName = ShadcnScrollAreaScrollbar.displayName;
|
|
5153
4664
|
|
|
5154
4665
|
// components/form-controls/select.tsx
|
|
5155
|
-
import { jsx as
|
|
4666
|
+
import { jsx as jsx60, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5156
4667
|
var Select2 = ({
|
|
5157
4668
|
defaultValue,
|
|
5158
4669
|
placeholder,
|
|
@@ -5160,9 +4671,9 @@ var Select2 = ({
|
|
|
5160
4671
|
className = "",
|
|
5161
4672
|
onValueChange
|
|
5162
4673
|
}) => {
|
|
5163
|
-
return /* @__PURE__ */
|
|
5164
|
-
/* @__PURE__ */
|
|
5165
|
-
/* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ jsxs40(Select, { value: defaultValue, onValueChange, children: [
|
|
4675
|
+
/* @__PURE__ */ jsx60(SelectTrigger, { className, children: /* @__PURE__ */ jsx60(SelectValue, { placeholder }) }),
|
|
4676
|
+
/* @__PURE__ */ jsx60(SelectContent, { children: options?.map((option, i) => /* @__PURE__ */ jsx60(SelectItem, { value: option.value, children: option.label }, i)) })
|
|
5166
4677
|
] });
|
|
5167
4678
|
};
|
|
5168
4679
|
|
|
@@ -5174,8 +4685,8 @@ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
|
5174
4685
|
// components/ui/progress.tsx
|
|
5175
4686
|
import * as React33 from "react";
|
|
5176
4687
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5177
|
-
import { jsx as
|
|
5178
|
-
var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */
|
|
4688
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4689
|
+
var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx61(
|
|
5179
4690
|
ProgressPrimitive.Root,
|
|
5180
4691
|
{
|
|
5181
4692
|
ref,
|
|
@@ -5184,7 +4695,7 @@ var Progress = React33.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
|
5184
4695
|
className
|
|
5185
4696
|
),
|
|
5186
4697
|
...props,
|
|
5187
|
-
children: /* @__PURE__ */
|
|
4698
|
+
children: /* @__PURE__ */ jsx61(
|
|
5188
4699
|
ProgressPrimitive.Indicator,
|
|
5189
4700
|
{
|
|
5190
4701
|
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
@@ -5197,26 +4708,26 @@ Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
|
5197
4708
|
|
|
5198
4709
|
// components/form-controls/setup-guide.tsx
|
|
5199
4710
|
import { Check as Check4 } from "lucide-react";
|
|
5200
|
-
import { useId as useId3, useState as
|
|
5201
|
-
import { jsx as
|
|
4711
|
+
import { useId as useId3, useState as useState7 } from "react";
|
|
4712
|
+
import { jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5202
4713
|
var SetupGuide = ({
|
|
5203
4714
|
onDismiss,
|
|
5204
4715
|
onStepComplete,
|
|
5205
4716
|
items
|
|
5206
4717
|
}) => {
|
|
5207
|
-
const [expanded, setExpanded] =
|
|
4718
|
+
const [expanded, setExpanded] = useState7(
|
|
5208
4719
|
items.findIndex((item) => !item.complete)
|
|
5209
4720
|
);
|
|
5210
|
-
const [isGuideOpen, setIsGuideOpen] =
|
|
4721
|
+
const [isGuideOpen, setIsGuideOpen] = useState7(true);
|
|
5211
4722
|
const accessId = useId3();
|
|
5212
4723
|
const completedItemsLength = items.filter((item) => item.complete).length;
|
|
5213
|
-
return /* @__PURE__ */
|
|
5214
|
-
/* @__PURE__ */
|
|
5215
|
-
completedItemsLength === items.length ? /* @__PURE__ */
|
|
5216
|
-
/* @__PURE__ */
|
|
5217
|
-
/* @__PURE__ */
|
|
5218
|
-
] }) : /* @__PURE__ */
|
|
5219
|
-
completedItemsLength !== items.length && /* @__PURE__ */
|
|
4724
|
+
return /* @__PURE__ */ jsxs41("div", { className: "p-0", children: [
|
|
4725
|
+
/* @__PURE__ */ jsx62("div", { className: "px-4 pb-4", children: /* @__PURE__ */ jsx62("div", { className: "space-y-4", children: /* @__PURE__ */ jsx62("div", { className: "mt-2", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
4726
|
+
completedItemsLength === items.length ? /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
|
|
4727
|
+
/* @__PURE__ */ jsx62(Check4, { className: "h-4 w-4 text-gray-400" }),
|
|
4728
|
+
/* @__PURE__ */ jsx62("span", { className: "text-sm text-gray-400", children: "Done" })
|
|
4729
|
+
] }) : /* @__PURE__ */ jsx62("span", { className: "text-sm", children: `${completedItemsLength} / ${items.length} completed` }),
|
|
4730
|
+
completedItemsLength !== items.length && /* @__PURE__ */ jsx62("div", { className: "w-24", children: /* @__PURE__ */ jsx62(
|
|
5220
4731
|
Progress,
|
|
5221
4732
|
{
|
|
5222
4733
|
value: completedItemsLength / items.length * 100,
|
|
@@ -5224,7 +4735,7 @@ var SetupGuide = ({
|
|
|
5224
4735
|
}
|
|
5225
4736
|
) })
|
|
5226
4737
|
] }) }) }) }),
|
|
5227
|
-
/* @__PURE__ */
|
|
4738
|
+
/* @__PURE__ */ jsx62(Collapsible, { open: isGuideOpen, id: accessId, children: /* @__PURE__ */ jsx62(CollapsibleContent2, { className: "p-2", children: /* @__PURE__ */ jsx62("div", { className: "space-y-1", children: items.map((item) => /* @__PURE__ */ jsx62(
|
|
5228
4739
|
SetupItem,
|
|
5229
4740
|
{
|
|
5230
4741
|
expanded: expanded === item.id,
|
|
@@ -5234,7 +4745,7 @@ var SetupGuide = ({
|
|
|
5234
4745
|
},
|
|
5235
4746
|
item.id
|
|
5236
4747
|
)) }) }) }),
|
|
5237
|
-
completedItemsLength === items.length && /* @__PURE__ */
|
|
4748
|
+
completedItemsLength === items.length && /* @__PURE__ */ jsx62("div", { className: "border-t border-gray-200 bg-gray-50 p-3", children: /* @__PURE__ */ jsx62("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx62(Button, { onClick: onDismiss, children: "Dismiss Guide" }) }) })
|
|
5238
4749
|
] });
|
|
5239
4750
|
};
|
|
5240
4751
|
var SetupItem = ({
|
|
@@ -5249,44 +4760,44 @@ var SetupItem = ({
|
|
|
5249
4760
|
secondaryButton,
|
|
5250
4761
|
id
|
|
5251
4762
|
}) => {
|
|
5252
|
-
const [loading, setLoading] =
|
|
4763
|
+
const [loading, setLoading] = useState7(false);
|
|
5253
4764
|
const completeItem = async () => {
|
|
5254
4765
|
setLoading(true);
|
|
5255
4766
|
await onComplete(id);
|
|
5256
4767
|
setLoading(false);
|
|
5257
4768
|
};
|
|
5258
|
-
return /* @__PURE__ */
|
|
5259
|
-
/* @__PURE__ */
|
|
5260
|
-
/* @__PURE__ */
|
|
4769
|
+
return /* @__PURE__ */ jsx62("div", { className: `rounded ${expanded ? "bg-gray-100" : ""}`, children: /* @__PURE__ */ jsx62("div", { className: `p-2 ${expanded ? "" : "hover:bg-gray-50"}`, children: /* @__PURE__ */ jsxs41("div", { className: "flex gap-2 items-start", children: [
|
|
4770
|
+
/* @__PURE__ */ jsx62(TooltipProvider, { children: /* @__PURE__ */ jsxs41(Tooltip, { children: [
|
|
4771
|
+
/* @__PURE__ */ jsx62(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx62(
|
|
5261
4772
|
Button,
|
|
5262
4773
|
{
|
|
5263
4774
|
variant: "ghost",
|
|
5264
4775
|
size: "icon",
|
|
5265
4776
|
className: "mt-0.5",
|
|
5266
4777
|
onClick: completeItem,
|
|
5267
|
-
children: loading ? /* @__PURE__ */
|
|
4778
|
+
children: loading ? /* @__PURE__ */ jsx62("div", { className: "h-5 w-5 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" }) : complete ? /* @__PURE__ */ jsx62("div", { className: "h-5 w-5 rounded-full bg-gray-900 flex items-center justify-center", children: /* @__PURE__ */ jsx62(Check4, { className: "h-3 w-3 text-white" }) }) : /* @__PURE__ */ jsx62("div", { className: "h-5 w-5 rounded-full border-2 border-gray-300" })
|
|
5268
4779
|
}
|
|
5269
4780
|
) }),
|
|
5270
|
-
/* @__PURE__ */
|
|
4781
|
+
/* @__PURE__ */ jsx62(TooltipContent, { children: complete ? "Mark as not done" : "Mark as done" })
|
|
5271
4782
|
] }) }),
|
|
5272
|
-
/* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ jsx62(
|
|
5273
4784
|
"div",
|
|
5274
4785
|
{
|
|
5275
4786
|
className: `grow ${expanded ? "" : "cursor-pointer"}`,
|
|
5276
4787
|
onClick: expanded ? void 0 : setExpanded,
|
|
5277
|
-
children: /* @__PURE__ */
|
|
5278
|
-
/* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5280
|
-
/* @__PURE__ */
|
|
5281
|
-
(primaryButton || secondaryButton) && /* @__PURE__ */
|
|
5282
|
-
primaryButton && /* @__PURE__ */
|
|
5283
|
-
secondaryButton && /* @__PURE__ */
|
|
4788
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "space-y-3", id: id.toString(), children: [
|
|
4789
|
+
/* @__PURE__ */ jsx62("h4", { className: expanded ? "text-sm font-semibold" : "text-sm", children: title }),
|
|
4790
|
+
/* @__PURE__ */ jsx62(Collapsible, { open: expanded, children: /* @__PURE__ */ jsx62(CollapsibleContent2, { className: "pb-2 pr-2", children: /* @__PURE__ */ jsxs41("div", { className: "space-y-4", children: [
|
|
4791
|
+
/* @__PURE__ */ jsx62("p", { className: "text-sm text-gray-600", children: description }),
|
|
4792
|
+
(primaryButton || secondaryButton) && /* @__PURE__ */ jsxs41("div", { className: "space-x-3", children: [
|
|
4793
|
+
primaryButton && /* @__PURE__ */ jsx62(Button, { ...primaryButton.props, children: primaryButton.content }),
|
|
4794
|
+
secondaryButton && /* @__PURE__ */ jsx62(Button, { variant: "outline", ...secondaryButton.props, children: secondaryButton.content })
|
|
5284
4795
|
] })
|
|
5285
4796
|
] }) }) })
|
|
5286
4797
|
] })
|
|
5287
4798
|
}
|
|
5288
4799
|
),
|
|
5289
|
-
image && expanded && /* @__PURE__ */
|
|
4800
|
+
image && expanded && /* @__PURE__ */ jsx62(
|
|
5290
4801
|
"img",
|
|
5291
4802
|
{
|
|
5292
4803
|
src: image.url,
|
|
@@ -5298,7 +4809,7 @@ var SetupItem = ({
|
|
|
5298
4809
|
};
|
|
5299
4810
|
|
|
5300
4811
|
// components/form-controls/sheet.tsx
|
|
5301
|
-
import { jsx as
|
|
4812
|
+
import { jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5302
4813
|
var Sheet2 = ({
|
|
5303
4814
|
title,
|
|
5304
4815
|
trigger,
|
|
@@ -5306,20 +4817,20 @@ var Sheet2 = ({
|
|
|
5306
4817
|
children,
|
|
5307
4818
|
...props
|
|
5308
4819
|
}) => {
|
|
5309
|
-
return /* @__PURE__ */
|
|
5310
|
-
trigger && /* @__PURE__ */
|
|
5311
|
-
/* @__PURE__ */
|
|
5312
|
-
/* @__PURE__ */
|
|
5313
|
-
/* @__PURE__ */
|
|
4820
|
+
return /* @__PURE__ */ jsxs42(Sheet, { ...props, children: [
|
|
4821
|
+
trigger && /* @__PURE__ */ jsx63(SheetTrigger, { children: trigger }),
|
|
4822
|
+
/* @__PURE__ */ jsx63(SheetContent, { children: /* @__PURE__ */ jsxs42(SheetHeader, { children: [
|
|
4823
|
+
/* @__PURE__ */ jsx63(SheetTitle, { children: title }),
|
|
4824
|
+
/* @__PURE__ */ jsx63(SheetDescription, { children: description }),
|
|
5314
4825
|
children
|
|
5315
4826
|
] }) })
|
|
5316
4827
|
] });
|
|
5317
4828
|
};
|
|
5318
4829
|
|
|
5319
4830
|
// components/form-controls/tags-input.tsx
|
|
5320
|
-
import { X as
|
|
4831
|
+
import { X as X2 } from "lucide-react";
|
|
5321
4832
|
import * as React35 from "react";
|
|
5322
|
-
import { jsx as
|
|
4833
|
+
import { jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5323
4834
|
var TagsInput = React35.forwardRef(
|
|
5324
4835
|
({ variant = "default", className, value, onChange, ...props }, ref) => {
|
|
5325
4836
|
const [inputValue, setInputValue] = React35.useState("");
|
|
@@ -5338,15 +4849,15 @@ var TagsInput = React35.forwardRef(
|
|
|
5338
4849
|
const removeTag = (index) => {
|
|
5339
4850
|
onChange(value.filter((_, i) => i !== index));
|
|
5340
4851
|
};
|
|
5341
|
-
return /* @__PURE__ */
|
|
5342
|
-
value.map((tag, index) => /* @__PURE__ */
|
|
4852
|
+
return /* @__PURE__ */ jsxs43("div", { className: "flex flex-wrap gap-2 p-2 border rounded", children: [
|
|
4853
|
+
value.map((tag, index) => /* @__PURE__ */ jsxs43(
|
|
5343
4854
|
"span",
|
|
5344
4855
|
{
|
|
5345
4856
|
className: "bg-gray-200 px-2 py-1 rounded flex items-center",
|
|
5346
4857
|
children: [
|
|
5347
4858
|
tag,
|
|
5348
|
-
/* @__PURE__ */
|
|
5349
|
-
|
|
4859
|
+
/* @__PURE__ */ jsx64(
|
|
4860
|
+
X2,
|
|
5350
4861
|
{
|
|
5351
4862
|
className: "ml-1 w-4 h-4 cursor-pointer",
|
|
5352
4863
|
onClick: () => removeTag(index)
|
|
@@ -5356,7 +4867,7 @@ var TagsInput = React35.forwardRef(
|
|
|
5356
4867
|
},
|
|
5357
4868
|
index
|
|
5358
4869
|
)),
|
|
5359
|
-
/* @__PURE__ */
|
|
4870
|
+
/* @__PURE__ */ jsx64(
|
|
5360
4871
|
"input",
|
|
5361
4872
|
{
|
|
5362
4873
|
className: "grow border-none focus:ring-0",
|
|
@@ -5374,7 +4885,7 @@ TagsInput.displayName = "TagsInput";
|
|
|
5374
4885
|
|
|
5375
4886
|
// components/form-controls/textarea.tsx
|
|
5376
4887
|
import * as React36 from "react";
|
|
5377
|
-
import { jsx as
|
|
4888
|
+
import { jsx as jsx65, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5378
4889
|
var Textarea2 = React36.forwardRef(
|
|
5379
4890
|
({
|
|
5380
4891
|
variant = "default",
|
|
@@ -5386,15 +4897,15 @@ var Textarea2 = React36.forwardRef(
|
|
|
5386
4897
|
rules,
|
|
5387
4898
|
...props
|
|
5388
4899
|
}, ref) => {
|
|
5389
|
-
return isFormField ? /* @__PURE__ */
|
|
4900
|
+
return isFormField ? /* @__PURE__ */ jsx65(
|
|
5390
4901
|
FormField,
|
|
5391
4902
|
{
|
|
5392
4903
|
control,
|
|
5393
4904
|
name,
|
|
5394
4905
|
rules,
|
|
5395
|
-
render: ({ field }) => /* @__PURE__ */
|
|
5396
|
-
title && /* @__PURE__ */
|
|
5397
|
-
/* @__PURE__ */
|
|
4906
|
+
render: ({ field }) => /* @__PURE__ */ jsxs44(FormItem, { children: [
|
|
4907
|
+
title && /* @__PURE__ */ jsx65(FormLabel, { children: title }),
|
|
4908
|
+
/* @__PURE__ */ jsx65(FormControl, { children: /* @__PURE__ */ jsx65(
|
|
5398
4909
|
Textarea,
|
|
5399
4910
|
{
|
|
5400
4911
|
className: `${className} resize-none`,
|
|
@@ -5402,10 +4913,10 @@ var Textarea2 = React36.forwardRef(
|
|
|
5402
4913
|
...props
|
|
5403
4914
|
}
|
|
5404
4915
|
) }),
|
|
5405
|
-
/* @__PURE__ */
|
|
4916
|
+
/* @__PURE__ */ jsx65(FormMessage, {})
|
|
5406
4917
|
] })
|
|
5407
4918
|
}
|
|
5408
|
-
) : /* @__PURE__ */
|
|
4919
|
+
) : /* @__PURE__ */ jsx65(
|
|
5409
4920
|
Textarea,
|
|
5410
4921
|
{
|
|
5411
4922
|
className: `${className} resize-none`,
|
|
@@ -5419,8 +4930,8 @@ Textarea2.displayName = "Textarea";
|
|
|
5419
4930
|
|
|
5420
4931
|
// components/form-controls/time-picker.tsx
|
|
5421
4932
|
import { Clock } from "lucide-react";
|
|
5422
|
-
import { useState as
|
|
5423
|
-
import { jsx as
|
|
4933
|
+
import { useState as useState9 } from "react";
|
|
4934
|
+
import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
5424
4935
|
var TimePicker = ({
|
|
5425
4936
|
value,
|
|
5426
4937
|
onValueChange,
|
|
@@ -5428,7 +4939,7 @@ var TimePicker = ({
|
|
|
5428
4939
|
className = "",
|
|
5429
4940
|
disabled = false
|
|
5430
4941
|
}) => {
|
|
5431
|
-
const [open, setOpen] =
|
|
4942
|
+
const [open, setOpen] = useState9(false);
|
|
5432
4943
|
const hours = Array.from({ length: 24 }, (_, i) => ({
|
|
5433
4944
|
value: i.toString().padStart(2, "0"),
|
|
5434
4945
|
label: i.toString().padStart(2, "0")
|
|
@@ -5444,21 +4955,21 @@ var TimePicker = ({
|
|
|
5444
4955
|
const handleMinuteChange = (newMinute) => {
|
|
5445
4956
|
onValueChange(`${hour}:${newMinute}`);
|
|
5446
4957
|
};
|
|
5447
|
-
return /* @__PURE__ */
|
|
5448
|
-
/* @__PURE__ */
|
|
4958
|
+
return /* @__PURE__ */ jsxs45(Popover, { open, onOpenChange: setOpen, children: [
|
|
4959
|
+
/* @__PURE__ */ jsx66(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs45(
|
|
5449
4960
|
Button,
|
|
5450
4961
|
{
|
|
5451
4962
|
variant: "outline",
|
|
5452
4963
|
className: `w-full justify-start text-left font-normal ${className}`,
|
|
5453
4964
|
disabled,
|
|
5454
4965
|
children: [
|
|
5455
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ jsx66(Clock, { className: "mr-2 h-4 w-4" }),
|
|
5456
4967
|
value || placeholder
|
|
5457
4968
|
]
|
|
5458
4969
|
}
|
|
5459
4970
|
) }),
|
|
5460
|
-
/* @__PURE__ */
|
|
5461
|
-
/* @__PURE__ */
|
|
4971
|
+
/* @__PURE__ */ jsx66(PopoverContent, { className: "w-auto p-4", align: "start", children: /* @__PURE__ */ jsxs45("div", { className: "flex items-center gap-2", children: [
|
|
4972
|
+
/* @__PURE__ */ jsx66(
|
|
5462
4973
|
Select2,
|
|
5463
4974
|
{
|
|
5464
4975
|
defaultValue: hour,
|
|
@@ -5468,8 +4979,8 @@ var TimePicker = ({
|
|
|
5468
4979
|
className: "w-[80px]"
|
|
5469
4980
|
}
|
|
5470
4981
|
),
|
|
5471
|
-
/* @__PURE__ */
|
|
5472
|
-
/* @__PURE__ */
|
|
4982
|
+
/* @__PURE__ */ jsx66("span", { className: "text-lg", children: ":" }),
|
|
4983
|
+
/* @__PURE__ */ jsx66(
|
|
5473
4984
|
Select2,
|
|
5474
4985
|
{
|
|
5475
4986
|
defaultValue: minute,
|
|
@@ -5484,19 +4995,19 @@ var TimePicker = ({
|
|
|
5484
4995
|
};
|
|
5485
4996
|
|
|
5486
4997
|
// components/form-controls/tooltip.tsx
|
|
5487
|
-
import { jsx as
|
|
4998
|
+
import { jsx as jsx67, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5488
4999
|
var Tooltip3 = ({ children, tipContent }) => {
|
|
5489
|
-
return /* @__PURE__ */
|
|
5490
|
-
/* @__PURE__ */
|
|
5491
|
-
/* @__PURE__ */
|
|
5000
|
+
return /* @__PURE__ */ jsx67(TooltipProvider, { children: /* @__PURE__ */ jsxs46(Tooltip, { delayDuration: 0, children: [
|
|
5001
|
+
/* @__PURE__ */ jsx67(TooltipTrigger, { children }),
|
|
5002
|
+
/* @__PURE__ */ jsx67(TooltipContent, { children: /* @__PURE__ */ jsx67("p", { children: tipContent }) })
|
|
5492
5003
|
] }) });
|
|
5493
5004
|
};
|
|
5494
5005
|
|
|
5495
5006
|
// components/form-controls/upload-widget.tsx
|
|
5496
|
-
import { Loader2 as
|
|
5007
|
+
import { Loader2 as Loader23, Upload } from "lucide-react";
|
|
5497
5008
|
import { useDropzone } from "react-dropzone";
|
|
5498
5009
|
import { toast } from "sonner";
|
|
5499
|
-
import { jsx as
|
|
5010
|
+
import { jsx as jsx68, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5500
5011
|
function UploadWidget({
|
|
5501
5012
|
accept,
|
|
5502
5013
|
maxSize,
|
|
@@ -5528,18 +5039,18 @@ function UploadWidget({
|
|
|
5528
5039
|
maxFiles
|
|
5529
5040
|
};
|
|
5530
5041
|
const { getRootProps, getInputProps, isDragActive } = useDropzone(dropzoneOptions);
|
|
5531
|
-
return /* @__PURE__ */
|
|
5042
|
+
return /* @__PURE__ */ jsxs47(
|
|
5532
5043
|
"div",
|
|
5533
5044
|
{
|
|
5534
5045
|
...getRootProps(),
|
|
5535
5046
|
className: "relative border-2 border-dashed border-gray-300 rounded-lg p-6 text-center cursor-pointer min-h-[160px]",
|
|
5536
5047
|
children: [
|
|
5537
|
-
isUploading && /* @__PURE__ */
|
|
5538
|
-
/* @__PURE__ */
|
|
5539
|
-
isDragActive ? /* @__PURE__ */
|
|
5540
|
-
/* @__PURE__ */
|
|
5541
|
-
/* @__PURE__ */
|
|
5542
|
-
/* @__PURE__ */
|
|
5048
|
+
isUploading && /* @__PURE__ */ jsx68("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ jsx68(Loader23, { className: "animate-spin h-6 w-6 text-primary" }) }),
|
|
5049
|
+
/* @__PURE__ */ jsx68("input", { ...getInputProps() }),
|
|
5050
|
+
isDragActive ? /* @__PURE__ */ jsx68("p", { children: "Drop the files here ..." }) : /* @__PURE__ */ jsxs47("div", { children: [
|
|
5051
|
+
/* @__PURE__ */ jsx68(Upload, { className: "mx-auto h-12 w-12 text-gray-400" }),
|
|
5052
|
+
/* @__PURE__ */ jsx68("p", { children: "Drag n drop some files here, or click to select files" }),
|
|
5053
|
+
/* @__PURE__ */ jsxs47("p", { className: "text-sm text-gray-500", children: [
|
|
5543
5054
|
"Only ",
|
|
5544
5055
|
acceptedTypes,
|
|
5545
5056
|
" files up to ",
|
|
@@ -5547,11 +5058,11 @@ function UploadWidget({
|
|
|
5547
5058
|
"MB are accepted"
|
|
5548
5059
|
] })
|
|
5549
5060
|
] }),
|
|
5550
|
-
fileUrls.length > 0 && /* @__PURE__ */
|
|
5061
|
+
fileUrls.length > 0 && /* @__PURE__ */ jsx68("div", { className: "mt-4 border-t border-gray-300 pt-4", children: /* @__PURE__ */ jsx68("ul", { className: "flex flex-wrap gap-2", children: fileUrls.map((url, i) => {
|
|
5551
5062
|
const fileName = getFileName(url);
|
|
5552
|
-
return /* @__PURE__ */
|
|
5553
|
-
/* @__PURE__ */
|
|
5554
|
-
/* @__PURE__ */
|
|
5063
|
+
return /* @__PURE__ */ jsxs47("li", { className: "flex items-center space-x-2 text-sm", children: [
|
|
5064
|
+
/* @__PURE__ */ jsx68("div", { children: getFileIcon(fileName) }),
|
|
5065
|
+
/* @__PURE__ */ jsx68("span", { children: fileName })
|
|
5555
5066
|
] }, i);
|
|
5556
5067
|
}) }) })
|
|
5557
5068
|
]
|
|
@@ -5562,15 +5073,15 @@ function UploadWidget({
|
|
|
5562
5073
|
// components/general/markdown-renderer.tsx
|
|
5563
5074
|
import ReactMarkdown from "react-markdown";
|
|
5564
5075
|
import remarkGfm from "remark-gfm";
|
|
5565
|
-
import { jsx as
|
|
5076
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
5566
5077
|
function MarkdownRenderer({ content }) {
|
|
5567
|
-
return /* @__PURE__ */
|
|
5078
|
+
return /* @__PURE__ */ jsx69(
|
|
5568
5079
|
ReactMarkdown,
|
|
5569
5080
|
{
|
|
5570
5081
|
remarkPlugins: [remarkGfm],
|
|
5571
5082
|
className: "text-primary-900",
|
|
5572
5083
|
components: {
|
|
5573
|
-
a: ({ node, ...props }) => /* @__PURE__ */
|
|
5084
|
+
a: ({ node, ...props }) => /* @__PURE__ */ jsx69(
|
|
5574
5085
|
"a",
|
|
5575
5086
|
{
|
|
5576
5087
|
target: "_blank",
|
|
@@ -5579,20 +5090,20 @@ function MarkdownRenderer({ content }) {
|
|
|
5579
5090
|
...props
|
|
5580
5091
|
}
|
|
5581
5092
|
),
|
|
5582
|
-
h1: ({ node, ...props }) => /* @__PURE__ */
|
|
5583
|
-
h2: ({ node, ...props }) => /* @__PURE__ */
|
|
5584
|
-
h3: ({ node, ...props }) => /* @__PURE__ */
|
|
5585
|
-
code: ({ node, ...props }) => /* @__PURE__ */
|
|
5093
|
+
h1: ({ node, ...props }) => /* @__PURE__ */ jsx69("h1", { className: "text-2xl font-bold mt-6 mb-4", ...props }),
|
|
5094
|
+
h2: ({ node, ...props }) => /* @__PURE__ */ jsx69("h2", { className: "text-xl font-semibold mt-5 mb-3", ...props }),
|
|
5095
|
+
h3: ({ node, ...props }) => /* @__PURE__ */ jsx69("h3", { className: "text-lg font-semibold mt-4 mb-2", ...props }),
|
|
5096
|
+
code: ({ node, ...props }) => /* @__PURE__ */ jsx69(
|
|
5586
5097
|
"code",
|
|
5587
5098
|
{
|
|
5588
5099
|
className: "block bg-stone-100 p-3 rounded font-mono",
|
|
5589
5100
|
...props
|
|
5590
5101
|
}
|
|
5591
5102
|
),
|
|
5592
|
-
ul: ({ node, ...props }) => /* @__PURE__ */
|
|
5593
|
-
ol: ({ node, ...props }) => /* @__PURE__ */
|
|
5594
|
-
p: ({ node, ...props }) => /* @__PURE__ */
|
|
5595
|
-
blockquote: ({ node, ...props }) => /* @__PURE__ */
|
|
5103
|
+
ul: ({ node, ...props }) => /* @__PURE__ */ jsx69("ul", { className: "list-disc pl-6 my-4", ...props }),
|
|
5104
|
+
ol: ({ node, ...props }) => /* @__PURE__ */ jsx69("ol", { className: "list-decimal pl-6 my-4", ...props }),
|
|
5105
|
+
p: ({ node, ...props }) => /* @__PURE__ */ jsx69("p", { className: "my-4", ...props }),
|
|
5106
|
+
blockquote: ({ node, ...props }) => /* @__PURE__ */ jsx69(
|
|
5596
5107
|
"blockquote",
|
|
5597
5108
|
{
|
|
5598
5109
|
className: "border-l-4 border-stone-200 pl-4 my-4 italic",
|
|
@@ -5606,9 +5117,9 @@ function MarkdownRenderer({ content }) {
|
|
|
5606
5117
|
}
|
|
5607
5118
|
|
|
5608
5119
|
// components/general/chat-loading.tsx
|
|
5609
|
-
import { jsx as
|
|
5120
|
+
import { jsx as jsx70, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5610
5121
|
function ChatLoading() {
|
|
5611
|
-
return /* @__PURE__ */
|
|
5122
|
+
return /* @__PURE__ */ jsxs48(
|
|
5612
5123
|
"svg",
|
|
5613
5124
|
{
|
|
5614
5125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5616,7 +5127,7 @@ function ChatLoading() {
|
|
|
5616
5127
|
width: "60",
|
|
5617
5128
|
height: "15",
|
|
5618
5129
|
children: [
|
|
5619
|
-
/* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ jsx70("circle", { cx: "7.5", cy: "7.5", r: "3.5", fill: "#444444", children: /* @__PURE__ */ jsx70(
|
|
5620
5131
|
"animate",
|
|
5621
5132
|
{
|
|
5622
5133
|
attributeName: "cy",
|
|
@@ -5629,7 +5140,7 @@ function ChatLoading() {
|
|
|
5629
5140
|
values: "7.5;3.5;7.5"
|
|
5630
5141
|
}
|
|
5631
5142
|
) }),
|
|
5632
|
-
/* @__PURE__ */
|
|
5143
|
+
/* @__PURE__ */ jsx70("circle", { cx: "30", cy: "7.5", r: "3.5", fill: "#444444", children: /* @__PURE__ */ jsx70(
|
|
5633
5144
|
"animate",
|
|
5634
5145
|
{
|
|
5635
5146
|
attributeName: "cy",
|
|
@@ -5642,7 +5153,7 @@ function ChatLoading() {
|
|
|
5642
5153
|
values: "7.5;3.5;7.5"
|
|
5643
5154
|
}
|
|
5644
5155
|
) }),
|
|
5645
|
-
/* @__PURE__ */
|
|
5156
|
+
/* @__PURE__ */ jsx70("circle", { cx: "52.5", cy: "7.5", r: "3.5", fill: "#444444", children: /* @__PURE__ */ jsx70(
|
|
5646
5157
|
"animate",
|
|
5647
5158
|
{
|
|
5648
5159
|
attributeName: "cy",
|
|
@@ -5661,10 +5172,10 @@ function ChatLoading() {
|
|
|
5661
5172
|
}
|
|
5662
5173
|
|
|
5663
5174
|
// components/layout/action-bar.tsx
|
|
5664
|
-
import { ArrowLeft, icons as icons3, Loader2 as
|
|
5665
|
-
import { useRouter as
|
|
5175
|
+
import { ArrowLeft, icons as icons3, Loader2 as Loader24 } from "lucide-react";
|
|
5176
|
+
import { useRouter as useRouter3 } from "next/navigation";
|
|
5666
5177
|
import React37 from "react";
|
|
5667
|
-
import { Fragment as
|
|
5178
|
+
import { Fragment as Fragment6, jsx as jsx71, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5668
5179
|
var colorStyles = {
|
|
5669
5180
|
red: "bg-red-50 hover:bg-red-100 text-red-600",
|
|
5670
5181
|
blue: "bg-blue-50 hover:bg-blue-100 text-blue-600",
|
|
@@ -5678,50 +5189,50 @@ function EloquentActionBar({
|
|
|
5678
5189
|
buttons,
|
|
5679
5190
|
title
|
|
5680
5191
|
}) {
|
|
5681
|
-
const router =
|
|
5192
|
+
const router = useRouter3();
|
|
5682
5193
|
const LucideIcons = icons3;
|
|
5683
|
-
return /* @__PURE__ */
|
|
5684
|
-
showBack && /* @__PURE__ */
|
|
5685
|
-
/* @__PURE__ */
|
|
5194
|
+
return /* @__PURE__ */ jsxs49("div", { className: "flex bg-white border-gray-200 border-b border-x rounded-t-lg items-center", children: [
|
|
5195
|
+
showBack && /* @__PURE__ */ jsxs49(Fragment6, { children: [
|
|
5196
|
+
/* @__PURE__ */ jsxs49(
|
|
5686
5197
|
"button",
|
|
5687
5198
|
{
|
|
5688
5199
|
onClick: () => router.back(),
|
|
5689
5200
|
className: "flex items-center px-3 py-2 hover:bg-gray-100 transition-colors",
|
|
5690
5201
|
children: [
|
|
5691
|
-
/* @__PURE__ */
|
|
5692
|
-
/* @__PURE__ */
|
|
5202
|
+
/* @__PURE__ */ jsx71(ArrowLeft, { className: "w-5 h-5 mr-2 text-gray-600" }),
|
|
5203
|
+
/* @__PURE__ */ jsx71("span", { className: "text-gray-600 font-medium", children: "Back" })
|
|
5693
5204
|
]
|
|
5694
5205
|
}
|
|
5695
5206
|
),
|
|
5696
|
-
/* @__PURE__ */
|
|
5207
|
+
/* @__PURE__ */ jsx71(Separator3, { orientation: "vertical", className: "h-full" })
|
|
5697
5208
|
] }),
|
|
5698
|
-
/* @__PURE__ */
|
|
5209
|
+
/* @__PURE__ */ jsx71("div", { className: "flex items-center", children: buttons.map((button, index) => {
|
|
5699
5210
|
const Icon3 = LucideIcons[button.icon];
|
|
5700
|
-
return /* @__PURE__ */
|
|
5701
|
-
/* @__PURE__ */
|
|
5211
|
+
return /* @__PURE__ */ jsxs49(React37.Fragment, { children: [
|
|
5212
|
+
/* @__PURE__ */ jsxs49(
|
|
5702
5213
|
"button",
|
|
5703
5214
|
{
|
|
5704
5215
|
onClick: button.action,
|
|
5705
5216
|
disabled: button.isLoading,
|
|
5706
5217
|
className: `flex items-center px-4 py-2 transition-colors ${colorStyles[button.color]} ${button.isLoading ? "opacity-70 cursor-not-allowed" : ""}`,
|
|
5707
5218
|
children: [
|
|
5708
|
-
button.isLoading ? /* @__PURE__ */
|
|
5709
|
-
/* @__PURE__ */
|
|
5219
|
+
button.isLoading ? /* @__PURE__ */ jsx71(Loader24, { className: "w-5 h-5 mr-2 animate-spin" }) : /* @__PURE__ */ jsx71(Icon3, { className: "w-5 h-5 mr-2" }),
|
|
5220
|
+
/* @__PURE__ */ jsx71("span", { className: "font-medium", children: button.label })
|
|
5710
5221
|
]
|
|
5711
5222
|
}
|
|
5712
5223
|
),
|
|
5713
|
-
index < buttons.length - 1 && /* @__PURE__ */
|
|
5224
|
+
index < buttons.length - 1 && /* @__PURE__ */ jsx71(Separator3, { orientation: "vertical", className: "h-full" })
|
|
5714
5225
|
] }, button.label);
|
|
5715
5226
|
}) }),
|
|
5716
|
-
title && /* @__PURE__ */
|
|
5227
|
+
title && /* @__PURE__ */ jsx71("span", { className: "text-lg", children: title })
|
|
5717
5228
|
] });
|
|
5718
5229
|
}
|
|
5719
5230
|
|
|
5720
5231
|
// components/schema-fields/dropdown-field.tsx
|
|
5721
|
-
import { jsx as
|
|
5232
|
+
import { jsx as jsx72, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5722
5233
|
function ColorDot({ color }) {
|
|
5723
5234
|
if (!color) return null;
|
|
5724
|
-
return /* @__PURE__ */
|
|
5235
|
+
return /* @__PURE__ */ jsx72(
|
|
5725
5236
|
"div",
|
|
5726
5237
|
{
|
|
5727
5238
|
className: "w-3 h-3 rounded-full mr-2 inline-block",
|
|
@@ -5738,25 +5249,25 @@ function DropdownField({ schema, value, onChange }) {
|
|
|
5738
5249
|
const renderSelectedValue = () => {
|
|
5739
5250
|
const selectedOption = options?.find((opt) => opt.value === value);
|
|
5740
5251
|
if (!selectedOption) return null;
|
|
5741
|
-
return /* @__PURE__ */
|
|
5742
|
-
/* @__PURE__ */
|
|
5252
|
+
return /* @__PURE__ */ jsxs50("div", { className: "flex items-center", children: [
|
|
5253
|
+
/* @__PURE__ */ jsx72(ColorDot, { color: selectedOption.color }),
|
|
5743
5254
|
selectedOption.label
|
|
5744
5255
|
] });
|
|
5745
5256
|
};
|
|
5746
|
-
return /* @__PURE__ */
|
|
5257
|
+
return /* @__PURE__ */ jsxs50(
|
|
5747
5258
|
Select,
|
|
5748
5259
|
{
|
|
5749
5260
|
value: value ?? "",
|
|
5750
5261
|
onValueChange: onChange,
|
|
5751
5262
|
children: [
|
|
5752
|
-
/* @__PURE__ */
|
|
5753
|
-
/* @__PURE__ */
|
|
5263
|
+
/* @__PURE__ */ jsx72(SelectTrigger, { children: /* @__PURE__ */ jsx72(SelectValue, { children: renderSelectedValue() }) }),
|
|
5264
|
+
/* @__PURE__ */ jsx72(SelectContent, { children: options?.map((option) => /* @__PURE__ */ jsxs50(
|
|
5754
5265
|
SelectItem,
|
|
5755
5266
|
{
|
|
5756
5267
|
value: option.value,
|
|
5757
5268
|
className: "flex items-center",
|
|
5758
5269
|
children: [
|
|
5759
|
-
/* @__PURE__ */
|
|
5270
|
+
/* @__PURE__ */ jsx72(ColorDot, { color: option.color }),
|
|
5760
5271
|
option.label
|
|
5761
5272
|
]
|
|
5762
5273
|
},
|
|
@@ -5768,7 +5279,7 @@ function DropdownField({ schema, value, onChange }) {
|
|
|
5768
5279
|
}
|
|
5769
5280
|
|
|
5770
5281
|
// components/schema-fields/string-field.tsx
|
|
5771
|
-
import { jsx as
|
|
5282
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
5772
5283
|
function StringField({
|
|
5773
5284
|
name,
|
|
5774
5285
|
schema,
|
|
@@ -5800,7 +5311,7 @@ function StringField({
|
|
|
5800
5311
|
return "text";
|
|
5801
5312
|
}
|
|
5802
5313
|
};
|
|
5803
|
-
return /* @__PURE__ */
|
|
5314
|
+
return /* @__PURE__ */ jsx73(
|
|
5804
5315
|
Input,
|
|
5805
5316
|
{
|
|
5806
5317
|
value: value || "",
|
|
@@ -5819,14 +5330,14 @@ function StringField({
|
|
|
5819
5330
|
}
|
|
5820
5331
|
|
|
5821
5332
|
// components/schema-fields/string-multi-line-field.tsx
|
|
5822
|
-
import { jsx as
|
|
5333
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
5823
5334
|
function StringMultiLineField({
|
|
5824
5335
|
name,
|
|
5825
5336
|
schema,
|
|
5826
5337
|
value,
|
|
5827
5338
|
onChange
|
|
5828
5339
|
}) {
|
|
5829
|
-
return /* @__PURE__ */
|
|
5340
|
+
return /* @__PURE__ */ jsx74(
|
|
5830
5341
|
Textarea,
|
|
5831
5342
|
{
|
|
5832
5343
|
value: value || "",
|
|
@@ -5840,10 +5351,10 @@ function StringMultiLineField({
|
|
|
5840
5351
|
|
|
5841
5352
|
// components/schema-fields/text-field.tsx
|
|
5842
5353
|
import { RiCheckLine } from "@remixicon/react";
|
|
5843
|
-
import { useState as
|
|
5844
|
-
import { jsx as
|
|
5354
|
+
import { useState as useState10 } from "react";
|
|
5355
|
+
import { jsx as jsx75, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5845
5356
|
function TextField({ schema, value, onChange }) {
|
|
5846
|
-
return /* @__PURE__ */
|
|
5357
|
+
return /* @__PURE__ */ jsx75(TooltipProvider, { children: /* @__PURE__ */ jsx75("div", { className: "rounded-lg border bg-background flex flex-col", children: /* @__PURE__ */ jsx75(
|
|
5847
5358
|
Input,
|
|
5848
5359
|
{
|
|
5849
5360
|
value,
|
|
@@ -5854,7 +5365,7 @@ function TextField({ schema, value, onChange }) {
|
|
|
5854
5365
|
}
|
|
5855
5366
|
|
|
5856
5367
|
// components/schema-fields/schema-field.tsx
|
|
5857
|
-
import { jsx as
|
|
5368
|
+
import { jsx as jsx76, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5858
5369
|
function getFieldType(schema) {
|
|
5859
5370
|
if (schema.enum) return "dropdown";
|
|
5860
5371
|
if (schema.format === "richtext") return "text";
|
|
@@ -5876,38 +5387,63 @@ function SchemaField(props) {
|
|
|
5876
5387
|
case "email":
|
|
5877
5388
|
case "phone":
|
|
5878
5389
|
case "url":
|
|
5879
|
-
return /* @__PURE__ */
|
|
5390
|
+
return /* @__PURE__ */ jsx76(StringField, { ...props });
|
|
5880
5391
|
case "stringMultiline":
|
|
5881
|
-
return /* @__PURE__ */
|
|
5392
|
+
return /* @__PURE__ */ jsx76(StringMultiLineField, { ...props });
|
|
5882
5393
|
case "text":
|
|
5883
|
-
return /* @__PURE__ */
|
|
5394
|
+
return /* @__PURE__ */ jsx76(TextField, { ...props });
|
|
5884
5395
|
case "dropdown":
|
|
5885
|
-
return /* @__PURE__ */
|
|
5396
|
+
return /* @__PURE__ */ jsx76(DropdownField, { ...props });
|
|
5886
5397
|
default:
|
|
5887
|
-
return /* @__PURE__ */
|
|
5398
|
+
return /* @__PURE__ */ jsxs52("div", { className: "text-red-500", children: [
|
|
5888
5399
|
"Unsupported field type: ",
|
|
5889
5400
|
fieldType
|
|
5890
5401
|
] });
|
|
5891
5402
|
}
|
|
5892
5403
|
};
|
|
5893
|
-
return /* @__PURE__ */
|
|
5894
|
-
/* @__PURE__ */
|
|
5404
|
+
return /* @__PURE__ */ jsxs52("div", { className: cn("space-y-2", getColspanBySchema(schema)), children: [
|
|
5405
|
+
/* @__PURE__ */ jsxs52(Label, { children: [
|
|
5895
5406
|
label ?? schema.title ?? name,
|
|
5896
|
-
schema.required && /* @__PURE__ */
|
|
5407
|
+
schema.required && /* @__PURE__ */ jsx76("span", { className: "text-red-500", children: "*" })
|
|
5897
5408
|
] }),
|
|
5898
5409
|
renderField(),
|
|
5899
|
-
schema.description && /* @__PURE__ */
|
|
5410
|
+
schema.description && /* @__PURE__ */ jsx76("p", { className: "text-sm text-gray-500", children: schema.description })
|
|
5900
5411
|
] });
|
|
5901
5412
|
}
|
|
5902
5413
|
|
|
5414
|
+
// ../docs/dist/index.mjs
|
|
5415
|
+
import { File as File2, FileSpreadsheet as FileSpreadsheet2, FileText as FileText2 } from "lucide-react";
|
|
5416
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
5417
|
+
var getFileIcon2 = (fileName) => {
|
|
5418
|
+
const extensionMatch = fileName.match(/\.([^.]+)$/);
|
|
5419
|
+
const extension = extensionMatch ? extensionMatch[1].toLowerCase() : null;
|
|
5420
|
+
if (!extension) return /* @__PURE__ */ jsx77(File2, { className: "w-8 h-8 text-gray-500" });
|
|
5421
|
+
switch (extension) {
|
|
5422
|
+
case "pdf":
|
|
5423
|
+
return /* @__PURE__ */ jsx77(File2, { className: "w-8 h-8 text-red-500" });
|
|
5424
|
+
case "doc":
|
|
5425
|
+
case "docx":
|
|
5426
|
+
return /* @__PURE__ */ jsx77(FileText2, { className: "w-8 h-8 text-blue-500" });
|
|
5427
|
+
case "xls":
|
|
5428
|
+
case "xlsx":
|
|
5429
|
+
return /* @__PURE__ */ jsx77(FileSpreadsheet2, { className: "w-8 h-8 text-green-500" });
|
|
5430
|
+
default:
|
|
5431
|
+
return /* @__PURE__ */ jsx77(File2, { className: "w-8 h-8 text-gray-500" });
|
|
5432
|
+
}
|
|
5433
|
+
};
|
|
5434
|
+
var getFileName2 = (url) => {
|
|
5435
|
+
const fileName = decodeURIComponent(url.split("/").pop() ?? "");
|
|
5436
|
+
const cleanFileName = fileName.replace(/%28(\d+)%29/g, "($1)").replace(/[^\w\s().-]/g, "").replace(/\s+/g, "_").replace(/-\d+(?=\.pdf)/g, "");
|
|
5437
|
+
return cleanFileName;
|
|
5438
|
+
};
|
|
5439
|
+
|
|
5903
5440
|
// components/upload/upload-widget-v2.tsx
|
|
5904
|
-
import {
|
|
5905
|
-
import {
|
|
5906
|
-
import { useState as useState14 } from "react";
|
|
5441
|
+
import { Loader2 as Loader25, UploadCloud } from "lucide-react";
|
|
5442
|
+
import { useState as useState11 } from "react";
|
|
5907
5443
|
import { useDropzone as useDropzone2 } from "react-dropzone";
|
|
5908
5444
|
import { toast as toast2 } from "sonner";
|
|
5909
5445
|
import { uploadFile, uploadToS3 } from "./upload/upload-actions";
|
|
5910
|
-
import { jsx as
|
|
5446
|
+
import { jsx as jsx78, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5911
5447
|
function UploadWidgetV2({
|
|
5912
5448
|
accept,
|
|
5913
5449
|
maxSize,
|
|
@@ -5917,8 +5453,8 @@ function UploadWidgetV2({
|
|
|
5917
5453
|
uploadDestination = "azure",
|
|
5918
5454
|
hideUploadedFiles = false
|
|
5919
5455
|
}) {
|
|
5920
|
-
const [isUploading, setIsUploading] =
|
|
5921
|
-
const [fileUrls, setFileUrls] =
|
|
5456
|
+
const [isUploading, setIsUploading] = useState11(false);
|
|
5457
|
+
const [fileUrls, setFileUrls] = useState11([]);
|
|
5922
5458
|
const fileMaxSizeMB = maxSize / 1024 / 1024;
|
|
5923
5459
|
const acceptedTypes = accept ? Object.values(accept).flat().join(", ") : "";
|
|
5924
5460
|
const handleUpload = async (files) => {
|
|
@@ -5965,7 +5501,7 @@ function UploadWidgetV2({
|
|
|
5965
5501
|
maxSize,
|
|
5966
5502
|
maxFiles
|
|
5967
5503
|
});
|
|
5968
|
-
return /* @__PURE__ */
|
|
5504
|
+
return /* @__PURE__ */ jsxs53(
|
|
5969
5505
|
"div",
|
|
5970
5506
|
{
|
|
5971
5507
|
...getRootProps(),
|
|
@@ -5974,12 +5510,12 @@ function UploadWidgetV2({
|
|
|
5974
5510
|
className
|
|
5975
5511
|
),
|
|
5976
5512
|
children: [
|
|
5977
|
-
isUploading && /* @__PURE__ */
|
|
5978
|
-
/* @__PURE__ */
|
|
5979
|
-
isDragActive ? /* @__PURE__ */
|
|
5980
|
-
/* @__PURE__ */
|
|
5981
|
-
/* @__PURE__ */
|
|
5982
|
-
/* @__PURE__ */
|
|
5513
|
+
isUploading && /* @__PURE__ */ jsx78("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ jsx78(Loader25, { className: "animate-spin h-6 w-6 text-primary" }) }),
|
|
5514
|
+
/* @__PURE__ */ jsx78("input", { ...getInputProps() }),
|
|
5515
|
+
isDragActive ? /* @__PURE__ */ jsx78("p", { children: "Drop the files here ..." }) : /* @__PURE__ */ jsxs53("div", { children: [
|
|
5516
|
+
/* @__PURE__ */ jsx78(UploadCloud, { className: "mx-auto h-12 w-12 text-gray-400" }),
|
|
5517
|
+
/* @__PURE__ */ jsx78("p", { children: "Drag n drop some files here, or click to select files" }),
|
|
5518
|
+
/* @__PURE__ */ jsxs53("p", { className: "text-sm text-gray-500", children: [
|
|
5983
5519
|
"Only ",
|
|
5984
5520
|
acceptedTypes,
|
|
5985
5521
|
" files up to ",
|
|
@@ -5987,102 +5523,17 @@ function UploadWidgetV2({
|
|
|
5987
5523
|
"MB are accepted"
|
|
5988
5524
|
] })
|
|
5989
5525
|
] }),
|
|
5990
|
-
!hideUploadedFiles && fileUrls.length > 0 && /* @__PURE__ */
|
|
5526
|
+
!hideUploadedFiles && fileUrls.length > 0 && /* @__PURE__ */ jsx78("div", { className: "mt-4 border-t border-gray-300 pt-4", children: /* @__PURE__ */ jsx78("ul", { className: "flex flex-wrap gap-2", children: fileUrls.map((url, i) => {
|
|
5991
5527
|
const fileName = getFileName2(url);
|
|
5992
|
-
return /* @__PURE__ */
|
|
5993
|
-
/* @__PURE__ */
|
|
5994
|
-
/* @__PURE__ */
|
|
5528
|
+
return /* @__PURE__ */ jsxs53("li", { className: "flex items-center space-x-2 text-sm", children: [
|
|
5529
|
+
/* @__PURE__ */ jsx78("div", { children: getFileIcon2(fileName) }),
|
|
5530
|
+
/* @__PURE__ */ jsx78("span", { children: fileName })
|
|
5995
5531
|
] }, i);
|
|
5996
5532
|
}) }) })
|
|
5997
5533
|
]
|
|
5998
5534
|
}
|
|
5999
5535
|
);
|
|
6000
5536
|
}
|
|
6001
|
-
|
|
6002
|
-
// hooks/use-file-upload.ts
|
|
6003
|
-
import { useNatsContext } from "@elqnt/nats";
|
|
6004
|
-
import { useEffect as useEffect7, useState as useState15 } from "react";
|
|
6005
|
-
import { useWatch } from "react-hook-form";
|
|
6006
|
-
function convertDataUrlToUint8Array(dataURL) {
|
|
6007
|
-
const base64String = dataURL.split(",")[1];
|
|
6008
|
-
const binaryString = atob(base64String);
|
|
6009
|
-
const len = binaryString.length;
|
|
6010
|
-
const bytes = new Uint8Array(len);
|
|
6011
|
-
for (let i = 0; i < len; i++) {
|
|
6012
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
6013
|
-
}
|
|
6014
|
-
return bytes;
|
|
6015
|
-
}
|
|
6016
|
-
var JS_OS_FILE_UPLOAD = "file-upload";
|
|
6017
|
-
var useFileUpload = (formFieldName) => {
|
|
6018
|
-
const files = useWatch({ name: formFieldName });
|
|
6019
|
-
const [fileUrls, setFileUrls] = useState15([]);
|
|
6020
|
-
const [isUploading, setIsUploading] = useState15(false);
|
|
6021
|
-
const { request, ObjectStore } = useNatsContext();
|
|
6022
|
-
useEffect7(() => {
|
|
6023
|
-
if (!files || files.length === 0) return;
|
|
6024
|
-
const uploadFiles = async () => {
|
|
6025
|
-
setIsUploading(true);
|
|
6026
|
-
const bucket = JS_OS_FILE_UPLOAD;
|
|
6027
|
-
const filesArray = Array.from(files);
|
|
6028
|
-
for (const file of filesArray) {
|
|
6029
|
-
const reader = new FileReader();
|
|
6030
|
-
reader.readAsDataURL(file);
|
|
6031
|
-
try {
|
|
6032
|
-
await new Promise((resolve, reject) => {
|
|
6033
|
-
reader.onloadend = async () => {
|
|
6034
|
-
const dataURL = reader.result;
|
|
6035
|
-
const uint8Array = convertDataUrlToUint8Array(dataURL);
|
|
6036
|
-
const os = await ObjectStore(bucket);
|
|
6037
|
-
if (os instanceof Error) {
|
|
6038
|
-
console.error(os);
|
|
6039
|
-
reject(os);
|
|
6040
|
-
return;
|
|
6041
|
-
}
|
|
6042
|
-
const extension = file.name.match(/\.[^/.]+$/)?.[0];
|
|
6043
|
-
const name = file.name.replace(/\.[^/.]+$/, "") + "-" + Date.now() + extension;
|
|
6044
|
-
const meta = {
|
|
6045
|
-
"Content-Type": file.type,
|
|
6046
|
-
name
|
|
6047
|
-
};
|
|
6048
|
-
const result = await os.putBlob(meta, uint8Array);
|
|
6049
|
-
if (result instanceof Error) {
|
|
6050
|
-
console.error(result);
|
|
6051
|
-
reject(result);
|
|
6052
|
-
return;
|
|
6053
|
-
}
|
|
6054
|
-
const res = await request("entities.uploadFile", {
|
|
6055
|
-
fileName: name,
|
|
6056
|
-
mimeType: file.type
|
|
6057
|
-
});
|
|
6058
|
-
if (res instanceof Error) {
|
|
6059
|
-
console.error(res);
|
|
6060
|
-
reject(res);
|
|
6061
|
-
return;
|
|
6062
|
-
}
|
|
6063
|
-
const { url } = res;
|
|
6064
|
-
const deleteRes = await os.delete(name);
|
|
6065
|
-
if (deleteRes instanceof Error) {
|
|
6066
|
-
console.error(deleteRes);
|
|
6067
|
-
reject(deleteRes);
|
|
6068
|
-
return;
|
|
6069
|
-
}
|
|
6070
|
-
console.log("file uploaded successfully", url);
|
|
6071
|
-
setFileUrls((prevUrls) => [...prevUrls, url]);
|
|
6072
|
-
resolve();
|
|
6073
|
-
};
|
|
6074
|
-
});
|
|
6075
|
-
} catch (error) {
|
|
6076
|
-
console.error("Error uploading file:", error);
|
|
6077
|
-
continue;
|
|
6078
|
-
}
|
|
6079
|
-
}
|
|
6080
|
-
setIsUploading(false);
|
|
6081
|
-
};
|
|
6082
|
-
uploadFiles();
|
|
6083
|
-
}, [files]);
|
|
6084
|
-
return { fileUrls, isUploading };
|
|
6085
|
-
};
|
|
6086
5537
|
export {
|
|
6087
5538
|
ActionBar,
|
|
6088
5539
|
ActionBarButton,
|
|
@@ -6106,7 +5557,6 @@ export {
|
|
|
6106
5557
|
DurationInput,
|
|
6107
5558
|
EloquentActionBar,
|
|
6108
5559
|
FilterCombobox,
|
|
6109
|
-
FilterDialog,
|
|
6110
5560
|
Form,
|
|
6111
5561
|
FormCombobox,
|
|
6112
5562
|
FormControl,
|
|
@@ -6118,15 +5568,12 @@ export {
|
|
|
6118
5568
|
FormMessage,
|
|
6119
5569
|
FormRow,
|
|
6120
5570
|
FormWithActionButtons,
|
|
6121
|
-
|
|
5571
|
+
Icon,
|
|
6122
5572
|
IconButton,
|
|
6123
5573
|
Input2 as Input,
|
|
6124
|
-
KnowledgeGraphWordCloud,
|
|
6125
|
-
LeftNav,
|
|
6126
5574
|
MarkdownRenderer,
|
|
6127
5575
|
MultiSelect,
|
|
6128
5576
|
MultiStepProcess,
|
|
6129
|
-
OrgSelector,
|
|
6130
5577
|
PageHeader,
|
|
6131
5578
|
Popover2 as Popover,
|
|
6132
5579
|
ProfileMenu,
|
|
@@ -6152,7 +5599,6 @@ export {
|
|
|
6152
5599
|
getFieldType,
|
|
6153
5600
|
getFileIcon,
|
|
6154
5601
|
getFileName,
|
|
6155
|
-
useFileUpload,
|
|
6156
5602
|
useFormField
|
|
6157
5603
|
};
|
|
6158
5604
|
//# sourceMappingURL=index.mjs.map
|