@sikka/hawa 0.46.4-next → 0.47.0-next

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/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
  2. package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
  3. package/dist/blocks/auth/index.d.mts +8 -8
  4. package/dist/blocks/auth/index.d.ts +8 -8
  5. package/dist/blocks/auth/index.js +85 -128
  6. package/dist/blocks/auth/index.mjs +18 -50
  7. package/dist/blocks/feedback/index.js +68 -79
  8. package/dist/blocks/feedback/index.mjs +1 -1
  9. package/dist/blocks/index.d.mts +3 -3
  10. package/dist/blocks/index.d.ts +3 -3
  11. package/dist/blocks/index.js +85 -128
  12. package/dist/blocks/index.mjs +5 -24
  13. package/dist/blocks/misc/index.js +68 -79
  14. package/dist/blocks/misc/index.mjs +1 -1
  15. package/dist/{chunk-5CTMGPEF.mjs → chunk-342KIV4R.mjs} +81 -105
  16. package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
  17. package/dist/elements/index.d.mts +2 -2
  18. package/dist/elements/index.d.ts +2 -2
  19. package/dist/elements/index.js +81 -105
  20. package/dist/elements/index.mjs +1 -1
  21. package/dist/index.d.mts +10 -9
  22. package/dist/index.d.ts +10 -9
  23. package/dist/index.js +85 -128
  24. package/dist/index.mjs +85 -128
  25. package/dist/phoneInput/index.d.mts +7 -7
  26. package/dist/phoneInput/index.d.ts +7 -7
  27. package/dist/phoneInput/index.js +78 -85
  28. package/dist/phoneInput/index.js.map +1 -1
  29. package/dist/phoneInput/index.mjs +78 -85
  30. package/dist/phoneInput/index.mjs.map +1 -1
  31. package/dist/pinInput/index.js +3 -20
  32. package/dist/pinInput/index.js.map +1 -1
  33. package/dist/pinInput/index.mjs +3 -20
  34. package/dist/pinInput/index.mjs.map +1 -1
  35. package/dist/select/index.d.mts +1 -0
  36. package/dist/select/index.d.ts +1 -0
  37. package/dist/select/index.js +68 -79
  38. package/dist/select/index.js.map +1 -1
  39. package/dist/select/index.mjs +68 -79
  40. package/dist/select/index.mjs.map +1 -1
  41. package/package.json +1 -1
