@itilite/lumina-ui 1.1.3 → 1.1.5

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.
Files changed (41) hide show
  1. package/dist/atom/RangePicker/Chevron.d.mts +13 -0
  2. package/dist/atom/RangePicker/Chevron.d.ts +13 -0
  3. package/dist/atom/RangePicker/Chevron.js +110 -0
  4. package/dist/atom/RangePicker/Chevron.mjs +7 -0
  5. package/dist/atom/RangePicker/RangePicker.d.mts +26 -0
  6. package/dist/atom/RangePicker/RangePicker.d.ts +26 -0
  7. package/dist/atom/RangePicker/RangePicker.js +1322 -0
  8. package/dist/atom/RangePicker/RangePicker.mjs +11 -0
  9. package/dist/atom/Select/Select.d.mts +40 -0
  10. package/dist/atom/Select/Select.d.ts +40 -0
  11. package/dist/atom/Select/Select.js +678 -0
  12. package/dist/atom/Select/Select.mjs +9 -0
  13. package/dist/chunk-33JITG5Y.mjs +621 -0
  14. package/dist/chunk-3K2RTVMH.mjs +584 -0
  15. package/dist/chunk-3YDCRJYV.mjs +618 -0
  16. package/dist/chunk-6NZEDJ2M.mjs +582 -0
  17. package/dist/chunk-BP4XS2GF.mjs +585 -0
  18. package/dist/chunk-BTIIO2CP.mjs +582 -0
  19. package/dist/chunk-D5B2TUSL.mjs +591 -0
  20. package/dist/chunk-E6UPDTDY.mjs +611 -0
  21. package/dist/chunk-G6P5MKL3.mjs +582 -0
  22. package/dist/chunk-IUTUCRDD.mjs +611 -0
  23. package/dist/chunk-JCMSG75Q.mjs +51 -0
  24. package/dist/chunk-JZCHXA6R.mjs +585 -0
  25. package/dist/chunk-KH7D4ESJ.mjs +584 -0
  26. package/dist/chunk-KQBCWIIM.mjs +618 -0
  27. package/dist/chunk-PGAAFJOG.mjs +576 -0
  28. package/dist/chunk-QUZAACW5.mjs +585 -0
  29. package/dist/chunk-RZ7V2KQZ.mjs +621 -0
  30. package/dist/chunk-S3CUYIE3.mjs +585 -0
  31. package/dist/chunk-TENXL4LK.mjs +107 -0
  32. package/dist/chunk-UFAFA6RV.mjs +585 -0
  33. package/dist/chunk-XE4LPYOW.mjs +581 -0
  34. package/dist/chunk-ZTRM4HZJ.mjs +53 -0
  35. package/dist/chunk-ZUMHWVMV.mjs +585 -0
  36. package/dist/index.d.mts +2 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.js +1259 -0
  39. package/dist/index.mjs +20 -11
  40. package/dist/styles.css +775 -199
  41. package/package.json +2 -1
