@sikka/hawa 0.23.2-next → 0.23.7-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 (145) hide show
  1. package/dist/accordion/index.js +30 -2399
  2. package/dist/accordion/index.mjs +19 -461
  3. package/dist/alert/index.mjs +0 -1
  4. package/dist/appStores/index.js +75 -0
  5. package/dist/appStores/index.mjs +38 -0
  6. package/dist/avatar/index.mjs +118 -3
  7. package/dist/backToTop/index.mjs +102 -4
  8. package/dist/badge/index.js +127 -0
  9. package/dist/badge/index.mjs +84 -0
  10. package/dist/blocks/auth/index.js +1173 -3092
  11. package/dist/blocks/auth/index.mjs +16 -10
  12. package/dist/blocks/feedback/index.js +864 -2913
  13. package/dist/blocks/feedback/index.mjs +14 -8
  14. package/dist/blocks/index.js +5714 -5316
  15. package/dist/blocks/index.mjs +390 -45
  16. package/dist/blocks/misc/index.js +634 -2409
  17. package/dist/blocks/misc/index.mjs +14 -8
  18. package/dist/blocks/pricing/index.js +522 -524
  19. package/dist/blocks/pricing/index.mjs +1861 -45
  20. package/dist/breadcrumb/index.js +63 -0
  21. package/dist/breadcrumb/index.mjs +26 -0
  22. package/dist/card/index.mjs +83 -8
  23. package/dist/checkbox/index.mjs +138 -3
  24. package/dist/chip/index.js +129 -0
  25. package/dist/chip/index.mjs +8 -0
  26. package/dist/{chunk-X6PCWJYD.mjs → chunk-2R2QPJT7.mjs} +761 -1104
  27. package/dist/chunk-677VOLD4.mjs +464 -0
  28. package/dist/chunk-72HYR6WB.mjs +88 -0
  29. package/dist/chunk-A25EXELT.mjs +131 -0
  30. package/dist/{chunk-OE27DSIY.mjs → chunk-F6TKEDDP.mjs} +2 -4
  31. package/dist/{chunk-YFC2GSJ6.mjs → chunk-P2O6R3S6.mjs} +66 -5
  32. package/dist/{chunk-GXXX5UB4.mjs → chunk-QGKW5R5F.mjs} +59 -20
  33. package/dist/chunk-TR56G3NM.mjs +2350 -0
  34. package/dist/chunk-UAVBFK53.mjs +346 -0
  35. package/dist/combobox/index.mjs +153 -7
  36. package/dist/dataTable/index.mjs +355 -8
  37. package/dist/elements/index.js +800 -1148
  38. package/dist/elements/index.mjs +1 -11
  39. package/dist/fileDropzone/index.mjs +226 -4
  40. package/dist/index.js +1721 -1721
  41. package/dist/index.mjs +1663 -1663
  42. package/dist/layout/index.js +493 -510
  43. package/dist/layout/index.mjs +1 -1
  44. package/dist/loading/index.mjs +0 -1
  45. package/dist/logos/index.mjs +204 -3
  46. package/dist/navigationMenu/index.mjs +155 -13
  47. package/dist/phoneInput/index.js +2074 -0
  48. package/dist/phoneInput/index.mjs +1776 -0
  49. package/dist/pinInput/index.js +130 -0
  50. package/dist/pinInput/index.mjs +88 -0
  51. package/dist/progress/index.js +71 -0
  52. package/dist/progress/index.mjs +29 -0
  53. package/dist/radio/index.mjs +202 -4
  54. package/dist/scrollArea/index.js +90 -0
  55. package/dist/scrollArea/index.mjs +47 -0
  56. package/dist/select/index.mjs +1 -1
  57. package/dist/sheet/index.mjs +137 -12
  58. package/dist/sortButton/index.mjs +40 -4
  59. package/dist/stopPropagationWrapper/index.js +48 -0
  60. package/dist/stopPropagationWrapper/index.mjs +11 -0
  61. package/dist/switch/index.mjs +79 -3
  62. package/dist/tabs/index.js +1 -1
  63. package/dist/tabs/index.mjs +68 -6
  64. package/dist/textarea/index.mjs +54 -4
  65. package/package.json +2 -2
  66. package/dist/Chip-DJ6ThZc_.d.ts +0 -21
  67. package/dist/Chip-eal8vwDz.d.mts +0 -21
  68. package/dist/accordion/index.d.mts +0 -42
  69. package/dist/accordion/index.d.ts +0 -42
  70. package/dist/alert/index.d.mts +0 -28
  71. package/dist/alert/index.d.ts +0 -28
  72. package/dist/avatar/index.d.mts +0 -15
  73. package/dist/avatar/index.d.ts +0 -15
  74. package/dist/backToTop/index.d.mts +0 -15
  75. package/dist/backToTop/index.d.ts +0 -15
  76. package/dist/button/index.d.mts +0 -16
  77. package/dist/button/index.d.ts +0 -16
  78. package/dist/card/index.d.mts +0 -17
  79. package/dist/card/index.d.ts +0 -17
  80. package/dist/checkbox/index.d.mts +0 -20
  81. package/dist/checkbox/index.d.ts +0 -20
  82. package/dist/chunk-BK5WF7UO.mjs +0 -231
  83. package/dist/chunk-CXWYC6FS.mjs +0 -360
  84. package/dist/chunk-D2USGMDT.mjs +0 -208
  85. package/dist/chunk-DX4SLF2L.mjs +0 -45
  86. package/dist/chunk-ENNSA4VR.mjs +0 -5566
  87. package/dist/chunk-GXSYCLZZ.mjs +0 -158
  88. package/dist/chunk-IQPGAHUR.mjs +0 -107
  89. package/dist/chunk-POT2IP62.mjs +0 -123
  90. package/dist/chunk-TWDZB2VH.mjs +0 -151
  91. package/dist/chunk-VBTYVVA7.mjs +0 -93
  92. package/dist/chunk-VCGW5DIP.mjs +0 -170
  93. package/dist/chunk-X3SMPIA3.mjs +0 -0
  94. package/dist/chunk-XA646BZ2.mjs +0 -143
  95. package/dist/chunk-ZCUUQ5VV.mjs +0 -84
  96. package/dist/combobox/index.d.mts +0 -32
  97. package/dist/combobox/index.d.ts +0 -32
  98. package/dist/command/index.d.mts +0 -48
  99. package/dist/command/index.d.ts +0 -48
  100. package/dist/commonTypes-gbO4hPli.d.mts +0 -7
  101. package/dist/commonTypes-gbO4hPli.d.ts +0 -7
  102. package/dist/dataTable/index.d.mts +0 -39
  103. package/dist/dataTable/index.d.ts +0 -39
  104. package/dist/dialog/index.d.mts +0 -57
  105. package/dist/dialog/index.d.ts +0 -57
  106. package/dist/dropdownMenu/index.d.mts +0 -95
  107. package/dist/dropdownMenu/index.d.ts +0 -95
  108. package/dist/fileDropzone/index.d.mts +0 -37
  109. package/dist/fileDropzone/index.d.ts +0 -37
  110. package/dist/input/index.d.mts +0 -36
  111. package/dist/input/index.d.ts +0 -36
  112. package/dist/label/index.d.mts +0 -12
  113. package/dist/label/index.d.ts +0 -12
  114. package/dist/loading/index.d.mts +0 -15
  115. package/dist/loading/index.d.ts +0 -15
  116. package/dist/logos/index.d.mts +0 -27
  117. package/dist/logos/index.d.ts +0 -27
  118. package/dist/navigationMenu/index.d.mts +0 -39
  119. package/dist/navigationMenu/index.d.ts +0 -39
  120. package/dist/popover/index.d.mts +0 -23
  121. package/dist/popover/index.d.ts +0 -23
  122. package/dist/radio/index.d.mts +0 -28
  123. package/dist/radio/index.d.ts +0 -28
  124. package/dist/select/index.d.mts +0 -43
  125. package/dist/select/index.d.ts +0 -43
  126. package/dist/sheet/index.d.mts +0 -30
  127. package/dist/sheet/index.d.ts +0 -30
  128. package/dist/skeleton/index.d.mts +0 -10
  129. package/dist/skeleton/index.d.ts +0 -10
  130. package/dist/sortButton/index.d.mts +0 -10
  131. package/dist/sortButton/index.d.ts +0 -10
  132. package/dist/splitButton/index.d.mts +0 -15
  133. package/dist/splitButton/index.d.ts +0 -15
  134. package/dist/switch/index.d.mts +0 -12
  135. package/dist/switch/index.d.ts +0 -12
  136. package/dist/table/index.d.mts +0 -21
  137. package/dist/table/index.d.ts +0 -21
  138. package/dist/tabs/index.d.mts +0 -16
  139. package/dist/tabs/index.d.ts +0 -16
  140. package/dist/textarea/index.d.mts +0 -17
  141. package/dist/textarea/index.d.ts +0 -17
  142. package/dist/tooltip/index.d.mts +0 -26
  143. package/dist/tooltip/index.d.ts +0 -26
  144. /package/dist/{chunk-A7OPD7H7.mjs → chunk-B6UCD4GP.mjs} +0 -0
  145. /package/dist/{chunk-O2ALK7UE.mjs → chunk-Z4M72OD3.mjs} +0 -0
