katalyst-riya-test 0.1.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +238 -3
- package/dist/index.cjs +1703 -312
- package/dist/index.css +1570 -412
- package/dist/index.d.cts +259 -60
- package/dist/index.d.ts +259 -60
- package/dist/index.js +1690 -305
- package/package.json +23 -23
package/dist/index.cjs
CHANGED
|
@@ -28,13 +28,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/app/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Accordion: () => Accordion,
|
|
34
34
|
AccordionContent: () => AccordionContent,
|
|
35
35
|
AccordionItem: () => AccordionItem,
|
|
36
36
|
AccordionTrigger: () => AccordionTrigger,
|
|
37
37
|
Button: () => Button_default,
|
|
38
|
+
Callout: () => Callout_default,
|
|
38
39
|
Caption: () => Caption_default,
|
|
39
40
|
Card: () => Card,
|
|
40
41
|
CardBg: () => CardBg,
|
|
@@ -46,7 +47,9 @@ __export(app_exports, {
|
|
|
46
47
|
CardTitle: () => CardTitle,
|
|
47
48
|
Checkbox: () => Checkbox_default,
|
|
48
49
|
Chip: () => Chip_default,
|
|
49
|
-
|
|
50
|
+
Drawer: () => Drawer_default,
|
|
51
|
+
Dropdown: () => Dropdown_default,
|
|
52
|
+
FillButton: () => FillButton_default,
|
|
50
53
|
Footer: () => Footer,
|
|
51
54
|
FooterContent: () => FooterContent,
|
|
52
55
|
FooterHeader: () => FooterHeader,
|
|
@@ -56,16 +59,27 @@ __export(app_exports, {
|
|
|
56
59
|
Input: () => Input_default,
|
|
57
60
|
Label: () => Label_default,
|
|
58
61
|
ListItem: () => ListItem_default,
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
ListPagination: () => ListPagination_default,
|
|
63
|
+
Loading: () => Loading_default,
|
|
64
|
+
Modal: () => Modal,
|
|
65
|
+
NestedDropdown: () => NestedDropdown_default,
|
|
66
|
+
OTPInput: () => OTPInput_default,
|
|
61
67
|
Paragraph: () => Paragraph_default,
|
|
68
|
+
Popover: () => Popover_default,
|
|
69
|
+
Radio: () => Radio_default,
|
|
70
|
+
Skeleton: () => Skeleton_default,
|
|
62
71
|
Slider: () => Slider_default,
|
|
72
|
+
Spinner: () => Spinner_default,
|
|
63
73
|
StatsCard: () => StatsCard_default,
|
|
74
|
+
Tab: () => Tab,
|
|
75
|
+
TabList: () => TabList,
|
|
76
|
+
TabPanel: () => TabPanel,
|
|
77
|
+
TabsContainer: () => Tabs_default,
|
|
64
78
|
Textarea: () => Textarea_default,
|
|
65
79
|
Toggle: () => Toggle_default,
|
|
66
80
|
Typography: () => Typography_default
|
|
67
81
|
});
|
|
68
|
-
module.exports = __toCommonJS(
|
|
82
|
+
module.exports = __toCommonJS(index_exports);
|
|
69
83
|
|
|
70
84
|
// src/utils/util.ts
|
|
71
85
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
@@ -74,83 +88,231 @@ var cn = (...classes) => (0, import_tailwind_merge.twMerge)((0, import_clsx.defa
|
|
|
74
88
|
|
|
75
89
|
// src/components/Accordion.tsx
|
|
76
90
|
var import_react = __toESM(require("react"), 1);
|
|
77
|
-
var
|
|
91
|
+
var import_hi = require("react-icons/hi");
|
|
78
92
|
function Accordion({
|
|
79
93
|
type = "single",
|
|
80
94
|
collapsible = true,
|
|
81
95
|
className,
|
|
82
|
-
children
|
|
96
|
+
children,
|
|
97
|
+
expanded,
|
|
98
|
+
defaultOpenValues = [],
|
|
99
|
+
"aria-label": ariaLabel,
|
|
100
|
+
"aria-labelledby": ariaLabelledBy
|
|
83
101
|
}) {
|
|
84
|
-
const [openItems, setOpenItems] = (0, import_react.useState)(
|
|
102
|
+
const [openItems, setOpenItems] = (0, import_react.useState)(defaultOpenValues);
|
|
103
|
+
(0, import_react.useEffect)(() => {
|
|
104
|
+
if (expanded !== void 0) {
|
|
105
|
+
if (expanded) {
|
|
106
|
+
const allValues = [];
|
|
107
|
+
import_react.default.Children.forEach(children, (child) => {
|
|
108
|
+
if (import_react.default.isValidElement(child)) {
|
|
109
|
+
allValues.push(child.props.value);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
setOpenItems(allValues);
|
|
113
|
+
} else {
|
|
114
|
+
setOpenItems(collapsible ? [] : openItems);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, [expanded, children, collapsible]);
|
|
85
118
|
const handleToggle = (value) => {
|
|
86
119
|
if (type === "single") {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
120
|
+
const isClosing = openItems.includes(value);
|
|
121
|
+
if (isClosing && !collapsible) return;
|
|
122
|
+
setOpenItems(isClosing ? [] : [value]);
|
|
90
123
|
} else {
|
|
91
|
-
setOpenItems(
|
|
92
|
-
|
|
93
|
-
|
|
124
|
+
setOpenItems((prev) => {
|
|
125
|
+
const isClosing = prev.includes(value);
|
|
126
|
+
if (isClosing && !collapsible && prev.length === 1) return prev;
|
|
127
|
+
return isClosing ? prev.filter((item) => item !== value) : [...prev, value];
|
|
128
|
+
});
|
|
94
129
|
}
|
|
95
130
|
};
|
|
96
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
131
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: cn("flex flex-col", className),
|
|
135
|
+
role: type === "single" ? "tablist" : void 0,
|
|
136
|
+
"aria-label": ariaLabel,
|
|
137
|
+
"aria-labelledby": ariaLabelledBy,
|
|
138
|
+
"aria-multiselectable": type === "multiple"
|
|
139
|
+
},
|
|
140
|
+
import_react.default.Children.map(children, (child, index) => {
|
|
141
|
+
if (import_react.default.isValidElement(child)) {
|
|
142
|
+
return import_react.default.cloneElement(child, {
|
|
101
143
|
openItems,
|
|
102
|
-
handleToggle
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
144
|
+
handleToggle,
|
|
145
|
+
index,
|
|
146
|
+
totalItems: import_react.default.Children.count(children)
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return child;
|
|
150
|
+
})
|
|
151
|
+
);
|
|
108
152
|
}
|
|
109
153
|
function AccordionItem({
|
|
110
154
|
value,
|
|
111
|
-
disabled
|
|
155
|
+
disabled,
|
|
112
156
|
openItems,
|
|
113
157
|
handleToggle,
|
|
114
|
-
children
|
|
158
|
+
children,
|
|
159
|
+
index,
|
|
160
|
+
totalItems
|
|
115
161
|
}) {
|
|
116
162
|
const isOpen = openItems?.includes(value);
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
163
|
+
const itemId = `accordion-item-${value}`;
|
|
164
|
+
const triggerId = `accordion-trigger-${value}`;
|
|
165
|
+
const contentId = `accordion-content-${value}`;
|
|
166
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: cn(
|
|
170
|
+
"rounded-lg mb-3 border transition-all duration-300 overflow-hidden",
|
|
171
|
+
isOpen ? "border-primary-500 bg-white dark:bg-gray-900 dark:border-primary-400" : "border-transparent bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700/70",
|
|
172
|
+
disabled && "opacity-50 pointer-events-none dark:opacity-40"
|
|
173
|
+
),
|
|
174
|
+
id: itemId,
|
|
175
|
+
role: "presentation"
|
|
176
|
+
},
|
|
177
|
+
import_react.default.Children.map(children, (child) => {
|
|
178
|
+
if (import_react.default.isValidElement(child)) {
|
|
179
|
+
return import_react.default.cloneElement(child, {
|
|
180
|
+
isOpen,
|
|
181
|
+
onClick: () => handleToggle?.(value),
|
|
182
|
+
triggerId,
|
|
183
|
+
contentId,
|
|
184
|
+
disabled,
|
|
185
|
+
index,
|
|
186
|
+
totalItems,
|
|
187
|
+
value
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return child;
|
|
191
|
+
})
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
function AccordionTrigger({
|
|
195
|
+
isOpen,
|
|
196
|
+
children,
|
|
197
|
+
onClick,
|
|
198
|
+
disabled,
|
|
199
|
+
triggerId,
|
|
200
|
+
contentId,
|
|
201
|
+
index,
|
|
202
|
+
totalItems,
|
|
203
|
+
value,
|
|
204
|
+
className,
|
|
205
|
+
triggerIcon = /* @__PURE__ */ import_react.default.createElement(import_hi.HiChevronDown, { size: 18 })
|
|
206
|
+
}) {
|
|
207
|
+
const handleKeyDown = (e) => {
|
|
208
|
+
if (disabled) return;
|
|
209
|
+
switch (e.key) {
|
|
210
|
+
case "Enter":
|
|
211
|
+
case " ":
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
onClick?.();
|
|
214
|
+
break;
|
|
215
|
+
case "ArrowDown": {
|
|
216
|
+
e.preventDefault();
|
|
217
|
+
const nextTrigger = document.querySelector(
|
|
218
|
+
`[data-accordion-trigger-index="${(index || 0) + 1}"]`
|
|
219
|
+
);
|
|
220
|
+
nextTrigger?.focus();
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case "ArrowUp": {
|
|
224
|
+
e.preventDefault();
|
|
225
|
+
const prevTrigger = document.querySelector(
|
|
226
|
+
`[data-accordion-trigger-index="${(index || 0) - 1}"]`
|
|
227
|
+
);
|
|
228
|
+
prevTrigger?.focus();
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
case "Home": {
|
|
232
|
+
e.preventDefault();
|
|
233
|
+
const firstTrigger = document.querySelector(
|
|
234
|
+
'[data-accordion-trigger-index="0"]'
|
|
235
|
+
);
|
|
236
|
+
firstTrigger?.focus();
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
case "End": {
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
const lastIndex = (totalItems || 1) - 1;
|
|
242
|
+
const lastTrigger = document.querySelector(
|
|
243
|
+
`[data-accordion-trigger-index="${lastIndex}"]`
|
|
244
|
+
);
|
|
245
|
+
lastTrigger?.focus();
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
120
248
|
}
|
|
121
249
|
};
|
|
122
250
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
123
251
|
"div",
|
|
124
252
|
{
|
|
253
|
+
id: triggerId,
|
|
254
|
+
role: "button",
|
|
255
|
+
tabIndex: disabled ? -1 : 0,
|
|
256
|
+
"aria-expanded": isOpen,
|
|
257
|
+
"aria-controls": contentId,
|
|
258
|
+
"aria-disabled": disabled,
|
|
259
|
+
"data-accordion-trigger-index": index,
|
|
260
|
+
"data-accordion-value": value,
|
|
261
|
+
onClick: disabled ? void 0 : onClick,
|
|
262
|
+
onKeyDown: handleKeyDown,
|
|
125
263
|
className: cn(
|
|
126
|
-
"rounded-
|
|
127
|
-
|
|
128
|
-
|
|
264
|
+
"flex p-3.5 text-base rounded-lg cursor-pointer bg-white dark:bg-gray-900 justify-between items-center font-semibold transition-all delay-150 ease-in",
|
|
265
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800 active:bg-gray-100 dark:active:bg-gray-700",
|
|
266
|
+
isOpen && "bg-gray-50 dark:bg-gray-800",
|
|
267
|
+
isOpen ? "border-none" : "border border-gray-200 dark:border-gray-700",
|
|
268
|
+
disabled && "cursor-not-allowed",
|
|
269
|
+
className
|
|
129
270
|
)
|
|
130
271
|
},
|
|
272
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "text-gray-900 dark:text-gray-100" }, children),
|
|
131
273
|
/* @__PURE__ */ import_react.default.createElement(
|
|
132
|
-
"
|
|
274
|
+
"span",
|
|
133
275
|
{
|
|
134
|
-
className:
|
|
135
|
-
|
|
276
|
+
className: cn(
|
|
277
|
+
"transition-transform duration-300 text-gray-600 dark:text-gray-400",
|
|
278
|
+
isOpen ? "rotate-180" : "rotate-0"
|
|
279
|
+
),
|
|
280
|
+
"aria-hidden": "true"
|
|
136
281
|
},
|
|
137
|
-
|
|
282
|
+
triggerIcon
|
|
138
283
|
)
|
|
139
284
|
);
|
|
140
285
|
}
|
|
141
|
-
function
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
286
|
+
function AccordionContent({
|
|
287
|
+
isOpen,
|
|
288
|
+
children,
|
|
289
|
+
className,
|
|
290
|
+
contentId,
|
|
291
|
+
triggerId
|
|
292
|
+
}) {
|
|
145
293
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
146
294
|
"div",
|
|
147
295
|
{
|
|
296
|
+
id: contentId,
|
|
297
|
+
role: "region",
|
|
298
|
+
"aria-labelledby": triggerId,
|
|
299
|
+
hidden: !isOpen,
|
|
148
300
|
className: cn(
|
|
149
|
-
"
|
|
150
|
-
|
|
301
|
+
"grid transition-all duration-500 ease-[cubic-bezier(0.87,0,0.13,1)]",
|
|
302
|
+
isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
|
|
151
303
|
)
|
|
152
304
|
},
|
|
153
|
-
|
|
305
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "overflow-hidden" }, /* @__PURE__ */ import_react.default.createElement(
|
|
306
|
+
"div",
|
|
307
|
+
{
|
|
308
|
+
className: cn(
|
|
309
|
+
"p-4 pb-6 mobile:px-4 mobile:pb-4 text-gray-600 dark:text-gray-300 leading-relaxed",
|
|
310
|
+
"border-t border-gray-100 dark:border-gray-700",
|
|
311
|
+
className
|
|
312
|
+
)
|
|
313
|
+
},
|
|
314
|
+
children
|
|
315
|
+
))
|
|
154
316
|
);
|
|
155
317
|
}
|
|
156
318
|
|
|
@@ -162,13 +324,14 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
162
324
|
{
|
|
163
325
|
variants: {
|
|
164
326
|
variant: {
|
|
165
|
-
primary: "bg-
|
|
166
|
-
"primary-light": "bg-
|
|
167
|
-
secondary: "bg-
|
|
327
|
+
primary: "bg-primary-500 text-light hover:bg-primary-600 hover:shadow-[inset_0px_2px_8px_-2px_#FFFFFF8F,inset_0px_8px_8px_-2px_#0000002E] active:bg-primary-400 active:shadow-[0px_0px_0px_3px] active:shadow-primary-300",
|
|
328
|
+
"primary-light": "bg-primary-50 text-primary-600 hover:bg-primary-200 hover:shadow-[inset_0px_2px_8px_-2px_#FFFFFF8F,inset_0px_8px_8px_-2px_#356AC32E] active:shadow-[0px_0px_0px_3px] active:bg-primary-50 active:shadow-primary-300",
|
|
329
|
+
secondary: "bg-primary-50 text-primary-800 hover:bg-primary-200 hover:shadow-[inset_0px_2px_8px_-2px_#FFFFFF8F,inset_0px_8px_8px_-2px_#6984AD2E] active:bg-primary-50 active:shadow-[0px_0px_0px_3px] active:shadow-primary-700",
|
|
168
330
|
tertiary: "bg-gray-100 text-gray-900 hover:bg-gray-300 hover:shadow-[inset_0px_2px_8px_-2px_#FFFFFF8F,inset_0px_8px_8px_-2px_#9595952E] active:bg-gray-25 active:shadow-[0px_0px_0px_3px] active:shadow-gray-700",
|
|
169
331
|
quaternary: "bg-gray-50/[0.02] text-light backdrop-blur-[6px] hover:shadow-[inset_0px_8px_8px_-2px_#23232314] hover:backdrop-blur-md hover:bg-gray-200/10 active:bg-gray-25 active:shadow-[0px_0px_0px_3px] active:text-gray-900 active:shadow-[#46464659]"
|
|
170
332
|
},
|
|
171
333
|
size: {
|
|
334
|
+
xs: "text-base px-spacing-sm",
|
|
172
335
|
sm: "text-xl leading-[30px] px-spacing-md",
|
|
173
336
|
md: "font-bold text-2xl leading-[36px] px-spacing-lg",
|
|
174
337
|
lg: "font-bold text-[32px] leading-[48px] px-spacing-xl"
|
|
@@ -176,7 +339,7 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
176
339
|
},
|
|
177
340
|
defaultVariants: {
|
|
178
341
|
variant: "primary",
|
|
179
|
-
size: "
|
|
342
|
+
size: "sm"
|
|
180
343
|
}
|
|
181
344
|
}
|
|
182
345
|
);
|
|
@@ -211,10 +374,116 @@ var Button = ({
|
|
|
211
374
|
};
|
|
212
375
|
var Button_default = Button;
|
|
213
376
|
|
|
214
|
-
// src/components/
|
|
377
|
+
// src/components/Callout.tsx
|
|
215
378
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
216
379
|
var import_react3 = __toESM(require("react"), 1);
|
|
217
|
-
var
|
|
380
|
+
var calloutVariants = (0, import_class_variance_authority2.cva)("py-3 px-4 font-medium rounded-md", {
|
|
381
|
+
variants: {
|
|
382
|
+
variant: {
|
|
383
|
+
filled: "",
|
|
384
|
+
outlined: "border"
|
|
385
|
+
},
|
|
386
|
+
intent: {
|
|
387
|
+
primary: "",
|
|
388
|
+
warning: "",
|
|
389
|
+
error: "",
|
|
390
|
+
success: "",
|
|
391
|
+
default: ""
|
|
392
|
+
},
|
|
393
|
+
size: {
|
|
394
|
+
xs: "text-xs",
|
|
395
|
+
sm: "text-sm",
|
|
396
|
+
md: "text-base",
|
|
397
|
+
lg: "text-lg"
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
compoundVariants: [
|
|
401
|
+
{
|
|
402
|
+
variant: "filled",
|
|
403
|
+
intent: "primary",
|
|
404
|
+
className: "bg-primary-50 text-primary-600 dark:bg-primary-900 dark:text-primary-400"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
variant: "outlined",
|
|
408
|
+
intent: "primary",
|
|
409
|
+
className: "border-primary-200 text-primary-600 bg-transparent dark:text-primary-400"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
variant: "filled",
|
|
413
|
+
intent: "warning",
|
|
414
|
+
className: "bg-yellow-50 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
variant: "outlined",
|
|
418
|
+
intent: "warning",
|
|
419
|
+
className: "border-yellow-400 text-yellow-600 bg-transparent"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
variant: "filled",
|
|
423
|
+
intent: "error",
|
|
424
|
+
className: "bg-red-50 text-red-600 dark:bg-red-900 dark:text-red-400"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
variant: "outlined",
|
|
428
|
+
intent: "error",
|
|
429
|
+
className: "border-red-200 text-red-600 bg-transparent"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
variant: "filled",
|
|
433
|
+
intent: "success",
|
|
434
|
+
className: "bg-green-50 dark:bg-green-900 dark:text-green-400 text-green-600"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
variant: "outlined",
|
|
438
|
+
intent: "success",
|
|
439
|
+
className: "border-green-300 text-green-600 bg-transparent"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
variant: "filled",
|
|
443
|
+
intent: "default",
|
|
444
|
+
className: "bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-400"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
variant: "outlined",
|
|
448
|
+
intent: "default",
|
|
449
|
+
className: "border-gray-300 text-gray-700 bg-transparent dark:text-gray-400"
|
|
450
|
+
}
|
|
451
|
+
],
|
|
452
|
+
defaultVariants: {
|
|
453
|
+
variant: "filled",
|
|
454
|
+
intent: "primary",
|
|
455
|
+
size: "sm"
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
var Callout = ({
|
|
459
|
+
children,
|
|
460
|
+
variant,
|
|
461
|
+
intent,
|
|
462
|
+
size,
|
|
463
|
+
startIcon,
|
|
464
|
+
endIcon,
|
|
465
|
+
className
|
|
466
|
+
}) => {
|
|
467
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
role: "alert",
|
|
471
|
+
className: cn(
|
|
472
|
+
calloutVariants({ variant, intent, size }),
|
|
473
|
+
"flex items-center justify-between gap-2",
|
|
474
|
+
className
|
|
475
|
+
)
|
|
476
|
+
},
|
|
477
|
+
/* @__PURE__ */ import_react3.default.createElement("div", { className: "flex items-center gap-2" }, startIcon && /* @__PURE__ */ import_react3.default.createElement("span", null, startIcon), children),
|
|
478
|
+
endIcon && /* @__PURE__ */ import_react3.default.createElement("span", null, endIcon)
|
|
479
|
+
);
|
|
480
|
+
};
|
|
481
|
+
var Callout_default = Callout;
|
|
482
|
+
|
|
483
|
+
// src/components/Caption.tsx
|
|
484
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
485
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
486
|
+
var captionVariants = (0, import_class_variance_authority3.cva)("font-bold font-karla text-dark dark:text-light", {
|
|
218
487
|
variants: {
|
|
219
488
|
variant: {
|
|
220
489
|
sm: "text-[10px] leading-[15px]",
|
|
@@ -226,24 +495,24 @@ var captionVariants = (0, import_class_variance_authority2.cva)("font-bold font-
|
|
|
226
495
|
}
|
|
227
496
|
});
|
|
228
497
|
var Caption = ({ children, variant, className, ...props }) => {
|
|
229
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ import_react4.default.createElement("span", { className: cn(captionVariants({ variant, className })), ...props }, children);
|
|
230
499
|
};
|
|
231
500
|
var Caption_default = Caption;
|
|
232
501
|
|
|
233
502
|
// src/components/Card.tsx
|
|
234
503
|
var import_image = __toESM(require("next/image"), 1);
|
|
235
|
-
var
|
|
504
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
236
505
|
|
|
237
506
|
// src/components/Typography.tsx
|
|
238
|
-
var
|
|
239
|
-
var
|
|
240
|
-
var typographyVariant = (0,
|
|
507
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
508
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
509
|
+
var typographyVariant = (0, import_class_variance_authority4.cva)("text-dark dark:text-light font-bold", {
|
|
241
510
|
variants: {
|
|
242
511
|
variant: {
|
|
243
|
-
h1: "text-8xl leading-[144px]",
|
|
244
|
-
h2: "text-7xl leading-[90px]",
|
|
245
|
-
h3: "text-5xl leading-[72px]",
|
|
246
|
-
h4: "text-[32px] leading-[48px]",
|
|
512
|
+
h1: "xl:text-8xl xl:leading-[144px] lg:text-7xl lg:leading-[90px] md:text-6xl md:leading-[72px] sm:text-5xl sm:leading-[48px] text-4xl leading-9",
|
|
513
|
+
h2: "xl:text-7xl xl:leading-[90px] lg:text-6xl lg:leading-[72px] md:text-5xl md:leading-[48px] sm:text-4xl sm:leading-9 text-3xl leading-7",
|
|
514
|
+
h3: "xl:text-5xl xl:leading-[72px] lg:text-4xl lg:leading-9 md:text-3xl md:leading-7 sm:text-2xl text-xl leading-[30px]",
|
|
515
|
+
h4: "md:text-[32px] md:leading-[48px] sm:text-xl sm:leading-[30px] text-xl",
|
|
247
516
|
h5: "text-2xl leading-9",
|
|
248
517
|
h6: "text-xl font-semibold leading-[30px]"
|
|
249
518
|
}
|
|
@@ -260,7 +529,7 @@ var Typography = ({
|
|
|
260
529
|
...props
|
|
261
530
|
}) => {
|
|
262
531
|
const Component = as || variant;
|
|
263
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
264
533
|
Component,
|
|
265
534
|
{
|
|
266
535
|
className: cn(typographyVariant({ variant, className })),
|
|
@@ -272,9 +541,9 @@ var Typography = ({
|
|
|
272
541
|
var Typography_default = Typography;
|
|
273
542
|
|
|
274
543
|
// src/components/Paragraph.tsx
|
|
275
|
-
var
|
|
276
|
-
var
|
|
277
|
-
var paragraphVariants = (0,
|
|
544
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
545
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
546
|
+
var paragraphVariants = (0, import_class_variance_authority5.cva)(
|
|
278
547
|
"font-karla font-normal text-dark dark:text-light",
|
|
279
548
|
{
|
|
280
549
|
variants: {
|
|
@@ -296,16 +565,16 @@ var Paragraph = ({
|
|
|
296
565
|
variant,
|
|
297
566
|
...props
|
|
298
567
|
}) => {
|
|
299
|
-
return /* @__PURE__ */
|
|
568
|
+
return /* @__PURE__ */ import_react6.default.createElement("p", { className: cn(paragraphVariants({ variant, className })), ...props }, children);
|
|
300
569
|
};
|
|
301
570
|
var Paragraph_default = Paragraph;
|
|
302
571
|
|
|
303
572
|
// src/components/Card.tsx
|
|
304
573
|
function Card({ children, className }) {
|
|
305
|
-
return /* @__PURE__ */
|
|
574
|
+
return /* @__PURE__ */ import_react7.default.createElement("article", { className }, children);
|
|
306
575
|
}
|
|
307
|
-
var CardIcon = ({ children, className }) => /* @__PURE__ */
|
|
308
|
-
var CardHeader = ({ children, className }) => /* @__PURE__ */
|
|
576
|
+
var CardIcon = ({ children, className }) => /* @__PURE__ */ import_react7.default.createElement("span", { className }, children);
|
|
577
|
+
var CardHeader = ({ children, className }) => /* @__PURE__ */ import_react7.default.createElement("div", { className }, children);
|
|
309
578
|
var CardBg = ({
|
|
310
579
|
children,
|
|
311
580
|
className,
|
|
@@ -313,7 +582,7 @@ var CardBg = ({
|
|
|
313
582
|
alt = "Card",
|
|
314
583
|
width = 300,
|
|
315
584
|
height = 200
|
|
316
|
-
}) => /* @__PURE__ */
|
|
585
|
+
}) => /* @__PURE__ */ import_react7.default.createElement("div", { className: cn("relative", className) }, src && /* @__PURE__ */ import_react7.default.createElement(
|
|
317
586
|
import_image.default,
|
|
318
587
|
{
|
|
319
588
|
src,
|
|
@@ -322,25 +591,26 @@ var CardBg = ({
|
|
|
322
591
|
height,
|
|
323
592
|
layout: "responsive"
|
|
324
593
|
}
|
|
325
|
-
), /* @__PURE__ */
|
|
326
|
-
var CardTitle = ({ children, className }) => /* @__PURE__ */
|
|
327
|
-
var CardDescription = ({ children, className }) => /* @__PURE__ */
|
|
328
|
-
var CardContent = ({ children, className }) => /* @__PURE__ */
|
|
329
|
-
var CardFooter = ({ children, className }) => /* @__PURE__ */
|
|
594
|
+
), /* @__PURE__ */ import_react7.default.createElement("div", { className: "absolute inset-0" }, children));
|
|
595
|
+
var CardTitle = ({ children, className }) => /* @__PURE__ */ import_react7.default.createElement(Typography_default, { variant: "h4", className }, children);
|
|
596
|
+
var CardDescription = ({ children, className }) => /* @__PURE__ */ import_react7.default.createElement(Paragraph_default, { variant: "b1", className: cn("text-light", className) }, children);
|
|
597
|
+
var CardContent = ({ children, className }) => /* @__PURE__ */ import_react7.default.createElement("div", { className: cn("font-karla text-white", className) }, children);
|
|
598
|
+
var CardFooter = ({ children, className }) => /* @__PURE__ */ import_react7.default.createElement("div", { className: cn("font-karla text-white", className) }, children);
|
|
330
599
|
|
|
331
600
|
// src/components/Checkbox.tsx
|
|
332
|
-
var
|
|
333
|
-
var Checkbox = (0,
|
|
334
|
-
({ disabled, checked, className, children, readOnly, ...props }, ref) => {
|
|
335
|
-
return /* @__PURE__ */
|
|
601
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
602
|
+
var Checkbox = (0, import_react8.forwardRef)(
|
|
603
|
+
({ disabled, checked, className, children, readOnly, square, ...props }, ref) => {
|
|
604
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
336
605
|
"div",
|
|
337
606
|
{
|
|
338
607
|
className: cn(
|
|
339
|
-
"
|
|
608
|
+
square ? "rounded-sm" : "rounded-full",
|
|
609
|
+
"group inline-flex relative items-center border-2 border-transparent hover:border-primary-300",
|
|
340
610
|
disabled && "border-none"
|
|
341
611
|
)
|
|
342
612
|
},
|
|
343
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
344
614
|
"input",
|
|
345
615
|
{
|
|
346
616
|
type: "checkbox",
|
|
@@ -350,20 +620,21 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
350
620
|
readOnly,
|
|
351
621
|
checked,
|
|
352
622
|
className: cn(
|
|
353
|
-
|
|
623
|
+
square ? "rounded-sm" : "rounded-full",
|
|
624
|
+
"peer relative h-5 w-5 cursor-pointer appearance-none border-2 border-gray-300 transition-all checked:border-primary-500 hover:border-primary-500 hover:bg-primary-25/25 disabled:opacity-30 disabled:pointer-events-none disabled:border-gray-400",
|
|
354
625
|
className
|
|
355
626
|
)
|
|
356
627
|
}
|
|
357
628
|
),
|
|
358
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
359
630
|
"span",
|
|
360
631
|
{
|
|
361
632
|
className: cn(
|
|
362
|
-
"absolute text-
|
|
633
|
+
"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",
|
|
363
634
|
disabled && "text-gray-300"
|
|
364
635
|
)
|
|
365
636
|
},
|
|
366
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
367
638
|
"svg",
|
|
368
639
|
{
|
|
369
640
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -373,7 +644,7 @@ var Checkbox = (0, import_react7.forwardRef)(
|
|
|
373
644
|
stroke: "currentColor",
|
|
374
645
|
strokeWidth: "0.3"
|
|
375
646
|
},
|
|
376
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
377
648
|
"path",
|
|
378
649
|
{
|
|
379
650
|
fillRule: "evenodd",
|
|
@@ -391,16 +662,18 @@ Checkbox.displayName = "Checkbox";
|
|
|
391
662
|
var Checkbox_default = Checkbox;
|
|
392
663
|
|
|
393
664
|
// src/components/Chip.tsx
|
|
394
|
-
var
|
|
395
|
-
var
|
|
396
|
-
var chipVariants = (0,
|
|
665
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
666
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
667
|
+
var chipVariants = (0, import_class_variance_authority6.cva)("", {
|
|
397
668
|
variants: {
|
|
398
669
|
variant: {
|
|
399
|
-
primary: "bg-white text-
|
|
400
|
-
secondary: "bg-
|
|
401
|
-
|
|
670
|
+
primary: "bg-white text-primary-500 hover:text-white hover:bg-gradient-to-r hover:from-primary-500 hover:to-primary-700",
|
|
671
|
+
secondary: "bg-primary-500 text-white hover:text-white hover:bg-gradient-to-r hover:from-primary-500 hover:to-primary-700",
|
|
672
|
+
default: "bg-gray-200",
|
|
673
|
+
glass: "backdrop-blur-sm text-primary-500"
|
|
402
674
|
},
|
|
403
675
|
size: {
|
|
676
|
+
xs: "text-xs py-1 px-3",
|
|
404
677
|
sm: "text-sm py-1 px-3",
|
|
405
678
|
md: "text-base px-4 py-2",
|
|
406
679
|
lg: "text-lg px-6 py-3"
|
|
@@ -420,21 +693,21 @@ var Chip = ({
|
|
|
420
693
|
size,
|
|
421
694
|
...props
|
|
422
695
|
}) => {
|
|
423
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
424
697
|
"div",
|
|
425
698
|
{
|
|
426
699
|
className: cn(
|
|
427
|
-
"rounded-radius-xl bg-gradient-to-r",
|
|
700
|
+
"rounded-radius-xl bg-gradient-to-r w-fit",
|
|
428
701
|
{
|
|
429
|
-
solid: "from-
|
|
430
|
-
primary: "from-
|
|
431
|
-
secondary: "from-
|
|
432
|
-
glass: "border border-
|
|
433
|
-
|
|
434
|
-
"
|
|
702
|
+
solid: "from-primary-200 to-primary-500 p-[1px]",
|
|
703
|
+
primary: "from-primary-200 to-primary-500 p-[1px]",
|
|
704
|
+
secondary: "from-primary-200 to-primary-500 p-[1px]",
|
|
705
|
+
glass: "border border-primary-500 bg-white/20",
|
|
706
|
+
default: "bg-gray-200 border border-gray-200 p-[1px]"
|
|
707
|
+
}[variant || "primary"]
|
|
435
708
|
)
|
|
436
709
|
},
|
|
437
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
438
711
|
"div",
|
|
439
712
|
{
|
|
440
713
|
...props,
|
|
@@ -453,181 +726,88 @@ var Chip = ({
|
|
|
453
726
|
};
|
|
454
727
|
var Chip_default = Chip;
|
|
455
728
|
|
|
456
|
-
// src/components/
|
|
457
|
-
var import_react9 = __toESM(require("react"), 1);
|
|
458
|
-
var import_hi2 = require("react-icons/hi2");
|
|
459
|
-
function Dropdown({
|
|
460
|
-
triggerIcon,
|
|
461
|
-
children,
|
|
462
|
-
width = "250px"
|
|
463
|
-
}) {
|
|
464
|
-
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
465
|
-
const dropdownRef = (0, import_react9.useRef)(null);
|
|
466
|
-
(0, import_react9.useEffect)(() => {
|
|
467
|
-
const handleClickOutside = (event) => {
|
|
468
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
469
|
-
setIsOpen(false);
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
473
|
-
return () => {
|
|
474
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
475
|
-
};
|
|
476
|
-
}, []);
|
|
477
|
-
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "relative w-full font-karla", ref: dropdownRef }, /* @__PURE__ */ import_react9.default.createElement(
|
|
478
|
-
"div",
|
|
479
|
-
{
|
|
480
|
-
className: "cursor-pointer",
|
|
481
|
-
onClick: () => setIsOpen(!isOpen),
|
|
482
|
-
"aria-label": "Open menu"
|
|
483
|
-
},
|
|
484
|
-
triggerIcon || /* @__PURE__ */ import_react9.default.createElement("span", null, "\u2630")
|
|
485
|
-
), isOpen && /* @__PURE__ */ import_react9.default.createElement(
|
|
486
|
-
"div",
|
|
487
|
-
{
|
|
488
|
-
style: { width },
|
|
489
|
-
className: "border border-gray-200 dark:bg-gray-800 dark:border-gray-600 dark:text-white rounded-t-radius-md absolute left-0 mt-1 z-[100000] w-full bg-white shadow-sm"
|
|
490
|
-
},
|
|
491
|
-
children
|
|
492
|
-
));
|
|
493
|
-
}
|
|
494
|
-
var MenuItem = ({
|
|
495
|
-
label,
|
|
496
|
-
onClick,
|
|
497
|
-
disabled,
|
|
498
|
-
children
|
|
499
|
-
}) => /* @__PURE__ */ import_react9.default.createElement(
|
|
500
|
-
"button",
|
|
501
|
-
{
|
|
502
|
-
className: cn(
|
|
503
|
-
"w-full text-left p-4 border-t border-gray-200 last:border-none hover:bg-gray-200 dark:hover:bg-gray-600",
|
|
504
|
-
disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
505
|
-
),
|
|
506
|
-
onClick,
|
|
507
|
-
disabled
|
|
508
|
-
},
|
|
509
|
-
label,
|
|
510
|
-
children && /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, children)
|
|
511
|
-
);
|
|
512
|
-
var MenuSubItem = ({
|
|
513
|
-
label,
|
|
514
|
-
children
|
|
515
|
-
}) => {
|
|
516
|
-
const [isSubOpen, setIsSubOpen] = (0, import_react9.useState)(false);
|
|
517
|
-
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "relative" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
518
|
-
"section",
|
|
519
|
-
{
|
|
520
|
-
onClick: () => setIsSubOpen(!isSubOpen),
|
|
521
|
-
className: "cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 border-t border-b border-gray-200 p-4 flex justify-between items-center gap-1 w-full text-left"
|
|
522
|
-
},
|
|
523
|
-
/* @__PURE__ */ import_react9.default.createElement("span", null, label),
|
|
524
|
-
isSubOpen ? /* @__PURE__ */ import_react9.default.createElement(import_hi2.HiChevronUp, null) : /* @__PURE__ */ import_react9.default.createElement(import_hi2.HiChevronDown, null)
|
|
525
|
-
), isSubOpen && /* @__PURE__ */ import_react9.default.createElement("div", { className: "bg-gray-100 border-gray-200 dark:bg-gray-700 dark:border-gray-600 dark:text-white" }, children));
|
|
526
|
-
};
|
|
527
|
-
|
|
528
|
-
// src/components/Footer.tsx
|
|
729
|
+
// src/components/Drawer.tsx
|
|
529
730
|
var import_react10 = __toESM(require("react"), 1);
|
|
530
|
-
var
|
|
531
|
-
|
|
731
|
+
var import_ri = require("react-icons/ri");
|
|
732
|
+
var Drawer = ({
|
|
733
|
+
isOpen,
|
|
734
|
+
setIsOpen,
|
|
532
735
|
children,
|
|
736
|
+
position = "right",
|
|
737
|
+
width = "w-80",
|
|
738
|
+
height = "h-64",
|
|
533
739
|
className,
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
|
|
740
|
+
showCloseButton = true,
|
|
741
|
+
closeOnOutsideClick = true
|
|
742
|
+
}) => {
|
|
743
|
+
const handleClose = (0, import_react10.useCallback)(() => {
|
|
744
|
+
setIsOpen(false);
|
|
745
|
+
}, [setIsOpen]);
|
|
746
|
+
(0, import_react10.useEffect)(() => {
|
|
747
|
+
document.body.style.overflow = isOpen ? "hidden" : "";
|
|
748
|
+
}, [isOpen]);
|
|
749
|
+
(0, import_react10.useEffect)(() => {
|
|
750
|
+
const handleKeyDown = (e) => {
|
|
751
|
+
if (e.key === "Escape" && isOpen) {
|
|
752
|
+
handleClose();
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
756
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
757
|
+
}, [isOpen, handleClose]);
|
|
758
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", null, /* @__PURE__ */ import_react10.default.createElement(
|
|
550
759
|
"div",
|
|
551
760
|
{
|
|
552
761
|
className: cn(
|
|
553
|
-
"
|
|
554
|
-
|
|
555
|
-
)
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
)
|
|
559
|
-
};
|
|
560
|
-
var FooterContent = ({ children, className }) => {
|
|
561
|
-
return /* @__PURE__ */ import_react10.default.createElement(
|
|
562
|
-
"section",
|
|
563
|
-
{
|
|
564
|
-
className: cn(
|
|
565
|
-
"max-w-6xl mx-auto flex md:flex-row flex-col items-center md:items-start justify-between gap-14 px-4 md:px-20 py-20",
|
|
566
|
-
className
|
|
567
|
-
)
|
|
568
|
-
},
|
|
569
|
-
children
|
|
570
|
-
);
|
|
571
|
-
};
|
|
572
|
-
var FooterList = ({ footerItems, target }) => {
|
|
573
|
-
return /* @__PURE__ */ import_react10.default.createElement("div", { className: "grid lg:grid-cols-3 md:grid-cols-2 place-items-start gap-12 text-center md:text-left" }, footerItems?.map((data, i) => /* @__PURE__ */ import_react10.default.createElement("div", { key: i, className: "space-y-5 w-full" }, /* @__PURE__ */ import_react10.default.createElement(Typography_default, { variant: "h5" }, data?.label), /* @__PURE__ */ import_react10.default.createElement("ul", { className: "space-y-2.5 list-none" }, data.content?.map((data2, i2) => /* @__PURE__ */ import_react10.default.createElement("li", { key: i2 }, /* @__PURE__ */ import_react10.default.createElement(import_link.default, { href: data2?.link, target }, /* @__PURE__ */ import_react10.default.createElement(
|
|
574
|
-
Paragraph_default,
|
|
575
|
-
{
|
|
576
|
-
variant: "b3",
|
|
577
|
-
className: "dark:text-gray-300 hover:text-brand-400 dark:hover:text-brand-600 text-gray-900"
|
|
578
|
-
},
|
|
579
|
-
data2?.text
|
|
580
|
-
))))))));
|
|
581
|
-
};
|
|
582
|
-
var FooterIcons = ({ icons }) => {
|
|
583
|
-
return /* @__PURE__ */ import_react10.default.createElement("div", { className: "flex flex-wrap justify-center items-center gap-5 text-brand-700 dark:text-brand-200" }, icons.map((icon, index) => /* @__PURE__ */ import_react10.default.createElement(
|
|
584
|
-
import_link.default,
|
|
585
|
-
{
|
|
586
|
-
href: icon.link,
|
|
587
|
-
key: index,
|
|
588
|
-
target: "_blank",
|
|
589
|
-
className: "hover:bg-brand-100 dark:hover:bg-brand-800 p-1 rounded-radius-sm"
|
|
590
|
-
},
|
|
591
|
-
icon.icon
|
|
592
|
-
)));
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
// src/components/ImageCard.tsx
|
|
596
|
-
var import_react11 = __toESM(require("react"), 1);
|
|
597
|
-
var ImageCard = ({
|
|
598
|
-
cardTitle,
|
|
599
|
-
cardDesc,
|
|
600
|
-
cardImg,
|
|
601
|
-
children,
|
|
602
|
-
className = ""
|
|
603
|
-
}) => {
|
|
604
|
-
const backgroundImage = `url('${cardImg}')`;
|
|
605
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
|
762
|
+
"fixed inset-0 bg-black/50 dark:bg-white/50 transition-opacity duration-300 z-[10000000000000000]",
|
|
763
|
+
isOpen ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
764
|
+
),
|
|
765
|
+
onClick: () => closeOnOutsideClick && handleClose()
|
|
766
|
+
}
|
|
767
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
|
606
768
|
"div",
|
|
607
769
|
{
|
|
608
770
|
className: cn(
|
|
609
|
-
"
|
|
771
|
+
"fixed bg-light dark:bg-dark shadow-xl p-4 transition-transform duration-300 z-[100000000000000000]",
|
|
772
|
+
position === "right" && `top-0 right-0 ${width} h-full`,
|
|
773
|
+
position === "left" && `top-0 left-0 ${width} h-full`,
|
|
774
|
+
position === "top" && `top-0 left-0 w-full ${height}`,
|
|
775
|
+
position === "bottom" && `bottom-0 left-0 w-full ${height}`,
|
|
776
|
+
!isOpen && (position === "right" ? "translate-x-full" : position === "left" ? "-translate-x-full" : position === "top" ? "-translate-y-full" : "translate-y-full"),
|
|
777
|
+
isOpen && "translate-x-0 translate-y-0",
|
|
610
778
|
className
|
|
611
779
|
),
|
|
612
|
-
|
|
613
|
-
backgroundImage
|
|
614
|
-
}
|
|
780
|
+
onClick: (e) => e.stopPropagation()
|
|
615
781
|
},
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
|
|
618
|
-
|
|
782
|
+
showCloseButton && /* @__PURE__ */ import_react10.default.createElement(
|
|
783
|
+
Button_default,
|
|
784
|
+
{
|
|
785
|
+
size: "xs",
|
|
786
|
+
variant: "tertiary",
|
|
787
|
+
onClick: handleClose,
|
|
788
|
+
startIcon: /* @__PURE__ */ import_react10.default.createElement(import_ri.RiCloseLine, { size: 20 }),
|
|
789
|
+
"aria-label": "Close drawer",
|
|
790
|
+
className: "absolute border-none p-1 transition-colors top-3 right-4"
|
|
791
|
+
}
|
|
792
|
+
),
|
|
793
|
+
/* @__PURE__ */ import_react10.default.createElement("div", { className: "overflow-y-auto h-full" }, children)
|
|
794
|
+
));
|
|
619
795
|
};
|
|
620
|
-
var
|
|
796
|
+
var Drawer_default = Drawer;
|
|
797
|
+
|
|
798
|
+
// src/components/Dropdown.tsx
|
|
799
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
800
|
+
var import_hi2 = require("react-icons/hi");
|
|
621
801
|
|
|
622
802
|
// src/components/Input.tsx
|
|
623
|
-
var
|
|
624
|
-
var
|
|
625
|
-
var inputVariants = (0,
|
|
803
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
804
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
805
|
+
var inputVariants = (0, import_class_variance_authority7.cva)(
|
|
626
806
|
"flex items-center text-sm gap-2 py-2 px-4 rounded-radius-md border font-karla has-[:disabled]:opacity-30 has-[:disabled]:select-none has-[:disabled]:pointer-events-none",
|
|
627
807
|
{
|
|
628
808
|
variants: {
|
|
629
809
|
variant: {
|
|
630
|
-
default: "dark:text-gray-500 dark:bg-gray-900 dark:border-gray-800 dark:hover:text-light dark:hover:bg-gray-800 dark:hover:border-gray-700 dark:focus-within:bg-gray-100 dark:focus-within:border-gray-800 dark:focus-within:hover:bg-gray-700 dark:focus-within:text-dark dark:has-[:disabled]:bg-gray-700 bg-gray-100 border-gray-200 text-gray-600 hover:border-gray-300 hover:text-gray-500 hover:bg-gray-300 focus-within:bg-gray-50 focus-within:border-gray-400 focus-within:text-dark focus-within:hover:text-dark focus-within:hover:border-
|
|
810
|
+
default: "dark:text-gray-500 dark:bg-gray-900 dark:border-gray-800 dark:hover:text-light dark:hover:bg-gray-800 dark:hover:border-gray-700 dark:focus-within:bg-gray-100 dark:focus-within:border-gray-800 dark:focus-within:hover:bg-gray-700 dark:focus-within:text-dark dark:has-[:disabled]:bg-gray-700 bg-gray-100 border-gray-200 text-gray-600 hover:border-gray-300 hover:text-gray-500 hover:bg-gray-300 focus-within:bg-gray-50 focus-within:border-gray-400 focus-within:text-dark focus-within:hover:text-dark focus-within:hover:border-primary-100 focus-within:hover:bg-primary-50 has-[:disabled]:bg-gray-25 has-[:disabled]:border-gray-400",
|
|
631
811
|
glass: "backdrop-blur-[3.5px] bg-light/10 dark:bg-dark/20 dark:border-gray-800 border-gray-200/50 text-light"
|
|
632
812
|
}
|
|
633
813
|
},
|
|
@@ -636,9 +816,9 @@ var inputVariants = (0, import_class_variance_authority6.cva)(
|
|
|
636
816
|
}
|
|
637
817
|
}
|
|
638
818
|
);
|
|
639
|
-
var Input = (0,
|
|
819
|
+
var Input = (0, import_react11.forwardRef)(
|
|
640
820
|
({ startIcon, endIcon, className, variant, type, disabled, ...props }, ref) => {
|
|
641
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", { className: cn(inputVariants({ variant, className })) }, startIcon, /* @__PURE__ */ import_react11.default.createElement(
|
|
642
822
|
"input",
|
|
643
823
|
{
|
|
644
824
|
...props,
|
|
@@ -654,9 +834,9 @@ Input.displayName = "Input";
|
|
|
654
834
|
var Input_default = Input;
|
|
655
835
|
|
|
656
836
|
// src/components/Label.tsx
|
|
657
|
-
var
|
|
658
|
-
var
|
|
659
|
-
var labelVariants = (0,
|
|
837
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
838
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
839
|
+
var labelVariants = (0, import_class_variance_authority8.cva)("font-medium text-dark dark:text-light", {
|
|
660
840
|
variants: {
|
|
661
841
|
size: {
|
|
662
842
|
sm: "text-xs",
|
|
@@ -677,7 +857,7 @@ var Label = ({
|
|
|
677
857
|
className,
|
|
678
858
|
...props
|
|
679
859
|
}) => {
|
|
680
|
-
return /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
681
861
|
"label",
|
|
682
862
|
{
|
|
683
863
|
htmlFor,
|
|
@@ -689,61 +869,545 @@ var Label = ({
|
|
|
689
869
|
...props
|
|
690
870
|
},
|
|
691
871
|
children,
|
|
692
|
-
required && /* @__PURE__ */
|
|
872
|
+
required && /* @__PURE__ */ import_react12.default.createElement("span", { className: "text-error" }, "*")
|
|
693
873
|
);
|
|
694
874
|
};
|
|
695
875
|
var Label_default = Label;
|
|
696
876
|
|
|
697
|
-
// src/components/
|
|
698
|
-
var
|
|
699
|
-
var
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
877
|
+
// src/components/Dropdown.tsx
|
|
878
|
+
var import_react14 = require("react");
|
|
879
|
+
var defaultRenderItem = (option, state) => {
|
|
880
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
881
|
+
MenuItem,
|
|
882
|
+
{
|
|
883
|
+
label: option.label,
|
|
884
|
+
value: option.value,
|
|
885
|
+
selected: state.selected,
|
|
886
|
+
disabled: state.disabled
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
};
|
|
890
|
+
var Dropdown = (0, import_react13.forwardRef)(
|
|
891
|
+
({
|
|
892
|
+
id: controlledId,
|
|
893
|
+
options,
|
|
894
|
+
selected,
|
|
895
|
+
setSelected,
|
|
896
|
+
search = false,
|
|
897
|
+
multiple = false,
|
|
898
|
+
dropdownText = "Select",
|
|
899
|
+
renderItem = defaultRenderItem,
|
|
900
|
+
children,
|
|
901
|
+
icon,
|
|
902
|
+
position = "top",
|
|
903
|
+
width,
|
|
904
|
+
info,
|
|
905
|
+
dropdownFooter = false,
|
|
906
|
+
onApply,
|
|
907
|
+
disabled = false,
|
|
908
|
+
onReset,
|
|
909
|
+
footerAction,
|
|
910
|
+
height = "200px"
|
|
911
|
+
}, ref) => {
|
|
912
|
+
const reactId = (0, import_react14.useId)();
|
|
913
|
+
const id = controlledId ?? `dropdown-${reactId}`;
|
|
914
|
+
const [searchQuery, setSearchQuery] = (0, import_react13.useState)("");
|
|
915
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react13.useState)(
|
|
916
|
+
options || []
|
|
917
|
+
);
|
|
918
|
+
const [dropdownMenu, setDropdownMenu] = (0, import_react13.useState)(false);
|
|
919
|
+
const dropdownRef = (0, import_react13.useRef)(null);
|
|
920
|
+
(0, import_react13.useImperativeHandle)(ref, () => dropdownRef.current);
|
|
921
|
+
(0, import_react13.useEffect)(() => {
|
|
922
|
+
if (options) {
|
|
923
|
+
setFilteredOptions(options);
|
|
924
|
+
}
|
|
925
|
+
}, [options]);
|
|
926
|
+
const memoizedFilteredOptions = (0, import_react13.useMemo)(() => {
|
|
927
|
+
if (!search) return filteredOptions;
|
|
928
|
+
return filteredOptions.filter((option) => {
|
|
929
|
+
if (typeof option.label === "string") {
|
|
930
|
+
return option.label.toLowerCase().includes(searchQuery.toLowerCase());
|
|
931
|
+
}
|
|
932
|
+
return option.label.toString().includes(searchQuery.toLowerCase());
|
|
933
|
+
});
|
|
934
|
+
}, [search, searchQuery, filteredOptions]);
|
|
935
|
+
const handleSearchChange = (0, import_react13.useCallback)(
|
|
936
|
+
(e) => {
|
|
937
|
+
setSearchQuery(e.target.value);
|
|
938
|
+
},
|
|
939
|
+
[]
|
|
940
|
+
);
|
|
941
|
+
const toggleOption = (0, import_react13.useCallback)(
|
|
942
|
+
(option) => {
|
|
943
|
+
if (multiple && setSelected) {
|
|
944
|
+
setSelected(
|
|
945
|
+
(prevSelected) => prevSelected.some((item) => item.value === option.value) ? prevSelected.filter((item) => item.value !== option.value) : [...prevSelected, option]
|
|
946
|
+
);
|
|
947
|
+
} else if (setSelected) {
|
|
948
|
+
setSelected([option]);
|
|
949
|
+
setDropdownMenu(false);
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
[multiple, setSelected]
|
|
953
|
+
);
|
|
954
|
+
const handleSelectAll = () => {
|
|
955
|
+
if (selected?.length === filteredOptions.length) {
|
|
956
|
+
setSelected?.([]);
|
|
957
|
+
} else {
|
|
958
|
+
setSelected?.(filteredOptions);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
const handleReset = () => {
|
|
962
|
+
if (onReset) {
|
|
963
|
+
onReset();
|
|
964
|
+
}
|
|
965
|
+
setSelected?.([]);
|
|
966
|
+
setDropdownMenu(false);
|
|
967
|
+
};
|
|
968
|
+
(0, import_react13.useEffect)(() => {
|
|
969
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
970
|
+
return () => {
|
|
971
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
972
|
+
};
|
|
973
|
+
}, []);
|
|
974
|
+
const handleClickOutside = (event) => {
|
|
975
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
976
|
+
setDropdownMenu(false);
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
980
|
+
"div",
|
|
981
|
+
{
|
|
982
|
+
id,
|
|
983
|
+
ref: dropdownRef,
|
|
984
|
+
className: cn(
|
|
985
|
+
"relative rounded-lg shadow-sm font-karla",
|
|
986
|
+
"bg-white dark:bg-gray-900",
|
|
987
|
+
"text-gray-900 dark:text-gray-100",
|
|
988
|
+
!width && "w-full",
|
|
989
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
990
|
+
),
|
|
991
|
+
style: {
|
|
992
|
+
width
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
996
|
+
"button",
|
|
997
|
+
{
|
|
998
|
+
type: "button",
|
|
999
|
+
"aria-haspopup": "listbox",
|
|
1000
|
+
"aria-expanded": dropdownMenu,
|
|
1001
|
+
"aria-labelledby": `${id}-label`,
|
|
1002
|
+
disabled,
|
|
1003
|
+
onClick: () => {
|
|
1004
|
+
if (!disabled) {
|
|
1005
|
+
setDropdownMenu((prev) => !prev);
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
onKeyDown: (e) => {
|
|
1009
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1010
|
+
e.preventDefault();
|
|
1011
|
+
if (!disabled) {
|
|
1012
|
+
setDropdownMenu((prev) => !prev);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
className: cn(
|
|
1017
|
+
"w-full flex justify-between items-center rounded-lg px-[14px] py-2 text-sm",
|
|
1018
|
+
"border transition-colors",
|
|
1019
|
+
"bg-white dark:bg-gray-900",
|
|
1020
|
+
"text-gray-900 dark:text-gray-100",
|
|
1021
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
1022
|
+
dropdownMenu ? "border-primary-600" : "border-gray-200 dark:border-gray-700",
|
|
1023
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
1024
|
+
)
|
|
1025
|
+
},
|
|
1026
|
+
/* @__PURE__ */ import_react13.default.createElement("section", { className: "flex items-center gap-2 text-ellipsis overflow-hidden" }, icon && /* @__PURE__ */ import_react13.default.createElement("span", { "aria-hidden": "true" }, icon), /* @__PURE__ */ import_react13.default.createElement("span", { id: `${id}-label`, className: "line-clamp-1 w-full" }, multiple ? (selected?.length ?? 0) > 0 ? `${selected?.length} Selected` : dropdownText : selected?.[0]?.label ? selected?.[0]?.label : dropdownText)),
|
|
1027
|
+
/* @__PURE__ */ import_react13.default.createElement(import_hi2.HiChevronDown, { "aria-hidden": "true", size: 18 })
|
|
1028
|
+
),
|
|
1029
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
1030
|
+
"ul",
|
|
1031
|
+
{
|
|
1032
|
+
role: "listbox",
|
|
1033
|
+
"aria-multiselectable": multiple,
|
|
1034
|
+
"aria-labelledby": `${id}-label`,
|
|
1035
|
+
className: cn(
|
|
1036
|
+
"absolute z-[1000] w-full mt-1 rounded shadow-md overflow-hidden transition-all",
|
|
1037
|
+
"bg-white dark:bg-gray-900",
|
|
1038
|
+
"text-gray-900 dark:text-gray-100",
|
|
1039
|
+
dropdownMenu ? "opacity-100 max-h-[360px]" : "opacity-0 max-h-0",
|
|
1040
|
+
position === "top" ? "top-10" : "bottom-10",
|
|
1041
|
+
dropdownMenu ? "border border-primary-600" : "border border-gray-200 dark:border-gray-700"
|
|
1042
|
+
)
|
|
1043
|
+
},
|
|
1044
|
+
search && /* @__PURE__ */ import_react13.default.createElement(
|
|
1045
|
+
Input_default,
|
|
1046
|
+
{
|
|
1047
|
+
id: `${id}-search`,
|
|
1048
|
+
type: "text",
|
|
1049
|
+
placeholder: "Search...",
|
|
1050
|
+
"aria-label": "Search options",
|
|
1051
|
+
value: searchQuery,
|
|
1052
|
+
onChange: handleSearchChange,
|
|
1053
|
+
className: "rounded-none text-gray-800 text-sm bg-white w-full h-[35px] pl-3 border-none",
|
|
1054
|
+
endIcon: /* @__PURE__ */ import_react13.default.createElement(import_hi2.HiOutlineSearch, { size: 18 })
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
multiple && /* @__PURE__ */ import_react13.default.createElement("section", { className: "py-[6px] px-[14px] flex justify-between items-center" }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1058
|
+
"button",
|
|
1059
|
+
{
|
|
1060
|
+
type: "button",
|
|
1061
|
+
"aria-label": "Select all",
|
|
1062
|
+
onClick: handleSelectAll,
|
|
1063
|
+
className: "text-sm hover:text-primary-700 text-primary-600 dark:text-primary-300 cursor-pointer"
|
|
1064
|
+
},
|
|
1065
|
+
"Select all"
|
|
1066
|
+
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1067
|
+
"button",
|
|
1068
|
+
{
|
|
1069
|
+
"aria-label": "Reset",
|
|
1070
|
+
type: "button",
|
|
1071
|
+
className: "text-sm text-warning-500 hover:text-warning-600",
|
|
1072
|
+
onClick: handleReset
|
|
1073
|
+
},
|
|
1074
|
+
"Reset"
|
|
1075
|
+
)),
|
|
1076
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
1077
|
+
"section",
|
|
1078
|
+
{
|
|
1079
|
+
style: { maxHeight: height },
|
|
1080
|
+
className: "z-[1000] transition-all duration-75 delay-100 ease-in-out overflow-y-scroll"
|
|
1081
|
+
},
|
|
1082
|
+
options ? memoizedFilteredOptions?.map((option, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, { key: `${option.value}-${i}` }, multiple ? /* @__PURE__ */ import_react13.default.createElement(
|
|
1083
|
+
Label_default,
|
|
1084
|
+
{
|
|
1085
|
+
className: cn(
|
|
1086
|
+
"flex flex-col cursor-pointer border-l-4 px-[14px] py-[6px]",
|
|
1087
|
+
"bg-white dark:bg-gray-900",
|
|
1088
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
1089
|
+
"border-transparent",
|
|
1090
|
+
"has-[:checked]:bg-primary-50 dark:has-[:checked]:bg-gray-800",
|
|
1091
|
+
"has-[:checked]:border-primary-600",
|
|
1092
|
+
option.disabledOption && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
1093
|
+
),
|
|
1094
|
+
htmlFor: `${id}-checkbox-${option.value}`,
|
|
1095
|
+
key: i
|
|
1096
|
+
},
|
|
1097
|
+
/* @__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(
|
|
1098
|
+
Checkbox_default,
|
|
1099
|
+
{
|
|
1100
|
+
square: true,
|
|
1101
|
+
id: `${id}-checkbox-${option.value}`,
|
|
1102
|
+
checked: selected?.some(
|
|
1103
|
+
(item) => item.value === option.value
|
|
1104
|
+
) ?? false,
|
|
1105
|
+
onChange: () => toggleOption(option),
|
|
1106
|
+
disabled: !!option.disabledOption
|
|
1107
|
+
}
|
|
1108
|
+
), /* @__PURE__ */ import_react13.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1109
|
+
"div",
|
|
1110
|
+
{
|
|
1111
|
+
style: {
|
|
1112
|
+
color: option?.disabledOption ? "#D1D5DB" : option.labelTextColor
|
|
1113
|
+
},
|
|
1114
|
+
className: cn(
|
|
1115
|
+
"break-words",
|
|
1116
|
+
option?.disabledOption && "text-gray-300"
|
|
1117
|
+
)
|
|
1118
|
+
},
|
|
1119
|
+
renderItem(option, {
|
|
1120
|
+
selected: selected?.some(
|
|
1121
|
+
(item) => item.value === option.value
|
|
1122
|
+
) ?? false,
|
|
1123
|
+
disabled: !!option.disabledOption
|
|
1124
|
+
})
|
|
1125
|
+
))), /* @__PURE__ */ import_react13.default.createElement("span", { className: "text-gray-500" }, option?.info)),
|
|
1126
|
+
/* @__PURE__ */ import_react13.default.createElement("span", { className: "pt-[2px] text-sm text-gray-500" }, option?.addInfo)
|
|
1127
|
+
) : /* @__PURE__ */ import_react13.default.createElement(
|
|
1128
|
+
Label_default,
|
|
1129
|
+
{
|
|
1130
|
+
key: i,
|
|
1131
|
+
htmlFor: `${id}-checkbox-${option.value}`,
|
|
1132
|
+
className: cn(
|
|
1133
|
+
"flex justify-between items-center px-[14px] py-[6px] border-l-4 cursor-pointer",
|
|
1134
|
+
"bg-white dark:bg-gray-900",
|
|
1135
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
1136
|
+
"border-transparent",
|
|
1137
|
+
selected?.[0]?.value === option.value && "bg-primary-50 dark:bg-gray-800 border-primary-600",
|
|
1138
|
+
option.disabledOption && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
1139
|
+
),
|
|
1140
|
+
onClick: () => !option?.disabledOption && toggleOption(option)
|
|
1141
|
+
},
|
|
1142
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
1143
|
+
MenuItem,
|
|
1144
|
+
{
|
|
1145
|
+
label: option.label,
|
|
1146
|
+
selected: selected?.[0]?.value === option.value,
|
|
1147
|
+
disabled: !!option.disabledOption
|
|
1148
|
+
}
|
|
1149
|
+
),
|
|
1150
|
+
/* @__PURE__ */ import_react13.default.createElement("span", { className: "text-gray-500" }, info)
|
|
1151
|
+
))) : children
|
|
1152
|
+
),
|
|
1153
|
+
footerAction && /* @__PURE__ */ import_react13.default.createElement("div", { className: "py-2 mt-1 px-2 border-t" }, footerAction),
|
|
1154
|
+
dropdownFooter && /* @__PURE__ */ import_react13.default.createElement(
|
|
1155
|
+
DropdownFooter,
|
|
1156
|
+
{
|
|
1157
|
+
setDropdownMenu,
|
|
1158
|
+
onApply
|
|
1159
|
+
}
|
|
1160
|
+
)
|
|
1161
|
+
)
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
);
|
|
1165
|
+
var MenuItem = ({
|
|
1166
|
+
label,
|
|
1167
|
+
selected,
|
|
1168
|
+
disabled,
|
|
1169
|
+
children
|
|
1170
|
+
}) => {
|
|
1171
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
1172
|
+
"p",
|
|
1173
|
+
{
|
|
1174
|
+
className: cn(
|
|
1175
|
+
"break-all transition-colors",
|
|
1176
|
+
"text-gray-900 dark:text-gray-100",
|
|
1177
|
+
selected && "text-gray-900 dark:text-white font-medium",
|
|
1178
|
+
disabled && "text-gray-300 dark:text-gray-500"
|
|
1179
|
+
)
|
|
1180
|
+
},
|
|
1181
|
+
label ?? children
|
|
1182
|
+
);
|
|
1183
|
+
};
|
|
1184
|
+
var DropdownFooter = ({
|
|
1185
|
+
onApply,
|
|
1186
|
+
setDropdownMenu
|
|
1187
|
+
}) => {
|
|
1188
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { className: "flex justify-end border-t border-gray-200 dark:border-gray-700 px-[14px] py-[8px] text-sm" }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1189
|
+
"button",
|
|
1190
|
+
{
|
|
1191
|
+
type: "button",
|
|
1192
|
+
className: "text-primary-600 dark:text-primary-300 hover:text-primary-700",
|
|
1193
|
+
onClick: () => {
|
|
1194
|
+
if (onApply) {
|
|
1195
|
+
onApply();
|
|
1196
|
+
}
|
|
1197
|
+
if (setDropdownMenu) {
|
|
1198
|
+
setDropdownMenu(false);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
},
|
|
1202
|
+
"Apply"
|
|
1203
|
+
));
|
|
1204
|
+
};
|
|
1205
|
+
Dropdown.displayName = "Dropdown";
|
|
1206
|
+
var Dropdown_default = Dropdown;
|
|
1207
|
+
|
|
1208
|
+
// src/components/FillButton.tsx
|
|
1209
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
1210
|
+
var FillButton = ({
|
|
1211
|
+
label,
|
|
1212
|
+
icon: Icon,
|
|
1213
|
+
fillColor = "bg-white",
|
|
1214
|
+
textHoverColor = "group-hover:text-primary-900",
|
|
1215
|
+
className,
|
|
1216
|
+
...props
|
|
1217
|
+
}) => {
|
|
1218
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1219
|
+
"button",
|
|
1220
|
+
{
|
|
1221
|
+
...props,
|
|
1222
|
+
className: cn(
|
|
1223
|
+
"relative overflow-hidden group px-6 py-4 rounded-full flex text-dark dark:text-light items-center gap-2 w-full justify-between border dark:border-gray-400 transition-colors",
|
|
1224
|
+
className
|
|
1225
|
+
)
|
|
1226
|
+
},
|
|
1227
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
1228
|
+
"span",
|
|
1229
|
+
{
|
|
1230
|
+
className: cn(
|
|
1231
|
+
"absolute inset-0 scale-x-0 origin-left transition-transform duration-500 group-hover:scale-x-100",
|
|
1232
|
+
fillColor
|
|
1233
|
+
)
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1236
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { className: cn("relative z-10 transition-colors", textHoverColor) }, label),
|
|
1237
|
+
Icon && /* @__PURE__ */ import_react15.default.createElement(
|
|
1238
|
+
Icon,
|
|
1239
|
+
{
|
|
1240
|
+
size: 18,
|
|
1241
|
+
className: cn("relative z-10 transition-colors", textHoverColor)
|
|
1242
|
+
}
|
|
1243
|
+
)
|
|
1244
|
+
);
|
|
1245
|
+
};
|
|
1246
|
+
var FillButton_default = FillButton;
|
|
1247
|
+
|
|
1248
|
+
// src/components/Footer.tsx
|
|
1249
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
1250
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
1251
|
+
function Footer({
|
|
1252
|
+
children,
|
|
1253
|
+
className,
|
|
1254
|
+
footerBottom
|
|
1255
|
+
}) {
|
|
1256
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1257
|
+
"footer",
|
|
1258
|
+
{
|
|
1259
|
+
className: cn(
|
|
1260
|
+
"bg-gradient-to-b from-gray-25 to-primary-100 dark:from-primary-900 dark:to-dark",
|
|
1261
|
+
className
|
|
1262
|
+
)
|
|
1263
|
+
},
|
|
1264
|
+
children,
|
|
1265
|
+
footerBottom && /* @__PURE__ */ import_react16.default.createElement("section", { className: "border-t border-primary-500 dark:border-primary-800 text-center py-spacing-md" }, footerBottom)
|
|
1266
|
+
);
|
|
1267
|
+
}
|
|
1268
|
+
var FooterHeader = ({ children, className }) => {
|
|
1269
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
className: cn(
|
|
1273
|
+
"md:w-[30%] space-y-4 flex flex-col items-center lg:items-start",
|
|
1274
|
+
className
|
|
1275
|
+
)
|
|
1276
|
+
},
|
|
1277
|
+
children
|
|
1278
|
+
);
|
|
1279
|
+
};
|
|
1280
|
+
var FooterContent = ({ children, className }) => {
|
|
1281
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1282
|
+
"section",
|
|
1283
|
+
{
|
|
1284
|
+
className: cn(
|
|
1285
|
+
"max-w-6xl mx-auto flex md:flex-row flex-col items-center md:items-start justify-between gap-14 px-4 md:px-20 py-20",
|
|
1286
|
+
className
|
|
1287
|
+
)
|
|
1288
|
+
},
|
|
1289
|
+
children
|
|
1290
|
+
);
|
|
1291
|
+
};
|
|
1292
|
+
var FooterList = ({ footerItems, target }) => {
|
|
1293
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1294
|
+
"div",
|
|
1295
|
+
{
|
|
1296
|
+
className: cn(
|
|
1297
|
+
"grid place-items-start gap-8 text-center md:text-left",
|
|
1298
|
+
footerItems.length === 2 && "md:grid-cols-2",
|
|
1299
|
+
(footerItems.length > 3 || footerItems.length === 3) && "lg:grid-cols-3 md:grid-cols-2"
|
|
1300
|
+
)
|
|
1301
|
+
},
|
|
1302
|
+
footerItems?.map((data, i) => /* @__PURE__ */ import_react16.default.createElement("div", { key: i, className: "space-y-3 w-full" }, /* @__PURE__ */ import_react16.default.createElement(Paragraph_default, { variant: "b3", className: "text-primary-600" }, data?.label), /* @__PURE__ */ import_react16.default.createElement("ul", { className: "space-y-2 list-none" }, data?.content?.map((data2, i2) => /* @__PURE__ */ import_react16.default.createElement("li", { key: i2 }, /* @__PURE__ */ import_react16.default.createElement(import_link.default, { href: data2?.link, target }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1303
|
+
Paragraph_default,
|
|
1304
|
+
{
|
|
1305
|
+
variant: "b4",
|
|
1306
|
+
className: "dark:text-gray-300 hover:text-primary-400 dark:hover:text-primary-600 font-semibold text-gray-900"
|
|
1307
|
+
},
|
|
1308
|
+
data2?.text
|
|
1309
|
+
)))))))
|
|
1310
|
+
);
|
|
1311
|
+
};
|
|
1312
|
+
var FooterIcons = ({ icons }) => {
|
|
1313
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { className: "flex flex-wrap justify-center items-center gap-5 text-primary-700 dark:text-primary-200" }, icons.map((icon, index) => /* @__PURE__ */ import_react16.default.createElement(
|
|
1314
|
+
import_link.default,
|
|
1315
|
+
{
|
|
1316
|
+
href: icon.link,
|
|
1317
|
+
key: index,
|
|
1318
|
+
target: "_blank",
|
|
1319
|
+
className: "hover:bg-primary-100 dark:hover:bg-primary-800 p-1 rounded-radius-sm"
|
|
1320
|
+
},
|
|
1321
|
+
icon.icon
|
|
1322
|
+
)));
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
// src/components/ImageCard.tsx
|
|
1326
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
1327
|
+
var ImageCard = ({
|
|
1328
|
+
cardTitle,
|
|
1329
|
+
cardDesc,
|
|
1330
|
+
cardImg,
|
|
1331
|
+
children,
|
|
1332
|
+
className = ""
|
|
1333
|
+
}) => {
|
|
1334
|
+
const backgroundImage = `url('${cardImg}')`;
|
|
1335
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1336
|
+
"div",
|
|
1337
|
+
{
|
|
1338
|
+
className: cn(
|
|
1339
|
+
"transition-all duration-300 ease-in-out hover:ring-1 hover:ring-[#4285F4] relative rounded-radius-xl overflow-hidden block z-10 bg-cover bg-no-repeat bg-center",
|
|
1340
|
+
className
|
|
1341
|
+
),
|
|
1342
|
+
style: {
|
|
1343
|
+
backgroundImage
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
/* @__PURE__ */ import_react17.default.createElement("div", { className: "absolute inset-0 z-[-5] transition-all duration-300 ease-in-out bg-gradient-to-b from-transparent via-black/50 to-black" }),
|
|
1347
|
+
/* @__PURE__ */ import_react17.default.createElement("section", { className: "p-[32px] w-full h-full flex flex-col justify-end font-karla hover:bg-gradient-to-b hover:from-black/60 hover:via-black/70 hover:to-[#070707]" }, /* @__PURE__ */ import_react17.default.createElement(CardTitle, { className: "text-[24px] font-bold text-white mt-4 mb-6" }, cardTitle), /* @__PURE__ */ import_react17.default.createElement(CardDescription, { className: "text-[20px] leading-[25px] text-white" }, cardDesc), /* @__PURE__ */ import_react17.default.createElement("div", null, children))
|
|
1348
|
+
);
|
|
1349
|
+
};
|
|
1350
|
+
var ImageCard_default = ImageCard;
|
|
1351
|
+
|
|
1352
|
+
// src/components/ListItem.tsx
|
|
1353
|
+
var import_link2 = __toESM(require("next/link"), 1);
|
|
1354
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
1355
|
+
var import_navigation = require("next/navigation");
|
|
1356
|
+
var ListItem = import_react18.default.forwardRef(
|
|
1357
|
+
({ className, title, href, onClick, as = "link", variant = "solid", icon }, ref) => {
|
|
1358
|
+
const pathname = (0, import_navigation.usePathname)();
|
|
1359
|
+
const isActive = as === "link" && href === pathname;
|
|
1360
|
+
const variantClasses = variant === "solid" ? "rounded-radius-lg hover:bg-primary-50 text-dark group border border-transparent hover:border-primary-200 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:text-white leading-none no-underline outline-none transition-colors" : variant === "glass" ? "rounded-radius-lg group border border-transparent hover:border-primary-200 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:text-white leading-none no-underline outline-none transition-colors" : "";
|
|
1361
|
+
if (as === "button") {
|
|
1362
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1363
|
+
"button",
|
|
709
1364
|
{
|
|
710
1365
|
className: cn(
|
|
711
|
-
"px-4 py-[8px] font-karla",
|
|
1366
|
+
"px-4 py-[8px] group font-karla w-full text-left flex items-center gap-2",
|
|
712
1367
|
variantClasses,
|
|
713
1368
|
className
|
|
714
1369
|
),
|
|
715
1370
|
onClick,
|
|
716
1371
|
ref
|
|
717
1372
|
},
|
|
718
|
-
/* @__PURE__ */
|
|
1373
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
719
1374
|
Typography_default,
|
|
720
1375
|
{
|
|
721
1376
|
variant: "h6",
|
|
722
1377
|
className: cn("font-karla group-hover:dark:text-dark", className)
|
|
723
1378
|
},
|
|
724
1379
|
title
|
|
725
|
-
)
|
|
1380
|
+
),
|
|
1381
|
+
icon && /* @__PURE__ */ import_react18.default.createElement("span", { className: "text-dark dark:text-white" }, icon)
|
|
726
1382
|
);
|
|
727
1383
|
}
|
|
728
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
729
1385
|
import_link2.default,
|
|
730
1386
|
{
|
|
731
1387
|
href: href ?? "",
|
|
732
1388
|
passHref: true,
|
|
733
1389
|
className: cn(
|
|
734
|
-
"px-4 py-[8px] font-karla",
|
|
735
|
-
isActive ? "bg-
|
|
1390
|
+
"px-4 py-[8px] font-karla w-full flex items-center gap-2 group",
|
|
1391
|
+
isActive ? "bg-primary-400 text-white border border-primary-200" : variantClasses,
|
|
736
1392
|
className
|
|
737
1393
|
),
|
|
738
1394
|
ref
|
|
739
1395
|
},
|
|
740
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
741
1397
|
Typography_default,
|
|
742
1398
|
{
|
|
743
1399
|
variant: "h6",
|
|
744
1400
|
className: cn("font-karla group-hover:dark:text-dark", className)
|
|
745
1401
|
},
|
|
746
1402
|
title
|
|
1403
|
+
),
|
|
1404
|
+
icon && /* @__PURE__ */ import_react18.default.createElement(
|
|
1405
|
+
Caption_default,
|
|
1406
|
+
{
|
|
1407
|
+
variant: "md",
|
|
1408
|
+
className: "text-dark dark:text-white group-hover:dark:text-dark"
|
|
1409
|
+
},
|
|
1410
|
+
icon
|
|
747
1411
|
)
|
|
748
1412
|
);
|
|
749
1413
|
}
|
|
@@ -751,12 +1415,502 @@ var ListItem = import_react14.default.forwardRef(
|
|
|
751
1415
|
ListItem.displayName = "ListItem";
|
|
752
1416
|
var ListItem_default = ListItem;
|
|
753
1417
|
|
|
1418
|
+
// src/components/ListPagination.tsx
|
|
1419
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
1420
|
+
var import_ri2 = require("react-icons/ri");
|
|
1421
|
+
var ListPagination = ({
|
|
1422
|
+
count,
|
|
1423
|
+
page,
|
|
1424
|
+
rowsPerPage,
|
|
1425
|
+
onPageChange,
|
|
1426
|
+
className
|
|
1427
|
+
}) => {
|
|
1428
|
+
const totalPages = Math.ceil(count / rowsPerPage);
|
|
1429
|
+
const [expanded, setExpanded] = (0, import_react19.useState)(false);
|
|
1430
|
+
const renderPages = () => {
|
|
1431
|
+
if (totalPages <= 6 || expanded) {
|
|
1432
|
+
return [...Array(totalPages)].map((_, i) => /* @__PURE__ */ import_react19.default.createElement(PageBtn, { key: i, i, page, onPageChange }));
|
|
1433
|
+
}
|
|
1434
|
+
const start = [0, 1];
|
|
1435
|
+
const mid = [page - 1, page, page + 1].filter(
|
|
1436
|
+
(i) => i > 1 && i < totalPages - 2
|
|
1437
|
+
);
|
|
1438
|
+
const end = [totalPages - 2, totalPages - 1];
|
|
1439
|
+
const range = Array.from(/* @__PURE__ */ new Set([...start, ...mid, ...end]));
|
|
1440
|
+
return range.map(
|
|
1441
|
+
(i, idx) => typeof range[idx - 1] === "number" && i - range[idx - 1] > 1 ? /* @__PURE__ */ import_react19.default.createElement(
|
|
1442
|
+
Button_default,
|
|
1443
|
+
{
|
|
1444
|
+
key: `dots-${i}`,
|
|
1445
|
+
size: "sm",
|
|
1446
|
+
variant: "secondary",
|
|
1447
|
+
onClick: () => setExpanded(true)
|
|
1448
|
+
},
|
|
1449
|
+
"..."
|
|
1450
|
+
) : /* @__PURE__ */ import_react19.default.createElement(PageBtn, { key: i, i, page, onPageChange })
|
|
1451
|
+
);
|
|
1452
|
+
};
|
|
1453
|
+
return /* @__PURE__ */ import_react19.default.createElement("section", { className: cn("flex items-center gap-1", className) }, /* @__PURE__ */ import_react19.default.createElement(
|
|
1454
|
+
NavBtn,
|
|
1455
|
+
{
|
|
1456
|
+
icon: /* @__PURE__ */ import_react19.default.createElement(import_ri2.RiArrowLeftSLine, { size: 28 }),
|
|
1457
|
+
onClick: () => onPageChange(page - 1),
|
|
1458
|
+
disabled: page === 0
|
|
1459
|
+
}
|
|
1460
|
+
), /* @__PURE__ */ import_react19.default.createElement("div", { className: "max-w-[90vw] w-max overflow-auto flex items-center gap-2 p-2" }, renderPages()), /* @__PURE__ */ import_react19.default.createElement(
|
|
1461
|
+
NavBtn,
|
|
1462
|
+
{
|
|
1463
|
+
icon: /* @__PURE__ */ import_react19.default.createElement(import_ri2.RiArrowRightSLine, { size: 28 }),
|
|
1464
|
+
onClick: () => onPageChange(page + 1),
|
|
1465
|
+
disabled: page === totalPages - 1
|
|
1466
|
+
}
|
|
1467
|
+
));
|
|
1468
|
+
};
|
|
1469
|
+
var PageBtn = ({
|
|
1470
|
+
i,
|
|
1471
|
+
page,
|
|
1472
|
+
onPageChange
|
|
1473
|
+
}) => /* @__PURE__ */ import_react19.default.createElement(
|
|
1474
|
+
Button_default,
|
|
1475
|
+
{
|
|
1476
|
+
size: "sm",
|
|
1477
|
+
variant: "secondary",
|
|
1478
|
+
className: cn(
|
|
1479
|
+
// "dark:bg-transparent dark:border dark:text-gray-300 dark:border-gray-400",
|
|
1480
|
+
i === page && "bg-primary-50 shadow-[0px_0px_0px_2px] shadow-primary-700 hover:shadow-[0px_0px_0px_2px] hover:shadow-primary-700 dark:shadow-primary-200 dark:bg-primary-300"
|
|
1481
|
+
),
|
|
1482
|
+
onClick: () => onPageChange(i)
|
|
1483
|
+
},
|
|
1484
|
+
i + 1
|
|
1485
|
+
);
|
|
1486
|
+
var NavBtn = ({
|
|
1487
|
+
icon,
|
|
1488
|
+
onClick,
|
|
1489
|
+
disabled
|
|
1490
|
+
}) => /* @__PURE__ */ import_react19.default.createElement(
|
|
1491
|
+
Button_default,
|
|
1492
|
+
{
|
|
1493
|
+
size: "sm",
|
|
1494
|
+
variant: "primary-light",
|
|
1495
|
+
startIcon: icon,
|
|
1496
|
+
onClick,
|
|
1497
|
+
disabled,
|
|
1498
|
+
className: "border border-primary-100 px-1.5"
|
|
1499
|
+
}
|
|
1500
|
+
);
|
|
1501
|
+
var ListPagination_default = ListPagination;
|
|
1502
|
+
|
|
1503
|
+
// src/components/Loading.tsx
|
|
1504
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
1505
|
+
var Loading = ({ width, height, loaderColor, variant }) => {
|
|
1506
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1507
|
+
"div",
|
|
1508
|
+
{
|
|
1509
|
+
className: cn(
|
|
1510
|
+
"animate-spin-slow border-primary-600 border-t-gray-200/50 rounded-full",
|
|
1511
|
+
variant === "light" ? "border-2" : "border-4"
|
|
1512
|
+
),
|
|
1513
|
+
style: {
|
|
1514
|
+
width,
|
|
1515
|
+
height,
|
|
1516
|
+
borderColor: loaderColor,
|
|
1517
|
+
borderTopColor: "rgb(234 236 240 / 0.5)"
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
);
|
|
1521
|
+
};
|
|
1522
|
+
var Loading_default = Loading;
|
|
1523
|
+
|
|
1524
|
+
// src/components/Modal.tsx
|
|
1525
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
1526
|
+
var import_ri3 = require("react-icons/ri");
|
|
1527
|
+
function Modal({
|
|
1528
|
+
children,
|
|
1529
|
+
showModal,
|
|
1530
|
+
setShowModal,
|
|
1531
|
+
closeModal = true,
|
|
1532
|
+
closeOnOutsideClick = true,
|
|
1533
|
+
className = "",
|
|
1534
|
+
width = "50%"
|
|
1535
|
+
}) {
|
|
1536
|
+
(0, import_react21.useEffect)(() => {
|
|
1537
|
+
if (showModal) {
|
|
1538
|
+
document.body.style.overflow = "hidden";
|
|
1539
|
+
} else {
|
|
1540
|
+
document.body.style.overflow = "auto";
|
|
1541
|
+
}
|
|
1542
|
+
return () => {
|
|
1543
|
+
document.body.style.overflow = "auto";
|
|
1544
|
+
};
|
|
1545
|
+
}, [showModal]);
|
|
1546
|
+
const handleClickOutside = (event) => {
|
|
1547
|
+
if (event.target === event.currentTarget && closeOnOutsideClick) {
|
|
1548
|
+
setShowModal(false);
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1551
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, showModal && /* @__PURE__ */ import_react21.default.createElement(
|
|
1552
|
+
"div",
|
|
1553
|
+
{
|
|
1554
|
+
onClick: handleClickOutside,
|
|
1555
|
+
className: "w-full h-full bg-backdrop dark:bg-white/25 bg-blend-overlay fixed top-0 bottom-0 left-0 right-0 flex justify-center items-center z-[1000000] overflow-hidden"
|
|
1556
|
+
},
|
|
1557
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
1558
|
+
"div",
|
|
1559
|
+
{
|
|
1560
|
+
style: { width },
|
|
1561
|
+
className: cn(
|
|
1562
|
+
"relative bg-white dark:bg-dark shadow-boxShadow rounded-xl p-[18px] transition-all duration-150 fade-in-grow mx-4",
|
|
1563
|
+
className
|
|
1564
|
+
)
|
|
1565
|
+
},
|
|
1566
|
+
/* @__PURE__ */ import_react21.default.createElement("div", null, children),
|
|
1567
|
+
closeModal && /* @__PURE__ */ import_react21.default.createElement(
|
|
1568
|
+
"div",
|
|
1569
|
+
{
|
|
1570
|
+
className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop dark:text-white dark:hover:bg-gray-700 rounded-md cursor-pointer hover:bg-gray-100",
|
|
1571
|
+
onClick: () => setShowModal(false)
|
|
1572
|
+
},
|
|
1573
|
+
/* @__PURE__ */ import_react21.default.createElement(import_ri3.RiCloseLine, { size: 24 })
|
|
1574
|
+
)
|
|
1575
|
+
)
|
|
1576
|
+
));
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
// src/components/NestedDropdown.tsx
|
|
1580
|
+
var import_fi = require("react-icons/fi");
|
|
1581
|
+
var import_react22 = require("react");
|
|
1582
|
+
var NestedDropdown = ({
|
|
1583
|
+
data,
|
|
1584
|
+
onSelect,
|
|
1585
|
+
placeholder = "Select Industry",
|
|
1586
|
+
getChildren = (item) => item.children
|
|
1587
|
+
}) => {
|
|
1588
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
|
|
1589
|
+
const [selectedItem, setSelectedItem] = (0, import_react22.useState)(null);
|
|
1590
|
+
const [activePath, setActivePath] = (0, import_react22.useState)([]);
|
|
1591
|
+
const dropdownRef = (0, import_react22.useRef)(null);
|
|
1592
|
+
(0, import_react22.useEffect)(() => {
|
|
1593
|
+
const handleClickOutside = (event) => {
|
|
1594
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1595
|
+
setIsOpen(false);
|
|
1596
|
+
setActivePath([]);
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1600
|
+
return () => {
|
|
1601
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1602
|
+
};
|
|
1603
|
+
}, []);
|
|
1604
|
+
const handleItemClick = (item, path) => {
|
|
1605
|
+
setSelectedItem(item);
|
|
1606
|
+
setIsOpen(false);
|
|
1607
|
+
setActivePath([]);
|
|
1608
|
+
onSelect?.(item, path);
|
|
1609
|
+
};
|
|
1610
|
+
const toggleDropdown = () => {
|
|
1611
|
+
setIsOpen(!isOpen);
|
|
1612
|
+
if (isOpen) {
|
|
1613
|
+
setActivePath([]);
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
const handleCategoryClick = (item, level, event) => {
|
|
1617
|
+
const children = getChildren(item);
|
|
1618
|
+
const currentPath = activePath.slice(0, level);
|
|
1619
|
+
currentPath[level] = item;
|
|
1620
|
+
const isDoubleClick = event?.detail === 2;
|
|
1621
|
+
if (children && children.length > 0 && !isDoubleClick) {
|
|
1622
|
+
setActivePath(currentPath);
|
|
1623
|
+
} else {
|
|
1624
|
+
handleItemClick(item, [...currentPath]);
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative w-full max-w-[200px]", ref: dropdownRef }, /* @__PURE__ */ React.createElement(
|
|
1628
|
+
"button",
|
|
1629
|
+
{
|
|
1630
|
+
type: "button",
|
|
1631
|
+
className: "w-full flex justify-between items-center py-3 px-4 text-sm bg-white border border-gray-300 rounded-lg shadow-sm text-left focus:outline-none focus:ring-1 focus:ring-primary-600 focus:border-primary-500 hover:border-gray-400 transition-colors duration-200",
|
|
1632
|
+
onClick: toggleDropdown
|
|
1633
|
+
},
|
|
1634
|
+
/* @__PURE__ */ React.createElement(
|
|
1635
|
+
"span",
|
|
1636
|
+
{
|
|
1637
|
+
className: `whitespace-nowrap text-ellipsis overflow-hidden w-[180px] ${selectedItem ? "text-gray-900 font-medium" : "text-gray-500"}`
|
|
1638
|
+
},
|
|
1639
|
+
selectedItem ? selectedItem.name : placeholder
|
|
1640
|
+
),
|
|
1641
|
+
/* @__PURE__ */ React.createElement(
|
|
1642
|
+
import_fi.FiChevronDown,
|
|
1643
|
+
{
|
|
1644
|
+
className: `w-5 h-5 text-gray-400 transform transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`
|
|
1645
|
+
}
|
|
1646
|
+
)
|
|
1647
|
+
), isOpen && /* @__PURE__ */ React.createElement("div", { className: "absolute z-50 w-[200px] mt-1 bg-white rounded-lg shadow-xl max-h-96" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col h-full" }, /* @__PURE__ */ React.createElement("div", { className: "border-b border-gray-200" }, /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(
|
|
1648
|
+
"input",
|
|
1649
|
+
{
|
|
1650
|
+
type: "text",
|
|
1651
|
+
placeholder: "Search",
|
|
1652
|
+
className: "w-full pl-3 pr-4 py-2 focus:outline-none focus:border-b focus:border-b-primary-600 text-sm"
|
|
1653
|
+
}
|
|
1654
|
+
), /* @__PURE__ */ React.createElement("div", { className: "absolute right-2 top-1/2 transform -translate-y-1/2" }, /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded" }, "Q")))), /* @__PURE__ */ React.createElement("div", { className: "flex-1 overflow-y-auto bg-white max-h-[200px]" }, /* @__PURE__ */ React.createElement("div", { className: "" }, data?.map((item) => {
|
|
1655
|
+
const children = getChildren(item);
|
|
1656
|
+
const hasChildren = children && children.length > 0;
|
|
1657
|
+
const isActive = activePath[0]?._id === item._id;
|
|
1658
|
+
return /* @__PURE__ */ React.createElement(
|
|
1659
|
+
"div",
|
|
1660
|
+
{
|
|
1661
|
+
key: item._id,
|
|
1662
|
+
className: `
|
|
1663
|
+
group flex items-center justify-between py-2 px-3 border border-transparent cursor-pointer
|
|
1664
|
+
transition-colors duration-200 relative
|
|
1665
|
+
${isActive ? "bg-primary-50 text-primary-700 border border-primary-200" : "hover:bg-gray-50"}
|
|
1666
|
+
`,
|
|
1667
|
+
onClick: (e) => handleCategoryClick(item, 0, e)
|
|
1668
|
+
},
|
|
1669
|
+
/* @__PURE__ */ React.createElement("span", { className: "text-sm text-gray-800" }, item.name),
|
|
1670
|
+
hasChildren && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_fi.FiChevronRight, { className: "w-4 h-4 text-gray-400" }))
|
|
1671
|
+
);
|
|
1672
|
+
})))), activePath?.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "absolute left-full top-[36px] flex" }, activePath?.map((pathItem, level) => {
|
|
1673
|
+
const children = getChildren(pathItem);
|
|
1674
|
+
return /* @__PURE__ */ React.createElement(
|
|
1675
|
+
"div",
|
|
1676
|
+
{
|
|
1677
|
+
key: pathItem._id,
|
|
1678
|
+
className: "w-[200px] bg-white border border-gray-200 shadow-xl rounded-b-lg max-h-[200px] overflow-y-auto"
|
|
1679
|
+
},
|
|
1680
|
+
/* @__PURE__ */ React.createElement("div", { className: "" }, /* @__PURE__ */ React.createElement("div", { className: "" }, children?.map((child) => {
|
|
1681
|
+
const childChildren = getChildren(child);
|
|
1682
|
+
const hasChildren = childChildren && childChildren.length > 0;
|
|
1683
|
+
const isActive = activePath[level + 1]?._id === child._id;
|
|
1684
|
+
return /* @__PURE__ */ React.createElement(
|
|
1685
|
+
"div",
|
|
1686
|
+
{
|
|
1687
|
+
key: child._id,
|
|
1688
|
+
className: `
|
|
1689
|
+
group flex items-center justify-between py-2 px-3 border border-transparent cursor-pointer
|
|
1690
|
+
transition-colors duration-200 relative
|
|
1691
|
+
${isActive ? "bg-primary-50 text-primary-700 border border-primary-200" : "hover:bg-gray-50"}
|
|
1692
|
+
`,
|
|
1693
|
+
onClick: (e) => handleCategoryClick(child, level + 1, e)
|
|
1694
|
+
},
|
|
1695
|
+
/* @__PURE__ */ React.createElement("span", { className: "text-sm text-gray-800" }, child.name),
|
|
1696
|
+
hasChildren && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_fi.FiChevronRight, { className: "w-4 h-4 text-gray-400" }), /* @__PURE__ */ React.createElement("div", { className: "absolute opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-gray-800 text-white text-xs py-1 px-2 rounded bottom-full mb-1 left-1/2 transform -translate-x-1/2 whitespace-nowrap z-10" }, "Double-click to select", /* @__PURE__ */ React.createElement("div", { className: "absolute top-full left-1/2 transform -translate-x-1/2 border-4 border-transparent border-t-gray-800" })))
|
|
1697
|
+
);
|
|
1698
|
+
})))
|
|
1699
|
+
);
|
|
1700
|
+
}))));
|
|
1701
|
+
};
|
|
1702
|
+
var NestedDropdown_default = NestedDropdown;
|
|
1703
|
+
|
|
1704
|
+
// src/components/OTPInput.tsx
|
|
1705
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
1706
|
+
var OTPInput = ({
|
|
1707
|
+
length,
|
|
1708
|
+
onChange,
|
|
1709
|
+
type = "text"
|
|
1710
|
+
}) => {
|
|
1711
|
+
const [otpValues, setOtpValues] = (0, import_react23.useState)(Array(length).fill(""));
|
|
1712
|
+
const inputsRef = (0, import_react23.useRef)([]);
|
|
1713
|
+
const handleChange = (e, idx) => {
|
|
1714
|
+
let value = e.target.value;
|
|
1715
|
+
if (type === "number") value = value.replace(/\D/g, "");
|
|
1716
|
+
if (!value) return;
|
|
1717
|
+
const newOtp = [...otpValues];
|
|
1718
|
+
newOtp[idx] = value[0];
|
|
1719
|
+
setOtpValues(newOtp);
|
|
1720
|
+
onChange(newOtp.join(""));
|
|
1721
|
+
if (idx < length - 1) inputsRef.current[idx + 1]?.focus();
|
|
1722
|
+
};
|
|
1723
|
+
const handleKeyDown = (e, idx) => {
|
|
1724
|
+
if (e.key === "Backspace") {
|
|
1725
|
+
if (otpValues[idx]) {
|
|
1726
|
+
const newOtp = [...otpValues];
|
|
1727
|
+
newOtp[idx] = "";
|
|
1728
|
+
setOtpValues(newOtp);
|
|
1729
|
+
onChange(newOtp.join(""));
|
|
1730
|
+
} else if (idx > 0) {
|
|
1731
|
+
inputsRef.current[idx - 1]?.focus();
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
};
|
|
1735
|
+
const handlePaste = (e) => {
|
|
1736
|
+
e.preventDefault();
|
|
1737
|
+
let pasteData = e.clipboardData.getData("Text");
|
|
1738
|
+
if (type === "number") pasteData = pasteData.replace(/\D/g, "");
|
|
1739
|
+
const newOtp = pasteData.split("").concat(Array(length).fill("")).slice(0, length);
|
|
1740
|
+
setOtpValues(newOtp);
|
|
1741
|
+
onChange(newOtp.join(""));
|
|
1742
|
+
inputsRef.current[Math.min(pasteData.length, length - 1)]?.focus();
|
|
1743
|
+
};
|
|
1744
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { className: "flex items-center gap-2" }, Array.from({ length }).map((_, idx) => /* @__PURE__ */ import_react23.default.createElement(
|
|
1745
|
+
Input_default,
|
|
1746
|
+
{
|
|
1747
|
+
key: idx,
|
|
1748
|
+
type,
|
|
1749
|
+
inputMode: type === "number" ? "numeric" : "text",
|
|
1750
|
+
maxLength: 1,
|
|
1751
|
+
value: otpValues[idx],
|
|
1752
|
+
onChange: (e) => handleChange(e, idx),
|
|
1753
|
+
onKeyDown: (e) => handleKeyDown(e, idx),
|
|
1754
|
+
onPaste: handlePaste,
|
|
1755
|
+
ref: (el) => {
|
|
1756
|
+
inputsRef.current[idx] = el ?? null;
|
|
1757
|
+
},
|
|
1758
|
+
className: "w-[40px] p-3.5"
|
|
1759
|
+
}
|
|
1760
|
+
)));
|
|
1761
|
+
};
|
|
1762
|
+
var OTPInput_default = OTPInput;
|
|
1763
|
+
|
|
1764
|
+
// src/components/Popover.tsx
|
|
1765
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
1766
|
+
var Popover = (0, import_react24.forwardRef)(
|
|
1767
|
+
({
|
|
1768
|
+
isOpen,
|
|
1769
|
+
setIsOpen,
|
|
1770
|
+
trigger,
|
|
1771
|
+
children,
|
|
1772
|
+
className,
|
|
1773
|
+
postion = "bottom-right"
|
|
1774
|
+
}, ref) => {
|
|
1775
|
+
const triggerRef = (0, import_react24.useRef)(null);
|
|
1776
|
+
const contentRef = (0, import_react24.useRef)(null);
|
|
1777
|
+
(0, import_react24.useEffect)(() => {
|
|
1778
|
+
const handleClickOutside = (event) => {
|
|
1779
|
+
if (!triggerRef.current?.contains(event.target) && !contentRef.current?.contains(event.target)) {
|
|
1780
|
+
setIsOpen(false);
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1783
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1784
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1785
|
+
}, [setIsOpen]);
|
|
1786
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { className: "relative w-max", ref }, /* @__PURE__ */ import_react24.default.createElement(
|
|
1787
|
+
"div",
|
|
1788
|
+
{
|
|
1789
|
+
className: "cursor-pointer",
|
|
1790
|
+
ref: triggerRef,
|
|
1791
|
+
onClick: () => setIsOpen(!isOpen)
|
|
1792
|
+
},
|
|
1793
|
+
trigger
|
|
1794
|
+
), isOpen && /* @__PURE__ */ import_react24.default.createElement(
|
|
1795
|
+
"div",
|
|
1796
|
+
{
|
|
1797
|
+
ref: contentRef,
|
|
1798
|
+
className: cn(
|
|
1799
|
+
"absolute z-10 bg-white dark:bg-dark dark:text-light border border-primary-200 dark:border-primary-700 dark:shadow-primary-600 shadow-primary-200 rounded-lg shadow-sm min-w-[200px] p-4",
|
|
1800
|
+
postion === "bottom-left" && "left-0 top-full mt-3",
|
|
1801
|
+
postion === "bottom-right" && "right-0 top-full mt-3",
|
|
1802
|
+
postion === "top-left" && "left-0 bottom-full mb-3",
|
|
1803
|
+
postion === "top-right" && "right-0 bottom-full mb-3",
|
|
1804
|
+
postion === "bottom-center" && "left-1/2 top-full mt-3 -translate-x-1/2",
|
|
1805
|
+
postion === "top-center" && "left-1/2 bottom-full mb-3 -translate-x-1/2",
|
|
1806
|
+
className
|
|
1807
|
+
)
|
|
1808
|
+
},
|
|
1809
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1810
|
+
"div",
|
|
1811
|
+
{
|
|
1812
|
+
className: cn(
|
|
1813
|
+
"absolute h-3 w-3 bg-white dark:bg-dark border border-primary-200 dark:border-primary-700 rotate-45",
|
|
1814
|
+
postion === "bottom-left" && "-top-1.5 left-4 border-b-0 border-r-0",
|
|
1815
|
+
postion === "bottom-right" && "-top-1.5 right-4 border-b-0 border-r-0",
|
|
1816
|
+
postion === "top-left" && "-bottom-1.5 left-4 border-t-0 border-l-0",
|
|
1817
|
+
postion === "top-right" && "-bottom-1.5 right-4 border-t-0 border-l-0",
|
|
1818
|
+
postion === "bottom-center" && "-top-1.5 left-1/2 -translate-x-1/2 border-b-0 border-r-0",
|
|
1819
|
+
postion === "top-center" && "-bottom-1.5 left-1/2 -translate-x-1/2 border-t-0 border-l-0"
|
|
1820
|
+
)
|
|
1821
|
+
}
|
|
1822
|
+
),
|
|
1823
|
+
children
|
|
1824
|
+
));
|
|
1825
|
+
}
|
|
1826
|
+
);
|
|
1827
|
+
Popover.displayName = "Popover";
|
|
1828
|
+
var Popover_default = Popover;
|
|
1829
|
+
|
|
1830
|
+
// src/components/Radio.tsx
|
|
1831
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
1832
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1833
|
+
var radioVariants = (0, import_class_variance_authority9.cva)("", {
|
|
1834
|
+
variants: {
|
|
1835
|
+
size: {
|
|
1836
|
+
sm: "h-3 w-3",
|
|
1837
|
+
lg: "h-4 w-4"
|
|
1838
|
+
}
|
|
1839
|
+
},
|
|
1840
|
+
defaultVariants: {
|
|
1841
|
+
size: "sm"
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1844
|
+
var Radio = (0, import_react25.forwardRef)(
|
|
1845
|
+
({ size, disabled, checked, className, id, name, ...props }, ref) => {
|
|
1846
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { className: "relative inline-flex items-center cursor-pointer" }, /* @__PURE__ */ import_react25.default.createElement(
|
|
1847
|
+
"input",
|
|
1848
|
+
{
|
|
1849
|
+
...props,
|
|
1850
|
+
ref,
|
|
1851
|
+
id,
|
|
1852
|
+
name,
|
|
1853
|
+
checked,
|
|
1854
|
+
disabled,
|
|
1855
|
+
role: "radio",
|
|
1856
|
+
"aria-checked": checked,
|
|
1857
|
+
type: "radio",
|
|
1858
|
+
className: cn(
|
|
1859
|
+
"peer relative cursor-pointer appearance-none rounded-full checked:bg-primary-600 border border-gray-300 hover:border-primary-600 hover:bg-primary-50 checked:hover:bg-primary-700 transition-all checked:border-primary-600 disabled:opacity-30 disabled:pointer-events-none focus-visible:ring-2 focus-visible:ring-primary-600 focus-visible:ring-offset-2",
|
|
1860
|
+
radioVariants({ size, className })
|
|
1861
|
+
)
|
|
1862
|
+
}
|
|
1863
|
+
), /* @__PURE__ */ import_react25.default.createElement(
|
|
1864
|
+
"span",
|
|
1865
|
+
{
|
|
1866
|
+
"aria-hidden": "true",
|
|
1867
|
+
className: cn(
|
|
1868
|
+
"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-white rounded-full duration-300",
|
|
1869
|
+
size === "sm" && "h-[4.5px] w-[4.5px]"
|
|
1870
|
+
)
|
|
1871
|
+
}
|
|
1872
|
+
));
|
|
1873
|
+
}
|
|
1874
|
+
);
|
|
1875
|
+
Radio.displayName = "Radio";
|
|
1876
|
+
var Radio_default = Radio;
|
|
1877
|
+
|
|
1878
|
+
// src/components/Skeleton.tsx
|
|
1879
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
1880
|
+
var Skeleton = ({
|
|
1881
|
+
width = "100%",
|
|
1882
|
+
height = "100%",
|
|
1883
|
+
circle = false,
|
|
1884
|
+
animation = "shimmer"
|
|
1885
|
+
}) => {
|
|
1886
|
+
const style = {
|
|
1887
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
1888
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
1889
|
+
borderRadius: circle ? "50%" : void 0,
|
|
1890
|
+
display: "block"
|
|
1891
|
+
};
|
|
1892
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
1893
|
+
"span",
|
|
1894
|
+
{
|
|
1895
|
+
className: cn(
|
|
1896
|
+
"skeleton rounded-lg",
|
|
1897
|
+
circle ? "circle" : "",
|
|
1898
|
+
animation === "shimmer" && "skeleton-shimmer",
|
|
1899
|
+
animation === "wave" && "skeleton-wave",
|
|
1900
|
+
animation === "pulse" && "skeleton-pulse"
|
|
1901
|
+
),
|
|
1902
|
+
style
|
|
1903
|
+
}
|
|
1904
|
+
);
|
|
1905
|
+
};
|
|
1906
|
+
var Skeleton_default = Skeleton;
|
|
1907
|
+
|
|
754
1908
|
// src/components/Slider.tsx
|
|
755
|
-
var
|
|
756
|
-
var Slider = (0,
|
|
1909
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
1910
|
+
var Slider = (0, import_react27.forwardRef)(
|
|
757
1911
|
({ value, min = 0, max = 100, size = "sm", ...props }, ref) => {
|
|
758
1912
|
const progress = (value - min) / (max - min) * 100;
|
|
759
|
-
return /* @__PURE__ */
|
|
1913
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement(
|
|
760
1914
|
"input",
|
|
761
1915
|
{
|
|
762
1916
|
ref,
|
|
@@ -770,7 +1924,7 @@ var Slider = (0, import_react15.forwardRef)(
|
|
|
770
1924
|
size === "sm" ? "h-1.5" : "h-4"
|
|
771
1925
|
),
|
|
772
1926
|
style: {
|
|
773
|
-
background: `linear-gradient(to right,
|
|
1927
|
+
background: `linear-gradient(to right, var(--primary-300) ${progress}%, var(--gray-200) ${progress}%)`
|
|
774
1928
|
}
|
|
775
1929
|
}
|
|
776
1930
|
));
|
|
@@ -779,39 +1933,262 @@ var Slider = (0, import_react15.forwardRef)(
|
|
|
779
1933
|
Slider.displayName = "Slider";
|
|
780
1934
|
var Slider_default = Slider;
|
|
781
1935
|
|
|
1936
|
+
// src/components/Spinner.tsx
|
|
1937
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
1938
|
+
var colorVars = {
|
|
1939
|
+
primary: {
|
|
1940
|
+
c1: "var(--primary-500)",
|
|
1941
|
+
c2: "var(--primary-200)"
|
|
1942
|
+
},
|
|
1943
|
+
black: {
|
|
1944
|
+
c1: "rgba(0, 0, 0, 1)",
|
|
1945
|
+
c2: "rgba(0, 0, 0, 0.5)"
|
|
1946
|
+
},
|
|
1947
|
+
gray: {
|
|
1948
|
+
c1: "var(--gray-500)",
|
|
1949
|
+
c2: "var(--gray-300)"
|
|
1950
|
+
}
|
|
1951
|
+
};
|
|
1952
|
+
var Spinner = ({ size = "md", color = "primary" }) => {
|
|
1953
|
+
const sizeClass = cn({
|
|
1954
|
+
"w-4 h-4": size === "xs",
|
|
1955
|
+
"w-6 h-6": size === "sm",
|
|
1956
|
+
"w-10 h-10": size === "md",
|
|
1957
|
+
"w-16 h-16": size === "lg"
|
|
1958
|
+
});
|
|
1959
|
+
const getColorValues = (color2) => {
|
|
1960
|
+
if (colorVars[color2]) {
|
|
1961
|
+
return colorVars[color2];
|
|
1962
|
+
}
|
|
1963
|
+
if (color2.startsWith("#")) {
|
|
1964
|
+
return {
|
|
1965
|
+
c1: color2,
|
|
1966
|
+
c2: `${color2}80`
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
return colorVars.primary;
|
|
1970
|
+
};
|
|
1971
|
+
const colorValues = getColorValues(color);
|
|
1972
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { className: cn("relative", sizeClass) }, /* @__PURE__ */ import_react28.default.createElement(
|
|
1973
|
+
"div",
|
|
1974
|
+
{
|
|
1975
|
+
className: "spinner",
|
|
1976
|
+
style: {
|
|
1977
|
+
["--spinner-color-1"]: colorValues.c1,
|
|
1978
|
+
["--spinner-color-2"]: colorValues.c2
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
));
|
|
1982
|
+
};
|
|
1983
|
+
var Spinner_default = Spinner;
|
|
1984
|
+
|
|
782
1985
|
// src/components/StatsCard.tsx
|
|
783
|
-
var
|
|
1986
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
784
1987
|
var StatsCard = ({
|
|
785
1988
|
statTitle,
|
|
786
1989
|
statDesc,
|
|
787
1990
|
className,
|
|
788
1991
|
cardIcon
|
|
789
1992
|
}) => {
|
|
790
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
791
1994
|
Card,
|
|
792
1995
|
{
|
|
793
1996
|
className: cn(
|
|
794
|
-
"border border-
|
|
1997
|
+
"border border-gray-200 hover:border-primary-500 rounded-radius-xl bg-[#FFFFFFE5] bg-gradient-to-b bg-[#fff] hover:from-primary-300 hover:to-primary-600 dark:from-primary-800 dark:to-primary-700 dark:hover:from-primary-800 dark:hover:to-primary-900 backdrop-blur-sm px-[32px] py-[64px] group",
|
|
795
1998
|
className
|
|
796
1999
|
)
|
|
797
2000
|
},
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ import_react29.default.createElement("span", { className: "group-hover:text-white text-dark dark:text-white" }, cardIcon),
|
|
2002
|
+
/* @__PURE__ */ import_react29.default.createElement(CardTitle, { className: "group-hover:text-white text-[48px] font-bold text-primary-500 dark:text-white my-4" }, statTitle),
|
|
2003
|
+
/* @__PURE__ */ import_react29.default.createElement(CardDescription, { className: "group-hover:text-white text-[24px] hover:text-white text-dark leading-[25px]" }, statDesc)
|
|
801
2004
|
);
|
|
802
2005
|
};
|
|
803
2006
|
var StatsCard_default = StatsCard;
|
|
804
2007
|
|
|
2008
|
+
// src/components/Tabs.tsx
|
|
2009
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
2010
|
+
var TabsContainer = ({
|
|
2011
|
+
children,
|
|
2012
|
+
className,
|
|
2013
|
+
position = "horizontal"
|
|
2014
|
+
}) => {
|
|
2015
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { className: cn(position === "vertical" ? "flex" : "block", className) }, children);
|
|
2016
|
+
};
|
|
2017
|
+
var TabList = ({
|
|
2018
|
+
onChange,
|
|
2019
|
+
ariaLabel,
|
|
2020
|
+
children,
|
|
2021
|
+
box = false,
|
|
2022
|
+
className,
|
|
2023
|
+
position = "horizontal"
|
|
2024
|
+
}) => {
|
|
2025
|
+
const [focusIndex, setFocusIndex] = import_react30.default.useState(0);
|
|
2026
|
+
const tabRefs = import_react30.default.useRef([]);
|
|
2027
|
+
const handleKeyDown = (e, index) => {
|
|
2028
|
+
const tabCount = import_react30.default.Children.count(children);
|
|
2029
|
+
switch (e.key) {
|
|
2030
|
+
case "ArrowRight": {
|
|
2031
|
+
if (position === "horizontal") {
|
|
2032
|
+
e.preventDefault();
|
|
2033
|
+
const nextIndex = (index + 1) % tabCount;
|
|
2034
|
+
setFocusIndex(nextIndex);
|
|
2035
|
+
tabRefs.current[nextIndex]?.focus();
|
|
2036
|
+
}
|
|
2037
|
+
break;
|
|
2038
|
+
}
|
|
2039
|
+
case "ArrowLeft": {
|
|
2040
|
+
if (position === "horizontal") {
|
|
2041
|
+
e.preventDefault();
|
|
2042
|
+
const prevIndex = (index - 1 + tabCount) % tabCount;
|
|
2043
|
+
setFocusIndex(prevIndex);
|
|
2044
|
+
tabRefs.current[prevIndex]?.focus();
|
|
2045
|
+
}
|
|
2046
|
+
break;
|
|
2047
|
+
}
|
|
2048
|
+
case "ArrowDown": {
|
|
2049
|
+
if (position === "vertical") {
|
|
2050
|
+
e.preventDefault();
|
|
2051
|
+
const nextIndex = (index + 1) % tabCount;
|
|
2052
|
+
setFocusIndex(nextIndex);
|
|
2053
|
+
tabRefs.current[nextIndex]?.focus();
|
|
2054
|
+
}
|
|
2055
|
+
break;
|
|
2056
|
+
}
|
|
2057
|
+
case "ArrowUp": {
|
|
2058
|
+
if (position === "vertical") {
|
|
2059
|
+
e.preventDefault();
|
|
2060
|
+
const prevIndex = (index - 1 + tabCount) % tabCount;
|
|
2061
|
+
setFocusIndex(prevIndex);
|
|
2062
|
+
tabRefs.current[prevIndex]?.focus();
|
|
2063
|
+
}
|
|
2064
|
+
break;
|
|
2065
|
+
}
|
|
2066
|
+
case "Home": {
|
|
2067
|
+
e.preventDefault();
|
|
2068
|
+
setFocusIndex(0);
|
|
2069
|
+
tabRefs.current[0]?.focus();
|
|
2070
|
+
break;
|
|
2071
|
+
}
|
|
2072
|
+
case "End": {
|
|
2073
|
+
e.preventDefault();
|
|
2074
|
+
const lastIndex = tabCount - 1;
|
|
2075
|
+
setFocusIndex(lastIndex);
|
|
2076
|
+
tabRefs.current[lastIndex]?.focus();
|
|
2077
|
+
break;
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
2082
|
+
"div",
|
|
2083
|
+
{
|
|
2084
|
+
className: cn(
|
|
2085
|
+
position === "horizontal" ? "flex items-center" : "flex flex-col items-stretch",
|
|
2086
|
+
box ? "rounded-2xl bg-light dark:bg-gray-900 p-2" : position === "horizontal" ? "border-b border-gray-200 dark:border-gray-600" : "border-r border-gray-200 dark:border-gray-600",
|
|
2087
|
+
className
|
|
2088
|
+
),
|
|
2089
|
+
role: "tablist",
|
|
2090
|
+
"aria-label": ariaLabel,
|
|
2091
|
+
"aria-orientation": position
|
|
2092
|
+
},
|
|
2093
|
+
import_react30.default.Children.map(children, (child, index) => {
|
|
2094
|
+
if (import_react30.default.isValidElement(child)) {
|
|
2095
|
+
return import_react30.default.cloneElement(child, {
|
|
2096
|
+
onChange,
|
|
2097
|
+
box,
|
|
2098
|
+
position,
|
|
2099
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
2100
|
+
tabIndex: index === focusIndex ? 0 : -1,
|
|
2101
|
+
ref: (el) => {
|
|
2102
|
+
tabRefs.current[index] = el;
|
|
2103
|
+
}
|
|
2104
|
+
});
|
|
2105
|
+
}
|
|
2106
|
+
return null;
|
|
2107
|
+
})
|
|
2108
|
+
);
|
|
2109
|
+
};
|
|
2110
|
+
var Tab = import_react30.default.forwardRef(
|
|
2111
|
+
({
|
|
2112
|
+
label,
|
|
2113
|
+
value,
|
|
2114
|
+
onChange,
|
|
2115
|
+
icon,
|
|
2116
|
+
content,
|
|
2117
|
+
box = false,
|
|
2118
|
+
selectedTabValue,
|
|
2119
|
+
className,
|
|
2120
|
+
onKeyDown,
|
|
2121
|
+
tabIndex,
|
|
2122
|
+
position = "horizontal"
|
|
2123
|
+
}, ref) => {
|
|
2124
|
+
const isSelected = value === selectedTabValue;
|
|
2125
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
2126
|
+
"button",
|
|
2127
|
+
{
|
|
2128
|
+
ref,
|
|
2129
|
+
role: "tab",
|
|
2130
|
+
"aria-selected": isSelected,
|
|
2131
|
+
"aria-controls": `panel-${value}`,
|
|
2132
|
+
id: `tab-${value}`,
|
|
2133
|
+
tabIndex,
|
|
2134
|
+
onKeyDown,
|
|
2135
|
+
onClick: () => onChange(value),
|
|
2136
|
+
className: cn(
|
|
2137
|
+
"flex items-center gap-2 px-4 py-3 text-base font-medium cursor-pointer",
|
|
2138
|
+
// Default variant
|
|
2139
|
+
!box && [
|
|
2140
|
+
isSelected && position === "horizontal" ? "text-primary-400 border-b-2 border-primary-400" : isSelected && position === "vertical" ? "text-primary-400 border-r-2 border-primary-400" : "border-transparent text-gray-700 dark:text-gray-500"
|
|
2141
|
+
],
|
|
2142
|
+
// Hover styles
|
|
2143
|
+
position === "horizontal" && !box ? "hover:bg-gray-100 dark:hover:bg-gray-900 hover:rounded-t transition-all duration-200" : "hover:bg-gray-100 dark:hover:bg-gray-900 transition-all duration-200",
|
|
2144
|
+
// Vertical border for unselected
|
|
2145
|
+
position === "vertical" && !box && !isSelected ? "border-r-2" : "",
|
|
2146
|
+
// Box variant
|
|
2147
|
+
box && [
|
|
2148
|
+
"transition-all ease-linear duration-200 delay-75 rounded-radius-lg border border-transparent hover:bg-primary-50 dark:hover:bg-primary-900 hover:border-primary-200 dark:hover:border-primary-800 dark:text-light",
|
|
2149
|
+
position === "horizontal" ? "flex items-center gap-2" : "",
|
|
2150
|
+
isSelected ? "text-light bg-primary-600 dark:bg-primary-800 shadow-[inset_3px_4px_5.3px_0_#0d3374a3] shadow-primary-700 border-primary-200 dark:border-primary-600 hover:bg-primary-600 hover:shadow-[inset_-4px_-3px_4px_0_#94bcff4a]" : ""
|
|
2151
|
+
],
|
|
2152
|
+
className
|
|
2153
|
+
)
|
|
2154
|
+
},
|
|
2155
|
+
icon && /* @__PURE__ */ import_react30.default.createElement("span", { "aria-hidden": "true" }, icon),
|
|
2156
|
+
label,
|
|
2157
|
+
content && /* @__PURE__ */ import_react30.default.createElement("span", { "aria-hidden": "true" }, content)
|
|
2158
|
+
);
|
|
2159
|
+
}
|
|
2160
|
+
);
|
|
2161
|
+
var TabPanel = ({
|
|
2162
|
+
value,
|
|
2163
|
+
currentValue,
|
|
2164
|
+
children,
|
|
2165
|
+
className
|
|
2166
|
+
}) => {
|
|
2167
|
+
return value === currentValue ? /* @__PURE__ */ import_react30.default.createElement(
|
|
2168
|
+
"div",
|
|
2169
|
+
{
|
|
2170
|
+
role: "tabpanel",
|
|
2171
|
+
id: `panel-${value}`,
|
|
2172
|
+
"aria-labelledby": `tab-${value}`,
|
|
2173
|
+
tabIndex: 0,
|
|
2174
|
+
className: cn("dark:text-light", className)
|
|
2175
|
+
},
|
|
2176
|
+
children
|
|
2177
|
+
) : null;
|
|
2178
|
+
};
|
|
2179
|
+
Tab.displayName = "Tab";
|
|
2180
|
+
var Tabs_default = TabsContainer;
|
|
2181
|
+
|
|
805
2182
|
// src/components/Textarea.tsx
|
|
806
|
-
var
|
|
807
|
-
var
|
|
808
|
-
var textareaVariants = (0,
|
|
809
|
-
"flex items-center gap-2 font-karla text-sm outline-none rounded-radius-md border py-2 px-4 disabled:opacity-60 disabled:select-none disabled:pointer-events-none w-full",
|
|
2183
|
+
var import_class_variance_authority10 = require("class-variance-authority");
|
|
2184
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
2185
|
+
var textareaVariants = (0, import_class_variance_authority10.cva)(
|
|
2186
|
+
"flex items-center gap-2 font-karla bg-transparent text-sm outline-none rounded-radius-md border py-2 px-4 disabled:opacity-60 disabled:select-none disabled:pointer-events-none w-full",
|
|
810
2187
|
{
|
|
811
2188
|
variants: {
|
|
812
2189
|
variant: {
|
|
813
|
-
default: "dark:text-gray-500 dark:bg-gray-900 dark:border-gray-800 dark:hover:text-light dark:hover:bg-gray-800 dark:hover:border-gray-700 dark:focus-within:bg-gray-100 dark:focus-within:border-gray-800 dark:focus-within:hover:bg-gray-700 dark:focus-within:text-dark dark:disabled:bg-gray-700 bg-gray-100 border-gray-200 text-gray-600 hover:border-gray-300 hover:text-gray-500 hover:bg-gray-300 focus-within:bg-gray-50 focus-within:border-gray-400 focus-within:text-dark focus-within:hover:text-dark focus-within:hover:border-
|
|
814
|
-
glass: "backdrop-blur-[3.5px] bg-
|
|
2190
|
+
default: "dark:text-gray-500 dark:bg-gray-900 dark:border-gray-800 dark:hover:text-light dark:hover:bg-gray-800 dark:hover:border-gray-700 dark:focus-within:bg-gray-100 dark:focus-within:border-gray-800 dark:focus-within:hover:bg-gray-700 dark:focus-within:text-dark dark:disabled:bg-gray-700 bg-gray-100 border-gray-200 text-gray-600 hover:border-gray-300 hover:text-gray-500 hover:bg-gray-300 focus-within:bg-gray-50 focus-within:border-gray-400 focus-within:text-dark focus-within:hover:text-dark focus-within:hover:border-primary-100 focus-within:hover:bg-primary-50 disabled:bg-gray-25 disabled:border-gray-400",
|
|
2191
|
+
glass: "backdrop-blur-[3.5px] bg-white/10 dark:bg-dark/20 dark:border-gray-800 border-gray-200/50 text-light"
|
|
815
2192
|
}
|
|
816
2193
|
},
|
|
817
2194
|
defaultVariants: {
|
|
@@ -819,9 +2196,9 @@ var textareaVariants = (0, import_class_variance_authority8.cva)(
|
|
|
819
2196
|
}
|
|
820
2197
|
}
|
|
821
2198
|
);
|
|
822
|
-
var Textarea = (0,
|
|
2199
|
+
var Textarea = (0, import_react31.forwardRef)(
|
|
823
2200
|
({ className, rows, cols, variant, disabled, children, ...props }, ref) => {
|
|
824
|
-
return /* @__PURE__ */
|
|
2201
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
825
2202
|
"textarea",
|
|
826
2203
|
{
|
|
827
2204
|
...props,
|
|
@@ -839,10 +2216,10 @@ Textarea.displayName = "Textarea";
|
|
|
839
2216
|
var Textarea_default = Textarea;
|
|
840
2217
|
|
|
841
2218
|
// src/components/Toggle.tsx
|
|
842
|
-
var
|
|
843
|
-
var
|
|
844
|
-
var toggleVariants = (0,
|
|
845
|
-
"rounded-radius-xl bg-gray-300 transition-colors peer-checked:bg-
|
|
2219
|
+
var import_class_variance_authority11 = require("class-variance-authority");
|
|
2220
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
2221
|
+
var toggleVariants = (0, import_class_variance_authority11.cva)(
|
|
2222
|
+
"rounded-radius-xl bg-gray-300 transition-colors peer-checked:bg-primary-500 peer-active:ring-2 peer-active:ring-primary-300",
|
|
846
2223
|
{
|
|
847
2224
|
variants: {
|
|
848
2225
|
size: {
|
|
@@ -855,9 +2232,9 @@ var toggleVariants = (0, import_class_variance_authority9.cva)(
|
|
|
855
2232
|
}
|
|
856
2233
|
}
|
|
857
2234
|
);
|
|
858
|
-
var Toggle = (0,
|
|
2235
|
+
var Toggle = (0, import_react32.forwardRef)(
|
|
859
2236
|
({ icon, children, disabled, size = "lg", ...props }, ref) => {
|
|
860
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
861
2238
|
"label",
|
|
862
2239
|
{
|
|
863
2240
|
className: cn(
|
|
@@ -865,7 +2242,7 @@ var Toggle = (0, import_react18.forwardRef)(
|
|
|
865
2242
|
disabled && "opacity-50 pointer-events-none"
|
|
866
2243
|
)
|
|
867
2244
|
},
|
|
868
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { className: "relative" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
869
2246
|
"input",
|
|
870
2247
|
{
|
|
871
2248
|
type: "checkbox",
|
|
@@ -874,15 +2251,15 @@ var Toggle = (0, import_react18.forwardRef)(
|
|
|
874
2251
|
...props,
|
|
875
2252
|
className: "sr-only peer"
|
|
876
2253
|
}
|
|
877
|
-
), /* @__PURE__ */
|
|
2254
|
+
), /* @__PURE__ */ import_react32.default.createElement("div", { className: cn(toggleVariants({ size })) }), /* @__PURE__ */ import_react32.default.createElement(
|
|
878
2255
|
"div",
|
|
879
2256
|
{
|
|
880
2257
|
className: cn(
|
|
881
2258
|
"absolute flex items-center justify-center bg-white transition-transform",
|
|
882
|
-
size === "sm" ? "peer-checked:translate-x-2 top-[1px] left-[2px] w-5 h-4 rounded-radius-md" : "peer-checked:translate-x-
|
|
2259
|
+
size === "sm" ? "peer-checked:translate-x-2 top-[1px] left-[2px] w-5 h-4 rounded-radius-md" : "peer-checked:translate-x-[11px] top-[2.5px] left-1 h-[22px] w-[34px] rounded-radius-lg"
|
|
883
2260
|
)
|
|
884
2261
|
},
|
|
885
|
-
/* @__PURE__ */
|
|
2262
|
+
/* @__PURE__ */ import_react32.default.createElement("span", { className: "flex items-center justify-center" }, icon),
|
|
886
2263
|
children
|
|
887
2264
|
))
|
|
888
2265
|
);
|
|
@@ -897,6 +2274,7 @@ var Toggle_default = Toggle;
|
|
|
897
2274
|
AccordionItem,
|
|
898
2275
|
AccordionTrigger,
|
|
899
2276
|
Button,
|
|
2277
|
+
Callout,
|
|
900
2278
|
Caption,
|
|
901
2279
|
Card,
|
|
902
2280
|
CardBg,
|
|
@@ -908,7 +2286,9 @@ var Toggle_default = Toggle;
|
|
|
908
2286
|
CardTitle,
|
|
909
2287
|
Checkbox,
|
|
910
2288
|
Chip,
|
|
2289
|
+
Drawer,
|
|
911
2290
|
Dropdown,
|
|
2291
|
+
FillButton,
|
|
912
2292
|
Footer,
|
|
913
2293
|
FooterContent,
|
|
914
2294
|
FooterHeader,
|
|
@@ -918,11 +2298,22 @@ var Toggle_default = Toggle;
|
|
|
918
2298
|
Input,
|
|
919
2299
|
Label,
|
|
920
2300
|
ListItem,
|
|
921
|
-
|
|
922
|
-
|
|
2301
|
+
ListPagination,
|
|
2302
|
+
Loading,
|
|
2303
|
+
Modal,
|
|
2304
|
+
NestedDropdown,
|
|
2305
|
+
OTPInput,
|
|
923
2306
|
Paragraph,
|
|
2307
|
+
Popover,
|
|
2308
|
+
Radio,
|
|
2309
|
+
Skeleton,
|
|
924
2310
|
Slider,
|
|
2311
|
+
Spinner,
|
|
925
2312
|
StatsCard,
|
|
2313
|
+
Tab,
|
|
2314
|
+
TabList,
|
|
2315
|
+
TabPanel,
|
|
2316
|
+
TabsContainer,
|
|
926
2317
|
Textarea,
|
|
927
2318
|
Toggle,
|
|
928
2319
|
Typography
|