@@ -0,0 +1,591 @@
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "./chunk-FWCSY2DS.mjs";
6
+
7
+ // src/atom/Select/Select.tsx
8
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
9
+ import clsx from "clsx";
10
+
11
+ // src/icons/Chevron.tsx
12
+ import * as React from "react";
13
+ import { jsx } from "react/jsx-runtime";
14
+ var Chevron = React.memo(
15
+ (_a) => {
16
+ var _b = _a, { size = 16, color = "#6b7280", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
17
+ return /* @__PURE__ */ jsx(
18
+ "svg",
19
+ __spreadProps(__spreadValues({
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ width: size,
22
+ height: size,
23
+ fill: "none",
24
+ viewBox: "0 0 16 16",
25
+ className
26
+ }, rest), {
27
+ children: /* @__PURE__ */ jsx(
28
+ "path",
29
+ {
30
+ fill: color,
31
+ d: "M11.78 6.22a.75.75 0 00-1.06 0L8 8.94 5.28 6.22a.75.75 0 00-1.06 1.06l3.25 3.25a.75.75 0 001.06 0l3.25-3.25a.75.75 0 000-1.06z"
32
+ }
33
+ )
34
+ })
35
+ );
36
+ }
37
+ );
38
+ Chevron.displayName = "Chevron";
39
+
40
+ // src/icons/CrossV2.tsx
41
+ import * as React2 from "react";
42
+ import { jsx as jsx2 } from "react/jsx-runtime";
43
+ var CrossV2 = React2.memo(
44
+ (_a) => {
45
+ var _b = _a, { size = 16, color = "#111827", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
46
+ return /* @__PURE__ */ jsx2(
47
+ "svg",
48
+ __spreadProps(__spreadValues({
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ width: size,
51
+ height: size,
52
+ fill: "none",
53
+ viewBox: "0 0 16 16",
54
+ className
55
+ }, rest), {
56
+ children: /* @__PURE__ */ jsx2(
57
+ "path",
58
+ {
59
+ fill: color,
60
+ fillRule: "evenodd",
61
+ d: "M4.293 4.293a1 1 0 011.414 0L8 6.586l2.293-2.293a1 1 0 111.414 1.414L9.414 8l2.293 2.293a1 1 0 01-1.414 1.414L8 9.414l-2.293 2.293a1 1 0 01-1.414-1.414L6.586 8 4.293 5.707a1 1 0 010-1.414z",
62
+ clipRule: "evenodd"
63
+ }
64
+ )
65
+ })
66
+ );
67
+ }
68
+ );
69
+ CrossV2.displayName = "CrossV2";
70
+
71
+ // src/atom/Select/Select.tsx
72
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
73
+ var Select = ({
74
+ label,
75
+ mandatory = false,
76
+ error = false,
77
+ options = [],
78
+ valueSelected = "",
79
+ // Keep for backward compatibility
80
+ value: _valueProp,
81
+ // Rename to avoid potential conflicts with native value attribute
82
+ onChange,
83
+ className = "",
84
+ dropdownClassName = "",
85
+ optionClassName = "",
86
+ style = {},
87
+ showDisplayValue = false,
88
+ // New prop to show displayValue instead of label
89
+ allowClear = true,
90
+ enableSearch = true,
91
+ // New prop to control search functionality, default true
92
+ doubleCharSearch = false,
93
+ id,
94
+ name,
95
+ tabIndex,
96
+ // Add tabIndex prop
97
+ // Additional styling props
98
+ size = "default",
99
+ // 'small', 'default', 'large'
100
+ variant = "default",
101
+ // 'default', 'filled', 'outlined'
102
+ wrapperClassName = "",
103
+ inputClassName = "",
104
+ // Custom class for input element specifically
105
+ labelClassName = "",
106
+ // Custom class for label element specifically
107
+ height = "tw-h-12",
108
+ // Custom height
109
+ experience = "business"
110
+ }) => {
111
+ const normalizeValue = useCallback(
112
+ (val) => {
113
+ if (val === null || val === void 0) return "";
114
+ return String(val);
115
+ },
116
+ []
117
+ );
118
+ const validatedOptions = useMemo(() => {
119
+ if (!Array.isArray(options)) return [];
120
+ return options.filter(
121
+ (opt) => opt && typeof opt === "object" && opt.value !== void 0 && opt.value !== null && opt.label !== void 0
122
+ );
123
+ }, [options]);
124
+ const [isOpen, setIsOpen] = useState(false);
125
+ const [isFocused, setIsFocused] = useState(false);
126
+ const [searchTerm, setSearchTerm] = useState("");
127
+ const [isHovering, setIsHovering] = useState(false);
128
+ const [highlightedIndex, setHighlightedIndex] = useState(-1);
129
+ const [selectedValue, setSelectedValue] = useState(() => {
130
+ const initialValue = valueSelected;
131
+ if (initialValue === null || initialValue === void 0) return "";
132
+ return String(initialValue);
133
+ });
134
+ const inputRef = useRef(null);
135
+ const inputValueRef = useRef("");
136
+ const dropdownRef = useRef(null);
137
+ const optionRefs = useRef([]);
138
+ const optionListRef = useRef(null);
139
+ const blurTimeoutRef = useRef(null);
140
+ const hoverTimeoutRef = useRef(null);
141
+ const isActive = isFocused || Boolean(selectedValue) || Boolean(valueSelected) || Boolean(searchTerm);
142
+ const sizeClasses = useMemo(() => {
143
+ switch (size) {
144
+ case "small":
145
+ return {
146
+ input: "tw-h-8 tw-px-3 tw-typography-body2",
147
+ padding: label ? "tw-pt-4 tw-pb-1" : "tw-py-2",
148
+ labelActive: "tw-top-0 tw-typography-caption4",
149
+ labelInactive: "tw-top-2 tw-typography-caption3"
150
+ };
151
+ case "medium":
152
+ return {
153
+ input: "tw-h-10 tw-px-4 tw-typography-body2",
154
+ padding: label ? "tw-pt-4 tw-pb-1" : "tw-py-2",
155
+ labelActive: "tw-top-1 tw-typography-caption3",
156
+ labelInactive: "tw-top-2.5 tw-typography-body2"
157
+ };
158
+ case "large":
159
+ return {
160
+ input: "tw-h-16 tw-px-5 tw-typography-bodyLarge",
161
+ padding: label ? "tw-pt-8 tw-pb-4" : "tw-py-5",
162
+ labelActive: "tw-top-1 tw-typography-caption2",
163
+ labelInactive: "tw-top-5 tw-typography-body1"
164
+ };
165
+ default:
166
+ return {
167
+ input: height + " tw-px-4 tw-typography-bodyLarge",
168
+ padding: label ? "tw-pt-6 tw-pb-3" : "tw-py-3",
169
+ labelActive: "tw-top-1 tw-typography-caption3",
170
+ labelInactive: "tw-top-3.5 tw-typography-body2"
171
+ };
172
+ }
173
+ }, [size, label, height]);
174
+ const variantClasses = useMemo(() => {
175
+ switch (variant) {
176
+ case "filled":
177
+ return "tw-bg-gray-50 tw-border-transparent";
178
+ case "outlined":
179
+ return "tw-bg-transparent tw-border-2";
180
+ default:
181
+ return " tw-border";
182
+ }
183
+ }, [variant]);
184
+ const handleBlur = useCallback(() => {
185
+ blurTimeoutRef.current = setTimeout(() => {
186
+ setIsOpen(false);
187
+ setSearchTerm("");
188
+ setHighlightedIndex(-1);
189
+ blurTimeoutRef.current = null;
190
+ setIsFocused(false);
191
+ }, 150);
192
+ }, []);
193
+ const handleSearchChange = useCallback(
194
+ (e) => {
195
+ var _a;
196
+ if (doubleCharSearch) {
197
+ setSearchTerm(e.target.value.slice(0, 2) || "");
198
+ } else {
199
+ setSearchTerm(e.target.value);
200
+ }
201
+ setIsOpen(true);
202
+ setHighlightedIndex(-1);
203
+ (_a = optionListRef == null ? void 0 : optionListRef.current) == null ? void 0 : _a.scrollTo({
204
+ top: 0,
205
+ behavior: "smooth"
206
+ });
207
+ },
208
+ [doubleCharSearch]
209
+ );
210
+ const handleOptionSelect = useCallback(
211
+ (option) => {
212
+ var _a;
213
+ if (blurTimeoutRef.current) {
214
+ clearTimeout(blurTimeoutRef.current);
215
+ blurTimeoutRef.current = null;
216
+ }
217
+ inputValueRef.current = option.label;
218
+ const normalizedValue = normalizeValue(option.value);
219
+ setSelectedValue(normalizedValue);
220
+ setSearchTerm("");
221
+ setIsOpen(false);
222
+ if (enableSearch) {
223
+ setIsFocused(false);
224
+ }
225
+ setIsHovering(false);
226
+ if (onChange) onChange(option.value);
227
+ if (enableSearch) (_a = inputRef.current) == null ? void 0 : _a.blur();
228
+ },
229
+ [normalizeValue, onChange, enableSearch]
230
+ );
231
+ const handleClear = useCallback(
232
+ (e) => {
233
+ var _a;
234
+ inputValueRef.current = "";
235
+ e.stopPropagation();
236
+ e.preventDefault();
237
+ setSelectedValue("");
238
+ setSearchTerm("");
239
+ if (enableSearch) {
240
+ setIsOpen(true);
241
+ setIsFocused(true);
242
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
243
+ } else {
244
+ setIsOpen(false);
245
+ setIsFocused(false);
246
+ }
247
+ if (onChange) onChange(null);
248
+ },
249
+ [onChange, enableSearch]
250
+ );
251
+ useEffect(() => {
252
+ if (!validatedOptions.length) {
253
+ setSelectedValue("");
254
+ setSearchTerm("");
255
+ inputValueRef.current = "";
256
+ }
257
+ }, [validatedOptions.length]);
258
+ useEffect(() => {
259
+ const newValue = normalizeValue(valueSelected);
260
+ setSelectedValue((prevValue) => {
261
+ const prevNormalized = normalizeValue(prevValue);
262
+ return prevNormalized !== newValue ? newValue : prevValue;
263
+ });
264
+ }, [valueSelected, normalizeValue]);
265
+ useEffect(() => {
266
+ const handleClickOutside = (event) => {
267
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
268
+ if (blurTimeoutRef.current) {
269
+ clearTimeout(blurTimeoutRef.current);
270
+ blurTimeoutRef.current = null;
271
+ }
272
+ setIsOpen(false);
273
+ setIsFocused(false);
274
+ setSearchTerm("");
275
+ setHighlightedIndex(-1);
276
+ }
277
+ };
278
+ document.addEventListener("mousedown", handleClickOutside);
279
+ return () => {
280
+ document.removeEventListener("mousedown", handleClickOutside);
281
+ if (blurTimeoutRef.current) {
282
+ clearTimeout(blurTimeoutRef.current);
283
+ }
284
+ if (hoverTimeoutRef.current) {
285
+ clearTimeout(hoverTimeoutRef.current);
286
+ }
287
+ };
288
+ }, []);
289
+ const getDisplayValue = useCallback(() => {
290
+ if (selectedValue && (validatedOptions == null ? void 0 : validatedOptions.length) > 0) {
291
+ const selected = validatedOptions.find(
292
+ (opt) => normalizeValue(opt.value) === normalizeValue(selectedValue)
293
+ );
294
+ if (selected) {
295
+ return showDisplayValue && selected.displayValue ? selected.displayValue : selected.label;
296
+ }
297
+ }
298
+ if (selectedValue && (!validatedOptions || validatedOptions.length === 0)) {
299
+ return selectedValue;
300
+ }
301
+ return "";
302
+ }, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
303
+ const filteredOptions = useMemo(() => {
304
+ var _a;
305
+ if (!enableSearch) {
306
+ return validatedOptions;
307
+ }
308
+ (_a = dropdownRef.current) == null ? void 0 : _a.scrollTo(0, 0);
309
+ const updatedFilteredOptions = validatedOptions.filter((option) => {
310
+ var _a2;
311
+ return (_a2 = option == null ? void 0 : option.label) == null ? void 0 : _a2.toLowerCase().includes(searchTerm == null ? void 0 : searchTerm.toLowerCase());
312
+ });
313
+ return updatedFilteredOptions;
314
+ }, [validatedOptions, searchTerm, enableSearch]);
315
+ const getSelectedOptionIndex = useCallback(() => {
316
+ if (!selectedValue || !filteredOptions.length) {
317
+ return 0;
318
+ }
319
+ const index = filteredOptions.findIndex(
320
+ (option) => normalizeValue(option.value) === normalizeValue(selectedValue)
321
+ );
322
+ return index >= 0 ? index : 0;
323
+ }, [selectedValue, filteredOptions, normalizeValue]);
324
+ const handleInputInteraction = useCallback(
325
+ (_e) => {
326
+ var _a;
327
+ if (blurTimeoutRef.current) {
328
+ clearTimeout(blurTimeoutRef.current);
329
+ blurTimeoutRef.current = null;
330
+ }
331
+ if (isOpen) {
332
+ setIsOpen(false);
333
+ setIsFocused(false);
334
+ setSearchTerm("");
335
+ setHighlightedIndex(-1);
336
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
337
+ return;
338
+ }
339
+ setIsFocused(true);
340
+ setIsOpen(true);
341
+ setHighlightedIndex(getSelectedOptionIndex());
342
+ if (inputRef.current) {
343
+ inputRef.current.focus();
344
+ }
345
+ },
346
+ [isOpen, getSelectedOptionIndex]
347
+ );
348
+ const handleKeyDown = useCallback(
349
+ (e) => {
350
+ var _a;
351
+ if (!isOpen) return;
352
+ switch (e.key) {
353
+ case "ArrowDown":
354
+ e.preventDefault();
355
+ setHighlightedIndex((prev) => {
356
+ const nextIndex = prev < filteredOptions.length - 1 ? prev + 1 : prev;
357
+ return nextIndex;
358
+ });
359
+ break;
360
+ case "ArrowUp":
361
+ e.preventDefault();
362
+ setHighlightedIndex((prev) => {
363
+ const nextIndex = prev > 0 ? prev - 1 : prev;
364
+ return nextIndex;
365
+ });
366
+ break;
367
+ case "Enter":
368
+ e.preventDefault();
369
+ if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {
370
+ handleOptionSelect(filteredOptions[highlightedIndex]);
371
+ }
372
+ break;
373
+ case "Escape":
374
+ e.preventDefault();
375
+ setIsOpen(false);
376
+ setIsFocused(false);
377
+ setSearchTerm("");
378
+ setHighlightedIndex(-1);
379
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
380
+ break;
381
+ default:
382
+ break;
383
+ }
384
+ },
385
+ [isOpen, highlightedIndex, filteredOptions, handleOptionSelect]
386
+ );
387
+ useEffect(() => {
388
+ if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
389
+ optionRefs.current[highlightedIndex].scrollIntoView({
390
+ block: "nearest",
391
+ behavior: "smooth"
392
+ });
393
+ }
394
+ }, [highlightedIndex]);
395
+ useEffect(() => {
396
+ optionRefs.current = [];
397
+ }, [filteredOptions]);
398
+ const handleMouseEnter = useCallback(() => {
399
+ if (hoverTimeoutRef.current) {
400
+ clearTimeout(hoverTimeoutRef.current);
401
+ }
402
+ if (!isHovering) {
403
+ setIsHovering(true);
404
+ }
405
+ }, [isHovering]);
406
+ const handleMouseLeave = useCallback(() => {
407
+ hoverTimeoutRef.current = setTimeout(() => {
408
+ setIsHovering(false);
409
+ }, 50);
410
+ }, []);
411
+ const handleChevronClick = useCallback(
412
+ (e) => {
413
+ var _a;
414
+ e.preventDefault();
415
+ if (blurTimeoutRef.current) {
416
+ clearTimeout(blurTimeoutRef.current);
417
+ blurTimeoutRef.current = null;
418
+ }
419
+ if (isOpen) {
420
+ setIsOpen(false);
421
+ setIsFocused(false);
422
+ setSearchTerm("");
423
+ setHighlightedIndex(-1);
424
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
425
+ } else {
426
+ if (inputRef.current) {
427
+ inputRef.current.focus();
428
+ }
429
+ handleInputInteraction();
430
+ }
431
+ },
432
+ [isOpen, handleInputInteraction]
433
+ );
434
+ return /* @__PURE__ */ jsxs(
435
+ "div",
436
+ {
437
+ style,
438
+ className: clsx("tw-relative tw-w-full", wrapperClassName),
439
+ ref: dropdownRef,
440
+ onMouseEnter: handleMouseEnter,
441
+ onMouseLeave: handleMouseLeave,
442
+ children: [
443
+ /* @__PURE__ */ jsxs("div", { className: "tw-relative", children: [
444
+ /* @__PURE__ */ jsx3(
445
+ "input",
446
+ {
447
+ ref: inputRef,
448
+ type: "text",
449
+ id,
450
+ name,
451
+ tabIndex,
452
+ autoComplete: "off",
453
+ autoCorrect: "off",
454
+ autoCapitalize: "off",
455
+ spellCheck: "false",
456
+ value: isFocused && enableSearch ? searchTerm : getDisplayValue(),
457
+ onChange: enableSearch ? handleSearchChange : void 0,
458
+ onClick: handleInputInteraction,
459
+ onKeyDown: handleKeyDown,
460
+ className: clsx(
461
+ "tw-w-full tw-rounded-xl tw-outline-none tw-transition-all tw-duration-200 tw-cursor-pointer tw-border-solid tw-text-color-text-default",
462
+ sizeClasses.input,
463
+ sizeClasses.padding,
464
+ variantClasses,
465
+ {
466
+ "tw-bg-white": valueSelected || getDisplayValue() || isFocused,
467
+ "tw-bg-color-gray-5": !valueSelected || !getDisplayValue()
468
+ },
469
+ // Conditional padding based on label presence
470
+ !label && "tw-flex tw-items-center",
471
+ {
472
+ "!tw-border-color-primary": isFocused && experience === "business"
473
+ },
474
+ {
475
+ "!tw-border-[#804D7B]": isFocused && experience === "personal"
476
+ },
477
+ error ? "!tw-border-color-text-critical " : "tw-border-[#EBE3DD] hover:tw-border-[#C5B7AC]",
478
+ // Add focus state styling
479
+ "focus:tw-shadow-sm focus:tw-ring-offset-1",
480
+ className,
481
+ inputClassName
482
+ // Put inputClassName last so it can override default classes
483
+ ),
484
+ readOnly: !isFocused || !enableSearch
485
+ }
486
+ ),
487
+ label && /* @__PURE__ */ jsxs(
488
+ "label",
489
+ {
490
+ htmlFor: id,
491
+ className: clsx(
492
+ "tw-absolute tw-left-[18px] tw-pointer-events-none tw-transition-all tw-duration-200 tw-ease-out tw-text-gray-500",
493
+ isActive ? sizeClasses.labelActive : sizeClasses.labelInactive,
494
+ error && "tw-text-color-text-critical",
495
+ labelClassName
496
+ ),
497
+ children: [
498
+ label,
499
+ mandatory && /* @__PURE__ */ jsx3("span", { className: "tw-text-color-text-critical tw-ml-1", children: "*" })
500
+ ]
501
+ }
502
+ ),
503
+ /* @__PURE__ */ jsx3(
504
+ "div",
505
+ {
506
+ className: clsx(
507
+ "tw-absolute tw-right-3 tw-top-1/2 tw--translate-y-1/2 tw-flex tw-items-center",
508
+ {
509
+ "!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear)
510
+ }
511
+ ),
512
+ children: /* @__PURE__ */ jsx3(
513
+ "div",
514
+ {
515
+ className: clsx(
516
+ "tw-transition-all tw-duration-200 tw-cursor-pointer tw-flex tw-items-center",
517
+ // Only rotate chevron when open and not showing clear icon
518
+ isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
519
+ ),
520
+ onMouseDown: (e) => {
521
+ if (isHovering && selectedValue && allowClear) {
522
+ handleClear(e);
523
+ } else {
524
+ handleChevronClick(e);
525
+ }
526
+ },
527
+ children: isHovering && selectedValue && allowClear ? /* @__PURE__ */ jsx3(CrossV2, { color: "#111827", className: "tw-mr-1" }) : /* @__PURE__ */ jsx3(
528
+ Chevron,
529
+ {
530
+ className: clsx("tw-text-gray-400 -tw-rotate-90"),
531
+ color: "#6B7280"
532
+ }
533
+ )
534
+ }
535
+ )
536
+ }
537
+ )
538
+ ] }),
539
+ isOpen && /* @__PURE__ */ jsx3(
540
+ "div",
541
+ {
542
+ className: clsx(
543
+ "tw-absolute tw-z-[100] tw-w-full tw-mt-0 tw-bg-white tw-border tw-border-[#ebe3dd] tw-border-solid tw-rounded-xl tw-shadow-lg tw-overflow-y-auto tw-py-1",
544
+ { "tw-max-h-60": !doubleCharSearch },
545
+ { "tw-max-h-44": doubleCharSearch },
546
+ dropdownClassName
547
+ ),
548
+ ref: optionListRef,
549
+ children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ jsx3(
550
+ "div",
551
+ {
552
+ ref: (el) => optionRefs.current[index] = el,
553
+ onClick: () => handleOptionSelect(option),
554
+ onMouseEnter: () => setHighlightedIndex(index),
555
+ className: clsx(
556
+ "tw-transition-all tw-duration-150 tw-typography-body2",
557
+ // Selected option styling
558
+ optionClassName
559
+ ),
560
+ children: /* @__PURE__ */ jsx3(
561
+ "div",
562
+ {
563
+ className: clsx(
564
+ "tw-px-4 tw-cursor-pointer tw-py-2 tw-mx-0.5 tw-rounded-xl",
565
+ normalizeValue(selectedValue) === normalizeValue(option.value) ? experience === "personal" ? "tw-bg-[#f1e8fa]" : "tw-bg-[#fff1e1]" : (
566
+ // Highlighted option styling (keyboard navigation)
567
+ index === highlightedIndex ? "tw-bg-[#f3f4f6] tw-text-gray-900" : (
568
+ // Default option styling
569
+ "tw-text-gray-900 hover:tw-bg-[#1118270a]"
570
+ )
571
+ )
572
+ ),
573
+ children: option.label
574
+ }
575
+ )
576
+ },
577
+ doubleCharSearch ? option.label : option.value
578
+ )) : /* @__PURE__ */ jsx3("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
579
+ }
580
+ )
581
+ ]
582
+ }
583
+ );
584
+ };
585
+ Select.displayName = "Select";
586
+ var Select_default = Select;
587
+
588
+ export {
589
+ Select,
590
+ Select_default
591
+ };