@@ -1499,6 +1499,7 @@ var import_clsx2 = __toESM(require("clsx"));
1499
1499
  var Select = ({
1500
1500
  labelProps,
1501
1501
  labelKey = "label",
1502
+ valueKey = "value",
1502
1503
  ...props
1503
1504
  }) => {
1504
1505
  const NoOption = () => {
@@ -1518,13 +1519,7 @@ var Select = ({
1518
1519
  children
1519
1520
  );
1520
1521
  };
1521
- const Option = ({
1522
- children,
1523
- innerProps,
1524
- innerRef,
1525
- isFocused,
1526
- isSelected
1527
- }) => {
1522
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
1528
1523
  return /* @__PURE__ */ import_react33.default.createElement(
1529
1524
  "div",
1530
1525
  {
@@ -1539,14 +1534,7 @@ var Select = ({
1539
1534
  children
1540
1535
  );
1541
1536
  };
1542
- const Menu = ({
1543
- cx,
1544
- children,
1545
- getStyles,
1546
- innerProps,
1547
- innerRef,
1548
- ...menuProps
1549
- }) => {
1537
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
1550
1538
  const menuOpen = menuProps.selectProps.menuIsOpen;
1551
1539
  return /* @__PURE__ */ import_react33.default.createElement(
1552
1540
  "div",
@@ -1575,71 +1563,72 @@ var Select = ({
1575
1563
  )
1576
1564
  },
1577
1565
  props.label && /* @__PURE__ */ import_react33.default.createElement(Label, { ...labelProps }, props.label),
1578
- props.isLoading ? /* @__PURE__ */ import_react33.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
1579
- // TODO: enable keyboard to go to the next item in the list
1580
- /* @__PURE__ */ import_react33.default.createElement(
1581
- import_react_select.default,
1582
- {
1583
- noOptionsMessage: NoOption,
1584
- classNames: {
1585
- control: () => cn(
1586
- props.phoneCode && "hawa-rounded-r-none",
1587
- props.controlClassNames
1588
- ),
1589
- container: () => cn(
1590
- selectContainerStyles,
1591
- props.phoneCode && phoneCodeStyles,
1592
- props.isMulti && "hawa-ps-0 "
1593
- ),
1594
- placeholder: () => cn(
1595
- selectPlaceholderStyles,
1596
- props.disabled && "hawa-text-muted-foreground"
1597
- ),
1598
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
1599
- singleValue: () => cn(
1600
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
1601
- ),
1602
- indicatorsContainer: () => cn(
1603
- selectIndicatorContainerStyles,
1604
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
1605
- props.disabled && "hawa-opacity-30"
1606
- )
1607
- },
1608
- unstyled: true,
1609
- autoFocus: false,
1610
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
1566
+ props.isLoading ? /* @__PURE__ */ import_react33.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react33.default.createElement(
1567
+ import_react_select.default,
1568
+ {
1569
+ noOptionsMessage: NoOption,
1570
+ classNames: {
1571
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
1572
+ container: () => cn(
1573
+ selectContainerStyles,
1574
+ props.phoneCode && phoneCodeStyles,
1575
+ props.isMulti && "hawa-ps-0 "
1576
+ ),
1577
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
1578
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
1579
+ singleValue: () => cn(
1580
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
1581
+ ),
1582
+ indicatorsContainer: () => cn(
1583
+ selectIndicatorContainerStyles,
1584
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
1585
+ props.disabled && "hawa-opacity-30"
1586
+ )
1587
+ },
1588
+ unstyled: true,
1589
+ autoFocus: false,
1590
+ components: props.hideIndicator ? {
1591
+ Option: (optionProps) => /* @__PURE__ */ import_react33.default.createElement(
1611
1592
  Option,
1612
- Menu,
1613
- ValueContainer: (e) => /* @__PURE__ */ import_react33.default.createElement(
1614
- "div",
1615
- {
1616
- className: cn(
1617
- e.className,
1618
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
1619
- ),
1620
- ...e
1621
- }
1622
- ),
1623
- MultiValueContainer: (e) => /* @__PURE__ */ import_react33.default.createElement(
1624
- "div",
1625
- {
1626
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
1627
- ...e
1628
- }
1629
- )
1630
- },
1631
- onChange: (newValue, action) => props.onChange(newValue, action),
1632
- options: props.options,
1633
- getOptionLabel: props.getOptionLabel,
1634
- defaultValue: props.defaultValue,
1635
- value: props.value,
1636
- placeholder: props.placeholder,
1637
- isDisabled: props.disabled,
1638
- isClearable: props.isClearable,
1639
- isMulti: props.isMulti,
1640
- isSearchable: props.isSearchable
1641
- }
1642
- )
1593
+ {
1594
+ ...optionProps,
1595
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
1596
+ }
1597
+ ),
1598
+ Menu,
1599
+ IndicatorsContainer: () => null
1600
+ } : {
1601
+ Option,
1602
+ Menu,
1603
+ ValueContainer: (e) => /* @__PURE__ */ import_react33.default.createElement(
1604
+ "div",
1605
+ {
1606
+ className: cn(
1607
+ e.className,
1608
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
1609
+ ),
1610
+ ...e
1611
+ }
1612
+ ),
1613
+ MultiValueContainer: (e) => /* @__PURE__ */ import_react33.default.createElement(
1614
+ "div",
1615
+ {
1616
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
1617
+ ...e
1618
+ }
1619
+ )
1620
+ },
1621
+ onChange: (newValue, action) => props.onChange(newValue, action),
1622
+ options: props.options,
1623
+ getOptionLabel: props.getOptionLabel,
1624
+ defaultValue: props.defaultValue,
1625
+ value: props.value,
1626
+ placeholder: props.placeholder,
1627
+ isDisabled: props.disabled,
1628
+ isClearable: props.isClearable,
1629
+ isMulti: props.isMulti,
1630
+ isSearchable: props.isSearchable
1631
+ }
1643
1632
  ) : /* @__PURE__ */ import_react33.default.createElement(
1644
1633
  import_creatable.default,
1645
1634
  {
@@ -11,7 +11,7 @@ import {
11
11
  } from "../../chunk-5S5DR7KF.mjs";
12
12
  import {
13
13
  Select
14
- } from "../../chunk-6TG2PHZK.mjs";
14
+ } from "../../chunk-AWJSHOYU.mjs";
15
15
  import {
16
16
  Button,
17
17
  Card,
@@ -350,6 +350,7 @@ import clsx from "clsx";
350
350
  var Select = ({
351
351
  labelProps,
352
352
  labelKey = "label",
353
+ valueKey = "value",
353
354
  ...props
354
355
  }) => {
355
356
  const NoOption = () => {
@@ -369,13 +370,7 @@ var Select = ({
369
370
  children
370
371
  );
371
372
  };
372
- const Option = ({
373
- children,
374
- innerProps,
375
- innerRef,
376
- isFocused,
377
- isSelected
378
- }) => {
373
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
379
374
  return /* @__PURE__ */ React3.createElement(
380
375
  "div",
381
376
  {
@@ -390,14 +385,7 @@ var Select = ({
390
385
  children
391
386
  );
392
387
  };
393
- const Menu = ({
394
- cx,
395
- children,
396
- getStyles,
397
- innerProps,
398
- innerRef,
399
- ...menuProps
400
- }) => {
388
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
401
389
  const menuOpen = menuProps.selectProps.menuIsOpen;
402
390
  return /* @__PURE__ */ React3.createElement(
403
391
  "div",
@@ -426,71 +414,72 @@ var Select = ({
426
414
  )
427
415
  },
428
416
  props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
429
- props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
430
- // TODO: enable keyboard to go to the next item in the list
431
- /* @__PURE__ */ React3.createElement(
432
- ReactSelect,
433
- {
434
- noOptionsMessage: NoOption,
435
- classNames: {
436
- control: () => cn(
437
- props.phoneCode && "hawa-rounded-r-none",
438
- props.controlClassNames
439
- ),
440
- container: () => cn(
441
- selectContainerStyles,
442
- props.phoneCode && phoneCodeStyles,
443
- props.isMulti && "hawa-ps-0 "
444
- ),
445
- placeholder: () => cn(
446
- selectPlaceholderStyles,
447
- props.disabled && "hawa-text-muted-foreground"
448
- ),
449
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
450
- singleValue: () => cn(
451
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
452
- ),
453
- indicatorsContainer: () => cn(
454
- selectIndicatorContainerStyles,
455
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
456
- props.disabled && "hawa-opacity-30"
457
- )
458
- },
459
- unstyled: true,
460
- autoFocus: false,
461
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
417
+ props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React3.createElement(
418
+ ReactSelect,
419
+ {
420
+ noOptionsMessage: NoOption,
421
+ classNames: {
422
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
423
+ container: () => cn(
424
+ selectContainerStyles,
425
+ props.phoneCode && phoneCodeStyles,
426
+ props.isMulti && "hawa-ps-0 "
427
+ ),
428
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
429
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
430
+ singleValue: () => cn(
431
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
432
+ ),
433
+ indicatorsContainer: () => cn(
434
+ selectIndicatorContainerStyles,
435
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
436
+ props.disabled && "hawa-opacity-30"
437
+ )
438
+ },
439
+ unstyled: true,
440
+ autoFocus: false,
441
+ components: props.hideIndicator ? {
442
+ Option: (optionProps) => /* @__PURE__ */ React3.createElement(
462
443
  Option,
463
- Menu,
464
- ValueContainer: (e) => /* @__PURE__ */ React3.createElement(
465
- "div",
466
- {
467
- className: cn(
468
- e.className,
469
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
470
- ),
471
- ...e
472
- }
473
- ),
474
- MultiValueContainer: (e) => /* @__PURE__ */ React3.createElement(
475
- "div",
476
- {
477
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
478
- ...e
479
- }
480
- )
481
- },
482
- onChange: (newValue, action) => props.onChange(newValue, action),
483
- options: props.options,
484
- getOptionLabel: props.getOptionLabel,
485
- defaultValue: props.defaultValue,
486
- value: props.value,
487
- placeholder: props.placeholder,
488
- isDisabled: props.disabled,
489
- isClearable: props.isClearable,
490
- isMulti: props.isMulti,
491
- isSearchable: props.isSearchable
492
- }
493
- )
444
+ {
445
+ ...optionProps,
446
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
447
+ }
448
+ ),
449
+ Menu,
450
+ IndicatorsContainer: () => null
451
+ } : {
452
+ Option,
453
+ Menu,
454
+ ValueContainer: (e) => /* @__PURE__ */ React3.createElement(
455
+ "div",
456
+ {
457
+ className: cn(
458
+ e.className,
459
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
460
+ ),
461
+ ...e
462
+ }
463
+ ),
464
+ MultiValueContainer: (e) => /* @__PURE__ */ React3.createElement(
465
+ "div",
466
+ {
467
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
468
+ ...e
469
+ }
470
+ )
471
+ },
472
+ onChange: (newValue, action) => props.onChange(newValue, action),
473
+ options: props.options,
474
+ getOptionLabel: props.getOptionLabel,
475
+ defaultValue: props.defaultValue,
476
+ value: props.value,
477
+ placeholder: props.placeholder,
478
+ isDisabled: props.disabled,
479
+ isClearable: props.isClearable,
480
+ isMulti: props.isMulti,
481
+ isSearchable: props.isSearchable
482
+ }
494
483
  ) : /* @__PURE__ */ React3.createElement(
495
484
  CreatableSelect,
496
485
  {
@@ -2228,11 +2217,13 @@ var PhoneInput = ({
2228
2217
  countryCodes,
2229
2218
  ...props
2230
2219
  }) => {
2220
+ var _a;
2231
2221
  const [phoneNumber, setPhoneNumber] = useState3("");
2232
- const [countryCode, setCountryCode] = useState3(props.preferredCountry);
2222
+ const [countryCode, setCountryCode] = useState3(
2223
+ props.preferredCountry || { label: "+966" }
2224
+ );
2233
2225
  const inputRef = useRef2(null);
2234
2226
  const handleInputChange = (e) => {
2235
- console.log("test e ", e.target.value);
2236
2227
  const validChars = /^[0-9-()]+$/;
2237
2228
  const input = e.target.value;
2238
2229
  if (input === "" || validChars.test(input)) {
@@ -2254,11 +2245,13 @@ var PhoneInput = ({
2254
2245
  isMulti: false,
2255
2246
  isSearchable: true,
2256
2247
  isClearable: false,
2257
- placeholder: "Code",
2248
+ placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
2258
2249
  options: countryCodes || countries_default,
2259
- onChange: setCountryCode,
2260
- value: countryCode == null ? void 0 : countryCode.label,
2261
- defaultValue: props.preferredCountry
2250
+ onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
2251
+ valueKey: "label",
2252
+ labelKey: "label",
2253
+ value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
2254
+ defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
2262
2255
  }
2263
2256
  ), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
2264
2257
  "input",
@@ -2516,14 +2509,7 @@ var PinInputRoot = React7.forwardRef(({ className, containerClassName, ...props
2516
2509
  }
2517
2510
  ));
2518
2511
  PinInputRoot.displayName = "PinInputRoot";
2519
- var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
2520
- "div",
2521
- {
2522
- ref,
2523
- className: cn("hawa-flex hawa-items-center", className),
2524
- ...props
2525
- }
2526
- ));
2512
+ var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
2527
2513
  PinInputGroup.displayName = "PinInputGroup";
2528
2514
  var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
2529
2515
  const pinInputContext = React7.useContext(OTPInputContext);
@@ -2546,22 +2532,12 @@ var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
2546
2532
  PinInputSlot.displayName = "PinInputSlot";
2547
2533
  var PinInputSeperator = React7.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React7.createElement(Dot, null)));
2548
2534
  PinInputSeperator.displayName = "PinInputSeperator";
2549
- var PinInput = ({
2550
- separatorPosition = 0,
2551
- ...props
2552
- }) => {
2535
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
2553
2536
  const maxLength = props.maxLength || 6;
2554
2537
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
2555
2538
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
2556
2539
  const secondGroupLength = maxLength - firstGroupLength;
2557
- return /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React7.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
2558
- PinInputSlot,
2559
- {
2560
- key: index,
2561
- index,
2562
- className: "hawa-w-full hawa-border"
2563
- }
2564
- ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React7.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
2540
+ return /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React7.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React7.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
2565
2541
  PinInputSlot,
2566
2542
  {
2567
2543
  key: index + firstGroupLength,
@@ -14,6 +14,7 @@ import clsx from "clsx";
14
14
  var Select = ({
15
15
  labelProps,
16
16
  labelKey = "label",
17
+ valueKey = "value",
17
18
  ...props
18
19
  }) => {
19
20
  const NoOption = () => {
@@ -33,13 +34,7 @@ var Select = ({
33
34
  children
34
35
  );
35
36
  };
36
- const Option = ({
37
- children,
38
- innerProps,
39
- innerRef,
40
- isFocused,
41
- isSelected
42
- }) => {
37
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
43
38
  return /* @__PURE__ */ React.createElement(
44
39
  "div",
45
40
  {
@@ -54,14 +49,7 @@ var Select = ({
54
49
  children
55
50
  );
56
51
  };
57
- const Menu = ({
58
- cx,
59
- children,
60
- getStyles,
61
- innerProps,
62
- innerRef,
63
- ...menuProps
64
- }) => {
52
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
65
53
  const menuOpen = menuProps.selectProps.menuIsOpen;
66
54
  return /* @__PURE__ */ React.createElement(
67
55
  "div",
@@ -90,71 +78,72 @@ var Select = ({
90
78
  )
91
79
  },
92
80
  props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
93
- props.isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
94
- // TODO: enable keyboard to go to the next item in the list
95
- /* @__PURE__ */ React.createElement(
96
- ReactSelect,
97
- {
98
- noOptionsMessage: NoOption,
99
- classNames: {
100
- control: () => cn(
101
- props.phoneCode && "hawa-rounded-r-none",
102
- props.controlClassNames
103
- ),
104
- container: () => cn(
105
- selectContainerStyles,
106
- props.phoneCode && phoneCodeStyles,
107
- props.isMulti && "hawa-ps-0 "
108
- ),
109
- placeholder: () => cn(
110
- selectPlaceholderStyles,
111
- props.disabled && "hawa-text-muted-foreground"
112
- ),
113
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
114
- singleValue: () => cn(
115
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
116
- ),
117
- indicatorsContainer: () => cn(
118
- selectIndicatorContainerStyles,
119
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
120
- props.disabled && "hawa-opacity-30"
121
- )
122
- },
123
- unstyled: true,
124
- autoFocus: false,
125
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
81
+ props.isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React.createElement(
82
+ ReactSelect,
83
+ {
84
+ noOptionsMessage: NoOption,
85
+ classNames: {
86
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
87
+ container: () => cn(
88
+ selectContainerStyles,
89
+ props.phoneCode && phoneCodeStyles,
90
+ props.isMulti && "hawa-ps-0 "
91
+ ),
92
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
93
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
94
+ singleValue: () => cn(
95
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
96
+ ),
97
+ indicatorsContainer: () => cn(
98
+ selectIndicatorContainerStyles,
99
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
100
+ props.disabled && "hawa-opacity-30"
101
+ )
102
+ },
103
+ unstyled: true,
104
+ autoFocus: false,
105
+ components: props.hideIndicator ? {
106
+ Option: (optionProps) => /* @__PURE__ */ React.createElement(
126
107
  Option,
127
- Menu,
128
- ValueContainer: (e) => /* @__PURE__ */ React.createElement(
129
- "div",
130
- {
131
- className: cn(
132
- e.className,
133
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
134
- ),
135
- ...e
136
- }
137
- ),
138
- MultiValueContainer: (e) => /* @__PURE__ */ React.createElement(
139
- "div",
140
- {
141
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
142
- ...e
143
- }
144
- )
145
- },
146
- onChange: (newValue, action) => props.onChange(newValue, action),
147
- options: props.options,
148
- getOptionLabel: props.getOptionLabel,
149
- defaultValue: props.defaultValue,
150
- value: props.value,
151
- placeholder: props.placeholder,
152
- isDisabled: props.disabled,
153
- isClearable: props.isClearable,
154
- isMulti: props.isMulti,
155
- isSearchable: props.isSearchable
156
- }
157
- )
108
+ {
109
+ ...optionProps,
110
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
111
+ }
112
+ ),
113
+ Menu,
114
+ IndicatorsContainer: () => null
115
+ } : {
116
+ Option,
117
+ Menu,
118
+ ValueContainer: (e) => /* @__PURE__ */ React.createElement(
119
+ "div",
120
+ {
121
+ className: cn(
122
+ e.className,
123
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
124
+ ),
125
+ ...e
126
+ }
127
+ ),
128
+ MultiValueContainer: (e) => /* @__PURE__ */ React.createElement(
129
+ "div",
130
+ {
131
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
132
+ ...e
133
+ }
134
+ )
135
+ },
136
+ onChange: (newValue, action) => props.onChange(newValue, action),
137
+ options: props.options,
138
+ getOptionLabel: props.getOptionLabel,
139
+ defaultValue: props.defaultValue,
140
+ value: props.value,
141
+ placeholder: props.placeholder,
142
+ isDisabled: props.disabled,
143
+ isClearable: props.isClearable,
144
+ isMulti: props.isMulti,
145
+ isSearchable: props.isSearchable
146
+ }
158
147
  ) : /* @__PURE__ */ React.createElement(
159
148
  CreatableSelect,
160
149
  {
@@ -11,8 +11,8 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
11
11
  import * as SheetPrimitive from '@radix-ui/react-dialog';
12
12
  import { DialogProps } from '@radix-ui/react-dialog';
13
13
  import { VariantProps } from 'class-variance-authority';
14
- import { L as LabelProps } from '../Radio-Dyvlywnk.mjs';
15
- export { b as Label, d as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-Dyvlywnk.mjs';
14
+ import { L as LabelProps } from '../Radio-BPHTeDMz.mjs';
15
+ export { b as Label, d as PhoneCodeValue, e as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-BPHTeDMz.mjs';
16
16
  import { RowData, ColumnDef } from '@tanstack/react-table';
17
17
  export { ColumnDef } from '@tanstack/react-table';
18
18
  import { Command as Command$1 } from 'cmdk';
@@ -11,8 +11,8 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
11
11
  import * as SheetPrimitive from '@radix-ui/react-dialog';
12
12
  import { DialogProps } from '@radix-ui/react-dialog';
13
13
  import { VariantProps } from 'class-variance-authority';
14
- import { L as LabelProps } from '../Radio-DlPwVCG4.js';
15
- export { b as Label, d as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-DlPwVCG4.js';
14
+ import { L as LabelProps } from '../Radio-cRcIH8_L.js';
15
+ export { b as Label, d as PhoneCodeValue, e as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-cRcIH8_L.js';
16
16
  import { RowData, ColumnDef } from '@tanstack/react-table';
17
17
  export { ColumnDef } from '@tanstack/react-table';
18
18
  import { Command as Command$1 } from 'cmdk';