@sikka/hawa 0.46.3-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 (89) 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 +87 -133
  6. package/dist/blocks/auth/index.mjs +21 -53
  7. package/dist/blocks/feedback/index.js +69 -80
  8. package/dist/blocks/feedback/index.mjs +5 -5
  9. package/dist/blocks/index.d.mts +3 -3
  10. package/dist/blocks/index.d.ts +3 -3
  11. package/dist/blocks/index.js +87 -133
  12. package/dist/blocks/index.mjs +6 -25
  13. package/dist/blocks/misc/index.js +70 -84
  14. package/dist/blocks/misc/index.mjs +5 -5
  15. package/dist/blocks/pricing/index.js +1 -1
  16. package/dist/blocks/pricing/index.mjs +4 -4
  17. package/dist/{chunk-QLUJEUIB.mjs → chunk-342KIV4R.mjs} +83 -110
  18. package/dist/{chunk-EHJXQQDP.mjs → chunk-5S5DR7KF.mjs} +1 -1
  19. package/dist/{chunk-HJVL6X7I.mjs → chunk-6SJUUJOV.mjs} +1 -1
  20. package/dist/{chunk-7O555VJR.mjs → chunk-AWJSHOYU.mjs} +69 -80
  21. package/dist/{chunk-U72MOMEK.mjs → chunk-C2UOOH4X.mjs} +1 -1
  22. package/dist/{chunk-7L5VUKZ7.mjs → chunk-EOH6A3GR.mjs} +2 -5
  23. package/dist/{chunk-6UOJKVIA.mjs → chunk-IFWYR5W2.mjs} +1 -1
  24. package/dist/{chunk-YXUHXKKK.mjs → chunk-JP2N5WKD.mjs} +1 -1
  25. package/dist/{chunk-R37QEYSB.mjs → chunk-NMW4GM4G.mjs} +1 -1
  26. package/dist/{chunk-CIMTNOLA.mjs → chunk-WUMDFBEK.mjs} +1 -1
  27. package/dist/colorPicker/index.js +1 -1
  28. package/dist/colorPicker/index.js.map +1 -1
  29. package/dist/colorPicker/index.mjs +1 -1
  30. package/dist/colorPicker/index.mjs.map +1 -1
  31. package/dist/combobox/index.js +1 -1
  32. package/dist/combobox/index.js.map +1 -1
  33. package/dist/combobox/index.mjs +1 -1
  34. package/dist/combobox/index.mjs.map +1 -1
  35. package/dist/dataTable/index.js +2 -5
  36. package/dist/dataTable/index.js.map +1 -1
  37. package/dist/dataTable/index.mjs +2 -5
  38. package/dist/dataTable/index.mjs.map +1 -1
  39. package/dist/elements/index.d.mts +2 -2
  40. package/dist/elements/index.d.ts +2 -2
  41. package/dist/elements/index.js +83 -110
  42. package/dist/elements/index.mjs +3 -3
  43. package/dist/index.d.mts +10 -9
  44. package/dist/index.d.ts +10 -9
  45. package/dist/index.js +87 -133
  46. package/dist/index.mjs +87 -133
  47. package/dist/input/index.js +2 -5
  48. package/dist/input/index.js.map +1 -1
  49. package/dist/input/index.mjs +2 -5
  50. package/dist/input/index.mjs.map +1 -1
  51. package/dist/layout/index.js +1 -1
  52. package/dist/layout/index.mjs +2 -2
  53. package/dist/passwordInput/index.js +2 -5
  54. package/dist/passwordInput/index.js.map +1 -1
  55. package/dist/passwordInput/index.mjs +2 -5
  56. package/dist/passwordInput/index.mjs.map +1 -1
  57. package/dist/phoneInput/index.d.mts +7 -7
  58. package/dist/phoneInput/index.d.ts +7 -7
  59. package/dist/phoneInput/index.js +79 -86
  60. package/dist/phoneInput/index.js.map +1 -1
  61. package/dist/phoneInput/index.mjs +79 -86
  62. package/dist/phoneInput/index.mjs.map +1 -1
  63. package/dist/pinInput/index.js +3 -20
  64. package/dist/pinInput/index.js.map +1 -1
  65. package/dist/pinInput/index.mjs +3 -20
  66. package/dist/pinInput/index.mjs.map +1 -1
  67. package/dist/select/index.d.mts +1 -0
  68. package/dist/select/index.d.ts +1 -0
  69. package/dist/select/index.js +69 -80
  70. package/dist/select/index.js.map +1 -1
  71. package/dist/select/index.mjs +69 -80
  72. package/dist/select/index.mjs.map +1 -1
  73. package/dist/simpleTable/index.js +1 -1
  74. package/dist/simpleTable/index.js.map +1 -1
  75. package/dist/simpleTable/index.mjs +1 -1
  76. package/dist/simpleTable/index.mjs.map +1 -1
  77. package/dist/skeleton/index.js +1 -1
  78. package/dist/skeleton/index.js.map +1 -1
  79. package/dist/skeleton/index.mjs +1 -1
  80. package/dist/skeleton/index.mjs.map +1 -1
  81. package/dist/stats/index.js +1 -1
  82. package/dist/stats/index.js.map +1 -1
  83. package/dist/stats/index.mjs +1 -1
  84. package/dist/stats/index.mjs.map +1 -1
  85. package/dist/textarea/index.js +1 -1
  86. package/dist/textarea/index.js.map +1 -1
  87. package/dist/textarea/index.mjs +1 -1
  88. package/dist/textarea/index.mjs.map +1 -1
  89. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "../../chunk-7L5VUKZ7.mjs";
