jett.admin.npmpackage 2.0.34 → 2.0.37
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 +23 -2
- package/dist/index.css +1621 -1486
- package/dist/index.js +2547 -2161
- package/dist/index.mjs +2508 -2130
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,2130 +1,2508 @@
|
|
|
1
|
-
// src/utils/cn.ts
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
function cn(...inputs) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// src/Button.jsx
|
|
9
|
-
import React from "react";
|
|
10
|
-
var variantStyles = {
|
|
11
|
-
PRIMARY: "bg-white dark:bg-[#18181b] dark:text-white",
|
|
12
|
-
SECONDARY: "bg-primary text-white dark:text-white",
|
|
13
|
-
DEFAULT: "bg-white text-black dark:text-white",
|
|
14
|
-
DANGER: "bg-[#ef4444] text-white dark:text-white"
|
|
15
|
-
};
|
|
16
|
-
var CustomButton = ({
|
|
17
|
-
id = "button",
|
|
18
|
-
variant = "DEFAULT",
|
|
19
|
-
children,
|
|
20
|
-
className,
|
|
21
|
-
onClick,
|
|
22
|
-
disabled = false,
|
|
23
|
-
icon
|
|
24
|
-
}) => {
|
|
25
|
-
return /* @__PURE__ */ React.createElement(
|
|
26
|
-
"div",
|
|
27
|
-
{
|
|
28
|
-
className: cn(
|
|
29
|
-
`cursor-pointer flex items-center py-2 px-3 min-h-10 justify-center border rounded-[6px] border-[#e5e5e5] dark:border-[#303036] ${variant == "DANGER" ? "bg-[#ef4444]" : "dark:bg-[#1d1d20]"} gap-2`,
|
|
30
|
-
variantStyles[variant],
|
|
31
|
-
className
|
|
32
|
-
),
|
|
33
|
-
onClick,
|
|
34
|
-
id: `${id}-div-1`
|
|
35
|
-
},
|
|
36
|
-
icon && /* @__PURE__ */ React.createElement("div", { id: `${id}-div-2` }, icon),
|
|
37
|
-
children
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/inputs/Autocomplete.jsx
|
|
42
|
-
import React2, { useState, useRef } from "react";
|
|
43
|
-
import { ChevronDown, Check, Search } from "lucide-react";
|
|
44
|
-
var CustomAutocomplete = ({
|
|
45
|
-
id = "autocomplete",
|
|
46
|
-
label,
|
|
47
|
-
value,
|
|
48
|
-
onChange,
|
|
49
|
-
options,
|
|
50
|
-
placeholder = "Search & select...",
|
|
51
|
-
isRequired = false,
|
|
52
|
-
error,
|
|
53
|
-
heading,
|
|
54
|
-
disabled = false
|
|
55
|
-
}) => {
|
|
56
|
-
const [open, setOpen] = useState(false);
|
|
57
|
-
const [search, setSearch] = useState("");
|
|
58
|
-
const wrapperRef = useRef(null);
|
|
59
|
-
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
60
|
-
const handleBlur = (e) => {
|
|
61
|
-
var _a;
|
|
62
|
-
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
63
|
-
setOpen(false);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const filteredOptions = options.filter(
|
|
67
|
-
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
68
|
-
);
|
|
69
|
-
const toggleValue = (val) => {
|
|
70
|
-
if (value.includes(val)) {
|
|
71
|
-
onChange(value.filter((v) => v !== val));
|
|
72
|
-
} else {
|
|
73
|
-
onChange([...value, val]);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
return /* @__PURE__ */ React2.createElement(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
className: "flex flex-col w-full relative dark:bg-[#18181b] dark:text-white",
|
|
80
|
-
ref: wrapperRef,
|
|
81
|
-
tabIndex: disabled ? -1 : 0,
|
|
82
|
-
onBlur: handleBlur,
|
|
83
|
-
id: `${id}-div-1`
|
|
84
|
-
},
|
|
85
|
-
heading && /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1", id: `${id}-h3-1` }, heading),
|
|
86
|
-
label && /* @__PURE__ */ React2.createElement(
|
|
87
|
-
"label",
|
|
88
|
-
{
|
|
89
|
-
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black dark:text-white"}`,
|
|
90
|
-
id: `${id}-label-1`
|
|
91
|
-
},
|
|
92
|
-
label,
|
|
93
|
-
" ",
|
|
94
|
-
isRequired && /* @__PURE__ */ React2.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
95
|
-
),
|
|
96
|
-
/* @__PURE__ */ React2.createElement(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
onClick: () => {
|
|
100
|
-
if (!disabled) setOpen((prev) => !prev);
|
|
101
|
-
},
|
|
102
|
-
className: `flex justify-between items-center flex-wrap gap-1 rounded-md px-3 py-2 text-sm transition border dark:border-[#303036] h-auto min-h-10 dark:bg-[#18181b] dark:text-white
|
|
103
|
-
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
104
|
-
${error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)] hover:border-gray-400 dark:bg-[#18181b] dark:text-white"}
|
|
105
|
-
`,
|
|
106
|
-
id: `${id}-div-2`
|
|
107
|
-
},
|
|
108
|
-
/* @__PURE__ */ React2.createElement("div", { className: "flex flex-wrap gap-1 flex-1", id: `${id}-div-3` }, selectedOptions.length > 0 ? selectedOptions.map((opt) => /* @__PURE__ */ React2.createElement(
|
|
109
|
-
"span",
|
|
110
|
-
{
|
|
111
|
-
key: opt.value,
|
|
112
|
-
className: "bg-[#F7FAFC] dark:bg-[#303036] border border-gray-300 px-2 dark:text-white py-0.5 rounded text-xs flex items-center gap-1",
|
|
113
|
-
id: `${id}-span-2`
|
|
114
|
-
},
|
|
115
|
-
opt.label,
|
|
116
|
-
/* @__PURE__ */ React2.createElement(
|
|
117
|
-
"button",
|
|
118
|
-
{
|
|
119
|
-
onClick: (e) => {
|
|
120
|
-
e.stopPropagation();
|
|
121
|
-
toggleValue(opt.value);
|
|
122
|
-
},
|
|
123
|
-
className: "text-gray-500 hover:text-gray-700 dark:text-white cursor-pointer dark:hover:text-white",
|
|
124
|
-
id: `${id}-button-1`
|
|
125
|
-
},
|
|
126
|
-
"\u2715"
|
|
127
|
-
)
|
|
128
|
-
)) : /* @__PURE__ */ React2.createElement("span", { className: "text-gray-400", id: `${id}-span-3` }, placeholder)),
|
|
129
|
-
/* @__PURE__ */ React2.createElement(
|
|
130
|
-
ChevronDown,
|
|
131
|
-
{
|
|
132
|
-
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
),
|
|
136
|
-
!disabled && open && /* @__PURE__ */ React2.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200", id: `${id}-div-5` }, /* @__PURE__ */ React2.createElement(Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React2.createElement(
|
|
137
|
-
"input",
|
|
138
|
-
{
|
|
139
|
-
type: "text",
|
|
140
|
-
value: search,
|
|
141
|
-
onChange: (e) => setSearch(e.target.value),
|
|
142
|
-
placeholder: "Search...",
|
|
143
|
-
className: "flex-1 text-sm focus:outline-none",
|
|
144
|
-
id: `${id}-input-1`
|
|
145
|
-
}
|
|
146
|
-
)), /* @__PURE__ */ React2.createElement("ul", { id: `${id}-ul-1` }, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
147
|
-
const selected = value.includes(opt.value);
|
|
148
|
-
return /* @__PURE__ */ React2.createElement(
|
|
149
|
-
"li",
|
|
150
|
-
{
|
|
151
|
-
key: opt.value,
|
|
152
|
-
onClick: () => toggleValue(opt.value),
|
|
153
|
-
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-[#F7FAFC] dark:hover:bg-[#303036] ${selected ? "bg-[#F7FAFC] dark:bg-[#303036] font-medium" : ""}`,
|
|
154
|
-
id: `${id}-li-1`
|
|
155
|
-
},
|
|
156
|
-
/* @__PURE__ */ React2.createElement(
|
|
157
|
-
"span",
|
|
158
|
-
{
|
|
159
|
-
className: `w-4 h-4 flex items-center justify-center border rounded-sm ${selected ? "bg-blue-600 border-blue-600 text-white" : "border-gray-300"}`,
|
|
160
|
-
id: `${id}-span-4`
|
|
161
|
-
},
|
|
162
|
-
selected && /* @__PURE__ */ React2.createElement(Check, { size: 14 })
|
|
163
|
-
),
|
|
164
|
-
opt.label
|
|
165
|
-
);
|
|
166
|
-
}) : /* @__PURE__ */ React2.createElement("li", { className: "px-3 py-2 text-sm text-gray-400", id: `${id}-li-2` }, "No results found")))
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
// src/inputs/Checkbox.jsx
|
|
171
|
-
import React3 from "react";
|
|
172
|
-
var CustomCheckbox = ({ id = "checkbox", onChange, checked }) => {
|
|
173
|
-
const handleChange = (e) => {
|
|
174
|
-
onChange(e.target.checked);
|
|
175
|
-
};
|
|
176
|
-
return /* @__PURE__ */ React3.createElement("label", { className: "inline-flex items-center cursor-pointer select-none", id: `${id}-label-1` }, /* @__PURE__ */ React3.createElement(
|
|
177
|
-
"input",
|
|
178
|
-
{
|
|
179
|
-
type: "checkbox",
|
|
180
|
-
checked,
|
|
181
|
-
onChange: handleChange,
|
|
182
|
-
className: "peer hidden",
|
|
183
|
-
id: `${id}-input-1`
|
|
184
|
-
}
|
|
185
|
-
), /* @__PURE__ */ React3.createElement(
|
|
186
|
-
"span",
|
|
187
|
-
{
|
|
188
|
-
className: "\r\n w-4 h-4 flex items-center justify-center border-2 border-gray-400 rounded \r\n peer-checked:bg-primary peer-checked:border-primary\r\n transition-colors\r\n ",
|
|
189
|
-
id: `${id}-span-1`
|
|
190
|
-
},
|
|
191
|
-
checked && /* @__PURE__ */ React3.createElement(
|
|
192
|
-
"svg",
|
|
193
|
-
{
|
|
194
|
-
className: "w-4 h-4 text-white",
|
|
195
|
-
fill: "none",
|
|
196
|
-
stroke: "currentColor",
|
|
197
|
-
strokeWidth: "3",
|
|
198
|
-
viewBox: "0 0 24 24",
|
|
199
|
-
id: `${id}-svg-1`
|
|
200
|
-
},
|
|
201
|
-
/* @__PURE__ */ React3.createElement("path", { d: "M5 13l4 4L19 7", id: `${id}-path-1` })
|
|
202
|
-
)
|
|
203
|
-
));
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
// src/inputs/Chip.jsx
|
|
207
|
-
import React4 from "react";
|
|
208
|
-
var VARIANTS = {
|
|
209
|
-
PRIMARY: "bg-gray-100 text-black dark:bg-gray-800 dark:text-white",
|
|
210
|
-
GREEN: "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",
|
|
211
|
-
RED: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100",
|
|
212
|
-
YELLOW: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
|
|
213
|
-
};
|
|
214
|
-
var Chip = ({ id = "chip", label, variant }) => {
|
|
215
|
-
return /* @__PURE__ */ React4.createElement(
|
|
216
|
-
"div",
|
|
217
|
-
{
|
|
218
|
-
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`,
|
|
219
|
-
id: `${id}-div-1`
|
|
220
|
-
},
|
|
221
|
-
label
|
|
222
|
-
);
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
// src/inputs/CustomSwitch.jsx
|
|
226
|
-
import React5 from "react";
|
|
227
|
-
var CustomSwitch = ({ id = "custom-switch", checked, onChange, label, description }) => {
|
|
228
|
-
return /* @__PURE__ */ React5.createElement("div", { id: `${id}-div-1` }, /* @__PURE__ */ React5.createElement(
|
|
229
|
-
"button",
|
|
230
|
-
{
|
|
231
|
-
type: "button",
|
|
232
|
-
role: "switch",
|
|
233
|
-
"aria-checked": checked,
|
|
234
|
-
onClick: () => onChange(!checked),
|
|
235
|
-
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`,
|
|
236
|
-
id: `${id}-button-1`
|
|
237
|
-
},
|
|
238
|
-
/* @__PURE__ */ React5.createElement(
|
|
239
|
-
"span",
|
|
240
|
-
{
|
|
241
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`,
|
|
242
|
-
id: `${id}-span-1`
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
), /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col", id: `${id}-div-2` }, label && /* @__PURE__ */ React5.createElement("h3", { className: "font-[500] text-sm text-black mb-2", id: `${id}-h3-1` }, label), description && /* @__PURE__ */ React5.createElement("p", { className: "font-[500] text-sm text-[#737373]", id: `${id}-p-1` }, description)));
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
// src/inputs/Input.jsx
|
|
249
|
-
import React6 from "react";
|
|
250
|
-
var CustomInput = ({
|
|
251
|
-
id = "input",
|
|
252
|
-
label,
|
|
253
|
-
isRequired,
|
|
254
|
-
value,
|
|
255
|
-
onChange,
|
|
256
|
-
placeholder,
|
|
257
|
-
disabled = false,
|
|
258
|
-
error,
|
|
259
|
-
heading
|
|
260
|
-
}) => {
|
|
261
|
-
return /* @__PURE__ */ React6.createElement("div", { className: "flex flex-col gap-1 w-full", id: `${id}-div-1` }, heading && /* @__PURE__ */ React6.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), /* @__PURE__ */ React6.createElement(
|
|
262
|
-
"label",
|
|
263
|
-
{
|
|
264
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`,
|
|
265
|
-
id: `${id}-label-1`
|
|
266
|
-
},
|
|
267
|
-
label,
|
|
268
|
-
" ",
|
|
269
|
-
isRequired && /* @__PURE__ */ React6.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
270
|
-
), /* @__PURE__ */ React6.createElement(
|
|
271
|
-
"input",
|
|
272
|
-
{
|
|
273
|
-
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
274
|
-
placeholder:text-[14px] placeholder:font-normal placeholder:text-[#6b7280]
|
|
275
|
-
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
276
|
-
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
277
|
-
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-500 border-gray-300" : error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)]"}
|
|
278
|
-
`,
|
|
279
|
-
value,
|
|
280
|
-
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
281
|
-
placeholder,
|
|
282
|
-
disabled,
|
|
283
|
-
readOnly: disabled,
|
|
284
|
-
id: `${id}-input-1`
|
|
285
|
-
}
|
|
286
|
-
));
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
// src/inputs/ProgressBar.jsx
|
|
290
|
-
import React7 from "react";
|
|
291
|
-
var ProgressBar = ({ id = "progress-bar", step, totalSteps }) => {
|
|
292
|
-
const progress = step / totalSteps * 100;
|
|
293
|
-
return /* @__PURE__ */ React7.createElement("div", { className: "mb-6", id: `${id}-div-1` }, /* @__PURE__ */ React7.createElement("p", { className: "text-gray-600 text-sm mb-2", id: `${id}-p-1` }, "Step ", step, " of ", totalSteps), /* @__PURE__ */ React7.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2", id: `${id}-div-2` }, /* @__PURE__ */ React7.createElement(
|
|
294
|
-
"div",
|
|
295
|
-
{
|
|
296
|
-
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
297
|
-
style: { width: `${progress}%` },
|
|
298
|
-
id: `${id}-div-3`
|
|
299
|
-
}
|
|
300
|
-
)));
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// src/inputs/Search.jsx
|
|
304
|
-
import React8 from "react";
|
|
305
|
-
import { Search as Search2 } from "lucide-react";
|
|
306
|
-
var CustomSearch = ({
|
|
307
|
-
id = "search",
|
|
308
|
-
value,
|
|
309
|
-
onChange,
|
|
310
|
-
placeholder = "Search Markets..."
|
|
311
|
-
}) => {
|
|
312
|
-
return /* @__PURE__ */ React8.createElement("div", { className: "flex items-center border bg-transparent text-[14px] border-[hsl(0_0%_89.8%)] dark:border-[#303036] \r\n rounded-md h-10 px-2 w-full focus-within:outline-2 focus-within:outline-black focus-within:outline-offset-2 dark:text-white", id: `${id}-div-1` }, /* @__PURE__ */ React8.createElement(Search2, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ React8.createElement(
|
|
313
|
-
"input",
|
|
314
|
-
{
|
|
315
|
-
type: "text",
|
|
316
|
-
value,
|
|
317
|
-
onChange,
|
|
318
|
-
placeholder,
|
|
319
|
-
className: "bg-transparent w-full h-full focus:outline-none",
|
|
320
|
-
id: `${id}-input-1`
|
|
321
|
-
}
|
|
322
|
-
));
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
// src/inputs/TextArea.jsx
|
|
326
|
-
import React9 from "react";
|
|
327
|
-
var CustomTextarea = ({
|
|
328
|
-
id = "text-area",
|
|
329
|
-
label,
|
|
330
|
-
isRequired,
|
|
331
|
-
value,
|
|
332
|
-
onChange,
|
|
333
|
-
placeholder,
|
|
334
|
-
disabled = false,
|
|
335
|
-
error,
|
|
336
|
-
heading,
|
|
337
|
-
rows = 4
|
|
338
|
-
}) => {
|
|
339
|
-
return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-col gap-1 w-full", id: `${id}-div-1` }, heading && /* @__PURE__ */ React9.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), /* @__PURE__ */ React9.createElement(
|
|
340
|
-
"label",
|
|
341
|
-
{
|
|
342
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`,
|
|
343
|
-
id: `${id}-label-1`
|
|
344
|
-
},
|
|
345
|
-
label,
|
|
346
|
-
" ",
|
|
347
|
-
isRequired && /* @__PURE__ */ React9.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
348
|
-
), /* @__PURE__ */ React9.createElement(
|
|
349
|
-
"textarea",
|
|
350
|
-
{
|
|
351
|
-
rows,
|
|
352
|
-
className: `border rounded-md px-4 py-2 w-full text-[14px]
|
|
353
|
-
focus:outline-2 focus:outline-black focus:outline-offset-2
|
|
354
|
-
focus:ring-0 focus:shadow-none focus:border-black
|
|
355
|
-
${disabled ? "bg-gray-100 text-gray-500 border-gray-300" : error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)]"}
|
|
356
|
-
`,
|
|
357
|
-
value,
|
|
358
|
-
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
359
|
-
placeholder,
|
|
360
|
-
disabled,
|
|
361
|
-
readOnly: disabled,
|
|
362
|
-
id: `${id}-textarea-1`
|
|
363
|
-
}
|
|
364
|
-
));
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
// src/inputs/Upload.jsx
|
|
368
|
-
import React10, { useRef as useRef2 } from "react";
|
|
369
|
-
import { Upload } from "lucide-react";
|
|
370
|
-
var CustomUpload = ({
|
|
371
|
-
id = "upload",
|
|
372
|
-
label = "Supporting documents",
|
|
373
|
-
description = "Drop items here or Browse Files",
|
|
374
|
-
accept = ".pdf,.jpg,.jpeg,.png",
|
|
375
|
-
maxSizeMB = 5,
|
|
376
|
-
onChange,
|
|
377
|
-
error,
|
|
378
|
-
value
|
|
379
|
-
}) => {
|
|
380
|
-
const inputRef = useRef2(null);
|
|
381
|
-
const handleFileSelect = (files) => {
|
|
382
|
-
if (!files || files.length === 0) return;
|
|
383
|
-
const selectedFile = files[0];
|
|
384
|
-
if (selectedFile.size > maxSizeMB * 1024 * 1024) {
|
|
385
|
-
alert(`File size must be less than ${maxSizeMB} MB`);
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
onChange == null ? void 0 : onChange(selectedFile);
|
|
389
|
-
};
|
|
390
|
-
return /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col gap-2 w-full", id: `${id}-div-1` }, label && /* @__PURE__ */ React10.createElement("label", { className: "text-sm font-medium", id: `${id}-label-1` }, label), /* @__PURE__ */ React10.createElement(
|
|
391
|
-
"div",
|
|
392
|
-
{
|
|
393
|
-
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
394
|
-
${error ? "border-red-500 bg-red-50" : "border-gray-300 hover:border-gray-400 bg-gray-50"}`,
|
|
395
|
-
onClick: () => {
|
|
396
|
-
var _a;
|
|
397
|
-
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
398
|
-
},
|
|
399
|
-
onDragOver: (e) => e.preventDefault(),
|
|
400
|
-
onDrop: (e) => {
|
|
401
|
-
e.preventDefault();
|
|
402
|
-
handleFileSelect(e.dataTransfer.files);
|
|
403
|
-
},
|
|
404
|
-
id: `${id}-div-2`
|
|
405
|
-
},
|
|
406
|
-
/* @__PURE__ */ React10.createElement(Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
407
|
-
/* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-700", id: `${id}-p-1` }, description),
|
|
408
|
-
/* @__PURE__ */ React10.createElement("p", { className: "text-xs text-gray-500 mt-1", id: `${id}-p-2` }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
409
|
-
/* @__PURE__ */ React10.createElement(
|
|
410
|
-
"input",
|
|
411
|
-
{
|
|
412
|
-
ref: inputRef,
|
|
413
|
-
type: "file",
|
|
414
|
-
accept,
|
|
415
|
-
className: "hidden",
|
|
416
|
-
onChange: (e) => handleFileSelect(e.target.files),
|
|
417
|
-
id: `${id}-input-1`
|
|
418
|
-
}
|
|
419
|
-
)
|
|
420
|
-
), value && /* @__PURE__ */ React10.createElement("span", { className: "text-sm truncate text-gray-500", id: `${id}-span-1` }, "Selected: ", value.name), error && /* @__PURE__ */ React10.createElement("p", { className: "text-xs text-red-500", id: `${id}-p-3` }, error));
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
// src/sideBar/SideBar.jsx
|
|
424
|
-
import {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
// src/
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
)
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
),
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
if (
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
{
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
if (
|
|
1177
|
-
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
const
|
|
1186
|
-
if (
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
if (
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
if (
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
const
|
|
1328
|
-
const
|
|
1329
|
-
const
|
|
1330
|
-
const
|
|
1331
|
-
const
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
()
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
);
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
"
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
)
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
}
|
|
1816
|
-
)
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
"
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
isHideCheckbox
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
const
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
{
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
}
|
|
1
|
+
// src/utils/cn.ts
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// src/Button.jsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
var variantStyles = {
|
|
11
|
+
PRIMARY: "bg-white dark:bg-[#18181b] dark:text-white",
|
|
12
|
+
SECONDARY: "bg-primary text-white dark:text-white",
|
|
13
|
+
DEFAULT: "bg-white text-black dark:text-white",
|
|
14
|
+
DANGER: "bg-[#ef4444] text-white dark:text-white"
|
|
15
|
+
};
|
|
16
|
+
var CustomButton = ({
|
|
17
|
+
id = "button",
|
|
18
|
+
variant = "DEFAULT",
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
onClick,
|
|
22
|
+
disabled = false,
|
|
23
|
+
icon
|
|
24
|
+
}) => {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: cn(
|
|
29
|
+
`cursor-pointer flex items-center py-2 px-3 min-h-10 justify-center border rounded-[6px] border-[#e5e5e5] dark:border-[#303036] ${variant == "DANGER" ? "bg-[#ef4444]" : "dark:bg-[#1d1d20]"} gap-2`,
|
|
30
|
+
variantStyles[variant],
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
onClick,
|
|
34
|
+
id: `${id}-div-1`
|
|
35
|
+
},
|
|
36
|
+
icon && /* @__PURE__ */ React.createElement("div", { id: `${id}-div-2` }, icon),
|
|
37
|
+
children
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/inputs/Autocomplete.jsx
|
|
42
|
+
import React2, { useState, useRef } from "react";
|
|
43
|
+
import { ChevronDown, Check, Search } from "lucide-react";
|
|
44
|
+
var CustomAutocomplete = ({
|
|
45
|
+
id = "autocomplete",
|
|
46
|
+
label,
|
|
47
|
+
value,
|
|
48
|
+
onChange,
|
|
49
|
+
options,
|
|
50
|
+
placeholder = "Search & select...",
|
|
51
|
+
isRequired = false,
|
|
52
|
+
error,
|
|
53
|
+
heading,
|
|
54
|
+
disabled = false
|
|
55
|
+
}) => {
|
|
56
|
+
const [open, setOpen] = useState(false);
|
|
57
|
+
const [search, setSearch] = useState("");
|
|
58
|
+
const wrapperRef = useRef(null);
|
|
59
|
+
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
60
|
+
const handleBlur = (e) => {
|
|
61
|
+
var _a;
|
|
62
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
63
|
+
setOpen(false);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const filteredOptions = options.filter(
|
|
67
|
+
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
68
|
+
);
|
|
69
|
+
const toggleValue = (val) => {
|
|
70
|
+
if (value.includes(val)) {
|
|
71
|
+
onChange(value.filter((v) => v !== val));
|
|
72
|
+
} else {
|
|
73
|
+
onChange([...value, val]);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ React2.createElement(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: "flex flex-col w-full relative dark:bg-[#18181b] dark:text-white",
|
|
80
|
+
ref: wrapperRef,
|
|
81
|
+
tabIndex: disabled ? -1 : 0,
|
|
82
|
+
onBlur: handleBlur,
|
|
83
|
+
id: `${id}-div-1`
|
|
84
|
+
},
|
|
85
|
+
heading && /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1", id: `${id}-h3-1` }, heading),
|
|
86
|
+
label && /* @__PURE__ */ React2.createElement(
|
|
87
|
+
"label",
|
|
88
|
+
{
|
|
89
|
+
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black dark:text-white"}`,
|
|
90
|
+
id: `${id}-label-1`
|
|
91
|
+
},
|
|
92
|
+
label,
|
|
93
|
+
" ",
|
|
94
|
+
isRequired && /* @__PURE__ */ React2.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ React2.createElement(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
onClick: () => {
|
|
100
|
+
if (!disabled) setOpen((prev) => !prev);
|
|
101
|
+
},
|
|
102
|
+
className: `flex justify-between items-center flex-wrap gap-1 rounded-md px-3 py-2 text-sm transition border dark:border-[#303036] h-auto min-h-10 dark:bg-[#18181b] dark:text-white
|
|
103
|
+
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
104
|
+
${error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)] hover:border-gray-400 dark:bg-[#18181b] dark:text-white"}
|
|
105
|
+
`,
|
|
106
|
+
id: `${id}-div-2`
|
|
107
|
+
},
|
|
108
|
+
/* @__PURE__ */ React2.createElement("div", { className: "flex flex-wrap gap-1 flex-1", id: `${id}-div-3` }, selectedOptions.length > 0 ? selectedOptions.map((opt) => /* @__PURE__ */ React2.createElement(
|
|
109
|
+
"span",
|
|
110
|
+
{
|
|
111
|
+
key: opt.value,
|
|
112
|
+
className: "bg-[#F7FAFC] dark:bg-[#303036] border border-gray-300 px-2 dark:text-white py-0.5 rounded text-xs flex items-center gap-1",
|
|
113
|
+
id: `${id}-span-2`
|
|
114
|
+
},
|
|
115
|
+
opt.label,
|
|
116
|
+
/* @__PURE__ */ React2.createElement(
|
|
117
|
+
"button",
|
|
118
|
+
{
|
|
119
|
+
onClick: (e) => {
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
toggleValue(opt.value);
|
|
122
|
+
},
|
|
123
|
+
className: "text-gray-500 hover:text-gray-700 dark:text-white cursor-pointer dark:hover:text-white",
|
|
124
|
+
id: `${id}-button-1`
|
|
125
|
+
},
|
|
126
|
+
"\u2715"
|
|
127
|
+
)
|
|
128
|
+
)) : /* @__PURE__ */ React2.createElement("span", { className: "text-gray-400", id: `${id}-span-3` }, placeholder)),
|
|
129
|
+
/* @__PURE__ */ React2.createElement(
|
|
130
|
+
ChevronDown,
|
|
131
|
+
{
|
|
132
|
+
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
),
|
|
136
|
+
!disabled && open && /* @__PURE__ */ React2.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200", id: `${id}-div-5` }, /* @__PURE__ */ React2.createElement(Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React2.createElement(
|
|
137
|
+
"input",
|
|
138
|
+
{
|
|
139
|
+
type: "text",
|
|
140
|
+
value: search,
|
|
141
|
+
onChange: (e) => setSearch(e.target.value),
|
|
142
|
+
placeholder: "Search...",
|
|
143
|
+
className: "flex-1 text-sm focus:outline-none",
|
|
144
|
+
id: `${id}-input-1`
|
|
145
|
+
}
|
|
146
|
+
)), /* @__PURE__ */ React2.createElement("ul", { id: `${id}-ul-1` }, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
147
|
+
const selected = value.includes(opt.value);
|
|
148
|
+
return /* @__PURE__ */ React2.createElement(
|
|
149
|
+
"li",
|
|
150
|
+
{
|
|
151
|
+
key: opt.value,
|
|
152
|
+
onClick: () => toggleValue(opt.value),
|
|
153
|
+
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-[#F7FAFC] dark:hover:bg-[#303036] ${selected ? "bg-[#F7FAFC] dark:bg-[#303036] font-medium" : ""}`,
|
|
154
|
+
id: `${id}-li-1`
|
|
155
|
+
},
|
|
156
|
+
/* @__PURE__ */ React2.createElement(
|
|
157
|
+
"span",
|
|
158
|
+
{
|
|
159
|
+
className: `w-4 h-4 flex items-center justify-center border rounded-sm ${selected ? "bg-blue-600 border-blue-600 text-white" : "border-gray-300"}`,
|
|
160
|
+
id: `${id}-span-4`
|
|
161
|
+
},
|
|
162
|
+
selected && /* @__PURE__ */ React2.createElement(Check, { size: 14 })
|
|
163
|
+
),
|
|
164
|
+
opt.label
|
|
165
|
+
);
|
|
166
|
+
}) : /* @__PURE__ */ React2.createElement("li", { className: "px-3 py-2 text-sm text-gray-400", id: `${id}-li-2` }, "No results found")))
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// src/inputs/Checkbox.jsx
|
|
171
|
+
import React3 from "react";
|
|
172
|
+
var CustomCheckbox = ({ id = "checkbox", onChange, checked }) => {
|
|
173
|
+
const handleChange = (e) => {
|
|
174
|
+
onChange(e.target.checked);
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ React3.createElement("label", { className: "inline-flex items-center cursor-pointer select-none", id: `${id}-label-1` }, /* @__PURE__ */ React3.createElement(
|
|
177
|
+
"input",
|
|
178
|
+
{
|
|
179
|
+
type: "checkbox",
|
|
180
|
+
checked,
|
|
181
|
+
onChange: handleChange,
|
|
182
|
+
className: "peer hidden",
|
|
183
|
+
id: `${id}-input-1`
|
|
184
|
+
}
|
|
185
|
+
), /* @__PURE__ */ React3.createElement(
|
|
186
|
+
"span",
|
|
187
|
+
{
|
|
188
|
+
className: "\r\n w-4 h-4 flex items-center justify-center border-2 border-gray-400 rounded \r\n peer-checked:bg-primary peer-checked:border-primary\r\n transition-colors\r\n ",
|
|
189
|
+
id: `${id}-span-1`
|
|
190
|
+
},
|
|
191
|
+
checked && /* @__PURE__ */ React3.createElement(
|
|
192
|
+
"svg",
|
|
193
|
+
{
|
|
194
|
+
className: "w-4 h-4 text-white",
|
|
195
|
+
fill: "none",
|
|
196
|
+
stroke: "currentColor",
|
|
197
|
+
strokeWidth: "3",
|
|
198
|
+
viewBox: "0 0 24 24",
|
|
199
|
+
id: `${id}-svg-1`
|
|
200
|
+
},
|
|
201
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M5 13l4 4L19 7", id: `${id}-path-1` })
|
|
202
|
+
)
|
|
203
|
+
));
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// src/inputs/Chip.jsx
|
|
207
|
+
import React4 from "react";
|
|
208
|
+
var VARIANTS = {
|
|
209
|
+
PRIMARY: "bg-gray-100 text-black dark:bg-gray-800 dark:text-white",
|
|
210
|
+
GREEN: "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",
|
|
211
|
+
RED: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100",
|
|
212
|
+
YELLOW: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
|
|
213
|
+
};
|
|
214
|
+
var Chip = ({ id = "chip", label, variant }) => {
|
|
215
|
+
return /* @__PURE__ */ React4.createElement(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`,
|
|
219
|
+
id: `${id}-div-1`
|
|
220
|
+
},
|
|
221
|
+
label
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// src/inputs/CustomSwitch.jsx
|
|
226
|
+
import React5 from "react";
|
|
227
|
+
var CustomSwitch = ({ id = "custom-switch", checked, onChange, label, description }) => {
|
|
228
|
+
return /* @__PURE__ */ React5.createElement("div", { id: `${id}-div-1` }, /* @__PURE__ */ React5.createElement(
|
|
229
|
+
"button",
|
|
230
|
+
{
|
|
231
|
+
type: "button",
|
|
232
|
+
role: "switch",
|
|
233
|
+
"aria-checked": checked,
|
|
234
|
+
onClick: () => onChange(!checked),
|
|
235
|
+
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`,
|
|
236
|
+
id: `${id}-button-1`
|
|
237
|
+
},
|
|
238
|
+
/* @__PURE__ */ React5.createElement(
|
|
239
|
+
"span",
|
|
240
|
+
{
|
|
241
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`,
|
|
242
|
+
id: `${id}-span-1`
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
), /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col", id: `${id}-div-2` }, label && /* @__PURE__ */ React5.createElement("h3", { className: "font-[500] text-sm text-black mb-2", id: `${id}-h3-1` }, label), description && /* @__PURE__ */ React5.createElement("p", { className: "font-[500] text-sm text-[#737373]", id: `${id}-p-1` }, description)));
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
// src/inputs/Input.jsx
|
|
249
|
+
import React6 from "react";
|
|
250
|
+
var CustomInput = ({
|
|
251
|
+
id = "input",
|
|
252
|
+
label,
|
|
253
|
+
isRequired,
|
|
254
|
+
value,
|
|
255
|
+
onChange,
|
|
256
|
+
placeholder,
|
|
257
|
+
disabled = false,
|
|
258
|
+
error,
|
|
259
|
+
heading
|
|
260
|
+
}) => {
|
|
261
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "flex flex-col gap-1 w-full", id: `${id}-div-1` }, heading && /* @__PURE__ */ React6.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), /* @__PURE__ */ React6.createElement(
|
|
262
|
+
"label",
|
|
263
|
+
{
|
|
264
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`,
|
|
265
|
+
id: `${id}-label-1`
|
|
266
|
+
},
|
|
267
|
+
label,
|
|
268
|
+
" ",
|
|
269
|
+
isRequired && /* @__PURE__ */ React6.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
270
|
+
), /* @__PURE__ */ React6.createElement(
|
|
271
|
+
"input",
|
|
272
|
+
{
|
|
273
|
+
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
274
|
+
placeholder:text-[14px] placeholder:font-normal placeholder:text-[#6b7280]
|
|
275
|
+
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
276
|
+
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
277
|
+
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-500 border-gray-300" : error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)]"}
|
|
278
|
+
`,
|
|
279
|
+
value,
|
|
280
|
+
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
281
|
+
placeholder,
|
|
282
|
+
disabled,
|
|
283
|
+
readOnly: disabled,
|
|
284
|
+
id: `${id}-input-1`
|
|
285
|
+
}
|
|
286
|
+
));
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// src/inputs/ProgressBar.jsx
|
|
290
|
+
import React7 from "react";
|
|
291
|
+
var ProgressBar = ({ id = "progress-bar", step, totalSteps }) => {
|
|
292
|
+
const progress = step / totalSteps * 100;
|
|
293
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "mb-6", id: `${id}-div-1` }, /* @__PURE__ */ React7.createElement("p", { className: "text-gray-600 text-sm mb-2", id: `${id}-p-1` }, "Step ", step, " of ", totalSteps), /* @__PURE__ */ React7.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2", id: `${id}-div-2` }, /* @__PURE__ */ React7.createElement(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
297
|
+
style: { width: `${progress}%` },
|
|
298
|
+
id: `${id}-div-3`
|
|
299
|
+
}
|
|
300
|
+
)));
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
// src/inputs/Search.jsx
|
|
304
|
+
import React8 from "react";
|
|
305
|
+
import { Search as Search2 } from "lucide-react";
|
|
306
|
+
var CustomSearch = ({
|
|
307
|
+
id = "search",
|
|
308
|
+
value,
|
|
309
|
+
onChange,
|
|
310
|
+
placeholder = "Search Markets..."
|
|
311
|
+
}) => {
|
|
312
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "flex items-center border bg-transparent text-[14px] border-[hsl(0_0%_89.8%)] dark:border-[#303036] \r\n rounded-md h-10 px-2 w-full focus-within:outline-2 focus-within:outline-black focus-within:outline-offset-2 dark:text-white", id: `${id}-div-1` }, /* @__PURE__ */ React8.createElement(Search2, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ React8.createElement(
|
|
313
|
+
"input",
|
|
314
|
+
{
|
|
315
|
+
type: "text",
|
|
316
|
+
value,
|
|
317
|
+
onChange,
|
|
318
|
+
placeholder,
|
|
319
|
+
className: "bg-transparent w-full h-full focus:outline-none",
|
|
320
|
+
id: `${id}-input-1`
|
|
321
|
+
}
|
|
322
|
+
));
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// src/inputs/TextArea.jsx
|
|
326
|
+
import React9 from "react";
|
|
327
|
+
var CustomTextarea = ({
|
|
328
|
+
id = "text-area",
|
|
329
|
+
label,
|
|
330
|
+
isRequired,
|
|
331
|
+
value,
|
|
332
|
+
onChange,
|
|
333
|
+
placeholder,
|
|
334
|
+
disabled = false,
|
|
335
|
+
error,
|
|
336
|
+
heading,
|
|
337
|
+
rows = 4
|
|
338
|
+
}) => {
|
|
339
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-col gap-1 w-full", id: `${id}-div-1` }, heading && /* @__PURE__ */ React9.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), /* @__PURE__ */ React9.createElement(
|
|
340
|
+
"label",
|
|
341
|
+
{
|
|
342
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`,
|
|
343
|
+
id: `${id}-label-1`
|
|
344
|
+
},
|
|
345
|
+
label,
|
|
346
|
+
" ",
|
|
347
|
+
isRequired && /* @__PURE__ */ React9.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
348
|
+
), /* @__PURE__ */ React9.createElement(
|
|
349
|
+
"textarea",
|
|
350
|
+
{
|
|
351
|
+
rows,
|
|
352
|
+
className: `border rounded-md px-4 py-2 w-full text-[14px]
|
|
353
|
+
focus:outline-2 focus:outline-black focus:outline-offset-2
|
|
354
|
+
focus:ring-0 focus:shadow-none focus:border-black
|
|
355
|
+
${disabled ? "bg-gray-100 text-gray-500 border-gray-300" : error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)]"}
|
|
356
|
+
`,
|
|
357
|
+
value,
|
|
358
|
+
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
359
|
+
placeholder,
|
|
360
|
+
disabled,
|
|
361
|
+
readOnly: disabled,
|
|
362
|
+
id: `${id}-textarea-1`
|
|
363
|
+
}
|
|
364
|
+
));
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
// src/inputs/Upload.jsx
|
|
368
|
+
import React10, { useRef as useRef2 } from "react";
|
|
369
|
+
import { Upload } from "lucide-react";
|
|
370
|
+
var CustomUpload = ({
|
|
371
|
+
id = "upload",
|
|
372
|
+
label = "Supporting documents",
|
|
373
|
+
description = "Drop items here or Browse Files",
|
|
374
|
+
accept = ".pdf,.jpg,.jpeg,.png",
|
|
375
|
+
maxSizeMB = 5,
|
|
376
|
+
onChange,
|
|
377
|
+
error,
|
|
378
|
+
value
|
|
379
|
+
}) => {
|
|
380
|
+
const inputRef = useRef2(null);
|
|
381
|
+
const handleFileSelect = (files) => {
|
|
382
|
+
if (!files || files.length === 0) return;
|
|
383
|
+
const selectedFile = files[0];
|
|
384
|
+
if (selectedFile.size > maxSizeMB * 1024 * 1024) {
|
|
385
|
+
alert(`File size must be less than ${maxSizeMB} MB`);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
onChange == null ? void 0 : onChange(selectedFile);
|
|
389
|
+
};
|
|
390
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col gap-2 w-full", id: `${id}-div-1` }, label && /* @__PURE__ */ React10.createElement("label", { className: "text-sm font-medium", id: `${id}-label-1` }, label), /* @__PURE__ */ React10.createElement(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
394
|
+
${error ? "border-red-500 bg-red-50" : "border-gray-300 hover:border-gray-400 bg-gray-50"}`,
|
|
395
|
+
onClick: () => {
|
|
396
|
+
var _a;
|
|
397
|
+
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
398
|
+
},
|
|
399
|
+
onDragOver: (e) => e.preventDefault(),
|
|
400
|
+
onDrop: (e) => {
|
|
401
|
+
e.preventDefault();
|
|
402
|
+
handleFileSelect(e.dataTransfer.files);
|
|
403
|
+
},
|
|
404
|
+
id: `${id}-div-2`
|
|
405
|
+
},
|
|
406
|
+
/* @__PURE__ */ React10.createElement(Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
407
|
+
/* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-700", id: `${id}-p-1` }, description),
|
|
408
|
+
/* @__PURE__ */ React10.createElement("p", { className: "text-xs text-gray-500 mt-1", id: `${id}-p-2` }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
409
|
+
/* @__PURE__ */ React10.createElement(
|
|
410
|
+
"input",
|
|
411
|
+
{
|
|
412
|
+
ref: inputRef,
|
|
413
|
+
type: "file",
|
|
414
|
+
accept,
|
|
415
|
+
className: "hidden",
|
|
416
|
+
onChange: (e) => handleFileSelect(e.target.files),
|
|
417
|
+
id: `${id}-input-1`
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
), value && /* @__PURE__ */ React10.createElement("span", { className: "text-sm truncate text-gray-500", id: `${id}-span-1` }, "Selected: ", value.name), error && /* @__PURE__ */ React10.createElement("p", { className: "text-xs text-red-500", id: `${id}-p-3` }, error));
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// src/sideBar/SideBar.jsx
|
|
424
|
+
import React14, { useEffect as useEffect3, useState as useState4, useCallback, useRef as useRef4, useMemo as useMemo2 } from "react";
|
|
425
|
+
|
|
426
|
+
// ConstantUI.js
|
|
427
|
+
import {
|
|
428
|
+
Home,
|
|
429
|
+
Banknote,
|
|
430
|
+
LifeBuoy,
|
|
431
|
+
Cog,
|
|
432
|
+
Building,
|
|
433
|
+
Handshake,
|
|
434
|
+
DollarSign,
|
|
435
|
+
BarChart3
|
|
436
|
+
} from "lucide-react";
|
|
437
|
+
var encodedAuthData = localStorage.getItem("encodedAuthData");
|
|
438
|
+
var navItemsConstant = [
|
|
439
|
+
{
|
|
440
|
+
Icon: Home,
|
|
441
|
+
label: "Home",
|
|
442
|
+
onClick: () => {
|
|
443
|
+
window.location.href = "/";
|
|
444
|
+
},
|
|
445
|
+
isDropDown: false
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
Icon: Building,
|
|
449
|
+
label: "Consumer Ecosystem",
|
|
450
|
+
onClick: () => {
|
|
451
|
+
},
|
|
452
|
+
options: [
|
|
453
|
+
{
|
|
454
|
+
label: "Corporate",
|
|
455
|
+
onClick: () => {
|
|
456
|
+
window.location.href = "/corporate/";
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
label: "Trips",
|
|
461
|
+
onClick: () => {
|
|
462
|
+
window.location.href = "/corporate/trips/";
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
label: "Users",
|
|
467
|
+
onClick: () => {
|
|
468
|
+
window.location.href = "/users/users";
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
label: "Tags (Custom Variables)",
|
|
473
|
+
onClick: () => {
|
|
474
|
+
window.location.href = "/orgselector/?path=tag";
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
label: "Special Request",
|
|
479
|
+
onClick: () => {
|
|
480
|
+
window.location.href = "/orgselector/?path=special-requests";
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
label: "Support Tickets (Coming Soon)",
|
|
485
|
+
isDisabled: true
|
|
486
|
+
// onClick: () => {},
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
isDropDown: true
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
Icon: Banknote,
|
|
493
|
+
label: "Finance",
|
|
494
|
+
onClick: () => {
|
|
495
|
+
},
|
|
496
|
+
isDropDown: true,
|
|
497
|
+
options: [
|
|
498
|
+
{
|
|
499
|
+
label: "Credit Management",
|
|
500
|
+
onClick: () => {
|
|
501
|
+
window.location.href = "/finance/paymentsLedger/";
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
label: "Booking & Invoices",
|
|
506
|
+
onClick: () => {
|
|
507
|
+
window.location.href = "/finance/bookingHistory/";
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
Icon: DollarSign,
|
|
514
|
+
label: "Revenue Management",
|
|
515
|
+
onClick: () => {
|
|
516
|
+
},
|
|
517
|
+
isDropDown: true,
|
|
518
|
+
options: [
|
|
519
|
+
{
|
|
520
|
+
label: "Pricing Engine",
|
|
521
|
+
onClick: () => {
|
|
522
|
+
window.location.href = "/orgselector/?path=pricing-policy";
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
label: "Offers",
|
|
527
|
+
onClick: () => {
|
|
528
|
+
window.location.href = "/orgselector/?path=offer";
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
label: "Vouchers",
|
|
533
|
+
onClick: () => {
|
|
534
|
+
window.location.href = "/orgselector/?path=voucher";
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
Icon: Handshake,
|
|
541
|
+
label: "Supplier Ecosystem",
|
|
542
|
+
onClick: () => {
|
|
543
|
+
},
|
|
544
|
+
isDropDown: true,
|
|
545
|
+
options: [
|
|
546
|
+
{
|
|
547
|
+
label: "Suppliers List",
|
|
548
|
+
onClick: () => {
|
|
549
|
+
window.location.href = "/orgselector/?path=supplier-list";
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
label: "Supplier Deals",
|
|
554
|
+
onClick: () => {
|
|
555
|
+
window.location.href = "/supplierdeals/";
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
Icon: BarChart3,
|
|
562
|
+
label: "Reports",
|
|
563
|
+
onClick: () => {
|
|
564
|
+
},
|
|
565
|
+
isDropDown: true,
|
|
566
|
+
options: [
|
|
567
|
+
{
|
|
568
|
+
label: "Reports",
|
|
569
|
+
onClick: () => {
|
|
570
|
+
window.location.href = "/reports/";
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
]
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
Icon: Cog,
|
|
577
|
+
label: "Settings",
|
|
578
|
+
onClick: () => {
|
|
579
|
+
},
|
|
580
|
+
isDropDown: true,
|
|
581
|
+
options: [
|
|
582
|
+
{
|
|
583
|
+
label: "Whitelabel",
|
|
584
|
+
onClick: () => {
|
|
585
|
+
window.location.href = "/whitelabel/";
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
label: "Markets",
|
|
590
|
+
onClick: () => {
|
|
591
|
+
window.location.href = "/market/";
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
label: "AuthMesh",
|
|
596
|
+
onClick: () => {
|
|
597
|
+
window.location.href = "/settings/authmesh";
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
label: "Audit",
|
|
602
|
+
onClick: () => {
|
|
603
|
+
window.location.href = "/market/audit";
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
label: "Users",
|
|
608
|
+
onClick: () => {
|
|
609
|
+
window.location.href = `/users/users?role=admin&auth=${encodedAuthData}`;
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
label: "Reports Configurations",
|
|
614
|
+
onClick: () => {
|
|
615
|
+
window.location.href = "/reports/";
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
];
|
|
621
|
+
var additionalItemsConstant = [
|
|
622
|
+
{
|
|
623
|
+
Icon: LifeBuoy,
|
|
624
|
+
label: "Help",
|
|
625
|
+
onClick: () => {
|
|
626
|
+
window.location.href = "/help";
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
];
|
|
630
|
+
|
|
631
|
+
// src/utils/cookieHelpers.js
|
|
632
|
+
var JETT_ID_COOKIE_NAME = "jett-id";
|
|
633
|
+
function getCookie(name) {
|
|
634
|
+
if (typeof document === "undefined" || !document.cookie) return null;
|
|
635
|
+
const match = document.cookie.match(
|
|
636
|
+
new RegExp("(^|\\s)" + name + "=([^;]+)")
|
|
637
|
+
);
|
|
638
|
+
return match ? decodeURIComponent(match[2].trim()) : null;
|
|
639
|
+
}
|
|
640
|
+
function decodeBase64(value) {
|
|
641
|
+
try {
|
|
642
|
+
let base64 = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
643
|
+
const pad = base64.length % 4;
|
|
644
|
+
if (pad) base64 += "=".repeat(4 - pad);
|
|
645
|
+
return atob(base64);
|
|
646
|
+
} catch {
|
|
647
|
+
return "";
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
function getJettIdCookieData() {
|
|
651
|
+
const raw = getCookie(JETT_ID_COOKIE_NAME);
|
|
652
|
+
if (!raw) return null;
|
|
653
|
+
try {
|
|
654
|
+
const decoded = decodeBase64(raw);
|
|
655
|
+
if (!decoded) return null;
|
|
656
|
+
const data = JSON.parse(decoded);
|
|
657
|
+
return data && typeof data === "object" ? data : null;
|
|
658
|
+
} catch {
|
|
659
|
+
return null;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
function getLogoFromJettIdCookie() {
|
|
663
|
+
const data = getJettIdCookieData();
|
|
664
|
+
if (!(data == null ? void 0 : data.CDNBasePath)) return null;
|
|
665
|
+
const logoPath = (data.OrgLogo || data.TmcLogo || "").trim();
|
|
666
|
+
if (!logoPath) return null;
|
|
667
|
+
return {
|
|
668
|
+
logoPath,
|
|
669
|
+
CDNBasePath: data.CDNBasePath
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function getScopeFromJettIdCookie() {
|
|
673
|
+
const data = getJettIdCookieData();
|
|
674
|
+
return (data == null ? void 0 : data.Scope) ?? null;
|
|
675
|
+
}
|
|
676
|
+
function getProfilesFromJettIdCookie(all) {
|
|
677
|
+
const data = getJettIdCookieData();
|
|
678
|
+
if (!(data == null ? void 0 : data.Profiles)) return [];
|
|
679
|
+
if (all) return data.Profiles;
|
|
680
|
+
return data.Profiles.filter((profile) => {
|
|
681
|
+
var _a;
|
|
682
|
+
return (_a = profile.Scope) == null ? void 0 : _a.endsWith("_ENTITY");
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
function buildLogoUrl(CDNBasePath, logoPath) {
|
|
686
|
+
const base = (CDNBasePath || "").replace(/\/$/, "");
|
|
687
|
+
const path = (logoPath || "").replace(/^\//, "");
|
|
688
|
+
if (!base || !path) return "";
|
|
689
|
+
return `${base}/${path}`;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// src/utils/switchProfileEncryption.js
|
|
693
|
+
import forge from "node-forge";
|
|
694
|
+
var RSA_MODULUS_BASE64 = "zktSGmyKa5SR8HO540HKTdgDPVmXafgGFrf4OYtRNApRssnt0hGoMU7Jitc/SVWbPstFshIi5XblbDL2NXWYhZtj4PWL4SKc1/bM02xxabPw/eFr3XAAPCF62WxAVPsJBbEoAB0AcOCeIcGHb+tzLtXQJAvOuIBsKLQiiB7/c9ltt5AVVM4si1RC3JsxpqcGTkgwnh+FMg8CFvLdHjh/oi789wj8zoGWLAdYSBBa8IoQgTuzZt1tft2LF0y4Ck3yT8F9TX5GbAiVXb0G9cM/hUmDNz/6xOvHuOfH5147tKDUNCT/sr5tEaLm5ePUmRdpoc5PZa04q1KGJ0rxf6T55E5pQ8Qh2EFr1yPyLh12wiSTRsnHwXwVsosbNNBBN3HdBOMklTQx2VJNDHpi19G+z4d1evlS8yDqNZe9QyRFKEsTd+xPg3ob3j/ObpYDOtXoMaw8fXWbvyG4MJTz7nWG5YL2s5oWSAFZ4mifgwOmM/OuTO/uholelws25k/a3+O/s5Xd/HOugBvpeb5azGLfMHrGvu6J9DSIVI28hfbaFm2+smjyLdS+5PWV2+hM9EQLgaw/euGx4Qhzo2nagLwl9+hNOZ2gjtNHJxJtbQJTNrE90d3mX2/yfxHzh8FiiAiraxiZCgdUQeEZbZNlAwQLHIYWazSqgmRhf4D1LGMMrak=";
|
|
695
|
+
var RSA_EXPONENT_BASE64 = "AQAB";
|
|
696
|
+
var convertModulusExponentToPem = (modulus, exponent) => {
|
|
697
|
+
const decodedModulus = forge.util.decode64(modulus);
|
|
698
|
+
const decodedExponent = forge.util.decode64(exponent);
|
|
699
|
+
const publicKey = forge.pki.setRsaPublicKey(
|
|
700
|
+
new forge.jsbn.BigInteger(forge.util.bytesToHex(decodedModulus), 16),
|
|
701
|
+
new forge.jsbn.BigInteger(forge.util.bytesToHex(decodedExponent), 16)
|
|
702
|
+
);
|
|
703
|
+
return forge.pki.publicKeyToPem(publicKey);
|
|
704
|
+
};
|
|
705
|
+
var cachedPemKey = null;
|
|
706
|
+
var getPemKey = () => {
|
|
707
|
+
if (!cachedPemKey) {
|
|
708
|
+
cachedPemKey = convertModulusExponentToPem(RSA_MODULUS_BASE64, RSA_EXPONENT_BASE64);
|
|
709
|
+
}
|
|
710
|
+
return cachedPemKey;
|
|
711
|
+
};
|
|
712
|
+
var encryptForSwitchProfile = (plainText) => {
|
|
713
|
+
const publicKey = forge.pki.publicKeyFromPem(getPemKey());
|
|
714
|
+
const encrypted = publicKey.encrypt(plainText, "RSAES-PKCS1-V1_5");
|
|
715
|
+
return forge.util.encode64(encrypted).replace(/\r?\n|\r/g, "");
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
// src/utils/switchProfileApi.js
|
|
719
|
+
var PROFILE_SWITCH_FLAG_KEY = "jett_profile_switch_done";
|
|
720
|
+
var hasSwitchedProfileThisSession = () => {
|
|
721
|
+
try {
|
|
722
|
+
return typeof localStorage !== "undefined" && localStorage.getItem(PROFILE_SWITCH_FLAG_KEY) === "true";
|
|
723
|
+
} catch {
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
var markProfileSwitched = () => {
|
|
728
|
+
try {
|
|
729
|
+
if (typeof localStorage !== "undefined") {
|
|
730
|
+
localStorage.setItem(PROFILE_SWITCH_FLAG_KEY, "true");
|
|
731
|
+
}
|
|
732
|
+
} catch {
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
var clearProfileSwitchFlag = () => {
|
|
736
|
+
try {
|
|
737
|
+
if (typeof localStorage !== "undefined") {
|
|
738
|
+
localStorage.removeItem(PROFILE_SWITCH_FLAG_KEY);
|
|
739
|
+
}
|
|
740
|
+
} catch {
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
var buildRequestContext = () => ({
|
|
744
|
+
UserAgent: typeof navigator !== "undefined" ? navigator.userAgent : "Mozilla/5.0",
|
|
745
|
+
TrackingId: crypto.randomUUID(),
|
|
746
|
+
TransactionId: crypto.randomUUID(),
|
|
747
|
+
CountryCode: "IN",
|
|
748
|
+
IpAddress: "127.0.0.1"
|
|
749
|
+
// Client IP cannot be retrieved from browser
|
|
750
|
+
});
|
|
751
|
+
var switchProfile = async (profile) => {
|
|
752
|
+
markProfileSwitched();
|
|
753
|
+
const encryptedRequest = encryptForSwitchProfile(
|
|
754
|
+
JSON.stringify({
|
|
755
|
+
ProfileToken: profile.ProfileToken,
|
|
756
|
+
ProfileId: profile.ProfileId
|
|
757
|
+
})
|
|
758
|
+
);
|
|
759
|
+
return fetch(`${window.location.origin}/auth/switch/profile`, {
|
|
760
|
+
method: "POST",
|
|
761
|
+
credentials: "include",
|
|
762
|
+
headers: { "Content-Type": "application/json" },
|
|
763
|
+
body: JSON.stringify({
|
|
764
|
+
Context: buildRequestContext(),
|
|
765
|
+
Request: encryptedRequest
|
|
766
|
+
})
|
|
767
|
+
}).then((res) => res.json());
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
// src/sideBar/SwitchProfileSection.jsx
|
|
771
|
+
import React12, { useEffect, useLayoutEffect, useState as useState2 } from "react";
|
|
772
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
773
|
+
import { LogOut as LogOut2, UserRound } from "lucide-react";
|
|
774
|
+
|
|
775
|
+
// src/sideBar/LogoutConfirmModal.jsx
|
|
776
|
+
import React11 from "react";
|
|
777
|
+
import { createPortal } from "react-dom";
|
|
778
|
+
import { LogOut } from "lucide-react";
|
|
779
|
+
var LogoutConfirmModal = ({
|
|
780
|
+
id = "logout-confirm",
|
|
781
|
+
open,
|
|
782
|
+
onConfirm,
|
|
783
|
+
onCancel,
|
|
784
|
+
loading = false
|
|
785
|
+
}) => {
|
|
786
|
+
if (!open || typeof document === "undefined") return null;
|
|
787
|
+
const handleOverlayClick = (e) => {
|
|
788
|
+
if (e.target === e.currentTarget && !loading) onCancel();
|
|
789
|
+
};
|
|
790
|
+
return createPortal(
|
|
791
|
+
/* @__PURE__ */ React11.createElement(
|
|
792
|
+
"div",
|
|
793
|
+
{
|
|
794
|
+
className: "fixed inset-0 z-[10000] flex items-center justify-center bg-black/50",
|
|
795
|
+
onClick: handleOverlayClick,
|
|
796
|
+
id: `${id}-overlay`
|
|
797
|
+
},
|
|
798
|
+
/* @__PURE__ */ React11.createElement("div", { className: "w-[360px] rounded-2xl bg-white dark:bg-[#18181b] p-6 text-center shadow-2xl", id: `${id}-dialog` }, /* @__PURE__ */ React11.createElement("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-blue-50 dark:bg-blue-950/40", id: `${id}-icon` }, /* @__PURE__ */ React11.createElement(LogOut, { className: "text-blue-600", width: 28, height: 28 })), /* @__PURE__ */ React11.createElement("p", { className: "!text-[22px] !font-semibold text-gray-900 dark:text-white" }, "Are you sure you want to logout?"), /* @__PURE__ */ React11.createElement("div", { className: "mt-6 flex gap-3" }, /* @__PURE__ */ React11.createElement(
|
|
799
|
+
"button",
|
|
800
|
+
{
|
|
801
|
+
type: "button",
|
|
802
|
+
onClick: onCancel,
|
|
803
|
+
disabled: loading,
|
|
804
|
+
className: "flex-1 no-wrap rounded-lg border border-gray-300 dark:border-[#303036] px-4 py-2 text-[14px] font-medium text-gray-700 dark:text-[#f4f4f5cc] cursor-pointer hover:bg-gray-50 dark:hover:bg-[#27272a] disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",
|
|
805
|
+
id: `${id}-cancel-button`
|
|
806
|
+
},
|
|
807
|
+
"No, Keep me in"
|
|
808
|
+
), /* @__PURE__ */ React11.createElement(
|
|
809
|
+
"button",
|
|
810
|
+
{
|
|
811
|
+
type: "button",
|
|
812
|
+
onClick: onConfirm,
|
|
813
|
+
disabled: loading,
|
|
814
|
+
className: "flex-1 rounded-lg bg-red-600 px-4 py-2 text-[14px] font-medium text-white cursor-pointer hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",
|
|
815
|
+
id: `${id}-confirm-button`
|
|
816
|
+
},
|
|
817
|
+
loading ? "Logging out..." : "Yes, logout"
|
|
818
|
+
)))
|
|
819
|
+
),
|
|
820
|
+
document.body
|
|
821
|
+
);
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
// src/sideBar/SwitchProfileSection.jsx
|
|
825
|
+
var SwitchProfileSection = ({
|
|
826
|
+
id = "switch-profile",
|
|
827
|
+
open,
|
|
828
|
+
anchorRef,
|
|
829
|
+
onClose,
|
|
830
|
+
onManageProfile,
|
|
831
|
+
onProfileSwitch,
|
|
832
|
+
onTmcSettings,
|
|
833
|
+
onLogout,
|
|
834
|
+
collapsed = false,
|
|
835
|
+
scopeLabel = ""
|
|
836
|
+
}) => {
|
|
837
|
+
const [position, setPosition] = useState2(null);
|
|
838
|
+
const [showLogoutConfirm, setShowLogoutConfirm] = useState2(false);
|
|
839
|
+
const [switchingProfileId, setSwitchingProfileId] = useState2(null);
|
|
840
|
+
const [switchError, setSwitchError] = useState2(null);
|
|
841
|
+
const jettIdData = getJettIdCookieData();
|
|
842
|
+
const userName = (jettIdData == null ? void 0 : jettIdData.UserName) || "";
|
|
843
|
+
const userEmail = (jettIdData == null ? void 0 : jettIdData.UserEmail) || "";
|
|
844
|
+
const currentProfileId = jettIdData == null ? void 0 : jettIdData.ProfileId;
|
|
845
|
+
const allMarkets = getProfilesFromJettIdCookie(true);
|
|
846
|
+
const markets = allMarkets.length ? allMarkets : (jettIdData == null ? void 0 : jettIdData.EntityName) ? [{ ProfileId: currentProfileId, EntityName: jettIdData.EntityName }] : [];
|
|
847
|
+
const handleProfileSwitch = async (profile) => {
|
|
848
|
+
var _a, _b, _c;
|
|
849
|
+
if (switchingProfileId) return;
|
|
850
|
+
setSwitchingProfileId(profile.ProfileId);
|
|
851
|
+
setSwitchError(null);
|
|
852
|
+
try {
|
|
853
|
+
const response = await switchProfile(profile);
|
|
854
|
+
const statusCode = (_a = response == null ? void 0 : response.Context) == null ? void 0 : _a.StatusCode;
|
|
855
|
+
const isSuccess = !statusCode || statusCode === 200;
|
|
856
|
+
if (!isSuccess) {
|
|
857
|
+
setSwitchError(((_b = response == null ? void 0 : response.Context) == null ? void 0 : _b.Message) || "Unable to switch profile. Please try again.");
|
|
858
|
+
setSwitchingProfileId(null);
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
if ((_c = response == null ? void 0 : response.Response) == null ? void 0 : _c.RedirectUrl) {
|
|
862
|
+
window.location.href = response.Response.RedirectUrl;
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
setSwitchingProfileId(null);
|
|
866
|
+
onProfileSwitch == null ? void 0 : onProfileSwitch(profile);
|
|
867
|
+
} catch (error) {
|
|
868
|
+
console.error("Switch profile request failed:", error);
|
|
869
|
+
setSwitchError("Something went wrong while switching profile. Please try again.");
|
|
870
|
+
setSwitchingProfileId(null);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
useLayoutEffect(() => {
|
|
874
|
+
if (!open || !(anchorRef == null ? void 0 : anchorRef.current)) return;
|
|
875
|
+
const updatePosition = () => {
|
|
876
|
+
const rect = anchorRef.current.getBoundingClientRect();
|
|
877
|
+
const width = Math.min(296, window.innerWidth - 16);
|
|
878
|
+
setPosition(
|
|
879
|
+
collapsed ? { left: rect.right + 8, bottom: Math.max(8, window.innerHeight - rect.bottom) } : { left: Math.max(8, Math.min(rect.left + 12, window.innerWidth - width - 8)), bottom: window.innerHeight - rect.top - 4 }
|
|
880
|
+
);
|
|
881
|
+
};
|
|
882
|
+
updatePosition();
|
|
883
|
+
window.addEventListener("resize", updatePosition);
|
|
884
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
885
|
+
return () => {
|
|
886
|
+
window.removeEventListener("resize", updatePosition);
|
|
887
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
888
|
+
};
|
|
889
|
+
}, [open, anchorRef, collapsed]);
|
|
890
|
+
useEffect(() => {
|
|
891
|
+
if (!open) setSwitchError(null);
|
|
892
|
+
}, [open]);
|
|
893
|
+
useEffect(() => {
|
|
894
|
+
if (!switchError) return;
|
|
895
|
+
const timer = setTimeout(() => setSwitchError(null), 5e3);
|
|
896
|
+
return () => clearTimeout(timer);
|
|
897
|
+
}, [switchError]);
|
|
898
|
+
if (!open && !showLogoutConfirm || typeof document === "undefined") return null;
|
|
899
|
+
const handleConfirmLogout = () => {
|
|
900
|
+
setShowLogoutConfirm(false);
|
|
901
|
+
onLogout == null ? void 0 : onLogout();
|
|
902
|
+
};
|
|
903
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, open && createPortal2(
|
|
904
|
+
/* @__PURE__ */ React12.createElement("div", { className: "font-jett", "data-jett-shell": true }, /* @__PURE__ */ React12.createElement("div", { className: "fixed inset-0 z-[9999]", onClick: onClose, id: `${id}-backdrop`, "aria-hidden": "true" }), /* @__PURE__ */ React12.createElement(
|
|
905
|
+
"div",
|
|
906
|
+
{
|
|
907
|
+
role: "dialog",
|
|
908
|
+
"aria-label": "Account",
|
|
909
|
+
className: "fixed z-[9999] flex max-h-[75vh] w-[296px] max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-[10px] border border-jett-line bg-jett-surface text-jett-ink shadow-jett-pop",
|
|
910
|
+
style: position ? { left: position.left, bottom: position.bottom } : { left: -9999, bottom: 0 },
|
|
911
|
+
id: `${id}-panel`
|
|
912
|
+
},
|
|
913
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-3 p-4", id: `${id}-header` }, /* @__PURE__ */ React12.createElement("span", { className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-jett-ink-800 text-[15px] font-semibold text-white", id: `${id}-avatar` }, userName ? userName.split(/\s+/).filter(Boolean).slice(0, 2).map((p) => p[0]).join("").toUpperCase() : "A"), /* @__PURE__ */ React12.createElement("div", { className: "min-w-0 flex-1", id: `${id}-header-text` }, /* @__PURE__ */ React12.createElement("div", { className: "truncate text-[14px] font-medium text-jett-ink-800" }, userName || "Admin"), userEmail && /* @__PURE__ */ React12.createElement("div", { className: "truncate text-[13px] text-jett-ink-500" }, userEmail), scopeLabel && /* @__PURE__ */ React12.createElement("span", { className: "mt-1.5 inline-flex rounded-full border border-jett-line bg-jett-fill px-[7px] py-px text-[11px] font-semibold text-jett-ink-600" }, scopeLabel))),
|
|
914
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex flex-col gap-0.5 px-2 pb-2" }, /* @__PURE__ */ React12.createElement(
|
|
915
|
+
"button",
|
|
916
|
+
{
|
|
917
|
+
type: "button",
|
|
918
|
+
onClick: onManageProfile,
|
|
919
|
+
className: "flex w-full cursor-pointer items-center gap-2.5 rounded-[6px] border-0 bg-transparent p-2 text-left text-[14px] text-jett-ink-700 hover:bg-jett-canvas hover:text-jett-ink",
|
|
920
|
+
id: `${id}-manage-profile-button`
|
|
921
|
+
},
|
|
922
|
+
/* @__PURE__ */ React12.createElement(UserRound, { width: 16, height: 16, strokeWidth: 1.8, className: "text-jett-ink-400", "aria-hidden": "true" }),
|
|
923
|
+
"Manage profile"
|
|
924
|
+
)),
|
|
925
|
+
/* @__PURE__ */ React12.createElement("div", { className: "min-h-0 overflow-y-auto border-t border-jett-line-row px-4 py-3 scrollbar-hide", id: `${id}-body` }, /* @__PURE__ */ React12.createElement("div", { className: "text-[11px] font-semibold uppercase tracking-[0.06em] text-jett-ink-400", id: `${id}-markets-label` }, "Your markets"), switchError && /* @__PURE__ */ React12.createElement("div", { role: "alert", className: "mt-2 rounded-[6px] border border-[#fca5a5] bg-jett-danger-soft px-3 py-2 text-[12px] font-medium text-jett-danger", id: `${id}-switch-error` }, switchError), /* @__PURE__ */ React12.createElement("div", { className: "mt-2 flex flex-col gap-1", role: "list", id: `${id}-markets-list` }, markets.length === 0 && /* @__PURE__ */ React12.createElement("p", { className: "!m-0 py-1 text-[13px] text-jett-ink-500", id: `${id}-markets-empty` }, "No markets available"), markets.map((profile) => {
|
|
926
|
+
const isCurrent = profile.ProfileId === currentProfileId;
|
|
927
|
+
const isSwitching = switchingProfileId === profile.ProfileId;
|
|
928
|
+
return /* @__PURE__ */ React12.createElement(
|
|
929
|
+
"button",
|
|
930
|
+
{
|
|
931
|
+
key: profile.ProfileId,
|
|
932
|
+
type: "button",
|
|
933
|
+
role: "listitem",
|
|
934
|
+
onClick: () => !isCurrent && handleProfileSwitch(profile),
|
|
935
|
+
disabled: isSwitching || !!switchingProfileId,
|
|
936
|
+
"aria-current": isCurrent || void 0,
|
|
937
|
+
className: `flex w-full items-center justify-between gap-2 rounded-[6px] border px-2.5 py-2 text-left transition-colors ${isCurrent ? "cursor-default border-jett-line bg-jett-fill" : "cursor-pointer border-transparent bg-transparent hover:bg-jett-canvas"} ${isSwitching ? "opacity-60" : ""}`,
|
|
938
|
+
id: `${id}-market-${profile.ProfileId}`
|
|
939
|
+
},
|
|
940
|
+
/* @__PURE__ */ React12.createElement("span", { className: `truncate text-[13px] text-jett-ink ${isCurrent ? "font-semibold" : "font-medium"}` }, profile.EntityName),
|
|
941
|
+
isCurrent && /* @__PURE__ */ React12.createElement("span", { className: "shrink-0 rounded-full bg-jett-brand-soft px-2 py-px text-[11px] font-semibold text-jett-brand-hover" }, "Signed in"),
|
|
942
|
+
isSwitching && /* @__PURE__ */ React12.createElement("span", { className: "shrink-0 text-[11px] text-jett-ink-400" }, "Switching\u2026")
|
|
943
|
+
);
|
|
944
|
+
}))),
|
|
945
|
+
/* @__PURE__ */ React12.createElement("div", { className: "border-t border-jett-line-row p-2", id: `${id}-footer` }, /* @__PURE__ */ React12.createElement(
|
|
946
|
+
"button",
|
|
947
|
+
{
|
|
948
|
+
type: "button",
|
|
949
|
+
onClick: () => {
|
|
950
|
+
onClose == null ? void 0 : onClose();
|
|
951
|
+
setShowLogoutConfirm(true);
|
|
952
|
+
},
|
|
953
|
+
className: "flex w-full cursor-pointer items-center gap-2.5 rounded-[6px] border-0 bg-transparent p-2 text-left text-[14px] font-semibold text-jett-danger hover:bg-jett-danger-soft",
|
|
954
|
+
id: `${id}-logout`
|
|
955
|
+
},
|
|
956
|
+
/* @__PURE__ */ React12.createElement(LogOut2, { width: 16, height: 16, strokeWidth: 1.8, "aria-hidden": "true" }),
|
|
957
|
+
"Log out"
|
|
958
|
+
))
|
|
959
|
+
)),
|
|
960
|
+
document.body
|
|
961
|
+
), /* @__PURE__ */ React12.createElement(
|
|
962
|
+
LogoutConfirmModal,
|
|
963
|
+
{
|
|
964
|
+
id: `${id}-logout-confirm`,
|
|
965
|
+
open: showLogoutConfirm,
|
|
966
|
+
onCancel: () => setShowLogoutConfirm(false),
|
|
967
|
+
onConfirm: handleConfirmLogout
|
|
968
|
+
}
|
|
969
|
+
));
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
// src/sideBar/CommandPalette.jsx
|
|
973
|
+
import React13, { useEffect as useEffect2, useMemo, useRef as useRef3, useState as useState3 } from "react";
|
|
974
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
975
|
+
var Kbd = ({ children, raised }) => /* @__PURE__ */ React13.createElement(
|
|
976
|
+
"span",
|
|
977
|
+
{
|
|
978
|
+
className: `inline-block min-w-[20px] rounded-[4px] border border-jett-line-soft bg-jett-surface px-[5px] text-center text-[11px] leading-[18px] font-medium text-jett-ink-500 ${raised ? "border-b-2 !text-[12px] text-jett-ink-700" : ""}`
|
|
979
|
+
},
|
|
980
|
+
children
|
|
981
|
+
);
|
|
982
|
+
var CommandPalette = ({ id = "command-palette", open, onClose, commands }) => {
|
|
983
|
+
const [q, setQ] = useState3("");
|
|
984
|
+
const [idx, setIdx] = useState3(0);
|
|
985
|
+
const inputRef = useRef3(null);
|
|
986
|
+
const listRef = useRef3(null);
|
|
987
|
+
useEffect2(() => {
|
|
988
|
+
if (!open) return;
|
|
989
|
+
setQ("");
|
|
990
|
+
setIdx(0);
|
|
991
|
+
const opener = document.activeElement;
|
|
992
|
+
const t = setTimeout(() => {
|
|
993
|
+
var _a;
|
|
994
|
+
return (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
995
|
+
}, 0);
|
|
996
|
+
return () => {
|
|
997
|
+
clearTimeout(t);
|
|
998
|
+
if (opener && opener.focus && document.contains(opener)) opener.focus({ preventScroll: true });
|
|
999
|
+
};
|
|
1000
|
+
}, [open]);
|
|
1001
|
+
const list = useMemo(() => {
|
|
1002
|
+
const s = q.trim().toLowerCase();
|
|
1003
|
+
return s ? commands.filter((c) => (c.label + " " + (c.sub || "")).toLowerCase().includes(s)) : commands;
|
|
1004
|
+
}, [q, commands]);
|
|
1005
|
+
const cur = Math.min(idx, Math.max(0, list.length - 1));
|
|
1006
|
+
useEffect2(() => {
|
|
1007
|
+
var _a, _b;
|
|
1008
|
+
(_b = (_a = listRef.current) == null ? void 0 : _a.querySelector(`[data-idx="${cur}"]`)) == null ? void 0 : _b.scrollIntoView({ block: "nearest" });
|
|
1009
|
+
}, [cur]);
|
|
1010
|
+
if (!open || typeof document === "undefined") return null;
|
|
1011
|
+
const run = (c) => {
|
|
1012
|
+
var _a;
|
|
1013
|
+
onClose();
|
|
1014
|
+
(_a = c == null ? void 0 : c.run) == null ? void 0 : _a.call(c);
|
|
1015
|
+
};
|
|
1016
|
+
const onKey = (e) => {
|
|
1017
|
+
if (e.key === "ArrowDown") {
|
|
1018
|
+
e.preventDefault();
|
|
1019
|
+
setIdx((cur + 1) % Math.max(1, list.length));
|
|
1020
|
+
} else if (e.key === "ArrowUp") {
|
|
1021
|
+
e.preventDefault();
|
|
1022
|
+
setIdx((cur - 1 + list.length) % Math.max(1, list.length));
|
|
1023
|
+
} else if (e.key === "Enter") {
|
|
1024
|
+
e.preventDefault();
|
|
1025
|
+
run(list[cur]);
|
|
1026
|
+
} else if (e.key === "Tab") {
|
|
1027
|
+
e.preventDefault();
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
return createPortal3(
|
|
1031
|
+
/* @__PURE__ */ React13.createElement("div", { className: "font-jett", id }, /* @__PURE__ */ React13.createElement("div", { className: "fixed inset-0 z-[95] bg-[rgba(17,24,39,0.4)]", onClick: onClose, "aria-hidden": "true" }), /* @__PURE__ */ React13.createElement(
|
|
1032
|
+
"div",
|
|
1033
|
+
{
|
|
1034
|
+
role: "dialog",
|
|
1035
|
+
"aria-modal": "true",
|
|
1036
|
+
"aria-label": "Command palette",
|
|
1037
|
+
className: "fixed left-1/2 top-[12vh] z-[96] flex w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 flex-col overflow-hidden rounded-[12px] border border-jett-line bg-jett-surface shadow-jett-pop"
|
|
1038
|
+
},
|
|
1039
|
+
/* @__PURE__ */ React13.createElement("div", { className: "flex h-[52px] items-center gap-2.5 border-b border-jett-line-row px-4" }, /* @__PURE__ */ React13.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement("circle", { cx: "11", cy: "11", r: "7" }), /* @__PURE__ */ React13.createElement("path", { d: "m20 20-3.5-3.5" })), /* @__PURE__ */ React13.createElement(
|
|
1040
|
+
"input",
|
|
1041
|
+
{
|
|
1042
|
+
ref: inputRef,
|
|
1043
|
+
type: "text",
|
|
1044
|
+
role: "combobox",
|
|
1045
|
+
"aria-expanded": "true",
|
|
1046
|
+
"aria-controls": `${id}-list`,
|
|
1047
|
+
"aria-activedescendant": list[cur] ? `${id}-opt-${cur}` : void 0,
|
|
1048
|
+
value: q,
|
|
1049
|
+
onChange: (e) => {
|
|
1050
|
+
setQ(e.target.value);
|
|
1051
|
+
setIdx(0);
|
|
1052
|
+
},
|
|
1053
|
+
onKeyDown: onKey,
|
|
1054
|
+
placeholder: "Search screens and actions",
|
|
1055
|
+
className: "h-full flex-1 border-0 bg-transparent p-0 text-[15px] text-jett-ink outline-none placeholder:text-jett-ink-400"
|
|
1056
|
+
}
|
|
1057
|
+
), /* @__PURE__ */ React13.createElement(Kbd, null, "Esc")),
|
|
1058
|
+
/* @__PURE__ */ React13.createElement("div", { ref: listRef, id: `${id}-list`, role: "listbox", className: "flex max-h-[360px] flex-col gap-0.5 overflow-y-auto p-1.5" }, list.map((c, i) => /* @__PURE__ */ React13.createElement(
|
|
1059
|
+
"button",
|
|
1060
|
+
{
|
|
1061
|
+
key: c.label + (c.sub || ""),
|
|
1062
|
+
id: `${id}-opt-${i}`,
|
|
1063
|
+
"data-idx": i,
|
|
1064
|
+
role: "option",
|
|
1065
|
+
"aria-selected": i === cur,
|
|
1066
|
+
type: "button",
|
|
1067
|
+
tabIndex: -1,
|
|
1068
|
+
onClick: () => run(c),
|
|
1069
|
+
onMouseEnter: () => setIdx(i),
|
|
1070
|
+
className: `flex cursor-pointer items-center gap-3 rounded-[6px] border-0 px-2.5 py-[9px] text-left ${i === cur ? "bg-jett-fill" : "bg-transparent"}`
|
|
1071
|
+
},
|
|
1072
|
+
/* @__PURE__ */ React13.createElement("span", { className: "min-w-0 flex-1 truncate text-[14px] font-medium text-jett-ink" }, c.label),
|
|
1073
|
+
/* @__PURE__ */ React13.createElement("span", { className: "text-[12px] text-jett-ink-500" }, c.sub),
|
|
1074
|
+
/* @__PURE__ */ React13.createElement("span", { className: "flex min-w-[44px] justify-end gap-[3px]" }, (c.keys || []).map((k) => /* @__PURE__ */ React13.createElement(Kbd, { key: k }, k)))
|
|
1075
|
+
)), !list.length && /* @__PURE__ */ React13.createElement("div", { className: "px-2.5 py-6 text-center text-[14px] text-jett-ink-500" }, "No matches")),
|
|
1076
|
+
/* @__PURE__ */ React13.createElement("div", { className: "flex gap-4 border-t border-jett-line-row px-4 py-2.5 text-[12px] text-jett-ink-500" }, /* @__PURE__ */ React13.createElement("span", null, "\u2191 \u2193 to move"), /* @__PURE__ */ React13.createElement("span", null, "\u21B5 to open"), /* @__PURE__ */ React13.createElement("span", null, "? for all shortcuts"))
|
|
1077
|
+
)),
|
|
1078
|
+
document.body
|
|
1079
|
+
);
|
|
1080
|
+
};
|
|
1081
|
+
var ShortcutsSheet = ({ id = "shortcuts-sheet", open, onClose, sections }) => {
|
|
1082
|
+
const closeRef = useRef3(null);
|
|
1083
|
+
useEffect2(() => {
|
|
1084
|
+
if (!open) return;
|
|
1085
|
+
const opener = document.activeElement;
|
|
1086
|
+
const t = setTimeout(() => {
|
|
1087
|
+
var _a;
|
|
1088
|
+
return (_a = closeRef.current) == null ? void 0 : _a.focus();
|
|
1089
|
+
}, 0);
|
|
1090
|
+
return () => {
|
|
1091
|
+
clearTimeout(t);
|
|
1092
|
+
if (opener && opener.focus && document.contains(opener)) opener.focus({ preventScroll: true });
|
|
1093
|
+
};
|
|
1094
|
+
}, [open]);
|
|
1095
|
+
if (!open || typeof document === "undefined") return null;
|
|
1096
|
+
return createPortal3(
|
|
1097
|
+
/* @__PURE__ */ React13.createElement("div", { className: "font-jett", id }, /* @__PURE__ */ React13.createElement("div", { className: "fixed inset-0 z-[95] bg-[rgba(17,24,39,0.4)]", onClick: onClose, "aria-hidden": "true" }), /* @__PURE__ */ React13.createElement(
|
|
1098
|
+
"div",
|
|
1099
|
+
{
|
|
1100
|
+
role: "dialog",
|
|
1101
|
+
"aria-modal": "true",
|
|
1102
|
+
"aria-label": "Keyboard shortcuts",
|
|
1103
|
+
className: "fixed left-1/2 top-1/2 z-[96] max-h-[calc(100vh-64px)] w-[calc(100%-32px)] max-w-[640px] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-[12px] border border-jett-line bg-jett-surface shadow-jett-pop"
|
|
1104
|
+
},
|
|
1105
|
+
/* @__PURE__ */ React13.createElement("div", { className: "flex items-center justify-between border-b border-jett-line-row px-5 py-4" }, /* @__PURE__ */ React13.createElement("h2", { className: "!m-0 !text-[16px] !font-semibold text-jett-ink" }, "Keyboard shortcuts"), /* @__PURE__ */ React13.createElement(
|
|
1106
|
+
"button",
|
|
1107
|
+
{
|
|
1108
|
+
ref: closeRef,
|
|
1109
|
+
type: "button",
|
|
1110
|
+
onClick: onClose,
|
|
1111
|
+
title: "Close",
|
|
1112
|
+
"aria-label": "Close",
|
|
1113
|
+
className: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-[6px] border-0 bg-transparent text-jett-ink-500 hover:bg-jett-fill"
|
|
1114
|
+
},
|
|
1115
|
+
/* @__PURE__ */ React13.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React13.createElement("path", { d: "M18 6 6 18M6 6l12 12" }))
|
|
1116
|
+
)),
|
|
1117
|
+
/* @__PURE__ */ React13.createElement("div", { className: "grid grid-cols-[repeat(auto-fit,minmax(260px,1fr))] gap-x-8 gap-y-2 px-5 pb-5 pt-2" }, sections.map((sec) => /* @__PURE__ */ React13.createElement("div", { key: sec.title, className: "flex flex-col" }, /* @__PURE__ */ React13.createElement("div", { className: "pb-1.5 pt-3 text-[11px] font-semibold uppercase tracking-[0.06em] text-jett-ink-400" }, sec.title), sec.rows.map((r) => /* @__PURE__ */ React13.createElement("div", { key: r.label, className: "flex items-center justify-between gap-3 border-b border-jett-line-row py-[7px]" }, /* @__PURE__ */ React13.createElement("span", { className: "text-[14px] text-jett-ink-700" }, r.label), /* @__PURE__ */ React13.createElement("span", { className: "flex items-center gap-1" }, r.keys.map((k) => /* @__PURE__ */ React13.createElement(Kbd, { key: k, raised: true }, k))))))))
|
|
1118
|
+
)),
|
|
1119
|
+
document.body
|
|
1120
|
+
);
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
// src/sideBar/navMatch.js
|
|
1124
|
+
var extractUrlFromOnClick = (onClick) => {
|
|
1125
|
+
if (!onClick || typeof onClick !== "function") return null;
|
|
1126
|
+
const funcString = onClick.toString();
|
|
1127
|
+
let match = funcString.match(/window\.location\.href\s*=\s*`([^`]+)`/);
|
|
1128
|
+
if (!match) {
|
|
1129
|
+
match = funcString.match(/window\.location\.href\s*=\s*["']([^"']+)["']/);
|
|
1130
|
+
}
|
|
1131
|
+
if (match && match[1]) {
|
|
1132
|
+
try {
|
|
1133
|
+
if (match[1].startsWith("http://") || match[1].startsWith("https://")) {
|
|
1134
|
+
const url = new URL(match[1]);
|
|
1135
|
+
return {
|
|
1136
|
+
pathname: url.pathname,
|
|
1137
|
+
search: url.search,
|
|
1138
|
+
fullPath: url.pathname + url.search
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
if (match[1].startsWith("/")) {
|
|
1142
|
+
const url = new URL(match[1], window.location.origin);
|
|
1143
|
+
return {
|
|
1144
|
+
pathname: url.pathname,
|
|
1145
|
+
search: url.search,
|
|
1146
|
+
fullPath: url.pathname + url.search
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
return null;
|
|
1150
|
+
} catch {
|
|
1151
|
+
const pathMatch = match[1].match(/^([^?]+)(\?.*)?$/);
|
|
1152
|
+
if (pathMatch) {
|
|
1153
|
+
return {
|
|
1154
|
+
pathname: pathMatch[1],
|
|
1155
|
+
search: pathMatch[2] || "",
|
|
1156
|
+
fullPath: match[1]
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
return null;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
return null;
|
|
1163
|
+
};
|
|
1164
|
+
var currentUrlMatches = (menuUrlData, currentPath, currentSearch) => {
|
|
1165
|
+
if (!menuUrlData || !currentPath) return false;
|
|
1166
|
+
const normalizedMenuPath = menuUrlData.pathname.replace(/\/$/, "") || "/";
|
|
1167
|
+
const normalizedCurrentPath = currentPath.replace(/\/$/, "") || "/";
|
|
1168
|
+
if (normalizedMenuPath === "/users/users" && normalizedCurrentPath === "/users/users") {
|
|
1169
|
+
const menuParams = new URLSearchParams(menuUrlData.search);
|
|
1170
|
+
const currentParams = new URLSearchParams(currentSearch);
|
|
1171
|
+
const menuRole = menuParams.get("role");
|
|
1172
|
+
const currentRole = currentParams.get("role");
|
|
1173
|
+
if (menuRole && currentRole) {
|
|
1174
|
+
return menuRole === currentRole;
|
|
1175
|
+
}
|
|
1176
|
+
if (menuRole && !currentRole || !menuRole && currentRole) {
|
|
1177
|
+
return false;
|
|
1178
|
+
}
|
|
1179
|
+
return true;
|
|
1180
|
+
}
|
|
1181
|
+
if (normalizedMenuPath === "/corporate" && normalizedCurrentPath.startsWith("/org/organizations")) {
|
|
1182
|
+
return true;
|
|
1183
|
+
}
|
|
1184
|
+
if (normalizedMenuPath === "/supplier" && normalizedCurrentPath === "/orgselector") {
|
|
1185
|
+
const currentPathParam = new URLSearchParams(currentSearch).get("path");
|
|
1186
|
+
if (currentPathParam === "supplier-list") {
|
|
1187
|
+
return true;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
if (normalizedMenuPath === "/supplierdeals" && normalizedCurrentPath === "/orgselector") {
|
|
1191
|
+
const currentPathParam = new URLSearchParams(currentSearch).get("path");
|
|
1192
|
+
if (currentPathParam === "supplier-deals") {
|
|
1193
|
+
return true;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
if (normalizedMenuPath === "/corporate/trips") {
|
|
1197
|
+
if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
|
|
1198
|
+
return true;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (normalizedMenuPath === "/orgselector" && menuUrlData.search) {
|
|
1202
|
+
const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
|
|
1203
|
+
if (menuPathParam) {
|
|
1204
|
+
const pathRouteMap = {
|
|
1205
|
+
"offer": "/offer/offer",
|
|
1206
|
+
"voucher": "/voucher/voucher",
|
|
1207
|
+
"tag": "/tags/tags",
|
|
1208
|
+
"special-requests": "/corporate/special-requests",
|
|
1209
|
+
"pricing-policy": "/policies/pricing-policy",
|
|
1210
|
+
"supplier-list": "/supplier",
|
|
1211
|
+
"users": "/users/users"
|
|
1212
|
+
// Consumer Ecosystem Users (no role param)
|
|
1213
|
+
};
|
|
1214
|
+
const expectedRoute = pathRouteMap[menuPathParam];
|
|
1215
|
+
if (expectedRoute) {
|
|
1216
|
+
if (normalizedCurrentPath === expectedRoute || normalizedCurrentPath.startsWith(expectedRoute + "/")) {
|
|
1217
|
+
if (menuPathParam === "users") {
|
|
1218
|
+
const currentParams = new URLSearchParams(currentSearch);
|
|
1219
|
+
const currentRole = currentParams.get("role");
|
|
1220
|
+
return currentRole !== "admin";
|
|
1221
|
+
}
|
|
1222
|
+
return true;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
if (normalizedCurrentPath === "/orgselector") {
|
|
1227
|
+
const menuPathParam2 = new URLSearchParams(menuUrlData.search).get("path");
|
|
1228
|
+
const currentPathParam = new URLSearchParams(currentSearch).get("path");
|
|
1229
|
+
if (menuPathParam2 && currentPathParam) {
|
|
1230
|
+
return menuPathParam2 === currentPathParam;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
if (normalizedMenuPath === normalizedCurrentPath) {
|
|
1235
|
+
if (menuUrlData.search) {
|
|
1236
|
+
const menuParams = new URLSearchParams(menuUrlData.search);
|
|
1237
|
+
const currentParams = new URLSearchParams(currentSearch);
|
|
1238
|
+
for (const [key, value] of menuParams.entries()) {
|
|
1239
|
+
if (key === "auth") {
|
|
1240
|
+
continue;
|
|
1241
|
+
}
|
|
1242
|
+
if (currentParams.get(key) !== value) {
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
return true;
|
|
1247
|
+
}
|
|
1248
|
+
return true;
|
|
1249
|
+
}
|
|
1250
|
+
if (normalizedCurrentPath.startsWith(normalizedMenuPath + "/")) {
|
|
1251
|
+
return true;
|
|
1252
|
+
}
|
|
1253
|
+
return false;
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
// src/sideBar/SideBar.jsx
|
|
1257
|
+
var SCOPE_LABELS = {
|
|
1258
|
+
TMC: "TMC Manager",
|
|
1259
|
+
TMC_ENTITY: "TMC Entity Manager"
|
|
1260
|
+
};
|
|
1261
|
+
var LS_COLLAPSED = "jett.sidebar.collapsed";
|
|
1262
|
+
var PHONE_MAX = 768;
|
|
1263
|
+
var AUTO_EXPAND = 1280;
|
|
1264
|
+
var GOTO = [
|
|
1265
|
+
["h", "Home"],
|
|
1266
|
+
["c", "Corporate"],
|
|
1267
|
+
["t", "Trips"],
|
|
1268
|
+
["r", "Special Request"],
|
|
1269
|
+
["b", "Booking & Invoices"],
|
|
1270
|
+
["e", "Pricing Engine"],
|
|
1271
|
+
["l", "Credit Management"],
|
|
1272
|
+
["s", "Suppliers List"],
|
|
1273
|
+
["d", "Supplier Deals"],
|
|
1274
|
+
["w", "Whitelabel"],
|
|
1275
|
+
["m", "Markets"],
|
|
1276
|
+
["p", "Users", "Settings"],
|
|
1277
|
+
["i", "AuthMesh"],
|
|
1278
|
+
["a", "Audit"]
|
|
1279
|
+
];
|
|
1280
|
+
var norm = (s) => String(s || "").trim().toLowerCase();
|
|
1281
|
+
var SOON_RX = /\s*\((coming )?soon\)\s*$/i;
|
|
1282
|
+
var cleanLabel = (s) => String(s || "").replace(SOON_RX, "");
|
|
1283
|
+
var isSoon = (o) => !!o.isDisabled || SOON_RX.test(o.label || "");
|
|
1284
|
+
var MAC = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent || "");
|
|
1285
|
+
var MOD = MAC ? "\u2318" : "Ctrl";
|
|
1286
|
+
var readPref = () => {
|
|
1287
|
+
try {
|
|
1288
|
+
const v = localStorage.getItem(LS_COLLAPSED);
|
|
1289
|
+
return v === null ? null : v === "1";
|
|
1290
|
+
} catch {
|
|
1291
|
+
return null;
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
var initials = (name) => String(name || "A").split(/\s+/).filter(Boolean).slice(0, 2).map((p) => p[0]).join("").toUpperCase() || "A";
|
|
1295
|
+
var Chevron = ({ open }) => /* @__PURE__ */ React14.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 transition-transform duration-150", style: { transform: open ? "rotate(90deg)" : "none" }, "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("path", { d: "m9 18 6-6-6-6" }));
|
|
1296
|
+
var LogoTile = ({ size = 28 }) => /* @__PURE__ */ React14.createElement(
|
|
1297
|
+
"div",
|
|
1298
|
+
{
|
|
1299
|
+
className: "flex shrink-0 items-center justify-center rounded-[6px] bg-jett-brand font-bold text-white",
|
|
1300
|
+
style: { width: size, height: size, fontSize: size >= 28 ? 13 : 12 },
|
|
1301
|
+
"aria-hidden": "true"
|
|
1302
|
+
},
|
|
1303
|
+
"J"
|
|
1304
|
+
);
|
|
1305
|
+
var AppSideBar = ({
|
|
1306
|
+
id = "side-bar",
|
|
1307
|
+
username,
|
|
1308
|
+
navItems,
|
|
1309
|
+
additionalItems,
|
|
1310
|
+
sideBarLogo,
|
|
1311
|
+
onManageProfile,
|
|
1312
|
+
onProfileSwitch,
|
|
1313
|
+
onTmcSettings,
|
|
1314
|
+
onLogout
|
|
1315
|
+
}) => {
|
|
1316
|
+
var _a, _b;
|
|
1317
|
+
const profileCardRef = useRef4(null);
|
|
1318
|
+
const [authData, setAuthData] = useState4(null);
|
|
1319
|
+
const [cookieUserName, setCookieUserName] = useState4(null);
|
|
1320
|
+
const [scope, setScope] = useState4(null);
|
|
1321
|
+
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState4(false);
|
|
1322
|
+
const [isSwitchProfileOpen, setIsSwitchProfileOpen] = useState4(false);
|
|
1323
|
+
const [openMenus, setOpenMenus] = useState4(/* @__PURE__ */ new Set());
|
|
1324
|
+
const [activeMenuPath, setActiveMenuPath] = useState4(null);
|
|
1325
|
+
const [width, setWidth] = useState4(() => typeof window === "undefined" ? 1440 : window.innerWidth);
|
|
1326
|
+
const [pref, setPref] = useState4(readPref);
|
|
1327
|
+
const [fly, setFly] = useState4(null);
|
|
1328
|
+
const [palOpen, setPalOpen] = useState4(false);
|
|
1329
|
+
const [helpOpen, setHelpOpen] = useState4(false);
|
|
1330
|
+
const [ready, setReady] = useState4(false);
|
|
1331
|
+
const gPending = useRef4(false);
|
|
1332
|
+
const gTimer = useRef4(null);
|
|
1333
|
+
const phone = width < PHONE_MAX;
|
|
1334
|
+
const collapsed = !phone && (pref === null ? width < AUTO_EXPAND : pref);
|
|
1335
|
+
const toggleMenu = (menuKey) => {
|
|
1336
|
+
setOpenMenus((prev) => {
|
|
1337
|
+
const next = new Set(prev);
|
|
1338
|
+
if (next.has(menuKey)) next.delete(menuKey);
|
|
1339
|
+
else next.add(menuKey);
|
|
1340
|
+
return next;
|
|
1341
|
+
});
|
|
1342
|
+
};
|
|
1343
|
+
const isMenuOpen = (menuKey) => openMenus.has(menuKey);
|
|
1344
|
+
const closeMobileMenu = () => setIsMobileMenuOpen(false);
|
|
1345
|
+
const handleMenuClick = (item, index, e) => {
|
|
1346
|
+
if (item.isDropDown || item.options && item.options.length) {
|
|
1347
|
+
e.preventDefault();
|
|
1348
|
+
toggleMenu(`menu-${index}`);
|
|
1349
|
+
} else {
|
|
1350
|
+
setActiveMenuPath(`menu-${index}`);
|
|
1351
|
+
if (item.onClick) item.onClick(e);
|
|
1352
|
+
closeMobileMenu();
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
const handleSubMenuClick = (option, optionsIndex, parentIndex2, e) => {
|
|
1356
|
+
const parentMenuKey = `menu-${parentIndex2}`;
|
|
1357
|
+
setOpenMenus((prev) => new Set(prev).add(parentMenuKey));
|
|
1358
|
+
if (option.isDropDown) {
|
|
1359
|
+
e.preventDefault();
|
|
1360
|
+
toggleMenu(`menu-${parentIndex2}-option-${optionsIndex}`);
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
setActiveMenuPath(`menu-${parentIndex2}-option-${optionsIndex}`);
|
|
1364
|
+
setFly(null);
|
|
1365
|
+
if (option.onClick) option.onClick();
|
|
1366
|
+
closeMobileMenu();
|
|
1367
|
+
};
|
|
1368
|
+
const handleSubSubMenuClick = (subOption, parentIndex2, optionsIndex) => {
|
|
1369
|
+
setOpenMenus((prev) => {
|
|
1370
|
+
const next = new Set(prev);
|
|
1371
|
+
next.add(`menu-${parentIndex2}`);
|
|
1372
|
+
next.add(`menu-${parentIndex2}-option-${optionsIndex}`);
|
|
1373
|
+
return next;
|
|
1374
|
+
});
|
|
1375
|
+
setActiveMenuPath(`menu-${parentIndex2}-option-${optionsIndex}-sub-${subOption.label}`);
|
|
1376
|
+
setFly(null);
|
|
1377
|
+
if (subOption.onClick) subOption.onClick();
|
|
1378
|
+
closeMobileMenu();
|
|
1379
|
+
};
|
|
1380
|
+
useEffect3(() => {
|
|
1381
|
+
const storedAuthData = localStorage.getItem("authData");
|
|
1382
|
+
if (storedAuthData) {
|
|
1383
|
+
try {
|
|
1384
|
+
setAuthData(JSON.parse(storedAuthData));
|
|
1385
|
+
} catch {
|
|
1386
|
+
setAuthData(null);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}, []);
|
|
1390
|
+
useEffect3(() => {
|
|
1391
|
+
const jettIdData = getJettIdCookieData();
|
|
1392
|
+
if (jettIdData == null ? void 0 : jettIdData.UserName) setCookieUserName(jettIdData.UserName);
|
|
1393
|
+
const cookieScope = getScopeFromJettIdCookie();
|
|
1394
|
+
if (cookieScope) setScope(cookieScope);
|
|
1395
|
+
}, []);
|
|
1396
|
+
useEffect3(() => {
|
|
1397
|
+
if (hasSwitchedProfileThisSession()) return;
|
|
1398
|
+
const jettIdData = getJettIdCookieData();
|
|
1399
|
+
const allProfiles = getProfilesFromJettIdCookie(true);
|
|
1400
|
+
if (allProfiles.length <= 1) return;
|
|
1401
|
+
const tmcProfile = allProfiles.find((profile) => profile.Scope === "TMC");
|
|
1402
|
+
if (!tmcProfile || tmcProfile.ProfileId === (jettIdData == null ? void 0 : jettIdData.ProfileId)) return;
|
|
1403
|
+
switchProfile(tmcProfile).then((response) => {
|
|
1404
|
+
var _a2;
|
|
1405
|
+
if ((_a2 = response == null ? void 0 : response.Response) == null ? void 0 : _a2.RedirectUrl) {
|
|
1406
|
+
window.location.href = response.Response.RedirectUrl;
|
|
1407
|
+
}
|
|
1408
|
+
}).catch((error) => {
|
|
1409
|
+
console.error("Auto TMC profile switch failed:", error);
|
|
1410
|
+
});
|
|
1411
|
+
}, []);
|
|
1412
|
+
const navItemsLocal = navItems ?? navItemsConstant;
|
|
1413
|
+
void (additionalItems ?? additionalItemsConstant);
|
|
1414
|
+
const logoFromCookie = getLogoFromJettIdCookie();
|
|
1415
|
+
const logoUrlFromCookie = logoFromCookie ? buildLogoUrl(logoFromCookie.CDNBasePath, logoFromCookie.logoPath) : null;
|
|
1416
|
+
const logoUrlFromUserInfo = ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.CDNBasePath) && ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.OrgLogo) ? buildLogoUrl(authData.userInfo.CDNBasePath, authData.userInfo.OrgLogo) : null;
|
|
1417
|
+
const sideBarLogoLocal = sideBarLogo ?? logoUrlFromCookie ?? logoUrlFromUserInfo ?? null;
|
|
1418
|
+
const detectAndSetActiveMenu = useCallback(() => {
|
|
1419
|
+
const currentPath = window.location.pathname;
|
|
1420
|
+
const currentSearch = window.location.search;
|
|
1421
|
+
const newOpenMenus = /* @__PURE__ */ new Set();
|
|
1422
|
+
let foundActivePath = null;
|
|
1423
|
+
navItemsLocal.forEach((item, index) => {
|
|
1424
|
+
if (!item.isDropDown && item.onClick && typeof item.onClick === "function") {
|
|
1425
|
+
const itemUrlData = extractUrlFromOnClick(item.onClick);
|
|
1426
|
+
if (itemUrlData && currentUrlMatches(itemUrlData, currentPath, currentSearch)) {
|
|
1427
|
+
foundActivePath = `menu-${index}`;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
if (item.options && item.options.length > 0) {
|
|
1431
|
+
item.options.forEach((option, optionsIndex) => {
|
|
1432
|
+
if (option.onClick && typeof option.onClick === "function") {
|
|
1433
|
+
const optionUrlData = extractUrlFromOnClick(option.onClick);
|
|
1434
|
+
if (optionUrlData && currentUrlMatches(optionUrlData, currentPath, currentSearch)) {
|
|
1435
|
+
newOpenMenus.add(`menu-${index}`);
|
|
1436
|
+
foundActivePath = `menu-${index}-option-${optionsIndex}`;
|
|
1437
|
+
if (option.options && option.options.length > 0) {
|
|
1438
|
+
option.options.forEach((subOption) => {
|
|
1439
|
+
const subOptionUrlData = extractUrlFromOnClick(subOption.onClick);
|
|
1440
|
+
if (subOptionUrlData && currentUrlMatches(subOptionUrlData, currentPath, currentSearch)) {
|
|
1441
|
+
newOpenMenus.add(`menu-${index}-option-${optionsIndex}`);
|
|
1442
|
+
foundActivePath = `menu-${index}-option-${optionsIndex}-sub-${subOption.label}`;
|
|
1443
|
+
}
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
if (foundActivePath) {
|
|
1452
|
+
setOpenMenus(newOpenMenus);
|
|
1453
|
+
setActiveMenuPath(foundActivePath);
|
|
1454
|
+
}
|
|
1455
|
+
}, [navItemsLocal]);
|
|
1456
|
+
useEffect3(() => {
|
|
1457
|
+
detectAndSetActiveMenu();
|
|
1458
|
+
let lastUrl = window.location.pathname + window.location.search;
|
|
1459
|
+
const check = () => {
|
|
1460
|
+
const newUrl = window.location.pathname + window.location.search;
|
|
1461
|
+
if (newUrl !== lastUrl) {
|
|
1462
|
+
lastUrl = newUrl;
|
|
1463
|
+
detectAndSetActiveMenu();
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
window.addEventListener("popstate", check);
|
|
1467
|
+
const interval = setInterval(check, 250);
|
|
1468
|
+
return () => {
|
|
1469
|
+
window.removeEventListener("popstate", check);
|
|
1470
|
+
clearInterval(interval);
|
|
1471
|
+
};
|
|
1472
|
+
}, [detectAndSetActiveMenu]);
|
|
1473
|
+
useEffect3(() => {
|
|
1474
|
+
const onResize = () => {
|
|
1475
|
+
setWidth(window.innerWidth);
|
|
1476
|
+
setFly(null);
|
|
1477
|
+
};
|
|
1478
|
+
window.addEventListener("resize", onResize);
|
|
1479
|
+
const r = requestAnimationFrame(() => requestAnimationFrame(() => setReady(true)));
|
|
1480
|
+
return () => {
|
|
1481
|
+
window.removeEventListener("resize", onResize);
|
|
1482
|
+
cancelAnimationFrame(r);
|
|
1483
|
+
};
|
|
1484
|
+
}, []);
|
|
1485
|
+
useEffect3(() => {
|
|
1486
|
+
if (!phone) setIsMobileMenuOpen(false);
|
|
1487
|
+
}, [phone]);
|
|
1488
|
+
const toggleCollapsed = useCallback(() => {
|
|
1489
|
+
if (phone) return;
|
|
1490
|
+
const next = !collapsed;
|
|
1491
|
+
try {
|
|
1492
|
+
localStorage.setItem(LS_COLLAPSED, next ? "1" : "0");
|
|
1493
|
+
} catch {
|
|
1494
|
+
}
|
|
1495
|
+
setPref(next);
|
|
1496
|
+
setFly(null);
|
|
1497
|
+
setIsSwitchProfileOpen(false);
|
|
1498
|
+
}, [phone, collapsed]);
|
|
1499
|
+
const screens = useMemo2(() => {
|
|
1500
|
+
const out = [];
|
|
1501
|
+
navItemsLocal.forEach((item) => {
|
|
1502
|
+
if (item.options && item.options.length) {
|
|
1503
|
+
item.options.forEach((o) => {
|
|
1504
|
+
if (!isSoon(o) && o.onClick) out.push({ label: cleanLabel(o.label), group: item.label, run: () => o.onClick() });
|
|
1505
|
+
});
|
|
1506
|
+
} else if (item.onClick) {
|
|
1507
|
+
out.push({ label: cleanLabel(item.label), group: "", run: () => item.onClick() });
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
return out;
|
|
1511
|
+
}, [navItemsLocal]);
|
|
1512
|
+
const gotoMap = useMemo2(() => {
|
|
1513
|
+
const m = {};
|
|
1514
|
+
GOTO.forEach(([key, label, group]) => {
|
|
1515
|
+
const s = screens.find((x) => norm(x.label) === norm(label) && (!group || norm(x.group) === norm(group)));
|
|
1516
|
+
if (s) m[key] = s;
|
|
1517
|
+
});
|
|
1518
|
+
return m;
|
|
1519
|
+
}, [screens]);
|
|
1520
|
+
const commands = useMemo2(() => {
|
|
1521
|
+
const keyOf = new Map(Object.entries(gotoMap).map(([k, s]) => [s, k.toUpperCase()]));
|
|
1522
|
+
const cmds = screens.map((s) => ({ label: s.label, sub: s.group, keys: keyOf.has(s) ? ["G", keyOf.get(s)] : [], run: s.run }));
|
|
1523
|
+
if (!phone) cmds.push({ label: collapsed ? "Expand sidebar" : "Collapse sidebar", sub: "Action", keys: ["["], run: toggleCollapsed });
|
|
1524
|
+
cmds.push({ label: "Keyboard shortcuts", sub: "Help", keys: ["?"], run: () => setHelpOpen(true) });
|
|
1525
|
+
return cmds;
|
|
1526
|
+
}, [screens, gotoMap, phone, collapsed, toggleCollapsed]);
|
|
1527
|
+
const helpSections = useMemo2(
|
|
1528
|
+
() => [
|
|
1529
|
+
{
|
|
1530
|
+
title: "Global",
|
|
1531
|
+
rows: [
|
|
1532
|
+
{ label: "Focus search on this page", keys: [MOD, "K"] },
|
|
1533
|
+
{ label: "Focus search (alternative)", keys: ["/"] },
|
|
1534
|
+
{ label: "Jump to any screen or action", keys: [MOD, "\u21E7", "K"] },
|
|
1535
|
+
{ label: "Collapse or expand sidebar", keys: ["["] },
|
|
1536
|
+
{ label: "Close menu, drawer or dialog", keys: ["Esc"] },
|
|
1537
|
+
{ label: "Show this list", keys: ["?"] }
|
|
1538
|
+
]
|
|
1539
|
+
},
|
|
1540
|
+
{ title: "Go to", rows: GOTO.filter(([k]) => gotoMap[k]).map(([k]) => ({ label: gotoMap[k].label, keys: ["G", k.toUpperCase()] })) },
|
|
1541
|
+
{
|
|
1542
|
+
title: "In the palette",
|
|
1543
|
+
rows: [
|
|
1544
|
+
{ label: "Move selection", keys: ["\u2191", "\u2193"] },
|
|
1545
|
+
{ label: "Open selected", keys: ["\u21B5"] }
|
|
1546
|
+
]
|
|
1547
|
+
}
|
|
1548
|
+
],
|
|
1549
|
+
[gotoMap]
|
|
1550
|
+
);
|
|
1551
|
+
const stateRef = useRef4({});
|
|
1552
|
+
stateRef.current = { palOpen, helpOpen, fly, isSwitchProfileOpen, isMobileMenuOpen, phone, gotoMap, toggleCollapsed };
|
|
1553
|
+
useEffect3(() => {
|
|
1554
|
+
const findSearch = () => Array.from(document.querySelectorAll('main input[type="search"], main input[placeholder^="Search"], input[type="search"], input[placeholder^="Search"]')).find(
|
|
1555
|
+
(el) => el.offsetParent !== null && !el.closest("[data-jett-shell]")
|
|
1556
|
+
);
|
|
1557
|
+
const onKey = (e) => {
|
|
1558
|
+
const s = stateRef.current;
|
|
1559
|
+
const t = e.target;
|
|
1560
|
+
const typing = t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName));
|
|
1561
|
+
const mod = e.metaKey || e.ctrlKey;
|
|
1562
|
+
const key = (e.key || "").toLowerCase();
|
|
1563
|
+
if (mod && key === "k") {
|
|
1564
|
+
e.preventDefault();
|
|
1565
|
+
const el = !e.shiftKey && !s.palOpen ? findSearch() : null;
|
|
1566
|
+
if (el && document.activeElement !== el) {
|
|
1567
|
+
setHelpOpen(false);
|
|
1568
|
+
el.focus();
|
|
1569
|
+
if (el.select) el.select();
|
|
1570
|
+
return;
|
|
1571
|
+
}
|
|
1572
|
+
setHelpOpen(false);
|
|
1573
|
+
setFly(null);
|
|
1574
|
+
setIsSwitchProfileOpen(false);
|
|
1575
|
+
setPalOpen((o) => !o);
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
if (e.key === "Escape") {
|
|
1579
|
+
const close = () => {
|
|
1580
|
+
e.preventDefault();
|
|
1581
|
+
e.stopImmediatePropagation();
|
|
1582
|
+
};
|
|
1583
|
+
if (s.palOpen) return close(), setPalOpen(false);
|
|
1584
|
+
if (s.helpOpen) return close(), setHelpOpen(false);
|
|
1585
|
+
if (s.fly) return close(), setFly(null);
|
|
1586
|
+
if (s.isSwitchProfileOpen) return close(), setIsSwitchProfileOpen(false);
|
|
1587
|
+
if (s.isMobileMenuOpen) return close(), setIsMobileMenuOpen(false);
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
if (typing || mod || e.altKey || s.palOpen) return;
|
|
1591
|
+
if (gPending.current) {
|
|
1592
|
+
gPending.current = false;
|
|
1593
|
+
clearTimeout(gTimer.current);
|
|
1594
|
+
const target = s.gotoMap[key];
|
|
1595
|
+
if (target) {
|
|
1596
|
+
e.preventDefault();
|
|
1597
|
+
target.run();
|
|
1598
|
+
}
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
if (key === "g" && !e.shiftKey) {
|
|
1602
|
+
gPending.current = true;
|
|
1603
|
+
gTimer.current = setTimeout(() => gPending.current = false, 1200);
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
if (e.key === "/") {
|
|
1607
|
+
const el = findSearch();
|
|
1608
|
+
if (el) {
|
|
1609
|
+
e.preventDefault();
|
|
1610
|
+
el.focus();
|
|
1611
|
+
if (el.select) el.select();
|
|
1612
|
+
}
|
|
1613
|
+
return;
|
|
1614
|
+
}
|
|
1615
|
+
if (e.key === "?") {
|
|
1616
|
+
e.preventDefault();
|
|
1617
|
+
setHelpOpen((o) => !o);
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
if (e.key === "[" && !s.phone) {
|
|
1621
|
+
e.preventDefault();
|
|
1622
|
+
s.toggleCollapsed();
|
|
1623
|
+
}
|
|
1624
|
+
};
|
|
1625
|
+
window.addEventListener("keydown", onKey, true);
|
|
1626
|
+
return () => {
|
|
1627
|
+
window.removeEventListener("keydown", onKey, true);
|
|
1628
|
+
clearTimeout(gTimer.current);
|
|
1629
|
+
};
|
|
1630
|
+
}, []);
|
|
1631
|
+
const parentIndex = activeMenuPath ? Number((/^menu-(\d+)/.exec(activeMenuPath) || [])[1]) : -1;
|
|
1632
|
+
const activeLabel = (() => {
|
|
1633
|
+
var _a2, _b2;
|
|
1634
|
+
if (!activeMenuPath) return "JETT Admin";
|
|
1635
|
+
const m = /^menu-(\d+)(?:-option-(\d+))?/.exec(activeMenuPath);
|
|
1636
|
+
const item = navItemsLocal[Number(m == null ? void 0 : m[1])];
|
|
1637
|
+
if (!item) return "JETT Admin";
|
|
1638
|
+
return cleanLabel(m[2] !== void 0 ? (_b2 = (_a2 = item.options) == null ? void 0 : _a2[Number(m[2])]) == null ? void 0 : _b2.label : item.label) || "JETT Admin";
|
|
1639
|
+
})();
|
|
1640
|
+
const displayName = username || cookieUserName || "Admin";
|
|
1641
|
+
const scopeLabel = SCOPE_LABELS[scope] ?? scope ?? "";
|
|
1642
|
+
const expanded = !collapsed;
|
|
1643
|
+
const openFly = (index, e) => {
|
|
1644
|
+
var _a2, _b2;
|
|
1645
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
1646
|
+
const n = ((_b2 = (_a2 = navItemsLocal[index]) == null ? void 0 : _a2.options) == null ? void 0 : _b2.length) || 1;
|
|
1647
|
+
const top = Math.max(8, Math.min(r.top - 6, window.innerHeight - (n * 36 + 60)));
|
|
1648
|
+
setIsSwitchProfileOpen(false);
|
|
1649
|
+
setFly((f) => f && f.index === index ? null : { index, top });
|
|
1650
|
+
};
|
|
1651
|
+
const subItemClass = (active, soon) => `flex items-center justify-between gap-2 rounded-[6px] border-0 px-3 text-left !text-[14px] whitespace-nowrap w-full ${phone ? "py-[11px]" : "py-[6px]"} ${soon ? "cursor-default bg-transparent text-jett-ink-400" : active ? "cursor-pointer bg-jett-fill !font-semibold text-jett-ink" : "cursor-pointer bg-transparent !font-medium text-jett-ink-500 hover:bg-jett-fill hover:text-jett-ink"}`;
|
|
1652
|
+
const renderOptions = (item, index, inFlyout) => item.options.map((option, optionsIndex) => {
|
|
1653
|
+
const subKey = `menu-${index}-option-${optionsIndex}`;
|
|
1654
|
+
const active = activeMenuPath === subKey || (activeMenuPath == null ? void 0 : activeMenuPath.startsWith(`${subKey}-`));
|
|
1655
|
+
const soon = isSoon(option);
|
|
1656
|
+
const hasKids = option.options && option.options.length > 0;
|
|
1657
|
+
return /* @__PURE__ */ React14.createElement("div", { key: optionsIndex, id: `${id}-opt-${index}-${optionsIndex}` }, /* @__PURE__ */ React14.createElement(
|
|
1658
|
+
"button",
|
|
1659
|
+
{
|
|
1660
|
+
type: "button",
|
|
1661
|
+
disabled: soon,
|
|
1662
|
+
"aria-disabled": soon || void 0,
|
|
1663
|
+
"aria-current": active && !hasKids ? "page" : void 0,
|
|
1664
|
+
"aria-expanded": hasKids ? isMenuOpen(subKey) : void 0,
|
|
1665
|
+
title: soon ? "Not available yet" : void 0,
|
|
1666
|
+
onClick: (e) => soon ? e.preventDefault() : handleSubMenuClick(option, optionsIndex, index, e),
|
|
1667
|
+
className: `${subItemClass(active, soon)} ${inFlyout ? "!py-[7px] !px-2.5" : ""}`
|
|
1668
|
+
},
|
|
1669
|
+
/* @__PURE__ */ React14.createElement("span", { className: "truncate" }, cleanLabel(option.label)),
|
|
1670
|
+
soon && /* @__PURE__ */ React14.createElement("span", { className: "text-[11px] font-semibold text-jett-ink-400" }, "Soon"),
|
|
1671
|
+
hasKids && /* @__PURE__ */ React14.createElement(Chevron, { open: isMenuOpen(subKey) })
|
|
1672
|
+
), hasKids && isMenuOpen(subKey) && /* @__PURE__ */ React14.createElement("div", { className: "ml-3 flex flex-col gap-0.5 border-l border-jett-line pl-2" }, option.options.map((sub, subIndex) => {
|
|
1673
|
+
const subActive = activeMenuPath === `${subKey}-sub-${sub.label}`;
|
|
1674
|
+
return /* @__PURE__ */ React14.createElement("button", { key: subIndex, type: "button", "aria-current": subActive ? "page" : void 0, onClick: () => handleSubSubMenuClick(sub, index, optionsIndex), className: subItemClass(subActive, false) }, /* @__PURE__ */ React14.createElement("span", { className: "truncate" }, cleanLabel(sub.label)));
|
|
1675
|
+
})));
|
|
1676
|
+
});
|
|
1677
|
+
const flyItem = fly ? navItemsLocal[fly.index] : null;
|
|
1678
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, phone && /* @__PURE__ */ React14.createElement("div", { "data-jett-shell": true, className: "font-jett fixed left-0 top-0 z-50 flex h-14 w-full items-center gap-2.5 border-b border-jett-line bg-jett-surface pl-1 pr-2", id: `${id}-div-1` }, /* @__PURE__ */ React14.createElement(
|
|
1679
|
+
"button",
|
|
1680
|
+
{
|
|
1681
|
+
type: "button",
|
|
1682
|
+
onClick: () => setIsMobileMenuOpen(true),
|
|
1683
|
+
"aria-label": "Open menu",
|
|
1684
|
+
title: "Open menu",
|
|
1685
|
+
className: "flex h-11 w-11 cursor-pointer items-center justify-center rounded-[8px] border-0 bg-transparent text-jett-ink-700 hover:bg-jett-fill",
|
|
1686
|
+
id: `${id}-button-1`
|
|
1687
|
+
},
|
|
1688
|
+
/* @__PURE__ */ React14.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("path", { d: "M4 6h16M4 12h16M4 18h16" }))
|
|
1689
|
+
), sideBarLogoLocal ? /* @__PURE__ */ React14.createElement("img", { src: sideBarLogoLocal, alt: "Logo", className: "h-[26px] max-w-[96px] object-contain", id: `${id}-img-1` }) : /* @__PURE__ */ React14.createElement(LogoTile, { size: 26 }), /* @__PURE__ */ React14.createElement("span", { className: "min-w-0 flex-1 truncate text-[15px] font-semibold text-jett-ink" }, activeLabel), /* @__PURE__ */ React14.createElement("button", { type: "button", onClick: () => setIsMobileMenuOpen(true), "aria-label": "Account", title: "Account", className: "flex h-11 w-11 cursor-pointer items-center justify-center border-0 bg-transparent" }, /* @__PURE__ */ React14.createElement("span", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-jett-ink-800 text-[12px] font-semibold text-white" }, initials(displayName)))), phone && isMobileMenuOpen && /* @__PURE__ */ React14.createElement("div", { className: "fixed inset-0 z-[69] bg-[rgba(17,24,39,0.5)]", onClick: closeMobileMenu, "aria-hidden": "true", id: `${id}-div-4` }), /* @__PURE__ */ React14.createElement(
|
|
1690
|
+
"aside",
|
|
1691
|
+
{
|
|
1692
|
+
"data-jett-shell": true,
|
|
1693
|
+
"aria-label": "Main navigation",
|
|
1694
|
+
className: `font-jett flex h-screen flex-col border-r border-jett-line bg-jett-surface text-jett-ink ${phone ? "fixed left-0 top-0 z-[70] max-w-[86vw]" : "relative"} ${ready ? "transition-[width,transform] duration-200 ease-in-out" : ""}`,
|
|
1695
|
+
style: {
|
|
1696
|
+
width: phone ? 280 : collapsed ? 64 : 256,
|
|
1697
|
+
transform: phone && !isMobileMenuOpen ? "translateX(-100%)" : "none",
|
|
1698
|
+
boxShadow: phone && isMobileMenuOpen ? "var(--shadow-jett-drawer)" : "none"
|
|
1699
|
+
},
|
|
1700
|
+
id: `${id}-div-5`
|
|
1701
|
+
},
|
|
1702
|
+
/* @__PURE__ */ React14.createElement("div", { className: `flex h-16 shrink-0 items-center gap-2.5 border-b border-jett-line-row ${collapsed ? "justify-center px-0" : "px-6"}`, id: `${id}-div-6` }, expanded && sideBarLogoLocal ? /* @__PURE__ */ React14.createElement("img", { src: sideBarLogoLocal, alt: "Logo", className: "h-8 max-w-[168px] object-contain", id: `${id}-img-2` }) : /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(LogoTile, null), expanded && /* @__PURE__ */ React14.createElement("span", { className: "flex-1 whitespace-nowrap text-[15px] font-semibold tracking-[-0.01em] text-jett-ink" }, "JETT Admin")), phone && /* @__PURE__ */ React14.createElement(
|
|
1703
|
+
"button",
|
|
1704
|
+
{
|
|
1705
|
+
type: "button",
|
|
1706
|
+
onClick: closeMobileMenu,
|
|
1707
|
+
"aria-label": "Close menu",
|
|
1708
|
+
title: "Close menu",
|
|
1709
|
+
className: "-mr-3 ml-auto flex h-11 w-11 cursor-pointer items-center justify-center rounded-[8px] border-0 bg-transparent text-jett-ink-500 hover:bg-jett-fill"
|
|
1710
|
+
},
|
|
1711
|
+
/* @__PURE__ */ React14.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("path", { d: "M18 6 6 18M6 6l12 12" }))
|
|
1712
|
+
)),
|
|
1713
|
+
/* @__PURE__ */ React14.createElement("nav", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto overflow-x-hidden px-3 py-4 scrollbar-hide", id: `${id}-div-9` }, expanded ? /* @__PURE__ */ React14.createElement(
|
|
1714
|
+
"button",
|
|
1715
|
+
{
|
|
1716
|
+
type: "button",
|
|
1717
|
+
onClick: () => {
|
|
1718
|
+
closeMobileMenu();
|
|
1719
|
+
setPalOpen(true);
|
|
1720
|
+
},
|
|
1721
|
+
className: "mb-2.5 flex h-[34px] w-full shrink-0 cursor-pointer items-center gap-2.5 whitespace-nowrap rounded-[6px] border border-jett-line-soft bg-jett-canvas pl-3 pr-2 text-left text-[13px] text-jett-ink-500 hover:border-jett-line-control hover:text-jett-ink-700"
|
|
1722
|
+
},
|
|
1723
|
+
/* @__PURE__ */ React14.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("circle", { cx: "11", cy: "11", r: "7" }), /* @__PURE__ */ React14.createElement("path", { d: "m20 20-3.5-3.5" })),
|
|
1724
|
+
/* @__PURE__ */ React14.createElement("span", { className: "flex-1" }, "Jump to\u2026"),
|
|
1725
|
+
!phone && /* @__PURE__ */ React14.createElement(Kbd, null, MAC ? "\u21E7\u2318K" : "Ctrl \u21E7 K")
|
|
1726
|
+
) : /* @__PURE__ */ React14.createElement(
|
|
1727
|
+
"button",
|
|
1728
|
+
{
|
|
1729
|
+
type: "button",
|
|
1730
|
+
onClick: () => setPalOpen(true),
|
|
1731
|
+
title: `Jump to ${MAC ? "\u21E7\u2318K" : "Ctrl \u21E7 K"}`,
|
|
1732
|
+
"aria-label": "Search or jump to",
|
|
1733
|
+
className: "mx-auto mb-2 flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-[8px] border border-jett-line-soft bg-jett-canvas text-jett-ink-500 hover:border-jett-line-control hover:text-jett-ink-700"
|
|
1734
|
+
},
|
|
1735
|
+
/* @__PURE__ */ React14.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("circle", { cx: "11", cy: "11", r: "7" }), /* @__PURE__ */ React14.createElement("path", { d: "m20 20-3.5-3.5" }))
|
|
1736
|
+
), navItemsLocal == null ? void 0 : navItemsLocal.map((item, index) => {
|
|
1737
|
+
const menuKey = `menu-${index}`;
|
|
1738
|
+
const hasOptions = !!(item.options && item.options.length);
|
|
1739
|
+
const isOpen = isMenuOpen(menuKey);
|
|
1740
|
+
const isParent = index === parentIndex;
|
|
1741
|
+
const Icon = item.Icon;
|
|
1742
|
+
const iconEl = Icon ? /* @__PURE__ */ React14.createElement(Icon, { width: 18, height: 18, strokeWidth: 1.8, className: `shrink-0 ${isParent ? "text-jett-brand" : "text-jett-ink-400"}`, "aria-hidden": "true" }) : null;
|
|
1743
|
+
if (collapsed) {
|
|
1744
|
+
const flying = fly && fly.index === index;
|
|
1745
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1746
|
+
"button",
|
|
1747
|
+
{
|
|
1748
|
+
key: index,
|
|
1749
|
+
type: "button",
|
|
1750
|
+
title: item.label,
|
|
1751
|
+
"aria-label": item.label,
|
|
1752
|
+
"aria-haspopup": hasOptions ? "menu" : void 0,
|
|
1753
|
+
"aria-expanded": hasOptions ? !!flying : void 0,
|
|
1754
|
+
onClick: (e) => hasOptions ? openFly(index, e) : handleMenuClick(item, index, e),
|
|
1755
|
+
className: `mx-auto flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-[8px] border-0 ${isParent ? "bg-jett-brand-soft" : flying ? "bg-jett-fill" : "bg-transparent hover:bg-jett-fill"}`,
|
|
1756
|
+
id: `${id}-div-12-${index}`
|
|
1757
|
+
},
|
|
1758
|
+
iconEl
|
|
1759
|
+
);
|
|
1760
|
+
}
|
|
1761
|
+
return /* @__PURE__ */ React14.createElement("div", { key: index, className: "flex flex-col gap-0.5", id: `${id}-div-11-${index}` }, /* @__PURE__ */ React14.createElement(
|
|
1762
|
+
"button",
|
|
1763
|
+
{
|
|
1764
|
+
type: "button",
|
|
1765
|
+
"aria-expanded": hasOptions ? isOpen : void 0,
|
|
1766
|
+
"aria-current": !hasOptions && isParent ? "page" : void 0,
|
|
1767
|
+
onClick: (e) => handleMenuClick(item, index, e),
|
|
1768
|
+
className: `flex w-full cursor-pointer items-center gap-3 whitespace-nowrap rounded-[6px] border-0 px-3 text-left !text-[14px] ${phone ? "py-3" : "py-2"} ${isParent ? "bg-jett-brand-soft !font-semibold text-jett-brand" : "bg-transparent !font-medium text-jett-ink-700 hover:bg-jett-fill"}`,
|
|
1769
|
+
id: `${id}-div-12-${index}`
|
|
1770
|
+
},
|
|
1771
|
+
iconEl,
|
|
1772
|
+
/* @__PURE__ */ React14.createElement("span", { className: "flex-1 truncate" }, item.label),
|
|
1773
|
+
hasOptions && /* @__PURE__ */ React14.createElement("span", { className: isParent ? "text-jett-brand" : "text-jett-ink-400" }, /* @__PURE__ */ React14.createElement(Chevron, { open: isOpen }))
|
|
1774
|
+
), hasOptions && isOpen && /* @__PURE__ */ React14.createElement("div", { className: "mb-1 ml-[27px] mt-0.5 flex flex-col gap-0.5 border-l border-jett-line pl-[13px]", id: `${id}-div-15-${index}` }, renderOptions(item, index, false)));
|
|
1775
|
+
})),
|
|
1776
|
+
!phone && /* @__PURE__ */ React14.createElement("div", { className: `flex shrink-0 flex-wrap gap-1 border-t border-jett-line-row px-3 py-2 ${collapsed ? "justify-center" : ""}` }, /* @__PURE__ */ React14.createElement(
|
|
1777
|
+
"button",
|
|
1778
|
+
{
|
|
1779
|
+
type: "button",
|
|
1780
|
+
onClick: () => setHelpOpen(true),
|
|
1781
|
+
title: "Keyboard shortcuts ?",
|
|
1782
|
+
"aria-label": "Keyboard shortcuts",
|
|
1783
|
+
className: `flex h-9 min-w-10 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[6px] border-0 bg-transparent text-[13px] font-medium text-jett-ink-500 hover:bg-jett-fill hover:text-jett-ink ${collapsed ? "px-0" : "px-3"}`
|
|
1784
|
+
},
|
|
1785
|
+
/* @__PURE__ */ React14.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "6", width: "20", height: "12", rx: "2" }), /* @__PURE__ */ React14.createElement("path", { d: "M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10" })),
|
|
1786
|
+
expanded && /* @__PURE__ */ React14.createElement(Kbd, null, "?")
|
|
1787
|
+
), /* @__PURE__ */ React14.createElement(
|
|
1788
|
+
"button",
|
|
1789
|
+
{
|
|
1790
|
+
type: "button",
|
|
1791
|
+
onClick: toggleCollapsed,
|
|
1792
|
+
title: collapsed ? "Expand sidebar [" : "Collapse sidebar [",
|
|
1793
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
1794
|
+
"aria-pressed": collapsed,
|
|
1795
|
+
className: `flex h-9 min-w-10 cursor-pointer items-center justify-center gap-2.5 whitespace-nowrap rounded-[6px] border-0 bg-transparent text-[13px] font-medium text-jett-ink-500 hover:bg-jett-fill hover:text-jett-ink ${collapsed ? "px-0" : "flex-1 px-3"}`
|
|
1796
|
+
},
|
|
1797
|
+
/* @__PURE__ */ React14.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", style: { transform: collapsed ? "scaleX(-1)" : "none" }, "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }), /* @__PURE__ */ React14.createElement("path", { d: "M9 4v16M16 10l-2 2 2 2" })),
|
|
1798
|
+
expanded && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("span", { className: "flex-1 text-left" }, "Collapse"), /* @__PURE__ */ React14.createElement(Kbd, null, "["))
|
|
1799
|
+
)),
|
|
1800
|
+
/* @__PURE__ */ React14.createElement("div", { ref: profileCardRef, className: "relative shrink-0 border-t border-jett-line-row px-3 py-3", id: `${id}-div-22` }, /* @__PURE__ */ React14.createElement(
|
|
1801
|
+
"button",
|
|
1802
|
+
{
|
|
1803
|
+
type: "button",
|
|
1804
|
+
onClick: () => {
|
|
1805
|
+
setFly(null);
|
|
1806
|
+
setIsSwitchProfileOpen((prev) => !prev);
|
|
1807
|
+
},
|
|
1808
|
+
title: displayName,
|
|
1809
|
+
"aria-haspopup": "dialog",
|
|
1810
|
+
"aria-expanded": isSwitchProfileOpen,
|
|
1811
|
+
className: `flex w-full cursor-pointer items-center gap-3 rounded-[8px] border border-transparent text-left ${collapsed ? "justify-center p-0" : "p-2.5"} ${isSwitchProfileOpen ? "bg-jett-fill" : "bg-transparent hover:bg-jett-fill"}`,
|
|
1812
|
+
id: `${id}-div-23`
|
|
1813
|
+
},
|
|
1814
|
+
/* @__PURE__ */ React14.createElement("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-jett-ink-800 text-[13px] font-semibold text-white", id: `${id}-span-3` }, initials(displayName)),
|
|
1815
|
+
expanded && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("span", { className: "min-w-0 flex-1 whitespace-nowrap" }, /* @__PURE__ */ React14.createElement("span", { className: "block truncate text-[14px] font-medium text-jett-ink-800", id: `${id}-p-1` }, displayName), scopeLabel && /* @__PURE__ */ React14.createElement("span", { className: "block truncate text-[12px] text-jett-ink-500", id: `${id}-p-2` }, scopeLabel)), /* @__PURE__ */ React14.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React14.createElement("path", { d: "m7 15 5 5 5-5M7 9l5-5 5 5" })))
|
|
1816
|
+
), /* @__PURE__ */ React14.createElement(
|
|
1817
|
+
SwitchProfileSection,
|
|
1818
|
+
{
|
|
1819
|
+
id: `${id}-switch-profile`,
|
|
1820
|
+
open: isSwitchProfileOpen,
|
|
1821
|
+
anchorRef: profileCardRef,
|
|
1822
|
+
collapsed,
|
|
1823
|
+
scopeLabel,
|
|
1824
|
+
onClose: () => setIsSwitchProfileOpen(false),
|
|
1825
|
+
onManageProfile: () => {
|
|
1826
|
+
setIsSwitchProfileOpen(false);
|
|
1827
|
+
if (onManageProfile) onManageProfile();
|
|
1828
|
+
else window.location.href = "/profile";
|
|
1829
|
+
},
|
|
1830
|
+
onProfileSwitch: (profile) => {
|
|
1831
|
+
setIsSwitchProfileOpen(false);
|
|
1832
|
+
onProfileSwitch == null ? void 0 : onProfileSwitch(profile);
|
|
1833
|
+
},
|
|
1834
|
+
onTmcSettings: () => {
|
|
1835
|
+
setIsSwitchProfileOpen(false);
|
|
1836
|
+
onTmcSettings == null ? void 0 : onTmcSettings();
|
|
1837
|
+
},
|
|
1838
|
+
onLogout: () => {
|
|
1839
|
+
setIsSwitchProfileOpen(false);
|
|
1840
|
+
clearProfileSwitchFlag();
|
|
1841
|
+
if (onLogout) {
|
|
1842
|
+
onLogout();
|
|
1843
|
+
} else {
|
|
1844
|
+
window.location.href = `${window.location.origin}/login/logout`;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
))
|
|
1849
|
+
), collapsed && flyItem && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { className: "fixed inset-0 z-[79]", onClick: () => setFly(null), "aria-hidden": "true" }), /* @__PURE__ */ React14.createElement(
|
|
1850
|
+
"div",
|
|
1851
|
+
{
|
|
1852
|
+
"data-jett-shell": true,
|
|
1853
|
+
role: "menu",
|
|
1854
|
+
"aria-label": flyItem.label,
|
|
1855
|
+
className: "font-jett fixed z-[80] flex w-[220px] flex-col gap-0.5 rounded-[10px] border border-jett-line bg-jett-surface p-1.5 shadow-jett-pop",
|
|
1856
|
+
style: { left: 72, top: fly.top }
|
|
1857
|
+
},
|
|
1858
|
+
/* @__PURE__ */ React14.createElement("div", { className: "px-2.5 pb-2 pt-1.5 text-[11px] font-semibold uppercase tracking-[0.06em] text-jett-ink-400" }, flyItem.label),
|
|
1859
|
+
renderOptions(flyItem, fly.index, true)
|
|
1860
|
+
)), /* @__PURE__ */ React14.createElement(CommandPalette, { id: `${id}-palette`, open: palOpen, onClose: () => setPalOpen(false), commands }), /* @__PURE__ */ React14.createElement(ShortcutsSheet, { id: `${id}-shortcuts`, open: helpOpen, onClose: () => setHelpOpen(false), sections: helpSections }));
|
|
1861
|
+
};
|
|
1862
|
+
|
|
1863
|
+
// src/RightSheet/RightSheet.jsx
|
|
1864
|
+
import React15, { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1865
|
+
var RightSheet = ({
|
|
1866
|
+
id = "right-sheet",
|
|
1867
|
+
open,
|
|
1868
|
+
setOpen,
|
|
1869
|
+
children,
|
|
1870
|
+
callBack,
|
|
1871
|
+
actionLabel = "Save",
|
|
1872
|
+
onAction = () => {
|
|
1873
|
+
},
|
|
1874
|
+
showFooter = true
|
|
1875
|
+
}) => {
|
|
1876
|
+
const [visible, setVisible] = useState5(open);
|
|
1877
|
+
useEffect4(() => {
|
|
1878
|
+
if (open) {
|
|
1879
|
+
document.body.style.overflow = "hidden";
|
|
1880
|
+
setVisible(true);
|
|
1881
|
+
}
|
|
1882
|
+
return () => {
|
|
1883
|
+
document.body.style.overflow = "auto";
|
|
1884
|
+
};
|
|
1885
|
+
}, [open]);
|
|
1886
|
+
const handleClose = () => {
|
|
1887
|
+
setVisible(false);
|
|
1888
|
+
setTimeout(() => {
|
|
1889
|
+
setOpen(false);
|
|
1890
|
+
callBack();
|
|
1891
|
+
}, 200);
|
|
1892
|
+
};
|
|
1893
|
+
const handleAction = () => {
|
|
1894
|
+
onAction();
|
|
1895
|
+
handleClose();
|
|
1896
|
+
};
|
|
1897
|
+
if (!visible) return null;
|
|
1898
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1899
|
+
"div",
|
|
1900
|
+
{
|
|
1901
|
+
className: "fixed inset-0 overflow-x-hidden bg-black/80 sheetPopIn h-full overflow-auto ",
|
|
1902
|
+
onClick: handleClose,
|
|
1903
|
+
id: `${id}-div-1`
|
|
1904
|
+
},
|
|
1905
|
+
/* @__PURE__ */ React15.createElement(
|
|
1906
|
+
"div",
|
|
1907
|
+
{
|
|
1908
|
+
className: `absolute flex flex-col right-0 top-0 min-h-full min-w-[100%] md:min-w-[576px]
|
|
1909
|
+
${visible ? "sheetRightSlide" : "transition-all duration-200 translate-x-[100%]"} justify-between bg-[#fff] dark:bg-[#18181b] dark:text-white`,
|
|
1910
|
+
onClick: (e) => e.stopPropagation(),
|
|
1911
|
+
id: `${id}-div-2`
|
|
1912
|
+
},
|
|
1913
|
+
/* @__PURE__ */ React15.createElement("div", { className: " min-h-full ", id: `${id}-div-3` }, children),
|
|
1914
|
+
showFooter && /* @__PURE__ */ React15.createElement("div", { className: "h-[90px] flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 border-t sticky bottom-0 bg-white border-[#e6e6e6] dark:border-[#303036] dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose(), id: `${id}-custom-button-1` }, "Cancel"), /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction, id: `${id}-custom-button-2` }, actionLabel))
|
|
1915
|
+
)
|
|
1916
|
+
);
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1919
|
+
// src/Table/CustomTable.jsx
|
|
1920
|
+
import React16 from "react";
|
|
1921
|
+
var CustomTable = ({
|
|
1922
|
+
id = "custom-table",
|
|
1923
|
+
tableHeader,
|
|
1924
|
+
setIsAllChecked,
|
|
1925
|
+
isAllChecked,
|
|
1926
|
+
children,
|
|
1927
|
+
isHideCheckbox = "false"
|
|
1928
|
+
}) => {
|
|
1929
|
+
return /* @__PURE__ */ React16.createElement("div", { className: "border border-[#e5e5e5] dark:border-[#303036] rounded-lg overflow-x-auto", id: `${id}-div-1` }, /* @__PURE__ */ React16.createElement("div", { className: "w-full relative overflow-x-auto", id: `${id}-div-2` }, /* @__PURE__ */ React16.createElement("table", { className: "w-full caption-bottom text-sm overflow-x-auto bg-white dark:bg-[#18181b] table-fixed border-collapse", id: `${id}-table-1` }, /* @__PURE__ */ React16.createElement("thead", { className: "border-b border-[#e5e5e5] dark:border-[#303036] dark:bg-[#18181b]", id: `${id}-thead-1` }, /* @__PURE__ */ React16.createElement(
|
|
1930
|
+
"tr",
|
|
1931
|
+
{
|
|
1932
|
+
className: "transition-colors text-[#737373] hover:bg-muted/50 \r\n data-[state=selected]:bg-muted",
|
|
1933
|
+
id: `${id}-tr-1`
|
|
1934
|
+
},
|
|
1935
|
+
!isHideCheckbox && /* @__PURE__ */ React16.createElement("th", { className: "px-4 py-3 text-left w-[50px]", id: `${id}-th-1` }, /* @__PURE__ */ React16.createElement(
|
|
1936
|
+
CustomCheckbox,
|
|
1937
|
+
{
|
|
1938
|
+
checked: isAllChecked,
|
|
1939
|
+
onChange: () => {
|
|
1940
|
+
setIsAllChecked(!isAllChecked);
|
|
1941
|
+
},
|
|
1942
|
+
id: `${id}-custom-checkbox-1`
|
|
1943
|
+
}
|
|
1944
|
+
)),
|
|
1945
|
+
tableHeader.map((header, index) => {
|
|
1946
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1947
|
+
"th",
|
|
1948
|
+
{
|
|
1949
|
+
className: `text-[#737373] px-4 py-3 text-sm dark:bg-[#18181b] font-medium ${index == tableHeader.length - 1 ? "text-right" : "text-left"}`,
|
|
1950
|
+
key: header + index,
|
|
1951
|
+
id: `${id}-th-2-${index}`
|
|
1952
|
+
},
|
|
1953
|
+
header
|
|
1954
|
+
);
|
|
1955
|
+
})
|
|
1956
|
+
)), /* @__PURE__ */ React16.createElement("tbody", { id: `${id}-tbody-1` }, children))));
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1959
|
+
// src/inputs/CustomSelect.jsx
|
|
1960
|
+
import React17, { useState as useState6, useRef as useRef5 } from "react";
|
|
1961
|
+
import { ChevronDown as ChevronDown2, Search as Search3 } from "lucide-react";
|
|
1962
|
+
var CustomSelect = ({
|
|
1963
|
+
id = "custom-select",
|
|
1964
|
+
label,
|
|
1965
|
+
value,
|
|
1966
|
+
onChange,
|
|
1967
|
+
options,
|
|
1968
|
+
placeholder = "Select...",
|
|
1969
|
+
isRequired = false,
|
|
1970
|
+
error,
|
|
1971
|
+
heading,
|
|
1972
|
+
disabled = false
|
|
1973
|
+
}) => {
|
|
1974
|
+
const [open, setOpen] = useState6(false);
|
|
1975
|
+
const [search, setSearch] = useState6("");
|
|
1976
|
+
const wrapperRef = useRef5(null);
|
|
1977
|
+
const handleBlur = (e) => {
|
|
1978
|
+
var _a;
|
|
1979
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
1980
|
+
setOpen(false);
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
const filteredOptions = options.filter(
|
|
1984
|
+
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
1985
|
+
);
|
|
1986
|
+
const handleSelect = (val) => {
|
|
1987
|
+
onChange(val);
|
|
1988
|
+
setOpen(false);
|
|
1989
|
+
};
|
|
1990
|
+
const selectedOption = options.find((opt) => opt.value === value);
|
|
1991
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1992
|
+
"div",
|
|
1993
|
+
{
|
|
1994
|
+
className: "flex flex-col w-full relative",
|
|
1995
|
+
ref: wrapperRef,
|
|
1996
|
+
tabIndex: disabled ? -1 : 0,
|
|
1997
|
+
onBlur: handleBlur,
|
|
1998
|
+
id: `${id}-div-1`
|
|
1999
|
+
},
|
|
2000
|
+
heading && /* @__PURE__ */ React17.createElement("h3", { className: "text-lg font-semibold mb-1", id: `${id}-h3-1` }, heading),
|
|
2001
|
+
label && /* @__PURE__ */ React17.createElement(
|
|
2002
|
+
"label",
|
|
2003
|
+
{
|
|
2004
|
+
className: `font-medium text-sm mb-1 ${heading ? "text-[#737373] dark:text-white" : "text-black dark:text-white"}`,
|
|
2005
|
+
id: `${id}-label-1`
|
|
2006
|
+
},
|
|
2007
|
+
label,
|
|
2008
|
+
" ",
|
|
2009
|
+
isRequired && /* @__PURE__ */ React17.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
2010
|
+
),
|
|
2011
|
+
/* @__PURE__ */ React17.createElement(
|
|
2012
|
+
"div",
|
|
2013
|
+
{
|
|
2014
|
+
onClick: () => !disabled && setOpen((prev) => !prev),
|
|
2015
|
+
className: `flex justify-between items-center rounded-md px-3 py-2 text-sm border h-10 cursor-pointer dark:border-[#303036] dark:bg-[#18181b] dark:text-white
|
|
2016
|
+
${disabled ? "bg-gray-100 text-gray-400" : "bg-white dark:bg-[#18181b] dark:text-white"}
|
|
2017
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
2018
|
+
`,
|
|
2019
|
+
id: `${id}-div-2`
|
|
2020
|
+
},
|
|
2021
|
+
/* @__PURE__ */ React17.createElement("span", { className: `${selectedOption ? "text-black dark:text-white" : "text-gray-400 dark:text-white"}`, id: `${id}-span-2` }, selectedOption ? selectedOption.label : placeholder),
|
|
2022
|
+
/* @__PURE__ */ React17.createElement(
|
|
2023
|
+
ChevronDown2,
|
|
2024
|
+
{
|
|
2025
|
+
className: `w-4 h-4 text-gray-500 transition-transform dark:text-white ${open ? "rotate-180" : ""}`
|
|
2026
|
+
}
|
|
2027
|
+
)
|
|
2028
|
+
),
|
|
2029
|
+
open && !disabled && /* @__PURE__ */ React17.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white", id: `${id}-div-3` }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200", id: `${id}-div-4` }, /* @__PURE__ */ React17.createElement(Search3, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React17.createElement(
|
|
2030
|
+
"input",
|
|
2031
|
+
{
|
|
2032
|
+
type: "text",
|
|
2033
|
+
value: search,
|
|
2034
|
+
onChange: (e) => setSearch(e.target.value),
|
|
2035
|
+
placeholder: "Search...",
|
|
2036
|
+
className: "flex-1 text-sm focus:outline-none",
|
|
2037
|
+
id: `${id}-input-1`
|
|
2038
|
+
}
|
|
2039
|
+
)), /* @__PURE__ */ React17.createElement("ul", { id: `${id}-ul-1` }, filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ React17.createElement(
|
|
2040
|
+
"li",
|
|
2041
|
+
{
|
|
2042
|
+
key: opt.value,
|
|
2043
|
+
onClick: () => handleSelect(opt.value),
|
|
2044
|
+
className: `px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 dark:hover:bg-[#27272a] ${value === opt.value ? "bg-gray-100 font-medium dark:bg-[#27272a] dark:text-white" : ""}`,
|
|
2045
|
+
id: `${id}-li-1`
|
|
2046
|
+
},
|
|
2047
|
+
opt.label
|
|
2048
|
+
)) : /* @__PURE__ */ React17.createElement("li", { className: "px-3 py-2 text-sm text-gray-400 dark:text-white", id: `${id}-li-2` }, "No results found")))
|
|
2049
|
+
);
|
|
2050
|
+
};
|
|
2051
|
+
|
|
2052
|
+
// src/inputs/Dropdown.jsx
|
|
2053
|
+
import React18, { useId, useMemo as useMemo3 } from "react";
|
|
2054
|
+
import ReactSelect from "react-select";
|
|
2055
|
+
var isDarkMode = () => typeof document !== "undefined" && document.documentElement.classList.contains("dark");
|
|
2056
|
+
function buildStyles(isDark, error) {
|
|
2057
|
+
return {
|
|
2058
|
+
control: (base, state) => ({
|
|
2059
|
+
...base,
|
|
2060
|
+
minHeight: "40px !important",
|
|
2061
|
+
fontSize: 14,
|
|
2062
|
+
borderRadius: "6px",
|
|
2063
|
+
boxShadow: "none",
|
|
2064
|
+
backgroundColor: state.isDisabled ? "#f3f4f6" : error ? "#fef2f2" : isDark ? "#18181b" : "#ffffff",
|
|
2065
|
+
borderColor: state.isDisabled ? "#d1d5db" : error ? "#ef4444" : isDark ? "#303036" : "#e5e5e5",
|
|
2066
|
+
outline: state.isFocused ? "2px solid #000" : "none",
|
|
2067
|
+
outlineOffset: "2px",
|
|
2068
|
+
"&:hover": {
|
|
2069
|
+
borderColor: error ? "#ef4444" : "none"
|
|
2070
|
+
}
|
|
2071
|
+
}),
|
|
2072
|
+
menu: (base) => ({
|
|
2073
|
+
...base,
|
|
2074
|
+
backgroundColor: isDark ? "#18181b" : "#ffffff",
|
|
2075
|
+
zIndex: 9999
|
|
2076
|
+
}),
|
|
2077
|
+
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
|
|
2078
|
+
option: (base, state) => ({
|
|
2079
|
+
...base,
|
|
2080
|
+
fontSize: 14,
|
|
2081
|
+
cursor: "pointer",
|
|
2082
|
+
backgroundColor: state.isSelected ? "#0087FA" : state.isFocused ? isDark ? "#303036" : "#EBF5FF" : "transparent",
|
|
2083
|
+
color: state.isSelected ? "#ffffff" : isDark ? "#f3f4f6" : "#111827",
|
|
2084
|
+
"&:active": { backgroundColor: "#0087FA", color: "#ffffff" }
|
|
2085
|
+
}),
|
|
2086
|
+
singleValue: (base, state) => ({
|
|
2087
|
+
...base,
|
|
2088
|
+
fontSize: 14,
|
|
2089
|
+
fontWeight: 400,
|
|
2090
|
+
color: state.isDisabled ? "#6b7280" : isDark ? "#f3f4f6" : "#111827"
|
|
2091
|
+
}),
|
|
2092
|
+
multiValue: (base) => ({
|
|
2093
|
+
...base,
|
|
2094
|
+
backgroundColor: isDark ? "#303036" : "#EBF5FF"
|
|
2095
|
+
}),
|
|
2096
|
+
multiValueLabel: (base) => ({
|
|
2097
|
+
...base,
|
|
2098
|
+
fontSize: 12,
|
|
2099
|
+
color: isDark ? "#f3f4f6" : "#0087FA"
|
|
2100
|
+
}),
|
|
2101
|
+
multiValueRemove: (base) => ({
|
|
2102
|
+
...base,
|
|
2103
|
+
color: isDark ? "#9ca3af" : "#0087FA",
|
|
2104
|
+
"&:hover": { backgroundColor: "#0087FA", color: "#ffffff" }
|
|
2105
|
+
}),
|
|
2106
|
+
placeholder: (base) => ({
|
|
2107
|
+
...base,
|
|
2108
|
+
fontSize: 14,
|
|
2109
|
+
fontWeight: 400,
|
|
2110
|
+
color: "#6b7280"
|
|
2111
|
+
}),
|
|
2112
|
+
input: (base) => ({
|
|
2113
|
+
...base,
|
|
2114
|
+
fontSize: 14,
|
|
2115
|
+
fontWeight: 400,
|
|
2116
|
+
color: isDark ? "#f3f4f6" : "#111827"
|
|
2117
|
+
}),
|
|
2118
|
+
indicatorSeparator: () => ({ display: "none" }),
|
|
2119
|
+
dropdownIndicator: (base) => ({
|
|
2120
|
+
...base,
|
|
2121
|
+
padding: "0 6px",
|
|
2122
|
+
color: isDark ? "#9ca3af" : "#6b7280"
|
|
2123
|
+
}),
|
|
2124
|
+
clearIndicator: (base) => ({
|
|
2125
|
+
...base,
|
|
2126
|
+
padding: "0 4px",
|
|
2127
|
+
color: isDark ? "#9ca3af" : "#6b7280",
|
|
2128
|
+
cursor: "pointer",
|
|
2129
|
+
"&:hover": { color: "#0087FA" }
|
|
2130
|
+
}),
|
|
2131
|
+
valueContainer: (base) => ({ ...base, padding: "2px 16px" })
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
var Dropdown = React18.forwardRef(
|
|
2135
|
+
({
|
|
2136
|
+
id = "dropdown",
|
|
2137
|
+
options,
|
|
2138
|
+
placeholder = "Select...",
|
|
2139
|
+
isDisabled = false,
|
|
2140
|
+
isClearable = true,
|
|
2141
|
+
isLoading = false,
|
|
2142
|
+
error = false,
|
|
2143
|
+
label,
|
|
2144
|
+
heading,
|
|
2145
|
+
isRequired = false,
|
|
2146
|
+
name,
|
|
2147
|
+
menuPortalTarget,
|
|
2148
|
+
menuPosition = "absolute",
|
|
2149
|
+
className,
|
|
2150
|
+
style,
|
|
2151
|
+
isMulti = false,
|
|
2152
|
+
value,
|
|
2153
|
+
onChange
|
|
2154
|
+
}, ref) => {
|
|
2155
|
+
const reactId = useId();
|
|
2156
|
+
const isDark = isDarkMode();
|
|
2157
|
+
const styles = useMemo3(() => buildStyles(isDark, !!error), [isDark, error]);
|
|
2158
|
+
const selectedValue = isMulti ? options.filter((o) => (value ?? []).includes(o.value)) : options.find((o) => o.value === value) ?? null;
|
|
2159
|
+
const handleChange = (selected) => {
|
|
2160
|
+
if (isMulti) {
|
|
2161
|
+
onChange((selected ?? []).map((o) => o.value));
|
|
2162
|
+
} else {
|
|
2163
|
+
onChange((selected == null ? void 0 : selected.value) ?? null);
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
return /* @__PURE__ */ React18.createElement("div", { className: `flex flex-col gap-1 w-full ${className ?? ""}`, style, id: `${id}-div-1` }, heading && /* @__PURE__ */ React18.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), label && /* @__PURE__ */ React18.createElement(
|
|
2167
|
+
"label",
|
|
2168
|
+
{
|
|
2169
|
+
htmlFor: reactId,
|
|
2170
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`,
|
|
2171
|
+
id: `${id}-label-1`
|
|
2172
|
+
},
|
|
2173
|
+
label,
|
|
2174
|
+
isRequired && /* @__PURE__ */ React18.createElement("span", { className: "text-red-500 ml-0.5", id: `${id}-span-1` }, "*")
|
|
2175
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2176
|
+
ReactSelect,
|
|
2177
|
+
{
|
|
2178
|
+
ref,
|
|
2179
|
+
inputId: reactId,
|
|
2180
|
+
name,
|
|
2181
|
+
options,
|
|
2182
|
+
value: selectedValue,
|
|
2183
|
+
onChange: handleChange,
|
|
2184
|
+
placeholder,
|
|
2185
|
+
isDisabled,
|
|
2186
|
+
isClearable,
|
|
2187
|
+
isLoading,
|
|
2188
|
+
isMulti,
|
|
2189
|
+
styles,
|
|
2190
|
+
menuPortalTarget,
|
|
2191
|
+
menuPosition,
|
|
2192
|
+
classNamePrefix: "jett-dropdown"
|
|
2193
|
+
}
|
|
2194
|
+
));
|
|
2195
|
+
}
|
|
2196
|
+
);
|
|
2197
|
+
Dropdown.displayName = "Dropdown";
|
|
2198
|
+
|
|
2199
|
+
// src/Calendar/Calendar.tsx
|
|
2200
|
+
import React19, { useEffect as useEffect5, useState as useState7 } from "react";
|
|
2201
|
+
import {
|
|
2202
|
+
DatePicker,
|
|
2203
|
+
DateTimePicker,
|
|
2204
|
+
DatesProvider
|
|
2205
|
+
} from "@mantine/dates";
|
|
2206
|
+
var Calendar = (props) => {
|
|
2207
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2208
|
+
const {
|
|
2209
|
+
minDate,
|
|
2210
|
+
maxDate,
|
|
2211
|
+
excludeDate,
|
|
2212
|
+
firstDayOfWeek = 1,
|
|
2213
|
+
locale,
|
|
2214
|
+
size,
|
|
2215
|
+
className,
|
|
2216
|
+
error
|
|
2217
|
+
} = props;
|
|
2218
|
+
const isRange = props.mode === "range";
|
|
2219
|
+
const isDateTime = props.mode === "datetime";
|
|
2220
|
+
const datesProviderSettings = {
|
|
2221
|
+
firstDayOfWeek,
|
|
2222
|
+
consistentWeeks: true
|
|
2223
|
+
};
|
|
2224
|
+
if (locale) {
|
|
2225
|
+
datesProviderSettings.locale = locale;
|
|
2226
|
+
}
|
|
2227
|
+
const anchorDate = isRange ? ((_a = props.value) == null ? void 0 : _a[0]) ?? ((_b = props.value) == null ? void 0 : _b[1]) ?? ((_c = props.defaultValue) == null ? void 0 : _c[0]) ?? ((_d = props.defaultValue) == null ? void 0 : _d[1]) ?? void 0 : !isDateTime ? props.value ?? props.defaultValue ?? void 0 : void 0;
|
|
2228
|
+
const [displayDate, setDisplayDate] = useState7(anchorDate ?? void 0);
|
|
2229
|
+
const anchorTime = isRange ? ((_f = (_e = props.value) == null ? void 0 : _e[0]) == null ? void 0 : _f.getTime()) ?? ((_h = (_g = props.value) == null ? void 0 : _g[1]) == null ? void 0 : _h.getTime()) : !isDateTime ? (_i = props.value) == null ? void 0 : _i.getTime() : void 0;
|
|
2230
|
+
useEffect5(() => {
|
|
2231
|
+
if (anchorTime !== void 0) {
|
|
2232
|
+
setDisplayDate(new Date(anchorTime));
|
|
2233
|
+
}
|
|
2234
|
+
}, [anchorTime]);
|
|
2235
|
+
const weekendColorStyle = {
|
|
2236
|
+
"--mantine-color-red-6": "var(--mantine-color-text)"
|
|
2237
|
+
};
|
|
2238
|
+
if (isRange) {
|
|
2239
|
+
const datePickerProps2 = {
|
|
2240
|
+
type: "range",
|
|
2241
|
+
value: props.value,
|
|
2242
|
+
defaultValue: props.defaultValue,
|
|
2243
|
+
onChange: props.onChange,
|
|
2244
|
+
minDate,
|
|
2245
|
+
maxDate,
|
|
2246
|
+
excludeDate,
|
|
2247
|
+
size,
|
|
2248
|
+
className,
|
|
2249
|
+
date: displayDate,
|
|
2250
|
+
onDateChange: setDisplayDate,
|
|
2251
|
+
style: weekendColorStyle
|
|
2252
|
+
};
|
|
2253
|
+
return /* @__PURE__ */ React19.createElement(DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ React19.createElement(DatePicker, { ...datePickerProps2 }));
|
|
2254
|
+
}
|
|
2255
|
+
if (isDateTime) {
|
|
2256
|
+
const dateTimePickerProps = {
|
|
2257
|
+
value: props.value,
|
|
2258
|
+
defaultValue: props.defaultValue,
|
|
2259
|
+
onChange: props.onChange,
|
|
2260
|
+
minDate,
|
|
2261
|
+
maxDate,
|
|
2262
|
+
excludeDate,
|
|
2263
|
+
size,
|
|
2264
|
+
className,
|
|
2265
|
+
error,
|
|
2266
|
+
style: weekendColorStyle
|
|
2267
|
+
};
|
|
2268
|
+
return /* @__PURE__ */ React19.createElement(DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ React19.createElement(DateTimePicker, { ...dateTimePickerProps }));
|
|
2269
|
+
}
|
|
2270
|
+
const datePickerProps = {
|
|
2271
|
+
value: props.value,
|
|
2272
|
+
defaultValue: props.defaultValue,
|
|
2273
|
+
onChange: props.onChange,
|
|
2274
|
+
minDate,
|
|
2275
|
+
maxDate,
|
|
2276
|
+
excludeDate,
|
|
2277
|
+
size,
|
|
2278
|
+
className,
|
|
2279
|
+
date: displayDate,
|
|
2280
|
+
onDateChange: setDisplayDate,
|
|
2281
|
+
style: weekendColorStyle
|
|
2282
|
+
};
|
|
2283
|
+
return /* @__PURE__ */ React19.createElement(DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ React19.createElement(DatePicker, { ...datePickerProps }));
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2286
|
+
// src/Pagination/Pagination.jsx
|
|
2287
|
+
import React20, { useMemo as useMemo4, useState as useState8, useEffect as useEffect6 } from "react";
|
|
2288
|
+
import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
2289
|
+
var Pagination = ({
|
|
2290
|
+
id = "pagination",
|
|
2291
|
+
data = [],
|
|
2292
|
+
component: Component,
|
|
2293
|
+
itemsPerPage = 6,
|
|
2294
|
+
itemsPerPageOptions = [5, 10, 20, 50, 100],
|
|
2295
|
+
// Controlled props (optional)
|
|
2296
|
+
currentPage: controlledCurrentPage,
|
|
2297
|
+
onPageChange: controlledOnPageChange,
|
|
2298
|
+
onItemsPerPageChange: controlledOnItemsPerPageChange,
|
|
2299
|
+
// Legacy props for backward compatibility
|
|
2300
|
+
totalPages,
|
|
2301
|
+
totalItems: legacyTotalItems,
|
|
2302
|
+
onPageChange: legacyOnPageChange,
|
|
2303
|
+
onItemsPerPageChange: legacyOnItemsPerPageChange,
|
|
2304
|
+
tableHeader,
|
|
2305
|
+
isHideCheckbox,
|
|
2306
|
+
callback,
|
|
2307
|
+
isTable = false,
|
|
2308
|
+
// Component props - any additional props to pass to the component
|
|
2309
|
+
componentProps = {},
|
|
2310
|
+
...restProps
|
|
2311
|
+
}) => {
|
|
2312
|
+
const [internalCurrentPage, setInternalCurrentPage] = useState8(1);
|
|
2313
|
+
const [internalItemsPerPage, setInternalItemsPerPage] = useState8(itemsPerPage);
|
|
2314
|
+
const isControlled = controlledCurrentPage !== void 0;
|
|
2315
|
+
const isItemsPerPageControlled = controlledOnItemsPerPageChange !== void 0;
|
|
2316
|
+
const currentPage = isControlled ? controlledCurrentPage : internalCurrentPage;
|
|
2317
|
+
const activeItemsPerPage = isItemsPerPageControlled ? itemsPerPage : internalItemsPerPage;
|
|
2318
|
+
const totalItems = legacyTotalItems !== void 0 ? legacyTotalItems : data.length;
|
|
2319
|
+
const calculatedTotalPages = useMemo4(() => {
|
|
2320
|
+
if (totalItems > 0 && activeItemsPerPage > 0) {
|
|
2321
|
+
return Math.ceil(totalItems / activeItemsPerPage);
|
|
2322
|
+
}
|
|
2323
|
+
return 1;
|
|
2324
|
+
}, [totalItems, activeItemsPerPage]);
|
|
2325
|
+
const paginatedData = useMemo4(() => {
|
|
2326
|
+
if (!data || data.length === 0) return [];
|
|
2327
|
+
const startIndex = (currentPage - 1) * activeItemsPerPage;
|
|
2328
|
+
const endIndex = startIndex + activeItemsPerPage;
|
|
2329
|
+
return data.slice(startIndex, endIndex);
|
|
2330
|
+
}, [data, currentPage, activeItemsPerPage]);
|
|
2331
|
+
useEffect6(() => {
|
|
2332
|
+
if (!isControlled && currentPage > calculatedTotalPages && calculatedTotalPages > 0) {
|
|
2333
|
+
setInternalCurrentPage(1);
|
|
2334
|
+
}
|
|
2335
|
+
}, [calculatedTotalPages, isControlled, currentPage]);
|
|
2336
|
+
const getPageNumbers = () => {
|
|
2337
|
+
const pages = [];
|
|
2338
|
+
const maxVisible = 5;
|
|
2339
|
+
let startPage = Math.max(1, currentPage - Math.floor(maxVisible / 2));
|
|
2340
|
+
let endPage = Math.min(calculatedTotalPages, startPage + maxVisible - 1);
|
|
2341
|
+
if (endPage - startPage < maxVisible - 1) {
|
|
2342
|
+
startPage = Math.max(1, endPage - maxVisible + 1);
|
|
2343
|
+
}
|
|
2344
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
2345
|
+
pages.push(i);
|
|
2346
|
+
}
|
|
2347
|
+
return pages;
|
|
2348
|
+
};
|
|
2349
|
+
const handlePageChange = (page) => {
|
|
2350
|
+
if (page >= 1 && page <= calculatedTotalPages) {
|
|
2351
|
+
if (isControlled && controlledOnPageChange) {
|
|
2352
|
+
controlledOnPageChange(page);
|
|
2353
|
+
} else if (legacyOnPageChange) {
|
|
2354
|
+
legacyOnPageChange(page);
|
|
2355
|
+
} else {
|
|
2356
|
+
setInternalCurrentPage(page);
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2360
|
+
const startItem = totalItems !== void 0 ? (currentPage - 1) * activeItemsPerPage + 1 : null;
|
|
2361
|
+
const endItem = totalItems !== void 0 ? Math.min(currentPage * activeItemsPerPage, totalItems) : null;
|
|
2362
|
+
const renderContent = () => {
|
|
2363
|
+
if (Component) {
|
|
2364
|
+
if (React20.isValidElement(Component)) {
|
|
2365
|
+
const ComponentType = Component.type;
|
|
2366
|
+
const elementProps = Component.props;
|
|
2367
|
+
if (isTable) {
|
|
2368
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2369
|
+
CustomTable,
|
|
2370
|
+
{
|
|
2371
|
+
tableHeader,
|
|
2372
|
+
isHideCheckbox,
|
|
2373
|
+
id: `${id}-custom-table-1`
|
|
2374
|
+
},
|
|
2375
|
+
data.map((item, index) => {
|
|
2376
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2377
|
+
ComponentType,
|
|
2378
|
+
{
|
|
2379
|
+
key: item.id || item._id || index,
|
|
2380
|
+
data: item,
|
|
2381
|
+
...elementProps,
|
|
2382
|
+
...componentProps,
|
|
2383
|
+
...restProps,
|
|
2384
|
+
id: `${id}-component-type-1-${index}`
|
|
2385
|
+
}
|
|
2386
|
+
);
|
|
2387
|
+
})
|
|
2388
|
+
);
|
|
2389
|
+
} else {
|
|
2390
|
+
if (isTable) {
|
|
2391
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2392
|
+
CustomTable,
|
|
2393
|
+
{
|
|
2394
|
+
tableHeader,
|
|
2395
|
+
isHideCheckbox,
|
|
2396
|
+
id: `${id}-custom-table-2`
|
|
2397
|
+
},
|
|
2398
|
+
paginatedData.map((item, index) => {
|
|
2399
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2400
|
+
ComponentType,
|
|
2401
|
+
{
|
|
2402
|
+
key: item.id || item._id || index,
|
|
2403
|
+
data: item,
|
|
2404
|
+
...elementProps,
|
|
2405
|
+
...componentProps,
|
|
2406
|
+
...restProps,
|
|
2407
|
+
id: `${id}-component-type-2-${index}`
|
|
2408
|
+
}
|
|
2409
|
+
);
|
|
2410
|
+
})
|
|
2411
|
+
);
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
} else {
|
|
2415
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2416
|
+
CustomTable,
|
|
2417
|
+
{
|
|
2418
|
+
tableHeader,
|
|
2419
|
+
isHideCheckbox,
|
|
2420
|
+
id: `${id}-custom-table-3`
|
|
2421
|
+
},
|
|
2422
|
+
paginatedData.map((item, index) => {
|
|
2423
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2424
|
+
Component,
|
|
2425
|
+
{
|
|
2426
|
+
key: item.id || item._id || index,
|
|
2427
|
+
data: item,
|
|
2428
|
+
...componentProps,
|
|
2429
|
+
...restProps,
|
|
2430
|
+
id: `${id}-component-1-${index}`
|
|
2431
|
+
}
|
|
2432
|
+
);
|
|
2433
|
+
})
|
|
2434
|
+
);
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
return null;
|
|
2438
|
+
};
|
|
2439
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(React20.Fragment, null, renderContent()), /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col sm:flex-row justify-between items-center gap-4 px-4 py-3 border-t border-[#e5e5e5] dark:border-[#303036] bg-white dark:bg-[#18181b] z-10", id: `${id}-div-1` }, totalItems !== void 0 && /* @__PURE__ */ React20.createElement("div", { className: "text-sm text-[#737373] dark:text-white", id: `${id}-div-2` }, "Showing ", startItem, " to ", endItem, " of ", totalItems, " entries"), /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-2", id: `${id}-div-3` }, /* @__PURE__ */ React20.createElement(
|
|
2440
|
+
"button",
|
|
2441
|
+
{
|
|
2442
|
+
onClick: () => handlePageChange(1),
|
|
2443
|
+
disabled: currentPage === 1,
|
|
2444
|
+
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === 1 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
2445
|
+
title: "First page",
|
|
2446
|
+
id: `${id}-button-1`
|
|
2447
|
+
},
|
|
2448
|
+
/* @__PURE__ */ React20.createElement(ChevronsLeft, { size: 16 })
|
|
2449
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2450
|
+
"button",
|
|
2451
|
+
{
|
|
2452
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
2453
|
+
disabled: currentPage === 1,
|
|
2454
|
+
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === 1 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
2455
|
+
title: "Previous page",
|
|
2456
|
+
id: `${id}-button-2`
|
|
2457
|
+
},
|
|
2458
|
+
/* @__PURE__ */ React20.createElement(ChevronLeft, { size: 16 })
|
|
2459
|
+
), getPageNumbers().map((pageNum) => /* @__PURE__ */ React20.createElement(
|
|
2460
|
+
"button",
|
|
2461
|
+
{
|
|
2462
|
+
key: pageNum,
|
|
2463
|
+
onClick: () => handlePageChange(pageNum),
|
|
2464
|
+
className: `flex items-center justify-center min-w-9 h-9 px-3 cursor-pointer rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
2465
|
+
id: `${id}-button-3`
|
|
2466
|
+
},
|
|
2467
|
+
pageNum
|
|
2468
|
+
)), /* @__PURE__ */ React20.createElement(
|
|
2469
|
+
"button",
|
|
2470
|
+
{
|
|
2471
|
+
onClick: () => handlePageChange(currentPage + 1),
|
|
2472
|
+
disabled: currentPage === calculatedTotalPages || calculatedTotalPages === 0,
|
|
2473
|
+
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === calculatedTotalPages || calculatedTotalPages === 0 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
2474
|
+
title: "Next page",
|
|
2475
|
+
id: `${id}-button-4`
|
|
2476
|
+
},
|
|
2477
|
+
/* @__PURE__ */ React20.createElement(ChevronRight, { size: 16 })
|
|
2478
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2479
|
+
"button",
|
|
2480
|
+
{
|
|
2481
|
+
onClick: () => handlePageChange(calculatedTotalPages),
|
|
2482
|
+
disabled: currentPage === calculatedTotalPages || calculatedTotalPages === 0,
|
|
2483
|
+
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === calculatedTotalPages || calculatedTotalPages === 0 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
2484
|
+
title: "Last page",
|
|
2485
|
+
id: `${id}-button-5`
|
|
2486
|
+
},
|
|
2487
|
+
/* @__PURE__ */ React20.createElement(ChevronsRight, { size: 16 })
|
|
2488
|
+
))));
|
|
2489
|
+
};
|
|
2490
|
+
export {
|
|
2491
|
+
AppSideBar,
|
|
2492
|
+
Calendar,
|
|
2493
|
+
Chip,
|
|
2494
|
+
CustomAutocomplete,
|
|
2495
|
+
CustomButton,
|
|
2496
|
+
CustomCheckbox,
|
|
2497
|
+
CustomInput,
|
|
2498
|
+
CustomSearch,
|
|
2499
|
+
CustomSelect,
|
|
2500
|
+
CustomSwitch,
|
|
2501
|
+
CustomTable,
|
|
2502
|
+
CustomTextarea,
|
|
2503
|
+
CustomUpload,
|
|
2504
|
+
Dropdown,
|
|
2505
|
+
Pagination,
|
|
2506
|
+
ProgressBar,
|
|
2507
|
+
RightSheet
|
|
2508
|
+
};
|