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