atomos_next_genesis 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2762 -745
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1253 -102
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +325 -87
- package/dist/index.d.ts +325 -87
- package/dist/index.js +2760 -751
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38,30 +38,52 @@ __export(app_exports, {
|
|
|
38
38
|
AvatarGroup: () => AvatarGroup_default,
|
|
39
39
|
BreadCrumb: () => Breadcrumb_default,
|
|
40
40
|
Button: () => Button_default,
|
|
41
|
+
Callout: () => Callout_default,
|
|
42
|
+
Card: () => Card_default,
|
|
43
|
+
CardAction: () => CardAction,
|
|
44
|
+
CardContent: () => CardContent,
|
|
45
|
+
CardDescription: () => CardDescription,
|
|
46
|
+
CardFooter: () => CardFooter,
|
|
47
|
+
CardHeader: () => CardHeader,
|
|
48
|
+
CardTitle: () => CardTitle,
|
|
41
49
|
Checkbox: () => Checkbox_default,
|
|
42
50
|
Chip: () => Chip_default,
|
|
43
51
|
CircularProgress: () => CircularProgress_default,
|
|
44
52
|
Divider: () => Divider_default,
|
|
53
|
+
Drawer: () => Drawer_default,
|
|
45
54
|
Dropdown: () => Dropdown_default,
|
|
55
|
+
DropdownMenu: () => DropdownMenu,
|
|
56
|
+
DropdownMenuContent: () => DropdownMenuContent,
|
|
57
|
+
DropdownMenuItem: () => DropdownMenuItem,
|
|
58
|
+
DropdownMenuLabel: () => DropdownMenuLabel,
|
|
59
|
+
DropdownMenuSeparator: () => DropdownMenuSeparator,
|
|
60
|
+
DropdownMenuSub: () => DropdownMenuSub,
|
|
61
|
+
DropdownMenuSubContent: () => DropdownMenuSubContent,
|
|
62
|
+
DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
|
|
63
|
+
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
46
64
|
DropdownWithIcon: () => DropdownWithIcon_default,
|
|
65
|
+
FileSelector: () => FileSelector_default,
|
|
47
66
|
FileUpload: () => FileUpload_default,
|
|
67
|
+
FileUploadPreview: () => FileUploadPreview_default,
|
|
48
68
|
GlobalNavigation: () => GlobalNavigation_default,
|
|
49
69
|
HelperText: () => HelperText_default,
|
|
50
70
|
Input: () => Input_default,
|
|
51
71
|
Label: () => Label_default,
|
|
52
72
|
ListItem: () => ListItem_default,
|
|
73
|
+
ListPagination: () => ListPagination_default,
|
|
53
74
|
Loading: () => Loading_default,
|
|
54
|
-
MenuDropdown: () => MenuDropdown,
|
|
55
|
-
MenuItem: () => MenuItem3,
|
|
56
|
-
MenuSubItem: () => MenuSubItem,
|
|
57
75
|
Modal: () => Modal,
|
|
58
76
|
Notice: () => Notice_default,
|
|
77
|
+
OTPInput: () => OTPInput_default,
|
|
59
78
|
Pagination: () => Pagination_default,
|
|
60
79
|
ProgressBar: () => Progress_default,
|
|
61
80
|
Radio: () => Radio_default,
|
|
81
|
+
RazorPayFileUpload: () => ImageUploadControlled,
|
|
62
82
|
Sidebar: () => Sidebar_default,
|
|
63
83
|
Skeleton: () => Skeleton_default,
|
|
64
84
|
Slider: () => Slider_default,
|
|
85
|
+
Spinner: () => Spinner_default,
|
|
86
|
+
SplitButton: () => SplitButton_default,
|
|
65
87
|
Stepper: () => Stepper_default,
|
|
66
88
|
Tab: () => Tab,
|
|
67
89
|
TabList: () => TabList,
|
|
@@ -73,29 +95,60 @@ __export(app_exports, {
|
|
|
73
95
|
TableHeadCell: () => TableHeadCell,
|
|
74
96
|
TableRow: () => TableRow,
|
|
75
97
|
TabsContainer: () => Tabs_default,
|
|
98
|
+
TextInputWithLabel: () => TextInputWithLabel_default,
|
|
76
99
|
Textarea: () => Textarea_default,
|
|
77
100
|
Toggle: () => Toggle_default,
|
|
78
|
-
Tooltip: () => Tooltip_default
|
|
101
|
+
Tooltip: () => Tooltip_default,
|
|
102
|
+
TreeView: () => TreeView_default,
|
|
103
|
+
Typography: () => Typography_default,
|
|
104
|
+
defaultGetFileIcon: () => defaultGetFileIcon
|
|
79
105
|
});
|
|
80
106
|
module.exports = __toCommonJS(app_exports);
|
|
81
107
|
|
|
82
|
-
// app/components/
|
|
108
|
+
// app/components/Accordion.tsx
|
|
83
109
|
var import_react = __toESM(require("react"), 1);
|
|
110
|
+
var import_react2 = require("@remixicon/react");
|
|
84
111
|
|
|
85
112
|
// app/utils/utils.tsx
|
|
86
113
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
87
114
|
var import_tailwind_merge = require("tailwind-merge");
|
|
88
115
|
var cn = (...classes) => (0, import_tailwind_merge.twMerge)((0, import_clsx.default)(...classes));
|
|
89
116
|
|
|
90
|
-
// app/components/
|
|
91
|
-
var import_react2 = require("@remixicon/react");
|
|
117
|
+
// app/components/Accordion.tsx
|
|
92
118
|
function Accordion({
|
|
93
119
|
type = "single",
|
|
94
120
|
collapsible = true,
|
|
95
121
|
className,
|
|
96
|
-
children
|
|
122
|
+
children,
|
|
123
|
+
expanded
|
|
97
124
|
}) {
|
|
98
|
-
const [openItems, setOpenItems] = (0, import_react.useState)(
|
|
125
|
+
const [openItems, setOpenItems] = (0, import_react.useState)(() => {
|
|
126
|
+
const defaultOpen = [];
|
|
127
|
+
import_react.default.Children.forEach(children, (child) => {
|
|
128
|
+
if (import_react.default.isValidElement(child)) {
|
|
129
|
+
const triggerChild = import_react.default.Children.toArray(child.props.children)[0];
|
|
130
|
+
if (import_react.default.isValidElement(triggerChild) && triggerChild.props.defaultOpen) {
|
|
131
|
+
defaultOpen.push(child.props.value);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
return defaultOpen;
|
|
136
|
+
});
|
|
137
|
+
(0, import_react.useEffect)(() => {
|
|
138
|
+
if (expanded !== void 0) {
|
|
139
|
+
if (expanded) {
|
|
140
|
+
const allValues = [];
|
|
141
|
+
import_react.default.Children.forEach(children, (child) => {
|
|
142
|
+
if (import_react.default.isValidElement(child)) {
|
|
143
|
+
allValues.push(child.props.value);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
setOpenItems(allValues);
|
|
147
|
+
} else {
|
|
148
|
+
setOpenItems([]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, [expanded, children]);
|
|
99
152
|
const handleToggle = (value) => {
|
|
100
153
|
if (type === "single") {
|
|
101
154
|
setOpenItems(
|
|
@@ -107,7 +160,7 @@ function Accordion({
|
|
|
107
160
|
);
|
|
108
161
|
}
|
|
109
162
|
};
|
|
110
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className }, import_react.default.Children.map(children, (child) => {
|
|
163
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className, role: "region", "aria-label": "Accordion" }, import_react.default.Children.map(children, (child) => {
|
|
111
164
|
if (import_react.default.isValidElement(child)) {
|
|
112
165
|
return import_react.default.cloneElement(
|
|
113
166
|
child,
|
|
@@ -129,6 +182,8 @@ function AccordionItem({
|
|
|
129
182
|
className
|
|
130
183
|
}) {
|
|
131
184
|
const isOpen = openItems == null ? void 0 : openItems.includes(value);
|
|
185
|
+
const headerId = `accordion-header-${value}`;
|
|
186
|
+
const contentId = `accordion-content-${value}`;
|
|
132
187
|
const toggle = () => {
|
|
133
188
|
if (!disabled && handleToggle) {
|
|
134
189
|
handleToggle(value);
|
|
@@ -138,55 +193,79 @@ function AccordionItem({
|
|
|
138
193
|
"div",
|
|
139
194
|
{
|
|
140
195
|
className: cn(
|
|
141
|
-
"bg-white
|
|
142
|
-
disabled
|
|
143
|
-
isOpen
|
|
196
|
+
"bg-white rounded-lg shadow transition-all duration-300 ease-in-out border",
|
|
197
|
+
disabled && "opacity-50 pointer-events-none select-none",
|
|
198
|
+
isOpen && "border-gray-300",
|
|
144
199
|
className
|
|
145
200
|
)
|
|
146
201
|
},
|
|
147
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
202
|
+
children && Array.isArray(children) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
148
203
|
"div",
|
|
149
204
|
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
className: cn(
|
|
157
|
-
"grid transition-all duration-300 ease-in-out",
|
|
158
|
-
isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
|
|
159
|
-
)
|
|
205
|
+
onClick: toggle,
|
|
206
|
+
onKeyDown: (e) => {
|
|
207
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
toggle();
|
|
210
|
+
}
|
|
160
211
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
212
|
+
role: "button",
|
|
213
|
+
tabIndex: disabled ? -1 : 0,
|
|
214
|
+
"aria-expanded": isOpen,
|
|
215
|
+
"aria-disabled": disabled,
|
|
216
|
+
"aria-controls": contentId,
|
|
217
|
+
id: headerId,
|
|
218
|
+
className: "cursor-pointer"
|
|
219
|
+
},
|
|
220
|
+
import_react.default.cloneElement(children[0], { isOpen })
|
|
221
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
id: contentId,
|
|
225
|
+
role: "region",
|
|
226
|
+
"aria-labelledby": headerId,
|
|
227
|
+
className: cn(
|
|
228
|
+
"transition-all duration-300 ease-in-out overflow-hidden",
|
|
229
|
+
isOpen ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
|
|
230
|
+
),
|
|
231
|
+
onClick: (e) => e.stopPropagation()
|
|
232
|
+
},
|
|
233
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "p-3.5" }, children[1])
|
|
234
|
+
)) : children
|
|
164
235
|
);
|
|
165
236
|
}
|
|
166
|
-
function AccordionTrigger({
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
isOpen ? "rotate-180" : "rotate-0"
|
|
173
|
-
)
|
|
174
|
-
},
|
|
175
|
-
/* @__PURE__ */ import_react.default.createElement(import_react2.RiArrowDownSLine, { size: 18 })
|
|
176
|
-
));
|
|
177
|
-
}
|
|
178
|
-
function AccordionContent({ isOpen, children }) {
|
|
237
|
+
function AccordionTrigger({
|
|
238
|
+
isOpen,
|
|
239
|
+
children,
|
|
240
|
+
className,
|
|
241
|
+
triggerIcon = /* @__PURE__ */ import_react.default.createElement(import_react2.RiArrowDownSLine, { size: 18 })
|
|
242
|
+
}) {
|
|
179
243
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
180
244
|
"div",
|
|
181
245
|
{
|
|
182
246
|
className: cn(
|
|
183
|
-
"
|
|
184
|
-
|
|
247
|
+
"flex p-3.5 text-lg rounded-lg bg-white hover:bg-gray-50 justify-between items-center font-semibold transition-all delay-150 ease-in",
|
|
248
|
+
isOpen && "bg-gray-100",
|
|
249
|
+
className
|
|
185
250
|
)
|
|
186
251
|
},
|
|
187
|
-
children
|
|
252
|
+
children,
|
|
253
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
254
|
+
"span",
|
|
255
|
+
{
|
|
256
|
+
className: cn(
|
|
257
|
+
"transition-transform duration-300",
|
|
258
|
+
isOpen ? "rotate-180" : "rotate-0"
|
|
259
|
+
),
|
|
260
|
+
"aria-hidden": "true"
|
|
261
|
+
},
|
|
262
|
+
triggerIcon
|
|
263
|
+
)
|
|
188
264
|
);
|
|
189
265
|
}
|
|
266
|
+
function AccordionContent({ children }) {
|
|
267
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "text-gray-700" }, children);
|
|
268
|
+
}
|
|
190
269
|
|
|
191
270
|
// app/components/Avatar.tsx
|
|
192
271
|
var import_image = __toESM(require("next/image"), 1);
|
|
@@ -377,7 +456,7 @@ var Breadcrumb_default = Breadcrumbs;
|
|
|
377
456
|
var import_react6 = __toESM(require("react"), 1);
|
|
378
457
|
var import_class_variance_authority = require("class-variance-authority");
|
|
379
458
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
380
|
-
"rounded-lg disabled:select-none font-semibold cursor-pointer transition-colors duration-300 ease-in-out",
|
|
459
|
+
"rounded-lg disabled:select-none font-semibold cursor-pointer transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2",
|
|
381
460
|
{
|
|
382
461
|
variants: {
|
|
383
462
|
variant: {
|
|
@@ -390,11 +469,29 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
390
469
|
error: "bg-error-700 border-error-700 active:bg-error-900 active:border-error-900 hover:bg-error-800 hover:border-error-800",
|
|
391
470
|
warning: "bg-warning-600 border-warning-600 active:bg-warning-900 active:border-warning-900 hover:bg-warning-700 hover:border-warning-700",
|
|
392
471
|
default: "bg-gray-600 border-gray-600 active:bg-gray-900 active:border-gray-900 hover:bg-gray-700 hover:border-gray-700",
|
|
472
|
+
blue: "bg-blue-600 border-blue-600 active:bg-blue-900 active:border-blue-900 hover:bg-blue-700 hover:border-blue-700",
|
|
473
|
+
bluegray: "bg-bluegray-600 border-bluegray-600 active:bg-bluegray-900 active:border-bluegray-900 hover:bg-bluegray-700 hover:border-bluegray-700",
|
|
474
|
+
bluelight: "bg-bluelight-600 border-bluelight-600 active:bg-bluelight-900 active:border-bluelight-900 hover:bg-bluelight-700 hover:border-bluelight-700",
|
|
475
|
+
indigo: "bg-indigo-600 border-indigo-600 active:bg-indigo-900 active:border-indigo-900 hover:bg-indigo-700 hover:border-indigo-700",
|
|
476
|
+
purple: "bg-purple-600 border-purple-600 active:bg-purple-900 active:border-purple-900 hover:bg-purple-700 hover:border-purple-700",
|
|
477
|
+
violet: "bg-violet-600 border-violet-600 active:bg-violet-900 active:border-violet-900 hover:bg-violet-700 hover:border-violet-700",
|
|
478
|
+
pink: "bg-pink-600 border-pink-600 active:bg-pink-900 active:border-pink-900 hover:bg-pink-700 hover:border-pink-700",
|
|
479
|
+
rose: "bg-rose-600 border-rose-600 active:bg-rose-900 active:border-rose-900 hover:bg-rose-700 hover:border-rose-700",
|
|
480
|
+
orange: "bg-orange-600 border-orange-600 active:bg-orange-900 active:border-orange-900 hover:bg-orange-700 hover:border-orange-700",
|
|
393
481
|
"primary-outlined": "border-primary-600 text-primary-600 hover:bg-primary-100 active:bg-primary-200 active:border-primary-700",
|
|
394
482
|
"success-outlined": "border-success-600 text-success-600 hover:bg-success-50 hover:border-success-700 hover:text-success-700 active:bg-success-100 active:text-success-900 active:border-success-900",
|
|
395
483
|
"error-outlined": "border-error-700 text-error-700 hover:bg-error-100 hover:border-error-700 hover:text-error-700 active:bg-error-200 active:text-error-700 active:border-error-800",
|
|
396
484
|
"warning-outlined": "border-warning-500 text-warning-500 hover:bg-warning-50 hover:border-warning-600 hover:text-warning-600 active:bg-warning-100 active:text-warning-700 active:border-warning-700",
|
|
397
|
-
"default-outlined": "border-gray-700 text-gray-700 hover:bg-gray-100 hover:border-gray-700 hover:text-gray-700 active:bg-gray-300 active:text-gray-800 active:border-gray-800"
|
|
485
|
+
"default-outlined": "border-gray-700 text-gray-700 hover:bg-gray-100 hover:border-gray-700 hover:text-gray-700 active:bg-gray-300 active:text-gray-800 active:border-gray-800",
|
|
486
|
+
"blue-outlined": "border-blue-600 text-blue-600 hover:bg-blue-50 hover:border-blue-700 hover:text-blue-700 active:bg-blue-100 active:text-blue-900 active:border-blue-900",
|
|
487
|
+
"bluegray-outlined": "border-bluegray-600 text-bluegray-600 hover:bg-bluegray-50 hover:border-bluegray-700 hover:text-bluegray-700 active:bg-bluegray-100 active:text-bluegray-900 active:border-bluegray-900",
|
|
488
|
+
"bluelight-outlined": "border-bluelight-600 text-bluelight-600 hover:bg-bluelight-50 hover:border-bluelight-700 hover:text-bluelight-700 active:bg-bluelight-100 active:text-bluelight-900 active:border-bluelight-900",
|
|
489
|
+
"indigo-outlined": "border-indigo-600 text-indigo-600 hover:bg-indigo-50 hover:border-indigo-700 hover:text-indigo-700 active:bg-indigo-100 active:text-indigo-900 active:border-indigo-900",
|
|
490
|
+
"purple-outlined": "border-purple-600 text-purple-600 hover:bg-purple-50 hover:border-purple-700 hover:text-purple-700 active:bg-purple-100 active:text-purple-900 active:border-purple-900",
|
|
491
|
+
"violet-outlined": "border-violet-600 text-violet-600 hover:bg-violet-50 hover:border-violet-700 hover:text-violet-700 active:bg-violet-100 active:text-violet-900 active:border-violet-900",
|
|
492
|
+
"pink-outlined": "border-pink-600 text-pink-600 hover:bg-pink-50 hover:border-pink-700 hover:text-pink-700 active:bg-pink-100 active:text-pink-900 active:border-pink-900",
|
|
493
|
+
"rose-outlined": "border-rose-600 text-rose-600 hover:bg-rose-50 hover:border-rose-700 hover:text-rose-700 active:bg-rose-100 active:text-rose-900 active:border-rose-900",
|
|
494
|
+
"orange-outlined": "border-orange-600 text-orange-600 hover:bg-orange-50 hover:border-orange-700 hover:text-orange-700 active:bg-orange-100 active:text-orange-900 active:border-orange-900"
|
|
398
495
|
},
|
|
399
496
|
size: {
|
|
400
497
|
sm: "text-sm px-3.5 py-2",
|
|
@@ -404,7 +501,7 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
404
501
|
},
|
|
405
502
|
defaultVariants: {
|
|
406
503
|
variant: "filled",
|
|
407
|
-
size: "
|
|
504
|
+
size: "sm"
|
|
408
505
|
}
|
|
409
506
|
}
|
|
410
507
|
);
|
|
@@ -418,36 +515,187 @@ var Button = ({
|
|
|
418
515
|
disabled,
|
|
419
516
|
endIcon,
|
|
420
517
|
size,
|
|
518
|
+
type = "button",
|
|
421
519
|
...props
|
|
422
520
|
}) => {
|
|
423
|
-
return
|
|
424
|
-
|
|
521
|
+
return (
|
|
522
|
+
// <button
|
|
523
|
+
// {...props}
|
|
524
|
+
// disabled={disabled}
|
|
525
|
+
// type={type}
|
|
526
|
+
// aria-disabled={disabled}
|
|
527
|
+
// className={cn(
|
|
528
|
+
// fullWidth && "w-full",
|
|
529
|
+
// buttonVariants({ intent, className, variant, size }),
|
|
530
|
+
// "flex items-center text-center justify-center gap-2"
|
|
531
|
+
// )}
|
|
532
|
+
// >
|
|
533
|
+
// {startIcon}
|
|
534
|
+
// {children}
|
|
535
|
+
// {endIcon}
|
|
536
|
+
// </button>
|
|
537
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
538
|
+
"button",
|
|
539
|
+
{
|
|
540
|
+
...props,
|
|
541
|
+
disabled,
|
|
542
|
+
"aria-disabled": disabled,
|
|
543
|
+
type,
|
|
544
|
+
className: cn(
|
|
545
|
+
fullWidth && "w-full",
|
|
546
|
+
buttonVariants({ intent, className, variant, size }),
|
|
547
|
+
"flex items-center text-center justify-center gap-2"
|
|
548
|
+
)
|
|
549
|
+
},
|
|
550
|
+
startIcon && /* @__PURE__ */ import_react6.default.createElement("span", { "aria-hidden": "true" }, startIcon),
|
|
551
|
+
children,
|
|
552
|
+
endIcon && /* @__PURE__ */ import_react6.default.createElement("span", { "aria-hidden": "true" }, endIcon)
|
|
553
|
+
)
|
|
554
|
+
);
|
|
555
|
+
};
|
|
556
|
+
var Button_default = Button;
|
|
557
|
+
|
|
558
|
+
// app/components/Callout.tsx
|
|
559
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
560
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
561
|
+
var calloutVariants = (0, import_class_variance_authority2.cva)("py-3 px-4 font-medium rounded-md", {
|
|
562
|
+
variants: {
|
|
563
|
+
variant: {
|
|
564
|
+
filled: "",
|
|
565
|
+
outlined: "border"
|
|
566
|
+
},
|
|
567
|
+
intent: {
|
|
568
|
+
primary: "",
|
|
569
|
+
warning: "",
|
|
570
|
+
error: "",
|
|
571
|
+
success: "",
|
|
572
|
+
default: ""
|
|
573
|
+
},
|
|
574
|
+
size: {
|
|
575
|
+
xs: "text-xs",
|
|
576
|
+
sm: "text-sm",
|
|
577
|
+
md: "text-base",
|
|
578
|
+
lg: "text-lg"
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
compoundVariants: [
|
|
425
582
|
{
|
|
426
|
-
|
|
427
|
-
|
|
583
|
+
variant: "filled",
|
|
584
|
+
intent: "primary",
|
|
585
|
+
className: "bg-primary-50 text-primary-600"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
variant: "outlined",
|
|
589
|
+
intent: "primary",
|
|
590
|
+
className: "border-primary-200 text-primary-600 bg-transparent"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
variant: "filled",
|
|
594
|
+
intent: "warning",
|
|
595
|
+
className: "bg-warning-50 text-warning-600"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
variant: "outlined",
|
|
599
|
+
intent: "warning",
|
|
600
|
+
className: "border-warning-200 text-warning-600 bg-transparent"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
variant: "filled",
|
|
604
|
+
intent: "error",
|
|
605
|
+
className: "bg-error-50 text-error-600"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
variant: "outlined",
|
|
609
|
+
intent: "error",
|
|
610
|
+
className: "border-error-200 text-error-600 bg-transparent"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
variant: "filled",
|
|
614
|
+
intent: "success",
|
|
615
|
+
className: "bg-success-50 text-success-600"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
variant: "outlined",
|
|
619
|
+
intent: "success",
|
|
620
|
+
className: "border-success-200 text-success-600 bg-transparent"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
variant: "filled",
|
|
624
|
+
intent: "default",
|
|
625
|
+
className: "bg-gray-50 text-gray-600"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
variant: "outlined",
|
|
629
|
+
intent: "default",
|
|
630
|
+
className: "border-gray-300 text-gray-600 bg-transparent"
|
|
631
|
+
}
|
|
632
|
+
],
|
|
633
|
+
defaultVariants: {
|
|
634
|
+
variant: "filled",
|
|
635
|
+
intent: "primary",
|
|
636
|
+
size: "sm"
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
var Callout = ({
|
|
640
|
+
children,
|
|
641
|
+
variant,
|
|
642
|
+
intent,
|
|
643
|
+
size,
|
|
644
|
+
startIcon,
|
|
645
|
+
endIcon,
|
|
646
|
+
className
|
|
647
|
+
}) => {
|
|
648
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
649
|
+
"div",
|
|
650
|
+
{
|
|
651
|
+
role: "alert",
|
|
428
652
|
className: cn(
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
653
|
+
calloutVariants({ variant, intent, size }),
|
|
654
|
+
"flex items-center justify-between gap-2",
|
|
655
|
+
className
|
|
432
656
|
)
|
|
433
657
|
},
|
|
434
|
-
startIcon,
|
|
435
|
-
|
|
436
|
-
endIcon
|
|
658
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "flex items-center gap-2" }, startIcon && /* @__PURE__ */ import_react7.default.createElement("span", null, startIcon), children),
|
|
659
|
+
endIcon && /* @__PURE__ */ import_react7.default.createElement("span", null, endIcon)
|
|
437
660
|
);
|
|
438
661
|
};
|
|
439
|
-
var
|
|
662
|
+
var Callout_default = Callout;
|
|
663
|
+
|
|
664
|
+
// app/components/Card.tsx
|
|
665
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
666
|
+
function Card_default({ children, className }) {
|
|
667
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: cn("bg-white rounded-lg border border-gray-200 shadow-sm", className) }, children);
|
|
668
|
+
}
|
|
669
|
+
var CardHeader = ({ children, className }) => {
|
|
670
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: cn("p-4 pb-4", className) }, children);
|
|
671
|
+
};
|
|
672
|
+
var CardTitle = ({ children, className }) => {
|
|
673
|
+
return /* @__PURE__ */ import_react8.default.createElement("h3", { className: cn("text-lg font-semibold text-gray-900 mb-2", className) }, children);
|
|
674
|
+
};
|
|
675
|
+
var CardDescription = ({ children, className }) => {
|
|
676
|
+
return /* @__PURE__ */ import_react8.default.createElement("p", { className: cn("text-sm text-gray-600 mb-4", className) }, children);
|
|
677
|
+
};
|
|
678
|
+
var CardAction = ({ children, className }) => {
|
|
679
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: cn("mt-4", className) }, children);
|
|
680
|
+
};
|
|
681
|
+
var CardContent = ({ children, className }) => {
|
|
682
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: cn("p-6 pt-0", className) }, children);
|
|
683
|
+
};
|
|
684
|
+
var CardFooter = ({ children, className }) => {
|
|
685
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: cn("p-6 pt-0", className) }, children);
|
|
686
|
+
};
|
|
440
687
|
|
|
441
688
|
// app/components/Checkbox.tsx
|
|
442
|
-
var
|
|
443
|
-
var
|
|
444
|
-
var checkboxVariant = (0,
|
|
689
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
690
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
691
|
+
var checkboxVariant = (0, import_class_variance_authority3.cva)(
|
|
445
692
|
"peer relative cursor-pointer appearance-none rounded-[4px] border border-gray-300 transition-all checked:border-primary-600 checked:bg-primary-50 hover:bg-primary-50 disabled:opacity-30 disabled:pointer-events-none",
|
|
446
693
|
{
|
|
447
694
|
variants: {
|
|
448
695
|
size: {
|
|
449
696
|
sm: "h-3 w-3",
|
|
450
|
-
lg: "h-3.5 w-3.5"
|
|
697
|
+
lg: "h-3.5 w-3.5",
|
|
698
|
+
xl: "h-4 w-4"
|
|
451
699
|
}
|
|
452
700
|
},
|
|
453
701
|
defaultVariants: {
|
|
@@ -455,47 +703,59 @@ var checkboxVariant = (0, import_class_variance_authority2.cva)(
|
|
|
455
703
|
}
|
|
456
704
|
}
|
|
457
705
|
);
|
|
458
|
-
var Checkbox = (0,
|
|
459
|
-
({ disabled, checked, size, className, children, ...props }, ref) => {
|
|
460
|
-
return /* @__PURE__ */
|
|
706
|
+
var Checkbox = (0, import_react9.forwardRef)(
|
|
707
|
+
({ disabled, checked, size, className, children, id, ...props }, ref) => {
|
|
708
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "inline-flex relative items-center" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
461
709
|
"input",
|
|
462
710
|
{
|
|
463
711
|
type: "checkbox",
|
|
464
712
|
ref,
|
|
713
|
+
id,
|
|
465
714
|
...props,
|
|
466
715
|
disabled,
|
|
467
716
|
checked,
|
|
468
|
-
className: cn(
|
|
717
|
+
className: cn(
|
|
718
|
+
"peer",
|
|
719
|
+
checkboxVariant({ className, size }),
|
|
720
|
+
"focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2"
|
|
721
|
+
)
|
|
469
722
|
}
|
|
470
|
-
), /* @__PURE__ */
|
|
471
|
-
"
|
|
723
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
724
|
+
"span",
|
|
472
725
|
{
|
|
473
|
-
|
|
474
|
-
className: "
|
|
475
|
-
viewBox: "0 0 20 20",
|
|
476
|
-
fill: "currentColor",
|
|
477
|
-
stroke: "currentColor",
|
|
478
|
-
strokeWidth: "1"
|
|
726
|
+
"aria-hidden": "true",
|
|
727
|
+
className: "absolute text-primary-600 transition-opacity opacity-0 pointer-events-none top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 peer-checked:opacity-100"
|
|
479
728
|
},
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
"
|
|
729
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
730
|
+
"svg",
|
|
482
731
|
{
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
732
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
733
|
+
className: "w-2.5 h-2.5",
|
|
734
|
+
viewBox: "0 0 20 20",
|
|
735
|
+
fill: "currentColor",
|
|
736
|
+
stroke: "currentColor",
|
|
737
|
+
strokeWidth: "1"
|
|
738
|
+
},
|
|
739
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
740
|
+
"path",
|
|
741
|
+
{
|
|
742
|
+
fillRule: "evenodd",
|
|
743
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
744
|
+
clipRule: "evenodd"
|
|
745
|
+
}
|
|
746
|
+
)
|
|
487
747
|
)
|
|
488
|
-
))
|
|
748
|
+
));
|
|
489
749
|
}
|
|
490
750
|
);
|
|
491
751
|
Checkbox.displayName = "Checkbox";
|
|
492
752
|
var Checkbox_default = Checkbox;
|
|
493
753
|
|
|
494
754
|
// app/components/Chip.tsx
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var chipVariants = (0,
|
|
498
|
-
"
|
|
755
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
756
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
757
|
+
var chipVariants = (0, import_class_variance_authority4.cva)(
|
|
758
|
+
"inline-flex items-center w-fit gap-2 rounded-full capitalize",
|
|
499
759
|
{
|
|
500
760
|
variants: {
|
|
501
761
|
intent: {
|
|
@@ -503,6 +763,7 @@ var chipVariants = (0, import_class_variance_authority3.cva)(
|
|
|
503
763
|
success: "bg-success-50 text-success-600",
|
|
504
764
|
warning: "bg-warning-50 text-warning-500",
|
|
505
765
|
error: "bg-error-50 text-error-600",
|
|
766
|
+
blue: "bg-blue-100 text-blue-700",
|
|
506
767
|
primary: "bg-primary-100 text-primary-700",
|
|
507
768
|
bluegray: "bg-bluegray-100 text-bluegray-500",
|
|
508
769
|
bluelight: "bg-bluelight-100 text-bluelight-600",
|
|
@@ -516,7 +777,7 @@ var chipVariants = (0, import_class_variance_authority3.cva)(
|
|
|
516
777
|
size: {
|
|
517
778
|
sm: "text-xs px-2 py-0.5",
|
|
518
779
|
md: "text-sm px-2.5 py-0.5",
|
|
519
|
-
lg: "text-
|
|
780
|
+
lg: "text-base px-3 py-1"
|
|
520
781
|
}
|
|
521
782
|
},
|
|
522
783
|
defaultVariants: {
|
|
@@ -530,6 +791,7 @@ var dotColorVariants = {
|
|
|
530
791
|
success: "bg-success-600",
|
|
531
792
|
warning: "bg-warning-600",
|
|
532
793
|
error: "bg-error-600",
|
|
794
|
+
blue: "bg-blue-600",
|
|
533
795
|
primary: "bg-primary-600",
|
|
534
796
|
bluegray: "bg-bluegray-500",
|
|
535
797
|
bluelight: "bg-bluelight-600",
|
|
@@ -546,24 +808,37 @@ var Chip = ({
|
|
|
546
808
|
size,
|
|
547
809
|
intent = "default",
|
|
548
810
|
dot,
|
|
549
|
-
dotColor
|
|
811
|
+
dotColor,
|
|
812
|
+
startIcon,
|
|
813
|
+
endIcon,
|
|
814
|
+
...rest
|
|
550
815
|
}) => {
|
|
551
816
|
const resolvedIntent = intent ?? "default";
|
|
552
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
553
818
|
"span",
|
|
554
819
|
{
|
|
555
|
-
className: cn(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
820
|
+
className: cn(chipVariants({ intent: resolvedIntent, size }), className),
|
|
821
|
+
...rest
|
|
822
|
+
},
|
|
823
|
+
startIcon && /* @__PURE__ */ import_react10.default.createElement("span", { "aria-hidden": "true" }, startIcon),
|
|
824
|
+
!startIcon && dot && /* @__PURE__ */ import_react10.default.createElement(
|
|
825
|
+
"span",
|
|
826
|
+
{
|
|
827
|
+
"aria-hidden": "true",
|
|
828
|
+
className: cn(
|
|
829
|
+
"w-1.5 h-1.5 rounded-full",
|
|
830
|
+
dotColor || dotColorVariants[resolvedIntent] || "bg-primary-600"
|
|
831
|
+
)
|
|
832
|
+
}
|
|
833
|
+
),
|
|
834
|
+
children,
|
|
835
|
+
endIcon && /* @__PURE__ */ import_react10.default.createElement("span", { "aria-hidden": "true" }, endIcon)
|
|
836
|
+
);
|
|
562
837
|
};
|
|
563
838
|
var Chip_default = Chip;
|
|
564
839
|
|
|
565
840
|
// app/components/CircularProgress.tsx
|
|
566
|
-
var
|
|
841
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
567
842
|
var CircularProgressBar = ({
|
|
568
843
|
percentage,
|
|
569
844
|
size = 160,
|
|
@@ -575,7 +850,7 @@ var CircularProgressBar = ({
|
|
|
575
850
|
const viewBox = `0 0 ${size} ${size}`;
|
|
576
851
|
const dashArray = radius * Math.PI * 2;
|
|
577
852
|
const dashOffset = dashArray - dashArray * (percentage || 0) / 100;
|
|
578
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ import_react11.default.createElement("svg", { width: size, height: size, viewBox }, /* @__PURE__ */ import_react11.default.createElement(
|
|
579
854
|
"circle",
|
|
580
855
|
{
|
|
581
856
|
className: "fill-none stroke-gray-200",
|
|
@@ -584,7 +859,7 @@ var CircularProgressBar = ({
|
|
|
584
859
|
r: radius,
|
|
585
860
|
strokeWidth: `${strokeWidth}px`
|
|
586
861
|
}
|
|
587
|
-
), /* @__PURE__ */
|
|
862
|
+
), /* @__PURE__ */ import_react11.default.createElement(
|
|
588
863
|
"circle",
|
|
589
864
|
{
|
|
590
865
|
className: "fill-none stroke-primary-600 transition-all delay-200 ease-in",
|
|
@@ -599,7 +874,7 @@ var CircularProgressBar = ({
|
|
|
599
874
|
strokeDashoffset: dashOffset
|
|
600
875
|
}
|
|
601
876
|
}
|
|
602
|
-
), /* @__PURE__ */
|
|
877
|
+
), /* @__PURE__ */ import_react11.default.createElement(
|
|
603
878
|
"text",
|
|
604
879
|
{
|
|
605
880
|
x: "50%",
|
|
@@ -615,14 +890,14 @@ var CircularProgressBar = ({
|
|
|
615
890
|
var CircularProgress_default = CircularProgressBar;
|
|
616
891
|
|
|
617
892
|
// app/components/Divider.tsx
|
|
618
|
-
var
|
|
893
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
619
894
|
var Divider = ({
|
|
620
895
|
width,
|
|
621
896
|
height,
|
|
622
897
|
position = "horizontal",
|
|
623
898
|
className
|
|
624
899
|
}) => {
|
|
625
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
626
901
|
"div",
|
|
627
902
|
{
|
|
628
903
|
style: {
|
|
@@ -639,52 +914,142 @@ var Divider = ({
|
|
|
639
914
|
};
|
|
640
915
|
var Divider_default = Divider;
|
|
641
916
|
|
|
917
|
+
// app/components/Drawer.tsx
|
|
918
|
+
var import_react13 = require("react");
|
|
919
|
+
var import_react14 = require("@remixicon/react");
|
|
920
|
+
var Drawer = ({
|
|
921
|
+
isOpen,
|
|
922
|
+
setIsOpen,
|
|
923
|
+
children,
|
|
924
|
+
position = "right",
|
|
925
|
+
width = "w-80",
|
|
926
|
+
height = "h-64",
|
|
927
|
+
className,
|
|
928
|
+
showCloseButton = true,
|
|
929
|
+
closeOnOutsideClick = true
|
|
930
|
+
}) => {
|
|
931
|
+
const handleClose = (0, import_react13.useCallback)(() => {
|
|
932
|
+
setIsOpen(false);
|
|
933
|
+
}, [setIsOpen]);
|
|
934
|
+
(0, import_react13.useEffect)(() => {
|
|
935
|
+
document.body.style.overflow = isOpen ? "hidden" : "";
|
|
936
|
+
}, [isOpen]);
|
|
937
|
+
(0, import_react13.useEffect)(() => {
|
|
938
|
+
const handleKeyDown = (e) => {
|
|
939
|
+
if (e.key === "Escape" && isOpen) {
|
|
940
|
+
handleClose();
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
944
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
945
|
+
}, [isOpen, handleClose]);
|
|
946
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
947
|
+
"div",
|
|
948
|
+
{
|
|
949
|
+
className: cn(
|
|
950
|
+
"fixed inset-0 bg-black/50 transition-opacity duration-300 z-[10000000000000000]",
|
|
951
|
+
isOpen ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
952
|
+
),
|
|
953
|
+
onClick: () => closeOnOutsideClick && handleClose()
|
|
954
|
+
}
|
|
955
|
+
), /* @__PURE__ */ React.createElement(
|
|
956
|
+
"div",
|
|
957
|
+
{
|
|
958
|
+
className: cn(
|
|
959
|
+
"fixed bg-white shadow-xl p-4 transition-transform duration-300 z-[100000000000000000]",
|
|
960
|
+
position === "right" && `top-0 right-0 ${width} h-full`,
|
|
961
|
+
position === "left" && `top-0 left-0 ${width} h-full`,
|
|
962
|
+
position === "top" && `top-0 left-0 w-full ${height}`,
|
|
963
|
+
position === "bottom" && `bottom-0 left-0 w-full ${height}`,
|
|
964
|
+
!isOpen && (position === "right" ? "translate-x-full" : position === "left" ? "-translate-x-full" : position === "top" ? "-translate-y-full" : "translate-y-full"),
|
|
965
|
+
isOpen && "translate-x-0 translate-y-0",
|
|
966
|
+
className
|
|
967
|
+
),
|
|
968
|
+
onClick: (e) => e.stopPropagation()
|
|
969
|
+
},
|
|
970
|
+
showCloseButton && /* @__PURE__ */ React.createElement(
|
|
971
|
+
Button_default,
|
|
972
|
+
{
|
|
973
|
+
size: "sm",
|
|
974
|
+
variant: "outlined",
|
|
975
|
+
intent: "default-outlined",
|
|
976
|
+
onClick: handleClose,
|
|
977
|
+
startIcon: /* @__PURE__ */ React.createElement(import_react14.RiCloseLine, { size: 20 }),
|
|
978
|
+
"aria-label": "Close drawer",
|
|
979
|
+
className: "absolute border-none p-1 transition-colors top-3 right-4"
|
|
980
|
+
}
|
|
981
|
+
),
|
|
982
|
+
/* @__PURE__ */ React.createElement("div", { className: "overflow-y-auto h-full" }, children)
|
|
983
|
+
));
|
|
984
|
+
};
|
|
985
|
+
var Drawer_default = Drawer;
|
|
986
|
+
|
|
642
987
|
// app/components/Dropdown.tsx
|
|
643
|
-
var
|
|
644
|
-
var
|
|
988
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
989
|
+
var import_react18 = require("@remixicon/react");
|
|
645
990
|
|
|
646
991
|
// app/components/Input.tsx
|
|
647
|
-
var
|
|
648
|
-
var Input = (0,
|
|
649
|
-
({
|
|
650
|
-
|
|
992
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
993
|
+
var Input = (0, import_react15.forwardRef)(
|
|
994
|
+
({
|
|
995
|
+
size,
|
|
996
|
+
startIcon,
|
|
997
|
+
endIcon,
|
|
998
|
+
className,
|
|
999
|
+
type,
|
|
1000
|
+
error,
|
|
1001
|
+
disabled,
|
|
1002
|
+
id,
|
|
1003
|
+
"aria-label": ariaLabel,
|
|
1004
|
+
"aria-describedby": ariaDescribedby,
|
|
1005
|
+
...props
|
|
1006
|
+
}, ref) => {
|
|
1007
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
651
1008
|
"div",
|
|
652
1009
|
{
|
|
653
1010
|
className: cn(
|
|
654
|
-
"group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-
|
|
1011
|
+
"group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-[0px_1px_2px_0px_#1018280D] hover:bg-gray-50 hover:border-gray-300 focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 has-[:disabled]:opacity-30 has-[:disabled]:bg-gray-300 has-[:disabled]:select-none has-[:disabled]:pointer-events-none",
|
|
655
1012
|
size === "sm" ? "w-[320px] h-10" : size === "lg" ? "w-[313px] h-11" : "w-full h-10",
|
|
1013
|
+
error && "border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:hover:border-error-500",
|
|
656
1014
|
className
|
|
657
1015
|
)
|
|
658
1016
|
},
|
|
659
|
-
/* @__PURE__ */
|
|
1017
|
+
startIcon && /* @__PURE__ */ import_react15.default.createElement(
|
|
660
1018
|
"span",
|
|
661
1019
|
{
|
|
1020
|
+
"aria-hidden": "true",
|
|
662
1021
|
className: cn(
|
|
663
|
-
|
|
664
|
-
disabled
|
|
1022
|
+
"group-hover:text-gray-600 group-focus-within:text-gray-600",
|
|
1023
|
+
disabled && "text-gray-900",
|
|
1024
|
+
error && "text-error-500"
|
|
665
1025
|
)
|
|
666
1026
|
},
|
|
667
1027
|
startIcon
|
|
668
1028
|
),
|
|
669
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
670
1030
|
"input",
|
|
671
1031
|
{
|
|
672
1032
|
...props,
|
|
673
1033
|
ref,
|
|
1034
|
+
id,
|
|
674
1035
|
disabled,
|
|
675
1036
|
type,
|
|
1037
|
+
"aria-label": ariaLabel,
|
|
1038
|
+
"aria-describedby": ariaDescribedby,
|
|
1039
|
+
"aria-disabled": disabled,
|
|
676
1040
|
className: cn(
|
|
677
|
-
"w-full text-sm focus:outline-none bg-transparent disabled:text-gray-900 placeholder:text-gray-500 group-hover:placeholder:text-gray-500",
|
|
1041
|
+
"w-full text-sm focus:outline-none focus:ring-offset-0 bg-transparent disabled:text-gray-900 placeholder:text-gray-500 group-hover:placeholder:text-gray-500 rounded-md",
|
|
678
1042
|
size
|
|
679
1043
|
)
|
|
680
1044
|
}
|
|
681
1045
|
),
|
|
682
|
-
/* @__PURE__ */
|
|
1046
|
+
endIcon && /* @__PURE__ */ import_react15.default.createElement(
|
|
683
1047
|
"span",
|
|
684
1048
|
{
|
|
1049
|
+
"aria-hidden": "true",
|
|
685
1050
|
className: cn(
|
|
686
|
-
|
|
687
|
-
disabled
|
|
1051
|
+
"group-hover:text-gray-600 group-focus-within:text-gray-600",
|
|
1052
|
+
disabled && "text-gray-900"
|
|
688
1053
|
)
|
|
689
1054
|
},
|
|
690
1055
|
endIcon
|
|
@@ -696,9 +1061,9 @@ Input.displayName = "Input";
|
|
|
696
1061
|
var Input_default = Input;
|
|
697
1062
|
|
|
698
1063
|
// app/components/Label.tsx
|
|
699
|
-
var
|
|
700
|
-
var
|
|
701
|
-
var labelVariants = (0,
|
|
1064
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1065
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
1066
|
+
var labelVariants = (0, import_class_variance_authority5.cva)("flex item-start", {
|
|
702
1067
|
variants: {
|
|
703
1068
|
size: {
|
|
704
1069
|
sm: "text-xs",
|
|
@@ -719,52 +1084,39 @@ var Label = ({
|
|
|
719
1084
|
className,
|
|
720
1085
|
...props
|
|
721
1086
|
}) => {
|
|
722
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
723
1088
|
"label",
|
|
724
1089
|
{
|
|
725
1090
|
htmlFor,
|
|
726
|
-
className: cn(
|
|
1091
|
+
className: cn(
|
|
1092
|
+
"cursor-pointer",
|
|
1093
|
+
labelVariants({ className, size }),
|
|
1094
|
+
disabled === true ? "opacity-30 select-none pointer-events-none" : "opacity-100"
|
|
1095
|
+
),
|
|
1096
|
+
"aria-disabled": disabled,
|
|
727
1097
|
...props
|
|
728
1098
|
},
|
|
729
|
-
children,
|
|
730
|
-
|
|
1099
|
+
/* @__PURE__ */ import_react16.default.createElement("span", { className: "flex items-center gap-1" }, children, required && /* @__PURE__ */ import_react16.default.createElement(
|
|
1100
|
+
"span",
|
|
1101
|
+
{
|
|
1102
|
+
"aria-label": "required field",
|
|
1103
|
+
role: "presentation",
|
|
1104
|
+
className: "text-red-500",
|
|
1105
|
+
"aria-hidden": "true"
|
|
1106
|
+
},
|
|
1107
|
+
"*"
|
|
1108
|
+
))
|
|
731
1109
|
);
|
|
732
1110
|
};
|
|
733
1111
|
var Label_default = Label;
|
|
734
1112
|
|
|
735
|
-
// app/components/Tooltip.tsx
|
|
736
|
-
var import_class_variance_authority5 = require("class-variance-authority");
|
|
737
|
-
var import_react13 = __toESM(require("react"), 1);
|
|
738
|
-
var tooltipVariants = (0, import_class_variance_authority5.cva)(
|
|
739
|
-
"bg-white shadow-lg rounded-lg absolute hidden group-hover:block p-3 z-10 max-w-[328px] w-max whitespace-normal opacity-0 group-hover:opacity-100 transform transition-all duration-1000 ease-in-out group-hover:delay-[2000ms]",
|
|
740
|
-
{
|
|
741
|
-
variants: {
|
|
742
|
-
position: {
|
|
743
|
-
top: "bottom-[calc(100%+0px)] group-hover:translate-y-0 delay-1000 translate-y-[-10px]",
|
|
744
|
-
right: "top-1/2 -translate-y-1/2 left-[calc(100%+0px)] group-hover:translate-x-0 translate-x-[-10px]",
|
|
745
|
-
bottom: "top-[calc(100%+0px)] group-hover:translate-y-0 translate-y-[10px]",
|
|
746
|
-
left: "top-1/2 -translate-y-1/2 right-[calc(100%+0px)] group-hover:translate-x-0 translate-x-[10px]"
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
);
|
|
751
|
-
var Tooltip = ({
|
|
752
|
-
position,
|
|
753
|
-
content,
|
|
754
|
-
children,
|
|
755
|
-
className,
|
|
756
|
-
...props
|
|
757
|
-
}) => {
|
|
758
|
-
return /* @__PURE__ */ import_react13.default.createElement("div", { ...props, className: "relative cursor-pointer text-sm group" }, /* @__PURE__ */ import_react13.default.createElement("div", null, children), /* @__PURE__ */ import_react13.default.createElement("span", { className: cn(tooltipVariants({ position }), className) }, content));
|
|
759
|
-
};
|
|
760
|
-
var Tooltip_default = Tooltip;
|
|
761
|
-
|
|
762
1113
|
// app/components/Dropdown.tsx
|
|
763
1114
|
var defaultRenderItem = (option) => {
|
|
764
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ import_react17.default.createElement(MenuItem, { label: option.label, value: option.value });
|
|
765
1116
|
};
|
|
766
|
-
var Dropdown = (0,
|
|
1117
|
+
var Dropdown = (0, import_react17.forwardRef)(
|
|
767
1118
|
({
|
|
1119
|
+
id = `dropdown-${Math.random().toString(36).substring(2, 11)}`,
|
|
768
1120
|
options,
|
|
769
1121
|
selected,
|
|
770
1122
|
setSelected,
|
|
@@ -777,39 +1129,42 @@ var Dropdown = (0, import_react14.forwardRef)(
|
|
|
777
1129
|
position = "top",
|
|
778
1130
|
width,
|
|
779
1131
|
info,
|
|
780
|
-
dropDownTooltip = false,
|
|
781
1132
|
dropdownFooter = false,
|
|
782
1133
|
onApply,
|
|
783
1134
|
disabled = false,
|
|
784
|
-
onReset
|
|
1135
|
+
onReset,
|
|
1136
|
+
footerAction
|
|
785
1137
|
}, ref) => {
|
|
786
1138
|
var _a, _b;
|
|
787
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
788
|
-
const [filteredOptions, setFilteredOptions] = (0,
|
|
1139
|
+
const [searchQuery, setSearchQuery] = (0, import_react17.useState)("");
|
|
1140
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react17.useState)(
|
|
789
1141
|
options || []
|
|
790
1142
|
);
|
|
791
|
-
const [dropdownMenu, setDropdownMenu] = (0,
|
|
792
|
-
const dropdownRef = (0,
|
|
793
|
-
(0,
|
|
794
|
-
(0,
|
|
1143
|
+
const [dropdownMenu, setDropdownMenu] = (0, import_react17.useState)(false);
|
|
1144
|
+
const dropdownRef = (0, import_react17.useRef)(null);
|
|
1145
|
+
(0, import_react17.useImperativeHandle)(ref, () => dropdownRef.current);
|
|
1146
|
+
(0, import_react17.useEffect)(() => {
|
|
795
1147
|
if (options) {
|
|
796
1148
|
setFilteredOptions(options);
|
|
797
1149
|
}
|
|
798
1150
|
}, [options]);
|
|
799
|
-
const memoizedFilteredOptions = (0,
|
|
1151
|
+
const memoizedFilteredOptions = (0, import_react17.useMemo)(() => {
|
|
800
1152
|
if (!search)
|
|
801
1153
|
return filteredOptions;
|
|
802
|
-
return filteredOptions.filter(
|
|
803
|
-
(
|
|
804
|
-
|
|
1154
|
+
return filteredOptions.filter((option) => {
|
|
1155
|
+
if (typeof option.label === "string") {
|
|
1156
|
+
return option.label.toLowerCase().includes(searchQuery.toLowerCase());
|
|
1157
|
+
}
|
|
1158
|
+
return option.label.toString().includes(searchQuery.toLowerCase());
|
|
1159
|
+
});
|
|
805
1160
|
}, [search, searchQuery, filteredOptions]);
|
|
806
|
-
const handleSearchChange = (0,
|
|
1161
|
+
const handleSearchChange = (0, import_react17.useCallback)(
|
|
807
1162
|
(e) => {
|
|
808
1163
|
setSearchQuery(e.target.value);
|
|
809
1164
|
},
|
|
810
1165
|
[]
|
|
811
1166
|
);
|
|
812
|
-
const toggleOption = (0,
|
|
1167
|
+
const toggleOption = (0, import_react17.useCallback)(
|
|
813
1168
|
(option) => {
|
|
814
1169
|
if (multiple && setSelected) {
|
|
815
1170
|
setSelected(
|
|
@@ -822,7 +1177,7 @@ var Dropdown = (0, import_react14.forwardRef)(
|
|
|
822
1177
|
},
|
|
823
1178
|
[multiple, setSelected]
|
|
824
1179
|
);
|
|
825
|
-
const handleCheckboxChange = (0,
|
|
1180
|
+
const handleCheckboxChange = (0, import_react17.useCallback)(
|
|
826
1181
|
(option) => {
|
|
827
1182
|
if (multiple && setSelected) {
|
|
828
1183
|
setSelected(
|
|
@@ -848,7 +1203,7 @@ var Dropdown = (0, import_react14.forwardRef)(
|
|
|
848
1203
|
setSelected == null ? void 0 : setSelected([]);
|
|
849
1204
|
setDropdownMenu(false);
|
|
850
1205
|
};
|
|
851
|
-
(0,
|
|
1206
|
+
(0, import_react17.useEffect)(() => {
|
|
852
1207
|
document.addEventListener("mousedown", handleClickOutside);
|
|
853
1208
|
return () => {
|
|
854
1209
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
@@ -859,12 +1214,13 @@ var Dropdown = (0, import_react14.forwardRef)(
|
|
|
859
1214
|
setDropdownMenu(false);
|
|
860
1215
|
}
|
|
861
1216
|
};
|
|
862
|
-
return /* @__PURE__ */
|
|
1217
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
863
1218
|
"div",
|
|
864
1219
|
{
|
|
1220
|
+
id,
|
|
865
1221
|
ref: dropdownRef,
|
|
866
1222
|
className: cn(
|
|
867
|
-
"relative ",
|
|
1223
|
+
"relative bg-gray-25 shadow-[0px_1px_2px_0px_#1018280D] rounded-lg",
|
|
868
1224
|
!width && "w-full",
|
|
869
1225
|
disabled && "cursor-not-allowed opacity-50"
|
|
870
1226
|
),
|
|
@@ -872,110 +1228,143 @@ var Dropdown = (0, import_react14.forwardRef)(
|
|
|
872
1228
|
width
|
|
873
1229
|
}
|
|
874
1230
|
},
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
"
|
|
1231
|
+
/* @__PURE__ */ import_react17.default.createElement(
|
|
1232
|
+
"button",
|
|
877
1233
|
{
|
|
1234
|
+
type: "button",
|
|
1235
|
+
"aria-haspopup": "listbox",
|
|
1236
|
+
"aria-expanded": dropdownMenu,
|
|
1237
|
+
"aria-labelledby": `${id}-label`,
|
|
1238
|
+
disabled,
|
|
878
1239
|
onClick: () => !disabled && setDropdownMenu((prev) => !prev),
|
|
1240
|
+
onKeyDown: (e) => {
|
|
1241
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1242
|
+
e.preventDefault();
|
|
1243
|
+
!disabled && setDropdownMenu((prev) => !prev);
|
|
1244
|
+
}
|
|
1245
|
+
},
|
|
879
1246
|
className: cn(
|
|
880
|
-
"hover:bg-gray-50 py-2 px-[14px] rounded-lg flex justify-between items-center text-gray-900 bg-gray-25 text-text-sm cursor-pointer",
|
|
881
|
-
dropdownMenu ? "border border-
|
|
1247
|
+
"w-full hover:bg-gray-50 py-2 px-[14px] rounded-lg flex justify-between items-center text-gray-900 bg-gray-25 text-text-sm cursor-pointer",
|
|
1248
|
+
dropdownMenu ? "border border-primary-600" : "border border-gray-200",
|
|
882
1249
|
disabled && "bg-gray-300 hover:bg-gray-300 cursor-not-allowed"
|
|
883
1250
|
)
|
|
884
1251
|
},
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
|
|
887
|
-
{
|
|
888
|
-
className: cn(
|
|
889
|
-
"flex items-center gap-2 text-ellipsis overflow-hidden"
|
|
890
|
-
)
|
|
891
|
-
},
|
|
892
|
-
icon && /* @__PURE__ */ import_react14.default.createElement("span", null, icon),
|
|
893
|
-
/* @__PURE__ */ import_react14.default.createElement("p", { className: "line-clamp-1 w-full" }, multiple ? ((selected == null ? void 0 : selected.length) ?? 0) > 0 ? `${selected == null ? void 0 : selected.length} Selected` : dropdownText : ((_a = selected == null ? void 0 : selected[0]) == null ? void 0 : _a.label) ? (_b = selected == null ? void 0 : selected[0]) == null ? void 0 : _b.label : dropdownText)
|
|
894
|
-
),
|
|
895
|
-
/* @__PURE__ */ import_react14.default.createElement(import_react15.RiArrowDownSLine, { size: 18 })
|
|
1252
|
+
/* @__PURE__ */ import_react17.default.createElement("section", { className: "flex items-center gap-2 text-ellipsis overflow-hidden" }, icon && /* @__PURE__ */ import_react17.default.createElement("span", { "aria-hidden": "true" }, icon), /* @__PURE__ */ import_react17.default.createElement("span", { id: `${id}-label`, className: "line-clamp-1 w-full" }, multiple ? ((selected == null ? void 0 : selected.length) ?? 0) > 0 ? `${selected == null ? void 0 : selected.length} Selected` : dropdownText : ((_a = selected == null ? void 0 : selected[0]) == null ? void 0 : _a.label) ? (_b = selected == null ? void 0 : selected[0]) == null ? void 0 : _b.label : dropdownText)),
|
|
1253
|
+
/* @__PURE__ */ import_react17.default.createElement(import_react18.RiArrowDownSLine, { "aria-hidden": "true", size: 18 })
|
|
896
1254
|
),
|
|
897
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ import_react17.default.createElement(
|
|
898
1256
|
"ul",
|
|
899
1257
|
{
|
|
1258
|
+
role: "listbox",
|
|
1259
|
+
"aria-multiselectable": multiple,
|
|
1260
|
+
"aria-labelledby": `${id}-label`,
|
|
900
1261
|
className: cn(
|
|
901
1262
|
"max-h-0 opacity-0 overflow-hidden shadow-sm mt-1 rounded absolute text-[16px] bg-white z-[1000] w-full transition-all duration-75 delay-100 ease-in",
|
|
902
1263
|
position === "top" ? "top-10" : "bottom-10",
|
|
903
|
-
dropdownMenu
|
|
1264
|
+
dropdownMenu ? "border border-primary-600" : "border border-gray-200",
|
|
1265
|
+
dropdownMenu && "max-h-[360px] h-fit opacity-[1] transition-all ease-in duration-150"
|
|
904
1266
|
)
|
|
905
1267
|
},
|
|
906
|
-
search && /* @__PURE__ */
|
|
1268
|
+
search && /* @__PURE__ */ import_react17.default.createElement(
|
|
907
1269
|
Input_default,
|
|
908
1270
|
{
|
|
1271
|
+
id: `${id}-search`,
|
|
909
1272
|
type: "text",
|
|
910
1273
|
placeholder: "Search...",
|
|
1274
|
+
"aria-label": "Search options",
|
|
911
1275
|
value: searchQuery,
|
|
912
1276
|
onChange: handleSearchChange,
|
|
913
|
-
className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3",
|
|
914
|
-
endIcon: /* @__PURE__ */
|
|
1277
|
+
className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3 border-none",
|
|
1278
|
+
endIcon: /* @__PURE__ */ import_react17.default.createElement(import_react18.RiSearchLine, { size: 18 })
|
|
915
1279
|
}
|
|
916
1280
|
),
|
|
917
|
-
multiple && /* @__PURE__ */
|
|
918
|
-
"
|
|
1281
|
+
multiple && /* @__PURE__ */ import_react17.default.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1282
|
+
"button",
|
|
919
1283
|
{
|
|
1284
|
+
type: "button",
|
|
1285
|
+
"aria-label": "Select all",
|
|
920
1286
|
onClick: handleSelectAll,
|
|
921
1287
|
className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
|
|
922
1288
|
},
|
|
923
1289
|
"Select all"
|
|
924
|
-
), /* @__PURE__ */
|
|
1290
|
+
), /* @__PURE__ */ import_react17.default.createElement(
|
|
925
1291
|
"button",
|
|
926
1292
|
{
|
|
1293
|
+
"aria-label": "Reset",
|
|
1294
|
+
type: "button",
|
|
927
1295
|
className: "text-text-sm text-warning-500 hover:text-warning-600",
|
|
928
1296
|
onClick: handleReset
|
|
929
1297
|
},
|
|
930
1298
|
"Reset"
|
|
931
1299
|
)),
|
|
932
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ import_react17.default.createElement("section", { className: "max-h-[200px] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions == null ? void 0 : memoizedFilteredOptions.map((option, i) => {
|
|
933
1301
|
var _a2;
|
|
934
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react17.default.Fragment, { key: i }, multiple ? /* @__PURE__ */ import_react17.default.createElement(
|
|
935
1303
|
Label_default,
|
|
936
1304
|
{
|
|
937
|
-
className:
|
|
938
|
-
|
|
1305
|
+
className: cn(
|
|
1306
|
+
"has-[:checked]:bg-primary-50 has-[:checked]:border-primary-600 hover:bg-gray-50 flex flex-col py-[6px] px-[14px] cursor-pointer border-l-4 border-transparent",
|
|
1307
|
+
(option == null ? void 0 : option.disabledOption) && "opacity-50 cursor-not-allowed hover:bg-white text-gray-300 select-none"
|
|
1308
|
+
),
|
|
1309
|
+
htmlFor: `${id}-checkbox-${option.value}`,
|
|
939
1310
|
key: i
|
|
940
1311
|
},
|
|
941
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ import_react17.default.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ import_react17.default.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ import_react17.default.createElement(
|
|
942
1313
|
Checkbox_default,
|
|
943
1314
|
{
|
|
944
|
-
id:
|
|
1315
|
+
id: `${id}-checkbox-${option.value}`,
|
|
945
1316
|
checked: (selected == null ? void 0 : selected.some(
|
|
946
1317
|
(item) => item.value === option.value
|
|
947
1318
|
)) ?? false,
|
|
948
|
-
onChange: () => handleCheckboxChange(option)
|
|
1319
|
+
onChange: () => handleCheckboxChange(option),
|
|
1320
|
+
disabled: option == null ? void 0 : option.disabledOption
|
|
949
1321
|
}
|
|
950
|
-
), /* @__PURE__ */
|
|
951
|
-
|
|
1322
|
+
), /* @__PURE__ */ import_react17.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1323
|
+
"div",
|
|
952
1324
|
{
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1325
|
+
style: {
|
|
1326
|
+
color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
|
|
1327
|
+
},
|
|
1328
|
+
className: cn(
|
|
1329
|
+
"break-words",
|
|
1330
|
+
(option == null ? void 0 : option.disabledOption) && "text-gray-300"
|
|
1331
|
+
)
|
|
1332
|
+
},
|
|
1333
|
+
renderItem(option)
|
|
1334
|
+
))), /* @__PURE__ */ import_react17.default.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
|
|
1335
|
+
/* @__PURE__ */ import_react17.default.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
|
|
1336
|
+
) : /* @__PURE__ */ import_react17.default.createElement(
|
|
958
1337
|
Label_default,
|
|
959
1338
|
{
|
|
960
1339
|
key: i,
|
|
1340
|
+
htmlFor: `${id}-checkbox-${option.value}`,
|
|
961
1341
|
className: cn(
|
|
962
1342
|
"flex justify-between py-[6px] px-[14px] hover:bg-gray-50 gap-2 items-center border-l-4 border-transparent cursor-pointer",
|
|
963
1343
|
{
|
|
964
|
-
"bg-primary-50 border-primary-600": selected && ((_a2 = selected[0]) == null ? void 0 : _a2.value) === option.value
|
|
1344
|
+
"bg-primary-50 border-primary-600": selected && ((_a2 = selected[0]) == null ? void 0 : _a2.value) === option.value,
|
|
1345
|
+
"opacity-50 cursor-not-allowed hover:bg-white text-gray-500": option == null ? void 0 : option.disabledOption
|
|
965
1346
|
}
|
|
966
1347
|
),
|
|
967
|
-
onClick: () => toggleOption(option)
|
|
1348
|
+
onClick: () => !(option == null ? void 0 : option.disabledOption) && toggleOption(option)
|
|
968
1349
|
},
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
|
|
1350
|
+
/* @__PURE__ */ import_react17.default.createElement(
|
|
1351
|
+
"div",
|
|
971
1352
|
{
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1353
|
+
style: {
|
|
1354
|
+
color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
|
|
1355
|
+
},
|
|
1356
|
+
className: cn(
|
|
1357
|
+
"break-words",
|
|
1358
|
+
(option == null ? void 0 : option.disabledOption) && "text-gray-300"
|
|
1359
|
+
)
|
|
1360
|
+
},
|
|
1361
|
+
renderItem(option)
|
|
1362
|
+
),
|
|
1363
|
+
/* @__PURE__ */ import_react17.default.createElement("span", { className: "text-gray-500" }, info)
|
|
976
1364
|
));
|
|
977
1365
|
}) : children),
|
|
978
|
-
|
|
1366
|
+
footerAction && /* @__PURE__ */ import_react17.default.createElement("div", { className: "py-2 mt-1 px-2 border-t" }, footerAction),
|
|
1367
|
+
dropdownFooter && /* @__PURE__ */ import_react17.default.createElement(
|
|
979
1368
|
DropdownFooter,
|
|
980
1369
|
{
|
|
981
1370
|
setDropdownMenu,
|
|
@@ -987,28 +1376,24 @@ var Dropdown = (0, import_react14.forwardRef)(
|
|
|
987
1376
|
}
|
|
988
1377
|
);
|
|
989
1378
|
var MenuItem = ({ label, children }) => {
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
};
|
|
992
|
-
var DropdownTooltip = ({
|
|
993
|
-
tooltipContent
|
|
994
|
-
}) => {
|
|
995
|
-
const content = tooltipContent || "";
|
|
996
|
-
return content ? /* @__PURE__ */ import_react14.default.createElement(Tooltip_default, { position: "right", content }, /* @__PURE__ */ import_react14.default.createElement(import_react15.RiErrorWarningLine, { color: "#98A2B3", size: 14 })) : null;
|
|
1379
|
+
return /* @__PURE__ */ import_react17.default.createElement("p", { className: "break-all" }, label || children);
|
|
997
1380
|
};
|
|
998
1381
|
var DropdownFooter = ({
|
|
999
|
-
// onReset,
|
|
1000
1382
|
onApply,
|
|
1001
1383
|
setDropdownMenu
|
|
1002
1384
|
}) => {
|
|
1003
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { className: "flex justify-end border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1004
1386
|
"button",
|
|
1005
1387
|
{
|
|
1388
|
+
type: "button",
|
|
1006
1389
|
className: "text-primary-600 hover:text-primary-700",
|
|
1007
1390
|
onClick: () => {
|
|
1008
1391
|
if (onApply) {
|
|
1009
1392
|
onApply();
|
|
1010
1393
|
}
|
|
1011
|
-
setDropdownMenu
|
|
1394
|
+
if (setDropdownMenu) {
|
|
1395
|
+
setDropdownMenu(false);
|
|
1396
|
+
}
|
|
1012
1397
|
}
|
|
1013
1398
|
},
|
|
1014
1399
|
"Apply"
|
|
@@ -1017,38 +1402,324 @@ var DropdownFooter = ({
|
|
|
1017
1402
|
Dropdown.displayName = "Dropdown";
|
|
1018
1403
|
var Dropdown_default = Dropdown;
|
|
1019
1404
|
|
|
1020
|
-
// app/components/
|
|
1021
|
-
var
|
|
1022
|
-
var
|
|
1405
|
+
// app/components/DropdownMenu.tsx
|
|
1406
|
+
var import_react19 = require("@remixicon/react");
|
|
1407
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
1408
|
+
var DropdownContext = import_react20.default.createContext(null);
|
|
1409
|
+
function DropdownMenu({ children }) {
|
|
1410
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
1411
|
+
const [focusedIndex, setFocusedIndex] = (0, import_react20.useState)(-1);
|
|
1412
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
1413
|
+
const contentRef = (0, import_react20.useRef)(null);
|
|
1414
|
+
const menuItemsRef = (0, import_react20.useRef)([]);
|
|
1415
|
+
const itemsCountRef = (0, import_react20.useRef)(0);
|
|
1416
|
+
const registerItem = (0, import_react20.useCallback)(() => {
|
|
1417
|
+
const idx = itemsCountRef.current;
|
|
1418
|
+
itemsCountRef.current += 1;
|
|
1419
|
+
return idx;
|
|
1420
|
+
}, []);
|
|
1421
|
+
const closeMenu = () => {
|
|
1422
|
+
setIsOpen(false);
|
|
1423
|
+
setFocusedIndex(-1);
|
|
1424
|
+
};
|
|
1425
|
+
(0, import_react20.useEffect)(() => {
|
|
1426
|
+
if (!isOpen)
|
|
1427
|
+
return;
|
|
1428
|
+
const handleClickOutside = (e) => {
|
|
1429
|
+
if (triggerRef.current && contentRef.current && !triggerRef.current.contains(e.target) && !contentRef.current.contains(e.target)) {
|
|
1430
|
+
closeMenu();
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1434
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1435
|
+
}, [isOpen]);
|
|
1436
|
+
(0, import_react20.useEffect)(() => {
|
|
1437
|
+
if (!isOpen)
|
|
1438
|
+
return;
|
|
1439
|
+
const handleKey = (event) => {
|
|
1440
|
+
var _a;
|
|
1441
|
+
switch (event.key) {
|
|
1442
|
+
case "Escape":
|
|
1443
|
+
event.preventDefault();
|
|
1444
|
+
closeMenu();
|
|
1445
|
+
(_a = triggerRef.current) == null ? void 0 : _a.focus();
|
|
1446
|
+
break;
|
|
1447
|
+
case "ArrowDown":
|
|
1448
|
+
event.preventDefault();
|
|
1449
|
+
setFocusedIndex(
|
|
1450
|
+
(prev) => prev < itemsCountRef.current - 1 ? prev + 1 : 0
|
|
1451
|
+
);
|
|
1452
|
+
break;
|
|
1453
|
+
case "ArrowUp":
|
|
1454
|
+
event.preventDefault();
|
|
1455
|
+
setFocusedIndex(
|
|
1456
|
+
(prev) => prev > 0 ? prev - 1 : itemsCountRef.current - 1
|
|
1457
|
+
);
|
|
1458
|
+
break;
|
|
1459
|
+
case "Home":
|
|
1460
|
+
event.preventDefault();
|
|
1461
|
+
setFocusedIndex(0);
|
|
1462
|
+
break;
|
|
1463
|
+
case "End":
|
|
1464
|
+
event.preventDefault();
|
|
1465
|
+
setFocusedIndex(itemsCountRef.current - 1);
|
|
1466
|
+
break;
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
document.addEventListener("keydown", handleKey);
|
|
1470
|
+
setFocusedIndex(0);
|
|
1471
|
+
return () => document.removeEventListener("keydown", handleKey);
|
|
1472
|
+
}, [isOpen]);
|
|
1473
|
+
(0, import_react20.useEffect)(() => {
|
|
1474
|
+
if (!isOpen)
|
|
1475
|
+
return;
|
|
1476
|
+
const el = menuItemsRef.current[focusedIndex];
|
|
1477
|
+
if (el)
|
|
1478
|
+
el.focus();
|
|
1479
|
+
}, [focusedIndex, isOpen]);
|
|
1480
|
+
const contextValue = {
|
|
1481
|
+
isOpen,
|
|
1482
|
+
setIsOpen,
|
|
1483
|
+
triggerRef,
|
|
1484
|
+
contentRef,
|
|
1485
|
+
focusedIndex,
|
|
1486
|
+
setFocusedIndex,
|
|
1487
|
+
itemsCount: itemsCountRef.current,
|
|
1488
|
+
registerItem,
|
|
1489
|
+
menuItemsRef
|
|
1490
|
+
};
|
|
1491
|
+
return /* @__PURE__ */ import_react20.default.createElement(DropdownContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "relative inline-block text-left" }, children));
|
|
1492
|
+
}
|
|
1493
|
+
function DropdownMenuTrigger({
|
|
1494
|
+
children,
|
|
1495
|
+
isOpen,
|
|
1496
|
+
setIsOpen
|
|
1497
|
+
}) {
|
|
1498
|
+
const ctx = import_react20.default.useContext(DropdownContext);
|
|
1499
|
+
const actualIsOpen = (ctx == null ? void 0 : ctx.isOpen) ?? isOpen;
|
|
1500
|
+
const actualSetIsOpen = (ctx == null ? void 0 : ctx.setIsOpen) ?? setIsOpen;
|
|
1501
|
+
const handleKey = (e) => {
|
|
1502
|
+
switch (e.key) {
|
|
1503
|
+
case "Enter":
|
|
1504
|
+
case " ":
|
|
1505
|
+
e.preventDefault();
|
|
1506
|
+
actualSetIsOpen == null ? void 0 : actualSetIsOpen(!actualIsOpen);
|
|
1507
|
+
break;
|
|
1508
|
+
case "ArrowDown":
|
|
1509
|
+
e.preventDefault();
|
|
1510
|
+
actualSetIsOpen == null ? void 0 : actualSetIsOpen(true);
|
|
1511
|
+
break;
|
|
1512
|
+
case "ArrowUp":
|
|
1513
|
+
e.preventDefault();
|
|
1514
|
+
actualSetIsOpen == null ? void 0 : actualSetIsOpen(true);
|
|
1515
|
+
break;
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1519
|
+
"div",
|
|
1520
|
+
{
|
|
1521
|
+
ref: ctx == null ? void 0 : ctx.triggerRef,
|
|
1522
|
+
tabIndex: 0,
|
|
1523
|
+
role: "button",
|
|
1524
|
+
"aria-haspopup": "menu",
|
|
1525
|
+
"aria-expanded": actualIsOpen,
|
|
1526
|
+
onClick: () => actualSetIsOpen == null ? void 0 : actualSetIsOpen(!actualIsOpen),
|
|
1527
|
+
onKeyDown: handleKey,
|
|
1528
|
+
className: "cursor-pointer outline-none focus:ring-2 focus:ring-primary-500 rounded"
|
|
1529
|
+
},
|
|
1530
|
+
children
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1533
|
+
function DropdownMenuContent({
|
|
1534
|
+
children,
|
|
1535
|
+
isOpen,
|
|
1536
|
+
align = "right",
|
|
1537
|
+
className = ""
|
|
1538
|
+
}) {
|
|
1539
|
+
const ctx = import_react20.default.useContext(DropdownContext);
|
|
1540
|
+
const actualIsOpen = (ctx == null ? void 0 : ctx.isOpen) ?? isOpen;
|
|
1541
|
+
const [visible, setVisible] = (0, import_react20.useState)(actualIsOpen);
|
|
1542
|
+
(0, import_react20.useEffect)(() => {
|
|
1543
|
+
if (actualIsOpen)
|
|
1544
|
+
setVisible(true);
|
|
1545
|
+
else
|
|
1546
|
+
setTimeout(() => setVisible(false), 150);
|
|
1547
|
+
}, [actualIsOpen]);
|
|
1548
|
+
if (!visible)
|
|
1549
|
+
return null;
|
|
1550
|
+
const pos = align === "left" || align === "start" ? "right-0" : align === "right" || align === "end" ? "left-0" : align === "center" ? "left-1/2 -translate-x-1/2" : "";
|
|
1551
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1552
|
+
"div",
|
|
1553
|
+
{
|
|
1554
|
+
ref: ctx == null ? void 0 : ctx.contentRef,
|
|
1555
|
+
role: "menu",
|
|
1556
|
+
className: cn(
|
|
1557
|
+
"absolute w-56 mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-50 transition-all",
|
|
1558
|
+
actualIsOpen ? "opacity-100" : "opacity-0 -translate-y-2",
|
|
1559
|
+
pos,
|
|
1560
|
+
className
|
|
1561
|
+
)
|
|
1562
|
+
},
|
|
1563
|
+
children
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1566
|
+
function DropdownMenuItemWrapper({
|
|
1567
|
+
children,
|
|
1568
|
+
onClick,
|
|
1569
|
+
onKeyDown,
|
|
1570
|
+
disabled,
|
|
1571
|
+
isSubTrigger,
|
|
1572
|
+
className,
|
|
1573
|
+
"aria-expanded": ariaExpanded
|
|
1574
|
+
}) {
|
|
1575
|
+
const ctx = import_react20.default.useContext(DropdownContext);
|
|
1576
|
+
const [index] = (0, import_react20.useState)(() => (ctx == null ? void 0 : ctx.registerItem()) ?? -1);
|
|
1577
|
+
const ref = (0, import_react20.useRef)(null);
|
|
1578
|
+
(0, import_react20.useEffect)(() => {
|
|
1579
|
+
if (ctx && index >= 0) {
|
|
1580
|
+
ctx.menuItemsRef.current[index] = ref.current;
|
|
1581
|
+
}
|
|
1582
|
+
}, [index, ctx]);
|
|
1583
|
+
const handleKey = (e) => {
|
|
1584
|
+
if (onKeyDown)
|
|
1585
|
+
onKeyDown(e);
|
|
1586
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1587
|
+
e.preventDefault();
|
|
1588
|
+
if (!disabled)
|
|
1589
|
+
onClick == null ? void 0 : onClick();
|
|
1590
|
+
}
|
|
1591
|
+
};
|
|
1592
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1593
|
+
"div",
|
|
1594
|
+
{
|
|
1595
|
+
ref,
|
|
1596
|
+
role: "menuitem",
|
|
1597
|
+
tabIndex: disabled ? -1 : 0,
|
|
1598
|
+
"aria-disabled": disabled,
|
|
1599
|
+
"aria-expanded": ariaExpanded,
|
|
1600
|
+
onClick: () => !disabled && (onClick == null ? void 0 : onClick()),
|
|
1601
|
+
onKeyDown: handleKey,
|
|
1602
|
+
className: cn(
|
|
1603
|
+
"px-4 py-2 flex items-center justify-between text-sm cursor-pointer rounded",
|
|
1604
|
+
disabled ? "text-gray-400 cursor-not-allowed" : "hover:bg-gray-100",
|
|
1605
|
+
className
|
|
1606
|
+
)
|
|
1607
|
+
},
|
|
1608
|
+
children
|
|
1609
|
+
);
|
|
1610
|
+
}
|
|
1611
|
+
function DropdownMenuItem({
|
|
1612
|
+
children,
|
|
1613
|
+
className = "",
|
|
1614
|
+
onClick,
|
|
1615
|
+
disabled,
|
|
1616
|
+
shortcut
|
|
1617
|
+
}) {
|
|
1618
|
+
const ctx = import_react20.default.useContext(DropdownContext);
|
|
1619
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1620
|
+
DropdownMenuItemWrapper,
|
|
1621
|
+
{
|
|
1622
|
+
disabled,
|
|
1623
|
+
onClick: () => {
|
|
1624
|
+
if (!disabled) {
|
|
1625
|
+
onClick == null ? void 0 : onClick();
|
|
1626
|
+
ctx == null ? void 0 : ctx.setIsOpen(false);
|
|
1627
|
+
}
|
|
1628
|
+
},
|
|
1629
|
+
className
|
|
1630
|
+
},
|
|
1631
|
+
/* @__PURE__ */ import_react20.default.createElement("span", null, children),
|
|
1632
|
+
shortcut && /* @__PURE__ */ import_react20.default.createElement("kbd", { className: "text-xs text-gray-400" }, shortcut)
|
|
1633
|
+
);
|
|
1634
|
+
}
|
|
1635
|
+
function DropdownMenuLabel({ children }) {
|
|
1636
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { className: "px-4 py-2 text-sm font-semibold text-gray-700" }, children);
|
|
1637
|
+
}
|
|
1638
|
+
function DropdownMenuSeparator() {
|
|
1639
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { className: "border-t border-gray-100 my-1" });
|
|
1640
|
+
}
|
|
1641
|
+
var SubmenuContext = import_react20.default.createContext(null);
|
|
1642
|
+
function DropdownMenuSub({ children }) {
|
|
1643
|
+
const [isSubOpen, setIsSubOpen] = (0, import_react20.useState)(false);
|
|
1644
|
+
return /* @__PURE__ */ import_react20.default.createElement(SubmenuContext.Provider, { value: { isSubOpen, setIsSubOpen } }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "relative" }, children));
|
|
1645
|
+
}
|
|
1646
|
+
function DropdownMenuSubTrigger({ children }) {
|
|
1647
|
+
const sub = import_react20.default.useContext(SubmenuContext);
|
|
1648
|
+
const handleKey = (e) => {
|
|
1649
|
+
if (e.key === "ArrowRight") {
|
|
1650
|
+
e.preventDefault();
|
|
1651
|
+
sub.setIsSubOpen(true);
|
|
1652
|
+
} else if (e.key === "ArrowLeft") {
|
|
1653
|
+
e.preventDefault();
|
|
1654
|
+
sub.setIsSubOpen(false);
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1658
|
+
DropdownMenuItemWrapper,
|
|
1659
|
+
{
|
|
1660
|
+
isSubTrigger: true,
|
|
1661
|
+
"aria-expanded": sub.isSubOpen,
|
|
1662
|
+
onClick: () => sub.setIsSubOpen(!sub.isSubOpen),
|
|
1663
|
+
onKeyDown: handleKey
|
|
1664
|
+
},
|
|
1665
|
+
/* @__PURE__ */ import_react20.default.createElement("span", { className: "flex-1" }, children),
|
|
1666
|
+
/* @__PURE__ */ import_react20.default.createElement(
|
|
1667
|
+
import_react19.RiArrowDownSLine,
|
|
1668
|
+
{
|
|
1669
|
+
className: cn(
|
|
1670
|
+
"w-4 h-4 transition-transform",
|
|
1671
|
+
sub.isSubOpen && "rotate-180"
|
|
1672
|
+
)
|
|
1673
|
+
}
|
|
1674
|
+
)
|
|
1675
|
+
);
|
|
1676
|
+
}
|
|
1677
|
+
function DropdownMenuSubContent({ children }) {
|
|
1678
|
+
const sub = import_react20.default.useContext(SubmenuContext);
|
|
1679
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1680
|
+
"div",
|
|
1681
|
+
{
|
|
1682
|
+
className: cn(
|
|
1683
|
+
"overflow-hidden bg-gray-50 transition-all",
|
|
1684
|
+
sub.isSubOpen ? "max-h-[300px] opacity-100" : "max-h-0 opacity-0"
|
|
1685
|
+
)
|
|
1686
|
+
},
|
|
1687
|
+
children
|
|
1688
|
+
);
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
// app/components/DropdownWithIcon.tsx
|
|
1692
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
1693
|
+
var import_react22 = require("@remixicon/react");
|
|
1023
1694
|
var defaultRenderItem2 = (option) => {
|
|
1024
|
-
return /* @__PURE__ */
|
|
1695
|
+
return /* @__PURE__ */ import_react21.default.createElement(MenuItem2, { label: option.label, value: option.value });
|
|
1025
1696
|
};
|
|
1026
|
-
var DropdownWithIcon = (0,
|
|
1697
|
+
var DropdownWithIcon = (0, import_react21.forwardRef)(
|
|
1027
1698
|
({
|
|
1699
|
+
id = `dropdown-${Math.random().toString(36).substring(2, 11)}`,
|
|
1028
1700
|
options,
|
|
1029
1701
|
selected = [],
|
|
1030
1702
|
setSelected,
|
|
1031
1703
|
search = false,
|
|
1032
1704
|
multiple = false,
|
|
1705
|
+
dropdownText,
|
|
1033
1706
|
renderItem = defaultRenderItem2,
|
|
1034
1707
|
children,
|
|
1035
1708
|
trigger,
|
|
1036
|
-
// dropdownMenu = false,
|
|
1037
1709
|
position = "top",
|
|
1038
|
-
// setDropdownMenu = () => {},
|
|
1039
1710
|
width,
|
|
1040
1711
|
info,
|
|
1041
|
-
dropDownTooltip = false,
|
|
1042
1712
|
dropdownFooter = false,
|
|
1043
1713
|
onApply,
|
|
1044
1714
|
disabled = false,
|
|
1045
|
-
onReset
|
|
1715
|
+
onReset,
|
|
1716
|
+
footerAction
|
|
1046
1717
|
}, ref) => {
|
|
1047
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
1048
|
-
const localDropdownRef = (0,
|
|
1049
|
-
const [dropdownMenu, setDropdownMenu] = (0,
|
|
1050
|
-
(0,
|
|
1051
|
-
const memoizedFilteredOptions = (0,
|
|
1718
|
+
const [searchQuery, setSearchQuery] = (0, import_react21.useState)("");
|
|
1719
|
+
const localDropdownRef = (0, import_react21.useRef)(null);
|
|
1720
|
+
const [dropdownMenu, setDropdownMenu] = (0, import_react21.useState)(false);
|
|
1721
|
+
(0, import_react21.useImperativeHandle)(ref, () => localDropdownRef.current);
|
|
1722
|
+
const memoizedFilteredOptions = (0, import_react21.useMemo)(() => {
|
|
1052
1723
|
if (!search)
|
|
1053
1724
|
return options;
|
|
1054
1725
|
return options == null ? void 0 : options.filter(
|
|
@@ -1058,14 +1729,14 @@ var DropdownWithIcon = (0, import_react16.forwardRef)(
|
|
|
1058
1729
|
}
|
|
1059
1730
|
);
|
|
1060
1731
|
}, [search, searchQuery, options]);
|
|
1061
|
-
const handleSearchChange = (0,
|
|
1732
|
+
const handleSearchChange = (0, import_react21.useCallback)(
|
|
1062
1733
|
(e) => {
|
|
1063
1734
|
var _a;
|
|
1064
1735
|
setSearchQuery((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
1065
1736
|
},
|
|
1066
1737
|
[]
|
|
1067
1738
|
);
|
|
1068
|
-
const toggleOption = (0,
|
|
1739
|
+
const toggleOption = (0, import_react21.useCallback)(
|
|
1069
1740
|
(option) => {
|
|
1070
1741
|
if (multiple && setSelected) {
|
|
1071
1742
|
setSelected(
|
|
@@ -1078,7 +1749,7 @@ var DropdownWithIcon = (0, import_react16.forwardRef)(
|
|
|
1078
1749
|
},
|
|
1079
1750
|
[multiple, setSelected, setDropdownMenu]
|
|
1080
1751
|
);
|
|
1081
|
-
const handleCheckboxChange = (0,
|
|
1752
|
+
const handleCheckboxChange = (0, import_react21.useCallback)(
|
|
1082
1753
|
(option) => {
|
|
1083
1754
|
if (multiple && setSelected) {
|
|
1084
1755
|
setSelected(
|
|
@@ -1104,7 +1775,7 @@ var DropdownWithIcon = (0, import_react16.forwardRef)(
|
|
|
1104
1775
|
setSelected == null ? void 0 : setSelected([]);
|
|
1105
1776
|
setDropdownMenu(false);
|
|
1106
1777
|
};
|
|
1107
|
-
(0,
|
|
1778
|
+
(0, import_react21.useEffect)(() => {
|
|
1108
1779
|
const handleClickOutside = (event) => {
|
|
1109
1780
|
var _a;
|
|
1110
1781
|
if ((localDropdownRef == null ? void 0 : localDropdownRef.current) && !((_a = localDropdownRef == null ? void 0 : localDropdownRef.current) == null ? void 0 : _a.contains(event == null ? void 0 : event.target))) {
|
|
@@ -1116,9 +1787,10 @@ var DropdownWithIcon = (0, import_react16.forwardRef)(
|
|
|
1116
1787
|
document == null ? void 0 : document.removeEventListener("mousedown", handleClickOutside);
|
|
1117
1788
|
};
|
|
1118
1789
|
}, [setDropdownMenu]);
|
|
1119
|
-
return /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
1120
1791
|
"div",
|
|
1121
1792
|
{
|
|
1793
|
+
id,
|
|
1122
1794
|
ref: localDropdownRef,
|
|
1123
1795
|
className: cn(
|
|
1124
1796
|
"relative",
|
|
@@ -1129,14 +1801,42 @@ var DropdownWithIcon = (0, import_react16.forwardRef)(
|
|
|
1129
1801
|
width
|
|
1130
1802
|
}
|
|
1131
1803
|
},
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
|
|
1804
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
1805
|
+
"button",
|
|
1806
|
+
{
|
|
1807
|
+
type: "button",
|
|
1808
|
+
"aria-haspopup": "listbox",
|
|
1809
|
+
"aria-expanded": dropdownMenu,
|
|
1810
|
+
"aria-labelledby": `${id}-label`,
|
|
1811
|
+
disabled,
|
|
1812
|
+
onClick: () => !disabled && setDropdownMenu((prev) => !prev),
|
|
1813
|
+
onKeyDown: (e) => {
|
|
1814
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1815
|
+
e.preventDefault();
|
|
1816
|
+
!disabled && setDropdownMenu((prev) => !prev);
|
|
1817
|
+
}
|
|
1818
|
+
},
|
|
1819
|
+
className: cn(
|
|
1820
|
+
"w-full",
|
|
1821
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
1822
|
+
dropdownText && "flex items-center gap-2"
|
|
1823
|
+
)
|
|
1824
|
+
},
|
|
1825
|
+
trigger,
|
|
1826
|
+
dropdownText && /* @__PURE__ */ import_react21.default.createElement("span", { id: `${id}-label`, className: "text-sm text-gray-800" }, dropdownText)
|
|
1827
|
+
),
|
|
1828
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
1134
1829
|
"ul",
|
|
1135
1830
|
{
|
|
1831
|
+
role: "listbox",
|
|
1832
|
+
"aria-multiselectable": multiple,
|
|
1833
|
+
"aria-labelledby": `${id}-label`,
|
|
1834
|
+
tabIndex: -1,
|
|
1136
1835
|
className: cn(
|
|
1137
1836
|
"max-h-0 opacity-0 overflow-hidden shadow-sm mt-1 rounded absolute text-[16px] bg-white z-[1000] w-full transition-all duration-75 delay-100 ease-in",
|
|
1837
|
+
dropdownMenu ? "border border-primary-600" : "border border-gray-200",
|
|
1138
1838
|
position === "top" ? "top-10" : position === "bottom" ? "bottom-10" : position === "left" ? "left-0" : position === "right" ? "right-[90%]" : "top-10",
|
|
1139
|
-
dropdownMenu && "max-h-[
|
|
1839
|
+
dropdownMenu && "max-h-[360px] h-fit opacity-[1] transition-all ease-in duration-150"
|
|
1140
1840
|
),
|
|
1141
1841
|
style: {
|
|
1142
1842
|
width,
|
|
@@ -1144,104 +1844,135 @@ var DropdownWithIcon = (0, import_react16.forwardRef)(
|
|
|
1144
1844
|
top: "calc(100% + 4px)"
|
|
1145
1845
|
}
|
|
1146
1846
|
},
|
|
1147
|
-
search && /* @__PURE__ */
|
|
1847
|
+
search && /* @__PURE__ */ import_react21.default.createElement(
|
|
1148
1848
|
Input_default,
|
|
1149
1849
|
{
|
|
1850
|
+
id: `${id}-search`,
|
|
1150
1851
|
type: "text",
|
|
1151
1852
|
placeholder: "Search...",
|
|
1853
|
+
"aria-label": "Search options",
|
|
1152
1854
|
value: searchQuery,
|
|
1153
1855
|
onChange: handleSearchChange,
|
|
1154
|
-
className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3",
|
|
1155
|
-
endIcon: /* @__PURE__ */
|
|
1856
|
+
className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3 border-none",
|
|
1857
|
+
endIcon: /* @__PURE__ */ import_react21.default.createElement(import_react22.RiSearchLine, { size: 18 })
|
|
1156
1858
|
}
|
|
1157
1859
|
),
|
|
1158
|
-
multiple && /* @__PURE__ */
|
|
1159
|
-
"
|
|
1860
|
+
multiple && /* @__PURE__ */ import_react21.default.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
1861
|
+
"button",
|
|
1160
1862
|
{
|
|
1863
|
+
type: "button",
|
|
1864
|
+
"aria-label": "Select all",
|
|
1161
1865
|
onClick: handleSelectAll,
|
|
1162
|
-
className: "text-text-sm hover:text-primary-700
|
|
1866
|
+
className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
|
|
1163
1867
|
},
|
|
1164
1868
|
"Select all"
|
|
1165
|
-
), /* @__PURE__ */
|
|
1869
|
+
), /* @__PURE__ */ import_react21.default.createElement(
|
|
1166
1870
|
"button",
|
|
1167
1871
|
{
|
|
1872
|
+
"aria-label": "Reset",
|
|
1873
|
+
type: "button",
|
|
1168
1874
|
className: "text-text-sm text-warning-500 hover:text-warning-600",
|
|
1169
1875
|
onClick: handleReset
|
|
1170
1876
|
},
|
|
1171
1877
|
"Reset"
|
|
1172
1878
|
)),
|
|
1173
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ import_react21.default.createElement("section", { className: "max-h-[200px] z-[1000] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions == null ? void 0 : memoizedFilteredOptions.map((option, i) => {
|
|
1174
1880
|
var _a;
|
|
1175
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, { key: i }, multiple ? /* @__PURE__ */ import_react21.default.createElement(
|
|
1176
1882
|
Label_default,
|
|
1177
1883
|
{
|
|
1178
|
-
className:
|
|
1179
|
-
|
|
1884
|
+
className: cn(
|
|
1885
|
+
"has-[:checked]:bg-primary-50 has-[:checked]:border-primary-600 hover:bg-gray-50 flex flex-col py-[6px] px-[14px] break-words cursor-pointer border-l-4 border-transparent",
|
|
1886
|
+
(option == null ? void 0 : option.disabledOption) && "opacity-50 cursor-not-allowed hover:bg-white text-gray-300 select-none"
|
|
1887
|
+
),
|
|
1888
|
+
htmlFor: `${id}-checkbox-${option.value}`,
|
|
1180
1889
|
key: i
|
|
1181
1890
|
},
|
|
1182
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ import_react21.default.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
1183
1892
|
Checkbox_default,
|
|
1184
1893
|
{
|
|
1185
|
-
id:
|
|
1894
|
+
id: `${id}-checkbox-${option.value}`,
|
|
1186
1895
|
checked: selected == null ? void 0 : selected.some(
|
|
1187
1896
|
(item) => (item == null ? void 0 : item.value) === (option == null ? void 0 : option.value)
|
|
1188
1897
|
),
|
|
1189
|
-
onChange: () => handleCheckboxChange(option)
|
|
1898
|
+
onChange: () => handleCheckboxChange(option),
|
|
1899
|
+
disabled: option == null ? void 0 : option.disabledOption
|
|
1190
1900
|
}
|
|
1191
|
-
), /* @__PURE__ */
|
|
1192
|
-
|
|
1901
|
+
), /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
1902
|
+
"div",
|
|
1193
1903
|
{
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1904
|
+
style: {
|
|
1905
|
+
color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
|
|
1906
|
+
},
|
|
1907
|
+
className: cn(
|
|
1908
|
+
"break-words",
|
|
1909
|
+
(option == null ? void 0 : option.disabledOption) && "text-gray-300"
|
|
1910
|
+
)
|
|
1911
|
+
},
|
|
1912
|
+
renderItem(option)
|
|
1913
|
+
))), /* @__PURE__ */ import_react21.default.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
|
|
1914
|
+
/* @__PURE__ */ import_react21.default.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
|
|
1915
|
+
) : /* @__PURE__ */ import_react21.default.createElement(
|
|
1199
1916
|
Label_default,
|
|
1200
1917
|
{
|
|
1918
|
+
htmlFor: `${id}-checkbox-${option.value}`,
|
|
1201
1919
|
key: i,
|
|
1202
1920
|
className: cn(
|
|
1203
1921
|
"flex justify-between py-[6px] px-[14px] hover:bg-gray-50 gap-2 items-center border-l-4 border-transparent cursor-pointer",
|
|
1204
1922
|
{
|
|
1205
|
-
"bg-primary-50 border-primary-600": selected && ((_a = selected[0]) == null ? void 0 : _a.value) === (option == null ? void 0 : option.value)
|
|
1923
|
+
"bg-primary-50 border-primary-600": selected && ((_a = selected[0]) == null ? void 0 : _a.value) === (option == null ? void 0 : option.value),
|
|
1924
|
+
"opacity-50 cursor-not-allowed hover:bg-white text-gray-500": option == null ? void 0 : option.disabledOption
|
|
1206
1925
|
}
|
|
1207
1926
|
),
|
|
1208
|
-
onClick: () => toggleOption(option)
|
|
1927
|
+
onClick: () => !(option == null ? void 0 : option.disabledOption) && toggleOption(option)
|
|
1209
1928
|
},
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
|
|
1929
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
1930
|
+
"div",
|
|
1212
1931
|
{
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1932
|
+
style: {
|
|
1933
|
+
color: (option == null ? void 0 : option.disabledOption) ? "#D1D5DB" : option.labelTextColor
|
|
1934
|
+
},
|
|
1935
|
+
className: cn(
|
|
1936
|
+
"break-words",
|
|
1937
|
+
(option == null ? void 0 : option.disabledOption) && "text-gray-300"
|
|
1938
|
+
)
|
|
1939
|
+
},
|
|
1940
|
+
renderItem(option)
|
|
1941
|
+
),
|
|
1942
|
+
/* @__PURE__ */ import_react21.default.createElement("span", { className: "text-gray-500" }, info)
|
|
1217
1943
|
));
|
|
1218
1944
|
}) : children),
|
|
1219
|
-
|
|
1945
|
+
footerAction && /* @__PURE__ */ import_react21.default.createElement("div", { className: "py-2 mt-1 px-2 border-t" }, footerAction),
|
|
1946
|
+
dropdownFooter && /* @__PURE__ */ import_react21.default.createElement(
|
|
1947
|
+
DropdownFooter2,
|
|
1948
|
+
{
|
|
1949
|
+
setDropdownMenu,
|
|
1950
|
+
onApply
|
|
1951
|
+
}
|
|
1952
|
+
)
|
|
1220
1953
|
)
|
|
1221
1954
|
);
|
|
1222
1955
|
}
|
|
1223
1956
|
);
|
|
1224
1957
|
var MenuItem2 = ({ label, children }) => {
|
|
1225
|
-
return /* @__PURE__ */
|
|
1226
|
-
};
|
|
1227
|
-
var DropdownTooltip2 = ({
|
|
1228
|
-
tooltipContent
|
|
1229
|
-
}) => {
|
|
1230
|
-
return tooltipContent ? /* @__PURE__ */ import_react16.default.createElement(Tooltip_default, { position: "right", content: tooltipContent }, /* @__PURE__ */ import_react16.default.createElement(import_react17.RiErrorWarningLine, { color: "#98A2B3", size: 14 })) : null;
|
|
1958
|
+
return /* @__PURE__ */ import_react21.default.createElement("p", { className: "break-all" }, label || children);
|
|
1231
1959
|
};
|
|
1232
1960
|
var DropdownFooter2 = ({
|
|
1233
1961
|
onApply,
|
|
1234
1962
|
setDropdownMenu
|
|
1235
1963
|
}) => {
|
|
1236
|
-
return /* @__PURE__ */
|
|
1964
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex justify-end border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
1237
1965
|
"button",
|
|
1238
1966
|
{
|
|
1967
|
+
type: "button",
|
|
1239
1968
|
className: "text-primary-600 hover:text-primary-700",
|
|
1240
1969
|
onClick: () => {
|
|
1241
1970
|
if (onApply) {
|
|
1242
1971
|
onApply();
|
|
1243
1972
|
}
|
|
1244
|
-
setDropdownMenu
|
|
1973
|
+
if (setDropdownMenu) {
|
|
1974
|
+
setDropdownMenu(false);
|
|
1975
|
+
}
|
|
1245
1976
|
}
|
|
1246
1977
|
},
|
|
1247
1978
|
"Apply"
|
|
@@ -1250,9 +1981,45 @@ var DropdownFooter2 = ({
|
|
|
1250
1981
|
DropdownWithIcon.displayName = "DropdownWithIcon";
|
|
1251
1982
|
var DropdownWithIcon_default = DropdownWithIcon;
|
|
1252
1983
|
|
|
1984
|
+
// app/components/FileSelector.tsx
|
|
1985
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
1986
|
+
var FileSelector = (0, import_react23.forwardRef)(
|
|
1987
|
+
({ component, ...props }, ref) => {
|
|
1988
|
+
const internalRef = (0, import_react23.useRef)(null);
|
|
1989
|
+
const inputRef = ref || internalRef;
|
|
1990
|
+
const handleClick = () => {
|
|
1991
|
+
var _a;
|
|
1992
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
1993
|
+
};
|
|
1994
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
1995
|
+
"div",
|
|
1996
|
+
{
|
|
1997
|
+
onClick: handleClick,
|
|
1998
|
+
style: { display: "inline-block", cursor: "pointer" }
|
|
1999
|
+
},
|
|
2000
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
2001
|
+
"input",
|
|
2002
|
+
{
|
|
2003
|
+
type: "file",
|
|
2004
|
+
ref: inputRef,
|
|
2005
|
+
...props,
|
|
2006
|
+
style: { display: "none" }
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
component
|
|
2010
|
+
);
|
|
2011
|
+
}
|
|
2012
|
+
);
|
|
2013
|
+
FileSelector.displayName = "FileSelector";
|
|
2014
|
+
var FileSelector_default = FileSelector;
|
|
2015
|
+
|
|
1253
2016
|
// app/components/FileUpload.tsx
|
|
1254
|
-
var
|
|
1255
|
-
var
|
|
2017
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
2018
|
+
var import_react27 = require("@remixicon/react");
|
|
2019
|
+
|
|
2020
|
+
// app/components/FileUploadPreview.tsx
|
|
2021
|
+
var import_react24 = require("@remixicon/react");
|
|
2022
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
1256
2023
|
var getIconForMimeType = (file) => {
|
|
1257
2024
|
var _a;
|
|
1258
2025
|
const fileName = typeof file === "string" ? file : file.name;
|
|
@@ -1265,65 +2032,109 @@ var getIconForMimeType = (file) => {
|
|
|
1265
2032
|
case "gif":
|
|
1266
2033
|
case "svg":
|
|
1267
2034
|
case "webp":
|
|
1268
|
-
iconComponent = /* @__PURE__ */
|
|
2035
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiImageLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1269
2036
|
break;
|
|
1270
2037
|
case "mp3":
|
|
1271
2038
|
case "wav":
|
|
1272
2039
|
case "ogg":
|
|
1273
|
-
iconComponent = /* @__PURE__ */
|
|
2040
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiMusic2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1274
2041
|
break;
|
|
1275
2042
|
case "mp4":
|
|
1276
2043
|
case "avi":
|
|
1277
2044
|
case "mkv":
|
|
1278
|
-
iconComponent = /* @__PURE__ */
|
|
2045
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiVideoLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1279
2046
|
break;
|
|
1280
2047
|
case "xls":
|
|
1281
2048
|
case "xlsx":
|
|
1282
2049
|
case "csv":
|
|
1283
2050
|
case "txt":
|
|
1284
2051
|
case "ods":
|
|
1285
|
-
iconComponent = /* @__PURE__ */
|
|
2052
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiFileExcel2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1286
2053
|
break;
|
|
1287
2054
|
case "doc":
|
|
1288
2055
|
case "docx":
|
|
1289
2056
|
case "odt":
|
|
1290
2057
|
case "xml":
|
|
1291
|
-
iconComponent = /* @__PURE__ */
|
|
2058
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiFileWord2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1292
2059
|
break;
|
|
1293
2060
|
case "pptx":
|
|
1294
2061
|
case "pptm":
|
|
1295
2062
|
case "xps":
|
|
1296
2063
|
case "ppsx":
|
|
1297
|
-
iconComponent = /* @__PURE__ */
|
|
2064
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiFilePpt2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1298
2065
|
break;
|
|
1299
2066
|
case "rar":
|
|
1300
2067
|
case "zip":
|
|
1301
|
-
iconComponent = /* @__PURE__ */
|
|
2068
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiFileZipLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1302
2069
|
break;
|
|
1303
2070
|
case "pdf":
|
|
1304
|
-
iconComponent = /* @__PURE__ */
|
|
2071
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiFilePdf2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1305
2072
|
break;
|
|
1306
2073
|
default:
|
|
1307
|
-
iconComponent = /* @__PURE__ */
|
|
2074
|
+
iconComponent = /* @__PURE__ */ import_react25.default.createElement(import_react24.RiFileLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1308
2075
|
break;
|
|
1309
2076
|
}
|
|
1310
2077
|
return iconComponent;
|
|
1311
2078
|
};
|
|
1312
|
-
var
|
|
2079
|
+
var FileUploadPreview = ({
|
|
2080
|
+
index,
|
|
2081
|
+
file,
|
|
2082
|
+
children,
|
|
2083
|
+
onDelete
|
|
2084
|
+
}) => {
|
|
2085
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
2086
|
+
"div",
|
|
2087
|
+
{
|
|
2088
|
+
key: index,
|
|
2089
|
+
className: "p-4 border border-gray-200 rounded-lg flex items-center justify-between gap-5"
|
|
2090
|
+
},
|
|
2091
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-2 w-full" }, getIconForMimeType(file), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ import_react25.default.createElement("p", { className: "text-sm line-clamp-2 break-all" }, typeof file === "string" ? file : file.name, " "), children && /* @__PURE__ */ import_react25.default.createElement("div", { className: "w-full" }, children))),
|
|
2092
|
+
/* @__PURE__ */ import_react25.default.createElement("button", { type: "button", onClick: () => onDelete == null ? void 0 : onDelete(index) }, /* @__PURE__ */ import_react25.default.createElement(import_react24.RiDeleteBinLine, { className: "text-gray-500 w-5 h-5 cursor-pointer" }))
|
|
2093
|
+
);
|
|
2094
|
+
};
|
|
2095
|
+
var FileUploadPreview_default = FileUploadPreview;
|
|
2096
|
+
|
|
2097
|
+
// app/components/FileUpload.tsx
|
|
2098
|
+
var FileUpload = (0, import_react26.forwardRef)(
|
|
1313
2099
|
({
|
|
1314
2100
|
selectedFile,
|
|
2101
|
+
setSelectedFile,
|
|
1315
2102
|
onChange,
|
|
1316
2103
|
multiple,
|
|
1317
2104
|
onDelete,
|
|
1318
2105
|
children,
|
|
1319
2106
|
disabled,
|
|
1320
2107
|
title,
|
|
2108
|
+
filePreviewClassName,
|
|
1321
2109
|
id,
|
|
1322
2110
|
className,
|
|
1323
2111
|
accept,
|
|
1324
2112
|
...props
|
|
1325
2113
|
}, ref) => {
|
|
1326
|
-
|
|
2114
|
+
const [isDragging, setIsDragging] = (0, import_react26.useState)(false);
|
|
2115
|
+
const handleDragOver = (e) => {
|
|
2116
|
+
e.preventDefault();
|
|
2117
|
+
if (!disabled)
|
|
2118
|
+
setIsDragging(true);
|
|
2119
|
+
};
|
|
2120
|
+
const handleDragLeave = () => {
|
|
2121
|
+
setIsDragging(false);
|
|
2122
|
+
};
|
|
2123
|
+
const handleDrop = (e) => {
|
|
2124
|
+
e.preventDefault();
|
|
2125
|
+
setIsDragging(false);
|
|
2126
|
+
if (disabled)
|
|
2127
|
+
return;
|
|
2128
|
+
const files = Array.from(e.dataTransfer.files);
|
|
2129
|
+
if (files.length === 0)
|
|
2130
|
+
return;
|
|
2131
|
+
if (multiple) {
|
|
2132
|
+
setSelectedFile && setSelectedFile([...selectedFile || [], ...files]);
|
|
2133
|
+
} else {
|
|
2134
|
+
setSelectedFile && setSelectedFile([files[0]]);
|
|
2135
|
+
}
|
|
2136
|
+
};
|
|
2137
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
1327
2138
|
"input",
|
|
1328
2139
|
{
|
|
1329
2140
|
type: "file",
|
|
@@ -1336,33 +2147,40 @@ var FileUpload = (0, import_react18.forwardRef)(
|
|
|
1336
2147
|
hidden: true,
|
|
1337
2148
|
ref
|
|
1338
2149
|
}
|
|
1339
|
-
), /* @__PURE__ */
|
|
2150
|
+
), /* @__PURE__ */ import_react26.default.createElement(
|
|
1340
2151
|
Label_default,
|
|
1341
2152
|
{
|
|
1342
2153
|
htmlFor: id,
|
|
1343
2154
|
disabled,
|
|
2155
|
+
role: "button",
|
|
2156
|
+
"aria-label": `Upload ${multiple ? "files" : "file"}`,
|
|
2157
|
+
tabIndex: 0,
|
|
2158
|
+
onKeyDown: (e) => {
|
|
2159
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2160
|
+
e.preventDefault();
|
|
2161
|
+
e.currentTarget.click();
|
|
2162
|
+
}
|
|
2163
|
+
},
|
|
2164
|
+
onDragOver: handleDragOver,
|
|
2165
|
+
onDragLeave: handleDragLeave,
|
|
2166
|
+
onDrop: handleDrop,
|
|
1344
2167
|
className: cn(
|
|
1345
|
-
"w-full h-[126px] border-2 border-dashed border-gray-200 hover:bg-gray-200 cursor-pointer rounded-lg px-6 py-4 flex
|
|
2168
|
+
"w-full h-[126px] border-2 border-dashed border-gray-200 hover:bg-gray-200 cursor-pointer rounded-lg px-6 py-4 flex items-center justify-center transition-all",
|
|
2169
|
+
isDragging && "border-primary-500 bg-primary-50",
|
|
1346
2170
|
disabled && "pointer-events-none",
|
|
1347
2171
|
className
|
|
1348
2172
|
)
|
|
1349
2173
|
},
|
|
1350
|
-
/* @__PURE__ */
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
"div",
|
|
2174
|
+
/* @__PURE__ */ import_react26.default.createElement("div", { className: cn("grid grid-cols-1 place-items-center gap-2") }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "w-10 h-10 border-[6px] border-gray-50 bg-gray-200 rounded-full p-1 flex justify-center items-center" }, /* @__PURE__ */ import_react26.default.createElement(import_react27.RiUpload2Line, { className: "w-5 h-5" })), /* @__PURE__ */ import_react26.default.createElement("div", null, /* @__PURE__ */ import_react26.default.createElement("p", { className: "text-center text-sm text-gray-600" }, /* @__PURE__ */ import_react26.default.createElement("span", { className: "text-primary-600 font-semibold" }, "Click to upload or drag and drop"), " ", /* @__PURE__ */ import_react26.default.createElement("br", null), " ", title)))
|
|
2175
|
+
), /* @__PURE__ */ import_react26.default.createElement("section", { className: cn(`grid gap-2`, filePreviewClassName) }, selectedFile == null ? void 0 : selectedFile.map((file, index) => /* @__PURE__ */ import_react26.default.createElement(
|
|
2176
|
+
FileUploadPreview_default,
|
|
1354
2177
|
{
|
|
1355
|
-
key: index,
|
|
1356
|
-
|
|
2178
|
+
key: file.name || index,
|
|
2179
|
+
file,
|
|
2180
|
+
index,
|
|
2181
|
+
onDelete
|
|
1357
2182
|
},
|
|
1358
|
-
|
|
1359
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
1360
|
-
import_react19.RiDeleteBinLine,
|
|
1361
|
-
{
|
|
1362
|
-
onClick: onDelete,
|
|
1363
|
-
className: "text-gray-500 w-5 h-5 cursor-pointer"
|
|
1364
|
-
}
|
|
1365
|
-
)
|
|
2183
|
+
children
|
|
1366
2184
|
))));
|
|
1367
2185
|
}
|
|
1368
2186
|
);
|
|
@@ -1370,8 +2188,8 @@ FileUpload.displayName = "FileUpload";
|
|
|
1370
2188
|
var FileUpload_default = FileUpload;
|
|
1371
2189
|
|
|
1372
2190
|
// app/components/GlobalNavigation.tsx
|
|
1373
|
-
var
|
|
1374
|
-
var GlobalNavigation = (0,
|
|
2191
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
2192
|
+
var GlobalNavigation = (0, import_react28.forwardRef)(
|
|
1375
2193
|
({
|
|
1376
2194
|
isOpen,
|
|
1377
2195
|
setIsOpen,
|
|
@@ -1380,27 +2198,30 @@ var GlobalNavigation = (0, import_react20.forwardRef)(
|
|
|
1380
2198
|
className,
|
|
1381
2199
|
postion = "bottom-right"
|
|
1382
2200
|
}, ref) => {
|
|
1383
|
-
const
|
|
1384
|
-
(0,
|
|
2201
|
+
const triggerRef = (0, import_react28.useRef)(null);
|
|
2202
|
+
const contentRef = (0, import_react28.useRef)(null);
|
|
2203
|
+
(0, import_react28.useEffect)(() => {
|
|
1385
2204
|
const handleClickOutside = (event) => {
|
|
1386
|
-
|
|
2205
|
+
var _a, _b;
|
|
2206
|
+
if (!((_a = triggerRef.current) == null ? void 0 : _a.contains(event.target)) && !((_b = contentRef.current) == null ? void 0 : _b.contains(event.target))) {
|
|
1387
2207
|
setIsOpen(false);
|
|
1388
2208
|
}
|
|
1389
2209
|
};
|
|
1390
2210
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1391
2211
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1392
|
-
}, []);
|
|
1393
|
-
return /* @__PURE__ */
|
|
2212
|
+
}, [setIsOpen]);
|
|
2213
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { className: "relative w-max", ref }, /* @__PURE__ */ import_react28.default.createElement(
|
|
1394
2214
|
"div",
|
|
1395
2215
|
{
|
|
1396
2216
|
className: "cursor-pointer",
|
|
1397
|
-
ref:
|
|
2217
|
+
ref: triggerRef,
|
|
1398
2218
|
onClick: () => setIsOpen(!isOpen)
|
|
1399
2219
|
},
|
|
1400
2220
|
trigger
|
|
1401
|
-
), isOpen && /* @__PURE__ */
|
|
2221
|
+
), isOpen && /* @__PURE__ */ import_react28.default.createElement(
|
|
1402
2222
|
"div",
|
|
1403
2223
|
{
|
|
2224
|
+
ref: contentRef,
|
|
1404
2225
|
className: cn(
|
|
1405
2226
|
"absolute z-10 bg-white rounded-lg shadow-sm border min-w-[200px] p-4 transition-all duration-300 ease-in-out",
|
|
1406
2227
|
postion === "bottom-left" && "left-0 top-4/4",
|
|
@@ -1418,9 +2239,9 @@ GlobalNavigation.displayName = "GlobalNavigation";
|
|
|
1418
2239
|
var GlobalNavigation_default = GlobalNavigation;
|
|
1419
2240
|
|
|
1420
2241
|
// app/components/HelperText.tsx
|
|
1421
|
-
var
|
|
2242
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
1422
2243
|
var HelperText = ({ children, className, size, error }) => {
|
|
1423
|
-
return /* @__PURE__ */
|
|
2244
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
1424
2245
|
"span",
|
|
1425
2246
|
{
|
|
1426
2247
|
className: cn(
|
|
@@ -1437,42 +2258,134 @@ var HelperText_default = HelperText;
|
|
|
1437
2258
|
|
|
1438
2259
|
// app/components/ListItem.tsx
|
|
1439
2260
|
var import_link = __toESM(require("next/link"), 1);
|
|
1440
|
-
var
|
|
1441
|
-
var ListItem =
|
|
2261
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
2262
|
+
var ListItem = import_react30.default.forwardRef(({ className, title, href, onClick, as = "link", icon }, ref) => {
|
|
2263
|
+
const commonClasses = cn(
|
|
2264
|
+
"px-4 py-[8px] w-full flex items-center gap-2 focus:outline-none focus:ring-2 focus:ring-primary-600 focus-visible:ring-2 rounded",
|
|
2265
|
+
className
|
|
2266
|
+
);
|
|
1442
2267
|
if (as === "button") {
|
|
1443
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
1444
2269
|
"button",
|
|
1445
2270
|
{
|
|
1446
|
-
className:
|
|
1447
|
-
"px-4 py-[8px] w-full text-left flex items-center gap-2",
|
|
1448
|
-
className
|
|
1449
|
-
),
|
|
2271
|
+
className: commonClasses,
|
|
1450
2272
|
onClick,
|
|
1451
|
-
ref
|
|
2273
|
+
ref,
|
|
2274
|
+
type: "button",
|
|
2275
|
+
role: "menuitem"
|
|
1452
2276
|
},
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
icon && /* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ import_react30.default.createElement("span", { className: "text-base font-normal" }, title),
|
|
2278
|
+
icon && /* @__PURE__ */ import_react30.default.createElement("span", { className: "flex-shrink-0", "aria-hidden": "true" }, icon)
|
|
1455
2279
|
);
|
|
1456
2280
|
}
|
|
1457
|
-
return /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
1458
2282
|
import_link.default,
|
|
1459
2283
|
{
|
|
1460
2284
|
href: href ?? "",
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
2285
|
+
className: commonClasses,
|
|
2286
|
+
ref,
|
|
2287
|
+
role: "menuitem",
|
|
2288
|
+
onClick: (e) => {
|
|
2289
|
+
if (!href) {
|
|
2290
|
+
e.preventDefault();
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
1464
2293
|
},
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
icon && /* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ import_react30.default.createElement("span", { className: "text-base font-normal" }, title),
|
|
2295
|
+
icon && /* @__PURE__ */ import_react30.default.createElement("span", { className: "flex-shrink-0", "aria-hidden": "true" }, icon)
|
|
1467
2296
|
);
|
|
1468
2297
|
});
|
|
1469
2298
|
ListItem.displayName = "ListItem";
|
|
1470
2299
|
var ListItem_default = ListItem;
|
|
1471
2300
|
|
|
2301
|
+
// app/components/ListPagination.tsx
|
|
2302
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
2303
|
+
var import_react32 = require("@remixicon/react");
|
|
2304
|
+
var ListPagination = ({
|
|
2305
|
+
count,
|
|
2306
|
+
page,
|
|
2307
|
+
rowsPerPage,
|
|
2308
|
+
onPageChange,
|
|
2309
|
+
className
|
|
2310
|
+
}) => {
|
|
2311
|
+
const totalPages = Math.ceil(count / rowsPerPage);
|
|
2312
|
+
const [expanded, setExpanded] = (0, import_react31.useState)(false);
|
|
2313
|
+
const renderPages = () => {
|
|
2314
|
+
if (totalPages <= 6 || expanded) {
|
|
2315
|
+
return [...Array(totalPages)].map((_, i) => /* @__PURE__ */ import_react31.default.createElement(PageBtn, { key: i, i, page, onPageChange }));
|
|
2316
|
+
}
|
|
2317
|
+
const start = [0, 1];
|
|
2318
|
+
const mid = [page - 1, page, page + 1].filter(
|
|
2319
|
+
(i) => i > 1 && i < totalPages - 2
|
|
2320
|
+
);
|
|
2321
|
+
const end = [totalPages - 2, totalPages - 1];
|
|
2322
|
+
const range = Array.from(/* @__PURE__ */ new Set([...start, ...mid, ...end]));
|
|
2323
|
+
return range.map(
|
|
2324
|
+
(i, idx) => typeof range[idx - 1] === "number" && i - range[idx - 1] > 1 ? /* @__PURE__ */ import_react31.default.createElement(
|
|
2325
|
+
Button_default,
|
|
2326
|
+
{
|
|
2327
|
+
key: `dots-${i}`,
|
|
2328
|
+
size: "sm",
|
|
2329
|
+
variant: "outlined",
|
|
2330
|
+
onClick: () => setExpanded(true)
|
|
2331
|
+
},
|
|
2332
|
+
"..."
|
|
2333
|
+
) : /* @__PURE__ */ import_react31.default.createElement(PageBtn, { key: i, i, page, onPageChange })
|
|
2334
|
+
);
|
|
2335
|
+
};
|
|
2336
|
+
return /* @__PURE__ */ import_react31.default.createElement("section", { className: cn("flex items-center gap-1", className) }, /* @__PURE__ */ import_react31.default.createElement(
|
|
2337
|
+
NavBtn,
|
|
2338
|
+
{
|
|
2339
|
+
icon: /* @__PURE__ */ import_react31.default.createElement(import_react32.RiArrowLeftSLine, { size: 22 }),
|
|
2340
|
+
onClick: () => onPageChange(page - 1),
|
|
2341
|
+
disabled: page === 0
|
|
2342
|
+
}
|
|
2343
|
+
), /* @__PURE__ */ import_react31.default.createElement("div", { className: "max-w-[90vw] w-max overflow-auto flex items-center gap-2 p-2" }, renderPages()), /* @__PURE__ */ import_react31.default.createElement(
|
|
2344
|
+
NavBtn,
|
|
2345
|
+
{
|
|
2346
|
+
icon: /* @__PURE__ */ import_react31.default.createElement(import_react32.RiArrowRightSLine, { size: 22 }),
|
|
2347
|
+
onClick: () => onPageChange(page + 1),
|
|
2348
|
+
disabled: page === totalPages - 1
|
|
2349
|
+
}
|
|
2350
|
+
));
|
|
2351
|
+
};
|
|
2352
|
+
var PageBtn = ({
|
|
2353
|
+
i,
|
|
2354
|
+
page,
|
|
2355
|
+
onPageChange
|
|
2356
|
+
}) => /* @__PURE__ */ import_react31.default.createElement(
|
|
2357
|
+
Button_default,
|
|
2358
|
+
{
|
|
2359
|
+
size: "sm",
|
|
2360
|
+
variant: "outlined",
|
|
2361
|
+
className: cn(
|
|
2362
|
+
i === page && "bg-primary-50 shadow-[0px_0px_0px_2px] shadow-primary-700 hover:shadow-[0px_0px_0px_2px] hover:shadow-primary-700"
|
|
2363
|
+
),
|
|
2364
|
+
onClick: () => onPageChange(i)
|
|
2365
|
+
},
|
|
2366
|
+
i + 1
|
|
2367
|
+
);
|
|
2368
|
+
var NavBtn = ({
|
|
2369
|
+
icon,
|
|
2370
|
+
onClick,
|
|
2371
|
+
disabled
|
|
2372
|
+
}) => /* @__PURE__ */ import_react31.default.createElement(
|
|
2373
|
+
Button_default,
|
|
2374
|
+
{
|
|
2375
|
+
size: "sm",
|
|
2376
|
+
variant: "outlined",
|
|
2377
|
+
startIcon: icon,
|
|
2378
|
+
onClick,
|
|
2379
|
+
disabled,
|
|
2380
|
+
className: "p-2"
|
|
2381
|
+
}
|
|
2382
|
+
);
|
|
2383
|
+
var ListPagination_default = ListPagination;
|
|
2384
|
+
|
|
1472
2385
|
// app/components/Loading.tsx
|
|
1473
|
-
var
|
|
2386
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
1474
2387
|
var Loading = ({ width, height, loaderColor, variant }) => {
|
|
1475
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
1476
2389
|
"div",
|
|
1477
2390
|
{
|
|
1478
2391
|
className: cn(
|
|
@@ -1491,17 +2404,18 @@ var Loading = ({ width, height, loaderColor, variant }) => {
|
|
|
1491
2404
|
var Loading_default = Loading;
|
|
1492
2405
|
|
|
1493
2406
|
// app/components/Modal.tsx
|
|
1494
|
-
var
|
|
1495
|
-
var
|
|
2407
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
2408
|
+
var import_react35 = require("@remixicon/react");
|
|
1496
2409
|
function Modal({
|
|
1497
2410
|
children,
|
|
1498
2411
|
showModal,
|
|
1499
2412
|
setShowModal,
|
|
1500
2413
|
closeModal = true,
|
|
1501
2414
|
closeOnOutsideClick = true,
|
|
1502
|
-
className = ""
|
|
2415
|
+
className = "",
|
|
2416
|
+
width = "50%"
|
|
1503
2417
|
}) {
|
|
1504
|
-
(0,
|
|
2418
|
+
(0, import_react34.useEffect)(() => {
|
|
1505
2419
|
if (showModal) {
|
|
1506
2420
|
document.body.style.overflow = "hidden";
|
|
1507
2421
|
} else {
|
|
@@ -1516,144 +2430,65 @@ function Modal({
|
|
|
1516
2430
|
setShowModal(false);
|
|
1517
2431
|
}
|
|
1518
2432
|
};
|
|
1519
|
-
return /* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, showModal && /* @__PURE__ */ import_react34.default.createElement(
|
|
1520
2434
|
"div",
|
|
1521
2435
|
{
|
|
1522
2436
|
onClick: handleClickOutside,
|
|
1523
2437
|
className: "w-full h-full bg-backdrop bg-blend-overlay fixed top-0 bottom-0 left-0 right-0 flex justify-center items-center z-[1000000] overflow-hidden"
|
|
1524
2438
|
},
|
|
1525
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ import_react34.default.createElement(
|
|
1526
2440
|
"div",
|
|
1527
2441
|
{
|
|
1528
|
-
|
|
2442
|
+
style: { width },
|
|
2443
|
+
className: cn(
|
|
2444
|
+
"relative bg-white shadow-boxShadow rounded-xl p-[18px] transition-all duration-150 fade-in-grow mx-4",
|
|
2445
|
+
className
|
|
2446
|
+
)
|
|
1529
2447
|
},
|
|
1530
|
-
/* @__PURE__ */
|
|
1531
|
-
closeModal && /* @__PURE__ */
|
|
2448
|
+
/* @__PURE__ */ import_react34.default.createElement("div", null, children),
|
|
2449
|
+
closeModal && /* @__PURE__ */ import_react34.default.createElement(
|
|
1532
2450
|
"div",
|
|
1533
2451
|
{
|
|
1534
|
-
className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop rounded-
|
|
2452
|
+
className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop rounded-md cursor-pointer hover:bg-gray-100",
|
|
1535
2453
|
onClick: () => setShowModal(false)
|
|
1536
2454
|
},
|
|
1537
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ import_react34.default.createElement(import_react35.RiCloseLine, { size: 24 })
|
|
1538
2456
|
)
|
|
1539
2457
|
)
|
|
1540
2458
|
));
|
|
1541
2459
|
}
|
|
1542
2460
|
|
|
1543
|
-
// app/components/
|
|
1544
|
-
var
|
|
1545
|
-
var
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
onClick: () => setIsOpen(!isOpen),
|
|
1570
|
-
"aria-label": "Open menu"
|
|
1571
|
-
},
|
|
1572
|
-
trigger
|
|
1573
|
-
), isOpen && /* @__PURE__ */ import_react26.default.createElement(
|
|
1574
|
-
"div",
|
|
1575
|
-
{
|
|
1576
|
-
style: { width },
|
|
1577
|
-
className: cn(
|
|
1578
|
-
"border border-gray-200 rounded-lg absolute left-0 mt-1 z-[100000] w-full bg-white shadow-sm",
|
|
1579
|
-
className
|
|
1580
|
-
)
|
|
1581
|
-
},
|
|
1582
|
-
children
|
|
1583
|
-
));
|
|
1584
|
-
}
|
|
1585
|
-
var MenuSubItem = ({
|
|
1586
|
-
label,
|
|
1587
|
-
onClick,
|
|
1588
|
-
disabled,
|
|
1589
|
-
children,
|
|
1590
|
-
className = ""
|
|
1591
|
-
}) => /* @__PURE__ */ import_react26.default.createElement(
|
|
1592
|
-
"button",
|
|
1593
|
-
{
|
|
1594
|
-
className: cn(
|
|
1595
|
-
"w-full text-left p-4 text-sm border-y-[0.5px] last:border-y first:rounded-t hover:bg-primary-50 hover:rounded",
|
|
1596
|
-
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
1597
|
-
className
|
|
1598
|
-
),
|
|
1599
|
-
onClick,
|
|
1600
|
-
disabled
|
|
1601
|
-
},
|
|
1602
|
-
label,
|
|
1603
|
-
children && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, children)
|
|
1604
|
-
);
|
|
1605
|
-
var MenuItem3 = ({
|
|
1606
|
-
content,
|
|
1607
|
-
children,
|
|
1608
|
-
className = "",
|
|
1609
|
-
sectionClassName = "",
|
|
1610
|
-
menuClassName = ""
|
|
1611
|
-
}) => {
|
|
1612
|
-
const [isSubOpen, setIsSubOpen] = (0, import_react26.useState)(false);
|
|
1613
|
-
return /* @__PURE__ */ import_react26.default.createElement("div", { className: cn("relative", className) }, /* @__PURE__ */ import_react26.default.createElement(
|
|
1614
|
-
"section",
|
|
1615
|
-
{
|
|
1616
|
-
onClick: () => setIsSubOpen(!isSubOpen),
|
|
1617
|
-
className: cn(
|
|
1618
|
-
"cursor-pointer hover:bg-primary-50 p-4 flex text-sm border-y-[0.5px] justify-between items-center gap-1 w-full text-left",
|
|
1619
|
-
sectionClassName
|
|
1620
|
-
)
|
|
1621
|
-
},
|
|
1622
|
-
content,
|
|
1623
|
-
isSubOpen ? /* @__PURE__ */ import_react26.default.createElement(import_react27.RiArrowUpSLine, { size: 20 }) : /* @__PURE__ */ import_react26.default.createElement(import_react27.RiArrowDownSLine, { size: 20 })
|
|
1624
|
-
), isSubOpen && /* @__PURE__ */ import_react26.default.createElement("div", { className: cn(" border-primary-100 bg-gray-50", menuClassName) }, children));
|
|
1625
|
-
};
|
|
1626
|
-
|
|
1627
|
-
// app/components/Notice.tsx
|
|
1628
|
-
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1629
|
-
var import_react28 = __toESM(require("react"), 1);
|
|
1630
|
-
var import_react29 = require("@remixicon/react");
|
|
1631
|
-
var VariantIcon = ({ variant }) => {
|
|
1632
|
-
switch (variant) {
|
|
1633
|
-
case "success":
|
|
1634
|
-
return /* @__PURE__ */ import_react28.default.createElement("span", null, /* @__PURE__ */ import_react28.default.createElement(import_react29.RiThumbUpLine, { size: 20, color: "#039855" }));
|
|
1635
|
-
case "warning":
|
|
1636
|
-
return /* @__PURE__ */ import_react28.default.createElement("span", null, /* @__PURE__ */ import_react28.default.createElement(import_react29.RiQuestionLine, { color: "#F79009", size: 20 }));
|
|
1637
|
-
case "info":
|
|
1638
|
-
return /* @__PURE__ */ import_react28.default.createElement("span", null, /* @__PURE__ */ import_react28.default.createElement(import_react29.RiErrorWarningLine, { color: "#1570EF", size: 20 }));
|
|
1639
|
-
case "error":
|
|
1640
|
-
return /* @__PURE__ */ import_react28.default.createElement("span", null, /* @__PURE__ */ import_react28.default.createElement(import_react29.RiAlertFill, { color: "#F04438", size: 20 }));
|
|
1641
|
-
default:
|
|
1642
|
-
return /* @__PURE__ */ import_react28.default.createElement("span", null, /* @__PURE__ */ import_react28.default.createElement(import_react29.RiShieldCheckLine, { color: "#475467", size: 20 }));
|
|
1643
|
-
}
|
|
1644
|
-
};
|
|
1645
|
-
var noticeVariants = (0, import_class_variance_authority6.cva)("p-4 w-fit rounded-[6px]", {
|
|
1646
|
-
variants: {
|
|
1647
|
-
variant: {
|
|
1648
|
-
success: "bg-success-25 border border-success-600",
|
|
1649
|
-
warning: "bg-warning-25 border border-warning-600",
|
|
1650
|
-
info: "bg-primary-25 border border-primary-600",
|
|
1651
|
-
error: "bg-error-25 border border-error-600",
|
|
1652
|
-
default: "bg-gray-25 border border-gray-600"
|
|
2461
|
+
// app/components/Notice.tsx
|
|
2462
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
2463
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
2464
|
+
var import_react37 = require("@remixicon/react");
|
|
2465
|
+
var VariantIcon = ({ variant }) => {
|
|
2466
|
+
switch (variant) {
|
|
2467
|
+
case "success":
|
|
2468
|
+
return /* @__PURE__ */ import_react36.default.createElement("span", null, /* @__PURE__ */ import_react36.default.createElement(import_react37.RiThumbUpLine, { size: 20, color: "#039855" }));
|
|
2469
|
+
case "warning":
|
|
2470
|
+
return /* @__PURE__ */ import_react36.default.createElement("span", null, /* @__PURE__ */ import_react36.default.createElement(import_react37.RiQuestionLine, { color: "#F79009", size: 20 }));
|
|
2471
|
+
case "info":
|
|
2472
|
+
return /* @__PURE__ */ import_react36.default.createElement("span", null, /* @__PURE__ */ import_react36.default.createElement(import_react37.RiErrorWarningLine, { color: "#1570EF", size: 20 }));
|
|
2473
|
+
case "error":
|
|
2474
|
+
return /* @__PURE__ */ import_react36.default.createElement("span", null, /* @__PURE__ */ import_react36.default.createElement(import_react37.RiAlertFill, { color: "#F04438", size: 20 }));
|
|
2475
|
+
default:
|
|
2476
|
+
return /* @__PURE__ */ import_react36.default.createElement("span", null, /* @__PURE__ */ import_react36.default.createElement(import_react37.RiShieldCheckLine, { color: "#475467", size: 20 }));
|
|
2477
|
+
}
|
|
2478
|
+
};
|
|
2479
|
+
var noticeVariants = (0, import_class_variance_authority6.cva)("p-4 w-fit rounded-[6px]", {
|
|
2480
|
+
variants: {
|
|
2481
|
+
variant: {
|
|
2482
|
+
success: "bg-success-25 border border-success-600",
|
|
2483
|
+
warning: "bg-warning-25 border border-warning-600",
|
|
2484
|
+
info: "bg-primary-25 border border-primary-600",
|
|
2485
|
+
error: "bg-error-25 border border-error-600",
|
|
2486
|
+
default: "bg-gray-25 border border-gray-600"
|
|
1653
2487
|
},
|
|
1654
2488
|
position: {
|
|
1655
2489
|
top: "top-4 transition-all duration-700 m-auto left-0 right-0",
|
|
1656
|
-
bottom: "bottom-4 transition-all duration-700 right-4"
|
|
2490
|
+
bottom: "bottom-4 transition-all duration-700 right-4",
|
|
2491
|
+
center: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 test"
|
|
1657
2492
|
}
|
|
1658
2493
|
}
|
|
1659
2494
|
});
|
|
@@ -1667,38 +2502,106 @@ var Notice = ({
|
|
|
1667
2502
|
showIcon = true
|
|
1668
2503
|
}) => {
|
|
1669
2504
|
const handleClose = () => setOpen(false);
|
|
1670
|
-
return /* @__PURE__ */
|
|
2505
|
+
return /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, open && /* @__PURE__ */ import_react36.default.createElement(
|
|
1671
2506
|
"div",
|
|
1672
2507
|
{
|
|
1673
2508
|
className: cn(
|
|
1674
2509
|
noticeVariants({ variant, position }),
|
|
1675
2510
|
`fixed z-10`,
|
|
1676
2511
|
position === "top" && open && `animate-slide-in-top`,
|
|
1677
|
-
position === "bottom" && open && `animate-slide-in-right
|
|
2512
|
+
position === "bottom" && open && `animate-slide-in-right`,
|
|
2513
|
+
position === "center" && open && `animate-fade-in`
|
|
1678
2514
|
)
|
|
1679
2515
|
},
|
|
1680
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ import_react36.default.createElement("div", { className: "relative" }, showIcon ? noticeTitle == "" ? /* @__PURE__ */ import_react36.default.createElement("div", { className: "flex items-start" }, /* @__PURE__ */ import_react36.default.createElement(VariantIcon, { variant }), /* @__PURE__ */ import_react36.default.createElement("span", { className: "ml-2 mr-8 text-text-sm" }, children), /* @__PURE__ */ import_react36.default.createElement("span", { onClick: handleClose }, /* @__PURE__ */ import_react36.default.createElement(import_react37.RiCloseLine, { size: 20 }))) : /* @__PURE__ */ import_react36.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react36.default.createElement("section", { className: "flex items-start" }, /* @__PURE__ */ import_react36.default.createElement(VariantIcon, { variant }), /* @__PURE__ */ import_react36.default.createElement("div", { className: "ml-2 mr-8 -mt-[3px]" }, /* @__PURE__ */ import_react36.default.createElement("span", { className: "font-bold text-gray-800 mb-1" }, noticeTitle), /* @__PURE__ */ import_react36.default.createElement("p", { className: "text-text-sm text-gray-700" }, children))), /* @__PURE__ */ import_react36.default.createElement(
|
|
1681
2517
|
"span",
|
|
1682
2518
|
{
|
|
1683
2519
|
className: cn("absolute top-0 right-0 cursor-pointer"),
|
|
1684
2520
|
onClick: handleClose
|
|
1685
2521
|
},
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
)) : /* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ import_react36.default.createElement(import_react37.RiCloseLine, { size: 20 })
|
|
2523
|
+
)) : /* @__PURE__ */ import_react36.default.createElement("div", { className: "mr-8" }, /* @__PURE__ */ import_react36.default.createElement("section", { className: "flex items-center" }, /* @__PURE__ */ import_react36.default.createElement("p", { className: "font-bold text-gray-800 mb-1" }, noticeTitle)), /* @__PURE__ */ import_react36.default.createElement(
|
|
1688
2524
|
"span",
|
|
1689
2525
|
{
|
|
1690
2526
|
className: cn("absolute top-0 right-0 cursor-pointer"),
|
|
1691
2527
|
onClick: handleClose
|
|
1692
2528
|
},
|
|
1693
|
-
/* @__PURE__ */
|
|
1694
|
-
), /* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ import_react36.default.createElement(import_react37.RiCloseLine, { size: 20 })
|
|
2530
|
+
), /* @__PURE__ */ import_react36.default.createElement("p", { className: "text-text-sm" }, children)))
|
|
1695
2531
|
));
|
|
1696
2532
|
};
|
|
1697
2533
|
var Notice_default = Notice;
|
|
1698
2534
|
|
|
2535
|
+
// app/components/OTPInput.tsx
|
|
2536
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
2537
|
+
var OTPInput = ({
|
|
2538
|
+
length,
|
|
2539
|
+
onChange,
|
|
2540
|
+
type = "text"
|
|
2541
|
+
}) => {
|
|
2542
|
+
const [otpValues, setOtpValues] = (0, import_react38.useState)(Array(length).fill(""));
|
|
2543
|
+
const inputsRef = (0, import_react38.useRef)([]);
|
|
2544
|
+
const handleChange = (e, idx) => {
|
|
2545
|
+
var _a;
|
|
2546
|
+
let value = e.target.value;
|
|
2547
|
+
if (type === "number")
|
|
2548
|
+
value = value.replace(/\D/g, "");
|
|
2549
|
+
if (!value)
|
|
2550
|
+
return;
|
|
2551
|
+
const newOtp = [...otpValues];
|
|
2552
|
+
newOtp[idx] = value[0];
|
|
2553
|
+
setOtpValues(newOtp);
|
|
2554
|
+
onChange(newOtp.join(""));
|
|
2555
|
+
if (idx < length - 1)
|
|
2556
|
+
(_a = inputsRef.current[idx + 1]) == null ? void 0 : _a.focus();
|
|
2557
|
+
};
|
|
2558
|
+
const handleKeyDown = (e, idx) => {
|
|
2559
|
+
var _a;
|
|
2560
|
+
if (e.key === "Backspace") {
|
|
2561
|
+
if (otpValues[idx]) {
|
|
2562
|
+
const newOtp = [...otpValues];
|
|
2563
|
+
newOtp[idx] = "";
|
|
2564
|
+
setOtpValues(newOtp);
|
|
2565
|
+
onChange(newOtp.join(""));
|
|
2566
|
+
} else if (idx > 0) {
|
|
2567
|
+
(_a = inputsRef.current[idx - 1]) == null ? void 0 : _a.focus();
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
};
|
|
2571
|
+
const handlePaste = (e) => {
|
|
2572
|
+
var _a;
|
|
2573
|
+
e.preventDefault();
|
|
2574
|
+
let pasteData = e.clipboardData.getData("Text");
|
|
2575
|
+
if (type === "number")
|
|
2576
|
+
pasteData = pasteData.replace(/\D/g, "");
|
|
2577
|
+
const newOtp = pasteData.split("").concat(Array(length).fill("")).slice(0, length);
|
|
2578
|
+
setOtpValues(newOtp);
|
|
2579
|
+
onChange(newOtp.join(""));
|
|
2580
|
+
(_a = inputsRef.current[Math.min(pasteData.length, length - 1)]) == null ? void 0 : _a.focus();
|
|
2581
|
+
};
|
|
2582
|
+
return /* @__PURE__ */ import_react38.default.createElement("div", { className: "flex items-center gap-2" }, Array.from({ length }).map((_, idx) => /* @__PURE__ */ import_react38.default.createElement(
|
|
2583
|
+
Input_default,
|
|
2584
|
+
{
|
|
2585
|
+
key: idx,
|
|
2586
|
+
type,
|
|
2587
|
+
inputMode: type === "number" ? "numeric" : "text",
|
|
2588
|
+
maxLength: 1,
|
|
2589
|
+
value: otpValues[idx],
|
|
2590
|
+
onChange: (e) => handleChange(e, idx),
|
|
2591
|
+
onKeyDown: (e) => handleKeyDown(e, idx),
|
|
2592
|
+
onPaste: handlePaste,
|
|
2593
|
+
ref: (el) => {
|
|
2594
|
+
inputsRef.current[idx] = el ?? null;
|
|
2595
|
+
},
|
|
2596
|
+
className: "w-[40px] p-3.5"
|
|
2597
|
+
}
|
|
2598
|
+
)));
|
|
2599
|
+
};
|
|
2600
|
+
var OTPInput_default = OTPInput;
|
|
2601
|
+
|
|
1699
2602
|
// app/components/Pagination.tsx
|
|
1700
|
-
var
|
|
1701
|
-
var
|
|
2603
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
2604
|
+
var import_react40 = require("@remixicon/react");
|
|
1702
2605
|
var Pagination = ({
|
|
1703
2606
|
count,
|
|
1704
2607
|
page,
|
|
@@ -1706,7 +2609,10 @@ var Pagination = ({
|
|
|
1706
2609
|
rowsPerPageOptions,
|
|
1707
2610
|
onPageChange,
|
|
1708
2611
|
onRowsPerPageChange,
|
|
1709
|
-
className
|
|
2612
|
+
className,
|
|
2613
|
+
variant = "primary",
|
|
2614
|
+
countVariable,
|
|
2615
|
+
itemsPerPage = true
|
|
1710
2616
|
}) => {
|
|
1711
2617
|
const totalPages = Math.ceil(count / rowsPerPage);
|
|
1712
2618
|
const handlePrevPageClick = () => {
|
|
@@ -1715,7 +2621,7 @@ var Pagination = ({
|
|
|
1715
2621
|
const handleNextPageClick = () => {
|
|
1716
2622
|
onPageChange(page + 1);
|
|
1717
2623
|
};
|
|
1718
|
-
const [showOptions, setShowOptions] = (0,
|
|
2624
|
+
const [showOptions, setShowOptions] = (0, import_react39.useState)(false);
|
|
1719
2625
|
const handleOptionClick = (option) => {
|
|
1720
2626
|
if (typeof option === "number") {
|
|
1721
2627
|
onRowsPerPageChange(option);
|
|
@@ -1724,15 +2630,16 @@ var Pagination = ({
|
|
|
1724
2630
|
}
|
|
1725
2631
|
setShowOptions(false);
|
|
1726
2632
|
};
|
|
1727
|
-
return /* @__PURE__ */
|
|
2633
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
1728
2634
|
"div",
|
|
1729
2635
|
{
|
|
1730
2636
|
className: cn(
|
|
1731
|
-
"
|
|
2637
|
+
"px-3 py-4 flex justify-between items-center w-full",
|
|
2638
|
+
variant === "primary" && "border border-gray-200 px-6 py-4",
|
|
1732
2639
|
className
|
|
1733
2640
|
)
|
|
1734
2641
|
},
|
|
1735
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ import_react39.default.createElement("section", { className: "flex gap-1.5 items-center" }, countVariable && /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-text-sm text-gray-800 font-medium" }, count, " ", countVariable ?? "Items"), itemsPerPage && /* @__PURE__ */ import_react39.default.createElement("div", { className: "flex gap-1.5 items-center" }, /* @__PURE__ */ import_react39.default.createElement("span", { className: "text-gray-800 text-text-sm font-medium" }, "Items per page"), /* @__PURE__ */ import_react39.default.createElement("div", { className: "relative z-[100]" }, /* @__PURE__ */ import_react39.default.createElement(
|
|
1736
2643
|
"div",
|
|
1737
2644
|
{
|
|
1738
2645
|
className: "border border-gray-600 w-[88px] rounded text-sm px-1.5 py-1 cursor-pointer flex items-center justify-between gap-1 text-gray-600",
|
|
@@ -1740,8 +2647,8 @@ var Pagination = ({
|
|
|
1740
2647
|
},
|
|
1741
2648
|
rowsPerPage,
|
|
1742
2649
|
" ",
|
|
1743
|
-
!showOptions ? /* @__PURE__ */
|
|
1744
|
-
), showOptions && /* @__PURE__ */
|
|
2650
|
+
!showOptions ? /* @__PURE__ */ import_react39.default.createElement(import_react40.RiArrowDownSLine, { size: 14 }) : /* @__PURE__ */ import_react39.default.createElement(import_react40.RiArrowUpSLine, { size: 14 })
|
|
2651
|
+
), showOptions && /* @__PURE__ */ import_react39.default.createElement("div", { className: "absolute top-full left-0 shadow bg-white rounded-md text-sm mt-1 z-50" }, rowsPerPageOptions == null ? void 0 : rowsPerPageOptions.map((option, index) => /* @__PURE__ */ import_react39.default.createElement(
|
|
1745
2652
|
"div",
|
|
1746
2653
|
{
|
|
1747
2654
|
key: index,
|
|
@@ -1749,42 +2656,62 @@ var Pagination = ({
|
|
|
1749
2656
|
onClick: () => handleOptionClick(option)
|
|
1750
2657
|
},
|
|
1751
2658
|
typeof option === "number" ? option : option.label
|
|
1752
|
-
))))),
|
|
1753
|
-
/* @__PURE__ */
|
|
2659
|
+
)))))),
|
|
2660
|
+
/* @__PURE__ */ import_react39.default.createElement("section", { className: "flex items-center gap-2 font-medium" }, variant === "primary" ? /* @__PURE__ */ import_react39.default.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm" }, /* @__PURE__ */ import_react39.default.createElement("span", null, "page"), /* @__PURE__ */ import_react39.default.createElement(
|
|
1754
2661
|
"select",
|
|
1755
2662
|
{
|
|
1756
2663
|
value: page + 1,
|
|
1757
2664
|
onChange: (e) => onPageChange(parseInt(e.target.value, 10) - 1),
|
|
1758
2665
|
className: "bg-gray-25 text-gray-500 px-3.5 py-1 border border-gray-200 rounded-md text-sm focus:outline-none focus:border-gray-600"
|
|
1759
2666
|
},
|
|
1760
|
-
totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */
|
|
1761
|
-
), /* @__PURE__ */
|
|
2667
|
+
totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */ import_react39.default.createElement("option", { key: index + 1, value: index + 1 }, index + 1))
|
|
2668
|
+
), /* @__PURE__ */ import_react39.default.createElement("span", null, "of ", totalPages > 0 ? totalPages : 0)) : /* @__PURE__ */ import_react39.default.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm mx-3" }, /* @__PURE__ */ import_react39.default.createElement("span", null, page + 1, " of ", totalPages > 0 ? totalPages : 0)), variant === "primary" ? /* @__PURE__ */ import_react39.default.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ import_react39.default.createElement(
|
|
1762
2669
|
Button_default,
|
|
1763
2670
|
{
|
|
1764
2671
|
variant: "outlined",
|
|
1765
2672
|
intent: "default-outlined",
|
|
1766
|
-
startIcon: /* @__PURE__ */
|
|
2673
|
+
startIcon: /* @__PURE__ */ import_react39.default.createElement(import_react40.RiArrowLeftLine, { size: 20 }),
|
|
1767
2674
|
onClick: handlePrevPageClick,
|
|
1768
2675
|
disabled: page === 0,
|
|
1769
2676
|
className: "rounded-none h-8 rounded-l-lg"
|
|
1770
2677
|
}
|
|
1771
|
-
), /* @__PURE__ */
|
|
2678
|
+
), /* @__PURE__ */ import_react39.default.createElement(
|
|
1772
2679
|
Button_default,
|
|
1773
2680
|
{
|
|
1774
2681
|
variant: "outlined",
|
|
1775
2682
|
intent: "default-outlined",
|
|
1776
|
-
startIcon: /* @__PURE__ */
|
|
2683
|
+
startIcon: /* @__PURE__ */ import_react39.default.createElement(import_react40.RiArrowRightLine, { size: 20 }),
|
|
1777
2684
|
onClick: handleNextPageClick,
|
|
1778
2685
|
disabled: page === totalPages - 1,
|
|
1779
2686
|
className: "rounded-none h-8 rounded-r-lg"
|
|
1780
2687
|
}
|
|
2688
|
+
)) : /* @__PURE__ */ import_react39.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react39.default.createElement(
|
|
2689
|
+
import_react40.RiArrowLeftSLine,
|
|
2690
|
+
{
|
|
2691
|
+
size: 22,
|
|
2692
|
+
cursor: "pointer",
|
|
2693
|
+
onClick: handlePrevPageClick,
|
|
2694
|
+
className: cn(
|
|
2695
|
+
page === 0 && "pointer-events-none select-none opacity-30"
|
|
2696
|
+
)
|
|
2697
|
+
}
|
|
2698
|
+
), /* @__PURE__ */ import_react39.default.createElement(
|
|
2699
|
+
import_react40.RiArrowRightSLine,
|
|
2700
|
+
{
|
|
2701
|
+
size: 22,
|
|
2702
|
+
cursor: "pointer",
|
|
2703
|
+
onClick: handleNextPageClick,
|
|
2704
|
+
className: cn(
|
|
2705
|
+
page === totalPages - 1 && "pointer-events-none select-none opacity-30"
|
|
2706
|
+
)
|
|
2707
|
+
}
|
|
1781
2708
|
)))
|
|
1782
2709
|
);
|
|
1783
2710
|
};
|
|
1784
2711
|
var Pagination_default = Pagination;
|
|
1785
2712
|
|
|
1786
2713
|
// app/components/Progress.tsx
|
|
1787
|
-
var
|
|
2714
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
1788
2715
|
var ProgressBar = ({
|
|
1789
2716
|
progress,
|
|
1790
2717
|
progressText = "",
|
|
@@ -1792,7 +2719,7 @@ var ProgressBar = ({
|
|
|
1792
2719
|
progressTextPosition
|
|
1793
2720
|
}) => {
|
|
1794
2721
|
const _progress = Math == null ? void 0 : Math.min(Math == null ? void 0 : Math.max(0, progress), 100);
|
|
1795
|
-
return /* @__PURE__ */
|
|
2722
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
|
1796
2723
|
"div",
|
|
1797
2724
|
{
|
|
1798
2725
|
className: cn(
|
|
@@ -1800,7 +2727,7 @@ var ProgressBar = ({
|
|
|
1800
2727
|
progressTextPosition === "right" ? "flex items-center gap-1" : progressTextPosition === "left" ? "flex items-center gap-1" : ""
|
|
1801
2728
|
)
|
|
1802
2729
|
},
|
|
1803
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
1804
2731
|
"span",
|
|
1805
2732
|
{
|
|
1806
2733
|
className: cn(
|
|
@@ -1810,7 +2737,7 @@ var ProgressBar = ({
|
|
|
1810
2737
|
},
|
|
1811
2738
|
progressText
|
|
1812
2739
|
),
|
|
1813
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
1814
2741
|
"div",
|
|
1815
2742
|
{
|
|
1816
2743
|
className: "w-full h-2 rounded bg-gray-200",
|
|
@@ -1819,15 +2746,15 @@ var ProgressBar = ({
|
|
|
1819
2746
|
"aria-valuemin": 0,
|
|
1820
2747
|
"aria-valuemax": 100
|
|
1821
2748
|
},
|
|
1822
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
1823
2750
|
"div",
|
|
1824
2751
|
{
|
|
1825
|
-
className: `${progressColor} h-full transition-all delay-
|
|
2752
|
+
className: `${progressColor} h-full transition-all delay-100 duration-300 rounded ease-in`,
|
|
1826
2753
|
style: { width: `${_progress}%` }
|
|
1827
2754
|
}
|
|
1828
2755
|
)
|
|
1829
2756
|
),
|
|
1830
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
1831
2758
|
"span",
|
|
1832
2759
|
{
|
|
1833
2760
|
className: cn(
|
|
@@ -1842,7 +2769,7 @@ var ProgressBar = ({
|
|
|
1842
2769
|
var Progress_default = ProgressBar;
|
|
1843
2770
|
|
|
1844
2771
|
// app/components/Radio.tsx
|
|
1845
|
-
var
|
|
2772
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
1846
2773
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1847
2774
|
var radioVariants = (0, import_class_variance_authority7.cva)("", {
|
|
1848
2775
|
variants: {
|
|
@@ -1855,27 +2782,32 @@ var radioVariants = (0, import_class_variance_authority7.cva)("", {
|
|
|
1855
2782
|
size: "sm"
|
|
1856
2783
|
}
|
|
1857
2784
|
});
|
|
1858
|
-
var Radio = (0,
|
|
1859
|
-
({ size, disabled, checked, className, children, ...props }, ref) => {
|
|
1860
|
-
return /* @__PURE__ */
|
|
2785
|
+
var Radio = (0, import_react42.forwardRef)(
|
|
2786
|
+
({ size, disabled, checked, className, children, id, name, ...props }, ref) => {
|
|
2787
|
+
return /* @__PURE__ */ import_react42.default.createElement("div", { className: "relative inline-flex items-center cursor-pointer" }, /* @__PURE__ */ import_react42.default.createElement(
|
|
1861
2788
|
"input",
|
|
1862
2789
|
{
|
|
1863
2790
|
...props,
|
|
1864
2791
|
ref,
|
|
2792
|
+
id,
|
|
2793
|
+
name,
|
|
1865
2794
|
checked,
|
|
1866
2795
|
disabled,
|
|
2796
|
+
role: "radio",
|
|
2797
|
+
"aria-checked": checked,
|
|
1867
2798
|
type: "radio",
|
|
1868
2799
|
className: cn(
|
|
1869
|
-
"peer relative cursor-pointer appearance-none rounded-full border border-gray-300 hover:border-primary-600 hover:bg-primary-50 transition-all checked:border-primary-600 checked:bg-primary-50 disabled:opacity-30 disabled:pointer-events-none",
|
|
2800
|
+
"peer relative cursor-pointer appearance-none rounded-full border border-gray-300 hover:border-primary-600 hover:bg-primary-50 transition-all checked:border-primary-600 checked:bg-primary-50 disabled:opacity-30 disabled:pointer-events-none focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2",
|
|
1870
2801
|
radioVariants({ size, className })
|
|
1871
2802
|
)
|
|
1872
2803
|
}
|
|
1873
|
-
), /* @__PURE__ */
|
|
2804
|
+
), /* @__PURE__ */ import_react42.default.createElement(
|
|
1874
2805
|
"span",
|
|
1875
2806
|
{
|
|
2807
|
+
"aria-hidden": "true",
|
|
1876
2808
|
className: cn(
|
|
1877
2809
|
"absolute transition-opacity opacity-0 ease-in-out pointer-events-none top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 peer-checked:opacity-100 h-1.5 w-1.5 bg-primary-600 rounded-full duration-300",
|
|
1878
|
-
size
|
|
2810
|
+
size === "sm" && "h-[4.5px] w-[4.5px]"
|
|
1879
2811
|
)
|
|
1880
2812
|
}
|
|
1881
2813
|
));
|
|
@@ -1884,156 +2816,685 @@ var Radio = (0, import_react33.forwardRef)(
|
|
|
1884
2816
|
Radio.displayName = "Radio";
|
|
1885
2817
|
var Radio_default = Radio;
|
|
1886
2818
|
|
|
2819
|
+
// app/components/RazorPayFileUpload.tsx
|
|
2820
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
2821
|
+
var import_react45 = require("@remixicon/react");
|
|
2822
|
+
|
|
2823
|
+
// app/components/Spinner.tsx
|
|
2824
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
2825
|
+
var colorVars = {
|
|
2826
|
+
primary: {
|
|
2827
|
+
c1: "var(--primary-500)",
|
|
2828
|
+
c2: "var(--primary-200)"
|
|
2829
|
+
},
|
|
2830
|
+
black: {
|
|
2831
|
+
c1: "rgba(0, 0, 0, 1)",
|
|
2832
|
+
c2: "rgba(0, 0, 0, 0.5)"
|
|
2833
|
+
},
|
|
2834
|
+
gray: {
|
|
2835
|
+
c1: "var(--gray-500)",
|
|
2836
|
+
c2: "var(--gray-300)"
|
|
2837
|
+
}
|
|
2838
|
+
};
|
|
2839
|
+
var Spinner = ({ size = "md", color = "primary" }) => {
|
|
2840
|
+
const sizeClass = cn({
|
|
2841
|
+
"w-4 h-4": size === "xs",
|
|
2842
|
+
"w-6 h-6": size === "sm",
|
|
2843
|
+
"w-10 h-10": size === "md",
|
|
2844
|
+
"w-16 h-16": size === "lg"
|
|
2845
|
+
});
|
|
2846
|
+
const getColorValues = (color2) => {
|
|
2847
|
+
if (colorVars[color2]) {
|
|
2848
|
+
return colorVars[color2];
|
|
2849
|
+
}
|
|
2850
|
+
if (color2.startsWith("#")) {
|
|
2851
|
+
return {
|
|
2852
|
+
c1: color2,
|
|
2853
|
+
c2: `${color2}80`
|
|
2854
|
+
};
|
|
2855
|
+
}
|
|
2856
|
+
return colorVars.primary;
|
|
2857
|
+
};
|
|
2858
|
+
const colorValues = getColorValues(color);
|
|
2859
|
+
return /* @__PURE__ */ import_react43.default.createElement("div", { className: cn("relative", sizeClass) }, /* @__PURE__ */ import_react43.default.createElement(
|
|
2860
|
+
"div",
|
|
2861
|
+
{
|
|
2862
|
+
className: "spinner",
|
|
2863
|
+
style: {
|
|
2864
|
+
["--spinner-color-1"]: colorValues.c1,
|
|
2865
|
+
["--spinner-color-2"]: colorValues.c2
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
));
|
|
2869
|
+
};
|
|
2870
|
+
var Spinner_default = Spinner;
|
|
2871
|
+
|
|
2872
|
+
// app/components/RazorPayFileUpload.tsx
|
|
2873
|
+
var import_image2 = __toESM(require("next/image"), 1);
|
|
2874
|
+
var defaultGetFileIcon = (fileName, fileType) => {
|
|
2875
|
+
var _a;
|
|
2876
|
+
const extension = ((_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase()) || "";
|
|
2877
|
+
if (fileType.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(extension)) {
|
|
2878
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiImageLine, { className: "w-6 h-6 text-white" });
|
|
2879
|
+
}
|
|
2880
|
+
if (fileType.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a"].includes(extension)) {
|
|
2881
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiMusic2Line, { className: "w-6 h-6 text-white" });
|
|
2882
|
+
}
|
|
2883
|
+
if (fileType.startsWith("video/") || ["mp4", "avi", "mkv", "mov", "wmv"].includes(extension)) {
|
|
2884
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiVideoLine, { className: "w-6 h-6 text-white" });
|
|
2885
|
+
}
|
|
2886
|
+
if (fileType.includes("excel") || ["xls", "xlsx", "csv", "txt", "ods"].includes(extension)) {
|
|
2887
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiFileExcel2Line, { className: "w-6 h-6 text-white" });
|
|
2888
|
+
}
|
|
2889
|
+
if (fileType.includes("word") || ["doc", "docx", "odt", "xml"].includes(extension)) {
|
|
2890
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiFileWord2Line, { className: "w-6 h-6 text-white" });
|
|
2891
|
+
}
|
|
2892
|
+
if (["pptx", "pptm", "xps", "ppsx"].includes(extension)) {
|
|
2893
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiFilePpt2Line, { className: "w-6 h-6 text-white" });
|
|
2894
|
+
}
|
|
2895
|
+
if (fileType.includes("zip") || ["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
2896
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiFileZipLine, { className: "w-6 h-6 text-white" });
|
|
2897
|
+
}
|
|
2898
|
+
if (fileType === "application/pdf" || extension === "pdf") {
|
|
2899
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiFilePdf2Line, { className: "w-6 h-6 text-white" });
|
|
2900
|
+
}
|
|
2901
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react45.RiFileLine, { className: "w-6 h-6 text-white" });
|
|
2902
|
+
};
|
|
2903
|
+
function ImageUploadControlled({
|
|
2904
|
+
items,
|
|
2905
|
+
onAddFiles,
|
|
2906
|
+
onUpdateItem,
|
|
2907
|
+
onDelete,
|
|
2908
|
+
onRetry,
|
|
2909
|
+
onPreview,
|
|
2910
|
+
onUpload,
|
|
2911
|
+
multiple = true,
|
|
2912
|
+
accept = "image/*",
|
|
2913
|
+
maxSizeMB = 15,
|
|
2914
|
+
className = "",
|
|
2915
|
+
hintText,
|
|
2916
|
+
showSizeText = true,
|
|
2917
|
+
getFileIcon = defaultGetFileIcon,
|
|
2918
|
+
autoUpload = true,
|
|
2919
|
+
disabled
|
|
2920
|
+
}) {
|
|
2921
|
+
var _a;
|
|
2922
|
+
const inputRef = (0, import_react44.useRef)(null);
|
|
2923
|
+
const [isDragging, setIsDragging] = (0, import_react44.useState)(false);
|
|
2924
|
+
const localPreviews = (0, import_react44.useRef)(/* @__PURE__ */ new Map());
|
|
2925
|
+
const uploadProgress = (0, import_react44.useRef)(/* @__PURE__ */ new Map());
|
|
2926
|
+
const formatSize = (bytes) => {
|
|
2927
|
+
if (!bytes)
|
|
2928
|
+
return "0 KB";
|
|
2929
|
+
return `${Math.round(bytes / 1024)} KB`;
|
|
2930
|
+
};
|
|
2931
|
+
const getPreviewUrl = (item) => {
|
|
2932
|
+
if (item.previewUrl)
|
|
2933
|
+
return item.previewUrl;
|
|
2934
|
+
if (item.file && !localPreviews.current.has(item.id)) {
|
|
2935
|
+
const url = URL.createObjectURL(item.file);
|
|
2936
|
+
localPreviews.current.set(item.id, url);
|
|
2937
|
+
}
|
|
2938
|
+
return localPreviews.current.get(item.id);
|
|
2939
|
+
};
|
|
2940
|
+
const getStatusDisplay = (status) => {
|
|
2941
|
+
switch (status) {
|
|
2942
|
+
case "uploading":
|
|
2943
|
+
return {
|
|
2944
|
+
text: "Uploading",
|
|
2945
|
+
color: "text-blue-600",
|
|
2946
|
+
showSpinner: true,
|
|
2947
|
+
icon: /* @__PURE__ */ import_react44.default.createElement(Spinner_default, { size: "xs", color: "gray" }),
|
|
2948
|
+
canPreview: false
|
|
2949
|
+
};
|
|
2950
|
+
case "success":
|
|
2951
|
+
return {
|
|
2952
|
+
text: "Completed",
|
|
2953
|
+
color: "text-green-600",
|
|
2954
|
+
showSpinner: false,
|
|
2955
|
+
icon: /* @__PURE__ */ import_react44.default.createElement(import_react45.RiCheckLine, { className: "w-3 h-3 text-white" }),
|
|
2956
|
+
canPreview: true
|
|
2957
|
+
};
|
|
2958
|
+
case "error":
|
|
2959
|
+
return {
|
|
2960
|
+
text: "Failed",
|
|
2961
|
+
color: "text-red-600",
|
|
2962
|
+
showSpinner: false,
|
|
2963
|
+
icon: /* @__PURE__ */ import_react44.default.createElement(import_react45.RiCloseLine, { className: "w-3 h-3 text-white" }),
|
|
2964
|
+
canPreview: false
|
|
2965
|
+
};
|
|
2966
|
+
default:
|
|
2967
|
+
return {
|
|
2968
|
+
text: "",
|
|
2969
|
+
color: "",
|
|
2970
|
+
showSpinner: false,
|
|
2971
|
+
icon: null,
|
|
2972
|
+
canPreview: false
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
};
|
|
2976
|
+
const getProgressColor = (status) => {
|
|
2977
|
+
switch (status) {
|
|
2978
|
+
case "uploading":
|
|
2979
|
+
return "bg-blue-500";
|
|
2980
|
+
case "success":
|
|
2981
|
+
return "bg-green-600";
|
|
2982
|
+
case "error":
|
|
2983
|
+
return "bg-red-500";
|
|
2984
|
+
default:
|
|
2985
|
+
return "bg-gray-300";
|
|
2986
|
+
}
|
|
2987
|
+
};
|
|
2988
|
+
const getItemFileIcon = (item) => {
|
|
2989
|
+
var _a2, _b;
|
|
2990
|
+
const fileName = item.name || ((_a2 = item.file) == null ? void 0 : _a2.name) || "";
|
|
2991
|
+
const fileType = ((_b = item.file) == null ? void 0 : _b.type) || "";
|
|
2992
|
+
return getFileIcon(fileName, fileType);
|
|
2993
|
+
};
|
|
2994
|
+
const handleUpload = import_react44.default.useCallback(
|
|
2995
|
+
async (item) => {
|
|
2996
|
+
if (!item.file || !onUpload)
|
|
2997
|
+
return;
|
|
2998
|
+
try {
|
|
2999
|
+
if (onUpdateItem) {
|
|
3000
|
+
onUpdateItem(item.id, { status: "uploading", progress: 0 });
|
|
3001
|
+
}
|
|
3002
|
+
const previewUrl = await onUpload(item.file, (progress) => {
|
|
3003
|
+
uploadProgress.current.set(item.id, progress);
|
|
3004
|
+
if (onUpdateItem) {
|
|
3005
|
+
onUpdateItem(item.id, { progress, status: "uploading" });
|
|
3006
|
+
}
|
|
3007
|
+
});
|
|
3008
|
+
if (onUpdateItem) {
|
|
3009
|
+
onUpdateItem(item.id, {
|
|
3010
|
+
progress: 100,
|
|
3011
|
+
status: "success",
|
|
3012
|
+
previewUrl
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
} catch (error) {
|
|
3016
|
+
if (onUpdateItem) {
|
|
3017
|
+
onUpdateItem(item.id, { progress: 0, status: "error" });
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
},
|
|
3021
|
+
[onUpload, onUpdateItem]
|
|
3022
|
+
);
|
|
3023
|
+
const getCurrentProgress = (item) => {
|
|
3024
|
+
return uploadProgress.current.get(item.id) ?? item.progress ?? 0;
|
|
3025
|
+
};
|
|
3026
|
+
const handleRetry = (id) => {
|
|
3027
|
+
const item = items.find((item2) => item2.id === id);
|
|
3028
|
+
if (item && onUpload) {
|
|
3029
|
+
handleUpload(item);
|
|
3030
|
+
} else if (onRetry) {
|
|
3031
|
+
onRetry(id);
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
const handleDelete = (id) => {
|
|
3035
|
+
if (localPreviews.current.has(id)) {
|
|
3036
|
+
const url = localPreviews.current.get(id);
|
|
3037
|
+
if (url)
|
|
3038
|
+
URL.revokeObjectURL(url);
|
|
3039
|
+
localPreviews.current.delete(id);
|
|
3040
|
+
}
|
|
3041
|
+
uploadProgress.current.delete(id);
|
|
3042
|
+
if (onDelete) {
|
|
3043
|
+
onDelete(id);
|
|
3044
|
+
}
|
|
3045
|
+
};
|
|
3046
|
+
const triggerInput = () => {
|
|
3047
|
+
var _a2;
|
|
3048
|
+
return (_a2 = inputRef.current) == null ? void 0 : _a2.click();
|
|
3049
|
+
};
|
|
3050
|
+
const handleInputChange = (e) => {
|
|
3051
|
+
const files = Array.from(e.target.files || []);
|
|
3052
|
+
if (files.length === 0)
|
|
3053
|
+
return;
|
|
3054
|
+
const validFiles = files.filter(
|
|
3055
|
+
(file) => file.size <= maxSizeMB * 1024 * 1024
|
|
3056
|
+
);
|
|
3057
|
+
if (validFiles.length === 0)
|
|
3058
|
+
return;
|
|
3059
|
+
onAddFiles(multiple ? validFiles : [validFiles[0]]);
|
|
3060
|
+
e.target.value = "";
|
|
3061
|
+
};
|
|
3062
|
+
const handleDragOver = (e) => {
|
|
3063
|
+
e.preventDefault();
|
|
3064
|
+
if (!disabled)
|
|
3065
|
+
setIsDragging(true);
|
|
3066
|
+
};
|
|
3067
|
+
const handleDragLeave = () => {
|
|
3068
|
+
setIsDragging(false);
|
|
3069
|
+
};
|
|
3070
|
+
const handleDrop = (e) => {
|
|
3071
|
+
e.preventDefault();
|
|
3072
|
+
setIsDragging(false);
|
|
3073
|
+
if (disabled)
|
|
3074
|
+
return;
|
|
3075
|
+
const files = Array.from(e.dataTransfer.files);
|
|
3076
|
+
if (files.length === 0)
|
|
3077
|
+
return;
|
|
3078
|
+
const validFiles = files.filter(
|
|
3079
|
+
(file) => file.size <= maxSizeMB * 1024 * 1024
|
|
3080
|
+
);
|
|
3081
|
+
if (validFiles.length > 0) {
|
|
3082
|
+
onAddFiles(multiple ? validFiles : [validFiles[0]]);
|
|
3083
|
+
}
|
|
3084
|
+
};
|
|
3085
|
+
const handleKeyDown = (e) => {
|
|
3086
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3087
|
+
e.preventDefault();
|
|
3088
|
+
triggerInput();
|
|
3089
|
+
}
|
|
3090
|
+
};
|
|
3091
|
+
import_react44.default.useEffect(() => {
|
|
3092
|
+
if (autoUpload && onUpload) {
|
|
3093
|
+
items.forEach((item) => {
|
|
3094
|
+
if (item.status === "idle" && item.file) {
|
|
3095
|
+
handleUpload(item);
|
|
3096
|
+
}
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
}, [items, autoUpload, onUpload, handleUpload]);
|
|
3100
|
+
import_react44.default.useEffect(() => {
|
|
3101
|
+
const previews = localPreviews == null ? void 0 : localPreviews.current;
|
|
3102
|
+
return () => {
|
|
3103
|
+
previews == null ? void 0 : previews.forEach((url) => URL == null ? void 0 : URL.revokeObjectURL(url));
|
|
3104
|
+
};
|
|
3105
|
+
}, []);
|
|
3106
|
+
return /* @__PURE__ */ import_react44.default.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ import_react44.default.createElement(
|
|
3107
|
+
"input",
|
|
3108
|
+
{
|
|
3109
|
+
ref: inputRef,
|
|
3110
|
+
type: "file",
|
|
3111
|
+
accept,
|
|
3112
|
+
multiple,
|
|
3113
|
+
hidden: true,
|
|
3114
|
+
onChange: handleInputChange,
|
|
3115
|
+
disabled
|
|
3116
|
+
}
|
|
3117
|
+
), /* @__PURE__ */ import_react44.default.createElement(
|
|
3118
|
+
Label_default,
|
|
3119
|
+
{
|
|
3120
|
+
htmlFor: (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.id,
|
|
3121
|
+
onDragOver: handleDragOver,
|
|
3122
|
+
onDragLeave: handleDragLeave,
|
|
3123
|
+
onDrop: handleDrop,
|
|
3124
|
+
onClick: triggerInput,
|
|
3125
|
+
onKeyDown: handleKeyDown,
|
|
3126
|
+
tabIndex: 0,
|
|
3127
|
+
role: "button",
|
|
3128
|
+
disabled,
|
|
3129
|
+
"aria-label": `Upload ${multiple ? "images" : "an image"}`,
|
|
3130
|
+
className: cn(
|
|
3131
|
+
"max-w-[564px] w-full bg-white py-4 flex items-center justify-center rounded-lg border cursor-pointer transition-all",
|
|
3132
|
+
isDragging ? "border-blue-500 bg-blue-50" : "border-gray-300 bg-white hover:bg-gray-50",
|
|
3133
|
+
disabled && "pointer-events-none cursor-not-allowed"
|
|
3134
|
+
)
|
|
3135
|
+
},
|
|
3136
|
+
/* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-center gap-3 text-center" }, /* @__PURE__ */ import_react44.default.createElement("div", null, /* @__PURE__ */ import_react44.default.createElement("p", { className: "text-sm text-gray-600" }, "Drag files here or", /* @__PURE__ */ import_react44.default.createElement("span", { className: "text-primary-600 font-semibold ml-1" }, "Upload"), " ", /* @__PURE__ */ import_react44.default.createElement("br", null))))
|
|
3137
|
+
), /* @__PURE__ */ import_react44.default.createElement("span", { className: "text-xs" }, hintText ?? `Only PNG, JPG, GIF. Max file size ${maxSizeMB}MB`), /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex flex-col gap-4 mt-4" }, items == null ? void 0 : items.map((item) => {
|
|
3138
|
+
var _a2, _b;
|
|
3139
|
+
const previewUrl = getPreviewUrl(item);
|
|
3140
|
+
const progress = getCurrentProgress(item);
|
|
3141
|
+
const statusInfo = getStatusDisplay(item.status);
|
|
3142
|
+
const progressColor = getProgressColor(item == null ? void 0 : item.status);
|
|
3143
|
+
const fileIcon = getItemFileIcon(item);
|
|
3144
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
3145
|
+
"div",
|
|
3146
|
+
{
|
|
3147
|
+
key: item == null ? void 0 : item.id,
|
|
3148
|
+
className: "flex items-center gap-4 bg-white max-w-[564px] w-full p-4 rounded-lg border border-gray-200"
|
|
3149
|
+
},
|
|
3150
|
+
/* @__PURE__ */ import_react44.default.createElement("div", { className: "w-14 h-14 flex-shrink-0 rounded-md overflow-hidden relative" }, /* @__PURE__ */ import_react44.default.createElement(
|
|
3151
|
+
import_image2.default,
|
|
3152
|
+
{
|
|
3153
|
+
src: "/fileImg.svg",
|
|
3154
|
+
className: "absolute inset-0 w-full h-full object-contain",
|
|
3155
|
+
fill: true,
|
|
3156
|
+
alt: "file"
|
|
3157
|
+
}
|
|
3158
|
+
), /* @__PURE__ */ import_react44.default.createElement("div", { className: "relative z-10 mt-2 -ml-[2px] flex items-center justify-center w-full h-full text-white" }, fileIcon)),
|
|
3159
|
+
/* @__PURE__ */ import_react44.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-start justify-between gap-2 mb-3" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ import_react44.default.createElement("h4", { className: "text-sm font-medium text-gray-900 truncate" }, (item == null ? void 0 : item.name) || ((_a2 = item.file) == null ? void 0 : _a2.name) || "Unnamed file"), showSizeText && /* @__PURE__ */ import_react44.default.createElement("div", { className: "text-xs text-gray-500 mt-1 flex items-center gap-1" }, formatSize((item == null ? void 0 : item.size) || ((_b = item.file) == null ? void 0 : _b.size)), statusInfo.text && /* @__PURE__ */ import_react44.default.createElement("div", { className: "ml-2 font-medium flex items-center gap-1" }, (statusInfo == null ? void 0 : statusInfo.showSpinner) ? (
|
|
3160
|
+
// For uploading - just show spinner without circle
|
|
3161
|
+
/* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, statusInfo.icon, /* @__PURE__ */ import_react44.default.createElement("span", { className: statusInfo.color }, statusInfo.text))
|
|
3162
|
+
) : (
|
|
3163
|
+
// For completed/failed - show circle with icon
|
|
3164
|
+
/* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, /* @__PURE__ */ import_react44.default.createElement(
|
|
3165
|
+
"div",
|
|
3166
|
+
{
|
|
3167
|
+
className: `w-4 h-4 rounded-full flex justify-center items-center ${(statusInfo == null ? void 0 : statusInfo.color) === "text-red-600" ? "bg-red-600" : (statusInfo == null ? void 0 : statusInfo.color) === "text-green-600" ? "bg-green-600" : "bg-gray-400"}`
|
|
3168
|
+
},
|
|
3169
|
+
statusInfo == null ? void 0 : statusInfo.icon
|
|
3170
|
+
), /* @__PURE__ */ import_react44.default.createElement("span", { className: statusInfo.color }, statusInfo == null ? void 0 : statusInfo.text))
|
|
3171
|
+
)))), /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-center gap-2" }, onPreview && (item == null ? void 0 : item.status) === "success" && /* @__PURE__ */ import_react44.default.createElement(
|
|
3172
|
+
"button",
|
|
3173
|
+
{
|
|
3174
|
+
type: "button",
|
|
3175
|
+
onClick: () => onPreview(item.id),
|
|
3176
|
+
className: "p-2 rounded-md hover:bg-gray-100 transition-colors text-gray-600",
|
|
3177
|
+
title: "Preview"
|
|
3178
|
+
},
|
|
3179
|
+
/* @__PURE__ */ import_react44.default.createElement(import_react45.RiEyeLine, { size: 16 })
|
|
3180
|
+
), (item == null ? void 0 : item.status) === "error" && /* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, /* @__PURE__ */ import_react44.default.createElement("span", { className: "hidden sm:inline-block" }, /* @__PURE__ */ import_react44.default.createElement(
|
|
3181
|
+
Button_default,
|
|
3182
|
+
{
|
|
3183
|
+
variant: "outlined",
|
|
3184
|
+
intent: "primary-outlined",
|
|
3185
|
+
type: "button",
|
|
3186
|
+
size: "sm",
|
|
3187
|
+
onClick: () => handleRetry(item == null ? void 0 : item.id),
|
|
3188
|
+
className: "whitespace-nowrap h-[30px]"
|
|
3189
|
+
},
|
|
3190
|
+
/* @__PURE__ */ import_react44.default.createElement(import_react45.RiRefreshLine, { size: 16 }),
|
|
3191
|
+
"Try Again"
|
|
3192
|
+
)), /* @__PURE__ */ import_react44.default.createElement("span", { className: "sm:hidden" }, /* @__PURE__ */ import_react44.default.createElement(
|
|
3193
|
+
Button_default,
|
|
3194
|
+
{
|
|
3195
|
+
variant: "outlined",
|
|
3196
|
+
intent: "primary-outlined",
|
|
3197
|
+
type: "button",
|
|
3198
|
+
size: "sm",
|
|
3199
|
+
onClick: () => handleRetry(item == null ? void 0 : item.id),
|
|
3200
|
+
className: "h-[30px] px-1 py-1"
|
|
3201
|
+
},
|
|
3202
|
+
/* @__PURE__ */ import_react44.default.createElement(import_react45.RiRefreshLine, { size: 16 })
|
|
3203
|
+
))), /* @__PURE__ */ import_react44.default.createElement(
|
|
3204
|
+
"button",
|
|
3205
|
+
{
|
|
3206
|
+
type: "button",
|
|
3207
|
+
onClick: () => handleDelete(item.id),
|
|
3208
|
+
className: "p-2 rounded-md hover:bg-gray-100 transition-colors text-gray-600",
|
|
3209
|
+
title: "Delete"
|
|
3210
|
+
},
|
|
3211
|
+
/* @__PURE__ */ import_react44.default.createElement(import_react45.RiDeleteBin6Line, { size: 16 })
|
|
3212
|
+
)))), /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex-1" }, /* @__PURE__ */ import_react44.default.createElement(
|
|
3213
|
+
Progress_default,
|
|
3214
|
+
{
|
|
3215
|
+
progressColor,
|
|
3216
|
+
progress
|
|
3217
|
+
}
|
|
3218
|
+
)), /* @__PURE__ */ import_react44.default.createElement("div", { className: "text-xs text-gray-500 w-12 text-right" }, item.status === "error" ? "--%" : `${Math.round(progress)}%`)))
|
|
3219
|
+
);
|
|
3220
|
+
})));
|
|
3221
|
+
}
|
|
3222
|
+
|
|
1887
3223
|
// app/components/Sidebar.tsx
|
|
1888
|
-
var
|
|
3224
|
+
var import_react46 = __toESM(require("react"), 1);
|
|
1889
3225
|
var import_link2 = __toESM(require("next/link"), 1);
|
|
3226
|
+
var import_react47 = require("@remixicon/react");
|
|
1890
3227
|
var import_navigation = require("next/navigation");
|
|
1891
|
-
var Sidebar = ({ children, collapsed, setCollapsed }) => {
|
|
1892
|
-
return /* @__PURE__ */
|
|
3228
|
+
var Sidebar = ({ children, collapsed, setCollapsed, dense = false }) => {
|
|
3229
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
1893
3230
|
"div",
|
|
1894
3231
|
{
|
|
1895
3232
|
onMouseEnter: () => setCollapsed(true),
|
|
1896
3233
|
onMouseLeave: () => setCollapsed(false),
|
|
1897
3234
|
className: cn(
|
|
1898
3235
|
"border border-gray-200 shadow-sm relative flex flex-col min-h-screen transition-all duration-300 ease-in-out cursor-pointer",
|
|
1899
|
-
!collapsed ? "w-[80px] py-[21px] px-[17px]" : "w-[308px] py-[22px] px-6"
|
|
3236
|
+
!collapsed ? dense ? "w-[76px] py-[19px] px-[15px]" : "w-[80px] py-[21px] px-[17px]" : dense ? "w-[304px] py-[20px] px-5" : "w-[308px] py-[22px] px-6"
|
|
1900
3237
|
)
|
|
1901
3238
|
},
|
|
1902
|
-
/* @__PURE__ */
|
|
3239
|
+
/* @__PURE__ */ import_react46.default.createElement("div", null, children)
|
|
1903
3240
|
);
|
|
1904
3241
|
};
|
|
1905
3242
|
var SidebarHeader = ({
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
children
|
|
3243
|
+
children,
|
|
3244
|
+
dense = false
|
|
1909
3245
|
}) => {
|
|
1910
|
-
return /* @__PURE__ */
|
|
1911
|
-
"div",
|
|
1912
|
-
{
|
|
1913
|
-
className: cn({
|
|
1914
|
-
"z-20": true
|
|
1915
|
-
})
|
|
1916
|
-
},
|
|
1917
|
-
/* @__PURE__ */ import_react34.default.createElement("div", { className: "flex justify-between items-center mb-4" }, /* @__PURE__ */ import_react34.default.createElement("span", { className: "whitespace-nowrap" }, children))
|
|
1918
|
-
);
|
|
3246
|
+
return /* @__PURE__ */ import_react46.default.createElement("div", { className: cn("z-20", dense ? "mb-3" : "mb-4") }, /* @__PURE__ */ import_react46.default.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ import_react46.default.createElement("span", { className: "whitespace-nowrap" }, children)));
|
|
1919
3247
|
};
|
|
1920
3248
|
var SidebarMenu = ({
|
|
1921
3249
|
collapsed,
|
|
1922
3250
|
navItems,
|
|
1923
|
-
scroll = false
|
|
3251
|
+
scroll = false,
|
|
3252
|
+
dense = false
|
|
1924
3253
|
}) => {
|
|
3254
|
+
const [openMenus, setOpenMenus] = (0, import_react46.useState)({});
|
|
1925
3255
|
const currentPath = (0, import_navigation.usePathname)();
|
|
1926
|
-
|
|
1927
|
-
|
|
3256
|
+
const toggleMenu = (label) => {
|
|
3257
|
+
setOpenMenus((prev) => ({ ...prev, [label]: !prev[label] }));
|
|
3258
|
+
};
|
|
3259
|
+
import_react46.default.useEffect(() => {
|
|
3260
|
+
if (!collapsed) {
|
|
3261
|
+
setOpenMenus({});
|
|
3262
|
+
}
|
|
3263
|
+
}, [collapsed]);
|
|
3264
|
+
const getMenuHeight = () => {
|
|
3265
|
+
const footerItemsLength = (navItems == null ? void 0 : navItems.reduce((acc, item) => acc + item.items.length, 0)) || 0;
|
|
3266
|
+
if (footerItemsLength <= 1) {
|
|
3267
|
+
return "max-h-[80vh]";
|
|
3268
|
+
} else if (footerItemsLength === 2) {
|
|
3269
|
+
return "max-h-[70vh]";
|
|
3270
|
+
} else {
|
|
3271
|
+
return "max-h-[60vh]";
|
|
3272
|
+
}
|
|
3273
|
+
};
|
|
3274
|
+
const renderMenuItems = (items, level = 0) => {
|
|
3275
|
+
return /* @__PURE__ */ import_react46.default.createElement("ul", { className: level > 0 ? "ml-5 border-l border-gray-200" : "" }, items == null ? void 0 : items.map((item, index) => {
|
|
3276
|
+
const hasSubItems = item.subItems && item.subItems.length > 0;
|
|
3277
|
+
const isActive = item.href === currentPath;
|
|
3278
|
+
const isOpen = openMenus[item.label];
|
|
3279
|
+
const paddingLeft = level === 0 ? dense ? "10px" : "12px" : `${level * 5 + (dense ? 10 : 12)}px`;
|
|
3280
|
+
return /* @__PURE__ */ import_react46.default.createElement("li", { key: index }, hasSubItems ? /* @__PURE__ */ import_react46.default.createElement(
|
|
3281
|
+
import_link2.default,
|
|
3282
|
+
{
|
|
3283
|
+
href: item.href || "#",
|
|
3284
|
+
className: cn(
|
|
3285
|
+
"flex items-center justify-between rounded-md cursor-pointer transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden",
|
|
3286
|
+
dense ? "px-3 py-1.5 mb-1" : "px-3 py-2 mb-[6px]",
|
|
3287
|
+
isActive ? "bg-primary-600 text-white" : "text-gray-700",
|
|
3288
|
+
isOpen ? "bg-gray-100" : "",
|
|
3289
|
+
"hover:bg-gray-100",
|
|
3290
|
+
level > 0 ? "text-sm font-medium" : ""
|
|
3291
|
+
),
|
|
3292
|
+
style: { paddingLeft },
|
|
3293
|
+
onClick: (e) => {
|
|
3294
|
+
if (collapsed) {
|
|
3295
|
+
toggleMenu(item.label);
|
|
3296
|
+
}
|
|
3297
|
+
if (!item.href)
|
|
3298
|
+
e.preventDefault();
|
|
3299
|
+
}
|
|
3300
|
+
},
|
|
3301
|
+
/* @__PURE__ */ import_react46.default.createElement("div", { className: "flex items-center gap-2" }, item.icon && level === 0 && /* @__PURE__ */ import_react46.default.createElement("span", { className: dense ? "text-xs" : "text-text-sm" }, item.icon), /* @__PURE__ */ import_react46.default.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)),
|
|
3302
|
+
collapsed && hasSubItems && /* @__PURE__ */ import_react46.default.createElement("span", null, isOpen ? /* @__PURE__ */ import_react46.default.createElement(
|
|
3303
|
+
import_react47.RiArrowDownSLine,
|
|
3304
|
+
{
|
|
3305
|
+
size: dense ? 16 : 18,
|
|
3306
|
+
color: "#475467"
|
|
3307
|
+
}
|
|
3308
|
+
) : /* @__PURE__ */ import_react46.default.createElement(
|
|
3309
|
+
import_react47.RiArrowRightSLine,
|
|
3310
|
+
{
|
|
3311
|
+
size: dense ? 16 : 18,
|
|
3312
|
+
color: "#475467"
|
|
3313
|
+
}
|
|
3314
|
+
))
|
|
3315
|
+
) : /* @__PURE__ */ import_react46.default.createElement(
|
|
3316
|
+
import_link2.default,
|
|
3317
|
+
{
|
|
3318
|
+
href: item.href || "#",
|
|
3319
|
+
className: cn(
|
|
3320
|
+
"flex items-center gap-2 rounded-md cursor-pointer transition-colors duration-300 whitespace-nowrap overflow-hidden",
|
|
3321
|
+
"hover:bg-gray-100",
|
|
3322
|
+
dense ? "px-3 py-1 mb-1" : "px-3 py-2 mb-[6px]",
|
|
3323
|
+
isActive ? "bg-primary-600 hover:bg-primary-700 text-white" : "text-gray-700",
|
|
3324
|
+
level > 0 ? "text-sm font-medium" : "font-semibold"
|
|
3325
|
+
)
|
|
3326
|
+
},
|
|
3327
|
+
item.icon && level === 0 && /* @__PURE__ */ import_react46.default.createElement("span", { className: dense ? "text-xs" : "text-text-sm" }, item.icon),
|
|
3328
|
+
/* @__PURE__ */ import_react46.default.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
|
|
3329
|
+
), hasSubItems && isOpen && /* @__PURE__ */ import_react46.default.createElement("div", { className: dense ? "mt-0.5" : "mt-1" }, renderMenuItems(item.subItems, level + 1)));
|
|
3330
|
+
}));
|
|
3331
|
+
};
|
|
3332
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
3333
|
+
"nav",
|
|
1928
3334
|
{
|
|
1929
|
-
|
|
1930
|
-
|
|
3335
|
+
className: cn(
|
|
3336
|
+
getMenuHeight(),
|
|
3337
|
+
"",
|
|
3338
|
+
scroll && collapsed ? "overflow-y-auto customScroll" : "overflow-hidden"
|
|
3339
|
+
)
|
|
1931
3340
|
},
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
"
|
|
3341
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3342
|
+
"ul",
|
|
1934
3343
|
{
|
|
1935
|
-
className: cn(
|
|
1936
|
-
"
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
},
|
|
1940
|
-
parentItem.label
|
|
1941
|
-
),
|
|
1942
|
-
/* @__PURE__ */ import_react34.default.createElement("ul", null, parentItem == null ? void 0 : parentItem.items.map((item, index) => /* @__PURE__ */ import_react34.default.createElement("li", { key: index }, /* @__PURE__ */ import_react34.default.createElement(
|
|
1943
|
-
import_link2.default,
|
|
1944
|
-
{
|
|
1945
|
-
className: cn({
|
|
1946
|
-
"hover:bg-gray-100 px-3 py-2 flex items-center mb-[6px] cursor-pointer rounded-md transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden": true,
|
|
1947
|
-
"text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
|
|
1948
|
-
"text-gray-700": currentPath !== (item == null ? void 0 : item.href),
|
|
1949
|
-
"hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
|
|
1950
|
-
}),
|
|
1951
|
-
href: item.href,
|
|
1952
|
-
passHref: true
|
|
3344
|
+
className: cn(
|
|
3345
|
+
"flex flex-col gap-2 items-stretch",
|
|
3346
|
+
dense ? "my-1.5" : "my-2"
|
|
3347
|
+
)
|
|
1953
3348
|
},
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
"
|
|
3349
|
+
navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => /* @__PURE__ */ import_react46.default.createElement(
|
|
3350
|
+
"li",
|
|
1956
3351
|
{
|
|
1957
|
-
|
|
3352
|
+
key: parentIndex,
|
|
3353
|
+
className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
|
|
1958
3354
|
},
|
|
1959
|
-
/* @__PURE__ */
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
3355
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3356
|
+
"p",
|
|
3357
|
+
{
|
|
3358
|
+
className: cn(
|
|
3359
|
+
"text-gray-500 font-medium",
|
|
3360
|
+
dense ? "text-[12px]" : "text-[14px]",
|
|
3361
|
+
!collapsed ? "opacity-0" : ""
|
|
3362
|
+
)
|
|
3363
|
+
},
|
|
3364
|
+
parentItem.label
|
|
3365
|
+
),
|
|
3366
|
+
renderMenuItems(parentItem.items)
|
|
3367
|
+
))
|
|
3368
|
+
)
|
|
3369
|
+
);
|
|
1964
3370
|
};
|
|
1965
|
-
var
|
|
3371
|
+
var SidebarFooter = ({
|
|
1966
3372
|
children,
|
|
1967
3373
|
setCollapsed,
|
|
1968
3374
|
collapsed,
|
|
1969
|
-
navItems
|
|
3375
|
+
navItems,
|
|
3376
|
+
dense = false
|
|
1970
3377
|
}) => {
|
|
1971
3378
|
const currentPath = (0, import_navigation.usePathname)();
|
|
1972
|
-
return /* @__PURE__ */
|
|
3379
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
1973
3380
|
"div",
|
|
1974
3381
|
{
|
|
1975
3382
|
className: cn({
|
|
1976
|
-
"absolute bottom-0
|
|
1977
|
-
"w-[
|
|
3383
|
+
"absolute bottom-0 overflow-auto bg-white z-10": true,
|
|
3384
|
+
"max-h-[226px] py-2.5 w-[85%]": dense,
|
|
3385
|
+
"max-h-[230px] py-3 w-[85%]": !dense,
|
|
3386
|
+
"w-[53%]": !collapsed && dense,
|
|
3387
|
+
"w-[55%]": !collapsed && !dense
|
|
1978
3388
|
}),
|
|
1979
3389
|
onClick: () => setCollapsed(true)
|
|
1980
3390
|
},
|
|
1981
|
-
collapsed && /* @__PURE__ */
|
|
1982
|
-
navItems && navItems.length > 0 && /* @__PURE__ */
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
"text-[14px] text-gray-500": true,
|
|
1995
|
-
"w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed
|
|
1996
|
-
})
|
|
1997
|
-
},
|
|
1998
|
-
parentItem.label
|
|
1999
|
-
),
|
|
2000
|
-
/* @__PURE__ */ import_react34.default.createElement("ul", null, (_a = parentItem == null ? void 0 : parentItem.items) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ import_react34.default.createElement("li", { key: index }, /* @__PURE__ */ import_react34.default.createElement(
|
|
2001
|
-
import_link2.default,
|
|
3391
|
+
collapsed && /* @__PURE__ */ import_react46.default.createElement("div", { className: "shadow-md" }, /* @__PURE__ */ import_react46.default.createElement(Divider_default, null)),
|
|
3392
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ import_react46.default.createElement("nav", { className: "flex-grow w-full" }, /* @__PURE__ */ import_react46.default.createElement(
|
|
3393
|
+
"ul",
|
|
3394
|
+
{
|
|
3395
|
+
className: cn(
|
|
3396
|
+
"flex flex-col gap-2 items-stretch",
|
|
3397
|
+
dense ? "my-1.5" : "my-2"
|
|
3398
|
+
)
|
|
3399
|
+
},
|
|
3400
|
+
navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => {
|
|
3401
|
+
var _a;
|
|
3402
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
3403
|
+
"li",
|
|
2002
3404
|
{
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
"text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
|
|
2006
|
-
"text-gray-700": currentPath !== (item == null ? void 0 : item.href),
|
|
2007
|
-
"hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
|
|
2008
|
-
}),
|
|
2009
|
-
href: item.href,
|
|
2010
|
-
passHref: true
|
|
3405
|
+
key: parentIndex,
|
|
3406
|
+
className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
|
|
2011
3407
|
},
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
-
"
|
|
3408
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3409
|
+
"p",
|
|
2014
3410
|
{
|
|
2015
|
-
className:
|
|
3411
|
+
className: cn({
|
|
3412
|
+
"text-gray-500": true,
|
|
3413
|
+
"text-[12px]": dense,
|
|
3414
|
+
"text-[14px]": !dense,
|
|
3415
|
+
"w-[35px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed && dense,
|
|
3416
|
+
"w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed && !dense
|
|
3417
|
+
})
|
|
2016
3418
|
},
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
)
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
3419
|
+
parentItem.label
|
|
3420
|
+
),
|
|
3421
|
+
/* @__PURE__ */ import_react46.default.createElement("ul", null, (_a = parentItem == null ? void 0 : parentItem.items) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ import_react46.default.createElement("li", { key: index }, /* @__PURE__ */ import_react46.default.createElement(
|
|
3422
|
+
import_link2.default,
|
|
3423
|
+
{
|
|
3424
|
+
className: cn({
|
|
3425
|
+
"hover:bg-gray-100 flex items-center cursor-pointer rounded-md transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden": true,
|
|
3426
|
+
"px-2 py-1.5 mb-1": dense,
|
|
3427
|
+
"px-3 py-2 mb-[6px]": !dense,
|
|
3428
|
+
"text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
|
|
3429
|
+
"text-gray-700": currentPath !== (item == null ? void 0 : item.href),
|
|
3430
|
+
"hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
|
|
3431
|
+
}),
|
|
3432
|
+
href: (item == null ? void 0 : item.href) || "#",
|
|
3433
|
+
passHref: true
|
|
3434
|
+
},
|
|
3435
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3436
|
+
"div",
|
|
3437
|
+
{
|
|
3438
|
+
className: `flex items-center gap-2 whitespace-nowrap`
|
|
3439
|
+
},
|
|
3440
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3441
|
+
"span",
|
|
3442
|
+
{
|
|
3443
|
+
className: dense ? "text-xs" : "text-text-sm"
|
|
3444
|
+
},
|
|
3445
|
+
" ",
|
|
3446
|
+
item.icon
|
|
3447
|
+
),
|
|
3448
|
+
/* @__PURE__ */ import_react46.default.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
|
|
3449
|
+
)
|
|
3450
|
+
))))
|
|
3451
|
+
);
|
|
3452
|
+
})
|
|
3453
|
+
)),
|
|
2023
3454
|
children
|
|
2024
3455
|
);
|
|
2025
3456
|
};
|
|
2026
3457
|
Sidebar.Header = SidebarHeader;
|
|
2027
3458
|
Sidebar.Menu = SidebarMenu;
|
|
2028
|
-
Sidebar.Footer =
|
|
3459
|
+
Sidebar.Footer = SidebarFooter;
|
|
2029
3460
|
var Sidebar_default = Sidebar;
|
|
2030
3461
|
|
|
3462
|
+
// app/components/Skeleton.tsx
|
|
3463
|
+
var import_react48 = __toESM(require("react"), 1);
|
|
3464
|
+
var Skeleton = ({
|
|
3465
|
+
width = "100%",
|
|
3466
|
+
height = "100%",
|
|
3467
|
+
circle = false,
|
|
3468
|
+
animation = "shimmer"
|
|
3469
|
+
}) => {
|
|
3470
|
+
const style = {
|
|
3471
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
3472
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
3473
|
+
borderRadius: circle ? "50%" : void 0,
|
|
3474
|
+
display: "block"
|
|
3475
|
+
};
|
|
3476
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
3477
|
+
"span",
|
|
3478
|
+
{
|
|
3479
|
+
className: cn(
|
|
3480
|
+
"skeleton rounded-lg",
|
|
3481
|
+
circle ? "circle" : "",
|
|
3482
|
+
animation === "shimmer" && "skeleton-shimmer",
|
|
3483
|
+
animation === "wave" && "skeleton-wave",
|
|
3484
|
+
animation === "pulse" && "skeleton-pulse"
|
|
3485
|
+
),
|
|
3486
|
+
style
|
|
3487
|
+
}
|
|
3488
|
+
);
|
|
3489
|
+
};
|
|
3490
|
+
var Skeleton_default = Skeleton;
|
|
3491
|
+
|
|
2031
3492
|
// app/components/Slider.tsx
|
|
2032
|
-
var
|
|
2033
|
-
var Slider = (0,
|
|
3493
|
+
var import_react49 = __toESM(require("react"), 1);
|
|
3494
|
+
var Slider = (0, import_react49.forwardRef)(
|
|
2034
3495
|
({ value, min = 0, max = 100, size = "sm", ...props }, ref) => {
|
|
2035
3496
|
const progress = (value - min) / (max - min) * 100;
|
|
2036
|
-
return /* @__PURE__ */
|
|
3497
|
+
return /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(
|
|
2037
3498
|
"input",
|
|
2038
3499
|
{
|
|
2039
3500
|
ref,
|
|
@@ -2053,28 +3514,30 @@ var Slider = (0, import_react35.forwardRef)(
|
|
|
2053
3514
|
));
|
|
2054
3515
|
}
|
|
2055
3516
|
);
|
|
2056
|
-
Slider.displayName = "Slider";
|
|
2057
|
-
var Slider_default = Slider;
|
|
2058
|
-
|
|
2059
|
-
// app/components/
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
}
|
|
2073
|
-
|
|
3517
|
+
Slider.displayName = "Slider";
|
|
3518
|
+
var Slider_default = Slider;
|
|
3519
|
+
|
|
3520
|
+
// app/components/SplitButton.tsx
|
|
3521
|
+
var import_react50 = __toESM(require("react"), 1);
|
|
3522
|
+
var SplitButton = (0, import_react50.forwardRef)(
|
|
3523
|
+
({ children, className = "", size = "md", appearance = "primary", compact = false, ...props }, ref) => {
|
|
3524
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
3525
|
+
"div",
|
|
3526
|
+
{
|
|
3527
|
+
ref,
|
|
3528
|
+
className: `inline-flex ${compact ? "gap-0" : ""} ${className}`,
|
|
3529
|
+
...props
|
|
3530
|
+
},
|
|
3531
|
+
children
|
|
3532
|
+
);
|
|
3533
|
+
}
|
|
3534
|
+
);
|
|
3535
|
+
SplitButton.displayName = "SplitButton";
|
|
3536
|
+
var SplitButton_default = SplitButton;
|
|
2074
3537
|
|
|
2075
3538
|
// app/components/Stepper.tsx
|
|
2076
|
-
var
|
|
2077
|
-
var
|
|
3539
|
+
var import_react51 = __toESM(require("react"), 1);
|
|
3540
|
+
var import_react52 = require("@remixicon/react");
|
|
2078
3541
|
var Stepper = ({
|
|
2079
3542
|
stepsConfig,
|
|
2080
3543
|
currentStep,
|
|
@@ -2083,82 +3546,126 @@ var Stepper = ({
|
|
|
2083
3546
|
setIsComplete,
|
|
2084
3547
|
position = "horizontal"
|
|
2085
3548
|
}) => {
|
|
2086
|
-
var _a;
|
|
2087
|
-
const stepRef = (0,
|
|
3549
|
+
var _a, _b;
|
|
3550
|
+
const stepRef = (0, import_react51.useRef)([]);
|
|
2088
3551
|
if (!stepsConfig.length) {
|
|
2089
3552
|
return null;
|
|
2090
3553
|
}
|
|
2091
3554
|
const ActiveComponent = (_a = stepsConfig[currentStep - 1]) == null ? void 0 : _a.Component;
|
|
2092
|
-
return /* @__PURE__ */
|
|
3555
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
2093
3556
|
"div",
|
|
2094
3557
|
{
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
)
|
|
3558
|
+
role: "region",
|
|
3559
|
+
"aria-label": "Step Progress",
|
|
3560
|
+
className: cn(position !== "horizontal" && "flex")
|
|
2099
3561
|
},
|
|
2100
|
-
|
|
3562
|
+
/* @__PURE__ */ import_react51.default.createElement(
|
|
2101
3563
|
"div",
|
|
2102
3564
|
{
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
3565
|
+
className: cn(
|
|
3566
|
+
"relative",
|
|
3567
|
+
position === "horizontal" ? "flex justify-center items-start" : "flex flex-col"
|
|
3568
|
+
),
|
|
3569
|
+
role: "list",
|
|
3570
|
+
"aria-label": `Progress: ${currentStep} of ${stepsConfig.length} steps`
|
|
2106
3571
|
},
|
|
2107
|
-
/* @__PURE__ */
|
|
3572
|
+
stepsConfig == null ? void 0 : stepsConfig.map((step, index) => /* @__PURE__ */ import_react51.default.createElement(
|
|
2108
3573
|
"div",
|
|
2109
3574
|
{
|
|
3575
|
+
key: index,
|
|
3576
|
+
ref: (el) => stepRef.current[index] = el,
|
|
2110
3577
|
className: cn(
|
|
2111
|
-
"",
|
|
2112
|
-
|
|
2113
|
-
|
|
3578
|
+
position === "horizontal" ? "flex gap-4 flex-col" : "flex gap-6 justify-start",
|
|
3579
|
+
index === stepsConfig.length - 1 ? "w-auto" : "w-full",
|
|
3580
|
+
currentStep > index + 1 || isComplete ? "complete" : "",
|
|
3581
|
+
currentStep === index + 1 ? "" : ""
|
|
3582
|
+
),
|
|
3583
|
+
role: "listitem",
|
|
3584
|
+
"aria-current": currentStep === index + 1 ? "step" : void 0,
|
|
3585
|
+
"aria-label": `${step.name}${step.helperName ? `, ${step.helperName}` : ""}, ${currentStep > index + 1 || isComplete ? "completed" : currentStep === index + 1 ? "current step" : "pending"}`
|
|
2114
3586
|
},
|
|
2115
|
-
/* @__PURE__ */
|
|
3587
|
+
/* @__PURE__ */ import_react51.default.createElement(
|
|
2116
3588
|
"div",
|
|
2117
3589
|
{
|
|
2118
|
-
className:
|
|
3590
|
+
className: cn(
|
|
3591
|
+
"",
|
|
3592
|
+
position === "horizontal" ? "flex items-center" : "flex flex-col"
|
|
3593
|
+
)
|
|
2119
3594
|
},
|
|
2120
|
-
|
|
2121
|
-
|
|
3595
|
+
/* @__PURE__ */ import_react51.default.createElement(
|
|
3596
|
+
"div",
|
|
3597
|
+
{
|
|
3598
|
+
className: `w-[20px] h-[20px] rounded-full bg-gray-100 flex justify-center items-center ${currentStep === index + 1 ? "border border-primary-600" : "border border-gray-200"} ${currentStep > index + 1 || isComplete ? "bg-primary-600 border-none" : ""}`,
|
|
3599
|
+
role: "status",
|
|
3600
|
+
"aria-label": `Step ${index + 1} ${currentStep > index + 1 || isComplete ? "completed" : currentStep === index + 1 ? "current" : "pending"}`
|
|
3601
|
+
},
|
|
3602
|
+
currentStep === index + 1 && !isComplete && /* @__PURE__ */ import_react51.default.createElement(
|
|
3603
|
+
"span",
|
|
3604
|
+
{
|
|
3605
|
+
"aria-hidden": "true",
|
|
3606
|
+
className: "w-[10px] h-[10px] rounded-full bg-primary-600"
|
|
3607
|
+
}
|
|
3608
|
+
),
|
|
3609
|
+
(currentStep > index + 1 || isComplete) && /* @__PURE__ */ import_react51.default.createElement("span", { "aria-hidden": "true" }, /* @__PURE__ */ import_react51.default.createElement(import_react52.RiCheckLine, { size: 12, color: "#fff" }))
|
|
3610
|
+
),
|
|
3611
|
+
index !== stepsConfig.length - 1 && /* @__PURE__ */ import_react51.default.createElement(
|
|
3612
|
+
"div",
|
|
3613
|
+
{
|
|
3614
|
+
className: cn(
|
|
3615
|
+
"mx-auto rounded-lg bg-gray-200",
|
|
3616
|
+
position === "horizontal" ? "w-[80%] h-1" : "h-[100px] w-1 my-2"
|
|
3617
|
+
),
|
|
3618
|
+
"aria-hidden": "true"
|
|
3619
|
+
},
|
|
3620
|
+
/* @__PURE__ */ import_react51.default.createElement(
|
|
3621
|
+
"p",
|
|
3622
|
+
{
|
|
3623
|
+
className: cn(
|
|
3624
|
+
"h-full rounded-lg",
|
|
3625
|
+
currentStep > index + 1 ? "bg-primary-600" : ""
|
|
3626
|
+
)
|
|
3627
|
+
}
|
|
3628
|
+
)
|
|
3629
|
+
)
|
|
2122
3630
|
),
|
|
2123
|
-
|
|
3631
|
+
/* @__PURE__ */ import_react51.default.createElement(
|
|
2124
3632
|
"div",
|
|
2125
3633
|
{
|
|
3634
|
+
"aria-hidden": currentStep !== index + 1,
|
|
2126
3635
|
className: cn(
|
|
2127
|
-
"
|
|
2128
|
-
position === "
|
|
3636
|
+
"whitespace-nowrap",
|
|
3637
|
+
position === "vertical" || (step == null ? void 0 : step.helperName) ? "-mt-1" : ""
|
|
2129
3638
|
)
|
|
2130
3639
|
},
|
|
2131
|
-
/* @__PURE__ */
|
|
2132
|
-
"
|
|
3640
|
+
/* @__PURE__ */ import_react51.default.createElement(
|
|
3641
|
+
"span",
|
|
2133
3642
|
{
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
)
|
|
3643
|
+
"aria-label": "Helper text",
|
|
3644
|
+
className: "text-gray-400 text-text-xs"
|
|
3645
|
+
},
|
|
3646
|
+
step == null ? void 0 : step.helperName
|
|
3647
|
+
),
|
|
3648
|
+
/* @__PURE__ */ import_react51.default.createElement("p", null, step == null ? void 0 : step.name)
|
|
2140
3649
|
)
|
|
2141
|
-
)
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
))
|
|
2154
|
-
), ActiveComponent && /* @__PURE__ */ import_react37.default.createElement(ActiveComponent, null));
|
|
3650
|
+
))
|
|
3651
|
+
),
|
|
3652
|
+
ActiveComponent && /* @__PURE__ */ import_react51.default.createElement(
|
|
3653
|
+
"div",
|
|
3654
|
+
{
|
|
3655
|
+
role: "tabpanel",
|
|
3656
|
+
"aria-label": `Current step: ${(_b = stepsConfig[currentStep - 1]) == null ? void 0 : _b.name}`,
|
|
3657
|
+
tabIndex: 0
|
|
3658
|
+
},
|
|
3659
|
+
/* @__PURE__ */ import_react51.default.createElement(ActiveComponent, null)
|
|
3660
|
+
)
|
|
3661
|
+
);
|
|
2155
3662
|
};
|
|
2156
3663
|
var Stepper_default = Stepper;
|
|
2157
3664
|
|
|
2158
3665
|
// app/components/TableComponents.tsx
|
|
2159
|
-
var
|
|
3666
|
+
var import_react53 = __toESM(require("react"), 1);
|
|
2160
3667
|
var Table = ({ children, className, dense, ...props }) => {
|
|
2161
|
-
return /* @__PURE__ */
|
|
3668
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
2162
3669
|
"table",
|
|
2163
3670
|
{
|
|
2164
3671
|
...props,
|
|
@@ -2176,7 +3683,7 @@ var TableHead = ({
|
|
|
2176
3683
|
className,
|
|
2177
3684
|
...props
|
|
2178
3685
|
}) => {
|
|
2179
|
-
return /* @__PURE__ */
|
|
3686
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
2180
3687
|
"thead",
|
|
2181
3688
|
{
|
|
2182
3689
|
...props,
|
|
@@ -2190,7 +3697,7 @@ var TableBody = ({
|
|
|
2190
3697
|
className,
|
|
2191
3698
|
...props
|
|
2192
3699
|
}) => {
|
|
2193
|
-
return /* @__PURE__ */
|
|
3700
|
+
return /* @__PURE__ */ import_react53.default.createElement("tbody", { ...props, className: cn(className) }, children);
|
|
2194
3701
|
};
|
|
2195
3702
|
var TableRow = ({
|
|
2196
3703
|
children,
|
|
@@ -2198,7 +3705,7 @@ var TableRow = ({
|
|
|
2198
3705
|
indent,
|
|
2199
3706
|
...props
|
|
2200
3707
|
}) => {
|
|
2201
|
-
return /* @__PURE__ */
|
|
3708
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
2202
3709
|
"tr",
|
|
2203
3710
|
{
|
|
2204
3711
|
...props,
|
|
@@ -2218,9 +3725,11 @@ var TableHeadCell = ({
|
|
|
2218
3725
|
sticky,
|
|
2219
3726
|
shadow,
|
|
2220
3727
|
left,
|
|
3728
|
+
shadowRight,
|
|
3729
|
+
right,
|
|
2221
3730
|
...props
|
|
2222
3731
|
}) => {
|
|
2223
|
-
return /* @__PURE__ */
|
|
3732
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
2224
3733
|
"th",
|
|
2225
3734
|
{
|
|
2226
3735
|
...props,
|
|
@@ -2228,14 +3737,17 @@ var TableHeadCell = ({
|
|
|
2228
3737
|
"px-6 py-3 text-left group-has-[th]/dense:py-2",
|
|
2229
3738
|
sticky && `sticky bg-gray-50`,
|
|
2230
3739
|
sticky && shadow && "shadow-table",
|
|
3740
|
+
sticky && shadowRight && "shadow-tableRight",
|
|
2231
3741
|
left,
|
|
3742
|
+
right,
|
|
2232
3743
|
className
|
|
2233
3744
|
),
|
|
2234
3745
|
style: {
|
|
2235
|
-
left
|
|
3746
|
+
left,
|
|
3747
|
+
right
|
|
2236
3748
|
}
|
|
2237
3749
|
},
|
|
2238
|
-
/* @__PURE__ */
|
|
3750
|
+
/* @__PURE__ */ import_react53.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react53.default.createElement("span", { className: "font-medium text-xs" }, children), icon && /* @__PURE__ */ import_react53.default.createElement(
|
|
2239
3751
|
"span",
|
|
2240
3752
|
{
|
|
2241
3753
|
className: "hover:bg-gray-200 w-5 h-5 flex items-center justify-center p-1 rounded focus:bg-gray-300 active:bg-gray-300"
|
|
@@ -2250,10 +3762,12 @@ var TableDataCell = ({
|
|
|
2250
3762
|
icon,
|
|
2251
3763
|
sticky,
|
|
2252
3764
|
shadow,
|
|
3765
|
+
shadowRight,
|
|
2253
3766
|
left,
|
|
3767
|
+
right,
|
|
2254
3768
|
...props
|
|
2255
3769
|
}) => {
|
|
2256
|
-
return /* @__PURE__ */
|
|
3770
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
2257
3771
|
"td",
|
|
2258
3772
|
{
|
|
2259
3773
|
...props,
|
|
@@ -2261,15 +3775,18 @@ var TableDataCell = ({
|
|
|
2261
3775
|
"px-6 py-4 text-sm font-medium group-has-[td]/dense:py-2 first:group-has-[td]/indent:pl-[60px]",
|
|
2262
3776
|
sticky && `sticky bg-white`,
|
|
2263
3777
|
sticky && shadow && "shadow-table",
|
|
3778
|
+
sticky && shadowRight && "shadow-tableRight",
|
|
2264
3779
|
left,
|
|
3780
|
+
right,
|
|
2265
3781
|
className
|
|
2266
3782
|
),
|
|
2267
3783
|
style: {
|
|
2268
|
-
left
|
|
3784
|
+
left,
|
|
3785
|
+
right
|
|
2269
3786
|
}
|
|
2270
3787
|
},
|
|
2271
|
-
/* @__PURE__ */
|
|
2272
|
-
icon && /* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ import_react53.default.createElement("span", { className: "font-medium text-sm" }, children),
|
|
3789
|
+
icon && /* @__PURE__ */ import_react53.default.createElement(
|
|
2273
3790
|
"span",
|
|
2274
3791
|
{
|
|
2275
3792
|
className: "hover:bg-gray-200 w-5 h-5 flex items-center justify-center p-1 rounded focus:bg-gray-300 active:bg-gray-300"
|
|
@@ -2281,94 +3798,215 @@ var TableDataCell = ({
|
|
|
2281
3798
|
var TableComponents_default = Table;
|
|
2282
3799
|
|
|
2283
3800
|
// app/components/Tabs.tsx
|
|
2284
|
-
var
|
|
3801
|
+
var import_react54 = __toESM(require("react"), 1);
|
|
2285
3802
|
var TabsContainer = ({
|
|
2286
3803
|
children,
|
|
2287
|
-
className
|
|
3804
|
+
className,
|
|
3805
|
+
position = "horizontal"
|
|
2288
3806
|
}) => {
|
|
2289
|
-
return /* @__PURE__ */
|
|
3807
|
+
return /* @__PURE__ */ import_react54.default.createElement("div", { className: cn(position === "vertical" ? "flex" : "block", className) }, children);
|
|
2290
3808
|
};
|
|
2291
3809
|
var TabList = ({
|
|
2292
3810
|
onChange,
|
|
2293
3811
|
ariaLabel,
|
|
2294
3812
|
children,
|
|
2295
3813
|
box = false,
|
|
2296
|
-
|
|
3814
|
+
pill = false,
|
|
3815
|
+
className,
|
|
3816
|
+
position = "horizontal"
|
|
2297
3817
|
}) => {
|
|
2298
|
-
const
|
|
2299
|
-
|
|
3818
|
+
const [focusIndex, setFocusIndex] = import_react54.default.useState(0);
|
|
3819
|
+
const tabRefs = import_react54.default.useRef([]);
|
|
3820
|
+
const handleKeyDown = (e, index) => {
|
|
3821
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3822
|
+
const tabCount = import_react54.default.Children.count(children);
|
|
3823
|
+
switch (e.key) {
|
|
3824
|
+
case "ArrowRight":
|
|
3825
|
+
if (position === "horizontal") {
|
|
3826
|
+
e.preventDefault();
|
|
3827
|
+
const nextIndex = (index + 1) % tabCount;
|
|
3828
|
+
setFocusIndex(nextIndex);
|
|
3829
|
+
(_a = tabRefs.current[nextIndex]) == null ? void 0 : _a.focus();
|
|
3830
|
+
}
|
|
3831
|
+
break;
|
|
3832
|
+
case "ArrowLeft":
|
|
3833
|
+
if (position === "horizontal") {
|
|
3834
|
+
e.preventDefault();
|
|
3835
|
+
const prevIndex = (index - 1 + tabCount) % tabCount;
|
|
3836
|
+
setFocusIndex(prevIndex);
|
|
3837
|
+
(_b = tabRefs.current[prevIndex]) == null ? void 0 : _b.focus();
|
|
3838
|
+
}
|
|
3839
|
+
break;
|
|
3840
|
+
case "ArrowDown":
|
|
3841
|
+
if (position === "vertical") {
|
|
3842
|
+
e.preventDefault();
|
|
3843
|
+
const nextIndex = (index + 1) % tabCount;
|
|
3844
|
+
setFocusIndex(nextIndex);
|
|
3845
|
+
(_c = tabRefs.current[nextIndex]) == null ? void 0 : _c.focus();
|
|
3846
|
+
}
|
|
3847
|
+
break;
|
|
3848
|
+
case "ArrowUp":
|
|
3849
|
+
if (position === "vertical") {
|
|
3850
|
+
e.preventDefault();
|
|
3851
|
+
const prevIndex = (index - 1 + tabCount) % tabCount;
|
|
3852
|
+
setFocusIndex(prevIndex);
|
|
3853
|
+
(_d = tabRefs.current[prevIndex]) == null ? void 0 : _d.focus();
|
|
3854
|
+
}
|
|
3855
|
+
break;
|
|
3856
|
+
case "Home":
|
|
3857
|
+
e.preventDefault();
|
|
3858
|
+
setFocusIndex(0);
|
|
3859
|
+
(_e = tabRefs.current[0]) == null ? void 0 : _e.focus();
|
|
3860
|
+
break;
|
|
3861
|
+
case "End":
|
|
3862
|
+
e.preventDefault();
|
|
3863
|
+
const lastIndex = tabCount - 1;
|
|
3864
|
+
setFocusIndex(lastIndex);
|
|
3865
|
+
(_f = tabRefs.current[lastIndex]) == null ? void 0 : _f.focus();
|
|
3866
|
+
break;
|
|
3867
|
+
}
|
|
2300
3868
|
};
|
|
2301
|
-
return /* @__PURE__ */
|
|
3869
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
2302
3870
|
"div",
|
|
2303
3871
|
{
|
|
2304
3872
|
className: cn(
|
|
2305
|
-
"flex items-center",
|
|
2306
|
-
box ? "bg-gray-50 rounded-lg border border-gray-200" : "border-b border-gray-200",
|
|
3873
|
+
position === "horizontal" ? "flex items-center" : "flex flex-col items-stretch",
|
|
3874
|
+
box ? "bg-gray-50 rounded-lg border border-gray-200" : pill ? position === "horizontal" ? "bg-transparent rounded-lg" : "bg-gray-100 rounded-full p-1" : position === "horizontal" ? "border-b border-gray-200" : "border-r border-gray-200",
|
|
2307
3875
|
className
|
|
2308
3876
|
),
|
|
2309
3877
|
role: "tablist",
|
|
2310
|
-
"aria-label": ariaLabel
|
|
3878
|
+
"aria-label": ariaLabel,
|
|
3879
|
+
"aria-orientation": position
|
|
2311
3880
|
},
|
|
2312
|
-
|
|
2313
|
-
if (
|
|
2314
|
-
|
|
2315
|
-
onChange
|
|
2316
|
-
box
|
|
3881
|
+
import_react54.default.Children.map(children, (child, index) => {
|
|
3882
|
+
if (import_react54.default.isValidElement(child)) {
|
|
3883
|
+
const childProps = {
|
|
3884
|
+
onChange,
|
|
3885
|
+
box,
|
|
3886
|
+
pill,
|
|
3887
|
+
// Add this line to pass pill prop to Tab
|
|
3888
|
+
position,
|
|
3889
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
3890
|
+
tabIndex: index === focusIndex ? 0 : -1
|
|
3891
|
+
};
|
|
3892
|
+
return import_react54.default.cloneElement(child, {
|
|
3893
|
+
...childProps,
|
|
3894
|
+
ref: (el) => {
|
|
3895
|
+
tabRefs.current[index] = el;
|
|
3896
|
+
const originalRef = child.ref;
|
|
3897
|
+
if (originalRef) {
|
|
3898
|
+
if (typeof originalRef === "function") {
|
|
3899
|
+
originalRef(el);
|
|
3900
|
+
} else {
|
|
3901
|
+
originalRef.current = el;
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
2317
3905
|
});
|
|
2318
3906
|
}
|
|
2319
3907
|
return null;
|
|
2320
3908
|
})
|
|
2321
3909
|
);
|
|
2322
3910
|
};
|
|
2323
|
-
var Tab = (
|
|
2324
|
-
|
|
2325
|
-
value,
|
|
2326
|
-
onChange,
|
|
2327
|
-
icon,
|
|
2328
|
-
content,
|
|
2329
|
-
box = false,
|
|
2330
|
-
selectedTabValue,
|
|
2331
|
-
className
|
|
2332
|
-
}) => {
|
|
2333
|
-
const handleClick = () => {
|
|
2334
|
-
onChange(value);
|
|
2335
|
-
};
|
|
2336
|
-
const isSelected = value === selectedTabValue;
|
|
2337
|
-
return /* @__PURE__ */ import_react40.default.createElement(
|
|
2338
|
-
"button",
|
|
2339
|
-
{
|
|
2340
|
-
role: "tab",
|
|
2341
|
-
className: cn(
|
|
2342
|
-
"flex items-center gap-2 px-4 py-3 text-text-sm font-medium cursor-pointer hover:bg-gray-100 hover:rounded-t transition-all ease-linear duration-200 delay-75",
|
|
2343
|
-
isSelected && !box ? "text-primary-600 border-b-2 border-primary-600" : "border-b-2 border-transparent text-gray-700",
|
|
2344
|
-
isSelected && box ? "bg-white hover:bg-white shadow-md" : "",
|
|
2345
|
-
box ? "m-1 rounded-lg hover:rounded-lg" : "m-0",
|
|
2346
|
-
className
|
|
2347
|
-
),
|
|
2348
|
-
onClick: handleClick
|
|
2349
|
-
},
|
|
2350
|
-
icon,
|
|
2351
|
-
" ",
|
|
3911
|
+
var Tab = import_react54.default.forwardRef(
|
|
3912
|
+
({
|
|
2352
3913
|
label,
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
3914
|
+
value,
|
|
3915
|
+
onChange,
|
|
3916
|
+
icon,
|
|
3917
|
+
content,
|
|
3918
|
+
box = false,
|
|
3919
|
+
pill = false,
|
|
3920
|
+
selectedTabValue,
|
|
3921
|
+
className,
|
|
3922
|
+
onKeyDown,
|
|
3923
|
+
tabIndex,
|
|
3924
|
+
position = "horizontal"
|
|
3925
|
+
}, ref) => {
|
|
3926
|
+
const isSelected = value === selectedTabValue;
|
|
3927
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
3928
|
+
"button",
|
|
3929
|
+
{
|
|
3930
|
+
ref,
|
|
3931
|
+
role: "tab",
|
|
3932
|
+
"aria-selected": isSelected,
|
|
3933
|
+
"aria-controls": `panel-${value}`,
|
|
3934
|
+
id: `tab-${value}`,
|
|
3935
|
+
tabIndex,
|
|
3936
|
+
onKeyDown,
|
|
3937
|
+
className: cn(
|
|
3938
|
+
"flex items-center gap-2 px-4 py-3 text-text-sm font-medium cursor-pointer",
|
|
3939
|
+
// Default variant (no box, no pill)
|
|
3940
|
+
!box && !pill && [
|
|
3941
|
+
isSelected && position === "horizontal" ? "text-primary-600 border-b-2 border-primary-600" : isSelected && position === "vertical" ? "text-primary-600 border-r-2 border-primary-600" : "border-transparent text-gray-700"
|
|
3942
|
+
],
|
|
3943
|
+
// Box variant
|
|
3944
|
+
box && [
|
|
3945
|
+
position === "horizontal" ? "m-1 rounded-lg hover:rounded-lg" : "mx-1 my-0.5 rounded-lg hover:rounded-lg",
|
|
3946
|
+
isSelected ? "bg-white hover:bg-white shadow-md" : ""
|
|
3947
|
+
],
|
|
3948
|
+
// Pill variant - Horizontal
|
|
3949
|
+
pill && position === "horizontal" && [
|
|
3950
|
+
"py-1 px-3 text-sm first:rounded-l-2xl last:rounded-r-2xl border transition-all duration-200",
|
|
3951
|
+
isSelected ? "bg-primary-600 border-primary-600 text-white shadow-sm hover:bg-primary-700" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"
|
|
3952
|
+
],
|
|
3953
|
+
// Pill variant - Vertical
|
|
3954
|
+
pill && position === "vertical" && [
|
|
3955
|
+
"py-2 px-4 rounded-full border transition-all duration-200 my-1",
|
|
3956
|
+
isSelected ? "bg-primary-600 border-primary-600 text-white shadow-sm hover:bg-primary-700" : "bg-gray-100 border-gray-300 text-gray-700 hover:bg-gray-200 hover:border-gray-400"
|
|
3957
|
+
],
|
|
3958
|
+
// Common hover styles for non-pill variants
|
|
3959
|
+
!pill && [
|
|
3960
|
+
position === "horizontal" ? "hover:bg-gray-100 hover:rounded-t transition-all ease-linear duration-200 delay-75" : "hover:bg-gray-100 hover:rounded-l transition-all ease-linear duration-200 delay-75"
|
|
3961
|
+
],
|
|
3962
|
+
// Border for vertical non-box, non-pill
|
|
3963
|
+
position === "vertical" && !box && !pill && !isSelected ? "border-r-2" : "",
|
|
3964
|
+
className
|
|
3965
|
+
),
|
|
3966
|
+
onClick: () => onChange(value)
|
|
3967
|
+
},
|
|
3968
|
+
icon && /* @__PURE__ */ import_react54.default.createElement("span", { "aria-hidden": "true" }, icon),
|
|
3969
|
+
label,
|
|
3970
|
+
content && /* @__PURE__ */ import_react54.default.createElement("span", { "aria-hidden": "true" }, content)
|
|
3971
|
+
);
|
|
3972
|
+
}
|
|
3973
|
+
);
|
|
2357
3974
|
var TabPanel = ({
|
|
2358
3975
|
value,
|
|
2359
3976
|
currentValue,
|
|
2360
3977
|
children,
|
|
2361
3978
|
className
|
|
2362
3979
|
}) => {
|
|
2363
|
-
return value === currentValue ? /* @__PURE__ */
|
|
3980
|
+
return value === currentValue ? /* @__PURE__ */ import_react54.default.createElement(
|
|
3981
|
+
"div",
|
|
3982
|
+
{
|
|
3983
|
+
role: "tabpanel",
|
|
3984
|
+
id: `panel-${value}`,
|
|
3985
|
+
"aria-labelledby": `tab-${value}`,
|
|
3986
|
+
tabIndex: 0,
|
|
3987
|
+
className
|
|
3988
|
+
},
|
|
3989
|
+
children
|
|
3990
|
+
) : null;
|
|
2364
3991
|
};
|
|
2365
3992
|
var Tabs_default = TabsContainer;
|
|
3993
|
+
Tab.displayName = "Tab";
|
|
2366
3994
|
|
|
2367
3995
|
// app/components/Textarea.tsx
|
|
2368
|
-
var
|
|
2369
|
-
var Textarea = (0,
|
|
2370
|
-
({
|
|
2371
|
-
|
|
3996
|
+
var import_react55 = __toESM(require("react"), 1);
|
|
3997
|
+
var Textarea = (0, import_react55.forwardRef)(
|
|
3998
|
+
({
|
|
3999
|
+
size,
|
|
4000
|
+
className,
|
|
4001
|
+
rows,
|
|
4002
|
+
cols,
|
|
4003
|
+
disabled,
|
|
4004
|
+
error,
|
|
4005
|
+
children,
|
|
4006
|
+
id,
|
|
4007
|
+
...props
|
|
4008
|
+
}, ref) => {
|
|
4009
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
2372
4010
|
"textarea",
|
|
2373
4011
|
{
|
|
2374
4012
|
...props,
|
|
@@ -2377,8 +4015,9 @@ var Textarea = (0, import_react41.forwardRef)(
|
|
|
2377
4015
|
rows,
|
|
2378
4016
|
cols,
|
|
2379
4017
|
className: cn(
|
|
2380
|
-
"group flex items-center gap-2 border border-gray-200 rounded-lg bg-gray-50 shadow-xs hover:bg-gray-50 hover:border-gray-300 text-sm focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 outline-none disabled:bg-gray-300 disabled:select-none disabled:pointer-events-none disabled:opacity-30 placeholder:text-gray-500 hover:placeholder:text-gray-500",
|
|
4018
|
+
"group flex items-center gap-2 border border-gray-200 rounded-lg bg-gray-50 shadow-xs hover:bg-gray-50 hover:border-gray-300 text-sm focus-within:border-gray-800 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-gray-800 outline-none disabled:bg-gray-300 disabled:select-none disabled:pointer-events-none disabled:opacity-30 w-full placeholder:text-gray-500 hover:placeholder:text-gray-500 shadow-[0px_1px_2px_0px_#1018280D]",
|
|
2381
4019
|
size === "sm" ? "py-2.5 px-3.5" : "p-2.5",
|
|
4020
|
+
error && "border-error-500 hover:border-error-600 focus-within:hover:border-error-500 focus-within:border-error-500",
|
|
2382
4021
|
className,
|
|
2383
4022
|
size
|
|
2384
4023
|
)
|
|
@@ -2390,9 +4029,74 @@ var Textarea = (0, import_react41.forwardRef)(
|
|
|
2390
4029
|
Textarea.displayName = "Textarea";
|
|
2391
4030
|
var Textarea_default = Textarea;
|
|
2392
4031
|
|
|
4032
|
+
// app/components/TextInputWithLabel.tsx
|
|
4033
|
+
var import_react56 = require("@remixicon/react");
|
|
4034
|
+
var import_react57 = __toESM(require("react"), 1);
|
|
4035
|
+
var TextInputWithLabel = ({
|
|
4036
|
+
intent = "primary",
|
|
4037
|
+
placeholder = "Enter tags",
|
|
4038
|
+
type = "text",
|
|
4039
|
+
size,
|
|
4040
|
+
tags,
|
|
4041
|
+
setTags,
|
|
4042
|
+
...props
|
|
4043
|
+
}) => {
|
|
4044
|
+
const handleAddTags = (inputValue) => {
|
|
4045
|
+
const values = inputValue.split(",").map((v) => v.trim()).filter((v) => v && !tags.includes(v));
|
|
4046
|
+
if (values.length === 0)
|
|
4047
|
+
return;
|
|
4048
|
+
setTags([...tags, ...values]);
|
|
4049
|
+
};
|
|
4050
|
+
const handleRemoveTag = (tag) => {
|
|
4051
|
+
setTags(tags.filter((t) => t !== tag));
|
|
4052
|
+
};
|
|
4053
|
+
const handleKeyDown = (e) => {
|
|
4054
|
+
if (e.key === "Enter") {
|
|
4055
|
+
e.preventDefault();
|
|
4056
|
+
const target = e.target;
|
|
4057
|
+
handleAddTags(target.value);
|
|
4058
|
+
target.value = "";
|
|
4059
|
+
}
|
|
4060
|
+
};
|
|
4061
|
+
const handlePaste = (e) => {
|
|
4062
|
+
e.preventDefault();
|
|
4063
|
+
const pasteData = e.clipboardData.getData("text");
|
|
4064
|
+
handleAddTags(pasteData);
|
|
4065
|
+
};
|
|
4066
|
+
return /* @__PURE__ */ import_react57.default.createElement("div", null, /* @__PURE__ */ import_react57.default.createElement(
|
|
4067
|
+
Input_default,
|
|
4068
|
+
{
|
|
4069
|
+
type,
|
|
4070
|
+
size,
|
|
4071
|
+
onKeyDown: handleKeyDown,
|
|
4072
|
+
onPaste: handlePaste,
|
|
4073
|
+
placeholder,
|
|
4074
|
+
className: "w-full",
|
|
4075
|
+
...props
|
|
4076
|
+
}
|
|
4077
|
+
), /* @__PURE__ */ import_react57.default.createElement("div", { className: "flex flex-wrap items-center gap-2 mt-2 transition-all duration-300" }, tags == null ? void 0 : tags.map((tag, idx) => /* @__PURE__ */ import_react57.default.createElement(
|
|
4078
|
+
Chip_default,
|
|
4079
|
+
{
|
|
4080
|
+
size: "md",
|
|
4081
|
+
intent,
|
|
4082
|
+
key: `${tag}-${idx}`,
|
|
4083
|
+
endIcon: /* @__PURE__ */ import_react57.default.createElement(
|
|
4084
|
+
import_react56.RiCloseCircleLine,
|
|
4085
|
+
{
|
|
4086
|
+
size: 14,
|
|
4087
|
+
className: "cursor-pointer hover:text-red-500",
|
|
4088
|
+
onClick: () => handleRemoveTag(tag)
|
|
4089
|
+
}
|
|
4090
|
+
)
|
|
4091
|
+
},
|
|
4092
|
+
tag
|
|
4093
|
+
))));
|
|
4094
|
+
};
|
|
4095
|
+
var TextInputWithLabel_default = TextInputWithLabel;
|
|
4096
|
+
|
|
2393
4097
|
// app/components/Toggle.tsx
|
|
2394
4098
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2395
|
-
var
|
|
4099
|
+
var import_react58 = __toESM(require("react"), 1);
|
|
2396
4100
|
var toggleVariants = (0, import_class_variance_authority8.cva)("", {
|
|
2397
4101
|
variants: {
|
|
2398
4102
|
size: {
|
|
@@ -2410,37 +4114,42 @@ var toggleVariants = (0, import_class_variance_authority8.cva)("", {
|
|
|
2410
4114
|
intent: "primary"
|
|
2411
4115
|
}
|
|
2412
4116
|
});
|
|
2413
|
-
var Toggle = (0,
|
|
2414
|
-
({ size, className, intent, disabled, children, ...props }, ref) => {
|
|
2415
|
-
return /* @__PURE__ */
|
|
4117
|
+
var Toggle = (0, import_react58.forwardRef)(
|
|
4118
|
+
({ size, className, intent, disabled, children, id, ...props }, ref) => {
|
|
4119
|
+
return /* @__PURE__ */ import_react58.default.createElement(
|
|
2416
4120
|
"label",
|
|
2417
4121
|
{
|
|
2418
4122
|
className: cn(
|
|
2419
4123
|
"inline-flex items-center cursor-pointer",
|
|
2420
4124
|
disabled && "opacity-30 pointer-events-none"
|
|
2421
|
-
)
|
|
4125
|
+
),
|
|
4126
|
+
htmlFor: id
|
|
2422
4127
|
},
|
|
2423
|
-
/* @__PURE__ */
|
|
4128
|
+
/* @__PURE__ */ import_react58.default.createElement(
|
|
2424
4129
|
"input",
|
|
2425
4130
|
{
|
|
2426
4131
|
type: "checkbox",
|
|
2427
4132
|
disabled,
|
|
2428
4133
|
ref,
|
|
4134
|
+
id,
|
|
4135
|
+
role: "switch",
|
|
4136
|
+
"aria-checked": props == null ? void 0 : props.checked,
|
|
2429
4137
|
...props,
|
|
2430
|
-
className: "sr-only
|
|
4138
|
+
className: "sr-only peer"
|
|
2431
4139
|
}
|
|
2432
4140
|
),
|
|
2433
|
-
/* @__PURE__ */
|
|
4141
|
+
/* @__PURE__ */ import_react58.default.createElement(
|
|
2434
4142
|
"span",
|
|
2435
4143
|
{
|
|
2436
4144
|
className: cn(
|
|
2437
|
-
"relative w-11 h-7 bg-gray-300 peer-focus:
|
|
4145
|
+
"relative w-11 h-7 bg-gray-300 rounded-full peer peer-focus:ring-2 peer-focus:ring-primary-600 peer-focus:ring-offset-2 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all",
|
|
2438
4146
|
toggleVariants({
|
|
2439
4147
|
intent,
|
|
2440
|
-
className,
|
|
2441
4148
|
size
|
|
2442
|
-
})
|
|
2443
|
-
|
|
4149
|
+
}),
|
|
4150
|
+
className
|
|
4151
|
+
),
|
|
4152
|
+
"aria-hidden": "true"
|
|
2444
4153
|
},
|
|
2445
4154
|
children
|
|
2446
4155
|
)
|
|
@@ -2449,6 +4158,288 @@ var Toggle = (0, import_react42.forwardRef)(
|
|
|
2449
4158
|
);
|
|
2450
4159
|
Toggle.displayName = "Toggle";
|
|
2451
4160
|
var Toggle_default = Toggle;
|
|
4161
|
+
|
|
4162
|
+
// app/components/Tooltip.tsx
|
|
4163
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
4164
|
+
var import_react59 = __toESM(require("react"), 1);
|
|
4165
|
+
var tooltipVariants = (0, import_class_variance_authority9.cva)(
|
|
4166
|
+
"bg-white shadow-lg rounded-lg absolute hidden group-hover:block p-3 z-10 max-w-[328px] w-max whitespace-normal opacity-0 group-hover:opacity-100 transform transition-all duration-1000 ease-in-out group-hover:delay-[2000ms]",
|
|
4167
|
+
{
|
|
4168
|
+
variants: {
|
|
4169
|
+
position: {
|
|
4170
|
+
top: "bottom-[calc(100%+8px)] group-hover:translate-y-0 delay-1000 translate-y-[-10px]",
|
|
4171
|
+
right: "top-1/2 -translate-y-1/2 left-[calc(100%+8px)] group-hover:translate-x-0 translate-x-[-10px]",
|
|
4172
|
+
bottom: "top-[calc(100%+8px)] group-hover:translate-y-0 translate-y-[10px]",
|
|
4173
|
+
left: "top-1/2 -translate-y-1/2 right-[calc(100%+8px)] group-hover:translate-x-0 translate-x-[10px]"
|
|
4174
|
+
}
|
|
4175
|
+
}
|
|
4176
|
+
}
|
|
4177
|
+
);
|
|
4178
|
+
var arrowVariants = (0, import_class_variance_authority9.cva)(
|
|
4179
|
+
"absolute w-0 h-0 border-transparent border-solid",
|
|
4180
|
+
{
|
|
4181
|
+
variants: {
|
|
4182
|
+
position: {
|
|
4183
|
+
top: "top-full left-5 -translate-x-1/2 border-t-white border-t-[6px] border-x-[6px] border-x-transparent border-b-0",
|
|
4184
|
+
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-r-[6px] border-y-[6px] border-y-transparent border-l-0",
|
|
4185
|
+
bottom: "bottom-full left-4 -translate-x-1/2 border-b-white border-b-[6px] border-x-[6px] border-x-transparent border-t-0",
|
|
4186
|
+
left: "left-full top-1/2 -translate-y-1/2 border-l-white border-l-[6px] border-y-[6px] border-y-transparent border-r-0"
|
|
4187
|
+
}
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
);
|
|
4191
|
+
var Tooltip = ({
|
|
4192
|
+
position,
|
|
4193
|
+
content,
|
|
4194
|
+
children,
|
|
4195
|
+
className,
|
|
4196
|
+
...props
|
|
4197
|
+
}) => {
|
|
4198
|
+
return /* @__PURE__ */ import_react59.default.createElement("div", { ...props, className: "relative cursor-pointer text-sm group w-fit" }, /* @__PURE__ */ import_react59.default.createElement("div", null, children), /* @__PURE__ */ import_react59.default.createElement("div", { className: cn(tooltipVariants({ position }), className) }, content, /* @__PURE__ */ import_react59.default.createElement("div", { className: cn(arrowVariants({ position })) })));
|
|
4199
|
+
};
|
|
4200
|
+
var Tooltip_default = Tooltip;
|
|
4201
|
+
|
|
4202
|
+
// app/components/TreeView.tsx
|
|
4203
|
+
var import_react60 = __toESM(require("react"), 1);
|
|
4204
|
+
var import_react61 = require("@remixicon/react");
|
|
4205
|
+
var TreeView = ({
|
|
4206
|
+
children,
|
|
4207
|
+
"aria-label": ariaLabel,
|
|
4208
|
+
flat = false,
|
|
4209
|
+
className,
|
|
4210
|
+
defaultExpandedIds = [],
|
|
4211
|
+
expandedIds,
|
|
4212
|
+
onExpandedChange,
|
|
4213
|
+
allowMultiple = true,
|
|
4214
|
+
expandTopLevelByDefault = false
|
|
4215
|
+
}) => {
|
|
4216
|
+
const topLevelIds = import_react60.default.Children.toArray(children).map(
|
|
4217
|
+
(child) => import_react60.default.isValidElement(child) ? child.props.id : null
|
|
4218
|
+
).filter(Boolean);
|
|
4219
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react60.useState)(
|
|
4220
|
+
() => new Set(
|
|
4221
|
+
defaultExpandedIds.length ? defaultExpandedIds : expandTopLevelByDefault ? topLevelIds : []
|
|
4222
|
+
)
|
|
4223
|
+
);
|
|
4224
|
+
const expandedNodes = expandedIds ? new Set(expandedIds) : internalExpanded;
|
|
4225
|
+
const [selectedId, setSelectedId] = (0, import_react60.useState)(null);
|
|
4226
|
+
const toggleNode = (id) => {
|
|
4227
|
+
const updateSet = (set) => {
|
|
4228
|
+
const next = new Set(set);
|
|
4229
|
+
if (allowMultiple) {
|
|
4230
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
4231
|
+
} else {
|
|
4232
|
+
next.clear();
|
|
4233
|
+
next.add(id);
|
|
4234
|
+
}
|
|
4235
|
+
return next;
|
|
4236
|
+
};
|
|
4237
|
+
if (expandedIds && onExpandedChange) {
|
|
4238
|
+
const newExpanded = updateSet(expandedNodes);
|
|
4239
|
+
onExpandedChange(Array.from(newExpanded));
|
|
4240
|
+
} else {
|
|
4241
|
+
setInternalExpanded((prev) => updateSet(prev));
|
|
4242
|
+
}
|
|
4243
|
+
};
|
|
4244
|
+
const handleSelect = (id) => setSelectedId(id);
|
|
4245
|
+
const enhanceChildren = (nodes, level = 0) => import_react60.default.Children.map(nodes, (child) => {
|
|
4246
|
+
if (import_react60.default.isValidElement(child)) {
|
|
4247
|
+
return import_react60.default.cloneElement(child, {
|
|
4248
|
+
level,
|
|
4249
|
+
expanded: expandedNodes.has(child.props.id),
|
|
4250
|
+
onToggle: toggleNode,
|
|
4251
|
+
onSelect: handleSelect,
|
|
4252
|
+
selected: selectedId === child.props.id,
|
|
4253
|
+
flat,
|
|
4254
|
+
children: enhanceChildren(child.props.children, level + 1)
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4257
|
+
return child;
|
|
4258
|
+
});
|
|
4259
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
4260
|
+
"ul",
|
|
4261
|
+
{
|
|
4262
|
+
role: "tree",
|
|
4263
|
+
"aria-label": ariaLabel,
|
|
4264
|
+
className: cn("list-none p-0 m-0 text-sm", className)
|
|
4265
|
+
},
|
|
4266
|
+
enhanceChildren(children)
|
|
4267
|
+
);
|
|
4268
|
+
};
|
|
4269
|
+
var DefaultExpandIcon = ({ expanded }) => /* @__PURE__ */ import_react60.default.createElement("span", { className: "transition-transform duration-200" }, expanded ? /* @__PURE__ */ import_react60.default.createElement(import_react61.RiArrowDownSFill, { size: 18 }) : /* @__PURE__ */ import_react60.default.createElement(import_react61.RiArrowRightSFill, { size: 18 }));
|
|
4270
|
+
var TreeViewItem = ({
|
|
4271
|
+
id,
|
|
4272
|
+
children,
|
|
4273
|
+
current = false,
|
|
4274
|
+
className,
|
|
4275
|
+
onSelect,
|
|
4276
|
+
expanded = false,
|
|
4277
|
+
onToggle,
|
|
4278
|
+
selected = false,
|
|
4279
|
+
level = 0,
|
|
4280
|
+
flat = false
|
|
4281
|
+
}) => {
|
|
4282
|
+
const leading = [];
|
|
4283
|
+
const trailing = [];
|
|
4284
|
+
const content = [];
|
|
4285
|
+
let subTree = null;
|
|
4286
|
+
import_react60.default.Children.forEach(children, (child) => {
|
|
4287
|
+
if (import_react60.default.isValidElement(child)) {
|
|
4288
|
+
if (child.type === TreeViewLeadingVisual)
|
|
4289
|
+
leading.push(child);
|
|
4290
|
+
else if (child.type === TreeViewTrailingVisual)
|
|
4291
|
+
trailing.push(child);
|
|
4292
|
+
else if (child.type === TreeViewSubTree)
|
|
4293
|
+
subTree = child;
|
|
4294
|
+
else
|
|
4295
|
+
content.push(child);
|
|
4296
|
+
} else
|
|
4297
|
+
content.push(child);
|
|
4298
|
+
});
|
|
4299
|
+
const hasSubTree = !!subTree;
|
|
4300
|
+
const handleClick = (e) => {
|
|
4301
|
+
e.stopPropagation();
|
|
4302
|
+
if (hasSubTree && !flat && onToggle)
|
|
4303
|
+
onToggle(id);
|
|
4304
|
+
if (onSelect)
|
|
4305
|
+
onSelect(id);
|
|
4306
|
+
};
|
|
4307
|
+
const handleKeyDown = (e) => {
|
|
4308
|
+
switch (e.key) {
|
|
4309
|
+
case "Enter":
|
|
4310
|
+
case " ":
|
|
4311
|
+
e.preventDefault();
|
|
4312
|
+
handleClick(e);
|
|
4313
|
+
break;
|
|
4314
|
+
case "ArrowRight":
|
|
4315
|
+
if (hasSubTree && !expanded && !flat && onToggle) {
|
|
4316
|
+
e.preventDefault();
|
|
4317
|
+
onToggle(id);
|
|
4318
|
+
}
|
|
4319
|
+
break;
|
|
4320
|
+
case "ArrowLeft":
|
|
4321
|
+
if (hasSubTree && expanded && !flat && onToggle) {
|
|
4322
|
+
e.preventDefault();
|
|
4323
|
+
onToggle(id);
|
|
4324
|
+
}
|
|
4325
|
+
break;
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
const processedSubTree = subTree && import_react60.default.isValidElement(subTree) ? import_react60.default.cloneElement(subTree, { expanded, flat }) : null;
|
|
4329
|
+
return /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, /* @__PURE__ */ import_react60.default.createElement(
|
|
4330
|
+
"li",
|
|
4331
|
+
{
|
|
4332
|
+
role: "treeitem",
|
|
4333
|
+
"aria-expanded": hasSubTree && !flat ? expanded : void 0,
|
|
4334
|
+
"aria-selected": selected,
|
|
4335
|
+
"aria-current": current ? "true" : void 0,
|
|
4336
|
+
className: cn(
|
|
4337
|
+
"flex items-center gap-2 px-2 py-1 cursor-pointer select-none rounded transition-colors duration-150",
|
|
4338
|
+
selected && "bg-blue-50 text-blue-600 font-medium",
|
|
4339
|
+
"hover:bg-gray-100",
|
|
4340
|
+
className
|
|
4341
|
+
),
|
|
4342
|
+
style: { paddingLeft: `${level * 16 + 8}px` },
|
|
4343
|
+
onClick: handleClick,
|
|
4344
|
+
onKeyDown: handleKeyDown,
|
|
4345
|
+
tabIndex: 0
|
|
4346
|
+
},
|
|
4347
|
+
/* @__PURE__ */ import_react60.default.createElement("span", { className: "flex items-center gap-1" }, !leading.length && hasSubTree && !flat && /* @__PURE__ */ import_react60.default.createElement(DefaultExpandIcon, { expanded }), leading),
|
|
4348
|
+
/* @__PURE__ */ import_react60.default.createElement("span", { className: "flex-1" }, content),
|
|
4349
|
+
trailing
|
|
4350
|
+
), processedSubTree);
|
|
4351
|
+
};
|
|
4352
|
+
var TreeViewSubTree = ({
|
|
4353
|
+
children,
|
|
4354
|
+
state,
|
|
4355
|
+
count,
|
|
4356
|
+
className,
|
|
4357
|
+
expanded = false,
|
|
4358
|
+
flat = false
|
|
4359
|
+
}) => {
|
|
4360
|
+
if (flat)
|
|
4361
|
+
return null;
|
|
4362
|
+
if (state === "loading") {
|
|
4363
|
+
return /* @__PURE__ */ import_react60.default.createElement("ul", { role: "group", className: cn("list-none m-0", className) }, /* @__PURE__ */ import_react60.default.createElement("li", { className: "text-gray-500 italic p-1 pl-6" }, "Loading", count ? ` ${count} items...` : "..."));
|
|
4364
|
+
}
|
|
4365
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
4366
|
+
"ul",
|
|
4367
|
+
{
|
|
4368
|
+
role: "group",
|
|
4369
|
+
className: cn(
|
|
4370
|
+
"list-none m-0 pl-0 overflow-hidden transition-all duration-300 ease-in-out",
|
|
4371
|
+
expanded ? "max-h-96 opacity-100" : "max-h-0 opacity-0",
|
|
4372
|
+
className
|
|
4373
|
+
)
|
|
4374
|
+
},
|
|
4375
|
+
children
|
|
4376
|
+
);
|
|
4377
|
+
};
|
|
4378
|
+
var TreeViewLeadingVisual = ({ children, className }) => /* @__PURE__ */ import_react60.default.createElement("span", { className: cn("flex items-center flex-shrink-0", className) }, children);
|
|
4379
|
+
var TreeViewTrailingVisual = ({ children, label, className }) => /* @__PURE__ */ import_react60.default.createElement(
|
|
4380
|
+
"span",
|
|
4381
|
+
{
|
|
4382
|
+
className: cn("flex items-center ml-auto flex-shrink-0", className),
|
|
4383
|
+
"aria-label": label
|
|
4384
|
+
},
|
|
4385
|
+
children
|
|
4386
|
+
);
|
|
4387
|
+
TreeView.Item = TreeViewItem;
|
|
4388
|
+
TreeView.SubTree = TreeViewSubTree;
|
|
4389
|
+
TreeView.LeadingVisual = TreeViewLeadingVisual;
|
|
4390
|
+
TreeView.TrailingVisual = TreeViewTrailingVisual;
|
|
4391
|
+
var TreeView_default = TreeView;
|
|
4392
|
+
|
|
4393
|
+
// app/components/Typography.tsx
|
|
4394
|
+
var import_class_variance_authority10 = require("class-variance-authority");
|
|
4395
|
+
var import_react62 = __toESM(require("react"), 1);
|
|
4396
|
+
var typographyVariant = (0, import_class_variance_authority10.cva)("text-dark", {
|
|
4397
|
+
variants: {
|
|
4398
|
+
variant: {
|
|
4399
|
+
h1: "text-8xl font-bold",
|
|
4400
|
+
h2: "text-7xl font-bold",
|
|
4401
|
+
h3: "text-5xl font-bold",
|
|
4402
|
+
h4: "text-[32px] font-bold",
|
|
4403
|
+
h5: "text-2xl font-bold",
|
|
4404
|
+
h6: "text-xl font-semibold",
|
|
4405
|
+
b1: "text-xl font-normal",
|
|
4406
|
+
b2: "text-lg font-normal",
|
|
4407
|
+
b3: "text-base font-normal",
|
|
4408
|
+
b4: "text-sm font-normal",
|
|
4409
|
+
b5: "text-xs font-normal"
|
|
4410
|
+
},
|
|
4411
|
+
intent: {
|
|
4412
|
+
primary: "text-primary-600",
|
|
4413
|
+
success: "text-success-600",
|
|
4414
|
+
error: "text-error-600",
|
|
4415
|
+
warning: "text-warning-600",
|
|
4416
|
+
default: "text-black"
|
|
4417
|
+
}
|
|
4418
|
+
},
|
|
4419
|
+
defaultVariants: {
|
|
4420
|
+
variant: "h1",
|
|
4421
|
+
intent: "default"
|
|
4422
|
+
}
|
|
4423
|
+
});
|
|
4424
|
+
var Typography = ({
|
|
4425
|
+
as,
|
|
4426
|
+
variant = "h1",
|
|
4427
|
+
intent = "default",
|
|
4428
|
+
children,
|
|
4429
|
+
className,
|
|
4430
|
+
...props
|
|
4431
|
+
}) => {
|
|
4432
|
+
const Component = as || ((variant == null ? void 0 : variant.startsWith("b")) ? "p" : variant);
|
|
4433
|
+
return /* @__PURE__ */ import_react62.default.createElement(
|
|
4434
|
+
Component,
|
|
4435
|
+
{
|
|
4436
|
+
className: cn(typographyVariant({ variant, intent, className })),
|
|
4437
|
+
...props
|
|
4438
|
+
},
|
|
4439
|
+
children
|
|
4440
|
+
);
|
|
4441
|
+
};
|
|
4442
|
+
var Typography_default = Typography;
|
|
2452
4443
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2453
4444
|
0 && (module.exports = {
|
|
2454
4445
|
Accordion,
|
|
@@ -2459,30 +4450,52 @@ var Toggle_default = Toggle;
|
|
|
2459
4450
|
AvatarGroup,
|
|
2460
4451
|
BreadCrumb,
|
|
2461
4452
|
Button,
|
|
4453
|
+
Callout,
|
|
4454
|
+
Card,
|
|
4455
|
+
CardAction,
|
|
4456
|
+
CardContent,
|
|
4457
|
+
CardDescription,
|
|
4458
|
+
CardFooter,
|
|
4459
|
+
CardHeader,
|
|
4460
|
+
CardTitle,
|
|
2462
4461
|
Checkbox,
|
|
2463
4462
|
Chip,
|
|
2464
4463
|
CircularProgress,
|
|
2465
4464
|
Divider,
|
|
4465
|
+
Drawer,
|
|
2466
4466
|
Dropdown,
|
|
4467
|
+
DropdownMenu,
|
|
4468
|
+
DropdownMenuContent,
|
|
4469
|
+
DropdownMenuItem,
|
|
4470
|
+
DropdownMenuLabel,
|
|
4471
|
+
DropdownMenuSeparator,
|
|
4472
|
+
DropdownMenuSub,
|
|
4473
|
+
DropdownMenuSubContent,
|
|
4474
|
+
DropdownMenuSubTrigger,
|
|
4475
|
+
DropdownMenuTrigger,
|
|
2467
4476
|
DropdownWithIcon,
|
|
4477
|
+
FileSelector,
|
|
2468
4478
|
FileUpload,
|
|
4479
|
+
FileUploadPreview,
|
|
2469
4480
|
GlobalNavigation,
|
|
2470
4481
|
HelperText,
|
|
2471
4482
|
Input,
|
|
2472
4483
|
Label,
|
|
2473
4484
|
ListItem,
|
|
4485
|
+
ListPagination,
|
|
2474
4486
|
Loading,
|
|
2475
|
-
MenuDropdown,
|
|
2476
|
-
MenuItem,
|
|
2477
|
-
MenuSubItem,
|
|
2478
4487
|
Modal,
|
|
2479
4488
|
Notice,
|
|
4489
|
+
OTPInput,
|
|
2480
4490
|
Pagination,
|
|
2481
4491
|
ProgressBar,
|
|
2482
4492
|
Radio,
|
|
4493
|
+
RazorPayFileUpload,
|
|
2483
4494
|
Sidebar,
|
|
2484
4495
|
Skeleton,
|
|
2485
4496
|
Slider,
|
|
4497
|
+
Spinner,
|
|
4498
|
+
SplitButton,
|
|
2486
4499
|
Stepper,
|
|
2487
4500
|
Tab,
|
|
2488
4501
|
TabList,
|
|
@@ -2494,8 +4507,12 @@ var Toggle_default = Toggle;
|
|
|
2494
4507
|
TableHeadCell,
|
|
2495
4508
|
TableRow,
|
|
2496
4509
|
TabsContainer,
|
|
4510
|
+
TextInputWithLabel,
|
|
2497
4511
|
Textarea,
|
|
2498
4512
|
Toggle,
|
|
2499
|
-
Tooltip
|
|
4513
|
+
Tooltip,
|
|
4514
|
+
TreeView,
|
|
4515
|
+
Typography,
|
|
4516
|
+
defaultGetFileIcon
|
|
2500
4517
|
});
|
|
2501
4518
|
//# sourceMappingURL=index.cjs.map
|