atomos_next_genesis 0.0.3-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +464 -0
- package/dist/index.cjs +2500 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +2698 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +534 -0
- package/dist/index.d.ts +534 -0
- package/dist/index.js +2464 -0
- package/dist/index.js.map +1 -0
- package/package.json +84 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2464 @@
|
|
|
1
|
+
// app/components/Accordian.tsx
|
|
2
|
+
import React2, { useState } from "react";
|
|
3
|
+
|
|
4
|
+
// app/utils/utils.tsx
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
var cn = (...classes) => twMerge(clsx(...classes));
|
|
8
|
+
|
|
9
|
+
// app/components/Accordian.tsx
|
|
10
|
+
import { RiArrowDownSLine } from "@remixicon/react";
|
|
11
|
+
function Accordion({
|
|
12
|
+
type = "single",
|
|
13
|
+
collapsible = true,
|
|
14
|
+
className,
|
|
15
|
+
children
|
|
16
|
+
}) {
|
|
17
|
+
const [openItems, setOpenItems] = useState([]);
|
|
18
|
+
const handleToggle = (value) => {
|
|
19
|
+
if (type === "single") {
|
|
20
|
+
setOpenItems(
|
|
21
|
+
(prev) => prev.includes(value) ? collapsible ? [] : prev : [value]
|
|
22
|
+
);
|
|
23
|
+
} else {
|
|
24
|
+
setOpenItems(
|
|
25
|
+
(prev) => prev.includes(value) ? prev.filter((item) => item !== value) : [...prev, value]
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ React2.createElement("div", { className }, React2.Children.map(children, (child) => {
|
|
30
|
+
if (React2.isValidElement(child)) {
|
|
31
|
+
return React2.cloneElement(
|
|
32
|
+
child,
|
|
33
|
+
{
|
|
34
|
+
openItems,
|
|
35
|
+
handleToggle
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return child;
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
function AccordionItem({
|
|
43
|
+
value,
|
|
44
|
+
disabled = false,
|
|
45
|
+
openItems,
|
|
46
|
+
handleToggle,
|
|
47
|
+
children,
|
|
48
|
+
className
|
|
49
|
+
}) {
|
|
50
|
+
const isOpen = openItems == null ? void 0 : openItems.includes(value);
|
|
51
|
+
const toggle = () => {
|
|
52
|
+
if (!disabled && handleToggle) {
|
|
53
|
+
handleToggle(value);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ React2.createElement(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: cn(
|
|
60
|
+
"bg-white hover:bg-gray-50 rounded-lg shadow transition-all duration-300 ease-in-out",
|
|
61
|
+
disabled ? "opacity-50 pointer-events-none select-none" : "cursor-pointer",
|
|
62
|
+
isOpen ? "border border-gray-300" : "border",
|
|
63
|
+
className
|
|
64
|
+
)
|
|
65
|
+
},
|
|
66
|
+
/* @__PURE__ */ React2.createElement(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: "font-semibold transition-all duration-300 ease-in-out",
|
|
70
|
+
onClick: toggle
|
|
71
|
+
},
|
|
72
|
+
children && Array.isArray(children) ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, React2.cloneElement(children[0], { isOpen }), /* @__PURE__ */ React2.createElement(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: cn(
|
|
76
|
+
"grid transition-all duration-300 ease-in-out",
|
|
77
|
+
isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
|
|
78
|
+
)
|
|
79
|
+
},
|
|
80
|
+
/* @__PURE__ */ React2.createElement("div", { className: "overflow-hidden" }, /* @__PURE__ */ React2.createElement("div", { className: cn("") }, children[1]))
|
|
81
|
+
)) : children
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function AccordionTrigger({ isOpen, children }) {
|
|
86
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "flex p-3.5 justify-between items-center text-sm font-semibold transition-all delay-150 ease-in" }, children, /* @__PURE__ */ React2.createElement(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
className: cn(
|
|
90
|
+
"transition-transform duration-300 transform",
|
|
91
|
+
isOpen ? "rotate-180" : "rotate-0"
|
|
92
|
+
)
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React2.createElement(RiArrowDownSLine, { size: 18 })
|
|
95
|
+
));
|
|
96
|
+
}
|
|
97
|
+
function AccordionContent({ isOpen, children }) {
|
|
98
|
+
return /* @__PURE__ */ React2.createElement(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: cn(
|
|
102
|
+
"w-full font-normal px-3.5 pb-3.5 text-sm overflow-hidden transition-all duration-500 ease-in",
|
|
103
|
+
!isOpen ? "max-h-full opacity-100" : "max-h-0 opacity-0"
|
|
104
|
+
)
|
|
105
|
+
},
|
|
106
|
+
children
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// app/components/Avatar.tsx
|
|
111
|
+
import Image from "next/image";
|
|
112
|
+
import React3, { forwardRef } from "react";
|
|
113
|
+
var Avatar = forwardRef((props, ref) => {
|
|
114
|
+
const {
|
|
115
|
+
type,
|
|
116
|
+
size = "md",
|
|
117
|
+
className,
|
|
118
|
+
onClick,
|
|
119
|
+
rounded,
|
|
120
|
+
border,
|
|
121
|
+
borderColor,
|
|
122
|
+
borderWidth,
|
|
123
|
+
radius,
|
|
124
|
+
disabled,
|
|
125
|
+
statusIcon,
|
|
126
|
+
statusPosition = "bottom-right"
|
|
127
|
+
} = props;
|
|
128
|
+
const sizes = {
|
|
129
|
+
sm: "w-8 h-8",
|
|
130
|
+
md: "w-12 h-12",
|
|
131
|
+
lg: "w-16 h-16"
|
|
132
|
+
};
|
|
133
|
+
const displayText = type === "text" && props.text ? props.text.length === 2 ? props.text.toUpperCase() : props.text.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").slice(0, 2) : "";
|
|
134
|
+
return /* @__PURE__ */ React3.createElement(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
ref,
|
|
138
|
+
className: cn(
|
|
139
|
+
"relative -z-10 ",
|
|
140
|
+
rounded && "rounded-full",
|
|
141
|
+
border && "border border-gray-200",
|
|
142
|
+
disabled && "opacity-50 pointer-events-none select-none"
|
|
143
|
+
),
|
|
144
|
+
style: {
|
|
145
|
+
borderColor,
|
|
146
|
+
borderWidth,
|
|
147
|
+
borderRadius: radius
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
type === "image" && /* @__PURE__ */ React3.createElement(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
className: cn(
|
|
154
|
+
"relative -z-10 flex items-center justify-center",
|
|
155
|
+
sizes[size],
|
|
156
|
+
className
|
|
157
|
+
),
|
|
158
|
+
onClick
|
|
159
|
+
},
|
|
160
|
+
/* @__PURE__ */ React3.createElement(
|
|
161
|
+
Image,
|
|
162
|
+
{
|
|
163
|
+
fill: true,
|
|
164
|
+
className: cn(rounded && "rounded-full", "object-cover"),
|
|
165
|
+
src: props.src,
|
|
166
|
+
alt: props.alt || ""
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
),
|
|
170
|
+
type === "icon" && /* @__PURE__ */ React3.createElement(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
className: cn(
|
|
174
|
+
"flex items-center justify-center",
|
|
175
|
+
rounded && "rounded-full",
|
|
176
|
+
className,
|
|
177
|
+
sizes[size]
|
|
178
|
+
),
|
|
179
|
+
onClick
|
|
180
|
+
},
|
|
181
|
+
props.icon
|
|
182
|
+
),
|
|
183
|
+
type === "text" && /* @__PURE__ */ React3.createElement(
|
|
184
|
+
"p",
|
|
185
|
+
{
|
|
186
|
+
onClick,
|
|
187
|
+
className: cn(
|
|
188
|
+
"flex items-center justify-center text-sm font-medium text-gray-700",
|
|
189
|
+
rounded && "rounded-full",
|
|
190
|
+
className,
|
|
191
|
+
sizes[size],
|
|
192
|
+
size === "sm" && "text-xs",
|
|
193
|
+
size === "lg" && "text-xl",
|
|
194
|
+
size === "md" && "text-base"
|
|
195
|
+
)
|
|
196
|
+
},
|
|
197
|
+
displayText
|
|
198
|
+
),
|
|
199
|
+
statusIcon && /* @__PURE__ */ React3.createElement(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
className: cn(
|
|
203
|
+
"absolute w-2 h-2",
|
|
204
|
+
// small
|
|
205
|
+
statusPosition === "bottom-left" && size === "sm" && type === "image" && "bottom-0",
|
|
206
|
+
statusPosition === "top-left" && size === "sm" && type === "image" && "top-0 -left-1.5",
|
|
207
|
+
statusPosition === "bottom-right" && size === "sm" && type === "image" && "bottom-0.5 right-0.5",
|
|
208
|
+
statusPosition === "top-right" && size === "sm" && type === "image" && "-top-[1.1px] right-0",
|
|
209
|
+
// sm text and icon
|
|
210
|
+
statusPosition === "bottom-left" && size === "sm" && (type === "text" || type === "icon") && "bottom-0",
|
|
211
|
+
statusPosition === "top-left" && size === "sm" && (type === "text" || type === "icon") && "-top-1 left-0",
|
|
212
|
+
statusPosition === "bottom-right" && size === "sm" && (type === "text" || type === "icon") && "bottom-0 right-1.5",
|
|
213
|
+
statusPosition === "top-right" && size === "sm" && (type === "text" || type === "icon") && "top-0 right-0.5",
|
|
214
|
+
// medium
|
|
215
|
+
statusPosition === "bottom-left" && size === "md" && type === "image" && "bottom-1",
|
|
216
|
+
statusPosition === "top-left" && size === "md" && type === "image" && "-top-1 left-0.5",
|
|
217
|
+
statusPosition === "bottom-right" && size === "md" && type === "image" && "bottom-1 right-2",
|
|
218
|
+
statusPosition === "top-right" && size === "md" && type === "image" && "top-0 right-1",
|
|
219
|
+
// medium text and icon
|
|
220
|
+
statusPosition === "bottom-left" && size === "md" && (type === "text" || type === "icon") && "bottom-1",
|
|
221
|
+
statusPosition === "top-left" && size === "md" && (type === "text" || type === "icon") && "-top-1 left-1",
|
|
222
|
+
statusPosition === "bottom-right" && size === "md" && (type === "text" || type === "icon") && "bottom-1 right-2",
|
|
223
|
+
statusPosition === "top-right" && size === "md" && (type === "text" || type === "icon") && "top-0 right-1.5",
|
|
224
|
+
// large
|
|
225
|
+
statusPosition === "bottom-left" && size === "lg" && type === "image" && "bottom-2 left-0",
|
|
226
|
+
statusPosition === "top-left" && size === "lg" && type === "image" && "top-0 left-0.5",
|
|
227
|
+
statusPosition === "bottom-right" && size === "lg" && type === "image" && "bottom-2.5 right-2",
|
|
228
|
+
statusPosition === "top-right" && size === "lg" && type === "image" && "top-0 right-2",
|
|
229
|
+
// large text and icon
|
|
230
|
+
statusPosition === "bottom-left" && size === "lg" && (type === "text" || type === "icon") && "bottom-1.5 left-1.5",
|
|
231
|
+
statusPosition === "top-left" && size === "lg" && (type === "text" || type === "icon") && "top-0 left-1",
|
|
232
|
+
statusPosition === "bottom-right" && size === "lg" && (type === "text" || type === "icon") && "bottom-2 right-2.5",
|
|
233
|
+
statusPosition === "top-right" && size === "lg" && (type === "text" || type === "icon") && "top-0 right-2.5"
|
|
234
|
+
)
|
|
235
|
+
},
|
|
236
|
+
statusIcon
|
|
237
|
+
)
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
Avatar.displayName = "Avatar";
|
|
241
|
+
var Avatar_default = Avatar;
|
|
242
|
+
|
|
243
|
+
// app/components/AvatarGroup.tsx
|
|
244
|
+
import React4, { forwardRef as forwardRef2 } from "react";
|
|
245
|
+
var AvatarGroup = forwardRef2(
|
|
246
|
+
({ avatars, size = "md", max, className }, ref) => {
|
|
247
|
+
const displayAvatars = max ? avatars.slice(0, max) : avatars;
|
|
248
|
+
const remainingCount = max ? avatars.length - max : 0;
|
|
249
|
+
return /* @__PURE__ */ React4.createElement(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
ref,
|
|
253
|
+
className: cn("flex -space-x-6 rtl:space-x-reverse", className)
|
|
254
|
+
},
|
|
255
|
+
displayAvatars.map((avatar, index) => /* @__PURE__ */ React4.createElement(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
className: "hover:-translate-x-3 transition-all duration-200",
|
|
259
|
+
key: index
|
|
260
|
+
},
|
|
261
|
+
/* @__PURE__ */ React4.createElement(Avatar_default, { ...avatar, size })
|
|
262
|
+
)),
|
|
263
|
+
remainingCount > 0 && /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement(
|
|
264
|
+
Avatar_default,
|
|
265
|
+
{
|
|
266
|
+
type: "text",
|
|
267
|
+
text: `+${remainingCount}`,
|
|
268
|
+
size,
|
|
269
|
+
rounded: true,
|
|
270
|
+
className: "bg-gray-100"
|
|
271
|
+
}
|
|
272
|
+
))
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
277
|
+
var AvatarGroup_default = AvatarGroup;
|
|
278
|
+
|
|
279
|
+
// app/components/Breadcrumb.tsx
|
|
280
|
+
import React5 from "react";
|
|
281
|
+
var Breadcrumbs = ({
|
|
282
|
+
children,
|
|
283
|
+
separator = "/",
|
|
284
|
+
"aria-label": ariaLabel,
|
|
285
|
+
containerClasses
|
|
286
|
+
}) => {
|
|
287
|
+
const items = React5.Children.toArray(children).map((child, index) => {
|
|
288
|
+
const isLast = index === React5.Children.count(children) - 1;
|
|
289
|
+
return /* @__PURE__ */ React5.createElement("span", { key: index, className: "flex items-center text-text-xs text-gray-700 font-semibold" }, child, !isLast && /* @__PURE__ */ React5.createElement("span", { className: "mx-[6px]" }, separator));
|
|
290
|
+
});
|
|
291
|
+
return /* @__PURE__ */ React5.createElement("nav", { "aria-label": ariaLabel, className: `flex items-center text-text-xs text-gray-700 font-semibold ${containerClasses}` }, items);
|
|
292
|
+
};
|
|
293
|
+
var Breadcrumb_default = Breadcrumbs;
|
|
294
|
+
|
|
295
|
+
// app/components/Button.tsx
|
|
296
|
+
import React6 from "react";
|
|
297
|
+
import { cva } from "class-variance-authority";
|
|
298
|
+
var buttonVariants = cva(
|
|
299
|
+
"rounded-lg disabled:select-none font-semibold cursor-pointer transition-colors duration-300 ease-in-out",
|
|
300
|
+
{
|
|
301
|
+
variants: {
|
|
302
|
+
variant: {
|
|
303
|
+
filled: "bg-primary-600 text-white active:bg-primary-900 active:border-primary-900 hover:bg-primary-700 hover:border-primary-700 border border-primary-600 disabled:opacity-[30%] disabled:pointer-events-none",
|
|
304
|
+
outlined: "border border-primary-600 bg-white disabled:opacity-[30%] disabled:pointer-events-none text-primary-600 hover:bg-primary-100 active:bg-primary-200 active:border-primary-700"
|
|
305
|
+
},
|
|
306
|
+
intent: {
|
|
307
|
+
primary: "bg-primary-600 border-primary-600 active:bg-primary-900 active:border-primary-900 hover:bg-primary-700 hover:border-primary-700",
|
|
308
|
+
success: "bg-success-600 border-success-600 active:bg-success-900 active:border-success-900 hover:bg-success-700 hover:border-success-700",
|
|
309
|
+
error: "bg-error-700 border-error-700 active:bg-error-900 active:border-error-900 hover:bg-error-800 hover:border-error-800",
|
|
310
|
+
warning: "bg-warning-600 border-warning-600 active:bg-warning-900 active:border-warning-900 hover:bg-warning-700 hover:border-warning-700",
|
|
311
|
+
default: "bg-gray-600 border-gray-600 active:bg-gray-900 active:border-gray-900 hover:bg-gray-700 hover:border-gray-700",
|
|
312
|
+
"primary-outlined": "border-primary-600 text-primary-600 hover:bg-primary-100 active:bg-primary-200 active:border-primary-700",
|
|
313
|
+
"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",
|
|
314
|
+
"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",
|
|
315
|
+
"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",
|
|
316
|
+
"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"
|
|
317
|
+
},
|
|
318
|
+
size: {
|
|
319
|
+
sm: "text-sm px-3.5 py-2",
|
|
320
|
+
md: "text-sm px-4 py-2.5",
|
|
321
|
+
lg: "text-base px-[18px] py-2.5"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
defaultVariants: {
|
|
325
|
+
variant: "filled",
|
|
326
|
+
size: "md"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
var Button = ({
|
|
331
|
+
children,
|
|
332
|
+
className,
|
|
333
|
+
variant,
|
|
334
|
+
intent,
|
|
335
|
+
fullWidth = false,
|
|
336
|
+
startIcon,
|
|
337
|
+
disabled,
|
|
338
|
+
endIcon,
|
|
339
|
+
size,
|
|
340
|
+
...props
|
|
341
|
+
}) => {
|
|
342
|
+
return /* @__PURE__ */ React6.createElement(
|
|
343
|
+
"button",
|
|
344
|
+
{
|
|
345
|
+
...props,
|
|
346
|
+
disabled,
|
|
347
|
+
className: cn(
|
|
348
|
+
fullWidth && "w-full",
|
|
349
|
+
buttonVariants({ intent, className, variant, size }),
|
|
350
|
+
"flex items-center text-center justify-center gap-2"
|
|
351
|
+
)
|
|
352
|
+
},
|
|
353
|
+
startIcon,
|
|
354
|
+
children,
|
|
355
|
+
endIcon
|
|
356
|
+
);
|
|
357
|
+
};
|
|
358
|
+
var Button_default = Button;
|
|
359
|
+
|
|
360
|
+
// app/components/Checkbox.tsx
|
|
361
|
+
import React7, { forwardRef as forwardRef3 } from "react";
|
|
362
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
363
|
+
var checkboxVariant = cva2(
|
|
364
|
+
"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",
|
|
365
|
+
{
|
|
366
|
+
variants: {
|
|
367
|
+
size: {
|
|
368
|
+
sm: "h-3 w-3",
|
|
369
|
+
lg: "h-3.5 w-3.5"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
defaultVariants: {
|
|
373
|
+
size: "lg"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
var Checkbox = forwardRef3(
|
|
378
|
+
({ disabled, checked, size, className, children, ...props }, ref) => {
|
|
379
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "inline-flex relative items-center" }, /* @__PURE__ */ React7.createElement(
|
|
380
|
+
"input",
|
|
381
|
+
{
|
|
382
|
+
type: "checkbox",
|
|
383
|
+
ref,
|
|
384
|
+
...props,
|
|
385
|
+
disabled,
|
|
386
|
+
checked,
|
|
387
|
+
className: cn(checkboxVariant({ className, size }))
|
|
388
|
+
}
|
|
389
|
+
), /* @__PURE__ */ React7.createElement("span", { 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" }, /* @__PURE__ */ React7.createElement(
|
|
390
|
+
"svg",
|
|
391
|
+
{
|
|
392
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
393
|
+
className: "w-2.5 h-2.5",
|
|
394
|
+
viewBox: "0 0 20 20",
|
|
395
|
+
fill: "currentColor",
|
|
396
|
+
stroke: "currentColor",
|
|
397
|
+
strokeWidth: "1"
|
|
398
|
+
},
|
|
399
|
+
/* @__PURE__ */ React7.createElement(
|
|
400
|
+
"path",
|
|
401
|
+
{
|
|
402
|
+
fillRule: "evenodd",
|
|
403
|
+
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",
|
|
404
|
+
clipRule: "evenodd"
|
|
405
|
+
}
|
|
406
|
+
)
|
|
407
|
+
)));
|
|
408
|
+
}
|
|
409
|
+
);
|
|
410
|
+
Checkbox.displayName = "Checkbox";
|
|
411
|
+
var Checkbox_default = Checkbox;
|
|
412
|
+
|
|
413
|
+
// app/components/Chip.tsx
|
|
414
|
+
import React8 from "react";
|
|
415
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
416
|
+
var chipVariants = cva3(
|
|
417
|
+
"rounded-full capitalize flex items-center w-fit gap-2",
|
|
418
|
+
{
|
|
419
|
+
variants: {
|
|
420
|
+
intent: {
|
|
421
|
+
default: "bg-gray-50 text-gray-600",
|
|
422
|
+
success: "bg-success-50 text-success-600",
|
|
423
|
+
warning: "bg-warning-50 text-warning-500",
|
|
424
|
+
error: "bg-error-50 text-error-600",
|
|
425
|
+
primary: "bg-primary-100 text-primary-700",
|
|
426
|
+
bluegray: "bg-bluegray-100 text-bluegray-500",
|
|
427
|
+
bluelight: "bg-bluelight-100 text-bluelight-600",
|
|
428
|
+
violet: "bg-violet-50 text-violet-700",
|
|
429
|
+
indigo: "bg-indigo-100 text-indigo-700",
|
|
430
|
+
purple: "bg-purple-50 text-purple-700",
|
|
431
|
+
pink: "bg-pink-25 text-pink-700",
|
|
432
|
+
rose: "bg-rose-50 text-rose-600",
|
|
433
|
+
orange: "bg-orange-50 text-orange-600"
|
|
434
|
+
},
|
|
435
|
+
size: {
|
|
436
|
+
sm: "text-xs px-2 py-0.5",
|
|
437
|
+
md: "text-sm px-2.5 py-0.5",
|
|
438
|
+
lg: "text-sm px-3 py-1"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
defaultVariants: {
|
|
442
|
+
intent: "default",
|
|
443
|
+
size: "md"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
var dotColorVariants = {
|
|
448
|
+
default: "bg-gray-600",
|
|
449
|
+
success: "bg-success-600",
|
|
450
|
+
warning: "bg-warning-600",
|
|
451
|
+
error: "bg-error-600",
|
|
452
|
+
primary: "bg-primary-600",
|
|
453
|
+
bluegray: "bg-bluegray-500",
|
|
454
|
+
bluelight: "bg-bluelight-600",
|
|
455
|
+
violet: "bg-violet-700",
|
|
456
|
+
indigo: "bg-indigo-700",
|
|
457
|
+
purple: "bg-purple-700",
|
|
458
|
+
pink: "bg-pink-700",
|
|
459
|
+
rose: "bg-rose-600",
|
|
460
|
+
orange: "bg-orange-600"
|
|
461
|
+
};
|
|
462
|
+
var Chip = ({
|
|
463
|
+
children,
|
|
464
|
+
className,
|
|
465
|
+
size,
|
|
466
|
+
intent = "default",
|
|
467
|
+
dot,
|
|
468
|
+
dotColor
|
|
469
|
+
}) => {
|
|
470
|
+
const resolvedIntent = intent ?? "default";
|
|
471
|
+
return /* @__PURE__ */ React8.createElement("div", { className: cn(chipVariants({ intent: resolvedIntent, size }), className) }, dot && /* @__PURE__ */ React8.createElement(
|
|
472
|
+
"span",
|
|
473
|
+
{
|
|
474
|
+
className: cn(
|
|
475
|
+
"w-1.5 h-1.5 rounded-full",
|
|
476
|
+
dotColor || dotColorVariants[resolvedIntent] || "bg-primary-600"
|
|
477
|
+
// Default fallback
|
|
478
|
+
)
|
|
479
|
+
}
|
|
480
|
+
), /* @__PURE__ */ React8.createElement("span", null, children));
|
|
481
|
+
};
|
|
482
|
+
var Chip_default = Chip;
|
|
483
|
+
|
|
484
|
+
// app/components/CircularProgress.tsx
|
|
485
|
+
var CircularProgressBar = ({
|
|
486
|
+
percentage,
|
|
487
|
+
size = 160,
|
|
488
|
+
strokeWidth = 8,
|
|
489
|
+
text,
|
|
490
|
+
textClassName
|
|
491
|
+
}) => {
|
|
492
|
+
const radius = (size - strokeWidth) / 2;
|
|
493
|
+
const viewBox = `0 0 ${size} ${size}`;
|
|
494
|
+
const dashArray = radius * Math.PI * 2;
|
|
495
|
+
const dashOffset = dashArray - dashArray * (percentage || 0) / 100;
|
|
496
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox }, /* @__PURE__ */ React.createElement(
|
|
497
|
+
"circle",
|
|
498
|
+
{
|
|
499
|
+
className: "fill-none stroke-gray-200",
|
|
500
|
+
cx: size / 2,
|
|
501
|
+
cy: size / 2,
|
|
502
|
+
r: radius,
|
|
503
|
+
strokeWidth: `${strokeWidth}px`
|
|
504
|
+
}
|
|
505
|
+
), /* @__PURE__ */ React.createElement(
|
|
506
|
+
"circle",
|
|
507
|
+
{
|
|
508
|
+
className: "fill-none stroke-primary-600 transition-all delay-200 ease-in",
|
|
509
|
+
cx: size / 2,
|
|
510
|
+
cy: size / 2,
|
|
511
|
+
r: radius,
|
|
512
|
+
strokeLinecap: "round",
|
|
513
|
+
strokeWidth: `${strokeWidth}px`,
|
|
514
|
+
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
515
|
+
style: {
|
|
516
|
+
strokeDasharray: dashArray,
|
|
517
|
+
strokeDashoffset: dashOffset
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
), /* @__PURE__ */ React.createElement(
|
|
521
|
+
"text",
|
|
522
|
+
{
|
|
523
|
+
x: "50%",
|
|
524
|
+
y: "50%",
|
|
525
|
+
dy: ".3em",
|
|
526
|
+
textAnchor: "middle",
|
|
527
|
+
fill: "currentColor",
|
|
528
|
+
className: cn(textClassName)
|
|
529
|
+
},
|
|
530
|
+
text
|
|
531
|
+
));
|
|
532
|
+
};
|
|
533
|
+
var CircularProgress_default = CircularProgressBar;
|
|
534
|
+
|
|
535
|
+
// app/components/Divider.tsx
|
|
536
|
+
import React9 from "react";
|
|
537
|
+
var Divider = ({
|
|
538
|
+
width,
|
|
539
|
+
height,
|
|
540
|
+
position = "horizontal",
|
|
541
|
+
className
|
|
542
|
+
}) => {
|
|
543
|
+
return /* @__PURE__ */ React9.createElement(
|
|
544
|
+
"div",
|
|
545
|
+
{
|
|
546
|
+
style: {
|
|
547
|
+
width,
|
|
548
|
+
height
|
|
549
|
+
},
|
|
550
|
+
className: cn(
|
|
551
|
+
`bg-gray-200`,
|
|
552
|
+
position === "horizontal" ? "w-full h-[1px]" : "w-[1px] h-full",
|
|
553
|
+
className
|
|
554
|
+
)
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
var Divider_default = Divider;
|
|
559
|
+
|
|
560
|
+
// app/components/Dropdown.tsx
|
|
561
|
+
import React13, {
|
|
562
|
+
useEffect,
|
|
563
|
+
useState as useState2,
|
|
564
|
+
useMemo,
|
|
565
|
+
useCallback,
|
|
566
|
+
forwardRef as forwardRef5,
|
|
567
|
+
useRef,
|
|
568
|
+
useImperativeHandle
|
|
569
|
+
} from "react";
|
|
570
|
+
import {
|
|
571
|
+
RiArrowDownSLine as RiArrowDownSLine2,
|
|
572
|
+
RiSearchLine,
|
|
573
|
+
RiErrorWarningLine
|
|
574
|
+
} from "@remixicon/react";
|
|
575
|
+
|
|
576
|
+
// app/components/Input.tsx
|
|
577
|
+
import React10, { forwardRef as forwardRef4 } from "react";
|
|
578
|
+
var Input = forwardRef4(
|
|
579
|
+
({ size, startIcon, endIcon, className, type, disabled, ...props }, ref) => {
|
|
580
|
+
return /* @__PURE__ */ React10.createElement(
|
|
581
|
+
"div",
|
|
582
|
+
{
|
|
583
|
+
className: cn(
|
|
584
|
+
"group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-xs 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",
|
|
585
|
+
size === "sm" ? "w-[320px] h-10" : size === "lg" ? "w-[313px] h-11" : "w-full h-10",
|
|
586
|
+
className
|
|
587
|
+
)
|
|
588
|
+
},
|
|
589
|
+
/* @__PURE__ */ React10.createElement(
|
|
590
|
+
"span",
|
|
591
|
+
{
|
|
592
|
+
className: cn(
|
|
593
|
+
startIcon ? "group-hover:text-gray-600 group-focus-within:text-gray-600" : "hidden",
|
|
594
|
+
disabled === true && "text-gray-900"
|
|
595
|
+
)
|
|
596
|
+
},
|
|
597
|
+
startIcon
|
|
598
|
+
),
|
|
599
|
+
/* @__PURE__ */ React10.createElement(
|
|
600
|
+
"input",
|
|
601
|
+
{
|
|
602
|
+
...props,
|
|
603
|
+
ref,
|
|
604
|
+
disabled,
|
|
605
|
+
type,
|
|
606
|
+
className: cn(
|
|
607
|
+
"w-full text-sm focus:outline-none bg-transparent disabled:text-gray-900 placeholder:text-gray-500 group-hover:placeholder:text-gray-500",
|
|
608
|
+
size
|
|
609
|
+
)
|
|
610
|
+
}
|
|
611
|
+
),
|
|
612
|
+
/* @__PURE__ */ React10.createElement(
|
|
613
|
+
"span",
|
|
614
|
+
{
|
|
615
|
+
className: cn(
|
|
616
|
+
endIcon ? "group-hover:text-gray-600 group-focus-within:text-gray-600" : "hidden",
|
|
617
|
+
disabled === true && "text-gray-900"
|
|
618
|
+
)
|
|
619
|
+
},
|
|
620
|
+
endIcon
|
|
621
|
+
)
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
);
|
|
625
|
+
Input.displayName = "Input";
|
|
626
|
+
var Input_default = Input;
|
|
627
|
+
|
|
628
|
+
// app/components/Label.tsx
|
|
629
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
630
|
+
import React11 from "react";
|
|
631
|
+
var labelVariants = cva4("flex item-start", {
|
|
632
|
+
variants: {
|
|
633
|
+
size: {
|
|
634
|
+
sm: "text-xs",
|
|
635
|
+
md: "text-sm",
|
|
636
|
+
lg: "text-base"
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
defaultVariants: {
|
|
640
|
+
size: "md"
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
var Label = ({
|
|
644
|
+
children,
|
|
645
|
+
htmlFor,
|
|
646
|
+
size,
|
|
647
|
+
required,
|
|
648
|
+
disabled,
|
|
649
|
+
className,
|
|
650
|
+
...props
|
|
651
|
+
}) => {
|
|
652
|
+
return /* @__PURE__ */ React11.createElement(
|
|
653
|
+
"label",
|
|
654
|
+
{
|
|
655
|
+
htmlFor,
|
|
656
|
+
className: cn("cursor-pointer", labelVariants({ className, size }), disabled === true ? "opacity-30 select-none" : "opacity-100"),
|
|
657
|
+
...props
|
|
658
|
+
},
|
|
659
|
+
children,
|
|
660
|
+
/* @__PURE__ */ React11.createElement("span", { className: cn(required === true ? "block text-red-500" : "hidden") }, "*")
|
|
661
|
+
);
|
|
662
|
+
};
|
|
663
|
+
var Label_default = Label;
|
|
664
|
+
|
|
665
|
+
// app/components/Tooltip.tsx
|
|
666
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
667
|
+
import React12 from "react";
|
|
668
|
+
var tooltipVariants = cva5(
|
|
669
|
+
"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]",
|
|
670
|
+
{
|
|
671
|
+
variants: {
|
|
672
|
+
position: {
|
|
673
|
+
top: "bottom-[calc(100%+0px)] group-hover:translate-y-0 delay-1000 translate-y-[-10px]",
|
|
674
|
+
right: "top-1/2 -translate-y-1/2 left-[calc(100%+0px)] group-hover:translate-x-0 translate-x-[-10px]",
|
|
675
|
+
bottom: "top-[calc(100%+0px)] group-hover:translate-y-0 translate-y-[10px]",
|
|
676
|
+
left: "top-1/2 -translate-y-1/2 right-[calc(100%+0px)] group-hover:translate-x-0 translate-x-[10px]"
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
);
|
|
681
|
+
var Tooltip = ({
|
|
682
|
+
position,
|
|
683
|
+
content,
|
|
684
|
+
children,
|
|
685
|
+
className,
|
|
686
|
+
...props
|
|
687
|
+
}) => {
|
|
688
|
+
return /* @__PURE__ */ React12.createElement("div", { ...props, className: "relative cursor-pointer text-sm group" }, /* @__PURE__ */ React12.createElement("div", null, children), /* @__PURE__ */ React12.createElement("span", { className: cn(tooltipVariants({ position }), className) }, content));
|
|
689
|
+
};
|
|
690
|
+
var Tooltip_default = Tooltip;
|
|
691
|
+
|
|
692
|
+
// app/components/Dropdown.tsx
|
|
693
|
+
var defaultRenderItem = (option) => {
|
|
694
|
+
return /* @__PURE__ */ React13.createElement(MenuItem, { label: option.label, value: option.value });
|
|
695
|
+
};
|
|
696
|
+
var Dropdown = forwardRef5(
|
|
697
|
+
({
|
|
698
|
+
options,
|
|
699
|
+
selected,
|
|
700
|
+
setSelected,
|
|
701
|
+
search = false,
|
|
702
|
+
multiple = false,
|
|
703
|
+
dropdownText = "Select",
|
|
704
|
+
renderItem = defaultRenderItem,
|
|
705
|
+
children,
|
|
706
|
+
icon,
|
|
707
|
+
position = "top",
|
|
708
|
+
width,
|
|
709
|
+
info,
|
|
710
|
+
dropDownTooltip = false,
|
|
711
|
+
dropdownFooter = false,
|
|
712
|
+
onApply,
|
|
713
|
+
disabled = false,
|
|
714
|
+
onReset
|
|
715
|
+
}, ref) => {
|
|
716
|
+
var _a, _b;
|
|
717
|
+
const [searchQuery, setSearchQuery] = useState2("");
|
|
718
|
+
const [filteredOptions, setFilteredOptions] = useState2(
|
|
719
|
+
options || []
|
|
720
|
+
);
|
|
721
|
+
const [dropdownMenu, setDropdownMenu] = useState2(false);
|
|
722
|
+
const dropdownRef = useRef(null);
|
|
723
|
+
useImperativeHandle(ref, () => dropdownRef.current);
|
|
724
|
+
useEffect(() => {
|
|
725
|
+
if (options) {
|
|
726
|
+
setFilteredOptions(options);
|
|
727
|
+
}
|
|
728
|
+
}, [options]);
|
|
729
|
+
const memoizedFilteredOptions = useMemo(() => {
|
|
730
|
+
if (!search)
|
|
731
|
+
return filteredOptions;
|
|
732
|
+
return filteredOptions.filter(
|
|
733
|
+
(option) => option.label.toLowerCase().includes(searchQuery.toLowerCase())
|
|
734
|
+
);
|
|
735
|
+
}, [search, searchQuery, filteredOptions]);
|
|
736
|
+
const handleSearchChange = useCallback(
|
|
737
|
+
(e) => {
|
|
738
|
+
setSearchQuery(e.target.value);
|
|
739
|
+
},
|
|
740
|
+
[]
|
|
741
|
+
);
|
|
742
|
+
const toggleOption = useCallback(
|
|
743
|
+
(option) => {
|
|
744
|
+
if (multiple && setSelected) {
|
|
745
|
+
setSelected(
|
|
746
|
+
(prevSelected) => prevSelected.some((item) => item.value === option.value) ? prevSelected.filter((item) => item.value !== option.value) : [...prevSelected, option]
|
|
747
|
+
);
|
|
748
|
+
} else if (setSelected) {
|
|
749
|
+
setSelected([option]);
|
|
750
|
+
setDropdownMenu(false);
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
[multiple, setSelected]
|
|
754
|
+
);
|
|
755
|
+
const handleCheckboxChange = useCallback(
|
|
756
|
+
(option) => {
|
|
757
|
+
if (multiple && setSelected) {
|
|
758
|
+
setSelected(
|
|
759
|
+
(prevSelected) => prevSelected.some((item) => item.value === option.value) ? prevSelected.filter((item) => item.value !== option.value) : [...prevSelected, option]
|
|
760
|
+
);
|
|
761
|
+
} else if (setSelected) {
|
|
762
|
+
setSelected([option]);
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
[multiple, setSelected]
|
|
766
|
+
);
|
|
767
|
+
const handleSelectAll = () => {
|
|
768
|
+
if ((selected == null ? void 0 : selected.length) === filteredOptions.length) {
|
|
769
|
+
setSelected == null ? void 0 : setSelected([]);
|
|
770
|
+
} else {
|
|
771
|
+
setSelected == null ? void 0 : setSelected(filteredOptions);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
const handleReset = () => {
|
|
775
|
+
if (onReset) {
|
|
776
|
+
onReset();
|
|
777
|
+
}
|
|
778
|
+
setSelected == null ? void 0 : setSelected([]);
|
|
779
|
+
setDropdownMenu(false);
|
|
780
|
+
};
|
|
781
|
+
useEffect(() => {
|
|
782
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
783
|
+
return () => {
|
|
784
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
785
|
+
};
|
|
786
|
+
}, []);
|
|
787
|
+
const handleClickOutside = (event) => {
|
|
788
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
789
|
+
setDropdownMenu(false);
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
return /* @__PURE__ */ React13.createElement(
|
|
793
|
+
"div",
|
|
794
|
+
{
|
|
795
|
+
ref: dropdownRef,
|
|
796
|
+
className: cn(
|
|
797
|
+
"relative ",
|
|
798
|
+
!width && "w-full",
|
|
799
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
800
|
+
),
|
|
801
|
+
style: {
|
|
802
|
+
width
|
|
803
|
+
}
|
|
804
|
+
},
|
|
805
|
+
/* @__PURE__ */ React13.createElement(
|
|
806
|
+
"div",
|
|
807
|
+
{
|
|
808
|
+
onClick: () => !disabled && setDropdownMenu((prev) => !prev),
|
|
809
|
+
className: cn(
|
|
810
|
+
"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",
|
|
811
|
+
dropdownMenu ? "border border-gray-800" : "border border-gray-200",
|
|
812
|
+
disabled && "bg-gray-300 hover:bg-gray-300 cursor-not-allowed"
|
|
813
|
+
)
|
|
814
|
+
},
|
|
815
|
+
/* @__PURE__ */ React13.createElement(
|
|
816
|
+
"section",
|
|
817
|
+
{
|
|
818
|
+
className: cn(
|
|
819
|
+
"flex items-center gap-2 text-ellipsis overflow-hidden"
|
|
820
|
+
)
|
|
821
|
+
},
|
|
822
|
+
icon && /* @__PURE__ */ React13.createElement("span", null, icon),
|
|
823
|
+
/* @__PURE__ */ React13.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)
|
|
824
|
+
),
|
|
825
|
+
/* @__PURE__ */ React13.createElement(RiArrowDownSLine2, { size: 18 })
|
|
826
|
+
),
|
|
827
|
+
/* @__PURE__ */ React13.createElement(
|
|
828
|
+
"ul",
|
|
829
|
+
{
|
|
830
|
+
className: cn(
|
|
831
|
+
"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",
|
|
832
|
+
position === "top" ? "top-10" : "bottom-10",
|
|
833
|
+
dropdownMenu && "max-h-[320px] opacity-[1] transition-all ease-in duration-150"
|
|
834
|
+
)
|
|
835
|
+
},
|
|
836
|
+
search && /* @__PURE__ */ React13.createElement(
|
|
837
|
+
Input_default,
|
|
838
|
+
{
|
|
839
|
+
type: "text",
|
|
840
|
+
placeholder: "Search...",
|
|
841
|
+
value: searchQuery,
|
|
842
|
+
onChange: handleSearchChange,
|
|
843
|
+
className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3",
|
|
844
|
+
endIcon: /* @__PURE__ */ React13.createElement(RiSearchLine, { size: 18 })
|
|
845
|
+
}
|
|
846
|
+
),
|
|
847
|
+
multiple && /* @__PURE__ */ React13.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ React13.createElement(
|
|
848
|
+
"p",
|
|
849
|
+
{
|
|
850
|
+
onClick: handleSelectAll,
|
|
851
|
+
className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
|
|
852
|
+
},
|
|
853
|
+
"Select all"
|
|
854
|
+
), /* @__PURE__ */ React13.createElement(
|
|
855
|
+
"button",
|
|
856
|
+
{
|
|
857
|
+
className: "text-text-sm text-warning-500 hover:text-warning-600",
|
|
858
|
+
onClick: handleReset
|
|
859
|
+
},
|
|
860
|
+
"Reset"
|
|
861
|
+
)),
|
|
862
|
+
/* @__PURE__ */ React13.createElement("section", { className: "max-h-[200px] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll" }, options ? memoizedFilteredOptions.map((option, i) => {
|
|
863
|
+
var _a2;
|
|
864
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, { key: i }, multiple ? /* @__PURE__ */ React13.createElement(
|
|
865
|
+
Label_default,
|
|
866
|
+
{
|
|
867
|
+
className: "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",
|
|
868
|
+
htmlFor: `checkbox-${option.value}`,
|
|
869
|
+
key: i
|
|
870
|
+
},
|
|
871
|
+
/* @__PURE__ */ React13.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ React13.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React13.createElement(
|
|
872
|
+
Checkbox_default,
|
|
873
|
+
{
|
|
874
|
+
id: `checkbox-${option.value}`,
|
|
875
|
+
checked: (selected == null ? void 0 : selected.some(
|
|
876
|
+
(item) => item.value === option.value
|
|
877
|
+
)) ?? false,
|
|
878
|
+
onChange: () => handleCheckboxChange(option)
|
|
879
|
+
}
|
|
880
|
+
), /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React13.createElement("span", null, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React13.createElement(
|
|
881
|
+
DropdownTooltip,
|
|
882
|
+
{
|
|
883
|
+
tooltipContent: option == null ? void 0 : option.tooltipContent
|
|
884
|
+
}
|
|
885
|
+
))), /* @__PURE__ */ React13.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
|
|
886
|
+
/* @__PURE__ */ React13.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
|
|
887
|
+
) : /* @__PURE__ */ React13.createElement(
|
|
888
|
+
Label_default,
|
|
889
|
+
{
|
|
890
|
+
key: i,
|
|
891
|
+
className: cn(
|
|
892
|
+
"flex justify-between py-[6px] px-[14px] hover:bg-gray-50 gap-2 items-center border-l-4 border-transparent cursor-pointer",
|
|
893
|
+
{
|
|
894
|
+
"bg-primary-50 border-primary-600": selected && ((_a2 = selected[0]) == null ? void 0 : _a2.value) === option.value
|
|
895
|
+
}
|
|
896
|
+
),
|
|
897
|
+
onClick: () => toggleOption(option)
|
|
898
|
+
},
|
|
899
|
+
/* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React13.createElement("span", null, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React13.createElement(
|
|
900
|
+
DropdownTooltip,
|
|
901
|
+
{
|
|
902
|
+
tooltipContent: option == null ? void 0 : option.tooltipContent
|
|
903
|
+
}
|
|
904
|
+
)),
|
|
905
|
+
/* @__PURE__ */ React13.createElement("span", { className: "text-gray-500" }, info)
|
|
906
|
+
));
|
|
907
|
+
}) : children),
|
|
908
|
+
dropdownFooter && /* @__PURE__ */ React13.createElement(
|
|
909
|
+
DropdownFooter,
|
|
910
|
+
{
|
|
911
|
+
setDropdownMenu,
|
|
912
|
+
onApply
|
|
913
|
+
}
|
|
914
|
+
)
|
|
915
|
+
)
|
|
916
|
+
);
|
|
917
|
+
}
|
|
918
|
+
);
|
|
919
|
+
var MenuItem = ({ label, children }) => {
|
|
920
|
+
return /* @__PURE__ */ React13.createElement("p", { className: "break-all" }, label || children);
|
|
921
|
+
};
|
|
922
|
+
var DropdownTooltip = ({
|
|
923
|
+
tooltipContent
|
|
924
|
+
}) => {
|
|
925
|
+
const content = tooltipContent || "";
|
|
926
|
+
return content ? /* @__PURE__ */ React13.createElement(Tooltip_default, { position: "right", content }, /* @__PURE__ */ React13.createElement(RiErrorWarningLine, { color: "#98A2B3", size: 14 })) : null;
|
|
927
|
+
};
|
|
928
|
+
var DropdownFooter = ({
|
|
929
|
+
// onReset,
|
|
930
|
+
onApply,
|
|
931
|
+
setDropdownMenu
|
|
932
|
+
}) => {
|
|
933
|
+
return /* @__PURE__ */ React13.createElement("div", { className: "flex justify-end border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ React13.createElement(
|
|
934
|
+
"button",
|
|
935
|
+
{
|
|
936
|
+
className: "text-primary-600 hover:text-primary-700",
|
|
937
|
+
onClick: () => {
|
|
938
|
+
if (onApply) {
|
|
939
|
+
onApply();
|
|
940
|
+
}
|
|
941
|
+
setDropdownMenu(false);
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
"Apply"
|
|
945
|
+
));
|
|
946
|
+
};
|
|
947
|
+
Dropdown.displayName = "Dropdown";
|
|
948
|
+
var Dropdown_default = Dropdown;
|
|
949
|
+
|
|
950
|
+
// app/components/DropdownWithIcon.tsx
|
|
951
|
+
import React14, {
|
|
952
|
+
useEffect as useEffect2,
|
|
953
|
+
useState as useState3,
|
|
954
|
+
useMemo as useMemo2,
|
|
955
|
+
forwardRef as forwardRef6,
|
|
956
|
+
useCallback as useCallback2,
|
|
957
|
+
useRef as useRef2,
|
|
958
|
+
useImperativeHandle as useImperativeHandle2
|
|
959
|
+
} from "react";
|
|
960
|
+
import { RiErrorWarningLine as RiErrorWarningLine2, RiSearchLine as RiSearchLine2 } from "@remixicon/react";
|
|
961
|
+
var defaultRenderItem2 = (option) => {
|
|
962
|
+
return /* @__PURE__ */ React14.createElement(MenuItem2, { label: option.label, value: option.value });
|
|
963
|
+
};
|
|
964
|
+
var DropdownWithIcon = forwardRef6(
|
|
965
|
+
({
|
|
966
|
+
options,
|
|
967
|
+
selected = [],
|
|
968
|
+
setSelected,
|
|
969
|
+
search = false,
|
|
970
|
+
multiple = false,
|
|
971
|
+
renderItem = defaultRenderItem2,
|
|
972
|
+
children,
|
|
973
|
+
trigger,
|
|
974
|
+
// dropdownMenu = false,
|
|
975
|
+
position = "top",
|
|
976
|
+
// setDropdownMenu = () => {},
|
|
977
|
+
width,
|
|
978
|
+
info,
|
|
979
|
+
dropDownTooltip = false,
|
|
980
|
+
dropdownFooter = false,
|
|
981
|
+
onApply,
|
|
982
|
+
disabled = false,
|
|
983
|
+
onReset
|
|
984
|
+
}, ref) => {
|
|
985
|
+
const [searchQuery, setSearchQuery] = useState3("");
|
|
986
|
+
const localDropdownRef = useRef2(null);
|
|
987
|
+
const [dropdownMenu, setDropdownMenu] = useState3(false);
|
|
988
|
+
useImperativeHandle2(ref, () => localDropdownRef.current);
|
|
989
|
+
const memoizedFilteredOptions = useMemo2(() => {
|
|
990
|
+
if (!search)
|
|
991
|
+
return options;
|
|
992
|
+
return options == null ? void 0 : options.filter(
|
|
993
|
+
(option) => {
|
|
994
|
+
var _a, _b;
|
|
995
|
+
return typeof (option == null ? void 0 : option.label) === "string" && ((_b = (_a = option == null ? void 0 : option.label) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes(searchQuery == null ? void 0 : searchQuery.toLowerCase()));
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
}, [search, searchQuery, options]);
|
|
999
|
+
const handleSearchChange = useCallback2(
|
|
1000
|
+
(e) => {
|
|
1001
|
+
var _a;
|
|
1002
|
+
setSearchQuery((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
1003
|
+
},
|
|
1004
|
+
[]
|
|
1005
|
+
);
|
|
1006
|
+
const toggleOption = useCallback2(
|
|
1007
|
+
(option) => {
|
|
1008
|
+
if (multiple && setSelected) {
|
|
1009
|
+
setSelected(
|
|
1010
|
+
(prevSelected) => (prevSelected == null ? void 0 : prevSelected.some((item) => (item == null ? void 0 : item.value) === (option == null ? void 0 : option.value))) ? prevSelected == null ? void 0 : prevSelected.filter((item) => (item == null ? void 0 : item.value) !== (option == null ? void 0 : option.value)) : [...prevSelected, option]
|
|
1011
|
+
);
|
|
1012
|
+
} else if (setSelected) {
|
|
1013
|
+
setSelected([option]);
|
|
1014
|
+
setDropdownMenu(false);
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
[multiple, setSelected, setDropdownMenu]
|
|
1018
|
+
);
|
|
1019
|
+
const handleCheckboxChange = useCallback2(
|
|
1020
|
+
(option) => {
|
|
1021
|
+
if (multiple && setSelected) {
|
|
1022
|
+
setSelected(
|
|
1023
|
+
(prevSelected) => (prevSelected == null ? void 0 : prevSelected.some((item) => (item == null ? void 0 : item.value) === (option == null ? void 0 : option.value))) ? prevSelected == null ? void 0 : prevSelected.filter((item) => (item == null ? void 0 : item.value) !== (option == null ? void 0 : option.value)) : [...prevSelected, option]
|
|
1024
|
+
);
|
|
1025
|
+
} else if (setSelected) {
|
|
1026
|
+
setSelected([option]);
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
[multiple, setSelected]
|
|
1030
|
+
);
|
|
1031
|
+
const handleSelectAll = () => {
|
|
1032
|
+
if ((selected == null ? void 0 : selected.length) === (options == null ? void 0 : options.length)) {
|
|
1033
|
+
setSelected == null ? void 0 : setSelected([]);
|
|
1034
|
+
} else {
|
|
1035
|
+
setSelected == null ? void 0 : setSelected(options);
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
const handleReset = () => {
|
|
1039
|
+
if (onReset) {
|
|
1040
|
+
onReset();
|
|
1041
|
+
}
|
|
1042
|
+
setSelected == null ? void 0 : setSelected([]);
|
|
1043
|
+
setDropdownMenu(false);
|
|
1044
|
+
};
|
|
1045
|
+
useEffect2(() => {
|
|
1046
|
+
const handleClickOutside = (event) => {
|
|
1047
|
+
var _a;
|
|
1048
|
+
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))) {
|
|
1049
|
+
setDropdownMenu(false);
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
document == null ? void 0 : document.addEventListener("mousedown", handleClickOutside);
|
|
1053
|
+
return () => {
|
|
1054
|
+
document == null ? void 0 : document.removeEventListener("mousedown", handleClickOutside);
|
|
1055
|
+
};
|
|
1056
|
+
}, [setDropdownMenu]);
|
|
1057
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1058
|
+
"div",
|
|
1059
|
+
{
|
|
1060
|
+
ref: localDropdownRef,
|
|
1061
|
+
className: cn(
|
|
1062
|
+
"relative",
|
|
1063
|
+
!width && "w-full",
|
|
1064
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
1065
|
+
),
|
|
1066
|
+
style: {
|
|
1067
|
+
width
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
/* @__PURE__ */ React14.createElement("div", { onClick: () => !disabled && setDropdownMenu((prev) => !prev) }, trigger),
|
|
1071
|
+
/* @__PURE__ */ React14.createElement(
|
|
1072
|
+
"ul",
|
|
1073
|
+
{
|
|
1074
|
+
className: cn(
|
|
1075
|
+
"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",
|
|
1076
|
+
position === "top" ? "top-10" : position === "bottom" ? "bottom-10" : position === "left" ? "left-0" : position === "right" ? "right-[90%]" : "top-10",
|
|
1077
|
+
dropdownMenu && "max-h-[320px] opacity-[1] transition-all ease-in duration-150"
|
|
1078
|
+
),
|
|
1079
|
+
style: {
|
|
1080
|
+
width,
|
|
1081
|
+
minWidth: "200px",
|
|
1082
|
+
top: "calc(100% + 4px)"
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
search && /* @__PURE__ */ React14.createElement(
|
|
1086
|
+
Input_default,
|
|
1087
|
+
{
|
|
1088
|
+
type: "text",
|
|
1089
|
+
placeholder: "Search...",
|
|
1090
|
+
value: searchQuery,
|
|
1091
|
+
onChange: handleSearchChange,
|
|
1092
|
+
className: "rounded rounded-b-none text-gray-800 bg-white w-full h-[35px] pl-3",
|
|
1093
|
+
endIcon: /* @__PURE__ */ React14.createElement(RiSearchLine2, { size: 18 })
|
|
1094
|
+
}
|
|
1095
|
+
),
|
|
1096
|
+
multiple && /* @__PURE__ */ React14.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ React14.createElement(
|
|
1097
|
+
"p",
|
|
1098
|
+
{
|
|
1099
|
+
onClick: handleSelectAll,
|
|
1100
|
+
className: "text-text-sm hover:text-primary-700 text-primary-600 cursor-pointer"
|
|
1101
|
+
},
|
|
1102
|
+
"Select all"
|
|
1103
|
+
), /* @__PURE__ */ React14.createElement(
|
|
1104
|
+
"button",
|
|
1105
|
+
{
|
|
1106
|
+
className: "text-text-sm text-warning-500 hover:text-warning-600",
|
|
1107
|
+
onClick: handleReset
|
|
1108
|
+
},
|
|
1109
|
+
"Reset"
|
|
1110
|
+
)),
|
|
1111
|
+
/* @__PURE__ */ React14.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) => {
|
|
1112
|
+
var _a;
|
|
1113
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: i }, multiple ? /* @__PURE__ */ React14.createElement(
|
|
1114
|
+
Label_default,
|
|
1115
|
+
{
|
|
1116
|
+
className: "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",
|
|
1117
|
+
htmlFor: `checkbox-${option == null ? void 0 : option.value}`,
|
|
1118
|
+
key: i
|
|
1119
|
+
},
|
|
1120
|
+
/* @__PURE__ */ React14.createElement("section", { className: "flex items-center justify-between gap-2 w-full" }, /* @__PURE__ */ React14.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React14.createElement(
|
|
1121
|
+
Checkbox_default,
|
|
1122
|
+
{
|
|
1123
|
+
id: `checkbox-${option == null ? void 0 : option.value}`,
|
|
1124
|
+
checked: selected == null ? void 0 : selected.some(
|
|
1125
|
+
(item) => (item == null ? void 0 : item.value) === (option == null ? void 0 : option.value)
|
|
1126
|
+
),
|
|
1127
|
+
onChange: () => handleCheckboxChange(option)
|
|
1128
|
+
}
|
|
1129
|
+
), /* @__PURE__ */ React14.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React14.createElement("div", { className: "break-words" }, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React14.createElement(
|
|
1130
|
+
DropdownTooltip2,
|
|
1131
|
+
{
|
|
1132
|
+
tooltipContent: option == null ? void 0 : option.tooltipContent
|
|
1133
|
+
}
|
|
1134
|
+
))), /* @__PURE__ */ React14.createElement("span", { className: "text-gray-500" }, option == null ? void 0 : option.info)),
|
|
1135
|
+
/* @__PURE__ */ React14.createElement("span", { className: "pt-[2px] text-text-sm text-gray-500" }, option == null ? void 0 : option.addInfo)
|
|
1136
|
+
) : /* @__PURE__ */ React14.createElement(
|
|
1137
|
+
Label_default,
|
|
1138
|
+
{
|
|
1139
|
+
key: i,
|
|
1140
|
+
className: cn(
|
|
1141
|
+
"flex justify-between py-[6px] px-[14px] hover:bg-gray-50 gap-2 items-center border-l-4 border-transparent cursor-pointer",
|
|
1142
|
+
{
|
|
1143
|
+
"bg-primary-50 border-primary-600": selected && ((_a = selected[0]) == null ? void 0 : _a.value) === (option == null ? void 0 : option.value)
|
|
1144
|
+
}
|
|
1145
|
+
),
|
|
1146
|
+
onClick: () => toggleOption(option)
|
|
1147
|
+
},
|
|
1148
|
+
/* @__PURE__ */ React14.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React14.createElement("span", null, renderItem(option)), dropDownTooltip && /* @__PURE__ */ React14.createElement(
|
|
1149
|
+
DropdownTooltip2,
|
|
1150
|
+
{
|
|
1151
|
+
tooltipContent: option == null ? void 0 : option.tooltipContent
|
|
1152
|
+
}
|
|
1153
|
+
)),
|
|
1154
|
+
/* @__PURE__ */ React14.createElement("span", { className: "text-gray-500" }, info)
|
|
1155
|
+
));
|
|
1156
|
+
}) : children),
|
|
1157
|
+
dropdownFooter && /* @__PURE__ */ React14.createElement(DropdownFooter2, { onApply })
|
|
1158
|
+
)
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1162
|
+
var MenuItem2 = ({ label, children }) => {
|
|
1163
|
+
return /* @__PURE__ */ React14.createElement("p", { className: "break-all" }, label || children);
|
|
1164
|
+
};
|
|
1165
|
+
var DropdownTooltip2 = ({
|
|
1166
|
+
tooltipContent
|
|
1167
|
+
}) => {
|
|
1168
|
+
return tooltipContent ? /* @__PURE__ */ React14.createElement(Tooltip_default, { position: "right", content: tooltipContent }, /* @__PURE__ */ React14.createElement(RiErrorWarningLine2, { color: "#98A2B3", size: 14 })) : null;
|
|
1169
|
+
};
|
|
1170
|
+
var DropdownFooter2 = ({
|
|
1171
|
+
onApply,
|
|
1172
|
+
setDropdownMenu
|
|
1173
|
+
}) => {
|
|
1174
|
+
return /* @__PURE__ */ React14.createElement("div", { className: "flex justify-between border-t border-gray-200 px-[14px] py-[8px] text-text-sm" }, /* @__PURE__ */ React14.createElement(
|
|
1175
|
+
"button",
|
|
1176
|
+
{
|
|
1177
|
+
className: "text-primary-600 hover:text-primary-700",
|
|
1178
|
+
onClick: () => {
|
|
1179
|
+
if (onApply) {
|
|
1180
|
+
onApply();
|
|
1181
|
+
}
|
|
1182
|
+
setDropdownMenu(false);
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
"Apply"
|
|
1186
|
+
));
|
|
1187
|
+
};
|
|
1188
|
+
DropdownWithIcon.displayName = "DropdownWithIcon";
|
|
1189
|
+
var DropdownWithIcon_default = DropdownWithIcon;
|
|
1190
|
+
|
|
1191
|
+
// app/components/FileUpload.tsx
|
|
1192
|
+
import React15, { forwardRef as forwardRef7 } from "react";
|
|
1193
|
+
import {
|
|
1194
|
+
RiFileLine,
|
|
1195
|
+
RiUpload2Line,
|
|
1196
|
+
RiDeleteBinLine,
|
|
1197
|
+
RiMusic2Line,
|
|
1198
|
+
RiVideoLine,
|
|
1199
|
+
RiImageLine,
|
|
1200
|
+
RiFileExcel2Line,
|
|
1201
|
+
RiFileWord2Line,
|
|
1202
|
+
RiFilePpt2Line,
|
|
1203
|
+
RiFileZipLine,
|
|
1204
|
+
RiFilePdf2Line
|
|
1205
|
+
} from "@remixicon/react";
|
|
1206
|
+
var getIconForMimeType = (file) => {
|
|
1207
|
+
var _a;
|
|
1208
|
+
const fileName = typeof file === "string" ? file : file.name;
|
|
1209
|
+
const extension = (_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase();
|
|
1210
|
+
let iconComponent;
|
|
1211
|
+
switch (extension) {
|
|
1212
|
+
case "jpg":
|
|
1213
|
+
case "jpeg":
|
|
1214
|
+
case "png":
|
|
1215
|
+
case "gif":
|
|
1216
|
+
case "svg":
|
|
1217
|
+
case "webp":
|
|
1218
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiImageLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1219
|
+
break;
|
|
1220
|
+
case "mp3":
|
|
1221
|
+
case "wav":
|
|
1222
|
+
case "ogg":
|
|
1223
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiMusic2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1224
|
+
break;
|
|
1225
|
+
case "mp4":
|
|
1226
|
+
case "avi":
|
|
1227
|
+
case "mkv":
|
|
1228
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiVideoLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1229
|
+
break;
|
|
1230
|
+
case "xls":
|
|
1231
|
+
case "xlsx":
|
|
1232
|
+
case "csv":
|
|
1233
|
+
case "txt":
|
|
1234
|
+
case "ods":
|
|
1235
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiFileExcel2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1236
|
+
break;
|
|
1237
|
+
case "doc":
|
|
1238
|
+
case "docx":
|
|
1239
|
+
case "odt":
|
|
1240
|
+
case "xml":
|
|
1241
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiFileWord2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1242
|
+
break;
|
|
1243
|
+
case "pptx":
|
|
1244
|
+
case "pptm":
|
|
1245
|
+
case "xps":
|
|
1246
|
+
case "ppsx":
|
|
1247
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiFilePpt2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1248
|
+
break;
|
|
1249
|
+
case "rar":
|
|
1250
|
+
case "zip":
|
|
1251
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiFileZipLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1252
|
+
break;
|
|
1253
|
+
case "pdf":
|
|
1254
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiFilePdf2Line, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1255
|
+
break;
|
|
1256
|
+
default:
|
|
1257
|
+
iconComponent = /* @__PURE__ */ React15.createElement(RiFileLine, { className: "text-primary-600 bg-primary-100 border-4 border-primary-50 w-8 h-8 p-1 rounded-full" });
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
return iconComponent;
|
|
1261
|
+
};
|
|
1262
|
+
var FileUpload = forwardRef7(
|
|
1263
|
+
({
|
|
1264
|
+
selectedFile,
|
|
1265
|
+
onChange,
|
|
1266
|
+
multiple,
|
|
1267
|
+
onDelete,
|
|
1268
|
+
children,
|
|
1269
|
+
disabled,
|
|
1270
|
+
title,
|
|
1271
|
+
id,
|
|
1272
|
+
className,
|
|
1273
|
+
accept,
|
|
1274
|
+
...props
|
|
1275
|
+
}, ref) => {
|
|
1276
|
+
return /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col gap-2 " }, /* @__PURE__ */ React15.createElement(
|
|
1277
|
+
"input",
|
|
1278
|
+
{
|
|
1279
|
+
type: "file",
|
|
1280
|
+
...props,
|
|
1281
|
+
accept,
|
|
1282
|
+
id,
|
|
1283
|
+
onChange,
|
|
1284
|
+
multiple,
|
|
1285
|
+
disabled,
|
|
1286
|
+
hidden: true,
|
|
1287
|
+
ref
|
|
1288
|
+
}
|
|
1289
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1290
|
+
Label_default,
|
|
1291
|
+
{
|
|
1292
|
+
htmlFor: id,
|
|
1293
|
+
disabled,
|
|
1294
|
+
className: cn(
|
|
1295
|
+
"w-full h-[126px] border-2 border-dashed border-gray-200 hover:bg-gray-200 cursor-pointer rounded-lg px-6 py-4 flex flex-col items-center gap-2",
|
|
1296
|
+
disabled && "pointer-events-none",
|
|
1297
|
+
className
|
|
1298
|
+
)
|
|
1299
|
+
},
|
|
1300
|
+
/* @__PURE__ */ React15.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__ */ React15.createElement(RiUpload2Line, { className: "w-5 h-5" })),
|
|
1301
|
+
/* @__PURE__ */ React15.createElement("p", { className: "text-center text-sm text-gray-600" }, /* @__PURE__ */ React15.createElement("span", { className: "text-primary-600 font-semibold" }, "Click to upload"), " ", /* @__PURE__ */ React15.createElement("br", null), " ", title)
|
|
1302
|
+
), /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col gap-2" }, selectedFile == null ? void 0 : selectedFile.map((file, index) => /* @__PURE__ */ React15.createElement(
|
|
1303
|
+
"div",
|
|
1304
|
+
{
|
|
1305
|
+
key: index,
|
|
1306
|
+
className: "p-4 border border-gray-200 rounded-lg flex items-center justify-between gap-5"
|
|
1307
|
+
},
|
|
1308
|
+
/* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2 w-full" }, getIconForMimeType(file), /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ React15.createElement("p", { className: "text-sm line-clamp-2 break-all" }, typeof file === "string" ? file : file.name, " "), /* @__PURE__ */ React15.createElement("div", { className: "w-full" }, children))),
|
|
1309
|
+
/* @__PURE__ */ React15.createElement(
|
|
1310
|
+
RiDeleteBinLine,
|
|
1311
|
+
{
|
|
1312
|
+
onClick: onDelete,
|
|
1313
|
+
className: "text-gray-500 w-5 h-5 cursor-pointer"
|
|
1314
|
+
}
|
|
1315
|
+
)
|
|
1316
|
+
))));
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1319
|
+
FileUpload.displayName = "FileUpload";
|
|
1320
|
+
var FileUpload_default = FileUpload;
|
|
1321
|
+
|
|
1322
|
+
// app/components/GlobalNavigation.tsx
|
|
1323
|
+
import React16, { useEffect as useEffect3, useRef as useRef3, forwardRef as forwardRef8 } from "react";
|
|
1324
|
+
var GlobalNavigation = forwardRef8(
|
|
1325
|
+
({
|
|
1326
|
+
isOpen,
|
|
1327
|
+
setIsOpen,
|
|
1328
|
+
trigger,
|
|
1329
|
+
children,
|
|
1330
|
+
className,
|
|
1331
|
+
postion = "bottom-right"
|
|
1332
|
+
}, ref) => {
|
|
1333
|
+
const popoverRef = useRef3(null);
|
|
1334
|
+
useEffect3(() => {
|
|
1335
|
+
const handleClickOutside = (event) => {
|
|
1336
|
+
if (popoverRef.current && !popoverRef.current.contains(event.target)) {
|
|
1337
|
+
setIsOpen(false);
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1341
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1342
|
+
}, []);
|
|
1343
|
+
return /* @__PURE__ */ React16.createElement("div", { className: "relative w-max", ref }, /* @__PURE__ */ React16.createElement(
|
|
1344
|
+
"div",
|
|
1345
|
+
{
|
|
1346
|
+
className: "cursor-pointer",
|
|
1347
|
+
ref: popoverRef,
|
|
1348
|
+
onClick: () => setIsOpen(!isOpen)
|
|
1349
|
+
},
|
|
1350
|
+
trigger
|
|
1351
|
+
), isOpen && /* @__PURE__ */ React16.createElement(
|
|
1352
|
+
"div",
|
|
1353
|
+
{
|
|
1354
|
+
className: cn(
|
|
1355
|
+
"absolute z-10 bg-white rounded-lg shadow-sm border min-w-[200px] p-4 transition-all duration-300 ease-in-out",
|
|
1356
|
+
postion === "bottom-left" && "left-0 top-4/4",
|
|
1357
|
+
postion === "bottom-right" && "top-4/4 right-0",
|
|
1358
|
+
postion === "top-left" && "bottom-[57px] left-0",
|
|
1359
|
+
postion === "top-right" && "bottom-[57px] right-0",
|
|
1360
|
+
className
|
|
1361
|
+
)
|
|
1362
|
+
},
|
|
1363
|
+
children
|
|
1364
|
+
));
|
|
1365
|
+
}
|
|
1366
|
+
);
|
|
1367
|
+
GlobalNavigation.displayName = "GlobalNavigation";
|
|
1368
|
+
var GlobalNavigation_default = GlobalNavigation;
|
|
1369
|
+
|
|
1370
|
+
// app/components/HelperText.tsx
|
|
1371
|
+
import React17 from "react";
|
|
1372
|
+
var HelperText = ({ children, className, size, error }) => {
|
|
1373
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1374
|
+
"span",
|
|
1375
|
+
{
|
|
1376
|
+
className: cn(
|
|
1377
|
+
"text-gray-500",
|
|
1378
|
+
error && "text-error-500",
|
|
1379
|
+
className,
|
|
1380
|
+
size === "sm" ? "text-xs" : "text-sm"
|
|
1381
|
+
)
|
|
1382
|
+
},
|
|
1383
|
+
children
|
|
1384
|
+
);
|
|
1385
|
+
};
|
|
1386
|
+
var HelperText_default = HelperText;
|
|
1387
|
+
|
|
1388
|
+
// app/components/ListItem.tsx
|
|
1389
|
+
import Link from "next/link";
|
|
1390
|
+
import React18 from "react";
|
|
1391
|
+
var ListItem = React18.forwardRef(({ className, title, href, onClick, as = "link", icon }, ref) => {
|
|
1392
|
+
if (as === "button") {
|
|
1393
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1394
|
+
"button",
|
|
1395
|
+
{
|
|
1396
|
+
className: cn(
|
|
1397
|
+
"px-4 py-[8px] w-full text-left flex items-center gap-2",
|
|
1398
|
+
className
|
|
1399
|
+
),
|
|
1400
|
+
onClick,
|
|
1401
|
+
ref
|
|
1402
|
+
},
|
|
1403
|
+
/* @__PURE__ */ React18.createElement("h1", null, title),
|
|
1404
|
+
icon && /* @__PURE__ */ React18.createElement("span", null, icon)
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1408
|
+
Link,
|
|
1409
|
+
{
|
|
1410
|
+
href: href ?? "",
|
|
1411
|
+
passHref: true,
|
|
1412
|
+
className: cn("px-4 py-[8px] w-full flex items-center gap-2", className),
|
|
1413
|
+
ref
|
|
1414
|
+
},
|
|
1415
|
+
/* @__PURE__ */ React18.createElement("h1", null, title),
|
|
1416
|
+
icon && /* @__PURE__ */ React18.createElement("p", null, icon)
|
|
1417
|
+
);
|
|
1418
|
+
});
|
|
1419
|
+
ListItem.displayName = "ListItem";
|
|
1420
|
+
var ListItem_default = ListItem;
|
|
1421
|
+
|
|
1422
|
+
// app/components/Loading.tsx
|
|
1423
|
+
import React19 from "react";
|
|
1424
|
+
var Loading = ({ width, height, loaderColor, variant }) => {
|
|
1425
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1426
|
+
"div",
|
|
1427
|
+
{
|
|
1428
|
+
className: cn(
|
|
1429
|
+
"animate-spin-slow border-primary-600 border-t-gray-200/50 rounded-full",
|
|
1430
|
+
variant === "light" ? "border-2" : "border-4"
|
|
1431
|
+
),
|
|
1432
|
+
style: {
|
|
1433
|
+
width,
|
|
1434
|
+
height,
|
|
1435
|
+
borderColor: loaderColor,
|
|
1436
|
+
borderTopColor: "rgb(234 236 240 / 0.5)"
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1440
|
+
};
|
|
1441
|
+
var Loading_default = Loading;
|
|
1442
|
+
|
|
1443
|
+
// app/components/Modal.tsx
|
|
1444
|
+
import React20, { useEffect as useEffect4 } from "react";
|
|
1445
|
+
import { RiCloseLine } from "@remixicon/react";
|
|
1446
|
+
function Modal({
|
|
1447
|
+
children,
|
|
1448
|
+
showModal,
|
|
1449
|
+
setShowModal,
|
|
1450
|
+
closeModal = true,
|
|
1451
|
+
closeOnOutsideClick = true,
|
|
1452
|
+
className = ""
|
|
1453
|
+
}) {
|
|
1454
|
+
useEffect4(() => {
|
|
1455
|
+
if (showModal) {
|
|
1456
|
+
document.body.style.overflow = "hidden";
|
|
1457
|
+
} else {
|
|
1458
|
+
document.body.style.overflow = "auto";
|
|
1459
|
+
}
|
|
1460
|
+
return () => {
|
|
1461
|
+
document.body.style.overflow = "auto";
|
|
1462
|
+
};
|
|
1463
|
+
}, [showModal]);
|
|
1464
|
+
const handleClickOutside = (event) => {
|
|
1465
|
+
if (event.target === event.currentTarget && closeOnOutsideClick) {
|
|
1466
|
+
setShowModal(false);
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, showModal && /* @__PURE__ */ React20.createElement(
|
|
1470
|
+
"div",
|
|
1471
|
+
{
|
|
1472
|
+
onClick: handleClickOutside,
|
|
1473
|
+
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"
|
|
1474
|
+
},
|
|
1475
|
+
/* @__PURE__ */ React20.createElement(
|
|
1476
|
+
"div",
|
|
1477
|
+
{
|
|
1478
|
+
className: `relative bg-white shadow-boxShadow rounded-xl p-[18px] transition-all duration-150 fade-in-grow w-[50%] mx-4 ${className}`
|
|
1479
|
+
},
|
|
1480
|
+
/* @__PURE__ */ React20.createElement("div", null, children),
|
|
1481
|
+
closeModal && /* @__PURE__ */ React20.createElement(
|
|
1482
|
+
"div",
|
|
1483
|
+
{
|
|
1484
|
+
className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop rounded-full text-primary cursor-pointer hover:bg-primaryLight",
|
|
1485
|
+
onClick: () => setShowModal(false)
|
|
1486
|
+
},
|
|
1487
|
+
/* @__PURE__ */ React20.createElement(RiCloseLine, { size: 24 })
|
|
1488
|
+
)
|
|
1489
|
+
)
|
|
1490
|
+
));
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
// app/components/MenuItem.tsx
|
|
1494
|
+
import React21, { useState as useState4, useRef as useRef4, useEffect as useEffect5 } from "react";
|
|
1495
|
+
import { RiArrowDownSLine as RiArrowDownSLine3, RiArrowUpSLine } from "@remixicon/react";
|
|
1496
|
+
function MenuDropdown({
|
|
1497
|
+
trigger,
|
|
1498
|
+
children,
|
|
1499
|
+
width = "250px",
|
|
1500
|
+
className
|
|
1501
|
+
}) {
|
|
1502
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1503
|
+
const dropdownRef = useRef4(null);
|
|
1504
|
+
useEffect5(() => {
|
|
1505
|
+
const handleClickOutside = (event) => {
|
|
1506
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1507
|
+
setIsOpen(false);
|
|
1508
|
+
}
|
|
1509
|
+
};
|
|
1510
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1511
|
+
return () => {
|
|
1512
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1513
|
+
};
|
|
1514
|
+
}, []);
|
|
1515
|
+
return /* @__PURE__ */ React21.createElement("div", { className: "relative w-full", ref: dropdownRef }, /* @__PURE__ */ React21.createElement(
|
|
1516
|
+
"div",
|
|
1517
|
+
{
|
|
1518
|
+
className: "cursor-pointer",
|
|
1519
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1520
|
+
"aria-label": "Open menu"
|
|
1521
|
+
},
|
|
1522
|
+
trigger
|
|
1523
|
+
), isOpen && /* @__PURE__ */ React21.createElement(
|
|
1524
|
+
"div",
|
|
1525
|
+
{
|
|
1526
|
+
style: { width },
|
|
1527
|
+
className: cn(
|
|
1528
|
+
"border border-gray-200 rounded-lg absolute left-0 mt-1 z-[100000] w-full bg-white shadow-sm",
|
|
1529
|
+
className
|
|
1530
|
+
)
|
|
1531
|
+
},
|
|
1532
|
+
children
|
|
1533
|
+
));
|
|
1534
|
+
}
|
|
1535
|
+
var MenuSubItem = ({
|
|
1536
|
+
label,
|
|
1537
|
+
onClick,
|
|
1538
|
+
disabled,
|
|
1539
|
+
children,
|
|
1540
|
+
className = ""
|
|
1541
|
+
}) => /* @__PURE__ */ React21.createElement(
|
|
1542
|
+
"button",
|
|
1543
|
+
{
|
|
1544
|
+
className: cn(
|
|
1545
|
+
"w-full text-left p-4 text-sm border-y-[0.5px] last:border-y first:rounded-t hover:bg-primary-50 hover:rounded",
|
|
1546
|
+
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
1547
|
+
className
|
|
1548
|
+
),
|
|
1549
|
+
onClick,
|
|
1550
|
+
disabled
|
|
1551
|
+
},
|
|
1552
|
+
label,
|
|
1553
|
+
children && /* @__PURE__ */ React21.createElement(React21.Fragment, null, children)
|
|
1554
|
+
);
|
|
1555
|
+
var MenuItem3 = ({
|
|
1556
|
+
content,
|
|
1557
|
+
children,
|
|
1558
|
+
className = "",
|
|
1559
|
+
sectionClassName = "",
|
|
1560
|
+
menuClassName = ""
|
|
1561
|
+
}) => {
|
|
1562
|
+
const [isSubOpen, setIsSubOpen] = useState4(false);
|
|
1563
|
+
return /* @__PURE__ */ React21.createElement("div", { className: cn("relative", className) }, /* @__PURE__ */ React21.createElement(
|
|
1564
|
+
"section",
|
|
1565
|
+
{
|
|
1566
|
+
onClick: () => setIsSubOpen(!isSubOpen),
|
|
1567
|
+
className: cn(
|
|
1568
|
+
"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",
|
|
1569
|
+
sectionClassName
|
|
1570
|
+
)
|
|
1571
|
+
},
|
|
1572
|
+
content,
|
|
1573
|
+
isSubOpen ? /* @__PURE__ */ React21.createElement(RiArrowUpSLine, { size: 20 }) : /* @__PURE__ */ React21.createElement(RiArrowDownSLine3, { size: 20 })
|
|
1574
|
+
), isSubOpen && /* @__PURE__ */ React21.createElement("div", { className: cn(" border-primary-100 bg-gray-50", menuClassName) }, children));
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
// app/components/Notice.tsx
|
|
1578
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
1579
|
+
import React22 from "react";
|
|
1580
|
+
import {
|
|
1581
|
+
RiAlertFill,
|
|
1582
|
+
RiCloseLine as RiCloseLine2,
|
|
1583
|
+
RiErrorWarningLine as RiErrorWarningLine3,
|
|
1584
|
+
RiQuestionLine,
|
|
1585
|
+
RiThumbUpLine,
|
|
1586
|
+
RiShieldCheckLine
|
|
1587
|
+
} from "@remixicon/react";
|
|
1588
|
+
var VariantIcon = ({ variant }) => {
|
|
1589
|
+
switch (variant) {
|
|
1590
|
+
case "success":
|
|
1591
|
+
return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiThumbUpLine, { size: 20, color: "#039855" }));
|
|
1592
|
+
case "warning":
|
|
1593
|
+
return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiQuestionLine, { color: "#F79009", size: 20 }));
|
|
1594
|
+
case "info":
|
|
1595
|
+
return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiErrorWarningLine3, { color: "#1570EF", size: 20 }));
|
|
1596
|
+
case "error":
|
|
1597
|
+
return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiAlertFill, { color: "#F04438", size: 20 }));
|
|
1598
|
+
default:
|
|
1599
|
+
return /* @__PURE__ */ React22.createElement("span", null, /* @__PURE__ */ React22.createElement(RiShieldCheckLine, { color: "#475467", size: 20 }));
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
var noticeVariants = cva6("p-4 w-fit rounded-[6px]", {
|
|
1603
|
+
variants: {
|
|
1604
|
+
variant: {
|
|
1605
|
+
success: "bg-success-25 border border-success-600",
|
|
1606
|
+
warning: "bg-warning-25 border border-warning-600",
|
|
1607
|
+
info: "bg-primary-25 border border-primary-600",
|
|
1608
|
+
error: "bg-error-25 border border-error-600",
|
|
1609
|
+
default: "bg-gray-25 border border-gray-600"
|
|
1610
|
+
},
|
|
1611
|
+
position: {
|
|
1612
|
+
top: "top-4 transition-all duration-700 m-auto left-0 right-0",
|
|
1613
|
+
bottom: "bottom-4 transition-all duration-700 right-4"
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
var Notice = ({
|
|
1618
|
+
children,
|
|
1619
|
+
variant,
|
|
1620
|
+
position,
|
|
1621
|
+
noticeTitle,
|
|
1622
|
+
open,
|
|
1623
|
+
setOpen,
|
|
1624
|
+
showIcon = true
|
|
1625
|
+
}) => {
|
|
1626
|
+
const handleClose = () => setOpen(false);
|
|
1627
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, open && /* @__PURE__ */ React22.createElement(
|
|
1628
|
+
"div",
|
|
1629
|
+
{
|
|
1630
|
+
className: cn(
|
|
1631
|
+
noticeVariants({ variant, position }),
|
|
1632
|
+
`fixed z-10`,
|
|
1633
|
+
position === "top" && open && `animate-slide-in-top`,
|
|
1634
|
+
position === "bottom" && open && `animate-slide-in-right`
|
|
1635
|
+
)
|
|
1636
|
+
},
|
|
1637
|
+
/* @__PURE__ */ React22.createElement("div", { className: "relative" }, showIcon ? noticeTitle == "" ? /* @__PURE__ */ React22.createElement("div", { className: "flex items-start" }, /* @__PURE__ */ React22.createElement(VariantIcon, { variant }), /* @__PURE__ */ React22.createElement("span", { className: "ml-2 mr-8 text-text-sm" }, children), /* @__PURE__ */ React22.createElement("span", { onClick: handleClose }, /* @__PURE__ */ React22.createElement(RiCloseLine2, { size: 20 }))) : /* @__PURE__ */ React22.createElement("div", { className: "" }, /* @__PURE__ */ React22.createElement("section", { className: "flex items-start" }, /* @__PURE__ */ React22.createElement(VariantIcon, { variant }), /* @__PURE__ */ React22.createElement("div", { className: "ml-2 mr-8 -mt-[3px]" }, /* @__PURE__ */ React22.createElement("span", { className: "font-bold text-gray-800 mb-1" }, noticeTitle), /* @__PURE__ */ React22.createElement("p", { className: "text-text-sm text-gray-700" }, children))), /* @__PURE__ */ React22.createElement(
|
|
1638
|
+
"span",
|
|
1639
|
+
{
|
|
1640
|
+
className: cn("absolute top-0 right-0 cursor-pointer"),
|
|
1641
|
+
onClick: handleClose
|
|
1642
|
+
},
|
|
1643
|
+
/* @__PURE__ */ React22.createElement(RiCloseLine2, { size: 20 })
|
|
1644
|
+
)) : /* @__PURE__ */ React22.createElement("div", { className: "mr-8" }, /* @__PURE__ */ React22.createElement("section", { className: "flex items-center" }, /* @__PURE__ */ React22.createElement("p", { className: "font-bold text-gray-800 mb-1" }, noticeTitle)), /* @__PURE__ */ React22.createElement(
|
|
1645
|
+
"span",
|
|
1646
|
+
{
|
|
1647
|
+
className: cn("absolute top-0 right-0 cursor-pointer"),
|
|
1648
|
+
onClick: handleClose
|
|
1649
|
+
},
|
|
1650
|
+
/* @__PURE__ */ React22.createElement(RiCloseLine2, { size: 20 })
|
|
1651
|
+
), /* @__PURE__ */ React22.createElement("p", { className: "text-text-sm" }, children)))
|
|
1652
|
+
));
|
|
1653
|
+
};
|
|
1654
|
+
var Notice_default = Notice;
|
|
1655
|
+
|
|
1656
|
+
// app/components/Pagination.tsx
|
|
1657
|
+
import React23, { useState as useState5 } from "react";
|
|
1658
|
+
import {
|
|
1659
|
+
RiArrowLeftLine,
|
|
1660
|
+
RiArrowRightLine,
|
|
1661
|
+
RiArrowDownSLine as RiArrowDownSLine4,
|
|
1662
|
+
RiArrowUpSLine as RiArrowUpSLine2
|
|
1663
|
+
} from "@remixicon/react";
|
|
1664
|
+
var Pagination = ({
|
|
1665
|
+
count,
|
|
1666
|
+
page,
|
|
1667
|
+
rowsPerPage,
|
|
1668
|
+
rowsPerPageOptions,
|
|
1669
|
+
onPageChange,
|
|
1670
|
+
onRowsPerPageChange,
|
|
1671
|
+
className
|
|
1672
|
+
}) => {
|
|
1673
|
+
const totalPages = Math.ceil(count / rowsPerPage);
|
|
1674
|
+
const handlePrevPageClick = () => {
|
|
1675
|
+
onPageChange(page - 1);
|
|
1676
|
+
};
|
|
1677
|
+
const handleNextPageClick = () => {
|
|
1678
|
+
onPageChange(page + 1);
|
|
1679
|
+
};
|
|
1680
|
+
const [showOptions, setShowOptions] = useState5(false);
|
|
1681
|
+
const handleOptionClick = (option) => {
|
|
1682
|
+
if (typeof option === "number") {
|
|
1683
|
+
onRowsPerPageChange(option);
|
|
1684
|
+
} else {
|
|
1685
|
+
onRowsPerPageChange(option.value);
|
|
1686
|
+
}
|
|
1687
|
+
setShowOptions(false);
|
|
1688
|
+
};
|
|
1689
|
+
return /* @__PURE__ */ React23.createElement(
|
|
1690
|
+
"div",
|
|
1691
|
+
{
|
|
1692
|
+
className: cn(
|
|
1693
|
+
"border border-gray-200 px-6 py-4 flex justify-between items-center w-full",
|
|
1694
|
+
className
|
|
1695
|
+
)
|
|
1696
|
+
},
|
|
1697
|
+
/* @__PURE__ */ React23.createElement("section", { className: "flex gap-1.5 items-center" }, /* @__PURE__ */ React23.createElement("span", { className: "text-gray-800 text-text-sm font-medium" }, "Items per page"), /* @__PURE__ */ React23.createElement("div", { className: "relative z-[100]" }, /* @__PURE__ */ React23.createElement(
|
|
1698
|
+
"div",
|
|
1699
|
+
{
|
|
1700
|
+
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",
|
|
1701
|
+
onClick: () => setShowOptions(!showOptions)
|
|
1702
|
+
},
|
|
1703
|
+
rowsPerPage,
|
|
1704
|
+
" ",
|
|
1705
|
+
!showOptions ? /* @__PURE__ */ React23.createElement(RiArrowDownSLine4, { size: 14 }) : /* @__PURE__ */ React23.createElement(RiArrowUpSLine2, { size: 14 })
|
|
1706
|
+
), showOptions && /* @__PURE__ */ React23.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__ */ React23.createElement(
|
|
1707
|
+
"div",
|
|
1708
|
+
{
|
|
1709
|
+
key: index,
|
|
1710
|
+
className: "px-2 py-1.5 w-[88px] text-gray-800 cursor-pointer hover:bg-gray-100",
|
|
1711
|
+
onClick: () => handleOptionClick(option)
|
|
1712
|
+
},
|
|
1713
|
+
typeof option === "number" ? option : option.label
|
|
1714
|
+
))))),
|
|
1715
|
+
/* @__PURE__ */ React23.createElement("section", { className: "flex items-center gap-2 font-medium" }, /* @__PURE__ */ React23.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm" }, /* @__PURE__ */ React23.createElement("span", null, "page"), /* @__PURE__ */ React23.createElement(
|
|
1716
|
+
"select",
|
|
1717
|
+
{
|
|
1718
|
+
value: page + 1,
|
|
1719
|
+
onChange: (e) => onPageChange(parseInt(e.target.value, 10) - 1),
|
|
1720
|
+
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"
|
|
1721
|
+
},
|
|
1722
|
+
totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */ React23.createElement("option", { key: index + 1, value: index + 1 }, index + 1))
|
|
1723
|
+
), /* @__PURE__ */ React23.createElement("span", null, "of ", totalPages > 0 ? totalPages : 0)), /* @__PURE__ */ React23.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React23.createElement(
|
|
1724
|
+
Button_default,
|
|
1725
|
+
{
|
|
1726
|
+
variant: "outlined",
|
|
1727
|
+
intent: "default-outlined",
|
|
1728
|
+
startIcon: /* @__PURE__ */ React23.createElement(RiArrowLeftLine, { size: 20 }),
|
|
1729
|
+
onClick: handlePrevPageClick,
|
|
1730
|
+
disabled: page === 0,
|
|
1731
|
+
className: "rounded-none h-8 rounded-l-lg"
|
|
1732
|
+
}
|
|
1733
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1734
|
+
Button_default,
|
|
1735
|
+
{
|
|
1736
|
+
variant: "outlined",
|
|
1737
|
+
intent: "default-outlined",
|
|
1738
|
+
startIcon: /* @__PURE__ */ React23.createElement(RiArrowRightLine, { size: 20 }),
|
|
1739
|
+
onClick: handleNextPageClick,
|
|
1740
|
+
disabled: page === totalPages - 1,
|
|
1741
|
+
className: "rounded-none h-8 rounded-r-lg"
|
|
1742
|
+
}
|
|
1743
|
+
)))
|
|
1744
|
+
);
|
|
1745
|
+
};
|
|
1746
|
+
var Pagination_default = Pagination;
|
|
1747
|
+
|
|
1748
|
+
// app/components/Progress.tsx
|
|
1749
|
+
import React24 from "react";
|
|
1750
|
+
var ProgressBar = ({
|
|
1751
|
+
progress,
|
|
1752
|
+
progressText = "",
|
|
1753
|
+
progressColor,
|
|
1754
|
+
progressTextPosition
|
|
1755
|
+
}) => {
|
|
1756
|
+
const _progress = Math == null ? void 0 : Math.min(Math == null ? void 0 : Math.max(0, progress), 100);
|
|
1757
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1758
|
+
"div",
|
|
1759
|
+
{
|
|
1760
|
+
className: cn(
|
|
1761
|
+
"rounded",
|
|
1762
|
+
progressTextPosition === "right" ? "flex items-center gap-1" : progressTextPosition === "left" ? "flex items-center gap-1" : ""
|
|
1763
|
+
)
|
|
1764
|
+
},
|
|
1765
|
+
/* @__PURE__ */ React24.createElement(
|
|
1766
|
+
"span",
|
|
1767
|
+
{
|
|
1768
|
+
className: cn(
|
|
1769
|
+
"text-gray-700 text-text-sm",
|
|
1770
|
+
progressTextPosition === "left" ? "inline-block" : progressTextPosition === "top" ? "flex justify-end" : "hidden"
|
|
1771
|
+
)
|
|
1772
|
+
},
|
|
1773
|
+
progressText
|
|
1774
|
+
),
|
|
1775
|
+
/* @__PURE__ */ React24.createElement(
|
|
1776
|
+
"div",
|
|
1777
|
+
{
|
|
1778
|
+
className: "w-full h-2 rounded bg-gray-200",
|
|
1779
|
+
role: "progressbar",
|
|
1780
|
+
"aria-valuenow": _progress,
|
|
1781
|
+
"aria-valuemin": 0,
|
|
1782
|
+
"aria-valuemax": 100
|
|
1783
|
+
},
|
|
1784
|
+
/* @__PURE__ */ React24.createElement(
|
|
1785
|
+
"div",
|
|
1786
|
+
{
|
|
1787
|
+
className: `${progressColor} h-full transition-all delay-1000 duration-700 rounded ease-in`,
|
|
1788
|
+
style: { width: `${_progress}%` }
|
|
1789
|
+
}
|
|
1790
|
+
)
|
|
1791
|
+
),
|
|
1792
|
+
/* @__PURE__ */ React24.createElement(
|
|
1793
|
+
"span",
|
|
1794
|
+
{
|
|
1795
|
+
className: cn(
|
|
1796
|
+
"text-gray-700 text-text-sm",
|
|
1797
|
+
progressTextPosition === "bottom" ? "flex justify-end" : progressTextPosition === "top" ? "hidden" : progressTextPosition === "right" ? "flex justify-end" : "hidden"
|
|
1798
|
+
)
|
|
1799
|
+
},
|
|
1800
|
+
progressText
|
|
1801
|
+
)
|
|
1802
|
+
);
|
|
1803
|
+
};
|
|
1804
|
+
var Progress_default = ProgressBar;
|
|
1805
|
+
|
|
1806
|
+
// app/components/Radio.tsx
|
|
1807
|
+
import React25, { forwardRef as forwardRef9 } from "react";
|
|
1808
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
1809
|
+
var radioVariants = cva7("", {
|
|
1810
|
+
variants: {
|
|
1811
|
+
size: {
|
|
1812
|
+
sm: "h-3 w-3",
|
|
1813
|
+
lg: "h-4 w-4"
|
|
1814
|
+
}
|
|
1815
|
+
},
|
|
1816
|
+
defaultVariants: {
|
|
1817
|
+
size: "sm"
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
var Radio = forwardRef9(
|
|
1821
|
+
({ size, disabled, checked, className, children, ...props }, ref) => {
|
|
1822
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "relative inline-flex items-center cursor-pointer" }, /* @__PURE__ */ React25.createElement(
|
|
1823
|
+
"input",
|
|
1824
|
+
{
|
|
1825
|
+
...props,
|
|
1826
|
+
ref,
|
|
1827
|
+
checked,
|
|
1828
|
+
disabled,
|
|
1829
|
+
type: "radio",
|
|
1830
|
+
className: cn(
|
|
1831
|
+
"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",
|
|
1832
|
+
radioVariants({ size, className })
|
|
1833
|
+
)
|
|
1834
|
+
}
|
|
1835
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1836
|
+
"span",
|
|
1837
|
+
{
|
|
1838
|
+
className: cn(
|
|
1839
|
+
"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",
|
|
1840
|
+
size == "sm" && "h-[4.5px] w-[4.5px]"
|
|
1841
|
+
)
|
|
1842
|
+
}
|
|
1843
|
+
));
|
|
1844
|
+
}
|
|
1845
|
+
);
|
|
1846
|
+
Radio.displayName = "Radio";
|
|
1847
|
+
var Radio_default = Radio;
|
|
1848
|
+
|
|
1849
|
+
// app/components/Sidebar.tsx
|
|
1850
|
+
import React26 from "react";
|
|
1851
|
+
import Link2 from "next/link";
|
|
1852
|
+
import { usePathname } from "next/navigation";
|
|
1853
|
+
var Sidebar = ({ children, collapsed, setCollapsed }) => {
|
|
1854
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1855
|
+
"div",
|
|
1856
|
+
{
|
|
1857
|
+
onMouseEnter: () => setCollapsed(true),
|
|
1858
|
+
onMouseLeave: () => setCollapsed(false),
|
|
1859
|
+
className: cn(
|
|
1860
|
+
"border border-gray-200 shadow-sm relative flex flex-col min-h-screen transition-all duration-300 ease-in-out cursor-pointer",
|
|
1861
|
+
!collapsed ? "w-[80px] py-[21px] px-[17px]" : "w-[308px] py-[22px] px-6"
|
|
1862
|
+
)
|
|
1863
|
+
},
|
|
1864
|
+
/* @__PURE__ */ React26.createElement("div", { className: "" }, children)
|
|
1865
|
+
);
|
|
1866
|
+
};
|
|
1867
|
+
var SidebarHeader = ({
|
|
1868
|
+
collapsed,
|
|
1869
|
+
setCollapsed,
|
|
1870
|
+
children
|
|
1871
|
+
}) => {
|
|
1872
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1873
|
+
"div",
|
|
1874
|
+
{
|
|
1875
|
+
className: cn({
|
|
1876
|
+
"z-20": true
|
|
1877
|
+
})
|
|
1878
|
+
},
|
|
1879
|
+
/* @__PURE__ */ React26.createElement("div", { className: "flex justify-between items-center mb-4" }, /* @__PURE__ */ React26.createElement("span", { className: "whitespace-nowrap" }, children))
|
|
1880
|
+
);
|
|
1881
|
+
};
|
|
1882
|
+
var SidebarMenu = ({
|
|
1883
|
+
collapsed,
|
|
1884
|
+
navItems,
|
|
1885
|
+
scroll = false
|
|
1886
|
+
}) => {
|
|
1887
|
+
const currentPath = usePathname();
|
|
1888
|
+
return /* @__PURE__ */ React26.createElement("nav", { className: `max-h-[60vh] ${scroll && "overflow-y-auto customScroll"}` }, /* @__PURE__ */ React26.createElement("ul", { className: "my-2 flex flex-col gap-2 items-stretch" }, navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => /* @__PURE__ */ React26.createElement(
|
|
1889
|
+
"li",
|
|
1890
|
+
{
|
|
1891
|
+
key: parentIndex,
|
|
1892
|
+
className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
|
|
1893
|
+
},
|
|
1894
|
+
/* @__PURE__ */ React26.createElement(
|
|
1895
|
+
"p",
|
|
1896
|
+
{
|
|
1897
|
+
className: cn({
|
|
1898
|
+
"text-[14px] text-gray-500": true,
|
|
1899
|
+
"w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed
|
|
1900
|
+
})
|
|
1901
|
+
},
|
|
1902
|
+
parentItem.label
|
|
1903
|
+
),
|
|
1904
|
+
/* @__PURE__ */ React26.createElement("ul", null, parentItem == null ? void 0 : parentItem.items.map((item, index) => /* @__PURE__ */ React26.createElement("li", { key: index }, /* @__PURE__ */ React26.createElement(
|
|
1905
|
+
Link2,
|
|
1906
|
+
{
|
|
1907
|
+
className: cn({
|
|
1908
|
+
"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,
|
|
1909
|
+
"text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
|
|
1910
|
+
"text-gray-700": currentPath !== (item == null ? void 0 : item.href),
|
|
1911
|
+
"hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
|
|
1912
|
+
}),
|
|
1913
|
+
href: item.href,
|
|
1914
|
+
passHref: true
|
|
1915
|
+
},
|
|
1916
|
+
/* @__PURE__ */ React26.createElement(
|
|
1917
|
+
"div",
|
|
1918
|
+
{
|
|
1919
|
+
className: `flex items-center gap-2 whitespace-nowrap`
|
|
1920
|
+
},
|
|
1921
|
+
/* @__PURE__ */ React26.createElement("span", { className: "text-text-sm" }, " ", item.icon),
|
|
1922
|
+
/* @__PURE__ */ React26.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
|
|
1923
|
+
)
|
|
1924
|
+
))))
|
|
1925
|
+
))));
|
|
1926
|
+
};
|
|
1927
|
+
var Footer = ({
|
|
1928
|
+
children,
|
|
1929
|
+
setCollapsed,
|
|
1930
|
+
collapsed,
|
|
1931
|
+
navItems
|
|
1932
|
+
}) => {
|
|
1933
|
+
const currentPath = usePathname();
|
|
1934
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1935
|
+
"div",
|
|
1936
|
+
{
|
|
1937
|
+
className: cn({
|
|
1938
|
+
"absolute bottom-0 max-h-[230px] overflow-auto bg-white z-10 py-3 w-[85%]": true,
|
|
1939
|
+
"w-[55%]": !collapsed
|
|
1940
|
+
}),
|
|
1941
|
+
onClick: () => setCollapsed(true)
|
|
1942
|
+
},
|
|
1943
|
+
collapsed && /* @__PURE__ */ React26.createElement("div", { className: "shadow-md" }, /* @__PURE__ */ React26.createElement(Divider_default, null)),
|
|
1944
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ React26.createElement("nav", { className: "flex-grow w-full" }, /* @__PURE__ */ React26.createElement("ul", { className: "my-2 flex flex-col gap-2 items-stretch" }, navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => {
|
|
1945
|
+
var _a;
|
|
1946
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1947
|
+
"li",
|
|
1948
|
+
{
|
|
1949
|
+
key: parentIndex,
|
|
1950
|
+
className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
|
|
1951
|
+
},
|
|
1952
|
+
/* @__PURE__ */ React26.createElement(
|
|
1953
|
+
"p",
|
|
1954
|
+
{
|
|
1955
|
+
className: cn({
|
|
1956
|
+
"text-[14px] text-gray-500": true,
|
|
1957
|
+
"w-[37px] text-ellipsis text-white whitespace-nowrap overflow-hidden": !collapsed
|
|
1958
|
+
})
|
|
1959
|
+
},
|
|
1960
|
+
parentItem.label
|
|
1961
|
+
),
|
|
1962
|
+
/* @__PURE__ */ React26.createElement("ul", null, (_a = parentItem == null ? void 0 : parentItem.items) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ React26.createElement("li", { key: index }, /* @__PURE__ */ React26.createElement(
|
|
1963
|
+
Link2,
|
|
1964
|
+
{
|
|
1965
|
+
className: cn({
|
|
1966
|
+
"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,
|
|
1967
|
+
"text-white bg-primary-600": currentPath === (item == null ? void 0 : item.href),
|
|
1968
|
+
"text-gray-700": currentPath !== (item == null ? void 0 : item.href),
|
|
1969
|
+
"hover:bg-primary-600": currentPath === (item == null ? void 0 : item.href)
|
|
1970
|
+
}),
|
|
1971
|
+
href: item.href,
|
|
1972
|
+
passHref: true
|
|
1973
|
+
},
|
|
1974
|
+
/* @__PURE__ */ React26.createElement(
|
|
1975
|
+
"div",
|
|
1976
|
+
{
|
|
1977
|
+
className: `flex items-center gap-2 whitespace-nowrap`
|
|
1978
|
+
},
|
|
1979
|
+
/* @__PURE__ */ React26.createElement("span", { className: "text-text-sm" }, " ", item.icon),
|
|
1980
|
+
/* @__PURE__ */ React26.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
|
|
1981
|
+
)
|
|
1982
|
+
))))
|
|
1983
|
+
);
|
|
1984
|
+
}))),
|
|
1985
|
+
children
|
|
1986
|
+
);
|
|
1987
|
+
};
|
|
1988
|
+
Sidebar.Header = SidebarHeader;
|
|
1989
|
+
Sidebar.Menu = SidebarMenu;
|
|
1990
|
+
Sidebar.Footer = Footer;
|
|
1991
|
+
var Sidebar_default = Sidebar;
|
|
1992
|
+
|
|
1993
|
+
// app/components/Slider.tsx
|
|
1994
|
+
import React27, { forwardRef as forwardRef10 } from "react";
|
|
1995
|
+
var Slider = forwardRef10(
|
|
1996
|
+
({ value, min = 0, max = 100, size = "sm", ...props }, ref) => {
|
|
1997
|
+
const progress = (value - min) / (max - min) * 100;
|
|
1998
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
|
|
1999
|
+
"input",
|
|
2000
|
+
{
|
|
2001
|
+
ref,
|
|
2002
|
+
type: "range",
|
|
2003
|
+
min,
|
|
2004
|
+
max,
|
|
2005
|
+
value,
|
|
2006
|
+
...props,
|
|
2007
|
+
className: cn(
|
|
2008
|
+
"slider w-full rounded-full appearance-none bg-gray-300 h-4 cursor-pointer focus:outline-none",
|
|
2009
|
+
size === "sm" ? "h-1.5" : "h-4"
|
|
2010
|
+
),
|
|
2011
|
+
style: {
|
|
2012
|
+
background: `linear-gradient(to right, var(--primary-300) ${progress}%, var(--gray-300) ${progress}%)`
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
));
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
Slider.displayName = "Slider";
|
|
2019
|
+
var Slider_default = Slider;
|
|
2020
|
+
|
|
2021
|
+
// app/components/Skeleton.tsx
|
|
2022
|
+
import React28 from "react";
|
|
2023
|
+
var Skeleton = ({
|
|
2024
|
+
width = "100%",
|
|
2025
|
+
height = "100%",
|
|
2026
|
+
circle = false
|
|
2027
|
+
}) => {
|
|
2028
|
+
const style = {
|
|
2029
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
2030
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
2031
|
+
borderRadius: circle ? "50%" : void 0
|
|
2032
|
+
};
|
|
2033
|
+
return /* @__PURE__ */ React28.createElement("span", { className: `skeleton rounded-lg ${circle ? "circle" : ""}`, style });
|
|
2034
|
+
};
|
|
2035
|
+
var Skeleton_default = Skeleton;
|
|
2036
|
+
|
|
2037
|
+
// app/components/Stepper.tsx
|
|
2038
|
+
import React29, { useRef as useRef5 } from "react";
|
|
2039
|
+
import { RiCheckLine } from "@remixicon/react";
|
|
2040
|
+
var Stepper = ({
|
|
2041
|
+
stepsConfig,
|
|
2042
|
+
currentStep,
|
|
2043
|
+
setCurrentStep,
|
|
2044
|
+
isComplete,
|
|
2045
|
+
setIsComplete,
|
|
2046
|
+
position = "horizontal"
|
|
2047
|
+
}) => {
|
|
2048
|
+
var _a;
|
|
2049
|
+
const stepRef = useRef5([]);
|
|
2050
|
+
if (!stepsConfig.length) {
|
|
2051
|
+
return null;
|
|
2052
|
+
}
|
|
2053
|
+
const ActiveComponent = (_a = stepsConfig[currentStep - 1]) == null ? void 0 : _a.Component;
|
|
2054
|
+
return /* @__PURE__ */ React29.createElement("div", { className: cn(position !== "horizontal" && "flex") }, /* @__PURE__ */ React29.createElement(
|
|
2055
|
+
"div",
|
|
2056
|
+
{
|
|
2057
|
+
className: cn(
|
|
2058
|
+
"relative",
|
|
2059
|
+
position === "horizontal" ? "flex justify-between items-start" : "flex flex-col"
|
|
2060
|
+
)
|
|
2061
|
+
},
|
|
2062
|
+
stepsConfig.map((step, index) => /* @__PURE__ */ React29.createElement(
|
|
2063
|
+
"div",
|
|
2064
|
+
{
|
|
2065
|
+
key: index,
|
|
2066
|
+
ref: (el) => stepRef.current[index] = el,
|
|
2067
|
+
className: `w-full ${position === "horizontal" ? "flex gap-4 flex-col" : "flex gap-6 justify-start"} ${currentStep > index + 1 || isComplete ? "complete" : ""} ${currentStep === index + 1 ? "" : ""}`
|
|
2068
|
+
},
|
|
2069
|
+
/* @__PURE__ */ React29.createElement(
|
|
2070
|
+
"div",
|
|
2071
|
+
{
|
|
2072
|
+
className: cn(
|
|
2073
|
+
"",
|
|
2074
|
+
position === "horizontal" ? "flex items-center" : "flex flex-col"
|
|
2075
|
+
)
|
|
2076
|
+
},
|
|
2077
|
+
/* @__PURE__ */ React29.createElement(
|
|
2078
|
+
"div",
|
|
2079
|
+
{
|
|
2080
|
+
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" : ""}`
|
|
2081
|
+
},
|
|
2082
|
+
currentStep === index + 1 && !isComplete && /* @__PURE__ */ React29.createElement("span", { className: "w-[10px] h-[10px] rounded-full bg-primary-600" }),
|
|
2083
|
+
(currentStep > index + 1 || isComplete) && /* @__PURE__ */ React29.createElement("span", null, /* @__PURE__ */ React29.createElement(RiCheckLine, { size: 12, color: "#fff" }))
|
|
2084
|
+
),
|
|
2085
|
+
index !== stepsConfig.length - 1 && /* @__PURE__ */ React29.createElement(
|
|
2086
|
+
"div",
|
|
2087
|
+
{
|
|
2088
|
+
className: cn(
|
|
2089
|
+
"mx-auto rounded-lg bg-gray-200",
|
|
2090
|
+
position === "horizontal" ? "w-[80%] h-1" : "h-[100px] w-1 my-2"
|
|
2091
|
+
)
|
|
2092
|
+
},
|
|
2093
|
+
/* @__PURE__ */ React29.createElement(
|
|
2094
|
+
"p",
|
|
2095
|
+
{
|
|
2096
|
+
className: cn(
|
|
2097
|
+
"h-full rounded-lg ",
|
|
2098
|
+
currentStep > index + 1 ? "bg-primary-600" : ""
|
|
2099
|
+
)
|
|
2100
|
+
}
|
|
2101
|
+
)
|
|
2102
|
+
)
|
|
2103
|
+
),
|
|
2104
|
+
/* @__PURE__ */ React29.createElement(
|
|
2105
|
+
"div",
|
|
2106
|
+
{
|
|
2107
|
+
className: cn(
|
|
2108
|
+
"whitespace-nowrap",
|
|
2109
|
+
position === "vertical" || (step == null ? void 0 : step.helperName) ? "-mt-1" : ""
|
|
2110
|
+
)
|
|
2111
|
+
},
|
|
2112
|
+
/* @__PURE__ */ React29.createElement("span", { className: "text-gray-400 text-text-xs" }, step == null ? void 0 : step.helperName),
|
|
2113
|
+
/* @__PURE__ */ React29.createElement("p", null, step == null ? void 0 : step.name)
|
|
2114
|
+
)
|
|
2115
|
+
))
|
|
2116
|
+
), ActiveComponent && /* @__PURE__ */ React29.createElement(ActiveComponent, null));
|
|
2117
|
+
};
|
|
2118
|
+
var Stepper_default = Stepper;
|
|
2119
|
+
|
|
2120
|
+
// app/components/TableComponents.tsx
|
|
2121
|
+
import React30 from "react";
|
|
2122
|
+
var Table = ({ children, className, dense, ...props }) => {
|
|
2123
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2124
|
+
"table",
|
|
2125
|
+
{
|
|
2126
|
+
...props,
|
|
2127
|
+
className: cn(
|
|
2128
|
+
dense && "group/dense",
|
|
2129
|
+
"bg-white text-left w-full border",
|
|
2130
|
+
className
|
|
2131
|
+
)
|
|
2132
|
+
},
|
|
2133
|
+
children
|
|
2134
|
+
);
|
|
2135
|
+
};
|
|
2136
|
+
var TableHead = ({
|
|
2137
|
+
children,
|
|
2138
|
+
className,
|
|
2139
|
+
...props
|
|
2140
|
+
}) => {
|
|
2141
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2142
|
+
"thead",
|
|
2143
|
+
{
|
|
2144
|
+
...props,
|
|
2145
|
+
className: cn("bg-gray-50 border border-gray-200", className)
|
|
2146
|
+
},
|
|
2147
|
+
children
|
|
2148
|
+
);
|
|
2149
|
+
};
|
|
2150
|
+
var TableBody = ({
|
|
2151
|
+
children,
|
|
2152
|
+
className,
|
|
2153
|
+
...props
|
|
2154
|
+
}) => {
|
|
2155
|
+
return /* @__PURE__ */ React30.createElement("tbody", { ...props, className: cn(className) }, children);
|
|
2156
|
+
};
|
|
2157
|
+
var TableRow = ({
|
|
2158
|
+
children,
|
|
2159
|
+
className,
|
|
2160
|
+
indent,
|
|
2161
|
+
...props
|
|
2162
|
+
}) => {
|
|
2163
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2164
|
+
"tr",
|
|
2165
|
+
{
|
|
2166
|
+
...props,
|
|
2167
|
+
className: cn(
|
|
2168
|
+
"border border-gray-200 hover:bg-gray-50",
|
|
2169
|
+
indent && "group/indent border-none",
|
|
2170
|
+
className
|
|
2171
|
+
)
|
|
2172
|
+
},
|
|
2173
|
+
children
|
|
2174
|
+
);
|
|
2175
|
+
};
|
|
2176
|
+
var TableHeadCell = ({
|
|
2177
|
+
children,
|
|
2178
|
+
className,
|
|
2179
|
+
icon,
|
|
2180
|
+
sticky,
|
|
2181
|
+
shadow,
|
|
2182
|
+
left,
|
|
2183
|
+
...props
|
|
2184
|
+
}) => {
|
|
2185
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2186
|
+
"th",
|
|
2187
|
+
{
|
|
2188
|
+
...props,
|
|
2189
|
+
className: cn(
|
|
2190
|
+
"px-6 py-3 text-left group-has-[th]/dense:py-2",
|
|
2191
|
+
sticky && `sticky bg-gray-50`,
|
|
2192
|
+
sticky && shadow && "shadow-table",
|
|
2193
|
+
left,
|
|
2194
|
+
className
|
|
2195
|
+
),
|
|
2196
|
+
style: {
|
|
2197
|
+
left
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
/* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React30.createElement("span", { className: "font-medium text-xs" }, children), icon && /* @__PURE__ */ React30.createElement(
|
|
2201
|
+
"span",
|
|
2202
|
+
{
|
|
2203
|
+
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"
|
|
2204
|
+
},
|
|
2205
|
+
icon
|
|
2206
|
+
))
|
|
2207
|
+
);
|
|
2208
|
+
};
|
|
2209
|
+
var TableDataCell = ({
|
|
2210
|
+
children,
|
|
2211
|
+
className,
|
|
2212
|
+
icon,
|
|
2213
|
+
sticky,
|
|
2214
|
+
shadow,
|
|
2215
|
+
left,
|
|
2216
|
+
...props
|
|
2217
|
+
}) => {
|
|
2218
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2219
|
+
"td",
|
|
2220
|
+
{
|
|
2221
|
+
...props,
|
|
2222
|
+
className: cn(
|
|
2223
|
+
"px-6 py-4 text-sm font-medium group-has-[td]/dense:py-2 first:group-has-[td]/indent:pl-[60px]",
|
|
2224
|
+
sticky && `sticky bg-white`,
|
|
2225
|
+
sticky && shadow && "shadow-table",
|
|
2226
|
+
left,
|
|
2227
|
+
className
|
|
2228
|
+
),
|
|
2229
|
+
style: {
|
|
2230
|
+
left
|
|
2231
|
+
}
|
|
2232
|
+
},
|
|
2233
|
+
/* @__PURE__ */ React30.createElement("span", { className: "font-medium text-sm" }, children),
|
|
2234
|
+
icon && /* @__PURE__ */ React30.createElement(
|
|
2235
|
+
"span",
|
|
2236
|
+
{
|
|
2237
|
+
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"
|
|
2238
|
+
},
|
|
2239
|
+
icon
|
|
2240
|
+
)
|
|
2241
|
+
);
|
|
2242
|
+
};
|
|
2243
|
+
var TableComponents_default = Table;
|
|
2244
|
+
|
|
2245
|
+
// app/components/Tabs.tsx
|
|
2246
|
+
import React31 from "react";
|
|
2247
|
+
var TabsContainer = ({
|
|
2248
|
+
children,
|
|
2249
|
+
className
|
|
2250
|
+
}) => {
|
|
2251
|
+
return /* @__PURE__ */ React31.createElement("div", { className }, children);
|
|
2252
|
+
};
|
|
2253
|
+
var TabList = ({
|
|
2254
|
+
onChange,
|
|
2255
|
+
ariaLabel,
|
|
2256
|
+
children,
|
|
2257
|
+
box = false,
|
|
2258
|
+
className
|
|
2259
|
+
}) => {
|
|
2260
|
+
const handleTabChange = (value) => {
|
|
2261
|
+
onChange(value);
|
|
2262
|
+
};
|
|
2263
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2264
|
+
"div",
|
|
2265
|
+
{
|
|
2266
|
+
className: cn(
|
|
2267
|
+
"flex items-center",
|
|
2268
|
+
box ? "bg-gray-50 rounded-lg border border-gray-200" : "border-b border-gray-200",
|
|
2269
|
+
className
|
|
2270
|
+
),
|
|
2271
|
+
role: "tablist",
|
|
2272
|
+
"aria-label": ariaLabel
|
|
2273
|
+
},
|
|
2274
|
+
React31.Children.map(children, (child) => {
|
|
2275
|
+
if (React31.isValidElement(child)) {
|
|
2276
|
+
return React31.cloneElement(child, {
|
|
2277
|
+
onChange: handleTabChange,
|
|
2278
|
+
box
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2281
|
+
return null;
|
|
2282
|
+
})
|
|
2283
|
+
);
|
|
2284
|
+
};
|
|
2285
|
+
var Tab = ({
|
|
2286
|
+
label,
|
|
2287
|
+
value,
|
|
2288
|
+
onChange,
|
|
2289
|
+
icon,
|
|
2290
|
+
content,
|
|
2291
|
+
box = false,
|
|
2292
|
+
selectedTabValue,
|
|
2293
|
+
className
|
|
2294
|
+
}) => {
|
|
2295
|
+
const handleClick = () => {
|
|
2296
|
+
onChange(value);
|
|
2297
|
+
};
|
|
2298
|
+
const isSelected = value === selectedTabValue;
|
|
2299
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2300
|
+
"button",
|
|
2301
|
+
{
|
|
2302
|
+
role: "tab",
|
|
2303
|
+
className: cn(
|
|
2304
|
+
"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",
|
|
2305
|
+
isSelected && !box ? "text-primary-600 border-b-2 border-primary-600" : "border-b-2 border-transparent text-gray-700",
|
|
2306
|
+
isSelected && box ? "bg-white hover:bg-white shadow-md" : "",
|
|
2307
|
+
box ? "m-1 rounded-lg hover:rounded-lg" : "m-0",
|
|
2308
|
+
className
|
|
2309
|
+
),
|
|
2310
|
+
onClick: handleClick
|
|
2311
|
+
},
|
|
2312
|
+
icon,
|
|
2313
|
+
" ",
|
|
2314
|
+
label,
|
|
2315
|
+
" ",
|
|
2316
|
+
content
|
|
2317
|
+
);
|
|
2318
|
+
};
|
|
2319
|
+
var TabPanel = ({
|
|
2320
|
+
value,
|
|
2321
|
+
currentValue,
|
|
2322
|
+
children,
|
|
2323
|
+
className
|
|
2324
|
+
}) => {
|
|
2325
|
+
return value === currentValue ? /* @__PURE__ */ React31.createElement("div", { className }, children) : null;
|
|
2326
|
+
};
|
|
2327
|
+
var Tabs_default = TabsContainer;
|
|
2328
|
+
|
|
2329
|
+
// app/components/Textarea.tsx
|
|
2330
|
+
import React32, {
|
|
2331
|
+
forwardRef as forwardRef11
|
|
2332
|
+
} from "react";
|
|
2333
|
+
var Textarea = forwardRef11(
|
|
2334
|
+
({ size, className, rows, cols, disabled, children, ...props }, ref) => {
|
|
2335
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2336
|
+
"textarea",
|
|
2337
|
+
{
|
|
2338
|
+
...props,
|
|
2339
|
+
ref,
|
|
2340
|
+
disabled,
|
|
2341
|
+
rows,
|
|
2342
|
+
cols,
|
|
2343
|
+
className: cn(
|
|
2344
|
+
"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",
|
|
2345
|
+
size === "sm" ? "py-2.5 px-3.5" : "p-2.5",
|
|
2346
|
+
className,
|
|
2347
|
+
size
|
|
2348
|
+
)
|
|
2349
|
+
},
|
|
2350
|
+
children
|
|
2351
|
+
);
|
|
2352
|
+
}
|
|
2353
|
+
);
|
|
2354
|
+
Textarea.displayName = "Textarea";
|
|
2355
|
+
var Textarea_default = Textarea;
|
|
2356
|
+
|
|
2357
|
+
// app/components/Toggle.tsx
|
|
2358
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
2359
|
+
import React33, { forwardRef as forwardRef12 } from "react";
|
|
2360
|
+
var toggleVariants = cva8("", {
|
|
2361
|
+
variants: {
|
|
2362
|
+
size: {
|
|
2363
|
+
sm: "w-5 h-3 after:w-2 after:h-2",
|
|
2364
|
+
md: "w-9 h-5 after:w-4 after:h-4",
|
|
2365
|
+
lg: "w-11 h-6 after:w-5 after:h-5"
|
|
2366
|
+
},
|
|
2367
|
+
intent: {
|
|
2368
|
+
primary: "peer-checked:bg-primary-600",
|
|
2369
|
+
success: "peer-checked:bg-success-500"
|
|
2370
|
+
}
|
|
2371
|
+
},
|
|
2372
|
+
defaultVariants: {
|
|
2373
|
+
size: "md",
|
|
2374
|
+
intent: "primary"
|
|
2375
|
+
}
|
|
2376
|
+
});
|
|
2377
|
+
var Toggle = forwardRef12(
|
|
2378
|
+
({ size, className, intent, disabled, children, ...props }, ref) => {
|
|
2379
|
+
return /* @__PURE__ */ React33.createElement(
|
|
2380
|
+
"label",
|
|
2381
|
+
{
|
|
2382
|
+
className: cn(
|
|
2383
|
+
"inline-flex items-center cursor-pointer",
|
|
2384
|
+
disabled && "opacity-30 pointer-events-none"
|
|
2385
|
+
)
|
|
2386
|
+
},
|
|
2387
|
+
/* @__PURE__ */ React33.createElement(
|
|
2388
|
+
"input",
|
|
2389
|
+
{
|
|
2390
|
+
type: "checkbox",
|
|
2391
|
+
disabled,
|
|
2392
|
+
ref,
|
|
2393
|
+
...props,
|
|
2394
|
+
className: "sr-only flex justify-center peer"
|
|
2395
|
+
}
|
|
2396
|
+
),
|
|
2397
|
+
/* @__PURE__ */ React33.createElement(
|
|
2398
|
+
"span",
|
|
2399
|
+
{
|
|
2400
|
+
className: cn(
|
|
2401
|
+
"relative w-11 h-7 bg-gray-300 peer-focus:outline-none rounded-full peer 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",
|
|
2402
|
+
toggleVariants({
|
|
2403
|
+
intent,
|
|
2404
|
+
className,
|
|
2405
|
+
size
|
|
2406
|
+
})
|
|
2407
|
+
)
|
|
2408
|
+
},
|
|
2409
|
+
children
|
|
2410
|
+
)
|
|
2411
|
+
);
|
|
2412
|
+
}
|
|
2413
|
+
);
|
|
2414
|
+
Toggle.displayName = "Toggle";
|
|
2415
|
+
var Toggle_default = Toggle;
|
|
2416
|
+
export {
|
|
2417
|
+
Accordion,
|
|
2418
|
+
AccordionContent,
|
|
2419
|
+
AccordionItem,
|
|
2420
|
+
AccordionTrigger,
|
|
2421
|
+
Avatar_default as Avatar,
|
|
2422
|
+
AvatarGroup_default as AvatarGroup,
|
|
2423
|
+
Breadcrumb_default as BreadCrumb,
|
|
2424
|
+
Button_default as Button,
|
|
2425
|
+
Checkbox_default as Checkbox,
|
|
2426
|
+
Chip_default as Chip,
|
|
2427
|
+
CircularProgress_default as CircularProgress,
|
|
2428
|
+
Divider_default as Divider,
|
|
2429
|
+
Dropdown_default as Dropdown,
|
|
2430
|
+
DropdownWithIcon_default as DropdownWithIcon,
|
|
2431
|
+
FileUpload_default as FileUpload,
|
|
2432
|
+
GlobalNavigation_default as GlobalNavigation,
|
|
2433
|
+
HelperText_default as HelperText,
|
|
2434
|
+
Input_default as Input,
|
|
2435
|
+
Label_default as Label,
|
|
2436
|
+
ListItem_default as ListItem,
|
|
2437
|
+
Loading_default as Loading,
|
|
2438
|
+
MenuDropdown,
|
|
2439
|
+
MenuItem3 as MenuItem,
|
|
2440
|
+
MenuSubItem,
|
|
2441
|
+
Modal,
|
|
2442
|
+
Notice_default as Notice,
|
|
2443
|
+
Pagination_default as Pagination,
|
|
2444
|
+
Progress_default as ProgressBar,
|
|
2445
|
+
Radio_default as Radio,
|
|
2446
|
+
Sidebar_default as Sidebar,
|
|
2447
|
+
Skeleton_default as Skeleton,
|
|
2448
|
+
Slider_default as Slider,
|
|
2449
|
+
Stepper_default as Stepper,
|
|
2450
|
+
Tab,
|
|
2451
|
+
TabList,
|
|
2452
|
+
TabPanel,
|
|
2453
|
+
TableComponents_default as Table,
|
|
2454
|
+
TableBody,
|
|
2455
|
+
TableDataCell,
|
|
2456
|
+
TableHead,
|
|
2457
|
+
TableHeadCell,
|
|
2458
|
+
TableRow,
|
|
2459
|
+
Tabs_default as TabsContainer,
|
|
2460
|
+
Textarea_default as Textarea,
|
|
2461
|
+
Toggle_default as Toggle,
|
|
2462
|
+
Tooltip_default as Tooltip
|
|
2463
|
+
};
|
|
2464
|
+
//# sourceMappingURL=index.js.map
|