4
+ } from "../../chunk-EOH6A3GR.mjs";
5
5
  import {
6
6
  Chip,
7
7
  ScrollArea
8
- } from "../../chunk-U72MOMEK.mjs";
8
+ } from "../../chunk-C2UOOH4X.mjs";
9
9
  import {
10
10
  Textarea
11
- } from "../../chunk-EHJXQQDP.mjs";
11
+ } from "../../chunk-5S5DR7KF.mjs";
12
12
  import {
13
13
  Select
14
- } from "../../chunk-7O555VJR.mjs";
14
+ } from "../../chunk-AWJSHOYU.mjs";
15
15
  import {
16
16
  Button,
17
17
  Card,
@@ -21,7 +21,7 @@ import {
21
21
  CardHeader,
22
22
  CardTitle,
23
23
  cn
24
- } from "../../chunk-6UOJKVIA.mjs";
24
+ } from "../../chunk-IFWYR5W2.mjs";
25
25
 
26
26
  // blocks/misc/LegalTexts.tsx
27
27
  import React10 from "react";
@@ -638,7 +638,7 @@ function Skeleton({
638
638
  };
639
639
  const styledAs = {
640
640
  div: "",
641
- input: "!h-[38px] !w-full"
641
+ input: "hawa-h-[40px] hawa-w-full"
642
642
  };
643
643
  return /* @__PURE__ */ import_react6.default.createElement(
644
644
  "div",
@@ -2,22 +2,22 @@
2
2
  import {
3
3
  Chip,
4
4
  ScrollArea
5
- } from "../../chunk-U72MOMEK.mjs";
5
+ } from "../../chunk-C2UOOH4X.mjs";
6
6
  import "../../chunk-47APBDKK.mjs";
7
7
  import {
8
8
  Radio
9
- } from "../../chunk-R37QEYSB.mjs";
9
+ } from "../../chunk-NMW4GM4G.mjs";
10
10
  import {
11
11
  CheckMark,
12
12
  UncheckMark
13
- } from "../../chunk-YXUHXKKK.mjs";
13
+ } from "../../chunk-JP2N5WKD.mjs";
14
14
  import {
15
15
  Button,
16
16
  Card,
17
17
  Skeleton,
18
18
  Tooltip,
19
19
  cn
20
- } from "../../chunk-6UOJKVIA.mjs";
20
+ } from "../../chunk-IFWYR5W2.mjs";
21
21
 