@@ -0,0 +1,346 @@
1
+ import {
2
+ Label,
3
+ Skeleton,
4
+ cn
5
+ } from "./chunk-677VOLD4.mjs";
6
+
7
+ // components/elements/select/Select.tsx
8
+ import React from "react";
9
+ import ReactSelect from "react-select";
10
+ import CreatableSelect from "react-select/creatable";
11
+ import clsx from "clsx";
12
+ var Select = ({
13
+ labelProps,
14
+ labelKey = "label",
15
+ ...props
16
+ }) => {
17
+ const NoOption = () => {
18
+ var _a, _b;
19
+ return /* @__PURE__ */ React.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
20
+ };
21
+ const Control = ({ children, innerProps, innerRef }) => {
22
+ return /* @__PURE__ */ React.createElement(
23
+ "div",
24
+ {
25
+ ref: innerRef,
26
+ className: clsx(
27
+ "hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500"
28
+ ),
29
+ ...innerProps
30
+ },
31
+ children
32
+ );
33
+ };
34
+ const Option = ({ children, innerProps, innerRef }) => {
35
+ return /* @__PURE__ */ React.createElement(
36
+ "div",
37
+ {
38
+ ref: innerRef,
39
+ className: cn(
40
+ "hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all hover:hawa-bg-primary hover:hawa-text-primary-foreground"
41
+ ),
42
+ ...innerProps
43
+ },
44
+ children
45
+ );
46
+ };
47
+ const Menu = ({
48
+ cx,
49
+ children,
50
+ getStyles,
51
+ innerProps,
52
+ innerRef,
53
+ ...menuProps
54
+ }) => {
55
+ const menuOpen = menuProps.selectProps.menuIsOpen;
56
+ return /* @__PURE__ */ React.createElement(
57
+ "div",
58
+ {
59
+ className: cn(
60
+ "dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md",
61
+ props.phoneCode ? "hawa-p-1.5" : "hawa-w-full hawa-p-1.5",
62
+ menuOpen && "hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 "
63
+ ),
64
+ ref: innerRef,
65
+ ...innerProps
66
+ },
67
+ children
68
+ );
69
+ };
70
+ return /* @__PURE__ */ React.createElement(
71
+ "div",
72
+ {
73
+ className: cn(
74
+ "hawa-flex hawa-flex-col hawa-gap-2",
75
+ props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
76
+ )
77
+ },
78
+ props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
79
+ props.isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
80
+ // TODO: enable keyboard to go to the next item in the list
81
+ /* @__PURE__ */ React.createElement(
82
+ ReactSelect,
83
+ {
84
+ noOptionsMessage: NoOption,
85
+ classNames: {
86
+ control: () => cn(
87
+ props.phoneCode && "hawa-rounded-r-none",
88
+ props.controlClassNames
89
+ ),
90
+ container: () => cn(
91
+ "hawa-rounded",
92
+ props.phoneCode && "hawa-w-fit hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
93
+ "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
94
+ props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
95
+ ),
96
+ placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
97
+ valueContainer: () => "hawa-text-foreground hawa-px-1 ",
98
+ singleValue: () => "hawa-text-foreground",
99
+ indicatorsContainer: () => cn(
100
+ "hawa-cursor-pointer hawa-text-muted-foreground",
101
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
102
+ )
103
+ },
104
+ unstyled: true,
105
+ autoFocus: true,
106
+ components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : { Option, Menu },
107
+ onChange: (newValue, action) => props.onChange(newValue, action),
108
+ options: props.options,
109
+ getOptionLabel: props.getOptionLabel,
110
+ defaultValue: props.defaultValue,
111
+ placeholder: props.placeholder,
112
+ isDisabled: props.disabled,
113
+ isClearable: props.isClearable,
114
+ isMulti: props.isMulti,
115
+ isSearchable: props.isSearchable
116
+ }
117
+ )
118
+ ) : /* @__PURE__ */ React.createElement(
119
+ CreatableSelect,
120
+ {
121
+ formatCreateLabel: (inputValue) => {
122
+ var _a, _b;
123
+ return `${(_b = (_a = props.texts) == null ? void 0 : _a.createLabel) != null ? _b : "Create"} "${inputValue}"`;
124
+ },
125
+ classNames: {
126
+ container: () => cn(
127
+ "hawa-rounded",
128
+ props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
129
+ ),
130
+ placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
131
+ input: () => "hawa-text-primary hawa-px-2",
132
+ valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
133
+ singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
134
+ indicatorsContainer: () => " hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground"
135
+ },
136
+ unstyled: true,
137
+ options: props.options,
138
+ isClearable: props.isClearable,
139
+ isMulti: props.isMulti,
140
+ isSearchable: props.isSearchable,
141
+ placeholder: props.placeholder,
142
+ onCreateOption: props.handleCreateOption,
143
+ onChange: (newValue, action) => props.onChange(newValue, action),
144
+ components: { Control, Option, Menu },
145
+ onInputChange: (newValue, action) => props.onInputChange(newValue, action)
146
+ }
147
+ ),
148
+ !props.hideHelperText && /* @__PURE__ */ React.createElement(
149
+ "p",
150
+ {
151
+ className: cn(
152
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
153
+ props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
154
+ )
155
+ },
156
+ props.helperText
157
+ )
158
+ );
159
+ };
160
+
161
+ // components/icons/Emojis.tsx
162
+ import React2 from "react";
163
+ var VeryGoodEmoji = () => /* @__PURE__ */ React2.createElement(
164
+ "svg",
165
+ {
166
+ fill: "none",
167
+ height: "16",
168
+ viewBox: "0 0 16 16",
169
+ width: "16",
170
+ xmlns: "http://www.w3.org/2000/svg"
171
+ },
172
+ /* @__PURE__ */ React2.createElement("g", { clipPath: "url(#clip0_53_166)" }, /* @__PURE__ */ React2.createElement(
173
+ "path",
174
+ {
175
+ clipRule: "evenodd",
176
+ d: "M14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM4.5 8.97498H3.875V9.59998C3.875 11.4747 5.81046 12.8637 7.99817 12.8637C10.1879 12.8637 12.125 11.4832 12.125 9.59998V8.97498H11.5H4.5ZM7.99817 11.6137C6.59406 11.6137 5.63842 10.9482 5.28118 10.225H10.7202C10.3641 10.9504 9.40797 11.6137 7.99817 11.6137Z",
177
+ fill: "currentColor",
178
+ fillRule: "evenodd"
179
+ }
180
+ ), /* @__PURE__ */ React2.createElement(
181
+ "path",
182
+ {
183
+ clipRule: "evenodd",
184
+ d: "M6.15295 4.92093L5.375 3.5L4.59705 4.92093L3 5.21885L4.11625 6.39495L3.90717 8L5.375 7.30593L6.84283 8L6.63375 6.39495L7.75 5.21885L6.15295 4.92093ZM11.403 4.92093L10.625 3.5L9.84705 4.92093L8.25 5.21885L9.36625 6.39495L9.15717 8L10.625 7.30593L12.0928 8L11.8837 6.39495L13 5.21885L11.403 4.92093Z",
185
+ fill: "#FF990A",
186
+ fillRule: "evenodd"
187
+ }
188
+ ))
189
+ );
190
+ var GoodEmoji = () => /* @__PURE__ */ React2.createElement(
191
+ "svg",
192
+ {
193
+ fill: "none",
194
+ height: "16",
195
+ viewBox: "0 0 16 16",
196
+ width: "16",
197
+ xmlns: "http://www.w3.org/2000/svg"
198
+ },
199
+ /* @__PURE__ */ React2.createElement("g", { clipPath: "url(#clip0_53_167)" }, /* @__PURE__ */ React2.createElement(
200
+ "path",
201
+ {
202
+ clipRule: "evenodd",
203
+ d: "M14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM11.5249 10.8478L11.8727 10.3286L10.8342 9.6329L10.4863 10.1522C9.94904 10.9543 9.0363 11.4802 8.00098 11.4802C6.96759 11.4802 6.05634 10.9563 5.51863 10.1567L5.16986 9.63804L4.13259 10.3356L4.48137 10.8542C5.2414 11.9844 6.53398 12.7302 8.00098 12.7302C9.47073 12.7302 10.7654 11.9816 11.5249 10.8478ZM6.75 6.75C6.75 7.30228 6.30228 7.75 5.75 7.75C5.19772 7.75 4.75 7.30228 4.75 6.75C4.75 6.19772 5.19772 5.75 5.75 5.75C6.30228 5.75 6.75 6.19772 6.75 6.75ZM10.25 7.75C10.8023 7.75 11.25 7.30228 11.25 6.75C11.25 6.19772 10.8023 5.75 10.25 5.75C9.69771 5.75 9.25 6.19772 9.25 6.75C9.25 7.30228 9.69771 7.75 10.25 7.75Z",
204
+ fill: "currentColor",
205
+ fillRule: "evenodd"
206
+ }
207
+ ))
208
+ );
209
+ var BadEmoji = () => /* @__PURE__ */ React2.createElement(
210
+ "svg",
211
+ {
212
+ fill: "none",
213
+ height: "16",
214
+ viewBox: "0 0 16 16",
215
+ width: "16",
216
+ xmlns: "http://www.w3.org/2000/svg"
217
+ },
218
+ /* @__PURE__ */ React2.createElement("g", { clipPath: "url(#clip0_53_152)" }, /* @__PURE__ */ React2.createElement(
219
+ "path",
220
+ {
221
+ clipRule: "evenodd",
222
+ d: "M14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5C11.5899 1.5 14.5 4.41015 14.5 8ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM5.75 7.75C6.30228 7.75 6.75 7.30228 6.75 6.75C6.75 6.19772 6.30228 5.75 5.75 5.75C5.19772 5.75 4.75 6.19772 4.75 6.75C4.75 7.30228 5.19772 7.75 5.75 7.75ZM11.25 6.75C11.25 7.30228 10.8023 7.75 10.25 7.75C9.69771 7.75 9.25 7.30228 9.25 6.75C9.25 6.19772 9.69771 5.75 10.25 5.75C10.8023 5.75 11.25 6.19772 11.25 6.75ZM11.5249 11.2622L11.8727 11.7814L10.8342 12.4771L10.4863 11.9578C9.94904 11.1557 9.0363 10.6298 8.00098 10.6298C6.96759 10.6298 6.05634 11.1537 5.51863 11.9533L5.16986 12.4719L4.13259 11.7744L4.48137 11.2558C5.2414 10.1256 6.53398 9.37982 8.00098 9.37982C9.47073 9.37982 10.7654 10.1284 11.5249 11.2622Z",
223
+ fill: "currentColor",
224
+ fillRule: "evenodd"
225
+ }
226
+ ))
227
+ );
228
+ var VeryBadEmoji = () => /* @__PURE__ */ React2.createElement(
229
+ "svg",
230
+ {
231
+ fill: "none",
232
+ height: "16",
233
+ viewBox: "0 0 16 16",
234
+ width: "16",
235
+ xmlns: "http://www.w3.org/2000/svg"
236
+ },
237
+ /* @__PURE__ */ React2.createElement("g", { clipPath: "url(#clip0_53_151)" }, /* @__PURE__ */ React2.createElement(
238
+ "path",
239
+ {
240
+ d: "M11.841 12.0225C12.7197 12.9324 12.7197 14.4077 11.841 15.3176C10.9623 16.2275 9.53769 16.2275 8.65901 15.3176C7.78033 14.4077 7.78033 12.9324 8.65901 12.0225L10.25 10.375L11.841 12.0225Z",
241
+ fill: "#0070F3"
242
+ }
243
+ ), /* @__PURE__ */ React2.createElement(
244
+ "path",
245
+ {
246
+ clipRule: "evenodd",
247
+ d: "M8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 10.9668 3.48826 13.4711 6.20649 14.2496L5.79351 15.6916C2.44895 14.7338 0 11.6539 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 9.4652 15.6054 10.8405 14.9162 12.023L13.6203 11.2677C14.1794 10.3083 14.5 9.19272 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5ZM6.75 6.75C6.75 7.30228 6.30228 7.75 5.75 7.75C5.19772 7.75 4.75 7.30228 4.75 6.75C4.75 6.19772 5.19772 5.75 5.75 5.75C6.30228 5.75 6.75 6.19772 6.75 6.75ZM10.25 7.75C10.8023 7.75 11.25 7.30228 11.25 6.75C11.25 6.19772 10.8023 5.75 10.25 5.75C9.69771 5.75 9.25 6.19772 9.25 6.75C9.25 7.30228 9.69771 7.75 10.25 7.75Z",
248
+ fill: "currentColor",
249
+ fillRule: "evenodd"
250
+ }
251
+ ))
252
+ );
253
+
254
+ // components/icons/InputIcons.tsx
255
+ import React3 from "react";
256
+ var EyeIcon = (props) => /* @__PURE__ */ React3.createElement("div", { className: cn("hawa-h-5 hawa-w-5", props.className) }, /* @__PURE__ */ React3.createElement(
257
+ "svg",
258
+ {
259
+ xmlns: "http://www.w3.org/2000/svg",
260
+ viewBox: "0 0 24 24",
261
+ fill: "none",
262
+ stroke: "currentColor",
263
+ strokeWidth: "2",
264
+ strokeLinecap: "round",
265
+ strokeLinejoin: "round"
266
+ },
267
+ /* @__PURE__ */ React3.createElement("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
268
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "3" })
269
+ ));
270
+ var HiddenEyeIcon = (props) => /* @__PURE__ */ React3.createElement("div", { className: cn("hawa-h-5 hawa-w-5", props.className) }, /* @__PURE__ */ React3.createElement(
271
+ "svg",
272
+ {
273
+ xmlns: "http://www.w3.org/2000/svg",
274
+ viewBox: "0 0 24 24",
275
+ fill: "none",
276
+ stroke: "currentColor",
277
+ strokeWidth: "2",
278
+ strokeLinecap: "round",
279
+ strokeLinejoin: "round"
280
+ },
281
+ /* @__PURE__ */ React3.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
282
+ /* @__PURE__ */ React3.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
283
+ /* @__PURE__ */ React3.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
284
+ /* @__PURE__ */ React3.createElement("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
285
+ ));
286
+
287
+ // components/icons/CommonIcons.tsx
288
+ import React4 from "react";
289
+ var CheckMark = ({ size = "default", className }) => {
290
+ let sizeStyles = {
291
+ default: "hawa-h-5 hawa-w-5",
292
+ sm: "hawa-h-3 hawa-w-3"
293
+ };
294
+ return /* @__PURE__ */ React4.createElement(
295
+ "svg",
296
+ {
297
+ className: cn(sizeStyles[size], className),
298
+ "aria-hidden": "true",
299
+ fill: "currentColor",
300
+ viewBox: "0 0 20 20"
301
+ },
302
+ /* @__PURE__ */ React4.createElement(
303
+ "path",
304
+ {
305
+ fillRule: "evenodd",
306
+ d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
307
+ clipRule: "evenodd"
308
+ }
309
+ )
310
+ );
311
+ };
312
+ var UncheckMark = ({ size = "default", className }) => {
313
+ let sizeStyles = {
314
+ default: "hawa-h-5 hawa-w-5",
315
+ sm: "hawa-h-3 hawa-w-3"
316
+ };
317
+ return /* @__PURE__ */ React4.createElement(
318
+ "svg",
319
+ {
320
+ className: cn(sizeStyles[size], className),
321
+ "aria-hidden": "true",
322
+ fill: "currentColor",
323
+ viewBox: "0 0 20 20"
324
+ },
325
+ /* @__PURE__ */ React4.createElement(
326
+ "path",
327
+ {
328
+ fillRule: "evenodd",
329
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
330
+ clipRule: "evenodd"
331
+ }
332
+ )
333
+ );
334
+ };
335
+
336
+ export {
337
+ Select,
338
+ VeryGoodEmoji,
339
+ GoodEmoji,
340
+ BadEmoji,
341
+ VeryBadEmoji,
342
+ EyeIcon,
343
+ HiddenEyeIcon,
344
+ CheckMark,
345
+ UncheckMark
346
+ };
@@ -1,15 +1,161 @@
1
1
  import {
2
- Combobox
3
- } from "../chunk-GXSYCLZZ.mjs";
4
- import "../chunk-AFOVBTLE.mjs";
2
+ PopoverContent,
3
+ PopoverTrigger
4
+ } from "../chunk-AFOVBTLE.mjs";
5
5
  import "../chunk-6QJMQV2X.mjs";
