jett.admin.npmpackage 1.0.59 → 1.0.60
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.js +972 -972
- package/dist/index.mjs +937 -937
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,972 +1,972 @@
|
|
|
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 dark:bg-[#18181b] dark:text-white",
|
|
60
|
-
SECONDARY: "bg-primary text-white dark:text-white",
|
|
61
|
-
DEFAULT: "bg-white text-black dark:text-white",
|
|
62
|
-
DANGER: "bg-[#ef4444] text-white dark:text-white"
|
|
63
|
-
};
|
|
64
|
-
var CustomButton = ({
|
|
65
|
-
variant = "DEFAULT",
|
|
66
|
-
children,
|
|
67
|
-
className,
|
|
68
|
-
onClick,
|
|
69
|
-
disabled = false,
|
|
70
|
-
icon
|
|
71
|
-
}) => {
|
|
72
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: cn(
|
|
76
|
-
`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`,
|
|
77
|
-
variantStyles[variant],
|
|
78
|
-
className
|
|
79
|
-
),
|
|
80
|
-
onClick
|
|
81
|
-
},
|
|
82
|
-
icon && /* @__PURE__ */ import_react.default.createElement("div", null, icon),
|
|
83
|
-
children
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
// src/inputs/Autocomplete.jsx
|
|
88
|
-
var import_react2 = __toESM(require("react"));
|
|
89
|
-
var import_lucide_react = require("lucide-react");
|
|
90
|
-
var CustomAutocomplete = ({
|
|
91
|
-
label,
|
|
92
|
-
value,
|
|
93
|
-
onChange,
|
|
94
|
-
options,
|
|
95
|
-
placeholder = "Search & select...",
|
|
96
|
-
isRequired = false,
|
|
97
|
-
error,
|
|
98
|
-
heading,
|
|
99
|
-
disabled = false
|
|
100
|
-
}) => {
|
|
101
|
-
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
102
|
-
const [search, setSearch] = (0, import_react2.useState)("");
|
|
103
|
-
const wrapperRef = (0, import_react2.useRef)(null);
|
|
104
|
-
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
105
|
-
const handleBlur = (e) => {
|
|
106
|
-
var _a;
|
|
107
|
-
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
108
|
-
setOpen(false);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const filteredOptions = options.filter(
|
|
112
|
-
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
113
|
-
);
|
|
114
|
-
const toggleValue = (val) => {
|
|
115
|
-
if (value.includes(val)) {
|
|
116
|
-
onChange(value.filter((v) => v !== val));
|
|
117
|
-
} else {
|
|
118
|
-
onChange([...value, val]);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
|
122
|
-
"div",
|
|
123
|
-
{
|
|
124
|
-
className: "flex flex-col w-full relative dark:bg-[#18181b] dark:text-white",
|
|
125
|
-
ref: wrapperRef,
|
|
126
|
-
tabIndex: disabled ? -1 : 0,
|
|
127
|
-
onBlur: handleBlur
|
|
128
|
-
},
|
|
129
|
-
heading && /* @__PURE__ */ import_react2.default.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1" }, heading),
|
|
130
|
-
label && /* @__PURE__ */ import_react2.default.createElement(
|
|
131
|
-
"label",
|
|
132
|
-
{
|
|
133
|
-
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black"}`
|
|
134
|
-
},
|
|
135
|
-
label,
|
|
136
|
-
" ",
|
|
137
|
-
isRequired && /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-red-500" }, "*")
|
|
138
|
-
),
|
|
139
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
onClick: () => {
|
|
143
|
-
if (!disabled) setOpen((prev) => !prev);
|
|
144
|
-
},
|
|
145
|
-
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 dark:bg-[#18181b] dark:text-white
|
|
146
|
-
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
147
|
-
${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"}
|
|
148
|
-
`
|
|
149
|
-
},
|
|
150
|
-
/* @__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(
|
|
151
|
-
"span",
|
|
152
|
-
{
|
|
153
|
-
key: opt.value,
|
|
154
|
-
className: "bg-gray-100 border border-gray-300 px-2 dark:bg-gray-800 dark:text-white py-0.5 rounded text-xs flex items-center gap-1"
|
|
155
|
-
},
|
|
156
|
-
opt.label,
|
|
157
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
158
|
-
"button",
|
|
159
|
-
{
|
|
160
|
-
onClick: (e) => {
|
|
161
|
-
e.stopPropagation();
|
|
162
|
-
toggleValue(opt.value);
|
|
163
|
-
},
|
|
164
|
-
className: "text-gray-500 hover:text-gray-700 dark:text-white"
|
|
165
|
-
},
|
|
166
|
-
"\u2715"
|
|
167
|
-
)
|
|
168
|
-
)) : /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-gray-400" }, placeholder)),
|
|
169
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
170
|
-
import_lucide_react.ChevronDown,
|
|
171
|
-
{
|
|
172
|
-
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
),
|
|
176
|
-
!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 dark:bg-[#18181b] dark:text-white" }, /* @__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(
|
|
177
|
-
"input",
|
|
178
|
-
{
|
|
179
|
-
type: "text",
|
|
180
|
-
value: search,
|
|
181
|
-
onChange: (e) => setSearch(e.target.value),
|
|
182
|
-
placeholder: "Search...",
|
|
183
|
-
className: "flex-1 text-sm focus:outline-none"
|
|
184
|
-
}
|
|
185
|
-
)), /* @__PURE__ */ import_react2.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
186
|
-
const selected = value.includes(opt.value);
|
|
187
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
|
188
|
-
"li",
|
|
189
|
-
{
|
|
190
|
-
key: opt.value,
|
|
191
|
-
onClick: () => toggleValue(opt.value),
|
|
192
|
-
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 ${selected ? "bg-gray-50 font-medium" : ""}`
|
|
193
|
-
},
|
|
194
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
|
195
|
-
"span",
|
|
196
|
-
{
|
|
197
|
-
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"}`
|
|
198
|
-
},
|
|
199
|
-
selected && /* @__PURE__ */ import_react2.default.createElement(import_lucide_react.Check, { size: 14 })
|
|
200
|
-
),
|
|
201
|
-
opt.label
|
|
202
|
-
);
|
|
203
|
-
}) : /* @__PURE__ */ import_react2.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400" }, "No results found")))
|
|
204
|
-
);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// src/inputs/Checkbox.jsx
|
|
208
|
-
var import_react3 = __toESM(require("react"));
|
|
209
|
-
var CustomCheckbox = ({ onChange, checked }) => {
|
|
210
|
-
const handleChange = (e) => {
|
|
211
|
-
onChange(e.target.checked);
|
|
212
|
-
};
|
|
213
|
-
return /* @__PURE__ */ import_react3.default.createElement("label", { className: "inline-flex items-center cursor-pointer select-none" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
214
|
-
"input",
|
|
215
|
-
{
|
|
216
|
-
type: "checkbox",
|
|
217
|
-
checked,
|
|
218
|
-
onChange: handleChange,
|
|
219
|
-
className: "peer hidden"
|
|
220
|
-
}
|
|
221
|
-
), /* @__PURE__ */ import_react3.default.createElement(
|
|
222
|
-
"span",
|
|
223
|
-
{
|
|
224
|
-
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 "
|
|
225
|
-
},
|
|
226
|
-
checked && /* @__PURE__ */ import_react3.default.createElement(
|
|
227
|
-
"svg",
|
|
228
|
-
{
|
|
229
|
-
className: "w-4 h-4 text-white",
|
|
230
|
-
fill: "none",
|
|
231
|
-
stroke: "currentColor",
|
|
232
|
-
strokeWidth: "3",
|
|
233
|
-
viewBox: "0 0 24 24"
|
|
234
|
-
},
|
|
235
|
-
/* @__PURE__ */ import_react3.default.createElement("path", { d: "M5 13l4 4L19 7" })
|
|
236
|
-
)
|
|
237
|
-
));
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
// src/inputs/Chip.jsx
|
|
241
|
-
var import_react4 = __toESM(require("react"));
|
|
242
|
-
var VARIANTS = {
|
|
243
|
-
PRIMARY: "bg-gray-100 text-black dark:bg-gray-800 dark:text-white",
|
|
244
|
-
GREEN: "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",
|
|
245
|
-
RED: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100",
|
|
246
|
-
YELLOW: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
|
|
247
|
-
};
|
|
248
|
-
var Chip = ({ label, variant }) => {
|
|
249
|
-
return /* @__PURE__ */ import_react4.default.createElement(
|
|
250
|
-
"div",
|
|
251
|
-
{
|
|
252
|
-
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`
|
|
253
|
-
},
|
|
254
|
-
label
|
|
255
|
-
);
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// src/inputs/CustomSwitch.jsx
|
|
259
|
-
var import_react5 = __toESM(require("react"));
|
|
260
|
-
var CustomSwitch = ({ checked, onChange, label, description }) => {
|
|
261
|
-
return /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement(
|
|
262
|
-
"button",
|
|
263
|
-
{
|
|
264
|
-
type: "button",
|
|
265
|
-
role: "switch",
|
|
266
|
-
"aria-checked": checked,
|
|
267
|
-
onClick: () => onChange(!checked),
|
|
268
|
-
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`
|
|
269
|
-
},
|
|
270
|
-
/* @__PURE__ */ import_react5.default.createElement(
|
|
271
|
-
"span",
|
|
272
|
-
{
|
|
273
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
), /* @__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)));
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
// src/inputs/Input.jsx
|
|
280
|
-
var import_react6 = __toESM(require("react"));
|
|
281
|
-
var CustomInput = ({
|
|
282
|
-
label,
|
|
283
|
-
isRequired,
|
|
284
|
-
value,
|
|
285
|
-
onChange,
|
|
286
|
-
placeholder,
|
|
287
|
-
disabled = false,
|
|
288
|
-
error,
|
|
289
|
-
heading
|
|
290
|
-
}) => {
|
|
291
|
-
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(
|
|
292
|
-
"label",
|
|
293
|
-
{
|
|
294
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`
|
|
295
|
-
},
|
|
296
|
-
label,
|
|
297
|
-
" ",
|
|
298
|
-
isRequired && /* @__PURE__ */ import_react6.default.createElement("span", { className: "text-red-500" }, "*")
|
|
299
|
-
), /* @__PURE__ */ import_react6.default.createElement(
|
|
300
|
-
"input",
|
|
301
|
-
{
|
|
302
|
-
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
303
|
-
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
304
|
-
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
305
|
-
${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%)]"}
|
|
306
|
-
`,
|
|
307
|
-
value,
|
|
308
|
-
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
309
|
-
placeholder,
|
|
310
|
-
disabled,
|
|
311
|
-
readOnly: disabled
|
|
312
|
-
}
|
|
313
|
-
));
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// src/inputs/ProgressBar.jsx
|
|
317
|
-
var import_react7 = __toESM(require("react"));
|
|
318
|
-
var ProgressBar = ({ step, totalSteps }) => {
|
|
319
|
-
const progress = step / totalSteps * 100;
|
|
320
|
-
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(
|
|
321
|
-
"div",
|
|
322
|
-
{
|
|
323
|
-
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
324
|
-
style: { width: `${progress}%` }
|
|
325
|
-
}
|
|
326
|
-
)));
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
// src/inputs/Search.jsx
|
|
330
|
-
var import_react8 = __toESM(require("react"));
|
|
331
|
-
var import_lucide_react2 = require("lucide-react");
|
|
332
|
-
var CustomSearch = ({
|
|
333
|
-
value,
|
|
334
|
-
onChange,
|
|
335
|
-
placeholder = "Search Markets..."
|
|
336
|
-
}) => {
|
|
337
|
-
return /* @__PURE__ */ import_react8.default.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" }, /* @__PURE__ */ import_react8.default.createElement(import_lucide_react2.Search, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ import_react8.default.createElement(
|
|
338
|
-
"input",
|
|
339
|
-
{
|
|
340
|
-
type: "text",
|
|
341
|
-
value,
|
|
342
|
-
onChange,
|
|
343
|
-
placeholder,
|
|
344
|
-
className: "bg-transparent w-full h-full focus:outline-none"
|
|
345
|
-
}
|
|
346
|
-
));
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
// src/inputs/TextArea.jsx
|
|
350
|
-
var import_react9 = __toESM(require("react"));
|
|
351
|
-
var CustomTextarea = ({
|
|
352
|
-
label,
|
|
353
|
-
isRequired,
|
|
354
|
-
value,
|
|
355
|
-
onChange,
|
|
356
|
-
placeholder,
|
|
357
|
-
disabled = false,
|
|
358
|
-
error,
|
|
359
|
-
heading,
|
|
360
|
-
rows = 4
|
|
361
|
-
}) => {
|
|
362
|
-
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(
|
|
363
|
-
"label",
|
|
364
|
-
{
|
|
365
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`
|
|
366
|
-
},
|
|
367
|
-
label,
|
|
368
|
-
" ",
|
|
369
|
-
isRequired && /* @__PURE__ */ import_react9.default.createElement("span", { className: "text-red-500" }, "*")
|
|
370
|
-
), /* @__PURE__ */ import_react9.default.createElement(
|
|
371
|
-
"textarea",
|
|
372
|
-
{
|
|
373
|
-
rows,
|
|
374
|
-
className: `border rounded-md px-4 py-2 w-full text-[14px]
|
|
375
|
-
focus:outline-2 focus:outline-black focus:outline-offset-2
|
|
376
|
-
focus:ring-0 focus:shadow-none focus:border-black
|
|
377
|
-
${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%)]"}
|
|
378
|
-
`,
|
|
379
|
-
value,
|
|
380
|
-
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
381
|
-
placeholder,
|
|
382
|
-
disabled,
|
|
383
|
-
readOnly: disabled
|
|
384
|
-
}
|
|
385
|
-
));
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
// src/inputs/Upload.jsx
|
|
389
|
-
var import_react10 = __toESM(require("react"));
|
|
390
|
-
var import_lucide_react3 = require("lucide-react");
|
|
391
|
-
var CustomUpload = ({
|
|
392
|
-
label = "Supporting documents",
|
|
393
|
-
description = "Drop items here or Browse Files",
|
|
394
|
-
accept = ".pdf,.jpg,.jpeg,.png",
|
|
395
|
-
maxSizeMB = 5,
|
|
396
|
-
onChange,
|
|
397
|
-
error,
|
|
398
|
-
value
|
|
399
|
-
}) => {
|
|
400
|
-
const inputRef = (0, import_react10.useRef)(null);
|
|
401
|
-
const handleFileSelect = (files) => {
|
|
402
|
-
if (!files || files.length === 0) return;
|
|
403
|
-
const selectedFile = files[0];
|
|
404
|
-
if (selectedFile.size > maxSizeMB * 1024 * 1024) {
|
|
405
|
-
alert(`File size must be less than ${maxSizeMB} MB`);
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
onChange == null ? void 0 : onChange(selectedFile);
|
|
409
|
-
};
|
|
410
|
-
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(
|
|
411
|
-
"div",
|
|
412
|
-
{
|
|
413
|
-
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
414
|
-
${error ? "border-red-500 bg-red-50" : "border-gray-300 hover:border-gray-400 bg-gray-50"}`,
|
|
415
|
-
onClick: () => {
|
|
416
|
-
var _a;
|
|
417
|
-
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
418
|
-
},
|
|
419
|
-
onDragOver: (e) => e.preventDefault(),
|
|
420
|
-
onDrop: (e) => {
|
|
421
|
-
e.preventDefault();
|
|
422
|
-
handleFileSelect(e.dataTransfer.files);
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
/* @__PURE__ */ import_react10.default.createElement(import_lucide_react3.Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
426
|
-
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-sm text-gray-700" }, description),
|
|
427
|
-
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
428
|
-
/* @__PURE__ */ import_react10.default.createElement(
|
|
429
|
-
"input",
|
|
430
|
-
{
|
|
431
|
-
ref: inputRef,
|
|
432
|
-
type: "file",
|
|
433
|
-
accept,
|
|
434
|
-
className: "hidden",
|
|
435
|
-
onChange: (e) => handleFileSelect(e.target.files)
|
|
436
|
-
}
|
|
437
|
-
)
|
|
438
|
-
), 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));
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
// src/sideBar/SideBar.jsx
|
|
442
|
-
var import_lucide_react6 = require("lucide-react");
|
|
443
|
-
var import_react12 = __toESM(require("react"));
|
|
444
|
-
|
|
445
|
-
// ConstantUI.js
|
|
446
|
-
var import_lucide_react4 = require("lucide-react");
|
|
447
|
-
var encodedAuthData = localStorage.getItem("encodedAuthData");
|
|
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.open("https://viz.jett.travel", "_blank");
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
label: "Tags",
|
|
498
|
-
onClick: () => {
|
|
499
|
-
window.location.href = "/orgselector/?path=tag";
|
|
500
|
-
}
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
label: "Users",
|
|
504
|
-
onClick: () => {
|
|
505
|
-
window.location.href = "/orgselector/?path=users";
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
],
|
|
509
|
-
isDropDown: true
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
Icon: import_lucide_react4.Banknote,
|
|
513
|
-
label: "Finance",
|
|
514
|
-
onClick: () => {
|
|
515
|
-
},
|
|
516
|
-
isDropDown: true,
|
|
517
|
-
options: [
|
|
518
|
-
{
|
|
519
|
-
label: "Invoices",
|
|
520
|
-
onClick: () => {
|
|
521
|
-
window.location.href = "/finance/invoices/";
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
label: "Booking History",
|
|
526
|
-
onClick: () => {
|
|
527
|
-
window.location.href = "/finance/bookingHistory/";
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
label: "Payments Ledger",
|
|
532
|
-
onClick: () => {
|
|
533
|
-
window.location.href = "/finance/paymentsLedger/";
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
]
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
Icon: import_lucide_react4.DollarSign,
|
|
540
|
-
label: "Revenue Management",
|
|
541
|
-
onClick: () => {
|
|
542
|
-
},
|
|
543
|
-
isDropDown: true,
|
|
544
|
-
options: [
|
|
545
|
-
{
|
|
546
|
-
label: "Pricing Policy",
|
|
547
|
-
onClick: () => {
|
|
548
|
-
window.location.href = "/orgselector/?path=pricing-policy";
|
|
549
|
-
}
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
label: "Offers",
|
|
553
|
-
onClick: () => {
|
|
554
|
-
window.location.href = "/orgselector/?path=offer";
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
label: "Vouchers",
|
|
559
|
-
onClick: () => {
|
|
560
|
-
window.location.href = "/orgselector/?path=voucher";
|
|
561
|
-
}
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
label: "Supplier Deals",
|
|
565
|
-
onClick: () => {
|
|
566
|
-
window.location.href = "/supplierdeals/";
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
label: "Subscription Plans",
|
|
571
|
-
onClick: () => {
|
|
572
|
-
window.location.href = "/subscription/";
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
]
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
Icon: import_lucide_react4.Cog,
|
|
579
|
-
label: "Settings",
|
|
580
|
-
onClick: () => {
|
|
581
|
-
},
|
|
582
|
-
isDropDown: true,
|
|
583
|
-
options: [
|
|
584
|
-
{
|
|
585
|
-
label: "Admin user Management",
|
|
586
|
-
isDropDown: true,
|
|
587
|
-
onClick: () => {
|
|
588
|
-
},
|
|
589
|
-
options: [
|
|
590
|
-
{
|
|
591
|
-
label: "Admin Users",
|
|
592
|
-
onClick: () => {
|
|
593
|
-
window.location.href = "/users/";
|
|
594
|
-
}
|
|
595
|
-
},
|
|
596
|
-
{ label: "Admin User Attributes", onClick: () => {
|
|
597
|
-
} }
|
|
598
|
-
]
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
label: "TMC Markets",
|
|
602
|
-
onClick: () => {
|
|
603
|
-
window.location.href = "/market/";
|
|
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 = "/whitelabel/";
|
|
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/logo-white.svg
|
|
632
|
-
var logo_white_default = "./logo-white-RYMEJOWI.svg";
|
|
633
|
-
|
|
634
|
-
// src/sideBar/SideBar.jsx
|
|
635
|
-
var import_js_cookie = __toESM(require("js-cookie"));
|
|
636
|
-
|
|
637
|
-
// src/inputs/CustomSelect.jsx
|
|
638
|
-
var import_react11 = __toESM(require("react"));
|
|
639
|
-
var import_lucide_react5 = require("lucide-react");
|
|
640
|
-
var CustomSelect = ({
|
|
641
|
-
label,
|
|
642
|
-
value,
|
|
643
|
-
onChange,
|
|
644
|
-
options,
|
|
645
|
-
placeholder = "Select...",
|
|
646
|
-
isRequired = false,
|
|
647
|
-
error,
|
|
648
|
-
heading,
|
|
649
|
-
disabled = false
|
|
650
|
-
}) => {
|
|
651
|
-
const [open, setOpen] = (0, import_react11.useState)(false);
|
|
652
|
-
const [search, setSearch] = (0, import_react11.useState)("");
|
|
653
|
-
const wrapperRef = (0, import_react11.useRef)(null);
|
|
654
|
-
const handleBlur = (e) => {
|
|
655
|
-
var _a;
|
|
656
|
-
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
657
|
-
setOpen(false);
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
const filteredOptions = options.filter(
|
|
661
|
-
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
662
|
-
);
|
|
663
|
-
const handleSelect = (val) => {
|
|
664
|
-
onChange(val);
|
|
665
|
-
setOpen(false);
|
|
666
|
-
};
|
|
667
|
-
const selectedOption = options.find((opt) => opt.value === value);
|
|
668
|
-
return /* @__PURE__ */ import_react11.default.createElement(
|
|
669
|
-
"div",
|
|
670
|
-
{
|
|
671
|
-
className: "flex flex-col w-full relative",
|
|
672
|
-
ref: wrapperRef,
|
|
673
|
-
tabIndex: disabled ? -1 : 0,
|
|
674
|
-
onBlur: handleBlur
|
|
675
|
-
},
|
|
676
|
-
heading && /* @__PURE__ */ import_react11.default.createElement("h3", { className: "text-lg font-semibold mb-1" }, heading),
|
|
677
|
-
label && /* @__PURE__ */ import_react11.default.createElement(
|
|
678
|
-
"label",
|
|
679
|
-
{
|
|
680
|
-
className: `font-medium text-sm mb-1 ${heading ? "text-[#737373] dark:text-white" : "text-black dark:text-white"}`
|
|
681
|
-
},
|
|
682
|
-
label,
|
|
683
|
-
" ",
|
|
684
|
-
isRequired && /* @__PURE__ */ import_react11.default.createElement("span", { className: "text-red-500" }, "*")
|
|
685
|
-
),
|
|
686
|
-
/* @__PURE__ */ import_react11.default.createElement(
|
|
687
|
-
"div",
|
|
688
|
-
{
|
|
689
|
-
onClick: () => !disabled && setOpen((prev) => !prev),
|
|
690
|
-
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
|
|
691
|
-
${disabled ? "bg-gray-100 text-gray-400" : "bg-white dark:bg-[#18181b] dark:text-white"}
|
|
692
|
-
${error ? "border-red-500" : "border-gray-300"}
|
|
693
|
-
`
|
|
694
|
-
},
|
|
695
|
-
/* @__PURE__ */ import_react11.default.createElement("span", { className: `${selectedOption ? "text-black dark:text-white" : "text-gray-400 dark:text-white"}` }, selectedOption ? selectedOption.label : placeholder),
|
|
696
|
-
/* @__PURE__ */ import_react11.default.createElement(
|
|
697
|
-
import_lucide_react5.ChevronDown,
|
|
698
|
-
{
|
|
699
|
-
className: `w-4 h-4 text-gray-500 transition-transform dark:text-white ${open ? "rotate-180" : ""}`
|
|
700
|
-
}
|
|
701
|
-
)
|
|
702
|
-
),
|
|
703
|
-
open && !disabled && /* @__PURE__ */ import_react11.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 dark:bg-[#18181b] dark:text-white" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ import_react11.default.createElement(import_lucide_react5.Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ import_react11.default.createElement(
|
|
704
|
-
"input",
|
|
705
|
-
{
|
|
706
|
-
type: "text",
|
|
707
|
-
value: search,
|
|
708
|
-
onChange: (e) => setSearch(e.target.value),
|
|
709
|
-
placeholder: "Search...",
|
|
710
|
-
className: "flex-1 text-sm focus:outline-none"
|
|
711
|
-
}
|
|
712
|
-
)), /* @__PURE__ */ import_react11.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ import_react11.default.createElement(
|
|
713
|
-
"li",
|
|
714
|
-
{
|
|
715
|
-
key: opt.value,
|
|
716
|
-
onClick: () => handleSelect(opt.value),
|
|
717
|
-
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" : ""}`
|
|
718
|
-
},
|
|
719
|
-
opt.label
|
|
720
|
-
)) : /* @__PURE__ */ import_react11.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400 dark:text-white" }, "No results found")))
|
|
721
|
-
);
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
// src/sideBar/SideBar.jsx
|
|
725
|
-
var AppSideBar = ({
|
|
726
|
-
username,
|
|
727
|
-
role,
|
|
728
|
-
navItems,
|
|
729
|
-
additionalItems,
|
|
730
|
-
sideBarLogo
|
|
731
|
-
}) => {
|
|
732
|
-
var _a, _b;
|
|
733
|
-
const [authData, setAuthData] = (0, import_react12.useState)(null);
|
|
734
|
-
const [selectedCountry, setSelectedCountry] = (0, import_react12.useState)("dubai");
|
|
735
|
-
const countryOptions = [
|
|
736
|
-
{ label: "India", value: "india" },
|
|
737
|
-
{ label: "Dubai", value: "dubai" },
|
|
738
|
-
{ label: "Singapore", value: "singapore" },
|
|
739
|
-
{ label: "Qatar", value: "qatar" }
|
|
740
|
-
];
|
|
741
|
-
const handleIconRotate = (e, index, additionalKey, parentIndex) => {
|
|
742
|
-
let dropDownIcon = e.currentTarget.children[2];
|
|
743
|
-
if (!dropDownIcon) return;
|
|
744
|
-
if (dropDownIcon.classList.contains("rotate-180")) {
|
|
745
|
-
dropDownIcon.classList.remove("rotate-180");
|
|
746
|
-
} else {
|
|
747
|
-
dropDownIcon.classList.add("transition-all");
|
|
748
|
-
dropDownIcon.classList.add("rotate-180");
|
|
749
|
-
}
|
|
750
|
-
const optionsContainer = document.getElementById(
|
|
751
|
-
`dropDownOptions-${index}${additionalKey ? `-${additionalKey}` : ""}${parentIndex ? `-${parentIndex}` : ""}`
|
|
752
|
-
);
|
|
753
|
-
if (!optionsContainer) return;
|
|
754
|
-
optionsContainer.classList.add("transition-all");
|
|
755
|
-
if (optionsContainer.classList.contains("max-h-0")) {
|
|
756
|
-
optionsContainer.classList.remove("max-h-0");
|
|
757
|
-
optionsContainer.classList.add("min-h-[50px]");
|
|
758
|
-
} else {
|
|
759
|
-
optionsContainer.classList.remove("min-h-[50px]");
|
|
760
|
-
optionsContainer.classList.add("max-h-0");
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
(0, import_react12.useEffect)(() => {
|
|
764
|
-
const storedAuthData = localStorage.getItem("authData");
|
|
765
|
-
if (storedAuthData) {
|
|
766
|
-
let parseData = JSON.parse(storedAuthData);
|
|
767
|
-
setAuthData(parseData);
|
|
768
|
-
}
|
|
769
|
-
}, [localStorage.getItem("authData")]);
|
|
770
|
-
const navItemsLocal = navItems ?? navItemsConstant;
|
|
771
|
-
const additionalItemsLocal = additionalItems ?? additionalItemsConstant;
|
|
772
|
-
const sideBarLogoLocal = sideBarLogo ?? logo_white_default;
|
|
773
|
-
return /* @__PURE__ */ import_react12.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] dark:bg-[#18181b]" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "p-2 mb-2" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
774
|
-
"img",
|
|
775
|
-
{
|
|
776
|
-
src: sideBarLogoLocal,
|
|
777
|
-
alt: "sidebarLogo",
|
|
778
|
-
width: 108,
|
|
779
|
-
height: 40,
|
|
780
|
-
className: "object-contain"
|
|
781
|
-
}
|
|
782
|
-
))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex ml-[20px] items-center gap-2 mb-2 dark:text-[#f4f4f5cc]" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "text-primary" }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.Globe, { width: 20, height: 20 })), /* @__PURE__ */ import_react12.default.createElement("h3", { className: "text-[#3f3f46cc] dark:text-[#f4f4f5cc] font-medium" }, "Data Centers")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement(
|
|
783
|
-
CustomSelect,
|
|
784
|
-
{
|
|
785
|
-
heading: "",
|
|
786
|
-
label: "",
|
|
787
|
-
value: selectedCountry,
|
|
788
|
-
onChange: setSelectedCountry,
|
|
789
|
-
options: countryOptions,
|
|
790
|
-
placeholder: "Select country..."
|
|
791
|
-
}
|
|
792
|
-
))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "overflow-y-auto" }, /* @__PURE__ */ import_react12.default.createElement("div", null, navItemsLocal == null ? void 0 : navItemsLocal.map((item, index) => {
|
|
793
|
-
return /* @__PURE__ */ import_react12.default.createElement("div", { key: index, className: "" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
794
|
-
"div",
|
|
795
|
-
{
|
|
796
|
-
className: "flex items-center gap-3 p-2 hover:bg-accent dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] cursor-pointer rounded-lg ml-2",
|
|
797
|
-
onClick: (e) => {
|
|
798
|
-
item.onClick && item.onClick(e);
|
|
799
|
-
handleIconRotate(e, index);
|
|
800
|
-
}
|
|
801
|
-
},
|
|
802
|
-
/* @__PURE__ */ import_react12.default.createElement("div", { className: "text-primary" }, /* @__PURE__ */ import_react12.default.createElement(item.Icon, { width: 20, height: 20 })),
|
|
803
|
-
/* @__PURE__ */ import_react12.default.createElement("span", { className: "font-medium dark:text-[#f4f4f5cc]" }, item.label),
|
|
804
|
-
item.isDropDown && /* @__PURE__ */ import_react12.default.createElement("div", { className: `ml-auto transition-all delay-75` }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.ChevronDown, { width: 20, height: 20 }))
|
|
805
|
-
), item.options && item.options.length > 0 && /* @__PURE__ */ import_react12.default.createElement(
|
|
806
|
-
"div",
|
|
807
|
-
{
|
|
808
|
-
className: "ml-[20px] max-h-0 overflow-hidden flex flex-col",
|
|
809
|
-
id: `dropDownOptions-${index}`
|
|
810
|
-
},
|
|
811
|
-
item.options.map((options, optionsIndex) => {
|
|
812
|
-
return /* @__PURE__ */ import_react12.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
813
|
-
"div",
|
|
814
|
-
{
|
|
815
|
-
className: "flex items-center gap-3 p-2 hover:bg-accent dark:hover:bg-[#27272a] cursor-pointer",
|
|
816
|
-
onClick: (e) => {
|
|
817
|
-
options.onClick && options.onClick();
|
|
818
|
-
options.isDropDown && handleIconRotate(
|
|
819
|
-
e,
|
|
820
|
-
optionsIndex,
|
|
821
|
-
"subOption",
|
|
822
|
-
index
|
|
823
|
-
);
|
|
824
|
-
}
|
|
825
|
-
},
|
|
826
|
-
/* @__PURE__ */ import_react12.default.createElement("div", null),
|
|
827
|
-
/* @__PURE__ */ import_react12.default.createElement("span", { className: "font-medium text-sm dark:text-[#f4f4f5cc] ml-[8px]" }, options.label),
|
|
828
|
-
options.isDropDown && /* @__PURE__ */ import_react12.default.createElement(
|
|
829
|
-
"div",
|
|
830
|
-
{
|
|
831
|
-
className: `ml-auto transition-all delay-75`
|
|
832
|
-
},
|
|
833
|
-
/* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.ChevronDown, { width: 20, height: 20 })
|
|
834
|
-
)
|
|
835
|
-
), options.options && options.options.length > 1 && /* @__PURE__ */ import_react12.default.createElement(
|
|
836
|
-
"div",
|
|
837
|
-
{
|
|
838
|
-
className: "ml-[20px] max-h-0 overflow-hidden flex flex-col",
|
|
839
|
-
id: `dropDownOptions-${optionsIndex}-subOption-${index}`
|
|
840
|
-
},
|
|
841
|
-
options.options.map((subOption) => {
|
|
842
|
-
return /* @__PURE__ */ import_react12.default.createElement(
|
|
843
|
-
"div",
|
|
844
|
-
{
|
|
845
|
-
className: "p-2 rounded-lg hover:bg-accent dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] font-medium text-sm",
|
|
846
|
-
onClick: (e) => {
|
|
847
|
-
subOption.onClick && subOption.onClick();
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
subOption.label
|
|
851
|
-
);
|
|
852
|
-
})
|
|
853
|
-
));
|
|
854
|
-
})
|
|
855
|
-
));
|
|
856
|
-
}))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "mt-auto bg-[#fafafa] dark:bg-[#18181b] sticky bottom-0 pt-2" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
857
|
-
"div",
|
|
858
|
-
{
|
|
859
|
-
className: "flex items-center justify-between p-2 rounded-lg hover:bg-accent dark:hover:bg-[#27272a] cursor-pointer",
|
|
860
|
-
onClick: () => {
|
|
861
|
-
window.location.href = "/profile";
|
|
862
|
-
}
|
|
863
|
-
},
|
|
864
|
-
/* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "flex h-full w-full items-center justify-center rounded-full bg-muted dark:text-white" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "font-semibold dark:text-white" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin User"), /* @__PURE__ */ import_react12.default.createElement("p", { className: "text-sm dark:text-[#f4f4f5cc]" }, role))),
|
|
865
|
-
/* @__PURE__ */ import_react12.default.createElement("div", { className: "dark:text-[#f4f4f5cc]" }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.LogOut, null))
|
|
866
|
-
)));
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
// src/RightSheet/RightSheet.jsx
|
|
870
|
-
var import_react13 = __toESM(require("react"));
|
|
871
|
-
var RightSheet = ({
|
|
872
|
-
open,
|
|
873
|
-
setOpen,
|
|
874
|
-
children,
|
|
875
|
-
callBack,
|
|
876
|
-
actionLabel = "Save",
|
|
877
|
-
onAction = () => {
|
|
878
|
-
}
|
|
879
|
-
}) => {
|
|
880
|
-
const [visible, setVisible] = (0, import_react13.useState)(open);
|
|
881
|
-
(0, import_react13.useEffect)(() => {
|
|
882
|
-
if (open) {
|
|
883
|
-
document.body.style.overflow = "hidden";
|
|
884
|
-
setVisible(true);
|
|
885
|
-
}
|
|
886
|
-
return () => {
|
|
887
|
-
document.body.style.overflow = "auto";
|
|
888
|
-
};
|
|
889
|
-
}, [open]);
|
|
890
|
-
const handleClose = () => {
|
|
891
|
-
setVisible(false);
|
|
892
|
-
setTimeout(() => {
|
|
893
|
-
setOpen(false);
|
|
894
|
-
callBack();
|
|
895
|
-
}, 200);
|
|
896
|
-
};
|
|
897
|
-
const handleAction = () => {
|
|
898
|
-
onAction();
|
|
899
|
-
handleClose();
|
|
900
|
-
};
|
|
901
|
-
if (!visible) return null;
|
|
902
|
-
return /* @__PURE__ */ import_react13.default.createElement(
|
|
903
|
-
"div",
|
|
904
|
-
{
|
|
905
|
-
className: "fixed inset-0 overflow-x-hidden bg-black/80 sheetPopIn h-full overflow-auto ",
|
|
906
|
-
onClick: handleClose
|
|
907
|
-
},
|
|
908
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
909
|
-
"div",
|
|
910
|
-
{
|
|
911
|
-
className: `absolute flex flex-col right-0 top-0 min-h-full min-w-[100%] md:min-w-[576px]
|
|
912
|
-
${visible ? "sheetRightSlide" : "transition-all duration-200 translate-x-[100%]"} justify-between bg-[#fff] dark:bg-[#18181b] dark:text-white`,
|
|
913
|
-
onClick: (e) => e.stopPropagation()
|
|
914
|
-
},
|
|
915
|
-
/* @__PURE__ */ import_react13.default.createElement("div", { className: " min-h-full " }, children),
|
|
916
|
-
/* @__PURE__ */ import_react13.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] dark:border-[#303036] dark:bg-[#18181b] dark:text-white" }, /* @__PURE__ */ import_react13.default.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose() }, "Cancel"), /* @__PURE__ */ import_react13.default.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction }, actionLabel))
|
|
917
|
-
)
|
|
918
|
-
);
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
// src/Table/CustomTable.jsx
|
|
922
|
-
var import_react14 = __toESM(require("react"));
|
|
923
|
-
var CustomTable = ({
|
|
924
|
-
tableHeader,
|
|
925
|
-
setIsAllChecked,
|
|
926
|
-
isAllChecked,
|
|
927
|
-
children,
|
|
928
|
-
isHideCheckbox = "false"
|
|
929
|
-
}) => {
|
|
930
|
-
return /* @__PURE__ */ import_react14.default.createElement("div", { className: "border border-[#e5e5e5] dark:border-[#303036] rounded-lg overflow-x-auto" }, /* @__PURE__ */ import_react14.default.createElement("div", { className: "w-full relative overflow-x-auto" }, /* @__PURE__ */ import_react14.default.createElement("table", { className: "w-full caption-bottom text-sm overflow-x-auto bg-white dark:bg-[#18181b] table-fixed border-collapse" }, /* @__PURE__ */ import_react14.default.createElement("thead", { className: "border-b border-[#e5e5e5] dark:bg-[#18181b]" }, /* @__PURE__ */ import_react14.default.createElement(
|
|
931
|
-
"tr",
|
|
932
|
-
{
|
|
933
|
-
className: "transition-colors text-[#737373] hover:bg-muted/50 \r\n data-[state=selected]:bg-muted"
|
|
934
|
-
},
|
|
935
|
-
!isHideCheckbox && /* @__PURE__ */ import_react14.default.createElement("th", { className: "px-4 py-3 text-left w-[50px]" }, /* @__PURE__ */ import_react14.default.createElement(
|
|
936
|
-
CustomCheckbox,
|
|
937
|
-
{
|
|
938
|
-
checked: isAllChecked,
|
|
939
|
-
onChange: () => {
|
|
940
|
-
setIsAllChecked(!isAllChecked);
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
)),
|
|
944
|
-
tableHeader.map((header, index) => {
|
|
945
|
-
return /* @__PURE__ */ import_react14.default.createElement(
|
|
946
|
-
"th",
|
|
947
|
-
{
|
|
948
|
-
className: `px-4 py-3 text-sm dark:bg-[#18181b] font-medium ${index == tableHeader.length - 1 ? "text-right" : "text-left"}`,
|
|
949
|
-
key: header + index
|
|
950
|
-
},
|
|
951
|
-
header
|
|
952
|
-
);
|
|
953
|
-
})
|
|
954
|
-
)), /* @__PURE__ */ import_react14.default.createElement("tbody", null, children))));
|
|
955
|
-
};
|
|
956
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
957
|
-
0 && (module.exports = {
|
|
958
|
-
AppSideBar,
|
|
959
|
-
Chip,
|
|
960
|
-
CustomAutocomplete,
|
|
961
|
-
CustomButton,
|
|
962
|
-
CustomCheckbox,
|
|
963
|
-
CustomInput,
|
|
964
|
-
CustomSearch,
|
|
965
|
-
CustomSelect,
|
|
966
|
-
CustomSwitch,
|
|
967
|
-
CustomTable,
|
|
968
|
-
CustomTextarea,
|
|
969
|
-
CustomUpload,
|
|
970
|
-
ProgressBar,
|
|
971
|
-
RightSheet
|
|
972
|
-
});
|
|
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 dark:bg-[#18181b] dark:text-white",
|
|
60
|
+
SECONDARY: "bg-primary text-white dark:text-white",
|
|
61
|
+
DEFAULT: "bg-white text-black dark:text-white",
|
|
62
|
+
DANGER: "bg-[#ef4444] text-white dark:text-white"
|
|
63
|
+
};
|
|
64
|
+
var CustomButton = ({
|
|
65
|
+
variant = "DEFAULT",
|
|
66
|
+
children,
|
|
67
|
+
className,
|
|
68
|
+
onClick,
|
|
69
|
+
disabled = false,
|
|
70
|
+
icon
|
|
71
|
+
}) => {
|
|
72
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: cn(
|
|
76
|
+
`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`,
|
|
77
|
+
variantStyles[variant],
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
onClick
|
|
81
|
+
},
|
|
82
|
+
icon && /* @__PURE__ */ import_react.default.createElement("div", null, icon),
|
|
83
|
+
children
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// src/inputs/Autocomplete.jsx
|
|
88
|
+
var import_react2 = __toESM(require("react"));
|
|
89
|
+
var import_lucide_react = require("lucide-react");
|
|
90
|
+
var CustomAutocomplete = ({
|
|
91
|
+
label,
|
|
92
|
+
value,
|
|
93
|
+
onChange,
|
|
94
|
+
options,
|
|
95
|
+
placeholder = "Search & select...",
|
|
96
|
+
isRequired = false,
|
|
97
|
+
error,
|
|
98
|
+
heading,
|
|
99
|
+
disabled = false
|
|
100
|
+
}) => {
|
|
101
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
102
|
+
const [search, setSearch] = (0, import_react2.useState)("");
|
|
103
|
+
const wrapperRef = (0, import_react2.useRef)(null);
|
|
104
|
+
const selectedOptions = options.filter((opt) => value.includes(opt.value));
|
|
105
|
+
const handleBlur = (e) => {
|
|
106
|
+
var _a;
|
|
107
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
108
|
+
setOpen(false);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const filteredOptions = options.filter(
|
|
112
|
+
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
113
|
+
);
|
|
114
|
+
const toggleValue = (val) => {
|
|
115
|
+
if (value.includes(val)) {
|
|
116
|
+
onChange(value.filter((v) => v !== val));
|
|
117
|
+
} else {
|
|
118
|
+
onChange([...value, val]);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
className: "flex flex-col w-full relative dark:bg-[#18181b] dark:text-white",
|
|
125
|
+
ref: wrapperRef,
|
|
126
|
+
tabIndex: disabled ? -1 : 0,
|
|
127
|
+
onBlur: handleBlur
|
|
128
|
+
},
|
|
129
|
+
heading && /* @__PURE__ */ import_react2.default.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1" }, heading),
|
|
130
|
+
label && /* @__PURE__ */ import_react2.default.createElement(
|
|
131
|
+
"label",
|
|
132
|
+
{
|
|
133
|
+
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black"}`
|
|
134
|
+
},
|
|
135
|
+
label,
|
|
136
|
+
" ",
|
|
137
|
+
isRequired && /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-red-500" }, "*")
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
onClick: () => {
|
|
143
|
+
if (!disabled) setOpen((prev) => !prev);
|
|
144
|
+
},
|
|
145
|
+
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 dark:bg-[#18181b] dark:text-white
|
|
146
|
+
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
147
|
+
${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"}
|
|
148
|
+
`
|
|
149
|
+
},
|
|
150
|
+
/* @__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(
|
|
151
|
+
"span",
|
|
152
|
+
{
|
|
153
|
+
key: opt.value,
|
|
154
|
+
className: "bg-gray-100 border border-gray-300 px-2 dark:bg-gray-800 dark:text-white py-0.5 rounded text-xs flex items-center gap-1"
|
|
155
|
+
},
|
|
156
|
+
opt.label,
|
|
157
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
onClick: (e) => {
|
|
161
|
+
e.stopPropagation();
|
|
162
|
+
toggleValue(opt.value);
|
|
163
|
+
},
|
|
164
|
+
className: "text-gray-500 hover:text-gray-700 dark:text-white"
|
|
165
|
+
},
|
|
166
|
+
"\u2715"
|
|
167
|
+
)
|
|
168
|
+
)) : /* @__PURE__ */ import_react2.default.createElement("span", { className: "text-gray-400" }, placeholder)),
|
|
169
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
170
|
+
import_lucide_react.ChevronDown,
|
|
171
|
+
{
|
|
172
|
+
className: `w-4 h-4 text-gray-500 transition-transform ${open ? "rotate-180" : ""}`
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
),
|
|
176
|
+
!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 dark:bg-[#18181b] dark:text-white" }, /* @__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(
|
|
177
|
+
"input",
|
|
178
|
+
{
|
|
179
|
+
type: "text",
|
|
180
|
+
value: search,
|
|
181
|
+
onChange: (e) => setSearch(e.target.value),
|
|
182
|
+
placeholder: "Search...",
|
|
183
|
+
className: "flex-1 text-sm focus:outline-none"
|
|
184
|
+
}
|
|
185
|
+
)), /* @__PURE__ */ import_react2.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
186
|
+
const selected = value.includes(opt.value);
|
|
187
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
188
|
+
"li",
|
|
189
|
+
{
|
|
190
|
+
key: opt.value,
|
|
191
|
+
onClick: () => toggleValue(opt.value),
|
|
192
|
+
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 ${selected ? "bg-gray-50 font-medium" : ""}`
|
|
193
|
+
},
|
|
194
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
195
|
+
"span",
|
|
196
|
+
{
|
|
197
|
+
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"}`
|
|
198
|
+
},
|
|
199
|
+
selected && /* @__PURE__ */ import_react2.default.createElement(import_lucide_react.Check, { size: 14 })
|
|
200
|
+
),
|
|
201
|
+
opt.label
|
|
202
|
+
);
|
|
203
|
+
}) : /* @__PURE__ */ import_react2.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400" }, "No results found")))
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/inputs/Checkbox.jsx
|
|
208
|
+
var import_react3 = __toESM(require("react"));
|
|
209
|
+
var CustomCheckbox = ({ onChange, checked }) => {
|
|
210
|
+
const handleChange = (e) => {
|
|
211
|
+
onChange(e.target.checked);
|
|
212
|
+
};
|
|
213
|
+
return /* @__PURE__ */ import_react3.default.createElement("label", { className: "inline-flex items-center cursor-pointer select-none" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
214
|
+
"input",
|
|
215
|
+
{
|
|
216
|
+
type: "checkbox",
|
|
217
|
+
checked,
|
|
218
|
+
onChange: handleChange,
|
|
219
|
+
className: "peer hidden"
|
|
220
|
+
}
|
|
221
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
222
|
+
"span",
|
|
223
|
+
{
|
|
224
|
+
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 "
|
|
225
|
+
},
|
|
226
|
+
checked && /* @__PURE__ */ import_react3.default.createElement(
|
|
227
|
+
"svg",
|
|
228
|
+
{
|
|
229
|
+
className: "w-4 h-4 text-white",
|
|
230
|
+
fill: "none",
|
|
231
|
+
stroke: "currentColor",
|
|
232
|
+
strokeWidth: "3",
|
|
233
|
+
viewBox: "0 0 24 24"
|
|
234
|
+
},
|
|
235
|
+
/* @__PURE__ */ import_react3.default.createElement("path", { d: "M5 13l4 4L19 7" })
|
|
236
|
+
)
|
|
237
|
+
));
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// src/inputs/Chip.jsx
|
|
241
|
+
var import_react4 = __toESM(require("react"));
|
|
242
|
+
var VARIANTS = {
|
|
243
|
+
PRIMARY: "bg-gray-100 text-black dark:bg-gray-800 dark:text-white",
|
|
244
|
+
GREEN: "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",
|
|
245
|
+
RED: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100",
|
|
246
|
+
YELLOW: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
|
|
247
|
+
};
|
|
248
|
+
var Chip = ({ label, variant }) => {
|
|
249
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`
|
|
253
|
+
},
|
|
254
|
+
label
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// src/inputs/CustomSwitch.jsx
|
|
259
|
+
var import_react5 = __toESM(require("react"));
|
|
260
|
+
var CustomSwitch = ({ checked, onChange, label, description }) => {
|
|
261
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement(
|
|
262
|
+
"button",
|
|
263
|
+
{
|
|
264
|
+
type: "button",
|
|
265
|
+
role: "switch",
|
|
266
|
+
"aria-checked": checked,
|
|
267
|
+
onClick: () => onChange(!checked),
|
|
268
|
+
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`
|
|
269
|
+
},
|
|
270
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
271
|
+
"span",
|
|
272
|
+
{
|
|
273
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
), /* @__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)));
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
// src/inputs/Input.jsx
|
|
280
|
+
var import_react6 = __toESM(require("react"));
|
|
281
|
+
var CustomInput = ({
|
|
282
|
+
label,
|
|
283
|
+
isRequired,
|
|
284
|
+
value,
|
|
285
|
+
onChange,
|
|
286
|
+
placeholder,
|
|
287
|
+
disabled = false,
|
|
288
|
+
error,
|
|
289
|
+
heading
|
|
290
|
+
}) => {
|
|
291
|
+
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(
|
|
292
|
+
"label",
|
|
293
|
+
{
|
|
294
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`
|
|
295
|
+
},
|
|
296
|
+
label,
|
|
297
|
+
" ",
|
|
298
|
+
isRequired && /* @__PURE__ */ import_react6.default.createElement("span", { className: "text-red-500" }, "*")
|
|
299
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
300
|
+
"input",
|
|
301
|
+
{
|
|
302
|
+
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
303
|
+
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
304
|
+
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
305
|
+
${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%)]"}
|
|
306
|
+
`,
|
|
307
|
+
value,
|
|
308
|
+
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
309
|
+
placeholder,
|
|
310
|
+
disabled,
|
|
311
|
+
readOnly: disabled
|
|
312
|
+
}
|
|
313
|
+
));
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// src/inputs/ProgressBar.jsx
|
|
317
|
+
var import_react7 = __toESM(require("react"));
|
|
318
|
+
var ProgressBar = ({ step, totalSteps }) => {
|
|
319
|
+
const progress = step / totalSteps * 100;
|
|
320
|
+
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(
|
|
321
|
+
"div",
|
|
322
|
+
{
|
|
323
|
+
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
324
|
+
style: { width: `${progress}%` }
|
|
325
|
+
}
|
|
326
|
+
)));
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// src/inputs/Search.jsx
|
|
330
|
+
var import_react8 = __toESM(require("react"));
|
|
331
|
+
var import_lucide_react2 = require("lucide-react");
|
|
332
|
+
var CustomSearch = ({
|
|
333
|
+
value,
|
|
334
|
+
onChange,
|
|
335
|
+
placeholder = "Search Markets..."
|
|
336
|
+
}) => {
|
|
337
|
+
return /* @__PURE__ */ import_react8.default.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" }, /* @__PURE__ */ import_react8.default.createElement(import_lucide_react2.Search, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ import_react8.default.createElement(
|
|
338
|
+
"input",
|
|
339
|
+
{
|
|
340
|
+
type: "text",
|
|
341
|
+
value,
|
|
342
|
+
onChange,
|
|
343
|
+
placeholder,
|
|
344
|
+
className: "bg-transparent w-full h-full focus:outline-none"
|
|
345
|
+
}
|
|
346
|
+
));
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
// src/inputs/TextArea.jsx
|
|
350
|
+
var import_react9 = __toESM(require("react"));
|
|
351
|
+
var CustomTextarea = ({
|
|
352
|
+
label,
|
|
353
|
+
isRequired,
|
|
354
|
+
value,
|
|
355
|
+
onChange,
|
|
356
|
+
placeholder,
|
|
357
|
+
disabled = false,
|
|
358
|
+
error,
|
|
359
|
+
heading,
|
|
360
|
+
rows = 4
|
|
361
|
+
}) => {
|
|
362
|
+
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(
|
|
363
|
+
"label",
|
|
364
|
+
{
|
|
365
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`
|
|
366
|
+
},
|
|
367
|
+
label,
|
|
368
|
+
" ",
|
|
369
|
+
isRequired && /* @__PURE__ */ import_react9.default.createElement("span", { className: "text-red-500" }, "*")
|
|
370
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
371
|
+
"textarea",
|
|
372
|
+
{
|
|
373
|
+
rows,
|
|
374
|
+
className: `border rounded-md px-4 py-2 w-full text-[14px]
|
|
375
|
+
focus:outline-2 focus:outline-black focus:outline-offset-2
|
|
376
|
+
focus:ring-0 focus:shadow-none focus:border-black
|
|
377
|
+
${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%)]"}
|
|
378
|
+
`,
|
|
379
|
+
value,
|
|
380
|
+
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
381
|
+
placeholder,
|
|
382
|
+
disabled,
|
|
383
|
+
readOnly: disabled
|
|
384
|
+
}
|
|
385
|
+
));
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
// src/inputs/Upload.jsx
|
|
389
|
+
var import_react10 = __toESM(require("react"));
|
|
390
|
+
var import_lucide_react3 = require("lucide-react");
|
|
391
|
+
var CustomUpload = ({
|
|
392
|
+
label = "Supporting documents",
|
|
393
|
+
description = "Drop items here or Browse Files",
|
|
394
|
+
accept = ".pdf,.jpg,.jpeg,.png",
|
|
395
|
+
maxSizeMB = 5,
|
|
396
|
+
onChange,
|
|
397
|
+
error,
|
|
398
|
+
value
|
|
399
|
+
}) => {
|
|
400
|
+
const inputRef = (0, import_react10.useRef)(null);
|
|
401
|
+
const handleFileSelect = (files) => {
|
|
402
|
+
if (!files || files.length === 0) return;
|
|
403
|
+
const selectedFile = files[0];
|
|
404
|
+
if (selectedFile.size > maxSizeMB * 1024 * 1024) {
|
|
405
|
+
alert(`File size must be less than ${maxSizeMB} MB`);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
onChange == null ? void 0 : onChange(selectedFile);
|
|
409
|
+
};
|
|
410
|
+
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(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
414
|
+
${error ? "border-red-500 bg-red-50" : "border-gray-300 hover:border-gray-400 bg-gray-50"}`,
|
|
415
|
+
onClick: () => {
|
|
416
|
+
var _a;
|
|
417
|
+
return (_a = inputRef.current) == null ? void 0 : _a.click();
|
|
418
|
+
},
|
|
419
|
+
onDragOver: (e) => e.preventDefault(),
|
|
420
|
+
onDrop: (e) => {
|
|
421
|
+
e.preventDefault();
|
|
422
|
+
handleFileSelect(e.dataTransfer.files);
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
/* @__PURE__ */ import_react10.default.createElement(import_lucide_react3.Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
426
|
+
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-sm text-gray-700" }, description),
|
|
427
|
+
/* @__PURE__ */ import_react10.default.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
428
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
429
|
+
"input",
|
|
430
|
+
{
|
|
431
|
+
ref: inputRef,
|
|
432
|
+
type: "file",
|
|
433
|
+
accept,
|
|
434
|
+
className: "hidden",
|
|
435
|
+
onChange: (e) => handleFileSelect(e.target.files)
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
), 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));
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// src/sideBar/SideBar.jsx
|
|
442
|
+
var import_lucide_react6 = require("lucide-react");
|
|
443
|
+
var import_react12 = __toESM(require("react"));
|
|
444
|
+
|
|
445
|
+
// ConstantUI.js
|
|
446
|
+
var import_lucide_react4 = require("lucide-react");
|
|
447
|
+
var encodedAuthData = localStorage.getItem("encodedAuthData");
|
|
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.open("https://viz.jett.travel", "_blank");
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
label: "Tags",
|
|
498
|
+
onClick: () => {
|
|
499
|
+
window.location.href = "/orgselector/?path=tag";
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
label: "Users",
|
|
504
|
+
onClick: () => {
|
|
505
|
+
window.location.href = "/orgselector/?path=users";
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
isDropDown: true
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
Icon: import_lucide_react4.Banknote,
|
|
513
|
+
label: "Finance",
|
|
514
|
+
onClick: () => {
|
|
515
|
+
},
|
|
516
|
+
isDropDown: true,
|
|
517
|
+
options: [
|
|
518
|
+
{
|
|
519
|
+
label: "Invoices",
|
|
520
|
+
onClick: () => {
|
|
521
|
+
window.location.href = "/finance/invoices/";
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
label: "Booking History",
|
|
526
|
+
onClick: () => {
|
|
527
|
+
window.location.href = "/finance/bookingHistory/";
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
label: "Payments Ledger",
|
|
532
|
+
onClick: () => {
|
|
533
|
+
window.location.href = "/finance/paymentsLedger/";
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
]
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
Icon: import_lucide_react4.DollarSign,
|
|
540
|
+
label: "Revenue Management",
|
|
541
|
+
onClick: () => {
|
|
542
|
+
},
|
|
543
|
+
isDropDown: true,
|
|
544
|
+
options: [
|
|
545
|
+
{
|
|
546
|
+
label: "Pricing Policy",
|
|
547
|
+
onClick: () => {
|
|
548
|
+
window.location.href = "/orgselector/?path=pricing-policy";
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
label: "Offers",
|
|
553
|
+
onClick: () => {
|
|
554
|
+
window.location.href = "/orgselector/?path=offer";
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
label: "Vouchers",
|
|
559
|
+
onClick: () => {
|
|
560
|
+
window.location.href = "/orgselector/?path=voucher";
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
label: "Supplier Deals",
|
|
565
|
+
onClick: () => {
|
|
566
|
+
window.location.href = "/supplierdeals/";
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
label: "Subscription Plans",
|
|
571
|
+
onClick: () => {
|
|
572
|
+
window.location.href = "/subscription/";
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
Icon: import_lucide_react4.Cog,
|
|
579
|
+
label: "Settings",
|
|
580
|
+
onClick: () => {
|
|
581
|
+
},
|
|
582
|
+
isDropDown: true,
|
|
583
|
+
options: [
|
|
584
|
+
{
|
|
585
|
+
label: "Admin user Management",
|
|
586
|
+
isDropDown: true,
|
|
587
|
+
onClick: () => {
|
|
588
|
+
},
|
|
589
|
+
options: [
|
|
590
|
+
{
|
|
591
|
+
label: "Admin Users",
|
|
592
|
+
onClick: () => {
|
|
593
|
+
window.location.href = "/users/";
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
{ label: "Admin User Attributes", onClick: () => {
|
|
597
|
+
} }
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
label: "TMC Markets",
|
|
602
|
+
onClick: () => {
|
|
603
|
+
window.location.href = "/market/";
|
|
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 = "/whitelabel/";
|
|
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/logo-white.svg
|
|
632
|
+
var logo_white_default = "./logo-white-RYMEJOWI.svg";
|
|
633
|
+
|
|
634
|
+
// src/sideBar/SideBar.jsx
|
|
635
|
+
var import_js_cookie = __toESM(require("js-cookie"));
|
|
636
|
+
|
|
637
|
+
// src/inputs/CustomSelect.jsx
|
|
638
|
+
var import_react11 = __toESM(require("react"));
|
|
639
|
+
var import_lucide_react5 = require("lucide-react");
|
|
640
|
+
var CustomSelect = ({
|
|
641
|
+
label,
|
|
642
|
+
value,
|
|
643
|
+
onChange,
|
|
644
|
+
options,
|
|
645
|
+
placeholder = "Select...",
|
|
646
|
+
isRequired = false,
|
|
647
|
+
error,
|
|
648
|
+
heading,
|
|
649
|
+
disabled = false
|
|
650
|
+
}) => {
|
|
651
|
+
const [open, setOpen] = (0, import_react11.useState)(false);
|
|
652
|
+
const [search, setSearch] = (0, import_react11.useState)("");
|
|
653
|
+
const wrapperRef = (0, import_react11.useRef)(null);
|
|
654
|
+
const handleBlur = (e) => {
|
|
655
|
+
var _a;
|
|
656
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
657
|
+
setOpen(false);
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
const filteredOptions = options.filter(
|
|
661
|
+
(opt) => opt.label.toLowerCase().includes(search.toLowerCase())
|
|
662
|
+
);
|
|
663
|
+
const handleSelect = (val) => {
|
|
664
|
+
onChange(val);
|
|
665
|
+
setOpen(false);
|
|
666
|
+
};
|
|
667
|
+
const selectedOption = options.find((opt) => opt.value === value);
|
|
668
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
669
|
+
"div",
|
|
670
|
+
{
|
|
671
|
+
className: "flex flex-col w-full relative",
|
|
672
|
+
ref: wrapperRef,
|
|
673
|
+
tabIndex: disabled ? -1 : 0,
|
|
674
|
+
onBlur: handleBlur
|
|
675
|
+
},
|
|
676
|
+
heading && /* @__PURE__ */ import_react11.default.createElement("h3", { className: "text-lg font-semibold mb-1" }, heading),
|
|
677
|
+
label && /* @__PURE__ */ import_react11.default.createElement(
|
|
678
|
+
"label",
|
|
679
|
+
{
|
|
680
|
+
className: `font-medium text-sm mb-1 ${heading ? "text-[#737373] dark:text-white" : "text-black dark:text-white"}`
|
|
681
|
+
},
|
|
682
|
+
label,
|
|
683
|
+
" ",
|
|
684
|
+
isRequired && /* @__PURE__ */ import_react11.default.createElement("span", { className: "text-red-500" }, "*")
|
|
685
|
+
),
|
|
686
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
687
|
+
"div",
|
|
688
|
+
{
|
|
689
|
+
onClick: () => !disabled && setOpen((prev) => !prev),
|
|
690
|
+
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
|
|
691
|
+
${disabled ? "bg-gray-100 text-gray-400" : "bg-white dark:bg-[#18181b] dark:text-white"}
|
|
692
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
693
|
+
`
|
|
694
|
+
},
|
|
695
|
+
/* @__PURE__ */ import_react11.default.createElement("span", { className: `${selectedOption ? "text-black dark:text-white" : "text-gray-400 dark:text-white"}` }, selectedOption ? selectedOption.label : placeholder),
|
|
696
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
697
|
+
import_lucide_react5.ChevronDown,
|
|
698
|
+
{
|
|
699
|
+
className: `w-4 h-4 text-gray-500 transition-transform dark:text-white ${open ? "rotate-180" : ""}`
|
|
700
|
+
}
|
|
701
|
+
)
|
|
702
|
+
),
|
|
703
|
+
open && !disabled && /* @__PURE__ */ import_react11.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 dark:bg-[#18181b] dark:text-white" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ import_react11.default.createElement(import_lucide_react5.Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ import_react11.default.createElement(
|
|
704
|
+
"input",
|
|
705
|
+
{
|
|
706
|
+
type: "text",
|
|
707
|
+
value: search,
|
|
708
|
+
onChange: (e) => setSearch(e.target.value),
|
|
709
|
+
placeholder: "Search...",
|
|
710
|
+
className: "flex-1 text-sm focus:outline-none"
|
|
711
|
+
}
|
|
712
|
+
)), /* @__PURE__ */ import_react11.default.createElement("ul", null, filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ import_react11.default.createElement(
|
|
713
|
+
"li",
|
|
714
|
+
{
|
|
715
|
+
key: opt.value,
|
|
716
|
+
onClick: () => handleSelect(opt.value),
|
|
717
|
+
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" : ""}`
|
|
718
|
+
},
|
|
719
|
+
opt.label
|
|
720
|
+
)) : /* @__PURE__ */ import_react11.default.createElement("li", { className: "px-3 py-2 text-sm text-gray-400 dark:text-white" }, "No results found")))
|
|
721
|
+
);
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
// src/sideBar/SideBar.jsx
|
|
725
|
+
var AppSideBar = ({
|
|
726
|
+
username,
|
|
727
|
+
role,
|
|
728
|
+
navItems,
|
|
729
|
+
additionalItems,
|
|
730
|
+
sideBarLogo
|
|
731
|
+
}) => {
|
|
732
|
+
var _a, _b;
|
|
733
|
+
const [authData, setAuthData] = (0, import_react12.useState)(null);
|
|
734
|
+
const [selectedCountry, setSelectedCountry] = (0, import_react12.useState)("dubai");
|
|
735
|
+
const countryOptions = [
|
|
736
|
+
{ label: "India", value: "india" },
|
|
737
|
+
{ label: "Dubai", value: "dubai" },
|
|
738
|
+
{ label: "Singapore", value: "singapore" },
|
|
739
|
+
{ label: "Qatar", value: "qatar" }
|
|
740
|
+
];
|
|
741
|
+
const handleIconRotate = (e, index, additionalKey, parentIndex) => {
|
|
742
|
+
let dropDownIcon = e.currentTarget.children[2];
|
|
743
|
+
if (!dropDownIcon) return;
|
|
744
|
+
if (dropDownIcon.classList.contains("rotate-180")) {
|
|
745
|
+
dropDownIcon.classList.remove("rotate-180");
|
|
746
|
+
} else {
|
|
747
|
+
dropDownIcon.classList.add("transition-all");
|
|
748
|
+
dropDownIcon.classList.add("rotate-180");
|
|
749
|
+
}
|
|
750
|
+
const optionsContainer = document.getElementById(
|
|
751
|
+
`dropDownOptions-${index}${additionalKey ? `-${additionalKey}` : ""}${parentIndex ? `-${parentIndex}` : ""}`
|
|
752
|
+
);
|
|
753
|
+
if (!optionsContainer) return;
|
|
754
|
+
optionsContainer.classList.add("transition-all");
|
|
755
|
+
if (optionsContainer.classList.contains("max-h-0")) {
|
|
756
|
+
optionsContainer.classList.remove("max-h-0");
|
|
757
|
+
optionsContainer.classList.add("min-h-[50px]");
|
|
758
|
+
} else {
|
|
759
|
+
optionsContainer.classList.remove("min-h-[50px]");
|
|
760
|
+
optionsContainer.classList.add("max-h-0");
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
(0, import_react12.useEffect)(() => {
|
|
764
|
+
const storedAuthData = localStorage.getItem("authData");
|
|
765
|
+
if (storedAuthData) {
|
|
766
|
+
let parseData = JSON.parse(storedAuthData);
|
|
767
|
+
setAuthData(parseData);
|
|
768
|
+
}
|
|
769
|
+
}, [localStorage.getItem("authData")]);
|
|
770
|
+
const navItemsLocal = navItems ?? navItemsConstant;
|
|
771
|
+
const additionalItemsLocal = additionalItems ?? additionalItemsConstant;
|
|
772
|
+
const sideBarLogoLocal = sideBarLogo ?? logo_white_default;
|
|
773
|
+
return /* @__PURE__ */ import_react12.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] dark:bg-[#18181b]" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "p-2 mb-2" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
774
|
+
"img",
|
|
775
|
+
{
|
|
776
|
+
src: sideBarLogoLocal,
|
|
777
|
+
alt: "sidebarLogo",
|
|
778
|
+
width: 108,
|
|
779
|
+
height: 40,
|
|
780
|
+
className: "object-contain"
|
|
781
|
+
}
|
|
782
|
+
))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "mb-4" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex ml-[20px] items-center gap-2 mb-2 dark:text-[#f4f4f5cc]" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "text-primary" }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.Globe, { width: 20, height: 20 })), /* @__PURE__ */ import_react12.default.createElement("h3", { className: "text-[#3f3f46cc] dark:text-[#f4f4f5cc] font-medium" }, "Data Centers")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement(
|
|
783
|
+
CustomSelect,
|
|
784
|
+
{
|
|
785
|
+
heading: "",
|
|
786
|
+
label: "",
|
|
787
|
+
value: selectedCountry,
|
|
788
|
+
onChange: setSelectedCountry,
|
|
789
|
+
options: countryOptions,
|
|
790
|
+
placeholder: "Select country..."
|
|
791
|
+
}
|
|
792
|
+
))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "overflow-y-auto" }, /* @__PURE__ */ import_react12.default.createElement("div", null, navItemsLocal == null ? void 0 : navItemsLocal.map((item, index) => {
|
|
793
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", { key: index, className: "" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
794
|
+
"div",
|
|
795
|
+
{
|
|
796
|
+
className: "flex items-center gap-3 p-2 hover:bg-accent dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] cursor-pointer rounded-lg ml-2",
|
|
797
|
+
onClick: (e) => {
|
|
798
|
+
item.onClick && item.onClick(e);
|
|
799
|
+
handleIconRotate(e, index);
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
/* @__PURE__ */ import_react12.default.createElement("div", { className: "text-primary" }, /* @__PURE__ */ import_react12.default.createElement(item.Icon, { width: 20, height: 20 })),
|
|
803
|
+
/* @__PURE__ */ import_react12.default.createElement("span", { className: "font-medium dark:text-[#f4f4f5cc]" }, item.label),
|
|
804
|
+
item.isDropDown && /* @__PURE__ */ import_react12.default.createElement("div", { className: `ml-auto transition-all delay-75` }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.ChevronDown, { width: 20, height: 20 }))
|
|
805
|
+
), item.options && item.options.length > 0 && /* @__PURE__ */ import_react12.default.createElement(
|
|
806
|
+
"div",
|
|
807
|
+
{
|
|
808
|
+
className: "ml-[20px] max-h-0 overflow-hidden flex flex-col",
|
|
809
|
+
id: `dropDownOptions-${index}`
|
|
810
|
+
},
|
|
811
|
+
item.options.map((options, optionsIndex) => {
|
|
812
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
813
|
+
"div",
|
|
814
|
+
{
|
|
815
|
+
className: "flex items-center gap-3 p-2 hover:bg-accent dark:hover:bg-[#27272a] cursor-pointer",
|
|
816
|
+
onClick: (e) => {
|
|
817
|
+
options.onClick && options.onClick();
|
|
818
|
+
options.isDropDown && handleIconRotate(
|
|
819
|
+
e,
|
|
820
|
+
optionsIndex,
|
|
821
|
+
"subOption",
|
|
822
|
+
index
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
/* @__PURE__ */ import_react12.default.createElement("div", null),
|
|
827
|
+
/* @__PURE__ */ import_react12.default.createElement("span", { className: "font-medium text-sm dark:text-[#f4f4f5cc] ml-[8px]" }, options.label),
|
|
828
|
+
options.isDropDown && /* @__PURE__ */ import_react12.default.createElement(
|
|
829
|
+
"div",
|
|
830
|
+
{
|
|
831
|
+
className: `ml-auto transition-all delay-75`
|
|
832
|
+
},
|
|
833
|
+
/* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.ChevronDown, { width: 20, height: 20 })
|
|
834
|
+
)
|
|
835
|
+
), options.options && options.options.length > 1 && /* @__PURE__ */ import_react12.default.createElement(
|
|
836
|
+
"div",
|
|
837
|
+
{
|
|
838
|
+
className: "ml-[20px] max-h-0 overflow-hidden flex flex-col",
|
|
839
|
+
id: `dropDownOptions-${optionsIndex}-subOption-${index}`
|
|
840
|
+
},
|
|
841
|
+
options.options.map((subOption) => {
|
|
842
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
843
|
+
"div",
|
|
844
|
+
{
|
|
845
|
+
className: "p-2 rounded-lg hover:bg-accent dark:hover:bg-[#27272a] dark:text-[#f4f4f5cc] font-medium text-sm",
|
|
846
|
+
onClick: (e) => {
|
|
847
|
+
subOption.onClick && subOption.onClick();
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
subOption.label
|
|
851
|
+
);
|
|
852
|
+
})
|
|
853
|
+
));
|
|
854
|
+
})
|
|
855
|
+
));
|
|
856
|
+
}))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "mt-auto bg-[#fafafa] dark:bg-[#18181b] sticky bottom-0 pt-2" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
857
|
+
"div",
|
|
858
|
+
{
|
|
859
|
+
className: "flex items-center justify-between p-2 rounded-lg hover:bg-accent dark:hover:bg-[#27272a] cursor-pointer",
|
|
860
|
+
onClick: () => {
|
|
861
|
+
window.location.href = "/profile";
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
/* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "flex h-full w-full items-center justify-center rounded-full bg-muted dark:text-white" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "font-semibold dark:text-white" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin User"), /* @__PURE__ */ import_react12.default.createElement("p", { className: "text-sm dark:text-[#f4f4f5cc]" }, role))),
|
|
865
|
+
/* @__PURE__ */ import_react12.default.createElement("div", { className: "dark:text-[#f4f4f5cc]" }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.LogOut, null))
|
|
866
|
+
)));
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
// src/RightSheet/RightSheet.jsx
|
|
870
|
+
var import_react13 = __toESM(require("react"));
|
|
871
|
+
var RightSheet = ({
|
|
872
|
+
open,
|
|
873
|
+
setOpen,
|
|
874
|
+
children,
|
|
875
|
+
callBack,
|
|
876
|
+
actionLabel = "Save",
|
|
877
|
+
onAction = () => {
|
|
878
|
+
}
|
|
879
|
+
}) => {
|
|
880
|
+
const [visible, setVisible] = (0, import_react13.useState)(open);
|
|
881
|
+
(0, import_react13.useEffect)(() => {
|
|
882
|
+
if (open) {
|
|
883
|
+
document.body.style.overflow = "hidden";
|
|
884
|
+
setVisible(true);
|
|
885
|
+
}
|
|
886
|
+
return () => {
|
|
887
|
+
document.body.style.overflow = "auto";
|
|
888
|
+
};
|
|
889
|
+
}, [open]);
|
|
890
|
+
const handleClose = () => {
|
|
891
|
+
setVisible(false);
|
|
892
|
+
setTimeout(() => {
|
|
893
|
+
setOpen(false);
|
|
894
|
+
callBack();
|
|
895
|
+
}, 200);
|
|
896
|
+
};
|
|
897
|
+
const handleAction = () => {
|
|
898
|
+
onAction();
|
|
899
|
+
handleClose();
|
|
900
|
+
};
|
|
901
|
+
if (!visible) return null;
|
|
902
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
903
|
+
"div",
|
|
904
|
+
{
|
|
905
|
+
className: "fixed inset-0 overflow-x-hidden bg-black/80 sheetPopIn h-full overflow-auto ",
|
|
906
|
+
onClick: handleClose
|
|
907
|
+
},
|
|
908
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
909
|
+
"div",
|
|
910
|
+
{
|
|
911
|
+
className: `absolute flex flex-col right-0 top-0 min-h-full min-w-[100%] md:min-w-[576px]
|
|
912
|
+
${visible ? "sheetRightSlide" : "transition-all duration-200 translate-x-[100%]"} justify-between bg-[#fff] dark:bg-[#18181b] dark:text-white`,
|
|
913
|
+
onClick: (e) => e.stopPropagation()
|
|
914
|
+
},
|
|
915
|
+
/* @__PURE__ */ import_react13.default.createElement("div", { className: " min-h-full " }, children),
|
|
916
|
+
/* @__PURE__ */ import_react13.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] dark:border-[#303036] dark:bg-[#18181b] dark:text-white" }, /* @__PURE__ */ import_react13.default.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose() }, "Cancel"), /* @__PURE__ */ import_react13.default.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction }, actionLabel))
|
|
917
|
+
)
|
|
918
|
+
);
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
// src/Table/CustomTable.jsx
|
|
922
|
+
var import_react14 = __toESM(require("react"));
|
|
923
|
+
var CustomTable = ({
|
|
924
|
+
tableHeader,
|
|
925
|
+
setIsAllChecked,
|
|
926
|
+
isAllChecked,
|
|
927
|
+
children,
|
|
928
|
+
isHideCheckbox = "false"
|
|
929
|
+
}) => {
|
|
930
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { className: "border border-[#e5e5e5] dark:border-[#303036] rounded-lg overflow-x-auto" }, /* @__PURE__ */ import_react14.default.createElement("div", { className: "w-full relative overflow-x-auto" }, /* @__PURE__ */ import_react14.default.createElement("table", { className: "w-full caption-bottom text-sm overflow-x-auto bg-white dark:bg-[#18181b] table-fixed border-collapse" }, /* @__PURE__ */ import_react14.default.createElement("thead", { className: "border-b border-[#e5e5e5] dark:bg-[#18181b]" }, /* @__PURE__ */ import_react14.default.createElement(
|
|
931
|
+
"tr",
|
|
932
|
+
{
|
|
933
|
+
className: "transition-colors text-[#737373] hover:bg-muted/50 \r\n data-[state=selected]:bg-muted"
|
|
934
|
+
},
|
|
935
|
+
!isHideCheckbox && /* @__PURE__ */ import_react14.default.createElement("th", { className: "px-4 py-3 text-left w-[50px]" }, /* @__PURE__ */ import_react14.default.createElement(
|
|
936
|
+
CustomCheckbox,
|
|
937
|
+
{
|
|
938
|
+
checked: isAllChecked,
|
|
939
|
+
onChange: () => {
|
|
940
|
+
setIsAllChecked(!isAllChecked);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
)),
|
|
944
|
+
tableHeader.map((header, index) => {
|
|
945
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
946
|
+
"th",
|
|
947
|
+
{
|
|
948
|
+
className: `px-4 py-3 text-sm dark:bg-[#18181b] font-medium ${index == tableHeader.length - 1 ? "text-right" : "text-left"}`,
|
|
949
|
+
key: header + index
|
|
950
|
+
},
|
|
951
|
+
header
|
|
952
|
+
);
|
|
953
|
+
})
|
|
954
|
+
)), /* @__PURE__ */ import_react14.default.createElement("tbody", null, children))));
|
|
955
|
+
};
|
|
956
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
957
|
+
0 && (module.exports = {
|
|
958
|
+
AppSideBar,
|
|
959
|
+
Chip,
|
|
960
|
+
CustomAutocomplete,
|
|
961
|
+
CustomButton,
|
|
962
|
+
CustomCheckbox,
|
|
963
|
+
CustomInput,
|
|
964
|
+
CustomSearch,
|
|
965
|
+
CustomSelect,
|
|
966
|
+
CustomSwitch,
|
|
967
|
+
CustomTable,
|
|
968
|
+
CustomTextarea,
|
|
969
|
+
CustomUpload,
|
|
970
|
+
ProgressBar,
|
|
971
|
+
RightSheet
|
|
972
|
+
});
|