@6thbridge/hexa 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,1053 +1,2 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- Button: () => Button,
34
- FormLabel: () => FormLabel,
35
- Input: () => Input,
36
- Loader: () => Loader,
37
- PasswordInput: () => PasswordInput,
38
- Searchable: () => Searchable,
39
- SearchableTrigger: () => SearchableTrigger,
40
- Textarea: () => Textarea
41
- });
42
- module.exports = __toCommonJS(index_exports);
43
-
44
- // src/components/label/FormLabel.tsx
45
- var import_react = __toESM(require("react"));
46
-
47
- // src/components/label/index.tsx
48
- var React = __toESM(require("react"));
49
- var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
50
- var import_class_variance_authority = require("class-variance-authority");
51
-
52
- // src/utils/index.ts
53
- var import_clsx = require("clsx");
54
- var import_tailwind_merge = require("tailwind-merge");
55
- function cn(...inputs) {
56
- return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
57
- }
58
-
59
- // src/components/label/index.tsx
60
- var import_jsx_runtime = require("react/jsx-runtime");
61
- var labelVariants = (0, import_class_variance_authority.cva)(
62
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
63
- );
64
- var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
- LabelPrimitive.Root,
66
- {
67
- ref,
68
- className: cn(labelVariants(), className),
69
- ...props
70
- }
71
- ));
72
- Label.displayName = LabelPrimitive.Root.displayName;
73
-
74
- // src/components/label/FormLabel.tsx
75
- var import_jsx_runtime2 = require("react/jsx-runtime");
76
- var FormLabel = import_react.default.forwardRef(({ className, children, showAsterisk, error, ...props }, ref) => {
77
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
78
- Label,
79
- {
80
- ref,
81
- className: cn(error && "text-red-500", className),
82
- ...props,
83
- children: showAsterisk ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { children: [
84
- children,
85
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-red-500", children: "*" })
86
- ] }) : children
87
- }
88
- );
89
- });
90
- FormLabel.displayName = "FormLabel";
91
-
92
- // src/components/loader/index.tsx
93
- var import_jsx_runtime3 = require("react/jsx-runtime");
94
- var Loader = ({
95
- size = 16,
96
- colour = "primary"
97
- }) => {
98
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
99
- "svg",
100
- {
101
- className: "animate-spin",
102
- width: size,
103
- height: size,
104
- viewBox: "0 0 20 20",
105
- fill: "none",
106
- children: [
107
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "10", cy: "10", r: "9.25", stroke: "transparent", strokeWidth: "1.5" }),
108
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
109
- "path",
110
- {
111
- d: "M10 0.595792C10 0.266746 10.267 -0.00185055 10.5954 0.0177417C11.9786 0.100242 13.3318 0.469461 14.5682 1.1044C15.9816 1.83021 17.2016 2.88235 18.1273 4.17366C19.0531 5.46496 19.6578 6.95826 19.8913 8.52984C20.1249 10.1014 19.9807 11.706 19.4705 13.2108C18.9604 14.7155 18.0991 16.077 16.9579 17.1825C15.8167 18.288 14.4285 19.1056 12.9084 19.5677C11.3882 20.0298 9.77982 20.123 8.21646 19.8397C6.84883 19.5918 5.55009 19.0619 4.40196 18.2863C4.12931 18.1021 4.08072 17.7265 4.28083 17.4653C4.48094 17.2041 4.85388 17.1564 5.12801 17.3384C6.12474 18.0001 7.24768 18.4531 8.42898 18.6672C9.80606 18.9168 11.2228 18.8347 12.5618 18.4276C13.9008 18.0206 15.1236 17.3004 16.1288 16.3266C17.134 15.3528 17.8927 14.1536 18.342 12.8282C18.7914 11.5027 18.9185 10.0893 18.7127 8.70502C18.507 7.32071 17.9743 6.00535 17.1589 4.86792C16.3435 3.73048 15.2688 2.80371 14.0238 2.16439C12.9559 1.61596 11.789 1.29259 10.5954 1.21173C10.2671 1.18949 10 0.92484 10 0.595792Z",
112
- fill: colour === "primary" ? "#ffffff" : "currentColor",
113
- className: "rounded"
114
- }
115
- )
116
- ]
117
- }
118
- );
119
- };
120
-
121
- // src/components/button/index.tsx
122
- var React3 = __toESM(require("react"));
123
- var import_react_slot = require("@radix-ui/react-slot");
124
- var import_class_variance_authority2 = require("class-variance-authority");
125
- var import_jsx_runtime4 = require("react/jsx-runtime");
126
- var buttonVariants = (0, import_class_variance_authority2.cva)(
127
- "overflow-hidden isolate relative inline-flex h-fit items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background dark:ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:!pointer-events-none",
128
- {
129
- variants: {
130
- variant: {
131
- primary: "border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",
132
- neutral: "!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",
133
- outlined: "border-blue-950 text-blue-950 hover:opacity-80 disabled:opacity-60",
134
- "light-outlined": "border-white text-white hover:opacity-80 disabled:opacity-60",
135
- "primary-outlined": " text-primary-main bg-primary-main/20 hover:opacity-80 disabled:opacity-60 !font-medium",
136
- "dark-text": "border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",
137
- light: "border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-blue-950 font-semibold"
138
- },
139
- size: {
140
- // lg: "h-15 px-8 items-center",
141
- // sm: "h-10 px-3.5 items-center text-sm",
142
- default: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
143
- sm: "py-[0.375rem] px-[1rem] text-[0.75rem] leading-[1rem] font-medium rounded-lg",
144
- lg: "py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",
145
- md: "h-12 py-1 px-5 items-center",
146
- "icon-sm": "h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",
147
- icon: "h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg",
148
- "icon-lg": "h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"
149
- }
150
- },
151
- defaultVariants: {
152
- variant: "primary",
153
- size: "default"
154
- }
155
- }
156
- );
157
- var Button = ({
158
- className,
159
- variant = "primary",
160
- size,
161
- asChild = false,
162
- isLoading = false,
163
- leftNode,
164
- rightNode,
165
- LoaderSize,
166
- ref,
167
- ...props
168
- }) => {
169
- const Component = asChild ? import_react_slot.Slot : "button";
170
- const { children, disabled, ...rest } = props;
171
- const reference = React3.useRef(null);
172
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
173
- Component,
174
- {
175
- className: cn(buttonVariants({ variant, size, className })),
176
- ref: reference || ref,
177
- disabled: disabled || isLoading,
178
- ...rest,
179
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex font-medium justify-center items-center gap-2", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Loader, { size: LoaderSize }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
180
- leftNode,
181
- children,
182
- rightNode
183
- ] }) })
184
- }
185
- );
186
- };
187
- Button.displayName = "Button";
188
-
189
- // src/components/input/index.tsx
190
- var import_class_variance_authority3 = require("class-variance-authority");
191
-
192
- // src/components/form/ErrorMessage.tsx
193
- var import_react2 = __toESM(require("react"));
194
- var import_jsx_runtime5 = require("react/jsx-runtime");
195
- var ErrorMessage = import_react2.default.forwardRef(({ className, children, error, ...props }, ref) => {
196
- const body = error ?? children;
197
- if (!body) {
198
- return null;
199
- }
200
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
201
- "p",
202
- {
203
- ref,
204
- className: cn("text-xs font-normal text-[#F04248]", className),
205
- ...props,
206
- children: body
207
- }
208
- );
209
- });
210
- ErrorMessage.displayName = "ErrorMessage";
211
-
212
- // src/components/form/FormDescription.tsx
213
- var import_react3 = __toESM(require("react"));
214
- var import_jsx_runtime6 = require("react/jsx-runtime");
215
- var FormDescription = import_react3.default.forwardRef(({ className, ...props }, ref) => {
216
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
217
- "p",
218
- {
219
- ref,
220
- className: cn("text-sm text-[#8E98A8", className),
221
- ...props
222
- }
223
- );
224
- });
225
- FormDescription.displayName = "FormDescription";
226
-
227
- // src/components/input/index.tsx
228
- var import_jsx_runtime7 = require("react/jsx-runtime");
229
- var inputVariants = (0, import_class_variance_authority3.cva)(
230
- "!p-0 flex h-full w-full !border-transparent !bg-transparent text-base focus-visible:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",
231
- {
232
- variants: {
233
- status: {
234
- default: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
235
- error: "placeholder:text-red-500 text-red-500",
236
- loading: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
237
- prefilled: ""
238
- }
239
- },
240
- defaultVariants: {
241
- status: "default"
242
- }
243
- }
244
- );
245
- var BaseInnerInput = ({
246
- className,
247
- status,
248
- type,
249
- ref,
250
- ...props
251
- }) => {
252
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
253
- "input",
254
- {
255
- type,
256
- className: cn(inputVariants({ status }), className),
257
- ref,
258
- ...props
259
- }
260
- );
261
- };
262
- BaseInnerInput.displayName = "BaseInnerInput";
263
- var inputContainerVariants = (0, import_class_variance_authority3.cva)(
264
- "flex relative h-10 w-full rounded-[4px] dark:!bg-transparent border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",
265
- {
266
- variants: {
267
- status: {
268
- default: "border-[#DEDEDE] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",
269
- error: "placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-status-error-bg-dark text-red-500 focus-within:bg-red-50 focus-within:border-red-500",
270
- loading: "",
271
- prefilled: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"
272
- }
273
- },
274
- defaultVariants: {
275
- status: "default"
276
- }
277
- }
278
- );
279
- var sideVariants = (0, import_class_variance_authority3.cva)(
280
- "top-0 flex justify-center items-center h-full min-w-[50px] max-w-[100px] dark:!bg-transparent transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",
281
- {
282
- variants: {
283
- side: {
284
- left: "left-0 rounded-l-[8px] border-r",
285
- right: "right-0 rounded-r-[8px] border-l"
286
- },
287
- status: {
288
- default: "border-[#DEDEDE] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",
289
- error: "placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-red-50 text-red-500 focus-within:bg-red-50 focus-within:border-red-500",
290
- loading: "",
291
- prefilled: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"
292
- }
293
- },
294
- defaultVariants: {
295
- status: "default",
296
- side: "left"
297
- }
298
- }
299
- );
300
- var Input = ({
301
- className,
302
- status = "default",
303
- disabled,
304
- error,
305
- isLoading,
306
- sideNodeClassName,
307
- showAsterisk,
308
- label,
309
- description,
310
- ref,
311
- ...props
312
- }) => {
313
- let containerStatus = status;
314
- if (error) containerStatus = "error";
315
- if (isLoading) containerStatus = "loading";
316
- if (disabled) containerStatus = "prefilled";
317
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative space-y-1", children: [
318
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormLabel, { showAsterisk, error, children: label }),
319
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
320
- "div",
321
- {
322
- className: cn(
323
- inputContainerVariants({ status: containerStatus }),
324
- props.leftNode || props.rightNode ? "p-0" : "",
325
- className
326
- ),
327
- children: [
328
- props.leftNode ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
329
- "div",
330
- {
331
- className: cn(
332
- sideVariants({
333
- status: containerStatus,
334
- side: "left"
335
- }),
336
- sideNodeClassName
337
- ),
338
- children: props.leftNode
339
- }
340
- ) : null,
341
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
342
- BaseInnerInput,
343
- {
344
- ref,
345
- disabled: isLoading || disabled,
346
- className: props.leftNode || props.rightNode ? "!px-3 !py-2" : "",
347
- ...props
348
- }
349
- ),
350
- props.rightNode ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
351
- "div",
352
- {
353
- className: cn(
354
- sideVariants({
355
- status: containerStatus,
356
- side: "right"
357
- }),
358
- sideNodeClassName
359
- ),
360
- children: props.rightNode
361
- }
362
- ) : null
363
- ]
364
- }
365
- ),
366
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
367
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorMessage, { error })
368
- ] });
369
- };
370
- Input.displayName = "Input";
371
-
372
- // src/components/password-input/index.tsx
373
- var import_react4 = require("react");
374
-
375
- // src/components/password-input/icons/Eye.tsx
376
- var import_jsx_runtime8 = require("react/jsx-runtime");
377
- var Eye = () => {
378
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
379
- "svg",
380
- {
381
- width: "18",
382
- height: "14",
383
- viewBox: "0 0 18 14",
384
- fill: "none",
385
- xmlns: "http://www.w3.org/2000/svg",
386
- children: [
387
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
388
- "path",
389
- {
390
- d: "M1.54639 7.26103C1.48389 7.09264 1.48389 6.90741 1.54639 6.73903C2.15517 5.26292 3.18853 4.00081 4.51547 3.1127C5.84241 2.22459 7.40317 1.75049 8.99989 1.75049C10.5966 1.75049 12.1574 2.22459 13.4843 3.1127C14.8113 4.00081 15.8446 5.26292 16.4534 6.73903C16.5159 6.90741 16.5159 7.09264 16.4534 7.26103C15.8446 8.73713 14.8113 9.99925 13.4843 10.8874C12.1574 11.7755 10.5966 12.2496 8.99989 12.2496C7.40317 12.2496 5.84241 11.7755 4.51547 10.8874C3.18853 9.99925 2.15517 8.73713 1.54639 7.26103Z",
391
- stroke: "#8E98A8",
392
- strokeWidth: "2",
393
- strokeLinecap: "round",
394
- strokeLinejoin: "round"
395
- }
396
- ),
397
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
398
- "path",
399
- {
400
- d: "M9 9.25C10.2426 9.25 11.25 8.24264 11.25 7C11.25 5.75736 10.2426 4.75 9 4.75C7.75736 4.75 6.75 5.75736 6.75 7C6.75 8.24264 7.75736 9.25 9 9.25Z",
401
- stroke: "#8E98A8",
402
- strokeWidth: "2",
403
- strokeLinecap: "round",
404
- strokeLinejoin: "round"
405
- }
406
- )
407
- ]
408
- }
409
- );
410
- };
411
-
412
- // src/components/password-input/icons/EyeOff.tsx
413
- var import_jsx_runtime9 = require("react/jsx-runtime");
414
- var EyeOff = () => {
415
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
416
- "svg",
417
- {
418
- width: "18",
419
- height: "18",
420
- viewBox: "0 0 18 18",
421
- fill: "none",
422
- xmlns: "http://www.w3.org/2000/svg",
423
- children: [
424
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
425
- "path",
426
- {
427
- d: "M4.08759 12.69C3.26171 11.9072 2.61006 10.9591 2.17509 9.90752C2.10081 9.73454 2.0625 9.54826 2.0625 9.36001C2.0625 9.17177 2.10081 8.98549 2.17509 8.81252C2.75274 7.4073 3.72095 6.19704 4.96509 5.32502C6.14597 4.4998 7.55989 4.07405 9.00009 4.11002C10.0363 4.084 11.064 4.30239 12.0001 4.74752M13.9201 6.03752C14.7415 6.81964 15.3904 7.76486 15.8251 8.81252C15.8994 8.98549 15.9377 9.17177 15.9377 9.36001C15.9377 9.54826 15.8994 9.73454 15.8251 9.90752C15.2474 11.3127 14.2792 12.523 13.0351 13.395C11.8542 14.2202 10.4403 14.646 9.00009 14.61C7.9639 14.636 6.93616 14.4176 6.00009 13.9725",
428
- stroke: "#8E98A8",
429
- strokeWidth: "1.5",
430
- strokeLinecap: "round",
431
- strokeLinejoin: "round"
432
- }
433
- ),
434
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
435
- "path",
436
- {
437
- d: "M6.5325 10.2375C6.42732 9.95694 6.37395 9.65962 6.375 9.36C6.375 8.66381 6.65156 7.99613 7.14384 7.50384C7.63613 7.01156 8.30381 6.735 9 6.735C9.3 6.7335 9.597 6.7875 9.8775 6.8925M11.4675 8.4825C11.5725 8.763 11.6265 9.06 11.625 9.36C11.625 10.0562 11.3484 10.7239 10.8562 11.2162C10.3639 11.7084 9.69619 11.985 9 11.985C8.70038 11.986 8.40306 11.9327 8.1225 11.8275M2.25 15L14.25 3",
438
- stroke: "#8E98A8",
439
- strokeWidth: "1.5",
440
- strokeLinecap: "round",
441
- strokeLinejoin: "round"
442
- }
443
- )
444
- ]
445
- }
446
- );
447
- };
448
-
449
- // src/components/password-input/index.tsx
450
- var import_jsx_runtime10 = require("react/jsx-runtime");
451
- var PasswordInput = ({ ...props }) => {
452
- const [passwordVisible, setPasswordVisible] = (0, import_react4.useState)(false);
453
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
454
- Input,
455
- {
456
- sideNodeClassName: "!border-l-0",
457
- rightNode: passwordVisible ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
458
- "button",
459
- {
460
- type: "button",
461
- onClick: () => setPasswordVisible((val) => !val),
462
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Eye, {})
463
- }
464
- ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
465
- "button",
466
- {
467
- type: "button",
468
- onClick: () => setPasswordVisible((val) => !val),
469
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EyeOff, {})
470
- }
471
- ),
472
- type: passwordVisible ? "text" : "password",
473
- ...props
474
- }
475
- );
476
- };
477
- PasswordInput.displayName = "PasswordInput";
478
-
479
- // src/components/textarea/index.tsx
480
- var import_class_variance_authority4 = require("class-variance-authority");
481
- var import_jsx_runtime11 = require("react/jsx-runtime");
482
- var textareaContainerVariants = (0, import_class_variance_authority4.cva)(
483
- "flex relative min-h-[80px] w-full rounded-[8px] border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",
484
- {
485
- variants: {
486
- status: {
487
- default: "border-[#D7D7D7] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] dark:focus-within:border-[#9299A2] dark:border-[#9299A2] dark:disabled:!border-[#9299A2]",
488
- error: "placeholder:text-status-error-fill bg-status-error-bg border-status-error-fill dark:!bg-status-error-bg-dark text-status-error-fill focus-within:bg-status-error-bg focus-within:border-status-error-fill",
489
- loading: "placeholder:text-[#C4C4C4]",
490
- prefilled: "resize-none bg-[#F6F6F6] border-[#D7D7D7] dark:!bg-transparent caret-[#D7D7D7] focus-within:bg-[#F6F6F6] focus-within:border-[#D7D7D7] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"
491
- }
492
- },
493
- defaultVariants: {
494
- status: "default"
495
- }
496
- }
497
- );
498
- var Textarea = ({
499
- className,
500
- status = "default",
501
- disabled,
502
- error,
503
- isLoading,
504
- showAsterisk,
505
- label,
506
- description,
507
- ...props
508
- }) => {
509
- let containerStatus = status;
510
- if (error) containerStatus = "error";
511
- if (isLoading) containerStatus = "loading";
512
- if (disabled) containerStatus = "prefilled";
513
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative space-y-1", children: [
514
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormLabel, { showAsterisk, error, children: label }),
515
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
516
- "textarea",
517
- {
518
- className: cn(
519
- "min-h-[80px]",
520
- inputContainerVariants({ status: containerStatus }),
521
- className
522
- ),
523
- disabled: isLoading || disabled,
524
- ...props
525
- }
526
- ),
527
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
528
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ErrorMessage, { error })
529
- ] });
530
- };
531
- Textarea.displayName = "Textarea";
532
-
533
- // src/components/select/index.tsx
534
- var React10 = __toESM(require("react"));
535
-
536
- // src/components/command/index.tsx
537
- var React7 = __toESM(require("react"));
538
- var import_cmdk = require("cmdk");
539
- var import_lucide_react = require("lucide-react");
540
-
541
- // src/components/dialog/index.tsx
542
- var React6 = __toESM(require("react"));
543
- var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
544
-
545
- // src/components/dialog/icon/CloseIcon.tsx
546
- var import_jsx_runtime12 = require("react/jsx-runtime");
547
- var CloseIcon = () => {
548
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
549
- "svg",
550
- {
551
- width: "20",
552
- height: "20",
553
- viewBox: "0 0 24 24",
554
- fill: "none",
555
- xmlns: "http://www.w3.org/2000/svg",
556
- className: "stroke-[#232528]]",
557
- children: [
558
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
559
- "path",
560
- {
561
- d: "M5.00098 5L19 18.9991",
562
- strokeWidth: "1.5",
563
- strokeLinecap: "round",
564
- strokeLinejoin: "round"
565
- }
566
- ),
567
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
568
- "path",
569
- {
570
- d: "M4.99996 18.9991L18.999 5",
571
- strokeWidth: "1.5",
572
- strokeLinecap: "round",
573
- strokeLinejoin: "round"
574
- }
575
- )
576
- ]
577
- }
578
- );
579
- };
580
-
581
- // src/components/dialog/index.tsx
582
- var import_jsx_runtime13 = require("react/jsx-runtime");
583
- var DialogRoot = DialogPrimitive.Root;
584
- var DialogTrigger = DialogPrimitive.Trigger;
585
- var DialogPortal = DialogPrimitive.Portal;
586
- var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
587
- DialogPrimitive.Overlay,
588
- {
589
- ref,
590
- className: cn(
591
- "fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
592
- className
593
- ),
594
- ...props
595
- }
596
- ));
597
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
598
- var DialogContent = React6.forwardRef(({ className, hideCloseButton, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPortal, { children: [
599
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, {}),
600
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
601
- DialogPrimitive.Content,
602
- {
603
- ref,
604
- className: cn(
605
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-transparent bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
606
- className
607
- ),
608
- ...props,
609
- children: [
610
- children,
611
- !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
612
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CloseIcon, {}),
613
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
614
- ] })
615
- ]
616
- }
617
- )
618
- ] }));
619
- DialogContent.displayName = DialogPrimitive.Content.displayName;
620
- var DialogHeader = ({
621
- className,
622
- ...props
623
- }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
624
- "div",
625
- {
626
- className: cn("flex flex-col space-y-1.5 text-left", className),
627
- ...props
628
- }
629
- );
630
- DialogHeader.displayName = "DialogHeader";
631
- var DialogFooter = ({
632
- className,
633
- ...props
634
- }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
635
- "div",
636
- {
637
- className: cn("flex flex-row justify-end sm:space-x-2", className),
638
- ...props
639
- }
640
- );
641
- DialogFooter.displayName = "DialogFooter";
642
- var DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
643
- DialogPrimitive.Title,
644
- {
645
- ref,
646
- className: cn(
647
- "text-lg font-semibold leading-none tracking-tight",
648
- className
649
- ),
650
- ...props
651
- }
652
- ));
653
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
654
- var DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
655
- DialogPrimitive.Description,
656
- {
657
- ref,
658
- className: cn("text-sm text-muted-foreground", className),
659
- ...props
660
- }
661
- ));
662
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
663
- var Dialog2 = ({
664
- trigger,
665
- children,
666
- open,
667
- onOpenChange,
668
- hideCloseButton,
669
- footer,
670
- title,
671
- description,
672
- contentClassName,
673
- headerClassName,
674
- titleClassName,
675
- descriptionClassName,
676
- footerClassName,
677
- asChild = true,
678
- onOpenAutoFocus,
679
- onCloseAutoFocus,
680
- onEscapeKeyDown,
681
- onInteractOutside,
682
- onPointerDownOutside,
683
- ...props
684
- }) => {
685
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogRoot, { ...props, open, onOpenChange, children: [
686
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogTrigger, { asChild, children: trigger }),
687
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
688
- DialogContent,
689
- {
690
- className: contentClassName,
691
- hideCloseButton,
692
- onOpenAutoFocus,
693
- onCloseAutoFocus,
694
- onEscapeKeyDown,
695
- onPointerDownOutside,
696
- onInteractOutside,
697
- children: [
698
- title || description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogHeader, { className: headerClassName, children: [
699
- title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogTitle, { className: titleClassName, children: title }),
700
- description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogDescription, { className: descriptionClassName, children: description })
701
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}),
702
- children,
703
- footer && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogFooter, { className: footerClassName, children: footer })
704
- ]
705
- }
706
- ) })
707
- ] });
708
- };
709
- Dialog2.displayName = DialogPrimitive.Dialog.displayName;
710
-
711
- // src/components/command/index.tsx
712
- var import_jsx_runtime14 = require("react/jsx-runtime");
713
- var Command = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
714
- import_cmdk.Command,
715
- {
716
- ref,
717
- className: cn(
718
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
719
- className
720
- ),
721
- ...props
722
- }
723
- ));
724
- Command.displayName = import_cmdk.Command.displayName;
725
- var CommandInput = React7.forwardRef(({ className, CommandInputContainerClassName, loading, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
726
- "div",
727
- {
728
- className: cn(
729
- "flex items-center border-0 px-3 gap-2",
730
- CommandInputContainerClassName
731
- ),
732
- "cmdk-input-wrapper": "",
733
- children: [
734
- loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 16, colour: "secondary" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
735
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
736
- import_cmdk.Command.Input,
737
- {
738
- ref,
739
- className: cn(
740
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
741
- className
742
- ),
743
- disabled: loading,
744
- ...props
745
- }
746
- )
747
- ]
748
- }
749
- ));
750
- CommandInput.displayName = import_cmdk.Command.Input.displayName;
751
- var CommandList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
752
- import_cmdk.Command.List,
753
- {
754
- ref,
755
- className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
756
- ...props
757
- }
758
- ));
759
- CommandList.displayName = import_cmdk.Command.List.displayName;
760
- var CommandEmpty = React7.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
761
- import_cmdk.Command.Empty,
762
- {
763
- ref,
764
- className: "py-6 text-center text-sm",
765
- ...props
766
- }
767
- ));
768
- CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
769
- var CommandGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
770
- import_cmdk.Command.Group,
771
- {
772
- ref,
773
- className: cn(
774
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
775
- className
776
- ),
777
- ...props
778
- }
779
- ));
780
- CommandGroup.displayName = import_cmdk.Command.Group.displayName;
781
- var CommandSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
782
- import_cmdk.Command.Separator,
783
- {
784
- ref,
785
- className: cn("-mx-1 h-px bg-border", className),
786
- ...props
787
- }
788
- ));
789
- CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
790
- var CommandItem = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
791
- import_cmdk.Command.Item,
792
- {
793
- ref,
794
- className: cn(
795
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
796
- className
797
- ),
798
- ...props
799
- }
800
- ));
801
- CommandItem.displayName = import_cmdk.Command.Item.displayName;
802
- var CommandShortcut = ({
803
- className,
804
- ...props
805
- }) => {
806
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
807
- "span",
808
- {
809
- className: cn(
810
- "ml-auto text-xs tracking-widest text-muted-foreground",
811
- className
812
- ),
813
- ...props
814
- }
815
- );
816
- };
817
- CommandShortcut.displayName = "CommandShortcut";
818
-
819
- // src/components/popover/index.tsx
820
- var React8 = __toESM(require("react"));
821
- var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
822
- var import_jsx_runtime15 = require("react/jsx-runtime");
823
- var PopoverRoot = PopoverPrimitive.Root;
824
- var PopoverTrigger = PopoverPrimitive.Trigger;
825
- var PopoverContent = React8.forwardRef(
826
- ({ className, align = "center", sideOffset = 4, portal = true, ...props }, ref) => portal ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
827
- PopoverPrimitive.Content,
828
- {
829
- ref,
830
- align,
831
- sideOffset,
832
- className: cn(
833
- "pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
834
- className
835
- ),
836
- onOpenAutoFocus: props.onOpenAutoFocus,
837
- onCloseAutoFocus: props.onCloseAutoFocus,
838
- ...props
839
- }
840
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
841
- PopoverPrimitive.Content,
842
- {
843
- ref,
844
- align,
845
- sideOffset,
846
- className: cn(
847
- "pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
848
- className
849
- ),
850
- onOpenAutoFocus: props.onOpenAutoFocus,
851
- onCloseAutoFocus: props.onCloseAutoFocus,
852
- ...props
853
- }
854
- )
855
- );
856
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
857
- var Popover = ({
858
- trigger,
859
- children,
860
- open,
861
- onOpenChange,
862
- contentClassName,
863
- asChild = true,
864
- align,
865
- side,
866
- alignOffset,
867
- sideOffset,
868
- onOpenAutoFocus,
869
- onCloseAutoFocus,
870
- ...props
871
- }) => {
872
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(PopoverRoot, { ...props, open, onOpenChange, children: [
873
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverTrigger, { asChild, children: trigger }),
874
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
875
- PopoverContent,
876
- {
877
- alignOffset,
878
- sideOffset,
879
- side,
880
- align,
881
- className: contentClassName,
882
- onOpenAutoFocus,
883
- onCloseAutoFocus,
884
- children
885
- }
886
- )
887
- ] });
888
- };
889
- Popover.displayName = PopoverPrimitive.Root.displayName;
890
-
891
- // src/components/scroll-area/index.tsx
892
- var React9 = __toESM(require("react"));
893
- var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
894
- var import_jsx_runtime16 = require("react/jsx-runtime");
895
- var ScrollArea = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
896
- ScrollAreaPrimitive.Root,
897
- {
898
- ref,
899
- className: cn("relative overflow-hidden", className),
900
- ...props,
901
- children: [
902
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
903
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScrollBar, {}),
904
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScrollAreaPrimitive.Corner, {})
905
- ]
906
- }
907
- ));
908
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
909
- var ScrollBar = React9.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
910
- ScrollAreaPrimitive.ScrollAreaScrollbar,
911
- {
912
- ref,
913
- orientation,
914
- className: cn(
915
- "flex touch-none select-none transition-colors",
916
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
917
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
918
- className
919
- ),
920
- ...props,
921
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
922
- }
923
- ));
924
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
925
-
926
- // src/components/select/index.tsx
927
- var import_jsx_runtime17 = require("react/jsx-runtime");
928
- var SearchableTrigger = ({
929
- className,
930
- value,
931
- placeholder = "",
932
- status,
933
- disabled
934
- }) => {
935
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
936
- "button",
937
- {
938
- disabled,
939
- className: cn(
940
- inputContainerVariants({ status }),
941
- "[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",
942
- value ? "" : "text-[#79818C]",
943
- className
944
- ),
945
- children: [
946
- value ?? placeholder ?? "Select options...",
947
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
948
- "svg",
949
- {
950
- width: "20",
951
- height: "20",
952
- viewBox: "0 0 20 20",
953
- fill: "none",
954
- className: " data-[state=open]:goup-rotate-180",
955
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
956
- "path",
957
- {
958
- d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
959
- stroke: "currentColor",
960
- strokeWidth: "1.5",
961
- strokeMiterlimit: "10",
962
- strokeLinecap: "round",
963
- strokeLinejoin: "round"
964
- }
965
- )
966
- }
967
- )
968
- ]
969
- }
970
- ) });
971
- };
972
- var Searchable = ({
973
- options,
974
- value,
975
- onChange,
976
- containerClassName,
977
- placeholder,
978
- disabled,
979
- loading,
980
- optionComponent,
981
- children,
982
- modal,
983
- hideSearch,
984
- className,
985
- inputValue,
986
- onInputValueChange
987
- }) => {
988
- const [open, setOpen] = React10.useState(false);
989
- const triggerRef = React10.useRef(null);
990
- const [width, setWidth] = React10.useState(void 0);
991
- React10.useLayoutEffect(() => {
992
- if (triggerRef.current) {
993
- setWidth(triggerRef.current.clientWidth);
994
- }
995
- }, [triggerRef.current]);
996
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(PopoverRoot, { modal, open, onOpenChange: setOpen, children: [
997
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: cn("w-full", className), ref: triggerRef, children }),
998
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
999
- PopoverContent,
1000
- {
1001
- portal: modal,
1002
- className: "p-0 min-w-[200px]",
1003
- style: { width },
1004
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Command, { className: "max-h-[270px] pt-3", children: [
1005
- !hideSearch && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1006
- CommandInput,
1007
- {
1008
- loading,
1009
- placeholder: placeholder ?? "Search options...",
1010
- onValueChange: onInputValueChange,
1011
- value: inputValue,
1012
- CommandInputContainerClassName: "mx-3 border rounded-md border-[#DEDEDE]"
1013
- }
1014
- ),
1015
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1016
- ScrollArea,
1017
- {
1018
- className: cn("w-full px-0", containerClassName),
1019
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(CommandList, { children: [
1020
- !hideSearch && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandEmpty, { children: "No result found." }),
1021
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandGroup, { className: "w-full", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1022
- CommandItem,
1023
- {
1024
- defaultValue: value?.label,
1025
- value: option.label,
1026
- disabled,
1027
- onSelect: () => {
1028
- onChange(option);
1029
- setOpen(false);
1030
- },
1031
- children: !optionComponent ? option.label : optionComponent(option)
1032
- },
1033
- option.value
1034
- )) })
1035
- ] })
1036
- }
1037
- )
1038
- ] })
1039
- }
1040
- )
1041
- ] });
1042
- };
1043
- // Annotate the CommonJS export names for ESM import in node:
1044
- 0 && (module.exports = {
1045
- Button,
1046
- FormLabel,
1047
- Input,
1048
- Loader,
1049
- PasswordInput,
1050
- Searchable,
1051
- SearchableTrigger,
1052
- Textarea
1053
- });
1
+ "use strict";var Ue=Object.create;var q=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(e,t)=>{for(var o in t)q(e,o,{get:t[o],enumerable:!0})},be=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ye(t))!et.call(e,i)&&i!==o&&q(e,i,{get:()=>t[i],enumerable:!(a=Xe(t,i))||a.enumerable});return e};var g=(e,t,o)=>(o=e!=null?Ue($e(e)):{},be(t||!e||!e.__esModule?q(o,"default",{value:e,enumerable:!0}):o,e)),ot=e=>be(q({},"__esModule",{value:!0}),e);var pt={};tt(pt,{Button:()=>te,FormLabel:()=>k,Input:()=>_,Loader:()=>T,PasswordInput:()=>oe,Select:()=>Qe,Textarea:()=>re});module.exports=ot(pt);var xe=g(require("react"));var ye=g(require("react")),$=g(require("@radix-ui/react-label")),Ce=require("class-variance-authority");var he=require("clsx"),ve=require("tailwind-merge");function r(...e){return(0,ve.twMerge)((0,he.clsx)(e))}var Pe=require("react/jsx-runtime"),rt=(0,Ce.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ee=ye.forwardRef(({className:e,...t},o)=>(0,Pe.jsx)($.Root,{ref:o,className:r(rt(),e),...t}));ee.displayName=$.Root.displayName;var M=require("react/jsx-runtime"),k=xe.default.forwardRef(({className:e,children:t,showAsterisk:o,error:a,...i},l)=>(0,M.jsx)(ee,{ref:l,className:r(a&&"text-red-500",e),...i,children:o?(0,M.jsxs)("p",{children:[t,(0,M.jsx)("span",{className:"text-red-500",children:"*"})]}):t}));k.displayName="FormLabel";var H=require("react/jsx-runtime"),T=({size:e=16,colour:t="primary"})=>(0,H.jsxs)("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 20 20",fill:"none",children:[(0,H.jsx)("circle",{cx:"10",cy:"10",r:"9.25",stroke:"transparent",strokeWidth:"1.5"}),(0,H.jsx)("path",{d:"M10 0.595792C10 0.266746 10.267 -0.00185055 10.5954 0.0177417C11.9786 0.100242 13.3318 0.469461 14.5682 1.1044C15.9816 1.83021 17.2016 2.88235 18.1273 4.17366C19.0531 5.46496 19.6578 6.95826 19.8913 8.52984C20.1249 10.1014 19.9807 11.706 19.4705 13.2108C18.9604 14.7155 18.0991 16.077 16.9579 17.1825C15.8167 18.288 14.4285 19.1056 12.9084 19.5677C11.3882 20.0298 9.77982 20.123 8.21646 19.8397C6.84883 19.5918 5.55009 19.0619 4.40196 18.2863C4.12931 18.1021 4.08072 17.7265 4.28083 17.4653C4.48094 17.2041 4.85388 17.1564 5.12801 17.3384C6.12474 18.0001 7.24768 18.4531 8.42898 18.6672C9.80606 18.9168 11.2228 18.8347 12.5618 18.4276C13.9008 18.0206 15.1236 17.3004 16.1288 16.3266C17.134 15.3528 17.8927 14.1536 18.342 12.8282C18.7914 11.5027 18.9185 10.0893 18.7127 8.70502C18.507 7.32071 17.9743 6.00535 17.1589 4.86792C16.3435 3.73048 15.2688 2.80371 14.0238 2.16439C12.9559 1.61596 11.789 1.29259 10.5954 1.21173C10.2671 1.18949 10 0.92484 10 0.595792Z",fill:t==="primary"?"#ffffff":"currentColor",className:"rounded"})]});var Re=g(require("react")),we=require("@radix-ui/react-slot"),Ne=require("class-variance-authority");var C=require("react/jsx-runtime"),at=(0,Ne.cva)("overflow-hidden isolate relative inline-flex h-fit items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background dark:ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:!pointer-events-none",{variants:{variant:{primary:"border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",neutral:"!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",outlined:"border-blue-950 text-blue-950 hover:opacity-80 disabled:opacity-60","light-outlined":"border-white text-white hover:opacity-80 disabled:opacity-60","primary-outlined":" text-primary-main bg-primary-main/20 hover:opacity-80 disabled:opacity-60 !font-medium","dark-text":"border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",light:"border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-blue-950 font-semibold"},size:{default:"py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",sm:"py-[0.375rem] px-[1rem] text-[0.75rem] leading-[1rem] font-medium rounded-lg",lg:"py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",md:"h-12 py-1 px-5 items-center","icon-sm":"h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",icon:"h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg","icon-lg":"h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"}},defaultVariants:{variant:"primary",size:"default"}}),te=({className:e,variant:t="primary",size:o,asChild:a=!1,isLoading:i=!1,leftNode:l,rightNode:h,LoaderSize:f,ref:y,...p})=>{let d=a?we.Slot:"button",{children:u,disabled:D,...I}=p,V=Re.useRef(null);return(0,C.jsx)(d,{className:r(at({variant:t,size:o,className:e})),ref:V||y,disabled:D||i,...I,children:(0,C.jsx)("div",{className:"flex font-medium justify-center items-center gap-2",children:i?(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("span",{className:"mx-auto",children:(0,C.jsx)(T,{size:f})})}):(0,C.jsxs)(C.Fragment,{children:[l,u,h]})})})};te.displayName="Button";var J=require("class-variance-authority");var De=g(require("react")),ke=require("react/jsx-runtime"),O=De.default.forwardRef(({className:e,children:t,error:o,...a},i)=>{let l=o??t;return l?(0,ke.jsx)("p",{ref:i,className:r("text-xs font-normal text-[#F04248]",e),...a,children:l}):null});O.displayName="ErrorMessage";var Ee=g(require("react")),Ae=require("react/jsx-runtime"),B=Ee.default.forwardRef(({className:e,...t},o)=>(0,Ae.jsx)("p",{ref:o,className:r("text-sm text-[#8E98A8",e),...t}));B.displayName="FormDescription";var P=require("react/jsx-runtime"),it=(0,J.cva)("!p-0 flex h-full w-full !border-transparent !bg-transparent text-base focus-visible:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",{variants:{status:{default:"placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",error:"placeholder:text-red-500 text-red-500",loading:"placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",prefilled:""}},defaultVariants:{status:"default"}}),Le=({className:e,status:t,type:o,ref:a,...i})=>(0,P.jsx)("input",{type:o,className:r(it({status:t}),e),ref:a,...i});Le.displayName="BaseInnerInput";var W=(0,J.cva)("flex relative h-10 w-full rounded-[4px] dark:!bg-transparent border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",{variants:{status:{default:"border-[#DEDEDE] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-status-error-bg-dark text-red-500 focus-within:bg-red-50 focus-within:border-red-500",loading:"",prefilled:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"}},defaultVariants:{status:"default"}}),Se=(0,J.cva)("top-0 flex justify-center items-center h-full min-w-[50px] max-w-[100px] dark:!bg-transparent transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",{variants:{side:{left:"left-0 rounded-l-[8px] border-r",right:"right-0 rounded-r-[8px] border-l"},status:{default:"border-[#DEDEDE] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-red-50 text-red-500 focus-within:bg-red-50 focus-within:border-red-500",loading:"",prefilled:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"}},defaultVariants:{status:"default",side:"left"}}),_=({className:e,status:t="default",disabled:o,error:a,isLoading:i,sideNodeClassName:l,showAsterisk:h,label:f,description:y,ref:p,...d})=>{let u=t;return a&&(u="error"),i&&(u="loading"),o&&(u="prefilled"),(0,P.jsxs)("div",{className:"relative space-y-1",children:[(0,P.jsx)(k,{showAsterisk:h,error:a,children:f}),(0,P.jsxs)("div",{className:r(W({status:u}),d.leftNode||d.rightNode?"p-0":"",e),children:[d.leftNode?(0,P.jsx)("div",{className:r(Se({status:u,side:"left"}),l),children:d.leftNode}):null,(0,P.jsx)(Le,{ref:p,disabled:i||o,className:d.leftNode||d.rightNode?"!px-3 !py-2":"",...d}),d.rightNode?(0,P.jsx)("div",{className:r(Se({status:u,side:"right"}),l),children:d.rightNode}):null]}),(0,P.jsx)(B,{className:"text-gray-400 text-sm !font-normal",children:y}),(0,P.jsx)(O,{error:a})]})};_.displayName="Input";var Ie=require("react");var z=require("react/jsx-runtime"),Te=()=>(0,z.jsxs)("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,z.jsx)("path",{d:"M1.54639 7.26103C1.48389 7.09264 1.48389 6.90741 1.54639 6.73903C2.15517 5.26292 3.18853 4.00081 4.51547 3.1127C5.84241 2.22459 7.40317 1.75049 8.99989 1.75049C10.5966 1.75049 12.1574 2.22459 13.4843 3.1127C14.8113 4.00081 15.8446 5.26292 16.4534 6.73903C16.5159 6.90741 16.5159 7.09264 16.4534 7.26103C15.8446 8.73713 14.8113 9.99925 13.4843 10.8874C12.1574 11.7755 10.5966 12.2496 8.99989 12.2496C7.40317 12.2496 5.84241 11.7755 4.51547 10.8874C3.18853 9.99925 2.15517 8.73713 1.54639 7.26103Z",stroke:"#8E98A8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,z.jsx)("path",{d:"M9 9.25C10.2426 9.25 11.25 8.24264 11.25 7C11.25 5.75736 10.2426 4.75 9 4.75C7.75736 4.75 6.75 5.75736 6.75 7C6.75 8.24264 7.75736 9.25 9 9.25Z",stroke:"#8E98A8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});var G=require("react/jsx-runtime"),Fe=()=>(0,G.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,G.jsx)("path",{d:"M4.08759 12.69C3.26171 11.9072 2.61006 10.9591 2.17509 9.90752C2.10081 9.73454 2.0625 9.54826 2.0625 9.36001C2.0625 9.17177 2.10081 8.98549 2.17509 8.81252C2.75274 7.4073 3.72095 6.19704 4.96509 5.32502C6.14597 4.4998 7.55989 4.07405 9.00009 4.11002C10.0363 4.084 11.064 4.30239 12.0001 4.74752M13.9201 6.03752C14.7415 6.81964 15.3904 7.76486 15.8251 8.81252C15.8994 8.98549 15.9377 9.17177 15.9377 9.36001C15.9377 9.54826 15.8994 9.73454 15.8251 9.90752C15.2474 11.3127 14.2792 12.523 13.0351 13.395C11.8542 14.2202 10.4403 14.646 9.00009 14.61C7.9639 14.636 6.93616 14.4176 6.00009 13.9725",stroke:"#8E98A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,G.jsx)("path",{d:"M6.5325 10.2375C6.42732 9.95694 6.37395 9.65962 6.375 9.36C6.375 8.66381 6.65156 7.99613 7.14384 7.50384C7.63613 7.01156 8.30381 6.735 9 6.735C9.3 6.7335 9.597 6.7875 9.8775 6.8925M11.4675 8.4825C11.5725 8.763 11.6265 9.06 11.625 9.36C11.625 10.0562 11.3484 10.7239 10.8562 11.2162C10.3639 11.7084 9.69619 11.985 9 11.985C8.70038 11.986 8.40306 11.9327 8.1225 11.8275M2.25 15L14.25 3",stroke:"#8E98A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});var F=require("react/jsx-runtime"),oe=({...e})=>{let[t,o]=(0,Ie.useState)(!1);return(0,F.jsx)(_,{sideNodeClassName:"!border-l-0",rightNode:t?(0,F.jsx)("button",{type:"button",onClick:()=>o(a=>!a),children:(0,F.jsx)(Te,{})}):(0,F.jsx)("button",{type:"button",onClick:()=>o(a=>!a),children:(0,F.jsx)(Fe,{})}),type:t?"text":"password",...e})};oe.displayName="PasswordInput";var Ve=require("class-variance-authority");var E=require("react/jsx-runtime"),Kt=(0,Ve.cva)("flex relative min-h-[80px] w-full rounded-[8px] border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",{variants:{status:{default:"border-[#D7D7D7] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-[#00B2A9] focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-[#00B2A9] dark:focus-within:border-[#9299A2] dark:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-status-error-fill bg-status-error-bg border-status-error-fill dark:!bg-status-error-bg-dark text-status-error-fill focus-within:bg-status-error-bg focus-within:border-status-error-fill",loading:"placeholder:text-[#C4C4C4]",prefilled:"resize-none bg-[#F6F6F6] border-[#D7D7D7] dark:!bg-transparent caret-[#D7D7D7] focus-within:bg-[#F6F6F6] focus-within:border-[#D7D7D7] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"}},defaultVariants:{status:"default"}}),re=({className:e,status:t="default",disabled:o,error:a,isLoading:i,showAsterisk:l,label:h,description:f,...y})=>{let p=t;return a&&(p="error"),i&&(p="loading"),o&&(p="prefilled"),(0,E.jsxs)("div",{className:"relative space-y-1",children:[(0,E.jsx)(k,{showAsterisk:l,error:a,children:h}),(0,E.jsx)("textarea",{className:r("min-h-[80px]",W({status:p}),e),disabled:i||o,...y}),(0,E.jsx)(B,{className:"text-gray-400 text-sm !font-normal",children:f}),(0,E.jsx)(O,{error:a})]})};re.displayName="Textarea";var A=g(require("react"));var R=g(require("react")),c=require("cmdk"),Ke=require("lucide-react");var Z=g(require("react")),s=g(require("@radix-ui/react-dialog"));var K=require("react/jsx-runtime"),Me=()=>(0,K.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"stroke-[#232528]]",children:[(0,K.jsx)("path",{d:"M5.00098 5L19 18.9991",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,K.jsx)("path",{d:"M4.99996 18.9991L18.999 5",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});var n=require("react/jsx-runtime"),nt=s.Root,st=s.Trigger,He=s.Portal,Oe=Z.forwardRef(({className:e,...t},o)=>(0,n.jsx)(s.Overlay,{ref:o,className:r("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Oe.displayName=s.Overlay.displayName;var ae=Z.forwardRef(({className:e,hideCloseButton:t,children:o,...a},i)=>(0,n.jsxs)(He,{children:[(0,n.jsx)(Oe,{}),(0,n.jsxs)(s.Content,{ref:i,className:r("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-transparent bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...a,children:[o,!t&&(0,n.jsxs)(s.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,n.jsx)(Me,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));ae.displayName=s.Content.displayName;var Be=({className:e,...t})=>(0,n.jsx)("div",{className:r("flex flex-col space-y-1.5 text-left",e),...t});Be.displayName="DialogHeader";var We=({className:e,...t})=>(0,n.jsx)("div",{className:r("flex flex-row justify-end sm:space-x-2",e),...t});We.displayName="DialogFooter";var _e=Z.forwardRef(({className:e,...t},o)=>(0,n.jsx)(s.Title,{ref:o,className:r("text-lg font-semibold leading-none tracking-tight",e),...t}));_e.displayName=s.Title.displayName;var ze=Z.forwardRef(({className:e,...t},o)=>(0,n.jsx)(s.Description,{ref:o,className:r("text-sm text-muted-foreground",e),...t}));ze.displayName=s.Description.displayName;var Ge=({trigger:e,children:t,open:o,onOpenChange:a,hideCloseButton:i,footer:l,title:h,description:f,contentClassName:y,headerClassName:p,titleClassName:d,descriptionClassName:u,footerClassName:D,asChild:I=!0,onOpenAutoFocus:V,onCloseAutoFocus:U,onEscapeKeyDown:j,onInteractOutside:S,onPointerDownOutside:X,...Y})=>(0,n.jsxs)(nt,{...Y,open:o,onOpenChange:a,children:[(0,n.jsx)(st,{asChild:I,children:e}),(0,n.jsx)(He,{children:(0,n.jsxs)(ae,{className:y,hideCloseButton:i,onOpenAutoFocus:V,onCloseAutoFocus:U,onEscapeKeyDown:j,onPointerDownOutside:X,onInteractOutside:S,children:[h||f?(0,n.jsxs)(Be,{className:p,children:[h&&(0,n.jsx)(_e,{className:d,children:h}),f&&(0,n.jsx)(ze,{className:u,children:f})]}):(0,n.jsx)(n.Fragment,{}),t,l&&(0,n.jsx)(We,{className:D,children:l})]})})]});Ge.displayName=s.Dialog.displayName;var b=require("react/jsx-runtime"),ie=R.forwardRef(({className:e,...t},o)=>(0,b.jsx)(c.Command,{ref:o,className:r("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));ie.displayName=c.Command.displayName;var ne=R.forwardRef(({className:e,CommandInputContainerClassName:t,loading:o,...a},i)=>(0,b.jsxs)("div",{className:r("flex items-center border-0 px-3 gap-2",t),"cmdk-input-wrapper":"",children:[o?(0,b.jsx)(T,{size:16,colour:"secondary"}):(0,b.jsx)(Ke.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,b.jsx)(c.Command.Input,{ref:i,className:r("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),disabled:o,...a})]}));ne.displayName=c.Command.Input.displayName;var se=R.forwardRef(({className:e,...t},o)=>(0,b.jsx)(c.Command.List,{ref:o,className:r("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));se.displayName=c.Command.List.displayName;var le=R.forwardRef((e,t)=>(0,b.jsx)(c.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));le.displayName=c.Command.Empty.displayName;var de=R.forwardRef(({className:e,...t},o)=>(0,b.jsx)(c.Command.Group,{ref:o,className:r("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));de.displayName=c.Command.Group.displayName;var lt=R.forwardRef(({className:e,...t},o)=>(0,b.jsx)(c.Command.Separator,{ref:o,className:r("-mx-1 h-px bg-border",e),...t}));lt.displayName=c.Command.Separator.displayName;var me=R.forwardRef(({className:e,...t},o)=>(0,b.jsx)(c.Command.Item,{ref:o,className:r("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));me.displayName=c.Command.Item.displayName;var dt=({className:e,...t})=>(0,b.jsx)("span",{className:r("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});dt.displayName="CommandShortcut";var Ze=g(require("react")),x=g(require("@radix-ui/react-popover"));var w=require("react/jsx-runtime"),pe=x.Root,ce=x.Trigger,Q=Ze.forwardRef(({className:e,align:t="center",sideOffset:o=4,portal:a=!0,...i},l)=>a?(0,w.jsx)(x.Portal,{children:(0,w.jsx)(x.Content,{ref:l,align:t,sideOffset:o,className:r("pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onOpenAutoFocus:i.onOpenAutoFocus,onCloseAutoFocus:i.onCloseAutoFocus,...i})}):(0,w.jsx)(x.Content,{ref:l,align:t,sideOffset:o,className:r("pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onOpenAutoFocus:i.onOpenAutoFocus,onCloseAutoFocus:i.onCloseAutoFocus,...i}));Q.displayName=x.Content.displayName;var mt=({trigger:e,children:t,open:o,onOpenChange:a,contentClassName:i,asChild:l=!0,align:h,side:f,alignOffset:y,sideOffset:p,onOpenAutoFocus:d,onCloseAutoFocus:u,...D})=>(0,w.jsxs)(pe,{...D,open:o,onOpenChange:a,children:[(0,w.jsx)(ce,{asChild:l,children:e}),(0,w.jsx)(Q,{alignOffset:y,sideOffset:p,side:f,align:h,className:i,onOpenAutoFocus:d,onCloseAutoFocus:u,children:t})]});mt.displayName=x.Root.displayName;var fe=g(require("react")),v=g(require("@radix-ui/react-scroll-area"));var N=require("react/jsx-runtime"),ue=fe.forwardRef(({className:e,children:t,...o},a)=>(0,N.jsxs)(v.Root,{ref:a,className:r("relative overflow-hidden",e),...o,children:[(0,N.jsx)(v.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,N.jsx)(je,{}),(0,N.jsx)(v.Corner,{})]}));ue.displayName=v.Root.displayName;var je=fe.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,N.jsx)(v.ScrollAreaScrollbar,{ref:a,orientation:t,className:r("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,N.jsx)(v.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));je.displayName=v.ScrollAreaScrollbar.displayName;var m=require("react/jsx-runtime"),qe=({className:e,value:t,placeholder:o="",status:a,disabled:i})=>(0,m.jsx)(ce,{asChild:!0,disabled:i,children:(0,m.jsxs)("button",{disabled:i,className:r(W({status:a}),"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",t?"":"text-[#79818C]",e),children:[t??o??"Select options...",(0,m.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:(0,m.jsx)("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),Je=({options:e,value:t,onChange:o,containerClassName:a,placeholder:i,disabled:l,loading:h,optionComponent:f,children:y,modal:p,hideSearch:d,className:u,inputValue:D,onValueChange:I,onInputValueChange:V})=>{let[U,j]=A.useState(!1),S=A.useRef(null),[X,Y]=A.useState(void 0);return A.useLayoutEffect(()=>{S.current&&Y(S.current.clientWidth)},[S.current]),(0,m.jsxs)(pe,{modal:p,open:U,onOpenChange:j,children:[(0,m.jsx)("div",{className:r("w-full",u),ref:S,children:y}),(0,m.jsx)(Q,{portal:p,className:"p-0 min-w-[200px]",style:{width:X},children:(0,m.jsxs)(ie,{className:"max-h-[270px] pt-3",children:[!d&&(0,m.jsx)(ne,{loading:h,placeholder:i??"Search options...",onValueChange:V,value:D,CommandInputContainerClassName:"mx-3 border rounded-md border-[#DEDEDE]"}),(0,m.jsx)(ue,{className:r("w-full px-0",a),children:(0,m.jsxs)(se,{children:[!d&&(0,m.jsx)(le,{children:"No result found."}),(0,m.jsx)(de,{className:"w-full",children:e.map(L=>(0,m.jsx)(me,{defaultValue:t?.label,value:L.label,disabled:l,onSelect:()=>{o(L),j(!1),I?.(L?.value)},children:f?f(L):L.label},L.value))})]})})]})})]})};var ge=require("react/jsx-runtime"),Qe=({hideSearch:e=!0,status:t,...o})=>(0,ge.jsx)(Je,{hideSearch:e,...o,children:(0,ge.jsx)(qe,{disabled:o?.disabled,placeholder:"Select or search email",status:t,value:o?.value?.label??o?.value?.value})});0&&(module.exports={Button,FormLabel,Input,Loader,PasswordInput,Select,Textarea});
2
+ //# sourceMappingURL=index.js.map