@avenue-ticketing/ui 0.11.0 → 0.12.0-beta.2

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 (226) hide show
  1. package/README.md +47 -0
  2. package/dist/badge-types-B67wcd4m.d.ts +22 -0
  3. package/dist/react/app-store-buttons-outline.d.ts +17 -0
  4. package/dist/react/app-store-buttons-outline.js +582 -0
  5. package/dist/react/app-store-buttons-outline.js.map +1 -0
  6. package/dist/react/app-store-buttons.d.ts +20 -0
  7. package/dist/react/app-store-buttons.js +817 -0
  8. package/dist/react/app-store-buttons.js.map +1 -0
  9. package/dist/react/avatar-label-group.d.ts +14 -0
  10. package/dist/react/avatar-label-group.js +183 -0
  11. package/dist/react/avatar-label-group.js.map +1 -0
  12. package/dist/react/avatar-profile-photo.d.ts +9 -0
  13. package/dist/react/avatar-profile-photo.js +202 -0
  14. package/dist/react/avatar-profile-photo.js.map +1 -0
  15. package/dist/react/avatar.d.ts +66 -40
  16. package/dist/react/avatar.js +159 -149
  17. package/dist/react/avatar.js.map +1 -1
  18. package/dist/react/badge-groups.d.ts +25 -0
  19. package/dist/react/badge-groups.js +162 -0
  20. package/dist/react/badge-groups.js.map +1 -0
  21. package/dist/react/badge.d.ts +123 -59
  22. package/dist/react/badge.js +314 -86
  23. package/dist/react/badge.js.map +1 -1
  24. package/dist/react/button-group.d.ts +43 -0
  25. package/dist/react/button-group.js +108 -0
  26. package/dist/react/button-group.js.map +1 -0
  27. package/dist/react/button-utility.d.ts +47 -0
  28. package/dist/react/button-utility.js +158 -0
  29. package/dist/react/button-utility.js.map +1 -0
  30. package/dist/react/button.d.ts +112 -37
  31. package/dist/react/button.js +270 -55
  32. package/dist/react/button.js.map +1 -1
  33. package/dist/react/checkbox.d.ts +25 -8
  34. package/dist/react/checkbox.js +115 -110
  35. package/dist/react/checkbox.js.map +1 -1
  36. package/dist/react/close-button.d.ts +25 -0
  37. package/dist/react/close-button.js +54 -0
  38. package/dist/react/close-button.js.map +1 -0
  39. package/dist/react/combobox.d.ts +18 -0
  40. package/dist/react/combobox.js +574 -0
  41. package/dist/react/combobox.js.map +1 -0
  42. package/dist/react/dialog.d.ts +15 -15
  43. package/dist/react/dialog.js +43 -108
  44. package/dist/react/dialog.js.map +1 -1
  45. package/dist/react/dropdown-account-breadcrumb.d.ts +5 -0
  46. package/dist/react/dropdown-account-breadcrumb.js +481 -0
  47. package/dist/react/dropdown-account-breadcrumb.js.map +1 -0
  48. package/dist/react/dropdown-account-button.d.ts +5 -0
  49. package/dist/react/dropdown-account-button.js +938 -0
  50. package/dist/react/dropdown-account-button.js.map +1 -0
  51. package/dist/react/dropdown-account-card-md.d.ts +5 -0
  52. package/dist/react/dropdown-account-card-md.js +714 -0
  53. package/dist/react/dropdown-account-card-md.js.map +1 -0
  54. package/dist/react/dropdown-account-card-sm.d.ts +5 -0
  55. package/dist/react/dropdown-account-card-sm.js +692 -0
  56. package/dist/react/dropdown-account-card-sm.js.map +1 -0
  57. package/dist/react/dropdown-account-card-xs.d.ts +5 -0
  58. package/dist/react/dropdown-account-card-xs.js +672 -0
  59. package/dist/react/dropdown-account-card-xs.js.map +1 -0
  60. package/dist/react/dropdown-avatar.d.ts +5 -0
  61. package/dist/react/dropdown-avatar.js +955 -0
  62. package/dist/react/dropdown-avatar.js.map +1 -0
  63. package/dist/react/dropdown-button-advanced.d.ts +5 -0
  64. package/dist/react/dropdown-button-advanced.js +964 -0
  65. package/dist/react/dropdown-button-advanced.js.map +1 -0
  66. package/dist/react/dropdown-button-link.d.ts +5 -0
  67. package/dist/react/dropdown-button-link.js +666 -0
  68. package/dist/react/dropdown-button-link.js.map +1 -0
  69. package/dist/react/dropdown-button-simple.d.ts +5 -0
  70. package/dist/react/dropdown-button-simple.js +919 -0
  71. package/dist/react/dropdown-button-simple.js.map +1 -0
  72. package/dist/react/dropdown-icon-advanced.d.ts +5 -0
  73. package/dist/react/dropdown-icon-advanced.js +708 -0
  74. package/dist/react/dropdown-icon-advanced.js.map +1 -0
  75. package/dist/react/dropdown-icon-simple.d.ts +5 -0
  76. package/dist/react/dropdown-icon-simple.js +670 -0
  77. package/dist/react/dropdown-icon-simple.js.map +1 -0
  78. package/dist/react/dropdown-integration.d.ts +5 -0
  79. package/dist/react/dropdown-integration.js +1490 -0
  80. package/dist/react/dropdown-integration.js.map +1 -0
  81. package/dist/react/dropdown-search-advanced.d.ts +5 -0
  82. package/dist/react/dropdown-search-advanced.js +1163 -0
  83. package/dist/react/dropdown-search-advanced.js.map +1 -0
  84. package/dist/react/dropdown-search-simple.d.ts +5 -0
  85. package/dist/react/dropdown-search-simple.js +1125 -0
  86. package/dist/react/dropdown-search-simple.js.map +1 -0
  87. package/dist/react/dropdown.d.ts +35 -133
  88. package/dist/react/dropdown.js +536 -1318
  89. package/dist/react/dropdown.js.map +1 -1
  90. package/dist/react/file-upload-trigger.d.ts +34 -0
  91. package/dist/react/file-upload-trigger.js +39 -0
  92. package/dist/react/file-upload-trigger.js.map +1 -0
  93. package/dist/react/form.d.ts +10 -0
  94. package/dist/react/form.js +11 -0
  95. package/dist/react/form.js.map +1 -0
  96. package/dist/react/hint-text.d.ts +17 -0
  97. package/dist/react/hint-text.js +36 -0
  98. package/dist/react/hint-text.js.map +1 -0
  99. package/dist/react/hook-form.d.ts +35 -0
  100. package/dist/react/hook-form.js +50 -0
  101. package/dist/react/hook-form.js.map +1 -0
  102. package/dist/react/input-date.d.ts +43 -0
  103. package/dist/react/input-date.js +306 -0
  104. package/dist/react/input-date.js.map +1 -0
  105. package/dist/react/input-file.d.ts +45 -0
  106. package/dist/react/input-file.js +748 -0
  107. package/dist/react/input-file.js.map +1 -0
  108. package/dist/react/input-group.d.ts +37 -0
  109. package/dist/react/input-group.js +251 -0
  110. package/dist/react/input-group.js.map +1 -0
  111. package/dist/react/input-number.d.ts +32 -0
  112. package/dist/react/input-number.js +553 -0
  113. package/dist/react/input-number.js.map +1 -0
  114. package/dist/react/input-payment.d.ts +16 -0
  115. package/dist/react/input-payment.js +593 -0
  116. package/dist/react/input-payment.js.map +1 -0
  117. package/dist/react/input-tags-outer.d.ts +53 -0
  118. package/dist/react/input-tags-outer.js +607 -0
  119. package/dist/react/input-tags-outer.js.map +1 -0
  120. package/dist/react/input-tags.d.ts +53 -0
  121. package/dist/react/input-tags.js +565 -0
  122. package/dist/react/input-tags.js.map +1 -0
  123. package/dist/react/input.d.ts +71 -22
  124. package/dist/react/input.js +332 -45
  125. package/dist/react/input.js.map +1 -1
  126. package/dist/react/label.d.ts +18 -0
  127. package/dist/react/label.js +112 -0
  128. package/dist/react/label.js.map +1 -0
  129. package/dist/react/multi-select.d.ts +90 -0
  130. package/dist/react/multi-select.js +1237 -0
  131. package/dist/react/multi-select.js.map +1 -0
  132. package/dist/react/pin-input.d.ts +59 -0
  133. package/dist/react/pin-input.js +229 -0
  134. package/dist/react/pin-input.js.map +1 -0
  135. package/dist/react/popover.d.ts +14 -71
  136. package/dist/react/popover.js +171 -540
  137. package/dist/react/popover.js.map +1 -1
  138. package/dist/react/progress-circle.d.ts +9 -0
  139. package/dist/react/progress-circle.js +36 -0
  140. package/dist/react/progress-circle.js.map +1 -0
  141. package/dist/react/progress-circles.d.ts +14 -0
  142. package/dist/react/progress-circles.js +160 -0
  143. package/dist/react/progress-circles.js.map +1 -0
  144. package/dist/react/progress-indicators.d.ts +52 -0
  145. package/dist/react/progress-indicators.js +78 -0
  146. package/dist/react/progress-indicators.js.map +1 -0
  147. package/dist/react/radio-buttons.d.ts +35 -0
  148. package/dist/react/radio-buttons.js +117 -0
  149. package/dist/react/radio-buttons.js.map +1 -0
  150. package/dist/react/scroll-header.d.ts +6 -0
  151. package/dist/react/scroll-header.js +42 -61
  152. package/dist/react/scroll-header.js.map +1 -1
  153. package/dist/react/scroll-wheel.d.ts +4 -5
  154. package/dist/react/scroll-wheel.js +19 -15
  155. package/dist/react/scroll-wheel.js.map +1 -1
  156. package/dist/react/select-item.d.ts +14 -0
  157. package/dist/react/select-item.js +340 -0
  158. package/dist/react/select-item.js.map +1 -0
  159. package/dist/react/select-native.d.ts +17 -0
  160. package/dist/react/select-native.js +203 -0
  161. package/dist/react/select-native.js.map +1 -0
  162. package/dist/react/select.d.ts +19 -61
  163. package/dist/react/select.js +866 -908
  164. package/dist/react/select.js.map +1 -1
  165. package/dist/react/sheet.d.ts +19 -19
  166. package/dist/react/sheet.js +97 -219
  167. package/dist/react/sheet.js.map +1 -1
  168. package/dist/react/slider.d.ts +15 -0
  169. package/dist/react/slider.js +66 -0
  170. package/dist/react/slider.js.map +1 -0
  171. package/dist/react/social-button.d.ts +55 -0
  172. package/dist/react/social-button.js +263 -0
  173. package/dist/react/social-button.js.map +1 -0
  174. package/dist/react/social-logos.d.ts +20 -0
  175. package/dist/react/social-logos.js +131 -0
  176. package/dist/react/social-logos.js.map +1 -0
  177. package/dist/react/switch.d.ts +21 -36
  178. package/dist/react/switch.js +121 -109
  179. package/dist/react/switch.js.map +1 -1
  180. package/dist/react/tag-select.d.ts +47 -0
  181. package/dist/react/tag-select.js +1252 -0
  182. package/dist/react/tag-select.js.map +1 -0
  183. package/dist/react/tags.d.ts +30 -0
  184. package/dist/react/tags.js +228 -0
  185. package/dist/react/tags.js.map +1 -0
  186. package/dist/react/textarea.d.ts +40 -4
  187. package/dist/react/textarea.js +193 -27
  188. package/dist/react/textarea.js.map +1 -1
  189. package/dist/react/tooltip.d.ts +30 -43
  190. package/dist/react/tooltip.js +65 -521
  191. package/dist/react/tooltip.js.map +1 -1
  192. package/dist/select-mobile-sheet-CB2ptDTJ.d.ts +12 -0
  193. package/dist/select-shared-oJEeJxeB.d.ts +68 -0
  194. package/package.json +28 -21
  195. package/source.css +2 -13
  196. package/theme.css +883 -79
  197. package/dist/react/calendar.d.ts +0 -13
  198. package/dist/react/calendar.js +0 -4639
  199. package/dist/react/calendar.js.map +0 -1
  200. package/dist/react/card.d.ts +0 -11
  201. package/dist/react/card.js +0 -113
  202. package/dist/react/card.js.map +0 -1
  203. package/dist/react/datetime-picker.d.ts +0 -21
  204. package/dist/react/datetime-picker.js +0 -6142
  205. package/dist/react/datetime-picker.js.map +0 -1
  206. package/dist/react/pagination.d.ts +0 -28
  207. package/dist/react/pagination.js +0 -262
  208. package/dist/react/pagination.js.map +0 -1
  209. package/dist/react/table-pagination.d.ts +0 -15
  210. package/dist/react/table-pagination.js +0 -1247
  211. package/dist/react/table-pagination.js.map +0 -1
  212. package/dist/react/table-view/column-menu.d.ts +0 -15
  213. package/dist/react/table-view/column-menu.js +0 -1049
  214. package/dist/react/table-view/column-menu.js.map +0 -1
  215. package/dist/react/table-view/index.d.ts +0 -70
  216. package/dist/react/table-view/index.js +0 -2284
  217. package/dist/react/table-view/index.js.map +0 -1
  218. package/dist/react/table.d.ts +0 -86
  219. package/dist/react/table.js +0 -414
  220. package/dist/react/table.js.map +0 -1
  221. package/dist/react/tabs.d.ts +0 -34
  222. package/dist/react/tabs.js +0 -423
  223. package/dist/react/tabs.js.map +0 -1
  224. package/dist/react/time-picker.d.ts +0 -22
  225. package/dist/react/time-picker.js +0 -856
  226. package/dist/react/time-picker.js.map +0 -1