22
22
  // blocks/pricing/PricingPlans.tsx
23
23
  import React8 from "react";
@@ -9,7 +9,7 @@ import {
9
9
  Label,
10
10
  Skeleton,
11
11
  cn
12
- } from "./chunk-HJVL6X7I.mjs";
12
+ } from "./chunk-6SJUUJOV.mjs";
13
13
 
14
14
  // elements/alert/Alert.tsx
15
15
  import React, { useRef, useState, useEffect } from "react";
@@ -215,14 +215,11 @@ var Input = forwardRef(
215
215
  }
216
216
  if (props.onChange) {
217
217
  if (props.type === "number" && props.maxLength) {
218
- console.log("type is ", props.type);
219
- console.log("max length is ", props.maxLength);
220
218
  let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
221
219
  const newEvent = { ...e, target: { ...e.target, value: v } };
222
220
  setValue(v);
223
221
  props.onChange(newEvent);
224
222
  } else {
225
- console.log("NETIHERRRER");
226
223
  const newEvent = { ...e, target: { ...e.target, value: newValue } };
227
224
  setValue(newValue);
228
225
  props.onChange(newEvent);
@@ -247,7 +244,7 @@ var Input = forwardRef(
247
244
  )
248
245
  },
249
246
  props.label && /* @__PURE__ */ React2.createElement(Label, { ...labelProps }, props.label),
250
- /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React2.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(
247
+ /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React2.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(Skeleton, { as: "input" })) : props.isLoadingError ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(
251
248
  Skeleton,
252
249
  {
253
250
  animation: "none",
@@ -353,6 +350,7 @@ import clsx from "clsx";
353
350
  var Select = ({
354
351
  labelProps,
355
352
  labelKey = "label",
353
+ valueKey = "value",
356
354
  ...props
357
355
  }) => {
358
356
  const NoOption = () => {
@@ -372,13 +370,7 @@ var Select = ({
372
370
  children
373
371
  );
374
372
  };
375
- const Option = ({
376
- children,
377
- innerProps,
378
- innerRef,
379
- isFocused,
380
- isSelected
381
- }) => {
373
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
382
374
  return /* @__PURE__ */ React3.createElement(
383
375
  "div",
384
376
  {
@@ -393,14 +385,7 @@ var Select = ({
393
385
  children
394
386
  );
395
387
  };
396
- const Menu = ({
397
- cx,
398
- children,
399
- getStyles,
400
- innerProps,
401
- innerRef,
402
- ...menuProps
403
- }) => {
388
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
404
389
  const menuOpen = menuProps.selectProps.menuIsOpen;
405
390
  return /* @__PURE__ */ React3.createElement(
406
391
  "div",
@@ -429,71 +414,72 @@ var Select = ({
429
414
  )
430
415
  },
431
416
  props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
432
- props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
433
- // TODO: enable keyboard to go to the next item in the list
434
- /* @__PURE__ */ React3.createElement(
435
- ReactSelect,
436
- {
437
- noOptionsMessage: NoOption,
438
- classNames: {
439
- control: () => cn(
440
- props.phoneCode && "hawa-rounded-r-none",
441
- props.controlClassNames
442
- ),
443
- container: () => cn(
444
- selectContainerStyles,
445
- props.phoneCode && phoneCodeStyles,
446
- props.isMulti && "hawa-ps-0 "
447
- ),
448
- placeholder: () => cn(
449
- selectPlaceholderStyles,
450
- props.disabled && "hawa-text-muted-foreground"
451
- ),
452
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
453
- singleValue: () => cn(
454
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
455
- ),
456
- indicatorsContainer: () => cn(
457
- selectIndicatorContainerStyles,
458
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
459
- props.disabled && "hawa-opacity-30"
460
- )
461
- },
462
- unstyled: true,
463
- autoFocus: false,
464
- 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(
465
443
  Option,
466
- Menu,
467
- ValueContainer: (e) => /* @__PURE__ */ React3.createElement(
468
- "div",
469
- {
470
- className: cn(
471
- e.className,
472
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
473
- ),
474
- ...e
475
- }
476
- ),
477
- MultiValueContainer: (e) => /* @__PURE__ */ React3.createElement(
478
- "div",
479
- {
480
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
481
- ...e
482
- }
483
- )
484
- },
485
- onChange: (newValue, action) => props.onChange(newValue, action),
486
- options: props.options,
487
- getOptionLabel: props.getOptionLabel,
488
- defaultValue: props.defaultValue,
489
- value: props.value,
490
- placeholder: props.placeholder,
491
- isDisabled: props.disabled,
492
- isClearable: props.isClearable,
493
- isMulti: props.isMulti,
494
- isSearchable: props.isSearchable
495
- }
496
- )
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
+ }
497
483
  ) : /* @__PURE__ */ React3.createElement(
498
484
  CreatableSelect,
499
485
  {
@@ -2231,11 +2217,13 @@ var PhoneInput = ({
2231
2217
  countryCodes,
2232
2218
  ...props
2233
2219
  }) => {
2220
+ var _a;
2234
2221
  const [phoneNumber, setPhoneNumber] = useState3("");
2235
- const [countryCode, setCountryCode] = useState3(props.preferredCountry);
2222
+ const [countryCode, setCountryCode] = useState3(
2223
+ props.preferredCountry || { label: "+966" }
2224
+ );
2236
2225
  const inputRef = useRef2(null);
2237
2226
  const handleInputChange = (e) => {
2238
- console.log("test e ", e.target.value);
2239
2227
  const validChars = /^[0-9-()]+$/;
2240
2228
  const input = e.target.value;
2241
2229
  if (input === "" || validChars.test(input)) {
@@ -2257,11 +2245,13 @@ var PhoneInput = ({
2257
2245
  isMulti: false,
2258
2246
  isSearchable: true,
2259
2247
  isClearable: false,
2260
- placeholder: "Code",
2248
+ placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
2261
2249
  options: countryCodes || countries_default,
2262
- onChange: setCountryCode,
2263
- value: countryCode == null ? void 0 : countryCode.label,
2264
- 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 }
2265
2255
  }
2266
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(
2267
2257
  "input",
@@ -2519,14 +2509,7 @@ var PinInputRoot = React7.forwardRef(({ className, containerClassName, ...props
2519
2509
  }
2520
2510
  ));
2521
2511
  PinInputRoot.displayName = "PinInputRoot";
2522
- var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
2523
- "div",
2524
- {
2525
- ref,
2526
- className: cn("hawa-flex hawa-items-center", className),
2527
- ...props
2528
- }
2529
- ));
2512
+ var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
2530
2513
  PinInputGroup.displayName = "PinInputGroup";
2531
2514
  var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
2532
2515
  const pinInputContext = React7.useContext(OTPInputContext);
@@ -2549,22 +2532,12 @@ var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
2549
2532
  PinInputSlot.displayName = "PinInputSlot";
2550
2533
  var PinInputSeperator = React7.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React7.createElement(Dot, null)));
2551
2534
  PinInputSeperator.displayName = "PinInputSeperator";
2552
- var PinInput = ({
2553
- separatorPosition = 0,
2554
- ...props
2555
- }) => {
2535
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
2556
2536
  const maxLength = props.maxLength || 6;
2557
2537
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
2558
2538
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
2559
2539
  const secondGroupLength = maxLength - firstGroupLength;
2560
- 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(
2561
- PinInputSlot,
2562
- {
2563
- key: index,
2564
- index,
2565
- className: "hawa-w-full hawa-border"
2566
- }
2567
- ))), 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(
2568
2541
  PinInputSlot,
2569
2542
  {
2570
2543
  key: index + firstGroupLength,
@@ -4,7 +4,7 @@ import {
4
4
  Label,
5
5
  Skeleton,
6
6
  cn
7
- } from "./chunk-6UOJKVIA.mjs";
7
+ } from "./chunk-IFWYR5W2.mjs";
8
8
 
9
9
  // elements/textarea/Textarea.tsx
10
10
  import * as React from "react";
@@ -1108,7 +1108,7 @@ function Skeleton({
1108
1108
  };
1109
1109
  const styledAs = {
1110
1110
  div: "",
1111
- input: "!h-[38px] !w-full"
1111
+ input: "hawa-h-[40px] hawa-w-full"
1112
1112
  };
1113
1113
  return /* @__PURE__ */ React8.createElement(
1114
1114
  "div",
@@ -4,7 +4,7 @@ import {
4
4
  Label,
5
5
  Skeleton,
6
6
  cn
7
- } from "./chunk-6UOJKVIA.mjs";
7
+ } from "./chunk-IFWYR5W2.mjs";
8
8
 
9
9
  // elements/select/Select.tsx
10
10
  import React from "react";
@@ -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
  {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  cn
4
- } from "./chunk-6UOJKVIA.mjs";
4
+ } from "./chunk-IFWYR5W2.mjs";
5
5
 
6
6
  // elements/scrollArea/ScrollArea.tsx
7
7
  import * as React from "react";
@@ -4,7 +4,7 @@ import {
4
4
  Label,
5
5
  Skeleton,
6
6
  cn
7
- } from "./chunk-6UOJKVIA.mjs";
7
+ } from "./chunk-IFWYR5W2.mjs";
8
8
 
9
9
  // elements/input/Input.tsx
10
10
  import React, { forwardRef, useState } from "react";
@@ -51,14 +51,11 @@ var Input = forwardRef(
51
51
  }
52
52
  if (props.onChange) {
53
53
  if (props.type === "number" && props.maxLength) {
54
- console.log("type is ", props.type);
55
- console.log("max length is ", props.maxLength);
56
54
  let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
57
55
  const newEvent = { ...e, target: { ...e.target, value: v } };
58
56
  setValue(v);
59
57
  props.onChange(newEvent);
60
58
  } else {
61
- console.log("NETIHERRRER");
62
59
  const newEvent = { ...e, target: { ...e.target, value: newValue } };
63
60
  setValue(newValue);
64
61
  props.onChange(newEvent);
@@ -83,7 +80,7 @@ var Input = forwardRef(
83
80
  )
84
81
  },
85
82
  props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
86
- /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(
83
+ /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(Skeleton, { as: "input" })) : props.isLoadingError ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(
87
84
  Skeleton,
88
85
  {
89
86
  animation: "none",
@@ -569,7 +569,7 @@ function Skeleton({
569
569
  };
570
570
  const styledAs = {
571
571
  div: "",
572
- input: "!h-[38px] !w-full"
572
+ input: "hawa-h-[40px] hawa-w-full"
573
573
  };
574
574
  return /* @__PURE__ */ React7.createElement(
575
575
  "div",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  cn
4
- } from "./chunk-6UOJKVIA.mjs";
4
+ } from "./chunk-IFWYR5W2.mjs";
5
5
 
6
6
  // icons/Emojis.tsx
7
7
  import React from "react";
@@ -3,7 +3,7 @@ import {
3
3
  HelperText,
4
4
  Label,
5
5
  cn
6
- } from "./chunk-6UOJKVIA.mjs";
6
+ } from "./chunk-IFWYR5W2.mjs";
7
7
 
8
8
  // elements/popover/Popover.tsx
9
9
  import * as React from "react";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  cn
4
- } from "./chunk-HJVL6X7I.mjs";
4
+ } from "./chunk-6SJUUJOV.mjs";
5
5
 
6
6
  // elements/sheet/Sheet.tsx
7
7
  import * as React from "react";
@@ -87,7 +87,7 @@ function Skeleton({
87
87
  };
88
88
  const styledAs = {
89
89
  div: "",
90
- input: "!h-[38px] !w-full"
90
+ input: "hawa-h-[40px] hawa-w-full"
91
91
  };
92
92
  return /* @__PURE__ */ import_react.default.createElement(
93
93
  "div",