6
- import "../chunk-QMV6AK2B.mjs";
6
+ import {
7
+ Command,
8
+ CommandEmpty,
9
+ CommandGroup,
10
+ CommandInput,
11
+ CommandItem
12
+ } from "../chunk-QMV6AK2B.mjs";
7
13
  import "../chunk-2IL2HDEQ.mjs";
8
- import "../chunk-Z3JCNSB3.mjs";
14
+ import {
15
+ Label
16
+ } from "../chunk-Z3JCNSB3.mjs";
9
17
  import "../chunk-VFP56EVG.mjs";
10
18
  import "../chunk-6CLNGID2.mjs";
11
- import "../chunk-J5NJEHQU.mjs";
12
- import "../chunk-TE3BKEXL.mjs";
19
+ import {
20
+ Skeleton
21
+ } from "../chunk-J5NJEHQU.mjs";
22
+ import {
23
+ cn
24
+ } from "../chunk-TE3BKEXL.mjs";
25
+
26
+ // components/elements/combobox/Combobox.tsx
27
+ import * as React from "react";
28
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
29
+ var Combobox = React.forwardRef(
30
+ ({
31
+ labelKey = "label",
32
+ valueKey = "value",
33
+ defaultValue = "",
34
+ popoverClassName,
35
+ labelProps,
36
+ data,
37
+ ...props
38
+ }, ref) => {
39
+ var _a, _b, _c;
40
+ const [open, setOpen] = React.useState(false);
41
+ const [value, setValue] = React.useState(defaultValue);
42
+ function getProperty(obj, key) {
43
+ return obj[key];
44
+ }
45
+ const handleOpenChange = (open2) => {
46
+ if (!(props.isLoading || props.preview)) {
47
+ setOpen(open2);
48
+ }
49
+ };
50
+ return /* @__PURE__ */ React.createElement(
51
+ "div",
52
+ {
53
+ className: cn(
54
+ "hawa-relative hawa-flex hawa-h-fit hawa-flex-col hawa-gap-2",
55
+ props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
56
+ )
57
+ },
58
+ props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
59
+ /* @__PURE__ */ React.createElement(PopoverPrimitive.Root, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-start hawa-gap-2 " }, /* @__PURE__ */ React.createElement(
60
+ "div",
61
+ {
62
+ className: cn(
63
+ "hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
64
+ props.preview ? "hawa-opacity-100" : "hawa-opacity-0"
65
+ )
66
+ }
67
+ ), /* @__PURE__ */ React.createElement(
68
+ "button",
69
+ {
70
+ role: "combobox",
71
+ "aria-expanded": open,
72
+ className: cn(
73
+ "hawa-inline-flex hawa-h-10 hawa-w-full hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-md hawa-border hawa-py-2 hawa-text-sm hawa-font-normal hawa-text-primary hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
74
+ props.preview ? "hawa-cursor-default hawa-rounded-none hawa-border-transparent hawa-px-0" : "hawa-bg-background hawa-px-3 "
75
+ )
76
+ },
77
+ value ? getProperty(
78
+ data.find((item) => item[valueKey] === value) || {},
79
+ labelKey
80
+ ) : ((_a = props.texts) == null ? void 0 : _a.placeholder) || "...",
81
+ /* @__PURE__ */ React.createElement(
82
+ "svg",
83
+ {
84
+ xmlns: "http://www.w3.org/2000/svg",
85
+ className: cn(
86
+ "hawa-icon hawa-transition-all",
87
+ !props.preview ? "hawa-visible hawa-opacity-100" : "hawa-invisible hawa-opacity-0"
88
+ ),
89
+ "aria-label": "Chevron down icon",
90
+ viewBox: "0 0 24 24",
91
+ fill: "none",
92
+ stroke: "currentColor",
93
+ strokeWidth: "2",
94
+ strokeLinecap: "round",
95
+ strokeLinejoin: "round"
96
+ },
97
+ /* @__PURE__ */ React.createElement("path", { d: "m6 9 6 6 6-6" })
98
+ )
99
+ ), /* @__PURE__ */ React.createElement(
100
+ "p",
101
+ {
102
+ className: cn(
103
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
104
+ props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
105
+ )
106
+ },
107
+ props.helperText
108
+ ))), /* @__PURE__ */ React.createElement(
109
+ PopoverContent,
110
+ {
111
+ className: cn("popover-w-parent", props.helperText && "-hawa-mt-4")
112
+ },
113
+ /* @__PURE__ */ React.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React.createElement(
114
+ CommandInput,
115
+ {
116
+ placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
117
+ }
118
+ ), /* @__PURE__ */ React.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-auto" }, data.map((item, i) => /* @__PURE__ */ React.createElement(
119
+ CommandItem,
120
+ {
121
+ key: i,
122
+ onSelect: () => {
123
+ const newValue = getProperty(item, valueKey);
124
+ setValue(newValue === value ? "" : newValue);
125
+ if (props.onChange) {
126
+ props.onChange(
127
+ newValue === value ? "" : newValue
128
+ );
129
+ }
130
+ setOpen(false);
131
+ }
132
+ },
133
+ /* @__PURE__ */ React.createElement(
134
+ "svg",
135
+ {
136
+ "aria-label": "Check Icon",
137
+ xmlns: "http://www.w3.org/2000/svg",
138
+ width: "24",
139
+ height: "24",
140
+ viewBox: "0 0 24 24",
141
+ fill: "none",
142
+ stroke: "currentColor",
143
+ strokeWidth: "2",
144
+ strokeLinecap: "round",
145
+ strokeLinejoin: "round",
146
+ className: cn(
147
+ "hawa-icon hawa-mr-2",
148
+ value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
149
+ )
150
+ },
151
+ /* @__PURE__ */ React.createElement("polyline", { points: "20 6 9 17 4 12" })
152
+ ),
153
+ getProperty(item, labelKey)
154
+ ))))
155
+ ))
156
+ );
157
+ }
158
+ );
13
159
  export {
14
160
  Combobox
15
161
  };