@@ -0,0 +1,1252 @@
1
+ import { createContext, useCallback, useRef, useState, useContext, useMemo, useEffect, isValidElement, useLayoutEffect } from 'react';
2
+ import { MagnifyingGlassIcon } from '@phosphor-icons/react/dist/csr/MagnifyingGlass';
3
+ import { useFilter, FocusScope, useFocusManager } from 'react-aria';
4
+ import { ComboBox, ListBox, Group, Label as Label$1, OverlayTriggerStateContext, Popover as Popover$1, Text, ComboBoxStateContext, Input, ListBoxItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, OverlayArrow, Button } from 'react-aria-components';
5
+ import { UserIcon } from '@phosphor-icons/react/dist/csr/User';
6
+ import { extendTailwindMerge } from 'tailwind-merge';
7
+ import '@phosphor-icons/react/dist/csr/Plus';
8
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
+ import { QuestionIcon } from '@phosphor-icons/react/dist/csr/Question';
10
+ import { createPortal } from 'react-dom';
11
+ import { XIcon } from '@phosphor-icons/react/dist/csr/X';
12
+ import '@phosphor-icons/react/dist/csr/Eye';
13
+ import '@phosphor-icons/react/dist/csr/EyeSlash';
14
+ import '@phosphor-icons/react/dist/csr/Info';
15
+ import { CheckIcon } from '@phosphor-icons/react/dist/csr/Check';
16
+
17
+ function $232f8dea1b0a4f2f$export$762f73dccccd255d(options) {
18
+ let { initialItems = [], initialSelectedKeys, getKey = (item) => item.id ?? item.key, filter, initialFilterText = "" } = options;
19
+ let [state, setState] = (useState)({
20
+ items: initialItems,
21
+ selectedKeys: initialSelectedKeys === "all" ? "all" : new Set(initialSelectedKeys || []),
22
+ filterText: initialFilterText
23
+ });
24
+ let filteredItems = (useMemo)(() => filter ? state.items.filter((item) => filter(item, state.filterText)) : state.items, [
25
+ state.items,
26
+ state.filterText,
27
+ filter
28
+ ]);
29
+ return {
30
+ ...state,
31
+ items: filteredItems,
32
+ ...$232f8dea1b0a4f2f$export$79c0c687a5963b0a({
33
+ getKey
34
+ }, setState),
35
+ getItem(key) {
36
+ return state.items.find((item) => getKey(item) === key);
37
+ }
38
+ };
39
+ }
40
+ function $232f8dea1b0a4f2f$export$79c0c687a5963b0a(opts, dispatch) {
41
+ let { cursor, getKey } = opts;
42
+ return {
43
+ setSelectedKeys(selectedKeys) {
44
+ dispatch((state) => ({
45
+ ...state,
46
+ selectedKeys
47
+ }));
48
+ },
49
+ addKeysToSelection(selectedKeys) {
50
+ dispatch((state) => {
51
+ if (state.selectedKeys === "all") return state;
52
+ if (selectedKeys === "all") return {
53
+ ...state,
54
+ selectedKeys: "all"
55
+ };
56
+ return {
57
+ ...state,
58
+ selectedKeys: /* @__PURE__ */ new Set([
59
+ ...state.selectedKeys,
60
+ ...selectedKeys
61
+ ])
62
+ };
63
+ });
64
+ },
65
+ removeKeysFromSelection(selectedKeys) {
66
+ dispatch((state) => {
67
+ if (selectedKeys === "all") return {
68
+ ...state,
69
+ selectedKeys: /* @__PURE__ */ new Set()
70
+ };
71
+ let selection = state.selectedKeys === "all" ? new Set(state.items.map(getKey)) : new Set(state.selectedKeys);
72
+ for (let key of selectedKeys) selection.delete(key);
73
+ return {
74
+ ...state,
75
+ selectedKeys: selection
76
+ };
77
+ });
78
+ },
79
+ setFilterText(filterText) {
80
+ dispatch((state) => ({
81
+ ...state,
82
+ filterText
83
+ }));
84
+ },
85
+ insert(index, ...values) {
86
+ dispatch((state) => $232f8dea1b0a4f2f$var$insert(state, index, ...values));
87
+ },
88
+ insertBefore(key, ...values) {
89
+ dispatch((state) => {
90
+ let index = state.items.findIndex((item) => getKey?.(item) === key);
91
+ if (index === -1) {
92
+ if (state.items.length === 0) index = 0;
93
+ else return state;
94
+ }
95
+ return $232f8dea1b0a4f2f$var$insert(state, index, ...values);
96
+ });
97
+ },
98
+ insertAfter(key, ...values) {
99
+ dispatch((state) => {
100
+ let index = state.items.findIndex((item) => getKey?.(item) === key);
101
+ if (index === -1) {
102
+ if (state.items.length === 0) index = 0;
103
+ else return state;
104
+ }
105
+ return $232f8dea1b0a4f2f$var$insert(state, index + 1, ...values);
106
+ });
107
+ },
108
+ prepend(...values) {
109
+ dispatch((state) => $232f8dea1b0a4f2f$var$insert(state, 0, ...values));
110
+ },
111
+ append(...values) {
112
+ dispatch((state) => $232f8dea1b0a4f2f$var$insert(state, state.items.length, ...values));
113
+ },
114
+ remove(...keys) {
115
+ dispatch((state) => {
116
+ let keySet = new Set(keys);
117
+ let items = state.items.filter((item) => !keySet.has(getKey(item)));
118
+ let selection = "all";
119
+ if (state.selectedKeys !== "all") {
120
+ selection = new Set(state.selectedKeys);
121
+ for (let key of keys) selection.delete(key);
122
+ }
123
+ if (cursor == null && items.length === 0) selection = /* @__PURE__ */ new Set();
124
+ return {
125
+ ...state,
126
+ items,
127
+ selectedKeys: selection
128
+ };
129
+ });
130
+ },
131
+ removeSelectedItems() {
132
+ dispatch((state) => {
133
+ if (state.selectedKeys === "all") return {
134
+ ...state,
135
+ items: [],
136
+ selectedKeys: /* @__PURE__ */ new Set()
137
+ };
138
+ let selectedKeys = state.selectedKeys;
139
+ let items = state.items.filter((item) => !selectedKeys.has(getKey(item)));
140
+ return {
141
+ ...state,
142
+ items,
143
+ selectedKeys: /* @__PURE__ */ new Set()
144
+ };
145
+ });
146
+ },
147
+ move(key, toIndex) {
148
+ dispatch((state) => {
149
+ let index = state.items.findIndex((item2) => getKey(item2) === key);
150
+ if (index === -1) return state;
151
+ let copy = state.items.slice();
152
+ let [item] = copy.splice(index, 1);
153
+ copy.splice(toIndex, 0, item);
154
+ return {
155
+ ...state,
156
+ items: copy
157
+ };
158
+ });
159
+ },
160
+ moveBefore(key, keys) {
161
+ dispatch((state) => {
162
+ let toIndex = state.items.findIndex((item) => getKey(item) === key);
163
+ if (toIndex === -1) return state;
164
+ let keyArray = Array.isArray(keys) ? keys : [
165
+ ...keys
166
+ ];
167
+ let indices = keyArray.map((key2) => state.items.findIndex((item) => getKey(item) === key2)).sort((a, b) => a - b);
168
+ return $232f8dea1b0a4f2f$var$move(state, indices, toIndex);
169
+ });
170
+ },
171
+ moveAfter(key, keys) {
172
+ dispatch((state) => {
173
+ let toIndex = state.items.findIndex((item) => getKey(item) === key);
174
+ if (toIndex === -1) return state;
175
+ let keyArray = Array.isArray(keys) ? keys : [
176
+ ...keys
177
+ ];
178
+ let indices = keyArray.map((key2) => state.items.findIndex((item) => getKey(item) === key2)).sort((a, b) => a - b);
179
+ return $232f8dea1b0a4f2f$var$move(state, indices, toIndex + 1);
180
+ });
181
+ },
182
+ update(key, newValue) {
183
+ dispatch((state) => {
184
+ let index = state.items.findIndex((item) => getKey(item) === key);
185
+ if (index === -1) return state;
186
+ let updatedValue;
187
+ if (typeof newValue === "function") updatedValue = newValue(state.items[index]);
188
+ else updatedValue = newValue;
189
+ return {
190
+ ...state,
191
+ items: [
192
+ ...state.items.slice(0, index),
193
+ updatedValue,
194
+ ...state.items.slice(index + 1)
195
+ ]
196
+ };
197
+ });
198
+ }
199
+ };
200
+ }
201
+ function $232f8dea1b0a4f2f$var$insert(state, index, ...values) {
202
+ return {
203
+ ...state,
204
+ items: [
205
+ ...state.items.slice(0, index),
206
+ ...values,
207
+ ...state.items.slice(index)
208
+ ]
209
+ };
210
+ }
211
+ function $232f8dea1b0a4f2f$var$move(state, indices, toIndex) {
212
+ toIndex -= indices.filter((index) => index < toIndex).length;
213
+ let moves = indices.map((from) => ({
214
+ from,
215
+ to: toIndex++
216
+ }));
217
+ for (let i = 0; i < moves.length; i++) {
218
+ let a = moves[i].from;
219
+ for (let j = i; j < moves.length; j++) {
220
+ let b = moves[j].from;
221
+ if (b > a) moves[j].from--;
222
+ }
223
+ }
224
+ for (let i = 0; i < moves.length; i++) {
225
+ let a = moves[i];
226
+ for (let j = moves.length - 1; j > i; j--) {
227
+ let b = moves[j];
228
+ if (b.from < a.to) a.to++;
229
+ else b.from++;
230
+ }
231
+ }
232
+ let copy = state.items.slice();
233
+ for (let move of moves) {
234
+ let [item] = copy.splice(move.from, 1);
235
+ copy.splice(move.to, 0, item);
236
+ }
237
+ return {
238
+ ...state,
239
+ items: copy
240
+ };
241
+ }
242
+ var twMerge = extendTailwindMerge({
243
+ extend: {
244
+ theme: {
245
+ text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
246
+ }
247
+ }
248
+ });
249
+ var cx = twMerge;
250
+ var Tooltip = ({
251
+ title,
252
+ description,
253
+ children,
254
+ arrow = false,
255
+ delay = 100,
256
+ closeDelay = 0,
257
+ trigger,
258
+ isDisabled,
259
+ isOpen,
260
+ defaultOpen,
261
+ offset = 6,
262
+ crossOffset,
263
+ placement = "top",
264
+ onOpenChange,
265
+ ...tooltipProps
266
+ }) => {
267
+ const isTopOrBottomLeft = ["top left", "top end", "bottom left", "bottom end"].includes(placement);
268
+ const isTopOrBottomRight = ["top right", "top start", "bottom right", "bottom start"].includes(placement);
269
+ const calculatedCrossOffset = isTopOrBottomLeft ? -12 : isTopOrBottomRight ? 12 : 0;
270
+ return /* @__PURE__ */ jsxs(TooltipTrigger$1, { ...{ trigger, delay, closeDelay, isDisabled, isOpen, defaultOpen, onOpenChange }, children: [
271
+ children,
272
+ /* @__PURE__ */ jsx(
273
+ Tooltip$1,
274
+ {
275
+ ...tooltipProps,
276
+ offset,
277
+ placement,
278
+ crossOffset: crossOffset ?? calculatedCrossOffset,
279
+ className: ({ isEntering, isExiting }) => cx(isEntering && "ease-out animate-in", isExiting && "ease-in animate-out"),
280
+ children: ({ isEntering, isExiting }) => /* @__PURE__ */ jsxs(
281
+ "div",
282
+ {
283
+ className: cx(
284
+ "z-50 flex max-w-xs origin-(--trigger-anchor-point) flex-col items-start gap-1 rounded-lg bg-primary-solid px-3 shadow-lg will-change-transform",
285
+ description ? "py-3" : "py-2",
286
+ isEntering && "ease-out animate-in fade-in zoom-in-95 in-placement-left:slide-in-from-right-0.5 in-placement-right:slide-in-from-left-0.5 in-placement-top:slide-in-from-bottom-0.5 in-placement-bottom:slide-in-from-top-0.5",
287
+ isExiting && "ease-in animate-out fade-out zoom-out-95 in-placement-left:slide-out-to-right-0.5 in-placement-right:slide-out-to-left-0.5 in-placement-top:slide-out-to-bottom-0.5 in-placement-bottom:slide-out-to-top-0.5"
288
+ ),
289
+ children: [
290
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-white", children: title }),
291
+ description && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: description }),
292
+ arrow && /* @__PURE__ */ jsx(OverlayArrow, { children: /* @__PURE__ */ jsx(
293
+ "svg",
294
+ {
295
+ viewBox: "0 0 100 100",
296
+ className: "size-2.5 fill-bg-primary-solid in-placement-left:-rotate-90 in-placement-right:rotate-90 in-placement-top:rotate-0 in-placement-bottom:rotate-180",
297
+ children: /* @__PURE__ */ jsx("path", { d: "M0,0 L35.858,35.858 Q50,50 64.142,35.858 L100,0 Z" })
298
+ }
299
+ ) })
300
+ ]
301
+ }
302
+ )
303
+ }
304
+ )
305
+ ] });
306
+ };
307
+ var TooltipTrigger = ({ children, className, ...buttonProps }) => {
308
+ return /* @__PURE__ */ jsx(Button, { ...buttonProps, className: (values) => cx("h-max w-max outline-hidden", typeof className === "function" ? className(values) : className), children });
309
+ };
310
+ var sizes = {
311
+ xs: "size-1.5",
312
+ sm: "size-2",
313
+ md: "size-2.5",
314
+ lg: "size-3",
315
+ xl: "size-3.5",
316
+ "2xl": "size-4",
317
+ "3xl": "size-4.5",
318
+ "4xl": "size-5"
319
+ };
320
+ var AvatarOnlineIndicator = ({ size, status, className }) => /* @__PURE__ */ jsx(
321
+ "span",
322
+ {
323
+ className: cx(
324
+ "absolute right-0 bottom-0 flex justify-center rounded-full ring-[1.5px] ring-bg-primary",
325
+ status === "online" ? "bg-fg-success-secondary" : "bg-utility-neutral-300",
326
+ sizes[size],
327
+ className
328
+ ),
329
+ style: {
330
+ backgroundImage: "radial-gradient(43.75% 43.75% at 50% 28.75%, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.00) 100%), radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.00) 74.66%, rgba(255, 255, 255, 0.18) 100%), radial-gradient(75% 75% at 50% 0%, rgba(255, 255, 255, 0.00) 0%, rgba(255, 255, 255, 0.00) 50%, rgba(255, 255, 255, 0.08) 99%, rgba(255, 255, 255, 0.00) 100%)"
331
+ },
332
+ children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 7.2 2.85", fill: "none", className: "mt-[10%] h-[20%] w-[60%]", children: [
333
+ /* @__PURE__ */ jsx(
334
+ "path",
335
+ {
336
+ d: "M7.2 1.83107C7.2 2.84235 5.58823 2.19729 3.6 2.19729C1.61177 2.19729 0 2.84235 0 1.83107C0 0.8198 1.61177 0 3.6 0C5.58823 0 7.2 0.8198 7.2 1.83107Z",
337
+ fill: "url(#reflection-gradient)",
338
+ fillOpacity: "0.4"
339
+ }
340
+ ),
341
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "reflection-gradient", x1: "3.6", y1: "0", x2: "3.6", y2: "2.4", gradientUnits: "userSpaceOnUse", children: [
342
+ /* @__PURE__ */ jsx("stop", { stopColor: "white" }),
343
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.1" })
344
+ ] }) })
345
+ ] })
346
+ }
347
+ );
348
+ var sizes2 = {
349
+ xs: "size-2.5",
350
+ sm: "size-3",
351
+ md: "size-3.5",
352
+ lg: "size-4",
353
+ xl: "size-4.5",
354
+ "2xl": "size-5",
355
+ "3xl": "size-6",
356
+ "4xl": "size-8"
357
+ };
358
+ var VerifiedTick = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { className: cx("z-10 text-utility-blue-500", sizes2[size], className), viewBox: "0 0 10 10", fill: "none", children: [
359
+ /* @__PURE__ */ jsx(
360
+ "path",
361
+ {
362
+ d: "M7.72237 1.77098C7.81734 2.00068 7.99965 2.18326 8.2292 2.27858L9.03413 2.61199C9.26384 2.70714 9.44635 2.88965 9.5415 3.11936C9.63665 3.34908 9.63665 3.60718 9.5415 3.83689L9.20833 4.64125C9.11313 4.87106 9.113 5.12943 9.20863 5.35913L9.54122 6.16325C9.58839 6.27702 9.61268 6.39897 9.6127 6.52214C9.61272 6.6453 9.58847 6.76726 9.54134 6.88105C9.4942 6.99484 9.42511 7.09823 9.33801 7.18531C9.2509 7.27238 9.14749 7.34144 9.03369 7.38854L8.22934 7.72171C7.99964 7.81669 7.81706 7.99899 7.72174 8.22855L7.38833 9.03348C7.29318 9.26319 7.11067 9.4457 6.88096 9.54085C6.65124 9.636 6.39314 9.636 6.16343 9.54085L5.35907 9.20767C5.12935 9.11276 4.87134 9.11295 4.64177 9.20821L3.83684 9.54115C3.60725 9.63608 3.34937 9.636 3.11984 9.54092C2.89032 9.44585 2.70791 9.26356 2.6127 9.03409L2.27918 8.22892C2.18421 7.99923 2.0019 7.81665 1.77235 7.72133L0.967421 7.38792C0.737807 7.29281 0.555355 7.11041 0.460169 6.88083C0.364983 6.65125 0.364854 6.39327 0.45981 6.16359L0.792984 5.35924C0.8879 5.12952 0.887707 4.87151 0.792445 4.64193L0.459749 3.83642C0.41258 3.72265 0.388291 3.60069 0.388272 3.47753C0.388252 3.35436 0.412501 3.2324 0.459634 3.11861C0.506767 3.00482 0.57586 2.90144 0.662965 2.81436C0.75007 2.72728 0.853479 2.65822 0.967283 2.61113L1.77164 2.27795C2.00113 2.18306 2.1836 2.00099 2.27899 1.7717L2.6124 0.966768C2.70755 0.737054 2.89006 0.554547 3.11978 0.459397C3.34949 0.364246 3.60759 0.364246 3.83731 0.459397L4.64166 0.792571C4.87138 0.887487 5.12939 0.887293 5.35897 0.792031L6.16424 0.459913C6.39392 0.364816 6.65197 0.364836 6.88164 0.459968C7.11131 0.555099 7.29379 0.737554 7.38895 0.967208L7.72247 1.77238L7.72237 1.77098Z",
363
+ className: "fill-current"
364
+ }
365
+ ),
366
+ /* @__PURE__ */ jsx(
367
+ "path",
368
+ {
369
+ fillRule: "evenodd",
370
+ clipRule: "evenodd",
371
+ d: "M6.95829 3.68932C7.02509 3.58439 7.04747 3.45723 7.02051 3.3358C6.99356 3.21437 6.91946 3.10862 6.81454 3.04182C6.70961 2.97502 6.58245 2.95264 6.46102 2.97959C6.33959 3.00655 6.23384 3.08064 6.16704 3.18557L4.33141 6.06995L3.49141 5.01995C3.41375 4.92281 3.30069 4.8605 3.17709 4.84673C3.05349 4.83296 2.92949 4.86885 2.83235 4.94651C2.73522 5.02417 2.67291 5.13723 2.65914 5.26083C2.64536 5.38443 2.68125 5.50843 2.75891 5.60557L4.00891 7.16807C4.0555 7.22638 4.11533 7.27271 4.18344 7.30323C4.25154 7.33375 4.32595 7.34757 4.40047 7.34353C4.47499 7.3395 4.54747 7.31773 4.61188 7.28004C4.67629 7.24234 4.73077 7.18981 4.77079 7.12682L6.95829 3.68932Z",
372
+ fill: "white"
373
+ }
374
+ )
375
+ ] });
376
+ var AvatarCount = ({ count, className }) => /* @__PURE__ */ jsx("div", { className: cx("absolute right-0 bottom-0 p-px", className), children: /* @__PURE__ */ jsx("div", { className: "flex size-3.5 items-center justify-center rounded-full bg-fg-error-primary text-center text-[10px] leading-[13px] font-bold text-white", children: count }) });
377
+ var styles = {
378
+ xs: { root: "size-6", rootWithBorder: "p-px", initials: "text-xs font-semibold", icon: "size-4" },
379
+ sm: { root: "size-8", rootWithBorder: "p-px", initials: "text-sm font-semibold", icon: "size-5" },
380
+ md: { root: "size-10", rootWithBorder: "p-px", initials: "text-md font-semibold", icon: "size-6" },
381
+ lg: { root: "size-12", rootWithBorder: "p-[1.5px]", initials: "text-lg font-semibold", icon: "size-7" },
382
+ xl: { root: "size-14", rootWithBorder: "p-0.5", initials: "text-xl font-semibold", icon: "size-8" },
383
+ "2xl": { root: "size-16", rootWithBorder: "p-0.5", initials: "text-display-xs font-semibold", icon: "size-8" }
384
+ };
385
+ var Avatar = ({
386
+ size = "md",
387
+ src,
388
+ alt,
389
+ initials,
390
+ placeholder,
391
+ placeholderIcon: PlaceholderIcon,
392
+ border,
393
+ badge,
394
+ status,
395
+ verified,
396
+ count,
397
+ focusable = false,
398
+ rounded = true,
399
+ className,
400
+ contentClassName
401
+ }) => {
402
+ const [isFailed, setIsFailed] = useState(false);
403
+ const canShowImage = src && !isFailed;
404
+ const renderMainContent = () => {
405
+ if (canShowImage) {
406
+ return /* @__PURE__ */ jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src, alt, onError: () => setIsFailed(true) });
407
+ }
408
+ if (initials) {
409
+ return /* @__PURE__ */ jsx("span", { className: cx("text-quaternary", styles[size].initials), children: initials });
410
+ }
411
+ if (PlaceholderIcon) {
412
+ return /* @__PURE__ */ jsx(PlaceholderIcon, { className: cx("text-fg-quaternary", styles[size].icon) });
413
+ }
414
+ return placeholder || /* @__PURE__ */ jsx(UserIcon, { className: cx("text-fg-quaternary", styles[size].icon) });
415
+ };
416
+ const renderBadgeContent = () => {
417
+ if (status) {
418
+ return /* @__PURE__ */ jsx(AvatarOnlineIndicator, { status, size });
419
+ }
420
+ if (verified) {
421
+ return /* @__PURE__ */ jsx(VerifiedTick, { size, className: cx("absolute right-0 bottom-0", size === "xs" && "-right-px -bottom-px") });
422
+ }
423
+ if (count) {
424
+ return /* @__PURE__ */ jsx(AvatarCount, { count });
425
+ }
426
+ return badge;
427
+ };
428
+ return /* @__PURE__ */ jsxs(
429
+ "div",
430
+ {
431
+ "data-avatar": true,
432
+ className: cx(
433
+ "relative inline-flex shrink-0 rounded-[7px]",
434
+ rounded && "rounded-full",
435
+ // Focus styles
436
+ focusable && "outline-none group-focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
437
+ border && "ring-1 ring-secondary_alt",
438
+ border && styles[size].rootWithBorder,
439
+ styles[size].root,
440
+ className
441
+ ),
442
+ children: [
443
+ /* @__PURE__ */ jsx(
444
+ "div",
445
+ {
446
+ className: cx(
447
+ "relative inline-flex size-full shrink-0 items-center justify-center overflow-hidden rounded-md bg-tertiary outline-[0.5px] -outline-offset-[0.5px] outline-black/16 before:inset-[0.5px]",
448
+ rounded && "rounded-full",
449
+ canShowImage && size !== "xs" && "before:absolute before:inset-0 before:rounded-[inherit] before:border before:border-white/32 before:mask-[linear-gradient(to_bottom,black_0%,transparent_25%,transparent_75%,black_100%)]",
450
+ contentClassName
451
+ ),
452
+ children: renderMainContent()
453
+ }
454
+ ),
455
+ renderBadgeContent()
456
+ ]
457
+ }
458
+ );
459
+ };
460
+ var HintText = ({ isInvalid, className, size = "md", ...props }) => {
461
+ return /* @__PURE__ */ jsx(
462
+ Text,
463
+ {
464
+ ...props,
465
+ slot: isInvalid ? "errorMessage" : "description",
466
+ className: cx(
467
+ "text-sm text-tertiary",
468
+ // Size
469
+ size === "sm" && "text-xs",
470
+ "in-data-[input-size=sm]:text-xs",
471
+ // Invalid state
472
+ isInvalid && "text-error-primary",
473
+ "group-invalid:text-error-primary",
474
+ className
475
+ )
476
+ }
477
+ );
478
+ };
479
+ HintText.displayName = "HintText";
480
+ var Label = ({ isInvalid, isRequired, tooltip, tooltipDescription, className, ...props }) => {
481
+ return /* @__PURE__ */ jsxs(
482
+ Label$1,
483
+ {
484
+ "data-label": "true",
485
+ ...props,
486
+ className: cx("flex cursor-default items-center gap-0.5 text-sm font-medium text-secondary", className),
487
+ children: [
488
+ props.children,
489
+ /* @__PURE__ */ jsx(
490
+ "span",
491
+ {
492
+ className: cx(
493
+ "hidden text-brand-tertiary",
494
+ isRequired && "block",
495
+ typeof isRequired === "undefined" && "group-required:block",
496
+ isInvalid && "text-error-primary",
497
+ typeof isInvalid === "undefined" && "group-invalid:text-error-primary"
498
+ ),
499
+ children: "*"
500
+ }
501
+ ),
502
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, description: tooltipDescription, placement: "top", children: /* @__PURE__ */ jsx(
503
+ TooltipTrigger,
504
+ {
505
+ isDisabled: false,
506
+ className: "cursor-pointer text-fg-quaternary transition duration-200 hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover",
507
+ children: /* @__PURE__ */ jsx(QuestionIcon, { className: "size-4" })
508
+ }
509
+ ) })
510
+ ]
511
+ }
512
+ );
513
+ };
514
+ Label.displayName = "Label";
515
+ var MOBILE_SHEET_MAX_PX = 1024;
516
+ function useIsMobile(breakpoint = MOBILE_SHEET_MAX_PX + 1) {
517
+ const [isMobile, setIsMobile] = useState(() => {
518
+ if (typeof window === "undefined") return false;
519
+ return window.matchMedia(`(max-width: ${breakpoint - 1}px)`).matches;
520
+ });
521
+ useEffect(() => {
522
+ const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
523
+ const handler = (e) => setIsMobile(e.matches);
524
+ mq.addEventListener("change", handler);
525
+ return () => mq.removeEventListener("change", handler);
526
+ }, [breakpoint]);
527
+ return isMobile;
528
+ }
529
+ var MOBILE_SHEET_MOTION_MS = 175;
530
+ var MOBILE_SHEET_ENTRY_EASING = "cubic-bezier(0.85, 0, 0.15, 1)";
531
+ var MOBILE_SHEET_EXIT_EASING = "cubic-bezier(0.85, 0, 1, 0.15)";
532
+ var MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX = 120;
533
+ function resolveSelectMobileOptions(mobileOptions) {
534
+ return {
535
+ sheet: mobileOptions?.sheet ?? true,
536
+ title: mobileOptions?.title,
537
+ sheetClassName: mobileOptions?.className,
538
+ contentClassName: mobileOptions?.contentClassName
539
+ };
540
+ }
541
+ function useMobileSheetAnimation(open, enabled, slideEntrance = true, slideOffsetPx = MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX) {
542
+ const [shouldRender, setShouldRender] = useState(open);
543
+ const [isAnimating, setIsAnimating] = useState(false);
544
+ useLayoutEffect(() => {
545
+ if (!enabled) {
546
+ setShouldRender(open);
547
+ return;
548
+ }
549
+ if (open) {
550
+ setShouldRender(true);
551
+ }
552
+ }, [open, enabled]);
553
+ useEffect(() => {
554
+ if (!enabled || open) return;
555
+ const timer = setTimeout(() => setShouldRender(false), MOBILE_SHEET_MOTION_MS);
556
+ return () => clearTimeout(timer);
557
+ }, [open, enabled]);
558
+ useLayoutEffect(() => {
559
+ if (!enabled || open || !shouldRender) return;
560
+ setIsAnimating(false);
561
+ }, [enabled, open, shouldRender]);
562
+ useEffect(() => {
563
+ if (!enabled || !shouldRender || !open) return;
564
+ let raf2 = 0;
565
+ const raf1 = requestAnimationFrame(() => {
566
+ raf2 = requestAnimationFrame(() => setIsAnimating(true));
567
+ });
568
+ return () => {
569
+ cancelAnimationFrame(raf1);
570
+ if (raf2) cancelAnimationFrame(raf2);
571
+ };
572
+ }, [shouldRender, open, enabled]);
573
+ const motionEasing = open ? MOBILE_SHEET_ENTRY_EASING : MOBILE_SHEET_EXIT_EASING;
574
+ const hiddenTransform = slideEntrance ? `translateY(${slideOffsetPx}px)` : "translateY(100%)";
575
+ const panelStyle = enabled ? {
576
+ transform: isAnimating ? "translateY(0)" : hiddenTransform,
577
+ opacity: isAnimating ? 1 : 0,
578
+ transitionProperty: "transform, opacity",
579
+ transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
580
+ transitionTimingFunction: motionEasing
581
+ } : void 0;
582
+ const backdropStyle = enabled ? {
583
+ opacity: isAnimating ? 1 : 0,
584
+ transitionProperty: "opacity",
585
+ transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
586
+ transitionTimingFunction: motionEasing
587
+ } : void 0;
588
+ return { shouldRender, isAnimating, panelStyle, backdropStyle };
589
+ }
590
+ function MobileSheetCloseButton({ onClose }) {
591
+ return /* @__PURE__ */ jsxs(
592
+ "button",
593
+ {
594
+ type: "button",
595
+ onClick: (e) => {
596
+ e.stopPropagation();
597
+ onClose();
598
+ },
599
+ className: "flex size-12 shrink-0 cursor-pointer items-center justify-center rounded-full text-fg-primary transition duration-100 ease-linear hover:bg-primary_hover active:scale-[0.96] focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
600
+ children: [
601
+ /* @__PURE__ */ jsx(XIcon, { className: "size-5", "aria-hidden": "true" }),
602
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
603
+ ]
604
+ }
605
+ );
606
+ }
607
+ function MobileSheetChrome({
608
+ title,
609
+ contentClassName,
610
+ onClose,
611
+ children
612
+ }) {
613
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
614
+ /* @__PURE__ */ jsxs("div", { className: cx("flex w-full shrink-0 items-center py-2 pl-4 pr-2", title ? "justify-between gap-3" : "justify-end"), children: [
615
+ title ? /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold text-primary", children: title }) : null,
616
+ /* @__PURE__ */ jsx(MobileSheetCloseButton, { onClose })
617
+ ] }),
618
+ /* @__PURE__ */ jsx(
619
+ "div",
620
+ {
621
+ className: cx(
622
+ "min-h-0 flex-1 overflow-y-auto pb-[calc(5rem+env(safe-area-inset-bottom,0px))]",
623
+ contentClassName
624
+ ),
625
+ children
626
+ }
627
+ )
628
+ ] });
629
+ }
630
+ var Popover = ({ mobileOptions, children, size, className, style, compoundContent = false, ...props }) => {
631
+ const isMobile = useIsMobile();
632
+ const resolvedMobile = useMemo(() => resolveSelectMobileOptions(mobileOptions), [mobileOptions]);
633
+ const useMobileSheet = isMobile && resolvedMobile.sheet;
634
+ const overlayState = useContext(OverlayTriggerStateContext);
635
+ const open = overlayState?.isOpen ?? false;
636
+ const { shouldRender, panelStyle, backdropStyle } = useMobileSheetAnimation(open, useMobileSheet);
637
+ useEffect(() => {
638
+ if (!useMobileSheet || !open) return;
639
+ const prev = document.body.style.overflow;
640
+ document.body.style.overflow = "hidden";
641
+ return () => {
642
+ document.body.style.overflow = prev;
643
+ };
644
+ }, [useMobileSheet, open]);
645
+ const close = () => overlayState?.close();
646
+ const showMobileSheet = useMobileSheet && shouldRender;
647
+ const isMobileSheetExiting = showMobileSheet && !open;
648
+ const mobileScrim = useMobileSheet && shouldRender && typeof document !== "undefined" ? createPortal(
649
+ /* @__PURE__ */ jsx(
650
+ "div",
651
+ {
652
+ className: "fixed inset-0 z-50 bg-overlay/70",
653
+ style: backdropStyle,
654
+ onClick: close,
655
+ "aria-hidden": "true"
656
+ }
657
+ ),
658
+ document.body
659
+ ) : null;
660
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
661
+ mobileScrim,
662
+ /* @__PURE__ */ jsx(
663
+ Popover$1,
664
+ {
665
+ placement: "bottom",
666
+ containerPadding: 0,
667
+ offset: 4,
668
+ ...props,
669
+ isExiting: isMobileSheetExiting,
670
+ ...useMobileSheet ? { "data-select-mobile-sheet": true } : {},
671
+ style: useMobileSheet ? { ...panelStyle, ...style } : style,
672
+ className: (state) => cx(
673
+ "outline-hidden",
674
+ !useMobileSheet && [
675
+ "w-(--trigger-width) origin-(--trigger-anchor-point) rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
676
+ compoundContent ? "overflow-hidden outline-hidden" : "overflow-x-hidden overflow-y-auto py-1 outline-hidden",
677
+ state.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
678
+ state.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
679
+ !compoundContent && size === "sm" && "max-h-56!",
680
+ !compoundContent && size === "md" && "max-h-64!",
681
+ !compoundContent && size === "lg" && "max-h-80!"
682
+ ],
683
+ useMobileSheet && [
684
+ "fixed! inset-x-0! bottom-0! top-auto! left-0! right-0! z-[51] flex w-full! max-w-none! flex-col overflow-hidden rounded-t-2xl rounded-b-none border-x-0 border-t border-secondary bg-primary shadow-xl",
685
+ "max-h-[min(90dvh,calc(100dvh-env(safe-area-inset-bottom,0px)))]",
686
+ resolvedMobile.sheetClassName
687
+ ],
688
+ typeof className === "function" ? className(state) : className
689
+ ),
690
+ children: (state) => {
691
+ const content = typeof children === "function" ? children(state) : children;
692
+ if (useMobileSheet) {
693
+ return /* @__PURE__ */ jsx(
694
+ MobileSheetChrome,
695
+ {
696
+ title: resolvedMobile.title,
697
+ contentClassName: resolvedMobile.contentClassName,
698
+ onClose: close,
699
+ children: content
700
+ }
701
+ );
702
+ }
703
+ return content;
704
+ }
705
+ }
706
+ )
707
+ ] });
708
+ };
709
+ var sizes3 = {
710
+ sm: {
711
+ root: "py-2 pl-3 pr-2.5 gap-2 *:data-icon:size-4 *:data-icon:stroke-[2.25px]",
712
+ withIcon: "",
713
+ text: "text-sm",
714
+ textContainer: "gap-x-1.5",
715
+ shortcut: "pr-2.5"
716
+ },
717
+ md: { root: "py-2 px-3 gap-2 *:data-icon:size-5", withIcon: "", text: "text-md", textContainer: "gap-x-1.5", shortcut: "pr-2.5" },
718
+ lg: { root: "py-2.5 px-3.5 gap-2 *:data-icon:size-5", withIcon: "", text: "text-md", textContainer: "gap-x-1.5", shortcut: "pr-3" }
719
+ };
720
+ var SelectContext = createContext({ size: "md" });
721
+ var focusShadowPlain = "focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
722
+ var styles2 = {
723
+ sm: { root: "p-0.5", icon: "size-2.5" },
724
+ md: { root: "p-0.5", icon: "size-3" },
725
+ lg: { root: "p-[3px]", icon: "size-3.5" }
726
+ };
727
+ var TagCloseX = ({ size = "md", className, ...otherProps }) => {
728
+ return /* @__PURE__ */ jsx(
729
+ Button,
730
+ {
731
+ slot: "remove",
732
+ "aria-label": "Remove this tag",
733
+ className: cx(
734
+ "flex cursor-pointer rounded-[3px] text-fg-quaternary outline-transparent transition duration-100 ease-linear hover:bg-primary_hover focus-visible:rounded-[3px] disabled:cursor-not-allowed disabled:opacity-50",
735
+ focusShadowPlain,
736
+ styles2[size].root,
737
+ className
738
+ ),
739
+ ...otherProps,
740
+ children: /* @__PURE__ */ jsx(XIcon, { className: cx("shrink-0 transition-inherit-all", styles2[size].icon) })
741
+ }
742
+ );
743
+ };
744
+ function hasResizeObserver() {
745
+ return typeof window.ResizeObserver !== "undefined";
746
+ }
747
+ function useResizeObserver(options) {
748
+ const { ref, box, onResize } = options;
749
+ useEffect(() => {
750
+ const element = ref?.current;
751
+ if (!element) {
752
+ return;
753
+ }
754
+ if (!hasResizeObserver()) {
755
+ window.addEventListener("resize", onResize, false);
756
+ return () => {
757
+ window.removeEventListener("resize", onResize, false);
758
+ };
759
+ } else {
760
+ const resizeObserverInstance = new window.ResizeObserver((entries) => {
761
+ if (!entries.length) {
762
+ return;
763
+ }
764
+ onResize();
765
+ });
766
+ resizeObserverInstance.observe(element, { box });
767
+ return () => {
768
+ if (element) {
769
+ resizeObserverInstance.unobserve(element);
770
+ }
771
+ };
772
+ }
773
+ }, [onResize, ref, box]);
774
+ }
775
+ var inputFocusRingShadow = "border-brand ring-1 ring-inset ring-brand";
776
+ var inputErrorFocusRingShadow = "border-error ring-1 ring-inset ring-error";
777
+ createContext({});
778
+ var CHECKBOX_TICK_DELAY_MS = 60;
779
+ var CHECKBOX_TICK_DRAW_MS = 100;
780
+ function CheckboxAnimatedCheckMark({ pixelSize, className }) {
781
+ const pathRef = useRef(null);
782
+ useLayoutEffect(() => {
783
+ const path = pathRef.current;
784
+ if (!path || typeof path.getTotalLength !== "function") return;
785
+ const len = path.getTotalLength();
786
+ if (len <= 0) return;
787
+ path.style.strokeDasharray = `${len}`;
788
+ path.style.strokeDashoffset = `${len}`;
789
+ if (typeof path.animate !== "function") {
790
+ path.style.strokeDashoffset = "0";
791
+ return;
792
+ }
793
+ const anim = path.animate([{ strokeDashoffset: len }, { strokeDashoffset: 0 }], {
794
+ duration: CHECKBOX_TICK_DRAW_MS,
795
+ delay: CHECKBOX_TICK_DELAY_MS,
796
+ easing: "cubic-bezier(0.45, 0, 0.2, 1)",
797
+ fill: "forwards"
798
+ });
799
+ return () => anim.cancel();
800
+ }, []);
801
+ return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", width: pixelSize, height: pixelSize, viewBox: "0 0 14 14", fill: "none", className: cx("block", className), children: /* @__PURE__ */ jsx(
802
+ "path",
803
+ {
804
+ ref: pathRef,
805
+ d: "M2.33325 7L5.24992 9.91667L11.6666 3.5",
806
+ stroke: "currentColor",
807
+ strokeWidth: "2",
808
+ strokeLinecap: "round",
809
+ strokeLinejoin: "round"
810
+ }
811
+ ) });
812
+ }
813
+ var focusRingShadow = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
814
+ var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = "sm", isFocusVisible = false }) => {
815
+ const isChecked = isSelected || isIndeterminate;
816
+ const iconPixelSize = size === "sm" ? 10 : 14;
817
+ return /* @__PURE__ */ jsxs(
818
+ "div",
819
+ {
820
+ className: cx(
821
+ "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip border border-solid border-primary",
822
+ size === "sm" ? "size-4 rounded-xs" : "size-5 rounded-sm",
823
+ isChecked ? "border-transparent bg-brand-solid" : "bg-primary",
824
+ !isChecked && !isDisabled && "group-hover:bg-primary_hover",
825
+ isDisabled && "cursor-not-allowed opacity-50",
826
+ isDisabled && !isChecked && "bg-tertiary",
827
+ isFocusVisible && !isDisabled && focusRingShadow,
828
+ className
829
+ ),
830
+ children: [
831
+ isIndeterminate && /* @__PURE__ */ jsx(
832
+ "svg",
833
+ {
834
+ "aria-hidden": "true",
835
+ width: iconPixelSize,
836
+ height: iconPixelSize,
837
+ viewBox: "0 0 14 14",
838
+ fill: "none",
839
+ className: "pointer-events-none block text-fg-white",
840
+ children: /* @__PURE__ */ jsx("path", { d: "M2.91675 7H11.0834", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
841
+ }
842
+ ),
843
+ isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { pixelSize: iconPixelSize, className: "pointer-events-none text-fg-white" })
844
+ ]
845
+ }
846
+ );
847
+ };
848
+ CheckboxBase.displayName = "CheckboxBase";
849
+
850
+ // ../../utils/is-react-component.ts
851
+ var isFunctionComponent = (component) => {
852
+ return typeof component === "function";
853
+ };
854
+ var isClassComponent = (component) => {
855
+ return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
856
+ };
857
+ var isForwardRefComponent = (component) => {
858
+ return typeof component === "object" && component !== null && component.$$typeof.toString() === "Symbol(react.forward_ref)";
859
+ };
860
+ var isReactComponent = (component) => {
861
+ return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
862
+ };
863
+ var sizes4 = {
864
+ sm: {
865
+ root: "p-2 pr-2.5 gap-2 *:data-icon:size-4 *:data-icon:stroke-[2.25px]",
866
+ text: "text-sm",
867
+ textContainer: "gap-x-1.5",
868
+ check: "size-4 stroke-[2.25px]",
869
+ checkbox: "sm"
870
+ },
871
+ md: {
872
+ root: "p-2 pr-2.5 gap-2 *:data-icon:size-5",
873
+ text: "text-md",
874
+ textContainer: "gap-x-2",
875
+ check: "size-5",
876
+ checkbox: "sm"
877
+ },
878
+ lg: {
879
+ root: "p-2.5 pl-2 gap-2 *:data-icon:size-5",
880
+ text: "text-md",
881
+ textContainer: "gap-x-2",
882
+ check: "size-5",
883
+ checkbox: "md"
884
+ }
885
+ };
886
+ var SelectItem = ({
887
+ label,
888
+ id,
889
+ value,
890
+ avatarUrl,
891
+ supportingText,
892
+ isDisabled,
893
+ icon: Icon,
894
+ className,
895
+ children,
896
+ selectionIndicator = "checkmark",
897
+ selectionIndicatorAlign = "right",
898
+ ...props
899
+ }) => {
900
+ const { size } = useContext(SelectContext);
901
+ const labelOrChildren = label || (typeof children === "string" ? children : "");
902
+ const textValue = supportingText ? labelOrChildren + " " + supportingText : labelOrChildren;
903
+ const isLeft = selectionIndicatorAlign === "left";
904
+ return /* @__PURE__ */ jsx(
905
+ ListBoxItem,
906
+ {
907
+ id,
908
+ value: value ?? {
909
+ id,
910
+ label: labelOrChildren,
911
+ avatarUrl,
912
+ supportingText,
913
+ isDisabled,
914
+ icon: Icon
915
+ },
916
+ textValue,
917
+ isDisabled,
918
+ ...props,
919
+ className: (state) => cx("w-full py-px outline-hidden", size === "sm" ? "px-1" : "px-1.5", typeof className === "function" ? className(state) : className),
920
+ children: (state) => /* @__PURE__ */ jsxs(
921
+ "div",
922
+ {
923
+ className: cx(
924
+ "flex cursor-pointer items-center rounded-md outline-hidden select-none",
925
+ (state.isFocused || state.isHovered) && !(state.isSelected && selectionIndicator !== "checkbox") && "bg-primary_hover",
926
+ state.isSelected && selectionIndicator !== "checkbox" && "bg-brand-primary_alt",
927
+ state.isDisabled && "cursor-not-allowed opacity-50",
928
+ // Icon styles
929
+ "*:data-icon:shrink-0 *:data-icon:text-fg-quaternary",
930
+ sizes4[size].root
931
+ ),
932
+ children: [
933
+ isLeft && selectionIndicator === "checkbox" && /* @__PURE__ */ jsx(CheckboxBase, { size: sizes4[size].checkbox, isSelected: state.isSelected, isDisabled: state.isDisabled }),
934
+ avatarUrl ? /* @__PURE__ */ jsx(Avatar, { "aria-hidden": "true", size: "xs", src: avatarUrl, alt: label, className: cx(size === "sm" && "size-5") }) : isReactComponent(Icon) ? /* @__PURE__ */ jsx(Icon, { "data-icon": true, "aria-hidden": "true" }) : isValidElement(Icon) ? Icon : null,
935
+ /* @__PURE__ */ jsxs("div", { className: cx("flex w-full min-w-0 flex-1 flex-wrap", sizes4[size].textContainer), children: [
936
+ /* @__PURE__ */ jsx(Text, { slot: "label", className: cx("truncate font-medium whitespace-nowrap text-primary", sizes4[size].text), children: label || (typeof children === "function" ? children(state) : children) }),
937
+ supportingText && /* @__PURE__ */ jsx(Text, { slot: "description", className: cx("whitespace-nowrap text-tertiary", sizes4[size].text), children: supportingText })
938
+ ] }),
939
+ state.isSelected && selectionIndicator === "checkmark" && /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true", className: cx("ml-auto text-fg-brand-primary", sizes4[size].check) }),
940
+ !isLeft && selectionIndicator === "checkbox" && /* @__PURE__ */ jsx(CheckboxBase, { size: sizes4[size].checkbox, isSelected: state.isSelected, isDisabled: state.isDisabled, className: "ml-auto" })
941
+ ]
942
+ }
943
+ )
944
+ }
945
+ );
946
+ };
947
+ var TagSelectContext = createContext({
948
+ size: "sm",
949
+ selectedKeys: [],
950
+ selectedItems: {},
951
+ onRemove: () => {
952
+ },
953
+ onInputChange: () => {
954
+ }
955
+ });
956
+ var TagSelectBase = ({
957
+ items,
958
+ children,
959
+ size = "sm",
960
+ selectedItems,
961
+ onItemCleared,
962
+ onItemInserted,
963
+ valueFormatter,
964
+ shortcut,
965
+ placeholder = "Search",
966
+ icon,
967
+ // Omit name to avoid conflicts with the `Select` component
968
+ name: _name,
969
+ mobileOptions,
970
+ className,
971
+ ...props
972
+ }) => {
973
+ const { contains } = useFilter({ sensitivity: "base" });
974
+ const selectedKeys = selectedItems.items.map((item) => item.id);
975
+ const filter = useCallback(
976
+ (item, filterText) => {
977
+ return !selectedKeys.includes(item.id) && contains(item.label || item.supportingText || "", filterText);
978
+ },
979
+ [contains, selectedKeys]
980
+ );
981
+ const accessibleList = $232f8dea1b0a4f2f$export$762f73dccccd255d({
982
+ initialItems: items,
983
+ filter
984
+ });
985
+ const onRemove = useCallback(
986
+ (keys) => {
987
+ const key = keys.values().next().value;
988
+ if (!key) return;
989
+ selectedItems.remove(key);
990
+ onItemCleared?.(key);
991
+ },
992
+ [selectedItems, onItemCleared]
993
+ );
994
+ const onSelectionChange = (id) => {
995
+ if (!id) {
996
+ return;
997
+ }
998
+ const item = accessibleList.getItem(id);
999
+ if (!item) {
1000
+ return;
1001
+ }
1002
+ if (!selectedKeys.includes(id)) {
1003
+ selectedItems.append(item);
1004
+ onItemInserted?.(id);
1005
+ }
1006
+ accessibleList.setFilterText("");
1007
+ };
1008
+ const onInputChange = (value) => {
1009
+ accessibleList.setFilterText(value);
1010
+ };
1011
+ const placeholderRef = useRef(null);
1012
+ const [popoverWidth, setPopoverWidth] = useState("");
1013
+ const onResize = useCallback(() => {
1014
+ if (!placeholderRef.current) return;
1015
+ let divRect = placeholderRef.current?.getBoundingClientRect();
1016
+ setPopoverWidth(divRect.width + "px");
1017
+ }, [placeholderRef, setPopoverWidth]);
1018
+ useResizeObserver({
1019
+ ref: placeholderRef,
1020
+ onResize,
1021
+ box: "border-box"
1022
+ });
1023
+ return /* @__PURE__ */ jsx(
1024
+ TagSelectContext.Provider,
1025
+ {
1026
+ value: {
1027
+ size,
1028
+ selectedKeys,
1029
+ selectedItems,
1030
+ onInputChange,
1031
+ onRemove,
1032
+ valueFormatter
1033
+ },
1034
+ children: /* @__PURE__ */ jsx(
1035
+ ComboBox,
1036
+ {
1037
+ allowsEmptyCollection: true,
1038
+ menuTrigger: "focus",
1039
+ items: accessibleList.items,
1040
+ onInputChange,
1041
+ inputValue: accessibleList.filterText,
1042
+ value: null,
1043
+ onChange: onSelectionChange,
1044
+ className: (state) => cx("flex flex-col gap-1.5", typeof className === "function" ? className(state) : className),
1045
+ ...props,
1046
+ children: (state) => /* @__PURE__ */ jsxs(Fragment, { children: [
1047
+ props.label && /* @__PURE__ */ jsx(Label, { isRequired: state.isRequired, tooltip: props.tooltip, children: props.label }),
1048
+ /* @__PURE__ */ jsx(
1049
+ TagSelectTagsValue,
1050
+ {
1051
+ size,
1052
+ shortcut,
1053
+ ref: placeholderRef,
1054
+ placeholder,
1055
+ icon,
1056
+ onFocus: onResize,
1057
+ onPointerEnter: onResize
1058
+ }
1059
+ ),
1060
+ /* @__PURE__ */ jsx(
1061
+ Popover,
1062
+ {
1063
+ size,
1064
+ triggerRef: placeholderRef,
1065
+ style: { width: popoverWidth },
1066
+ className: props?.popoverClassName,
1067
+ mobileOptions: { title: props.label, ...mobileOptions },
1068
+ children: /* @__PURE__ */ jsx(ListBox, { selectionMode: "multiple", className: "size-full outline-hidden", children })
1069
+ }
1070
+ ),
1071
+ props.hint && /* @__PURE__ */ jsx(HintText, { isInvalid: state.isInvalid, className: cx(size === "sm" && "text-xs"), children: props.hint })
1072
+ ] })
1073
+ }
1074
+ )
1075
+ }
1076
+ );
1077
+ };
1078
+ var InnerTagSelect = ({ isDisabled, shortcut, shortcutClassName, placeholder, size = "sm" }) => {
1079
+ const focusManager = useFocusManager();
1080
+ const tagSelectContext = useContext(TagSelectContext);
1081
+ const comboBoxStateContext = useContext(ComboBoxStateContext);
1082
+ const handleInputKeyDown = (event) => {
1083
+ const isCaretAtStart = event.currentTarget.selectionStart === 0 && event.currentTarget.selectionEnd === 0;
1084
+ if (!isCaretAtStart && event.currentTarget.value !== "") {
1085
+ return;
1086
+ }
1087
+ switch (event.key) {
1088
+ case "Backspace":
1089
+ case "ArrowLeft":
1090
+ focusManager?.focusPrevious({ wrap: false, tabbable: false });
1091
+ break;
1092
+ case "ArrowRight":
1093
+ focusManager?.focusNext({ wrap: false, tabbable: false });
1094
+ break;
1095
+ }
1096
+ };
1097
+ const handleInputMouseDown = (_event) => {
1098
+ if (comboBoxStateContext && !comboBoxStateContext.isOpen) {
1099
+ comboBoxStateContext.open();
1100
+ }
1101
+ };
1102
+ const handleTagKeyDown = (event, value) => {
1103
+ if (event.key === "Tab") {
1104
+ return;
1105
+ }
1106
+ event.preventDefault();
1107
+ const isFirstTag = tagSelectContext?.selectedItems?.items?.[0]?.id === value;
1108
+ switch (event.key) {
1109
+ case " ":
1110
+ case "Enter":
1111
+ case "Backspace":
1112
+ if (isFirstTag) {
1113
+ focusManager?.focusNext({ wrap: false, tabbable: false });
1114
+ } else {
1115
+ focusManager?.focusPrevious({ wrap: false, tabbable: false });
1116
+ }
1117
+ tagSelectContext.onRemove(/* @__PURE__ */ new Set([value]));
1118
+ break;
1119
+ case "ArrowLeft":
1120
+ focusManager?.focusPrevious({ wrap: false, tabbable: false });
1121
+ break;
1122
+ case "ArrowRight":
1123
+ focusManager?.focusNext({ wrap: false, tabbable: false });
1124
+ break;
1125
+ case "Escape":
1126
+ comboBoxStateContext?.close();
1127
+ break;
1128
+ }
1129
+ };
1130
+ const isSelectionEmpty = tagSelectContext?.selectedItems?.items?.length === 0;
1131
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex w-full min-w-0 flex-1 flex-row flex-wrap items-center justify-start gap-1.5", children: [
1132
+ !isSelectionEmpty && tagSelectContext?.selectedItems?.items?.map((value) => /* @__PURE__ */ jsxs(
1133
+ "span",
1134
+ {
1135
+ className: cx(
1136
+ "flex min-w-0 items-center rounded-md border border-solid border-primary bg-primary",
1137
+ size === "sm" ? "px-1 py-0.75" : "py-0.5 pr-1 pl-1.25"
1138
+ ),
1139
+ children: [
1140
+ /* @__PURE__ */ jsx(Avatar, { size: "xs", alt: value?.label, src: value?.avatarUrl, className: "size-4" }),
1141
+ /* @__PURE__ */ jsx(
1142
+ "p",
1143
+ {
1144
+ className: cx(
1145
+ "truncate font-medium whitespace-nowrap text-secondary select-none",
1146
+ size === "sm" ? "ml-1 text-xs" : "ml-1.25 text-sm"
1147
+ ),
1148
+ children: tagSelectContext.valueFormatter ? tagSelectContext.valueFormatter(value) : value?.label
1149
+ }
1150
+ ),
1151
+ /* @__PURE__ */ jsx(
1152
+ TagCloseX,
1153
+ {
1154
+ size: size === "sm" ? "sm" : "md",
1155
+ isDisabled,
1156
+ className: "ml-0.75",
1157
+ onKeyDown: (event) => handleTagKeyDown(event, value.id),
1158
+ onPress: () => tagSelectContext.onRemove(/* @__PURE__ */ new Set([value.id]))
1159
+ }
1160
+ )
1161
+ ]
1162
+ },
1163
+ value.id
1164
+ )),
1165
+ /* @__PURE__ */ jsxs("div", { className: cx("relative flex min-w-12 flex-1 flex-row items-center", !isSelectionEmpty && "ml-0.5", shortcut && "min-w-[30%]"), children: [
1166
+ /* @__PURE__ */ jsx(
1167
+ Input,
1168
+ {
1169
+ placeholder,
1170
+ onKeyDown: handleInputKeyDown,
1171
+ onMouseDown: handleInputMouseDown,
1172
+ className: cx(
1173
+ "w-full flex-[1_0_0] appearance-none bg-transparent text-ellipsis text-primary caret-alpha-black/90 outline-hidden placeholder:text-placeholder focus:outline-hidden disabled:cursor-not-allowed",
1174
+ sizes3[size].text
1175
+ )
1176
+ }
1177
+ ),
1178
+ shortcut && /* @__PURE__ */ jsx(
1179
+ "div",
1180
+ {
1181
+ "aria-hidden": "true",
1182
+ className: cx(
1183
+ "absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex",
1184
+ shortcutClassName,
1185
+ sizes3[size].shortcut
1186
+ ),
1187
+ children: /* @__PURE__ */ jsx(
1188
+ "span",
1189
+ {
1190
+ className: cx(
1191
+ "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
1192
+ isDisabled && "bg-transparent"
1193
+ ),
1194
+ children: "\u2318K"
1195
+ }
1196
+ )
1197
+ }
1198
+ )
1199
+ ] })
1200
+ ] });
1201
+ };
1202
+ var TagSelectTagsValue = ({
1203
+ size = "sm",
1204
+ shortcut,
1205
+ placeholder,
1206
+ shortcutClassName,
1207
+ icon: Icon = MagnifyingGlassIcon,
1208
+ // Omit this prop to avoid invalid HTML attribute warning
1209
+ isDisabled: _isDisabled,
1210
+ ...otherProps
1211
+ }) => {
1212
+ const tagSelectContext = useContext(TagSelectContext);
1213
+ const selectedItemsCount = tagSelectContext.selectedKeys.length;
1214
+ return /* @__PURE__ */ jsx(
1215
+ Group,
1216
+ {
1217
+ ...otherProps,
1218
+ className: ({ isFocusWithin, isDisabled, isInvalid }) => cx(
1219
+ "relative flex w-full items-center rounded-lg border border-solid border-primary bg-primary shadow-xs outline-hidden transition-[border-color,box-shadow] duration-100 ease-linear",
1220
+ isDisabled && "cursor-not-allowed opacity-50",
1221
+ !isInvalid && isFocusWithin && inputFocusRingShadow,
1222
+ isInvalid && !isFocusWithin && "border-error_subtle",
1223
+ isInvalid && isFocusWithin && inputErrorFocusRingShadow,
1224
+ // Icon styles
1225
+ "*:data-icon:shrink-0 *:data-icon:text-fg-quaternary",
1226
+ sizes3[size].root,
1227
+ // Overwrite vertical padding for small size when there are selected items
1228
+ // to prevent height jump because the tags are taller than the input text.
1229
+ size === "sm" && selectedItemsCount > 0 && "py-1.5"
1230
+ ),
1231
+ children: ({ isDisabled }) => /* @__PURE__ */ jsxs(Fragment, { children: [
1232
+ Icon && /* @__PURE__ */ jsx(Icon, { "data-icon": true, className: "pointer-events-none" }),
1233
+ /* @__PURE__ */ jsx(FocusScope, { contain: false, autoFocus: false, restoreFocus: false, children: /* @__PURE__ */ jsx(
1234
+ InnerTagSelect,
1235
+ {
1236
+ isDisabled,
1237
+ size,
1238
+ shortcut,
1239
+ shortcutClassName,
1240
+ placeholder
1241
+ }
1242
+ ) })
1243
+ ] })
1244
+ }
1245
+ );
1246
+ };
1247
+ var TagSelect = TagSelectBase;
1248
+ TagSelect.Item = SelectItem;
1249
+
1250
+ export { TagSelect, TagSelectBase, TagSelectTagsValue };
1251
+ //# sourceMappingURL=tag-select.js.map
1252
+ //# sourceMappingURL=tag-select.js.map