jett.admin.npmpackage 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1111 -1114
- package/dist/index.js +884 -838
- package/dist/index.mjs +849 -789
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,838 +1,884 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/index.js
|
|
30
|
-
var index_exports = {};
|
|
31
|
-
__export(index_exports, {
|
|
32
|
-
AppSideBar: () => AppSideBar,
|
|
33
|
-
Chip: () => Chip,
|
|
34
|
-
CustomAutocomplete: () => CustomAutocomplete,
|
|
35
|
-
CustomButton: () => CustomButton,
|
|
36
|
-
CustomCheckbox: () => CustomCheckbox,
|
|
37
|
-
CustomInput: () => CustomInput,
|
|
38
|
-
CustomSearch: () => CustomSearch,
|
|
39
|
-
CustomSelect: () => CustomSelect,
|
|
40
|
-
CustomSwitch: () => CustomSwitch,
|
|
41
|
-
CustomTable: () => CustomTable,
|
|
42
|
-
CustomTextarea: () => CustomTextarea,
|
|
43
|
-
CustomUpload: () => CustomUpload,
|
|
44
|
-
ProgressBar: () => ProgressBar,
|
|
45
|
-
RightSheet: () => RightSheet
|
|
46
|
-
});
|
|
47
|
-
module.exports = __toCommonJS(index_exports);
|
|
48
|
-
|
|
49
|
-
// src/utils/cn.ts
|
|
50
|
-
var import_clsx = require("clsx");
|
|
51
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
52
|
-
function cn(...inputs) {
|
|
53
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/Button.jsx
|
|
57
|
-
var import_react = __toESM(require("react"));
|
|
58
|
-
var variantStyles = {
|
|
59
|
-
PRIMARY: "bg-white",
|
|
60
|
-
SECONDARY: "bg-black text-white",
|
|
61
|
-
DEFAULT: "bg-white text-black hover:bg-gray-100",
|
|
62
|
-
DANGER: "bg-[#ef4444] text-white"
|
|
63
|
-
};
|
|
64
|
-
var CustomButton = ({
|
|
65
|
-
variant,
|
|
66
|
-
children,
|
|
67
|
-
className,
|
|
68
|
-
onClick,
|
|
69
|
-
disabled = false,
|
|
70
|
-
icon
|
|
71
|
-
}) => {
|
|
72
|
-
console.log(disabled);
|
|
73
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
className: cn(
|
|
77
|
-
`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`,
|
|
78
|
-
variantStyles[variant],
|
|
79
|
-
className
|
|
80
|
-
),
|
|
81
|
-
onClick
|
|
82
|
-
},
|
|
83
|
-
icon && /* @__PURE__ */ import_react.default.createElement("div", null, icon),
|
|
84
|
-
children
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// src/inputs/Autocomplete.jsx
|
|
89
|
-
var import_react2 = __toESM(require("react"));
|
|
90
|
-
var import_lucide_react = require("lucide-react");
|
|
91
|
-
var CustomAutocomplete = ({
|
|
92
|
-
label,
|
|
93
|
-
value,
|
|
94
|
-
onChange,
|
|
95
|
-
options,
|
|
96
|
-
placeholder = "Search & select...",
|
|
97
|
-
isRequired = false,
|
|
98
|
-
error,
|
|
99
|
-
heading,
|
|
100
|
-
disabled = false
|
|
101
|
-
}) => {
|
|
102
|
-
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
103
|
-
const [search, setSearch] = (0, import_react2.useState)("");
|
|
104
|
-
const wrapperRef = (0, import_react2.useRef)(null);
|
|
105
|
-
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
106
|
-
const handleBlur = (e) => {
|
|
107
|
-
var _a;
|
|
108
|
-
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
109
|
-
setOpen(false);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const filteredOptions = options.filter(
|
|
113
|
-
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
114
|
-
);
|
|
115
|
-
const toggleValue = (val) => {
|
|
116
|
-
if (value.includes(val)) {
|
|
117
|
-
onChange(value.filter((v) => v !== val));
|
|
118
|
-
} else {
|
|
119
|
-
onChange([...value, val]);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
className: "flex flex-col w-full relative",
|
|
126
|
-
ref: wrapperRef,
|
|
127
|
-
tabIndex: disabled ? -1 : 0,
|
|
128
|
-
onBlur: handleBlur
|
|
129
|
-
},
|
|
130
|
-
heading && /* @__PURE__ */ import_react2.default.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1" }, heading),
|
|
131
|
-
label && /* @__PURE__ */ import_react2.default.createElement(
|
|
132
|
-
"label",
|
|
133
|
-
{
|
|
134
|
-
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black"}`
|
|
135
|
-
},
|
|
136
|
-
label,
|
|
137
|
-
" ",
|
|
138
|
-
isRequired && /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-red-500" }, "*")
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
141
|
-
"div",
|
|
142
|
-
{
|
|
143
|
-
onClick: () => {
|
|
144
|
-
if (!disabled) setOpen((prev) => !prev);
|
|
145
|
-
},
|
|
146
|
-
className: `flex justify-between items-center flex-wrap gap-1 rounded-md px-3 py-2 text-sm transition border h-auto min-h-10
|
|
147
|
-
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
148
|
-
${error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)] hover:border-gray-400"}
|
|
149
|
-
`
|
|
150
|
-
},
|
|
151
|
-
/* @__PURE__ */ import_react2.default.createElement("div", { className: "flex flex-wrap gap-1 flex-1" }, selectedOptions.length > 0 ? selectedOptions.map((opt) => /* @__PURE__ */ import_react2.default.createElement(
|
|
152
|
-
"span",
|
|
153
|
-
{
|
|
154
|
-
key: opt.value,
|
|
155
|
-
className: "bg-gray-100 border border-gray-300 px-2 py-0.5 rounded text-xs flex items-center gap-1"
|
|
156
|
-
},
|
|
157
|
-
opt.label,
|
|
158
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
159
|
-
"button",
|
|
160
|
-
{
|
|
161
|
-
onClick: (e) => {
|
|
162
|
-
e.stopPropagation();
|
|
163
|
-
toggleValue(opt.value);
|
|
164
|
-
},
|
|
165
|
-
className: "text-gray-500 hover:text-gray-700"
|
|
166
|
-
},
|
|
167
|
-
"\u2715"
|
|
168
|
-
)
|
|
169
|
-
)) : /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-gray-400" }, placeholder)),
|
|
170
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
171
|
-
import_lucide_react.ChevronDown,
|
|
172
|
-
{
|
|
173
|
-
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
),
|
|
177
|
-
!disabled && open && /* @__PURE__ */ import_react2.default.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" }, /* @__PURE__ */ import_react2.default.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ import_react2.default.createElement(import_lucide_react.Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ import_react2.default.createElement(
|
|
178
|
-
"input",
|
|
179
|
-
{
|
|
180
|
-
type: "text",
|
|
181
|
-
value: search,
|
|
182
|
-
onChange: (e) => setSearch(e.target.value),
|
|
183
|
-
placeholder: "Search...",
|
|
184
|
-
className: "flex-1 text-sm focus:outline-none"
|
|
185
|
-
}
|
|
186
|
-
)), /* @__PURE__ */ import_react2.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
187
|
-
const selected = value.includes(opt.value);
|
|
188
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
|
189
|
-
"li",
|
|
190
|
-
{
|
|
191
|
-
key: opt.value,
|
|
192
|
-
onClick: () => toggleValue(opt.value),
|
|
193
|
-
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 ${selected ? "bg-gray-50 font-medium" : ""}`
|
|
194
|
-
},
|
|
195
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
196
|
-
"span",
|
|
197
|
-
{
|
|
198
|
-
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"}`
|
|
199
|
-
},
|
|
200
|
-
selected && /* @__PURE__ */ import_react2.default.createElement(import_lucide_react.Check, { size: 14 })
|
|
201
|
-
),
|
|
202
|
-
opt.label
|
|
203
|
-
);
|
|
204
|
-
}) : /* @__PURE__ */ import_react2.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400" }, "No results found")))
|
|
205
|
-
);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
// src/inputs/Checkbox.jsx
|
|
209
|
-
var import_react3 = __toESM(require("react"));
|
|
210
|
-
var CustomCheckbox = ({ onChange, checked }) => {
|
|
211
|
-
const handleChange = (e) => {
|
|
212
|
-
onChange(e.target.checked);
|
|
213
|
-
};
|
|
214
|
-
return /* @__PURE__ */ import_react3.default.createElement("label", { className: "inline-flex items-center cursor-pointer select-none" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
215
|
-
"input",
|
|
216
|
-
{
|
|
217
|
-
type: "checkbox",
|
|
218
|
-
checked,
|
|
219
|
-
onChange: handleChange,
|
|
220
|
-
className: "peer hidden"
|
|
221
|
-
}
|
|
222
|
-
), /* @__PURE__ */ import_react3.default.createElement(
|
|
223
|
-
"span",
|
|
224
|
-
{
|
|
225
|
-
className: "\r\n w-4 h-4 flex items-center justify-center border-2 border-gray-400 rounded \r\n peer-checked:bg-black peer-checked:border-black\r\n transition-colors\r\n "
|
|
226
|
-
},
|
|
227
|
-
checked && /* @__PURE__ */ import_react3.default.createElement(
|
|
228
|
-
"svg",
|
|
229
|
-
{
|
|
230
|
-
className: "w-4 h-4 text-white",
|
|
231
|
-
fill: "none",
|
|
232
|
-
stroke: "currentColor",
|
|
233
|
-
strokeWidth: "3",
|
|
234
|
-
viewBox: "0 0 24 24"
|
|
235
|
-
},
|
|
236
|
-
/* @__PURE__ */ import_react3.default.createElement("path", { d: "M5 13l4 4L19 7" })
|
|
237
|
-
)
|
|
238
|
-
));
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
// src/inputs/Chip.jsx
|
|
242
|
-
var import_react4 = __toESM(require("react"));
|
|
243
|
-
var VARIANTS = {
|
|
244
|
-
PRIMARY: "bg-gray-100 text-black",
|
|
245
|
-
GREEN: "bg-green-100 text-green-800",
|
|
246
|
-
RED: "bg-red-100 text-red-800",
|
|
247
|
-
YELLOW: "bg-yellow-100 text-yellow-800"
|
|
248
|
-
};
|
|
249
|
-
var Chip = ({ label, variant }) => {
|
|
250
|
-
return /* @__PURE__ */ import_react4.default.createElement(
|
|
251
|
-
"div",
|
|
252
|
-
{
|
|
253
|
-
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`
|
|
254
|
-
},
|
|
255
|
-
label
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
// src/inputs/CustomSwitch.jsx
|
|
260
|
-
var import_react5 = __toESM(require("react"));
|
|
261
|
-
var CustomSwitch = ({ checked, onChange, label, description }) => {
|
|
262
|
-
return /* @__PURE__ */ import_react5.default.createElement("div",
|
|
263
|
-
"button",
|
|
264
|
-
{
|
|
265
|
-
type: "button",
|
|
266
|
-
role: "switch",
|
|
267
|
-
"aria-checked": checked,
|
|
268
|
-
onClick: () => onChange(!checked),
|
|
269
|
-
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`
|
|
270
|
-
},
|
|
271
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
|
272
|
-
"span",
|
|
273
|
-
{
|
|
274
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`
|
|
275
|
-
}
|
|
276
|
-
)
|
|
277
|
-
), /* @__PURE__ */ import_react5.default.createElement("div", { className: "flex flex-col" }, label && /* @__PURE__ */ import_react5.default.createElement("h3", { className: "font-[500] text-sm text-black mb-2" }, label), description && /* @__PURE__ */ import_react5.default.createElement("p", { className: "font-[500] text-sm text-[#737373]" }, description)));
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
// src/inputs/Input.jsx
|
|
281
|
-
var import_react6 = __toESM(require("react"));
|
|
282
|
-
var CustomInput = ({
|
|
283
|
-
label,
|
|
284
|
-
isRequired,
|
|
285
|
-
value,
|
|
286
|
-
onChange,
|
|
287
|
-
placeholder,
|
|
288
|
-
disabled = false,
|
|
289
|
-
error,
|
|
290
|
-
heading
|
|
291
|
-
}) => {
|
|
292
|
-
return /* @__PURE__ */ import_react6.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, heading && /* @__PURE__ */ import_react6.default.createElement("h3", { className: "text-lg font-semibold" }, heading), /* @__PURE__ */ import_react6.default.createElement(
|
|
293
|
-
"label",
|
|
294
|
-
{
|
|
295
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`
|
|
296
|
-
},
|
|
297
|
-
label,
|
|
298
|
-
" ",
|
|
299
|
-
isRequired && /* @__PURE__ */ import_react6.default.createElement("span", { className: "text-red-500" }, "*")
|
|
300
|
-
), /* @__PURE__ */ import_react6.default.createElement(
|
|
301
|
-
"input",
|
|
302
|
-
{
|
|
303
|
-
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
304
|
-
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
305
|
-
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
306
|
-
${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%)]"}
|
|
307
|
-
`,
|
|
308
|
-
value,
|
|
309
|
-
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
310
|
-
placeholder,
|
|
311
|
-
disabled,
|
|
312
|
-
readOnly: disabled
|
|
313
|
-
}
|
|
314
|
-
));
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
// src/inputs/ProgressBar.jsx
|
|
318
|
-
var import_react7 = __toESM(require("react"));
|
|
319
|
-
var ProgressBar = ({ step, totalSteps }) => {
|
|
320
|
-
const progress = step / totalSteps * 100;
|
|
321
|
-
return /* @__PURE__ */ import_react7.default.createElement("div", { className: "mb-6" }, /* @__PURE__ */ import_react7.default.createElement("p", { className: "text-gray-600 text-sm mb-2" }, "Step ", step, " of ", totalSteps), /* @__PURE__ */ import_react7.default.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ import_react7.default.createElement(
|
|
322
|
-
"div",
|
|
323
|
-
{
|
|
324
|
-
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
325
|
-
style: { width: `${progress}%` }
|
|
326
|
-
}
|
|
327
|
-
)));
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
// src/inputs/Search.jsx
|
|
331
|
-
var import_react8 = __toESM(require("react"));
|
|
332
|
-
var import_lucide_react2 = require("lucide-react");
|
|
333
|
-
var CustomSearch = ({
|
|
334
|
-
value,
|
|
335
|
-
onChange,
|
|
336
|
-
placeholder = "Search Markets..."
|
|
337
|
-
}) => {
|
|
338
|
-
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "flex items-center border bg-transparent text-[14px] border-[hsl(0_0%_89.8%)] \r\n rounded-md h-10 px-2 w-full focus-within:outline-2 focus-within:outline-black focus-within:outline-offset-2" }, /* @__PURE__ */ import_react8.default.createElement(import_lucide_react2.Search, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ import_react8.default.createElement(
|
|
339
|
-
"input",
|
|
340
|
-
{
|
|
341
|
-
type: "text",
|
|
342
|
-
value,
|
|
343
|
-
onChange,
|
|
344
|
-
placeholder,
|
|
345
|
-
className: "bg-transparent w-full h-full focus:outline-none"
|
|
346
|
-
}
|
|
347
|
-
));
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
// src/inputs/TextArea.jsx
|
|
351
|
-
var import_react9 = __toESM(require("react"));
|
|
352
|
-
var CustomTextarea = ({
|
|
353
|
-
label,
|
|
354
|
-
isRequired,
|
|
355
|
-
value,
|
|
356
|
-
onChange,
|
|
357
|
-
placeholder,
|
|
358
|
-
disabled = false,
|
|
359
|
-
error,
|
|
360
|
-
heading,
|
|
361
|
-
rows = 4
|
|
362
|
-
}) => {
|
|
363
|
-
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, heading && /* @__PURE__ */ import_react9.default.createElement("h3", { className: "text-lg font-semibold" }, heading), /* @__PURE__ */ import_react9.default.createElement(
|
|
364
|
-
"label",
|
|
365
|
-
{
|
|
366
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`
|
|
367
|
-
},
|
|
368
|
-
label,
|
|
369
|
-
" ",
|
|
370
|
-
isRequired && /* @__PURE__ */ import_react9.default.createElement("span", { className: "text-red-500" }, "*")
|
|
371
|
-
), /* @__PURE__ */ import_react9.default.createElement(
|
|
372
|
-
"textarea",
|
|
373
|
-
{
|
|
374
|
-
rows,
|
|
375
|
-
className: `border rounded-md px-4 py-2 w-full text-[14px]
|
|
376
|
-
focus:outline-2 focus:outline-black focus:outline-offset-2
|
|
377
|
-
focus:ring-0 focus:shadow-none focus:border-black
|
|
378
|
-
${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%)]"}
|
|
379
|
-
`,
|
|
380
|
-
value,
|
|
381
|
-
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
382
|
-
placeholder,
|
|
383
|
-
disabled,
|
|
384
|
-
readOnly: disabled
|
|
385
|
-
}
|
|
386
|
-
));
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
// src/inputs/Upload.jsx
|
|
390
|
-
var import_react10 = __toESM(require("react"));
|
|
391
|
-
var import_lucide_react3 = require("lucide-react");
|
|
392
|
-
var CustomUpload = ({
|
|
393
|
-
label = "Supporting documents",
|
|
394
|
-
description = "Drop items here or Browse Files",
|
|
395
|
-
accept = ".pdf,.jpg,.jpeg,.png",
|
|
396
|
-
maxSizeMB = 5,
|
|
397
|
-
onChange,
|
|
398
|
-
error,
|
|
399
|
-
value
|
|
400
|
-
}) => {
|
|
401
|
-
const inputRef = (0, import_react10.useRef)(null);
|
|
402
|
-
const handleFileSelect = (files) => {
|
|
403
|
-
if (!files || files.length === 0) return;
|
|
404
|
-
const selectedFile = files[0];
|
|
405
|
-
if (selectedFile.size > maxSizeMB * 1024 * 1024) {
|
|
406
|
-
alert(`File size must be less than ${maxSizeMB} MB`);
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
onChange == null ? void 0 : onChange(selectedFile);
|
|
410
|
-
};
|
|
411
|
-
return /* @__PURE__ */ import_react10.default.createElement("div", { className: "flex flex-col gap-2 w-full" }, label && /* @__PURE__ */ import_react10.default.createElement("label", { className: "text-sm font-medium" }, label), /* @__PURE__ */ import_react10.default.createElement(
|
|
412
|
-
"div",
|
|
413
|
-
{
|
|
414
|
-
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
415
|
-
${error ? "border-red-500 bg-red-50" : "border-gray-300 hover:border-gray-400 bg-gray-50"}`,
|
|
416
|
-
onClick: () => {
|
|
417
|
-
var _a;
|
|
418
|
-
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
419
|
-
},
|
|
420
|
-
onDragOver: (e) => e.preventDefault(),
|
|
421
|
-
onDrop: (e) => {
|
|
422
|
-
e.preventDefault();
|
|
423
|
-
handleFileSelect(e.dataTransfer.files);
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
/* @__PURE__ */ import_react10.default.createElement(import_lucide_react3.Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
427
|
-
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-sm text-gray-700" }, description),
|
|
428
|
-
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
429
|
-
/* @__PURE__ */ import_react10.default.createElement(
|
|
430
|
-
"input",
|
|
431
|
-
{
|
|
432
|
-
ref: inputRef,
|
|
433
|
-
type: "file",
|
|
434
|
-
accept,
|
|
435
|
-
className: "hidden",
|
|
436
|
-
onChange: (e) => handleFileSelect(e.target.files)
|
|
437
|
-
}
|
|
438
|
-
)
|
|
439
|
-
), value && /* @__PURE__ */ import_react10.default.createElement("span", { className: "text-sm truncate text-gray-500" }, "Selected: ", value.name), error && /* @__PURE__ */ import_react10.default.createElement("p", { className: "text-xs text-red-500" }, error));
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
// src/sideBar/SideBar.jsx
|
|
443
|
-
var import_lucide_react5 = require("lucide-react");
|
|
444
|
-
var import_react11 = __toESM(require("react"));
|
|
445
|
-
|
|
446
|
-
// ConstantUI.js
|
|
447
|
-
var import_lucide_react4 = require("lucide-react");
|
|
448
|
-
var navItemsConstant = [
|
|
449
|
-
{
|
|
450
|
-
Icon: import_lucide_react4.Home,
|
|
451
|
-
label: "Home",
|
|
452
|
-
onClick: () => {
|
|
453
|
-
window.location.href = "/";
|
|
454
|
-
},
|
|
455
|
-
isDropDown: false
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
Icon: import_lucide_react4.Handshake,
|
|
459
|
-
label: "Supplier Ecosystem",
|
|
460
|
-
onClick: () => {
|
|
461
|
-
},
|
|
462
|
-
isDropDown: true,
|
|
463
|
-
options: [
|
|
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
|
-
label: "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.js
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
AppSideBar: () => AppSideBar,
|
|
33
|
+
Chip: () => Chip,
|
|
34
|
+
CustomAutocomplete: () => CustomAutocomplete,
|
|
35
|
+
CustomButton: () => CustomButton,
|
|
36
|
+
CustomCheckbox: () => CustomCheckbox,
|
|
37
|
+
CustomInput: () => CustomInput,
|
|
38
|
+
CustomSearch: () => CustomSearch,
|
|
39
|
+
CustomSelect: () => CustomSelect,
|
|
40
|
+
CustomSwitch: () => CustomSwitch,
|
|
41
|
+
CustomTable: () => CustomTable,
|
|
42
|
+
CustomTextarea: () => CustomTextarea,
|
|
43
|
+
CustomUpload: () => CustomUpload,
|
|
44
|
+
ProgressBar: () => ProgressBar,
|
|
45
|
+
RightSheet: () => RightSheet
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(index_exports);
|
|
48
|
+
|
|
49
|
+
// src/utils/cn.ts
|
|
50
|
+
var import_clsx = require("clsx");
|
|
51
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
52
|
+
function cn(...inputs) {
|
|
53
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/Button.jsx
|
|
57
|
+
var import_react = __toESM(require("react"));
|
|
58
|
+
var variantStyles = {
|
|
59
|
+
PRIMARY: "bg-white",
|
|
60
|
+
SECONDARY: "bg-black text-white",
|
|
61
|
+
DEFAULT: "bg-white text-black hover:bg-gray-100",
|
|
62
|
+
DANGER: "bg-[#ef4444] text-white"
|
|
63
|
+
};
|
|
64
|
+
var CustomButton = ({
|
|
65
|
+
variant,
|
|
66
|
+
children,
|
|
67
|
+
className,
|
|
68
|
+
onClick,
|
|
69
|
+
disabled = false,
|
|
70
|
+
icon
|
|
71
|
+
}) => {
|
|
72
|
+
console.log(disabled);
|
|
73
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: cn(
|
|
77
|
+
`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`,
|
|
78
|
+
variantStyles[variant],
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
onClick
|
|
82
|
+
},
|
|
83
|
+
icon && /* @__PURE__ */ import_react.default.createElement("div", null, icon),
|
|
84
|
+
children
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/inputs/Autocomplete.jsx
|
|
89
|
+
var import_react2 = __toESM(require("react"));
|
|
90
|
+
var import_lucide_react = require("lucide-react");
|
|
91
|
+
var CustomAutocomplete = ({
|
|
92
|
+
label,
|
|
93
|
+
value,
|
|
94
|
+
onChange,
|
|
95
|
+
options,
|
|
96
|
+
placeholder = "Search & select...",
|
|
97
|
+
isRequired = false,
|
|
98
|
+
error,
|
|
99
|
+
heading,
|
|
100
|
+
disabled = false
|
|
101
|
+
}) => {
|
|
102
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
103
|
+
const [search, setSearch] = (0, import_react2.useState)("");
|
|
104
|
+
const wrapperRef = (0, import_react2.useRef)(null);
|
|
105
|
+
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
106
|
+
const handleBlur = (e) => {
|
|
107
|
+
var _a;
|
|
108
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
109
|
+
setOpen(false);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const filteredOptions = options.filter(
|
|
113
|
+
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
114
|
+
);
|
|
115
|
+
const toggleValue = (val) => {
|
|
116
|
+
if (value.includes(val)) {
|
|
117
|
+
onChange(value.filter((v) => v !== val));
|
|
118
|
+
} else {
|
|
119
|
+
onChange([...value, val]);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: "flex flex-col w-full relative",
|
|
126
|
+
ref: wrapperRef,
|
|
127
|
+
tabIndex: disabled ? -1 : 0,
|
|
128
|
+
onBlur: handleBlur
|
|
129
|
+
},
|
|
130
|
+
heading && /* @__PURE__ */ import_react2.default.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1" }, heading),
|
|
131
|
+
label && /* @__PURE__ */ import_react2.default.createElement(
|
|
132
|
+
"label",
|
|
133
|
+
{
|
|
134
|
+
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black"}`
|
|
135
|
+
},
|
|
136
|
+
label,
|
|
137
|
+
" ",
|
|
138
|
+
isRequired && /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-red-500" }, "*")
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
onClick: () => {
|
|
144
|
+
if (!disabled) setOpen((prev) => !prev);
|
|
145
|
+
},
|
|
146
|
+
className: `flex justify-between items-center flex-wrap gap-1 rounded-md px-3 py-2 text-sm transition border h-auto min-h-10
|
|
147
|
+
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
148
|
+
${error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)] hover:border-gray-400"}
|
|
149
|
+
`
|
|
150
|
+
},
|
|
151
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "flex flex-wrap gap-1 flex-1" }, selectedOptions.length > 0 ? selectedOptions.map((opt) => /* @__PURE__ */ import_react2.default.createElement(
|
|
152
|
+
"span",
|
|
153
|
+
{
|
|
154
|
+
key: opt.value,
|
|
155
|
+
className: "bg-gray-100 border border-gray-300 px-2 py-0.5 rounded text-xs flex items-center gap-1"
|
|
156
|
+
},
|
|
157
|
+
opt.label,
|
|
158
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
159
|
+
"button",
|
|
160
|
+
{
|
|
161
|
+
onClick: (e) => {
|
|
162
|
+
e.stopPropagation();
|
|
163
|
+
toggleValue(opt.value);
|
|
164
|
+
},
|
|
165
|
+
className: "text-gray-500 hover:text-gray-700"
|
|
166
|
+
},
|
|
167
|
+
"\u2715"
|
|
168
|
+
)
|
|
169
|
+
)) : /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-gray-400" }, placeholder)),
|
|
170
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
171
|
+
import_lucide_react.ChevronDown,
|
|
172
|
+
{
|
|
173
|
+
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
),
|
|
177
|
+
!disabled && open && /* @__PURE__ */ import_react2.default.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" }, /* @__PURE__ */ import_react2.default.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ import_react2.default.createElement(import_lucide_react.Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ import_react2.default.createElement(
|
|
178
|
+
"input",
|
|
179
|
+
{
|
|
180
|
+
type: "text",
|
|
181
|
+
value: search,
|
|
182
|
+
onChange: (e) => setSearch(e.target.value),
|
|
183
|
+
placeholder: "Search...",
|
|
184
|
+
className: "flex-1 text-sm focus:outline-none"
|
|
185
|
+
}
|
|
186
|
+
)), /* @__PURE__ */ import_react2.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
187
|
+
const selected = value.includes(opt.value);
|
|
188
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
189
|
+
"li",
|
|
190
|
+
{
|
|
191
|
+
key: opt.value,
|
|
192
|
+
onClick: () => toggleValue(opt.value),
|
|
193
|
+
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 ${selected ? "bg-gray-50 font-medium" : ""}`
|
|
194
|
+
},
|
|
195
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
196
|
+
"span",
|
|
197
|
+
{
|
|
198
|
+
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"}`
|
|
199
|
+
},
|
|
200
|
+
selected && /* @__PURE__ */ import_react2.default.createElement(import_lucide_react.Check, { size: 14 })
|
|
201
|
+
),
|
|
202
|
+
opt.label
|
|
203
|
+
);
|
|
204
|
+
}) : /* @__PURE__ */ import_react2.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400" }, "No results found")))
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// src/inputs/Checkbox.jsx
|
|
209
|
+
var import_react3 = __toESM(require("react"));
|
|
210
|
+
var CustomCheckbox = ({ onChange, checked }) => {
|
|
211
|
+
const handleChange = (e) => {
|
|
212
|
+
onChange(e.target.checked);
|
|
213
|
+
};
|
|
214
|
+
return /* @__PURE__ */ import_react3.default.createElement("label", { className: "inline-flex items-center cursor-pointer select-none" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
215
|
+
"input",
|
|
216
|
+
{
|
|
217
|
+
type: "checkbox",
|
|
218
|
+
checked,
|
|
219
|
+
onChange: handleChange,
|
|
220
|
+
className: "peer hidden"
|
|
221
|
+
}
|
|
222
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
223
|
+
"span",
|
|
224
|
+
{
|
|
225
|
+
className: "\r\n w-4 h-4 flex items-center justify-center border-2 border-gray-400 rounded \r\n peer-checked:bg-black peer-checked:border-black\r\n transition-colors\r\n "
|
|
226
|
+
},
|
|
227
|
+
checked && /* @__PURE__ */ import_react3.default.createElement(
|
|
228
|
+
"svg",
|
|
229
|
+
{
|
|
230
|
+
className: "w-4 h-4 text-white",
|
|
231
|
+
fill: "none",
|
|
232
|
+
stroke: "currentColor",
|
|
233
|
+
strokeWidth: "3",
|
|
234
|
+
viewBox: "0 0 24 24"
|
|
235
|
+
},
|
|
236
|
+
/* @__PURE__ */ import_react3.default.createElement("path", { d: "M5 13l4 4L19 7" })
|
|
237
|
+
)
|
|
238
|
+
));
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// src/inputs/Chip.jsx
|
|
242
|
+
var import_react4 = __toESM(require("react"));
|
|
243
|
+
var VARIANTS = {
|
|
244
|
+
PRIMARY: "bg-gray-100 text-black",
|
|
245
|
+
GREEN: "bg-green-100 text-green-800",
|
|
246
|
+
RED: "bg-red-100 text-red-800",
|
|
247
|
+
YELLOW: "bg-yellow-100 text-yellow-800"
|
|
248
|
+
};
|
|
249
|
+
var Chip = ({ label, variant }) => {
|
|
250
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`
|
|
254
|
+
},
|
|
255
|
+
label
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// src/inputs/CustomSwitch.jsx
|
|
260
|
+
var import_react5 = __toESM(require("react"));
|
|
261
|
+
var CustomSwitch = ({ checked, onChange, label, description }) => {
|
|
262
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement(
|
|
263
|
+
"button",
|
|
264
|
+
{
|
|
265
|
+
type: "button",
|
|
266
|
+
role: "switch",
|
|
267
|
+
"aria-checked": checked,
|
|
268
|
+
onClick: () => onChange(!checked),
|
|
269
|
+
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`
|
|
270
|
+
},
|
|
271
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
272
|
+
"span",
|
|
273
|
+
{
|
|
274
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
), /* @__PURE__ */ import_react5.default.createElement("div", { className: "flex flex-col" }, label && /* @__PURE__ */ import_react5.default.createElement("h3", { className: "font-[500] text-sm text-black mb-2" }, label), description && /* @__PURE__ */ import_react5.default.createElement("p", { className: "font-[500] text-sm text-[#737373]" }, description)));
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// src/inputs/Input.jsx
|
|
281
|
+
var import_react6 = __toESM(require("react"));
|
|
282
|
+
var CustomInput = ({
|
|
283
|
+
label,
|
|
284
|
+
isRequired,
|
|
285
|
+
value,
|
|
286
|
+
onChange,
|
|
287
|
+
placeholder,
|
|
288
|
+
disabled = false,
|
|
289
|
+
error,
|
|
290
|
+
heading
|
|
291
|
+
}) => {
|
|
292
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, heading && /* @__PURE__ */ import_react6.default.createElement("h3", { className: "text-lg font-semibold" }, heading), /* @__PURE__ */ import_react6.default.createElement(
|
|
293
|
+
"label",
|
|
294
|
+
{
|
|
295
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`
|
|
296
|
+
},
|
|
297
|
+
label,
|
|
298
|
+
" ",
|
|
299
|
+
isRequired && /* @__PURE__ */ import_react6.default.createElement("span", { className: "text-red-500" }, "*")
|
|
300
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
301
|
+
"input",
|
|
302
|
+
{
|
|
303
|
+
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
304
|
+
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
305
|
+
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
306
|
+
${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%)]"}
|
|
307
|
+
`,
|
|
308
|
+
value,
|
|
309
|
+
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
310
|
+
placeholder,
|
|
311
|
+
disabled,
|
|
312
|
+
readOnly: disabled
|
|
313
|
+
}
|
|
314
|
+
));
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// src/inputs/ProgressBar.jsx
|
|
318
|
+
var import_react7 = __toESM(require("react"));
|
|
319
|
+
var ProgressBar = ({ step, totalSteps }) => {
|
|
320
|
+
const progress = step / totalSteps * 100;
|
|
321
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", { className: "mb-6" }, /* @__PURE__ */ import_react7.default.createElement("p", { className: "text-gray-600 text-sm mb-2" }, "Step ", step, " of ", totalSteps), /* @__PURE__ */ import_react7.default.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ import_react7.default.createElement(
|
|
322
|
+
"div",
|
|
323
|
+
{
|
|
324
|
+
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
325
|
+
style: { width: `${progress}%` }
|
|
326
|
+
}
|
|
327
|
+
)));
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
// src/inputs/Search.jsx
|
|
331
|
+
var import_react8 = __toESM(require("react"));
|
|
332
|
+
var import_lucide_react2 = require("lucide-react");
|
|
333
|
+
var CustomSearch = ({
|
|
334
|
+
value,
|
|
335
|
+
onChange,
|
|
336
|
+
placeholder = "Search Markets..."
|
|
337
|
+
}) => {
|
|
338
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "flex items-center border bg-transparent text-[14px] border-[hsl(0_0%_89.8%)] \r\n rounded-md h-10 px-2 w-full focus-within:outline-2 focus-within:outline-black focus-within:outline-offset-2" }, /* @__PURE__ */ import_react8.default.createElement(import_lucide_react2.Search, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ import_react8.default.createElement(
|
|
339
|
+
"input",
|
|
340
|
+
{
|
|
341
|
+
type: "text",
|
|
342
|
+
value,
|
|
343
|
+
onChange,
|
|
344
|
+
placeholder,
|
|
345
|
+
className: "bg-transparent w-full h-full focus:outline-none"
|
|
346
|
+
}
|
|
347
|
+
));
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
// src/inputs/TextArea.jsx
|
|
351
|
+
var import_react9 = __toESM(require("react"));
|
|
352
|
+
var CustomTextarea = ({
|
|
353
|
+
label,
|
|
354
|
+
isRequired,
|
|
355
|
+
value,
|
|
356
|
+
onChange,
|
|
357
|
+
placeholder,
|
|
358
|
+
disabled = false,
|
|
359
|
+
error,
|
|
360
|
+
heading,
|
|
361
|
+
rows = 4
|
|
362
|
+
}) => {
|
|
363
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, heading && /* @__PURE__ */ import_react9.default.createElement("h3", { className: "text-lg font-semibold" }, heading), /* @__PURE__ */ import_react9.default.createElement(
|
|
364
|
+
"label",
|
|
365
|
+
{
|
|
366
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`
|
|
367
|
+
},
|
|
368
|
+
label,
|
|
369
|
+
" ",
|
|
370
|
+
isRequired && /* @__PURE__ */ import_react9.default.createElement("span", { className: "text-red-500" }, "*")
|
|
371
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
372
|
+
"textarea",
|
|
373
|
+
{
|
|
374
|
+
rows,
|
|
375
|
+
className: `border rounded-md px-4 py-2 w-full text-[14px]
|
|
376
|
+
focus:outline-2 focus:outline-black focus:outline-offset-2
|
|
377
|
+
focus:ring-0 focus:shadow-none focus:border-black
|
|
378
|
+
${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%)]"}
|
|
379
|
+
`,
|
|
380
|
+
value,
|
|
381
|
+
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
382
|
+
placeholder,
|
|
383
|
+
disabled,
|
|
384
|
+
readOnly: disabled
|
|
385
|
+
}
|
|
386
|
+
));
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
// src/inputs/Upload.jsx
|
|
390
|
+
var import_react10 = __toESM(require("react"));
|
|
391
|
+
var import_lucide_react3 = require("lucide-react");
|
|
392
|
+
var CustomUpload = ({
|
|
393
|
+
label = "Supporting documents",
|
|
394
|
+
description = "Drop items here or Browse Files",
|
|
395
|
+
accept = ".pdf,.jpg,.jpeg,.png",
|
|
396
|
+
maxSizeMB = 5,
|
|
397
|
+
onChange,
|
|
398
|
+
error,
|
|
399
|
+
value
|
|
400
|
+
}) => {
|
|
401
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
402
|
+
const handleFileSelect = (files) => {
|
|
403
|
+
if (!files || files.length === 0) return;
|
|
404
|
+
const selectedFile = files[0];
|
|
405
|
+
if (selectedFile.size > maxSizeMB * 1024 * 1024) {
|
|
406
|
+
alert(`File size must be less than ${maxSizeMB} MB`);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
onChange == null ? void 0 : onChange(selectedFile);
|
|
410
|
+
};
|
|
411
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", { className: "flex flex-col gap-2 w-full" }, label && /* @__PURE__ */ import_react10.default.createElement("label", { className: "text-sm font-medium" }, label), /* @__PURE__ */ import_react10.default.createElement(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
415
|
+
${error ? "border-red-500 bg-red-50" : "border-gray-300 hover:border-gray-400 bg-gray-50"}`,
|
|
416
|
+
onClick: () => {
|
|
417
|
+
var _a;
|
|
418
|
+
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
419
|
+
},
|
|
420
|
+
onDragOver: (e) => e.preventDefault(),
|
|
421
|
+
onDrop: (e) => {
|
|
422
|
+
e.preventDefault();
|
|
423
|
+
handleFileSelect(e.dataTransfer.files);
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
/* @__PURE__ */ import_react10.default.createElement(import_lucide_react3.Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
427
|
+
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-sm text-gray-700" }, description),
|
|
428
|
+
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
429
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
430
|
+
"input",
|
|
431
|
+
{
|
|
432
|
+
ref: inputRef,
|
|
433
|
+
type: "file",
|
|
434
|
+
accept,
|
|
435
|
+
className: "hidden",
|
|
436
|
+
onChange: (e) => handleFileSelect(e.target.files)
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
), value && /* @__PURE__ */ import_react10.default.createElement("span", { className: "text-sm truncate text-gray-500" }, "Selected: ", value.name), error && /* @__PURE__ */ import_react10.default.createElement("p", { className: "text-xs text-red-500" }, error));
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
// src/sideBar/SideBar.jsx
|
|
443
|
+
var import_lucide_react5 = require("lucide-react");
|
|
444
|
+
var import_react11 = __toESM(require("react"));
|
|
445
|
+
|
|
446
|
+
// ConstantUI.js
|
|
447
|
+
var import_lucide_react4 = require("lucide-react");
|
|
448
|
+
var navItemsConstant = [
|
|
449
|
+
{
|
|
450
|
+
Icon: import_lucide_react4.Home,
|
|
451
|
+
label: "Home",
|
|
452
|
+
onClick: () => {
|
|
453
|
+
window.location.href = "/";
|
|
454
|
+
},
|
|
455
|
+
isDropDown: false
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
Icon: import_lucide_react4.Handshake,
|
|
459
|
+
label: "Supplier Ecosystem",
|
|
460
|
+
onClick: () => {
|
|
461
|
+
},
|
|
462
|
+
isDropDown: true,
|
|
463
|
+
options: [
|
|
464
|
+
{
|
|
465
|
+
label: "Suppliers",
|
|
466
|
+
onClick: () => {
|
|
467
|
+
window.location.href = "/supplier/";
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
Icon: import_lucide_react4.Building,
|
|
474
|
+
label: "Consumer Ecosystem",
|
|
475
|
+
onClick: () => {
|
|
476
|
+
},
|
|
477
|
+
options: [
|
|
478
|
+
{
|
|
479
|
+
label: "Corporate",
|
|
480
|
+
onClick: () => {
|
|
481
|
+
window.location.href = "/corporate/";
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
label: "Trips",
|
|
486
|
+
onClick: () => {
|
|
487
|
+
window.location.href = "/trips/";
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
label: "Reports",
|
|
492
|
+
onClick: () => {
|
|
493
|
+
window.location.href = "/reports/";
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
label: "Tags",
|
|
498
|
+
onClick: () => {
|
|
499
|
+
window.location.href = "/tags/";
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
isDropDown: true
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
Icon: import_lucide_react4.Banknote,
|
|
507
|
+
label: "Finance",
|
|
508
|
+
onClick: () => {
|
|
509
|
+
},
|
|
510
|
+
isDropDown: true,
|
|
511
|
+
options: [
|
|
512
|
+
{
|
|
513
|
+
label: "Invoices",
|
|
514
|
+
onClick: () => {
|
|
515
|
+
window.location.href = "/invoices/";
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
label: "Ledger",
|
|
520
|
+
onClick: () => {
|
|
521
|
+
window.location.href = "/ledger/";
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
label: "Payments",
|
|
526
|
+
onClick: () => {
|
|
527
|
+
window.location.href = "/payments/";
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
]
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
Icon: import_lucide_react4.DollarSign,
|
|
534
|
+
label: "Revenue Management",
|
|
535
|
+
onClick: () => {
|
|
536
|
+
},
|
|
537
|
+
isDropDown: true,
|
|
538
|
+
options: [
|
|
539
|
+
{
|
|
540
|
+
label: "Pricing Policy",
|
|
541
|
+
onClick: () => {
|
|
542
|
+
window.location.href = "/pricing/";
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
label: "Offers",
|
|
547
|
+
onClick: () => {
|
|
548
|
+
window.location.href = "/offers/";
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
label: "Vouchers",
|
|
553
|
+
onClick: () => {
|
|
554
|
+
window.location.href = "https://devadmin.musafirbiz.com/vouchers/";
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
label: "Supplier Deals",
|
|
559
|
+
onClick: () => {
|
|
560
|
+
window.location.href = "/supplierdeals/";
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
label: "Subscription Plans",
|
|
565
|
+
onClick: () => {
|
|
566
|
+
window.location.href = "/subscription/";
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
]
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
Icon: import_lucide_react4.Cog,
|
|
573
|
+
label: "Settings",
|
|
574
|
+
onClick: () => {
|
|
575
|
+
},
|
|
576
|
+
isDropDown: true,
|
|
577
|
+
options: [
|
|
578
|
+
{
|
|
579
|
+
label: "Admin user Management",
|
|
580
|
+
isDropDown: true,
|
|
581
|
+
onClick: () => {
|
|
582
|
+
},
|
|
583
|
+
options: [
|
|
584
|
+
{
|
|
585
|
+
label: "Admin Users",
|
|
586
|
+
onClick: () => {
|
|
587
|
+
window.location.href = "/users/";
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
{ label: "Admin User Attributes", onClick: () => {
|
|
591
|
+
} }
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
label: "TMC Markets",
|
|
596
|
+
onClick: () => {
|
|
597
|
+
window.location.href = "/market/";
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
label: "Permissions",
|
|
602
|
+
onClick: () => {
|
|
603
|
+
window.location.href = "/permissions/";
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
label: "Report Configurations",
|
|
608
|
+
onClick: () => {
|
|
609
|
+
window.location.href = "/reports/";
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
label: "Whitelabelling",
|
|
614
|
+
onClick: () => {
|
|
615
|
+
window.location.href = "/whitelabelling/";
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
];
|
|
621
|
+
var additionalItemsConstant = [
|
|
622
|
+
{
|
|
623
|
+
Icon: import_lucide_react4.LifeBuoy,
|
|
624
|
+
label: "Help",
|
|
625
|
+
onClick: () => {
|
|
626
|
+
window.location.href = "/help";
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
];
|
|
630
|
+
|
|
631
|
+
// src/assests/logo/sidebarlogo.webp
|
|
632
|
+
var sidebarlogo_default = "./sidebarlogo-S4TNJORM.webp";
|
|
633
|
+
|
|
634
|
+
// src/sideBar/SideBar.jsx
|
|
635
|
+
var AppSideBar = ({ username, role, navItems, additionalItems, sideBarLogo }) => {
|
|
636
|
+
var _a, _b;
|
|
637
|
+
const [authData, setAuthData] = (0, import_react11.useState)(null);
|
|
638
|
+
const handleIconRotate = (e, index, additionalKey) => {
|
|
639
|
+
let dropDownIcon = e.currentTarget.children[2];
|
|
640
|
+
if (!dropDownIcon) return;
|
|
641
|
+
if (dropDownIcon.classList.contains("rotate-180")) {
|
|
642
|
+
dropDownIcon.classList.remove("rotate-180");
|
|
643
|
+
} else {
|
|
644
|
+
dropDownIcon.classList.add("transition-all");
|
|
645
|
+
dropDownIcon.classList.add("rotate-180");
|
|
646
|
+
}
|
|
647
|
+
const optionsContainer = document.getElementById(`dropDownOptions-${index}${additionalKey ? `-${additionalKey}` : ""}`);
|
|
648
|
+
if (!optionsContainer) return;
|
|
649
|
+
optionsContainer.classList.add("transition-all");
|
|
650
|
+
if (optionsContainer.classList.contains("max-h-0")) {
|
|
651
|
+
optionsContainer.classList.remove("max-h-0");
|
|
652
|
+
optionsContainer.classList.add("min-h-[50px]");
|
|
653
|
+
} else {
|
|
654
|
+
optionsContainer.classList.remove("min-h-[50px]");
|
|
655
|
+
optionsContainer.classList.add("max-h-0");
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
const checkForAuthData = () => {
|
|
659
|
+
const params = new URLSearchParams(window.location.search);
|
|
660
|
+
let authData2 = params.get("authData");
|
|
661
|
+
if (authData2) {
|
|
662
|
+
authData2 = atob(authData2);
|
|
663
|
+
localStorage.setItem("authData", authData2);
|
|
664
|
+
setAuthData(JSON.parse(authData2));
|
|
665
|
+
params.delete("authData");
|
|
666
|
+
const newUrl = window.location.pathname + (params.toString() ? "?" + params.toString() : "");
|
|
667
|
+
window.history.replaceState({}, document.title, newUrl);
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
(0, import_react11.useEffect)(() => {
|
|
671
|
+
checkForAuthData();
|
|
672
|
+
}, []);
|
|
673
|
+
(0, import_react11.useEffect)(() => {
|
|
674
|
+
const storedAuthData = localStorage.getItem("authData");
|
|
675
|
+
if (storedAuthData) {
|
|
676
|
+
let parseData = JSON.parse(storedAuthData);
|
|
677
|
+
setAuthData(parseData);
|
|
678
|
+
}
|
|
679
|
+
}, [localStorage.getItem("authData")]);
|
|
680
|
+
const navItemsLocal = navItems ?? navItemsConstant;
|
|
681
|
+
const additionalItemsLocal = additionalItems ?? additionalItemsConstant;
|
|
682
|
+
const sideBarLogoLocal = sideBarLogo ?? sidebarlogo_default;
|
|
683
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", { className: "w-[320px] transition-all ease-in-out delay-100 bg-transparent border-r border-gray-200 dark:border-[#303036] flex flex-col p-4 h-full max-h-[100vh]" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "p-2 mb-4" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "w-[108px] h-[40px] flex items-center \r\n justify-center" }, /* @__PURE__ */ import_react11.default.createElement("img", { src: sideBarLogoLocal, alt: "sidebarLogo", width: 108, height: 40 }))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "mb-6" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex ml-[20px] items-center gap-2 mb-2 dark:text-[#f4f4f5cc]" }, /* @__PURE__ */ import_react11.default.createElement(import_lucide_react5.Globe, { width: 20, height: 20 }), /* @__PURE__ */ import_react11.default.createElement("h3", { className: "text-[#3f3f46cc] dark:text-[#f4f4f5cc] font-medium" }, "Data Centers")), /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement(CustomAutocomplete, { options: [] }))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "overflow-y-auto" }, /* @__PURE__ */ import_react11.default.createElement("div", null, navItemsLocal == null ? void 0 : navItemsLocal.map((item, index) => {
|
|
684
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", { key: index, className: "" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex items-center gap-3 p-2 hover:bg-[#f3f4f6] dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] cursor-pointer rounded-lg ml-2", onClick: (e) => {
|
|
685
|
+
item.onClick && item.onClick(e);
|
|
686
|
+
handleIconRotate(e, index);
|
|
687
|
+
} }, /* @__PURE__ */ import_react11.default.createElement(item.Icon, { width: 20, height: 20 }), /* @__PURE__ */ import_react11.default.createElement("span", { className: "font-medium text-[#3f3f46cc] dark:text-[#f4f4f5cc]" }, item.label), item.isDropDown && /* @__PURE__ */ import_react11.default.createElement("div", { className: `ml-auto transition-all delay-75` }, /* @__PURE__ */ import_react11.default.createElement(import_lucide_react5.ChevronDown, { width: 20, height: 20 }))), item.options && item.options.length > 0 && /* @__PURE__ */ import_react11.default.createElement("div", { className: "ml-[20px] max-h-0 overflow-hidden flex flex-col", id: `dropDownOptions-${index}` }, item.options.map((options, optionsIndex) => {
|
|
688
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react11.default.createElement(
|
|
689
|
+
"div",
|
|
690
|
+
{
|
|
691
|
+
className: "flex items-center gap-3 p-2 hover:bg-[#f3f4f6] dark:hover:bg-[#27272a] cursor-pointer",
|
|
692
|
+
onClick: (e) => {
|
|
693
|
+
options.onClick && options.onClick();
|
|
694
|
+
options.isDropDown && handleIconRotate(e, optionsIndex, "subOption");
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
/* @__PURE__ */ import_react11.default.createElement("div", null),
|
|
698
|
+
/* @__PURE__ */ import_react11.default.createElement("span", { className: "font-medium text-sm text-[#3f3f46cc] dark:text-[#f4f4f5cc]" }, options.label),
|
|
699
|
+
options.isDropDown && /* @__PURE__ */ import_react11.default.createElement("div", { className: `ml-auto transition-all delay-75` }, /* @__PURE__ */ import_react11.default.createElement(import_lucide_react5.ChevronDown, { width: 20, height: 20 }))
|
|
700
|
+
), options.options && options.options.length > 1 && /* @__PURE__ */ import_react11.default.createElement("div", { className: "ml-[20px] max-h-0 overflow-hidden flex flex-col", id: `dropDownOptions-${optionsIndex}-subOption` }, options.options.map((subOption) => {
|
|
701
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
702
|
+
"div",
|
|
703
|
+
{
|
|
704
|
+
className: "p-2 rounded-lg hover:bg-gray-100 text-[#3f3f46cc] dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] font-medium text-sm",
|
|
705
|
+
onClick: (e) => {
|
|
706
|
+
subOption.onClick && subOption.onClick();
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
subOption.label
|
|
710
|
+
);
|
|
711
|
+
})));
|
|
712
|
+
})));
|
|
713
|
+
})), /* @__PURE__ */ import_react11.default.createElement("div", { className: "border-t border-[#e5e5e5] dark:border-[#303036] mt-4" }, (additionalItemsLocal == null ? void 0 : additionalItemsLocal.length) > 0 && additionalItemsLocal.map((item, index) => {
|
|
714
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", { key: index, className: "flex items-center gap-3 p-2 hover:bg-[#f3f4f6] dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] cursor-pointer", onClick: () => item.onClick && item.onClick() }, /* @__PURE__ */ import_react11.default.createElement(item.Icon, { width: 20, height: 20 }), /* @__PURE__ */ import_react11.default.createElement("span", { className: "font-medium text-[#3f3f46cc] dark:text-[#f4f4f5cc]" }, item.label));
|
|
715
|
+
}))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "mt-auto bg-[#fafafa] dark:bg-transparent sticky bottom-0 pt-2" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex items-center justify-between p-2 rounded-lg hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] cursor-pointer", onClick: () => {
|
|
716
|
+
window.location.href = "/profile";
|
|
717
|
+
} }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden rounded-full h-10 w-10" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "flex h-full w-full items-center justify-center rounded-full bg-muted" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement("p", { className: "font-semibold" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin User"), /* @__PURE__ */ import_react11.default.createElement("p", { className: "text-sm text-[#3f3f46cc] dark:text-[#f4f4f5cc]" }, role))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "text-[#18181b] dark:text-[#f4f4f5cc]" }, /* @__PURE__ */ import_react11.default.createElement(import_lucide_react5.LogOut, null)))));
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
// src/RightSheet/RightSheet.jsx
|
|
721
|
+
var import_react12 = __toESM(require("react"));
|
|
722
|
+
var RightSheet = ({
|
|
723
|
+
open,
|
|
724
|
+
setOpen,
|
|
725
|
+
children,
|
|
726
|
+
callBack,
|
|
727
|
+
actionLabel = "Save",
|
|
728
|
+
onAction = () => {
|
|
729
|
+
}
|
|
730
|
+
}) => {
|
|
731
|
+
const [visible, setVisible] = (0, import_react12.useState)(open);
|
|
732
|
+
(0, import_react12.useEffect)(() => {
|
|
733
|
+
if (open) {
|
|
734
|
+
document.body.style.overflow = "hidden";
|
|
735
|
+
setVisible(true);
|
|
736
|
+
}
|
|
737
|
+
return () => {
|
|
738
|
+
document.body.style.overflow = "auto";
|
|
739
|
+
};
|
|
740
|
+
}, [open]);
|
|
741
|
+
const handleClose = () => {
|
|
742
|
+
setVisible(false);
|
|
743
|
+
setTimeout(() => {
|
|
744
|
+
setOpen(false);
|
|
745
|
+
callBack();
|
|
746
|
+
}, 200);
|
|
747
|
+
};
|
|
748
|
+
const handleAction = () => {
|
|
749
|
+
onAction();
|
|
750
|
+
handleClose();
|
|
751
|
+
};
|
|
752
|
+
if (!visible) return null;
|
|
753
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
754
|
+
"div",
|
|
755
|
+
{
|
|
756
|
+
className: "fixed inset-0 overflow-x-hidden bg-black/80 sheetPopIn h-full overflow-auto ",
|
|
757
|
+
onClick: handleClose
|
|
758
|
+
},
|
|
759
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
760
|
+
"div",
|
|
761
|
+
{
|
|
762
|
+
className: `absolute flex flex-col right-0 top-0 min-h-full min-w-[100%] md:min-w-[576px] bg-white
|
|
763
|
+
${visible ? "sheetRightSlide" : "transition-all duration-200 translate-x-[100%]"} justify-between `,
|
|
764
|
+
onClick: (e) => e.stopPropagation()
|
|
765
|
+
},
|
|
766
|
+
/* @__PURE__ */ import_react12.default.createElement("div", { className: "bg-white min-h-full " }, children),
|
|
767
|
+
/* @__PURE__ */ import_react12.default.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]" }, /* @__PURE__ */ import_react12.default.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose() }, "Cancel"), /* @__PURE__ */ import_react12.default.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction }, actionLabel))
|
|
768
|
+
)
|
|
769
|
+
);
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
// src/Table/CustomTable.jsx
|
|
773
|
+
var import_react13 = __toESM(require("react"));
|
|
774
|
+
var CustomTable = ({ tableHeader, setIsAllChecked, isAllChecked, children }) => {
|
|
775
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { className: "border border-[#e5e5e5] rounded-lg overflow-x-auto" }, /* @__PURE__ */ import_react13.default.createElement("div", { className: "w-full relative overflow-x-auto" }, /* @__PURE__ */ import_react13.default.createElement("table", { className: "w-full caption-bottom text-sm overflow-x-auto bg-white table-fixed border-collapse" }, /* @__PURE__ */ import_react13.default.createElement("thead", { className: "border-b border-[#e5e5e5]" }, /* @__PURE__ */ import_react13.default.createElement("tr", { className: "transition-colors text-[#737373] hover:bg-muted/50 \r\n data-[state=selected]:bg-muted" }, /* @__PURE__ */ import_react13.default.createElement("th", { className: "px-4 py-3 text-left w-[50px]" }, /* @__PURE__ */ import_react13.default.createElement(CustomCheckbox, { checked: isAllChecked, onChange: () => {
|
|
776
|
+
setIsAllChecked(!isAllChecked);
|
|
777
|
+
} })), tableHeader.map((header, index) => {
|
|
778
|
+
return /* @__PURE__ */ import_react13.default.createElement("th", { className: `px-4 py-3 text-sm font-medium ${index == tableHeader.length - 1 ? "text-right" : "text-left"}`, key: header + index }, header);
|
|
779
|
+
}))), /* @__PURE__ */ import_react13.default.createElement("tbody", null, children))));
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
// src/inputs/CustomSelect.jsx
|
|
783
|
+
var import_react14 = __toESM(require("react"));
|
|
784
|
+
var import_lucide_react6 = require("lucide-react");
|
|
785
|
+
var CustomSelect = ({
|
|
786
|
+
label,
|
|
787
|
+
value,
|
|
788
|
+
onChange,
|
|
789
|
+
options,
|
|
790
|
+
placeholder = "Select...",
|
|
791
|
+
isRequired = false,
|
|
792
|
+
error,
|
|
793
|
+
heading,
|
|
794
|
+
disabled = false
|
|
795
|
+
}) => {
|
|
796
|
+
const [open, setOpen] = (0, import_react14.useState)(false);
|
|
797
|
+
const [search, setSearch] = (0, import_react14.useState)("");
|
|
798
|
+
const wrapperRef = (0, import_react14.useRef)(null);
|
|
799
|
+
const handleBlur = (e) => {
|
|
800
|
+
var _a;
|
|
801
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
802
|
+
setOpen(false);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
const filteredOptions = options.filter(
|
|
806
|
+
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
807
|
+
);
|
|
808
|
+
const handleSelect = (val) => {
|
|
809
|
+
onChange(val);
|
|
810
|
+
setOpen(false);
|
|
811
|
+
};
|
|
812
|
+
const selectedOption = options.find((opt) => opt.value === value);
|
|
813
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
814
|
+
"div",
|
|
815
|
+
{
|
|
816
|
+
className: "flex flex-col w-full relative",
|
|
817
|
+
ref: wrapperRef,
|
|
818
|
+
tabIndex: disabled ? -1 : 0,
|
|
819
|
+
onBlur: handleBlur
|
|
820
|
+
},
|
|
821
|
+
heading && /* @__PURE__ */ import_react14.default.createElement("h3", { className: "text-lg font-semibold mb-1" }, heading),
|
|
822
|
+
label && /* @__PURE__ */ import_react14.default.createElement(
|
|
823
|
+
"label",
|
|
824
|
+
{
|
|
825
|
+
className: `font-medium text-sm mb-1 ${heading ? "text-gray-500" : "text-black"}`
|
|
826
|
+
},
|
|
827
|
+
label,
|
|
828
|
+
" ",
|
|
829
|
+
isRequired && /* @__PURE__ */ import_react14.default.createElement("span", { className: "text-red-500" }, "*")
|
|
830
|
+
),
|
|
831
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
832
|
+
"div",
|
|
833
|
+
{
|
|
834
|
+
onClick: () => !disabled && setOpen((prev) => !prev),
|
|
835
|
+
className: `flex justify-between items-center rounded-md px-3 py-2 text-sm border h-10 cursor-pointer
|
|
836
|
+
${disabled ? "bg-gray-100 text-gray-400" : "bg-white hover:border-gray-400"}
|
|
837
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
838
|
+
`
|
|
839
|
+
},
|
|
840
|
+
/* @__PURE__ */ import_react14.default.createElement("span", { className: `${selectedOption ? "text-black" : "text-gray-400"}` }, selectedOption ? selectedOption.label : placeholder),
|
|
841
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
842
|
+
import_lucide_react6.ChevronDown,
|
|
843
|
+
{
|
|
844
|
+
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
845
|
+
}
|
|
846
|
+
)
|
|
847
|
+
),
|
|
848
|
+
open && !disabled && /* @__PURE__ */ import_react14.default.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" }, /* @__PURE__ */ import_react14.default.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ import_react14.default.createElement(import_lucide_react6.Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ import_react14.default.createElement(
|
|
849
|
+
"input",
|
|
850
|
+
{
|
|
851
|
+
type: "text",
|
|
852
|
+
value: search,
|
|
853
|
+
onChange: (e) => setSearch(e.target.value),
|
|
854
|
+
placeholder: "Search...",
|
|
855
|
+
className: "flex-1 text-sm focus:outline-none"
|
|
856
|
+
}
|
|
857
|
+
)), /* @__PURE__ */ import_react14.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ import_react14.default.createElement(
|
|
858
|
+
"li",
|
|
859
|
+
{
|
|
860
|
+
key: opt.value,
|
|
861
|
+
onClick: () => handleSelect(opt.value),
|
|
862
|
+
className: `px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 ${value === opt.value ? "bg-gray-100 font-medium" : ""}`
|
|
863
|
+
},
|
|
864
|
+
opt.label
|
|
865
|
+
)) : /* @__PURE__ */ import_react14.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400" }, "No results found")))
|
|
866
|
+
);
|
|
867
|
+
};
|
|
868
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
869
|
+
0 && (module.exports = {
|
|
870
|
+
AppSideBar,
|
|
871
|
+
Chip,
|
|
872
|
+
CustomAutocomplete,
|
|
873
|
+
CustomButton,
|
|
874
|
+
CustomCheckbox,
|
|
875
|
+
CustomInput,
|
|
876
|
+
CustomSearch,
|
|
877
|
+
CustomSelect,
|
|
878
|
+
CustomSwitch,
|
|
879
|
+
CustomTable,
|
|
880
|
+
CustomTextarea,
|
|
881
|
+
CustomUpload,
|
|
882
|
+
ProgressBar,
|
|
883
|
+
RightSheet
|
|
884
|
+
});
|