@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,1163 @@
1
+ import { createContext, useState, isValidElement, useMemo, useContext, useEffect, useCallback, useLayoutEffect, useRef } from 'react';
2
+ import { CaretDownIcon } from '@phosphor-icons/react/dist/csr/CaretDown';
3
+ import { PlusIcon } from '@phosphor-icons/react/dist/csr/Plus';
4
+ import { MagnifyingGlassIcon } from '@phosphor-icons/react/dist/csr/MagnifyingGlass';
5
+ import { useFilter, MenuTrigger, Autocomplete, SearchField, SubmenuTrigger, Link, Button as Button$1, OverlayTriggerStateContext, Popover, Group, Input, Menu, MenuItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, OverlayArrow } from 'react-aria-components';
6
+ import { extendTailwindMerge } from 'tailwind-merge';
7
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
+ import { createPortal } from 'react-dom';
9
+ import { CheckIcon } from '@phosphor-icons/react/dist/csr/Check';
10
+ import { CaretRightIcon } from '@phosphor-icons/react/dist/csr/CaretRight';
11
+ import '@phosphor-icons/react/dist/csr/DotsThreeVertical';
12
+ import { XIcon } from '@phosphor-icons/react/dist/csr/X';
13
+ import { UserIcon } from '@phosphor-icons/react/dist/csr/User';
14
+ import { EyeIcon } from '@phosphor-icons/react/dist/csr/Eye';
15
+ import { EyeSlashIcon } from '@phosphor-icons/react/dist/csr/EyeSlash';
16
+ import { QuestionIcon } from '@phosphor-icons/react/dist/csr/Question';
17
+ import { InfoIcon } from '@phosphor-icons/react/dist/csr/Info';
18
+
19
+ var twMerge = extendTailwindMerge({
20
+ extend: {
21
+ theme: {
22
+ text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
23
+ }
24
+ }
25
+ });
26
+ var cx = twMerge;
27
+ function sortCx(classes) {
28
+ return classes;
29
+ }
30
+
31
+ // ../../utils/is-react-component.ts
32
+ var isFunctionComponent = (component) => {
33
+ return typeof component === "function";
34
+ };
35
+ var isClassComponent = (component) => {
36
+ return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
37
+ };
38
+ var isForwardRefComponent = (component) => {
39
+ return typeof component === "object" && component !== null && component.$$typeof.toString() === "Symbol(react.forward_ref)";
40
+ };
41
+ var isReactComponent = (component) => {
42
+ return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
43
+ };
44
+ 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)]";
45
+ var focusShadowSkeuomorphic = "focus-visible:outline-none focus-visible:[box-shadow:var(--shadow-xs-skeuomorphic),0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
46
+ var skeuomorphicGradientBorderClass = [
47
+ "ring-1 ring-inset ring-transparent",
48
+ "before:pointer-events-none before:absolute before:inset-px before:rounded-[inherit] before:border before:border-[#ffffff1f] before:content-['']",
49
+ "before:[mask-image:linear-gradient(to_bottom,#000,transparent)]"
50
+ ].join(" ");
51
+ var skeuomorphicShadowClass = ["shadow-xs-skeuomorphic", focusShadowSkeuomorphic, "overflow-hidden"].join(" ");
52
+ var focusShadowSecondary = "focus-visible:outline-none focus-visible:[box-shadow:0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
53
+ var secondaryInnerShadow = "after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:content-[''] after:[box-shadow:inset_0px_-1px_0px_0px_rgba(0,0,0,0.05)]";
54
+ var secondaryShadowClass = ["relative overflow-hidden shadow-xs", secondaryInnerShadow, focusShadowSecondary].join(" ");
55
+ var inputNumberButtonClass = [
56
+ "in-data-number-input:border-0 in-data-number-input:shadow-none in-data-number-input:!rounded-none in-data-number-input:!h-full in-data-number-input:!min-h-0 in-data-number-input:self-stretch in-data-number-input:overflow-hidden",
57
+ "in-data-number-input:before:hidden in-data-number-input:after:hidden",
58
+ "in-data-number-input:focus-visible:outline-none in-data-number-input:focus-visible:shadow-none in-data-number-input:focus-visible:ring-0 in-data-number-input:focus-visible:![box-shadow:none]"
59
+ ].join(" ");
60
+ var inputAddonButtonClass = [
61
+ "in-data-input-wrapper:border-0 in-data-input-wrapper:shadow-none in-data-input-wrapper:!rounded-none in-data-input-wrapper:overflow-hidden",
62
+ "in-data-input-wrapper:in-data-trailing:border-l in-data-input-wrapper:in-data-trailing:border-solid in-data-input-wrapper:in-data-trailing:border-primary",
63
+ "in-data-input-wrapper:in-data-leading:border-r in-data-input-wrapper:in-data-leading:border-solid in-data-input-wrapper:in-data-leading:border-primary",
64
+ "in-data-input-wrapper:group-invalid:in-data-trailing:border-error_subtle in-data-input-wrapper:group-invalid:in-data-leading:border-error_subtle",
65
+ "in-data-input-wrapper:before:hidden in-data-input-wrapper:after:hidden",
66
+ "in-data-input-wrapper:focus-visible:outline-none in-data-input-wrapper:focus-visible:shadow-none in-data-input-wrapper:focus-visible:ring-0 in-data-input-wrapper:focus-visible:![box-shadow:none]"
67
+ ].join(" ");
68
+ var styles = sortCx({
69
+ common: {
70
+ root: [
71
+ "group relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-full font-body outline-none before:absolute",
72
+ "font-semibold transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out",
73
+ "pressed:scale-[0.985] pressed:duration-100 pressed:ease-linear motion-reduce:pressed:scale-100",
74
+ "disabled:pointer-events-none disabled:cursor-not-allowed in-data-input-wrapper:disabled:opacity-100",
75
+ inputAddonButtonClass,
76
+ inputNumberButtonClass,
77
+ // Stretch to InputGroup row height; padding/typography follow `data-input-size` on the field (Figma 85:1269).
78
+ "in-data-input-wrapper:!h-full in-data-input-wrapper:!min-h-0 in-data-input-wrapper:self-stretch",
79
+ "in-data-input-wrapper:in-data-[input-size=sm]:gap-1 in-data-input-wrapper:in-data-[input-size=sm]:px-3 in-data-input-wrapper:in-data-[input-size=sm]:py-2 in-data-input-wrapper:in-data-[input-size=sm]:text-sm",
80
+ "in-data-input-wrapper:in-data-[input-size=md]:gap-1 in-data-input-wrapper:in-data-[input-size=md]:px-3.5 in-data-input-wrapper:in-data-[input-size=md]:py-2.5 in-data-input-wrapper:in-data-[input-size=md]:text-sm",
81
+ "in-data-input-wrapper:in-data-[input-size=lg]:gap-1.5 in-data-input-wrapper:in-data-[input-size=lg]:px-4 in-data-input-wrapper:in-data-[input-size=lg]:py-2.5 in-data-input-wrapper:in-data-[input-size=lg]:text-md",
82
+ "*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:transition-inherit-all"
83
+ ].join(" "),
84
+ icon: "pointer-events-none shrink-0 transition-inherit-all"
85
+ },
86
+ sizes: {
87
+ xs: {
88
+ root: [
89
+ "h-8 min-h-8 gap-1 px-[0.625rem] py-1.5 text-sm data-icon-only:size-8 data-icon-only:min-h-8 data-icon-only:min-w-8 data-icon-only:p-2",
90
+ "in-data-input-wrapper:data-icon-only:p-2.5",
91
+ "*:data-icon:size-4"
92
+ ].join(" "),
93
+ linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
94
+ },
95
+ sm: {
96
+ root: [
97
+ "h-9 min-h-9 gap-1 px-3 py-2 text-sm data-icon-only:size-9 data-icon-only:min-h-9 data-icon-only:min-w-9 data-icon-only:p-2",
98
+ "in-data-input-wrapper:data-icon-only:p-2.5",
99
+ "*:data-icon:size-5"
100
+ ].join(" "),
101
+ linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
102
+ },
103
+ md: {
104
+ root: [
105
+ "h-10 min-h-10 gap-1 px-3.5 py-2.5 text-sm data-icon-only:size-10 data-icon-only:min-h-10 data-icon-only:min-w-10 data-icon-only:p-2.5",
106
+ "in-data-input-wrapper:data-icon-only:p-3",
107
+ "*:data-icon:size-5"
108
+ ].join(" "),
109
+ linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-4"
110
+ },
111
+ lg: {
112
+ root: "h-11 min-h-11 gap-1.5 px-4 py-2.5 text-md data-icon-only:size-11 data-icon-only:min-h-11 data-icon-only:min-w-11 data-icon-only:p-3 *:data-icon:size-5",
113
+ linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
114
+ },
115
+ xl: {
116
+ root: "h-12 min-h-12 gap-1.5 px-[1.125rem] py-3 text-md data-icon-only:size-12 data-icon-only:min-h-12 data-icon-only:min-w-12 data-icon-only:p-3 data-icon-only:*:data-icon:size-6 *:data-icon:size-5",
117
+ linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
118
+ }
119
+ },
120
+ colors: {
121
+ /** Figma Hierarchy=Primary — dark neutral solid; hover lightens to fg-tertiary_hover (#404040). */
122
+ primary: {
123
+ root: [
124
+ "bg-primary-solid text-white",
125
+ skeuomorphicShadowClass,
126
+ skeuomorphicGradientBorderClass,
127
+ "hover:bg-fg-tertiary_hover dark:hover:bg-quaternary",
128
+ "disabled:opacity-30",
129
+ "data-loading:bg-fg-tertiary_hover dark:data-loading:bg-quaternary",
130
+ "*:data-icon:not([data-icon=loading]):text-white/70"
131
+ ].join(" ")
132
+ },
133
+ /** Figma Hierarchy=Brand — purple solid; hover darkens to bg-brand-solid_hover (#6d28d9). */
134
+ brand: {
135
+ root: [
136
+ "bg-brand-solid text-primary_on-brand",
137
+ skeuomorphicShadowClass,
138
+ skeuomorphicGradientBorderClass,
139
+ "hover:bg-brand-solid_hover",
140
+ "disabled:opacity-50",
141
+ "data-loading:bg-brand-solid_hover",
142
+ "*:data-icon:not([data-icon=loading]):text-primary_on-brand"
143
+ ].join(" ")
144
+ },
145
+ /** Figma Hierarchy=Secondary — border-primary + shadow-xs + skeuomorphic inner rim overlay. */
146
+ secondary: {
147
+ root: [
148
+ "border border-solid border-primary bg-primary text-secondary",
149
+ secondaryShadowClass,
150
+ "hover:bg-primary_hover hover:text-secondary_hover",
151
+ "disabled:opacity-50",
152
+ "data-loading:bg-primary_hover",
153
+ "*:data-icon:text-fg-secondary hover:*:data-icon:text-fg-quaternary_hover"
154
+ ].join(" ")
155
+ },
156
+ /** Figma Hierarchy=Tertiary */
157
+ tertiary: {
158
+ root: [
159
+ "border border-transparent bg-transparent text-tertiary",
160
+ focusShadowPlain,
161
+ "hover:bg-primary_hover hover:text-tertiary_hover",
162
+ "disabled:opacity-50",
163
+ "*:data-icon:text-fg-tertiary hover:*:data-icon:text-fg-quaternary_hover"
164
+ ].join(" ")
165
+ },
166
+ /** Figma Hierarchy=Link color — text + icons share brand-secondary; hover underlines with fg-brand-secondary. */
167
+ "link-color": {
168
+ root: [
169
+ "h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-brand-secondary shadow-none",
170
+ focusShadowPlain,
171
+ "hover:text-brand-secondary_hover",
172
+ "disabled:opacity-50",
173
+ "*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-brand-secondary"
174
+ ].join(" ")
175
+ },
176
+ /** Figma Hierarchy=Link gray — text + icons share tertiary; hover underlines with fg-quaternary. */
177
+ "link-gray": {
178
+ root: [
179
+ "h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-tertiary shadow-none",
180
+ focusShadowPlain,
181
+ "hover:text-tertiary_hover",
182
+ "disabled:opacity-50",
183
+ "*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-quaternary"
184
+ ].join(" ")
185
+ },
186
+ "primary-destructive": {
187
+ root: [
188
+ "bg-error-solid text-white",
189
+ skeuomorphicShadowClass,
190
+ skeuomorphicGradientBorderClass,
191
+ "hover:bg-error-solid_hover",
192
+ "disabled:opacity-50",
193
+ "data-loading:bg-error-solid_hover",
194
+ "*:data-icon:not([data-icon=loading]):text-white/70"
195
+ ].join(" ")
196
+ },
197
+ "secondary-destructive": {
198
+ root: [
199
+ "border border-solid border-primary bg-primary text-error-primary",
200
+ secondaryShadowClass,
201
+ "hover:bg-error-primary hover:text-error-primary_hover",
202
+ "disabled:opacity-50",
203
+ "data-loading:bg-error-primary",
204
+ "*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
205
+ ].join(" ")
206
+ },
207
+ "tertiary-destructive": {
208
+ root: [
209
+ "border border-transparent bg-transparent text-error-primary",
210
+ focusShadowPlain,
211
+ "hover:bg-error-primary hover:text-error-primary_hover",
212
+ "disabled:opacity-50",
213
+ "*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
214
+ ].join(" ")
215
+ },
216
+ /** Figma Hierarchy=Link (destructive) — text + icons share error-primary; hover underlines. */
217
+ "link-destructive": {
218
+ root: [
219
+ "h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-error-primary shadow-none",
220
+ focusShadowPlain,
221
+ "hover:text-error-primary_hover",
222
+ "disabled:opacity-50",
223
+ "*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-current"
224
+ ].join(" ")
225
+ }
226
+ }
227
+ });
228
+ var Button = ({
229
+ size = "md",
230
+ color = "primary",
231
+ children,
232
+ className,
233
+ noTextPadding,
234
+ iconLeading: IconLeading,
235
+ iconTrailing: IconTrailing,
236
+ isDisabled: disabled,
237
+ isLoading: loading,
238
+ showTextWhileLoading,
239
+ ...props
240
+ }) => {
241
+ const href = "href" in props ? props.href : void 0;
242
+ const isIcon = (IconLeading || IconTrailing) && !children;
243
+ const isLinkType = ["link-gray", "link-color", "link-destructive"].includes(color);
244
+ noTextPadding = isLinkType || noTextPadding;
245
+ const commonChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
246
+ isValidElement(IconLeading) && IconLeading,
247
+ isReactComponent(IconLeading) && /* @__PURE__ */ jsx(IconLeading, { "data-icon": "leading", className: styles.common.icon }),
248
+ loading && /* @__PURE__ */ jsx(
249
+ "svg",
250
+ {
251
+ fill: "none",
252
+ "data-icon": "loading",
253
+ viewBox: "0 0 256 256",
254
+ "aria-hidden": true,
255
+ className: cx(
256
+ styles.common.icon,
257
+ "size-5 animate-spin",
258
+ !showTextWhileLoading && "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
259
+ ),
260
+ children: /* @__PURE__ */ jsx(
261
+ "path",
262
+ {
263
+ fill: "currentColor",
264
+ d: "M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60,61.46,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20-66.54-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"
265
+ }
266
+ )
267
+ }
268
+ ),
269
+ children && /* @__PURE__ */ jsx("span", { "data-text": true, className: cx("transition-inherit-all", !noTextPadding && !isLinkType && "px-0.5"), children }),
270
+ isValidElement(IconTrailing) && IconTrailing,
271
+ isReactComponent(IconTrailing) && /* @__PURE__ */ jsx(IconTrailing, { "data-icon": "trailing", className: styles.common.icon })
272
+ ] });
273
+ const commonProps = {
274
+ "data-icon-only": isIcon ? true : void 0,
275
+ "data-loading": loading ? true : void 0,
276
+ ...props,
277
+ isDisabled: disabled || loading,
278
+ className: cx(
279
+ styles.common.root,
280
+ styles.sizes[size].root,
281
+ styles.colors[color].root,
282
+ isLinkType && styles.sizes[size].linkRoot,
283
+ (loading || href && (disabled || loading)) && "pointer-events-none",
284
+ loading && (showTextWhileLoading ? "[&>*:not([data-icon=loading]):not([data-text])]:hidden" : "[&>*:not([data-icon=loading])]:invisible"),
285
+ className
286
+ ),
287
+ children: commonChildren
288
+ };
289
+ if ("href" in commonProps) {
290
+ return /* @__PURE__ */ jsx(Link, { ...commonProps, href: disabled || loading ? void 0 : href });
291
+ }
292
+ return /* @__PURE__ */ jsx(Button$1, { ...commonProps, type: commonProps.type || "button", isPending: loading });
293
+ };
294
+ var MOBILE_SHEET_MOTION_MS = 175;
295
+ var MOBILE_SHEET_ENTRY_EASING = "cubic-bezier(0.85, 0, 0.15, 1)";
296
+ var MOBILE_SHEET_EXIT_EASING = "cubic-bezier(0.85, 0, 1, 0.15)";
297
+ var MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX = 120;
298
+ function resolveSelectMobileOptions(mobileOptions) {
299
+ return {
300
+ sheet: mobileOptions?.sheet ?? true,
301
+ title: mobileOptions?.title,
302
+ sheetClassName: mobileOptions?.className,
303
+ contentClassName: mobileOptions?.contentClassName
304
+ };
305
+ }
306
+ function useMobileSheetAnimation(open, enabled, slideEntrance = true, slideOffsetPx = MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX) {
307
+ const [shouldRender, setShouldRender] = useState(open);
308
+ const [isAnimating, setIsAnimating] = useState(false);
309
+ useLayoutEffect(() => {
310
+ if (!enabled) {
311
+ setShouldRender(open);
312
+ return;
313
+ }
314
+ if (open) {
315
+ setShouldRender(true);
316
+ }
317
+ }, [open, enabled]);
318
+ useEffect(() => {
319
+ if (!enabled || open) return;
320
+ const timer = setTimeout(() => setShouldRender(false), MOBILE_SHEET_MOTION_MS);
321
+ return () => clearTimeout(timer);
322
+ }, [open, enabled]);
323
+ useLayoutEffect(() => {
324
+ if (!enabled || open || !shouldRender) return;
325
+ setIsAnimating(false);
326
+ }, [enabled, open, shouldRender]);
327
+ useEffect(() => {
328
+ if (!enabled || !shouldRender || !open) return;
329
+ let raf2 = 0;
330
+ const raf1 = requestAnimationFrame(() => {
331
+ raf2 = requestAnimationFrame(() => setIsAnimating(true));
332
+ });
333
+ return () => {
334
+ cancelAnimationFrame(raf1);
335
+ if (raf2) cancelAnimationFrame(raf2);
336
+ };
337
+ }, [shouldRender, open, enabled]);
338
+ const motionEasing = open ? MOBILE_SHEET_ENTRY_EASING : MOBILE_SHEET_EXIT_EASING;
339
+ const hiddenTransform = slideEntrance ? `translateY(${slideOffsetPx}px)` : "translateY(100%)";
340
+ const panelStyle = enabled ? {
341
+ transform: isAnimating ? "translateY(0)" : hiddenTransform,
342
+ opacity: isAnimating ? 1 : 0,
343
+ transitionProperty: "transform, opacity",
344
+ transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
345
+ transitionTimingFunction: motionEasing
346
+ } : void 0;
347
+ const backdropStyle = enabled ? {
348
+ opacity: isAnimating ? 1 : 0,
349
+ transitionProperty: "opacity",
350
+ transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
351
+ transitionTimingFunction: motionEasing
352
+ } : void 0;
353
+ return { shouldRender, isAnimating, panelStyle, backdropStyle };
354
+ }
355
+ var MOBILE_SHEET_MAX_PX = 1024;
356
+ function useIsMobile(breakpoint = MOBILE_SHEET_MAX_PX + 1) {
357
+ const [isMobile, setIsMobile] = useState(() => {
358
+ if (typeof window === "undefined") return false;
359
+ return window.matchMedia(`(max-width: ${breakpoint - 1}px)`).matches;
360
+ });
361
+ useEffect(() => {
362
+ const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
363
+ const handler = (e) => setIsMobile(e.matches);
364
+ mq.addEventListener("change", handler);
365
+ return () => mq.removeEventListener("change", handler);
366
+ }, [breakpoint]);
367
+ return isMobile;
368
+ }
369
+ var Tooltip = ({
370
+ title,
371
+ description,
372
+ children,
373
+ arrow = false,
374
+ delay = 100,
375
+ closeDelay = 0,
376
+ trigger,
377
+ isDisabled,
378
+ isOpen,
379
+ defaultOpen,
380
+ offset = 6,
381
+ crossOffset,
382
+ placement = "top",
383
+ onOpenChange,
384
+ ...tooltipProps
385
+ }) => {
386
+ const isTopOrBottomLeft = ["top left", "top end", "bottom left", "bottom end"].includes(placement);
387
+ const isTopOrBottomRight = ["top right", "top start", "bottom right", "bottom start"].includes(placement);
388
+ const calculatedCrossOffset = isTopOrBottomLeft ? -12 : isTopOrBottomRight ? 12 : 0;
389
+ return /* @__PURE__ */ jsxs(TooltipTrigger$1, { ...{ trigger, delay, closeDelay, isDisabled, isOpen, defaultOpen, onOpenChange }, children: [
390
+ children,
391
+ /* @__PURE__ */ jsx(
392
+ Tooltip$1,
393
+ {
394
+ ...tooltipProps,
395
+ offset,
396
+ placement,
397
+ crossOffset: crossOffset ?? calculatedCrossOffset,
398
+ className: ({ isEntering, isExiting }) => cx(isEntering && "ease-out animate-in", isExiting && "ease-in animate-out"),
399
+ children: ({ isEntering, isExiting }) => /* @__PURE__ */ jsxs(
400
+ "div",
401
+ {
402
+ className: cx(
403
+ "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",
404
+ description ? "py-3" : "py-2",
405
+ 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",
406
+ 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"
407
+ ),
408
+ children: [
409
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-white", children: title }),
410
+ description && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: description }),
411
+ arrow && /* @__PURE__ */ jsx(OverlayArrow, { children: /* @__PURE__ */ jsx(
412
+ "svg",
413
+ {
414
+ viewBox: "0 0 100 100",
415
+ 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",
416
+ children: /* @__PURE__ */ jsx("path", { d: "M0,0 L35.858,35.858 Q50,50 64.142,35.858 L100,0 Z" })
417
+ }
418
+ ) })
419
+ ]
420
+ }
421
+ )
422
+ }
423
+ )
424
+ ] });
425
+ };
426
+ var TooltipTrigger = ({ children, className, ...buttonProps }) => {
427
+ return /* @__PURE__ */ jsx(Button$1, { ...buttonProps, className: (values) => cx("h-max w-max outline-hidden", typeof className === "function" ? className(values) : className), children });
428
+ };
429
+ var sizes = {
430
+ xs: "size-1.5",
431
+ sm: "size-2",
432
+ md: "size-2.5",
433
+ lg: "size-3",
434
+ xl: "size-3.5",
435
+ "2xl": "size-4",
436
+ "3xl": "size-4.5",
437
+ "4xl": "size-5"
438
+ };
439
+ var AvatarOnlineIndicator = ({ size, status, className }) => /* @__PURE__ */ jsx(
440
+ "span",
441
+ {
442
+ className: cx(
443
+ "absolute right-0 bottom-0 flex justify-center rounded-full ring-[1.5px] ring-bg-primary",
444
+ status === "online" ? "bg-fg-success-secondary" : "bg-utility-neutral-300",
445
+ sizes[size],
446
+ className
447
+ ),
448
+ style: {
449
+ 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%)"
450
+ },
451
+ children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 7.2 2.85", fill: "none", className: "mt-[10%] h-[20%] w-[60%]", children: [
452
+ /* @__PURE__ */ jsx(
453
+ "path",
454
+ {
455
+ 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",
456
+ fill: "url(#reflection-gradient)",
457
+ fillOpacity: "0.4"
458
+ }
459
+ ),
460
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "reflection-gradient", x1: "3.6", y1: "0", x2: "3.6", y2: "2.4", gradientUnits: "userSpaceOnUse", children: [
461
+ /* @__PURE__ */ jsx("stop", { stopColor: "white" }),
462
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.1" })
463
+ ] }) })
464
+ ] })
465
+ }
466
+ );
467
+ var sizes2 = {
468
+ xs: "size-2.5",
469
+ sm: "size-3",
470
+ md: "size-3.5",
471
+ lg: "size-4",
472
+ xl: "size-4.5",
473
+ "2xl": "size-5",
474
+ "3xl": "size-6",
475
+ "4xl": "size-8"
476
+ };
477
+ 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: [
478
+ /* @__PURE__ */ jsx(
479
+ "path",
480
+ {
481
+ 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",
482
+ className: "fill-current"
483
+ }
484
+ ),
485
+ /* @__PURE__ */ jsx(
486
+ "path",
487
+ {
488
+ fillRule: "evenodd",
489
+ clipRule: "evenodd",
490
+ 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",
491
+ fill: "white"
492
+ }
493
+ )
494
+ ] });
495
+ 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 }) });
496
+ var styles2 = {
497
+ xs: { root: "size-6", rootWithBorder: "p-px", initials: "text-xs font-semibold", icon: "size-4" },
498
+ sm: { root: "size-8", rootWithBorder: "p-px", initials: "text-sm font-semibold", icon: "size-5" },
499
+ md: { root: "size-10", rootWithBorder: "p-px", initials: "text-md font-semibold", icon: "size-6" },
500
+ lg: { root: "size-12", rootWithBorder: "p-[1.5px]", initials: "text-lg font-semibold", icon: "size-7" },
501
+ xl: { root: "size-14", rootWithBorder: "p-0.5", initials: "text-xl font-semibold", icon: "size-8" },
502
+ "2xl": { root: "size-16", rootWithBorder: "p-0.5", initials: "text-display-xs font-semibold", icon: "size-8" }
503
+ };
504
+ var Avatar = ({
505
+ size = "md",
506
+ src,
507
+ alt,
508
+ initials,
509
+ placeholder,
510
+ placeholderIcon: PlaceholderIcon,
511
+ border,
512
+ badge,
513
+ status,
514
+ verified,
515
+ count,
516
+ focusable = false,
517
+ rounded = true,
518
+ className,
519
+ contentClassName
520
+ }) => {
521
+ const [isFailed, setIsFailed] = useState(false);
522
+ const canShowImage = src && !isFailed;
523
+ const renderMainContent = () => {
524
+ if (canShowImage) {
525
+ return /* @__PURE__ */ jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src, alt, onError: () => setIsFailed(true) });
526
+ }
527
+ if (initials) {
528
+ return /* @__PURE__ */ jsx("span", { className: cx("text-quaternary", styles2[size].initials), children: initials });
529
+ }
530
+ if (PlaceholderIcon) {
531
+ return /* @__PURE__ */ jsx(PlaceholderIcon, { className: cx("text-fg-quaternary", styles2[size].icon) });
532
+ }
533
+ return placeholder || /* @__PURE__ */ jsx(UserIcon, { className: cx("text-fg-quaternary", styles2[size].icon) });
534
+ };
535
+ const renderBadgeContent = () => {
536
+ if (status) {
537
+ return /* @__PURE__ */ jsx(AvatarOnlineIndicator, { status, size });
538
+ }
539
+ if (verified) {
540
+ return /* @__PURE__ */ jsx(VerifiedTick, { size, className: cx("absolute right-0 bottom-0", size === "xs" && "-right-px -bottom-px") });
541
+ }
542
+ if (count) {
543
+ return /* @__PURE__ */ jsx(AvatarCount, { count });
544
+ }
545
+ return badge;
546
+ };
547
+ return /* @__PURE__ */ jsxs(
548
+ "div",
549
+ {
550
+ "data-avatar": true,
551
+ className: cx(
552
+ "relative inline-flex shrink-0 rounded-[7px]",
553
+ rounded && "rounded-full",
554
+ // Focus styles
555
+ focusable && "outline-none group-focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
556
+ border && "ring-1 ring-secondary_alt",
557
+ border && styles2[size].rootWithBorder,
558
+ styles2[size].root,
559
+ className
560
+ ),
561
+ children: [
562
+ /* @__PURE__ */ jsx(
563
+ "div",
564
+ {
565
+ className: cx(
566
+ "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]",
567
+ rounded && "rounded-full",
568
+ 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%)]",
569
+ contentClassName
570
+ ),
571
+ children: renderMainContent()
572
+ }
573
+ ),
574
+ renderBadgeContent()
575
+ ]
576
+ }
577
+ );
578
+ };
579
+ var CHECKBOX_TICK_DELAY_MS = 60;
580
+ var CHECKBOX_TICK_DRAW_MS = 100;
581
+ function CheckboxAnimatedCheckMark({ pixelSize, className }) {
582
+ const pathRef = useRef(null);
583
+ useLayoutEffect(() => {
584
+ const path = pathRef.current;
585
+ if (!path || typeof path.getTotalLength !== "function") return;
586
+ const len = path.getTotalLength();
587
+ if (len <= 0) return;
588
+ path.style.strokeDasharray = `${len}`;
589
+ path.style.strokeDashoffset = `${len}`;
590
+ if (typeof path.animate !== "function") {
591
+ path.style.strokeDashoffset = "0";
592
+ return;
593
+ }
594
+ const anim = path.animate([{ strokeDashoffset: len }, { strokeDashoffset: 0 }], {
595
+ duration: CHECKBOX_TICK_DRAW_MS,
596
+ delay: CHECKBOX_TICK_DELAY_MS,
597
+ easing: "cubic-bezier(0.45, 0, 0.2, 1)",
598
+ fill: "forwards"
599
+ });
600
+ return () => anim.cancel();
601
+ }, []);
602
+ 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(
603
+ "path",
604
+ {
605
+ ref: pathRef,
606
+ d: "M2.33325 7L5.24992 9.91667L11.6666 3.5",
607
+ stroke: "currentColor",
608
+ strokeWidth: "2",
609
+ strokeLinecap: "round",
610
+ strokeLinejoin: "round"
611
+ }
612
+ ) });
613
+ }
614
+ var focusRingShadow = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
615
+ var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = "sm", isFocusVisible = false }) => {
616
+ const isChecked = isSelected || isIndeterminate;
617
+ const iconPixelSize = size === "sm" ? 10 : 14;
618
+ return /* @__PURE__ */ jsxs(
619
+ "div",
620
+ {
621
+ className: cx(
622
+ "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip border border-solid border-primary",
623
+ size === "sm" ? "size-4 rounded-xs" : "size-5 rounded-sm",
624
+ isChecked ? "border-transparent bg-brand-solid" : "bg-primary",
625
+ !isChecked && !isDisabled && "group-hover:bg-primary_hover",
626
+ isDisabled && "cursor-not-allowed opacity-50",
627
+ isDisabled && !isChecked && "bg-tertiary",
628
+ isFocusVisible && !isDisabled && focusRingShadow,
629
+ className
630
+ ),
631
+ children: [
632
+ isIndeterminate && /* @__PURE__ */ jsx(
633
+ "svg",
634
+ {
635
+ "aria-hidden": "true",
636
+ width: iconPixelSize,
637
+ height: iconPixelSize,
638
+ viewBox: "0 0 14 14",
639
+ fill: "none",
640
+ className: "pointer-events-none block text-fg-white",
641
+ children: /* @__PURE__ */ jsx("path", { d: "M2.91675 7H11.0834", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
642
+ }
643
+ ),
644
+ isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { pixelSize: iconPixelSize, className: "pointer-events-none text-fg-white" })
645
+ ]
646
+ }
647
+ );
648
+ };
649
+ CheckboxBase.displayName = "CheckboxBase";
650
+ var RADIO_DOT_DELAY_MS = 60;
651
+ var RADIO_DOT_POP_MS = 100;
652
+ function RadioAnimatedDot({ className }) {
653
+ const dotRef = useRef(null);
654
+ useLayoutEffect(() => {
655
+ const dot = dotRef.current;
656
+ if (!dot) return;
657
+ if (typeof dot.animate !== "function") {
658
+ dot.style.opacity = "1";
659
+ dot.style.transform = "scale(1)";
660
+ return;
661
+ }
662
+ const anim = dot.animate(
663
+ [
664
+ { opacity: 0, transform: "scale(0)" },
665
+ { opacity: 1, transform: "scale(1)" }
666
+ ],
667
+ {
668
+ duration: RADIO_DOT_POP_MS,
669
+ delay: RADIO_DOT_DELAY_MS,
670
+ easing: "cubic-bezier(0.45, 0, 0.2, 1)",
671
+ fill: "forwards"
672
+ }
673
+ );
674
+ return () => anim.cancel();
675
+ }, []);
676
+ return /* @__PURE__ */ jsx("div", { ref: dotRef, "aria-hidden": "true", className: cx("rounded-full bg-fg-white", className), style: { opacity: 0, transform: "scale(0)" } });
677
+ }
678
+ var focusRingShadow2 = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
679
+ createContext(null);
680
+ var RadioButtonBase = ({ className, isFocusVisible, isSelected, isDisabled, size = "sm" }) => {
681
+ const dotClassName = size === "sm" ? "size-1.5" : "size-2";
682
+ return /* @__PURE__ */ jsx(
683
+ "div",
684
+ {
685
+ className: cx(
686
+ "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip rounded-full border border-solid border-primary bg-primary",
687
+ size === "sm" ? "size-4" : "size-5",
688
+ isSelected && "border-transparent bg-brand-solid",
689
+ !isSelected && !isDisabled && "group-hover:bg-primary_hover",
690
+ isDisabled && "cursor-not-allowed opacity-50",
691
+ isDisabled && !isSelected && "bg-tertiary",
692
+ isFocusVisible && !isDisabled && focusRingShadow2,
693
+ className
694
+ ),
695
+ children: isSelected && /* @__PURE__ */ jsx(RadioAnimatedDot, { className: cx("pointer-events-none", dotClassName) })
696
+ }
697
+ );
698
+ };
699
+ RadioButtonBase.displayName = "RadioButtonBase";
700
+ var focusRingShadow3 = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
701
+ var ToggleBase = ({ className, isHovered, isDisabled, isFocusVisible, isSelected, slim, size = "sm" }) => {
702
+ const styles3 = {
703
+ default: {
704
+ sm: {
705
+ track: "h-5 w-9 p-0.5",
706
+ thumb: "size-4",
707
+ thumbPosition: isSelected ? "left-[calc(100%-1rem-0.125rem)]" : "left-0.5"
708
+ },
709
+ md: {
710
+ track: "h-6 w-11 p-0.5",
711
+ thumb: "size-5",
712
+ thumbPosition: isSelected ? "left-[calc(100%-1.25rem-0.125rem)]" : "left-0.5"
713
+ }
714
+ },
715
+ slim: {
716
+ sm: {
717
+ track: "h-4 w-8",
718
+ thumb: "size-4",
719
+ thumbPosition: isSelected ? "left-4" : "left-0"
720
+ },
721
+ md: {
722
+ track: "h-5 w-10",
723
+ thumb: "size-5",
724
+ thumbPosition: isSelected ? "left-5" : "left-0"
725
+ }
726
+ }
727
+ };
728
+ const classes = slim ? styles3.slim[size] : styles3.default[size];
729
+ const offTrackBackground = (() => {
730
+ if (isDisabled) return "bg-tertiary";
731
+ if (isHovered) return "bg-secondary_hover";
732
+ return "bg-quaternary";
733
+ })();
734
+ return /* @__PURE__ */ jsx(
735
+ "div",
736
+ {
737
+ className: cx(
738
+ "relative inline-flex shrink-0 cursor-pointer overflow-clip rounded-full outline-none transition duration-150 ease-linear",
739
+ !isSelected && offTrackBackground,
740
+ !slim && "ring-[0.5px] ring-secondary ring-inset",
741
+ slim && "ring-1 ring-secondary ring-inset",
742
+ isSelected && "bg-brand-solid",
743
+ isSelected && isHovered && "bg-brand-solid_hover",
744
+ isSelected && "ring-transparent",
745
+ isDisabled && "cursor-not-allowed opacity-50",
746
+ isFocusVisible && !isDisabled && focusRingShadow3,
747
+ classes.track,
748
+ className
749
+ ),
750
+ children: /* @__PURE__ */ jsx(
751
+ "div",
752
+ {
753
+ className: cx(
754
+ "absolute rounded-full bg-fg-white shadow-sm transition-[left] duration-150 ease-in-out",
755
+ slim ? "top-0 shadow-xs" : "top-0.5",
756
+ slim && "border border-toggle-border",
757
+ slim && isSelected && "border-toggle-slim-border_pressed",
758
+ slim && isSelected && isHovered && "border-toggle-slim-border_pressed-hover",
759
+ classes.thumb,
760
+ classes.thumbPosition
761
+ )
762
+ }
763
+ )
764
+ }
765
+ );
766
+ };
767
+ var focusShadowInset = "[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
768
+ var DropdownItem = ({ label, children, addon, icon: Icon, avatarUrl, unstyled, selectionIndicator = "checkmark", ...props }) => {
769
+ const SelectionIndicator = useCallback(
770
+ (state) => {
771
+ if (selectionIndicator === "checkmark") {
772
+ return /* @__PURE__ */ jsx(
773
+ CheckIcon,
774
+ {
775
+ "aria-hidden": "true",
776
+ className: cx("size-4 shrink-0 stroke-[2.25px] text-fg-brand-primary", !state.isSelected && "invisible", state.className)
777
+ }
778
+ );
779
+ }
780
+ if (selectionIndicator === "checkbox") {
781
+ return /* @__PURE__ */ jsx(
782
+ CheckboxBase,
783
+ {
784
+ isSelected: state.isSelected && !state.hasSubmenu,
785
+ isIndeterminate: state.isSelected && state.hasSubmenu,
786
+ size: "sm",
787
+ className: cx("shrink-0", state.className)
788
+ }
789
+ );
790
+ }
791
+ if (selectionIndicator === "radio") {
792
+ return /* @__PURE__ */ jsx(RadioButtonBase, { isSelected: state.isSelected, className: cx("shrink-0", state.className) });
793
+ }
794
+ if (selectionIndicator === "toggle") {
795
+ return /* @__PURE__ */ jsx(ToggleBase, { slim: true, size: "sm", isSelected: state.isSelected, className: cx("shrink-0", state.className) });
796
+ }
797
+ return null;
798
+ },
799
+ [selectionIndicator]
800
+ );
801
+ if (unstyled) {
802
+ return /* @__PURE__ */ jsx(MenuItem, { id: label, textValue: label, ...props });
803
+ }
804
+ return /* @__PURE__ */ jsx(
805
+ MenuItem,
806
+ {
807
+ ...props,
808
+ className: (state) => cx(
809
+ "group block cursor-pointer px-1.5 py-px outline-hidden",
810
+ state.isDisabled && "cursor-not-allowed opacity-50",
811
+ typeof props.className === "function" ? props.className(state) : props.className
812
+ ),
813
+ children: (state) => /* @__PURE__ */ jsxs(
814
+ "div",
815
+ {
816
+ className: cx(
817
+ "relative flex items-center rounded-md px-2.5 py-2 transition duration-100 ease-linear",
818
+ !state.isDisabled && "group-hover:bg-primary_hover",
819
+ state.isFocused && "bg-primary_hover",
820
+ state.isFocusVisible && focusShadowInset,
821
+ state.hasSubmenu && "pr-1.5"
822
+ ),
823
+ children: [
824
+ state.selectionMode !== "none" && !avatarUrl && !Icon && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "mr-2" }),
825
+ avatarUrl && /* @__PURE__ */ jsx("div", { className: "mr-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(Avatar, { "aria-hidden": "true", size: "xs", src: avatarUrl, alt: label, className: "size-5" }) }),
826
+ Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: "mr-2 size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" }),
827
+ /* @__PURE__ */ jsx("span", { className: cx("grow truncate text-sm font-semibold text-secondary", state.isFocused && "text-secondary_hover"), children: label || (typeof children === "function" ? children(state) : children) }),
828
+ addon && /* @__PURE__ */ jsx("span", { className: "ml-1 shrink-0 pr-1 text-xs font-medium text-quaternary", children: addon }),
829
+ state.selectionMode !== "none" && (avatarUrl || Icon) && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "ml-1" }),
830
+ state.hasSubmenu && /* @__PURE__ */ jsx(CaretRightIcon, { "aria-hidden": "true", className: "ml-auto size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" })
831
+ ]
832
+ }
833
+ )
834
+ }
835
+ );
836
+ };
837
+ var DropdownMenu = (props) => {
838
+ return /* @__PURE__ */ jsx(
839
+ Menu,
840
+ {
841
+ ...props,
842
+ className: (state) => cx("h-min overflow-y-auto py-1 outline-hidden select-none", typeof props.className === "function" ? props.className(state) : props.className)
843
+ }
844
+ );
845
+ };
846
+ var DropdownSheetDepthContext = createContext(0);
847
+ function DropdownSheetCloseButton({ onClose }) {
848
+ return /* @__PURE__ */ jsxs(
849
+ "button",
850
+ {
851
+ type: "button",
852
+ onClick: (e) => {
853
+ e.stopPropagation();
854
+ onClose();
855
+ },
856
+ 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)]",
857
+ children: [
858
+ /* @__PURE__ */ jsx(XIcon, { className: "size-5", "aria-hidden": "true" }),
859
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
860
+ ]
861
+ }
862
+ );
863
+ }
864
+ function DropdownSheetChrome({ title, onClose, children }) {
865
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
866
+ /* @__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: [
867
+ title ? /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold text-primary", children: title }) : null,
868
+ /* @__PURE__ */ jsx(DropdownSheetCloseButton, { onClose })
869
+ ] }),
870
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto pb-[max(2.5rem,calc(env(safe-area-inset-bottom)+2rem))]", children })
871
+ ] });
872
+ }
873
+ var DropdownPopover = ({ mobileOptions, children, className, style, ...props }) => {
874
+ const isMobile = useIsMobile();
875
+ const resolvedMobile = useMemo(() => resolveSelectMobileOptions(mobileOptions), [mobileOptions]);
876
+ const useMobileSheet = isMobile && resolvedMobile.sheet;
877
+ const overlayState = useContext(OverlayTriggerStateContext);
878
+ const open = overlayState?.isOpen ?? false;
879
+ const parentDepth = useContext(DropdownSheetDepthContext);
880
+ const depth = parentDepth + 1;
881
+ const { shouldRender, panelStyle, backdropStyle } = useMobileSheetAnimation(open, useMobileSheet);
882
+ useEffect(() => {
883
+ if (!useMobileSheet || !open) return;
884
+ const prev = document.body.style.overflow;
885
+ document.body.style.overflow = "hidden";
886
+ return () => {
887
+ document.body.style.overflow = prev;
888
+ };
889
+ }, [useMobileSheet, open]);
890
+ if (!useMobileSheet) {
891
+ return /* @__PURE__ */ jsx(
892
+ Popover,
893
+ {
894
+ placement: "bottom right",
895
+ ...props,
896
+ style,
897
+ className: (state) => cx(
898
+ "w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
899
+ 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",
900
+ 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",
901
+ typeof className === "function" ? className(state) : className
902
+ ),
903
+ children
904
+ }
905
+ );
906
+ }
907
+ const close = () => overlayState?.close();
908
+ const showMobileSheet = shouldRender;
909
+ const isMobileSheetExiting = showMobileSheet && !open;
910
+ const scrimZIndex = 50 + (depth - 1) * 10;
911
+ const sheetZIndex = scrimZIndex + 1;
912
+ const mobileScrim = shouldRender && typeof document !== "undefined" ? createPortal(
913
+ /* @__PURE__ */ jsx(
914
+ "div",
915
+ {
916
+ className: "fixed inset-0 bg-overlay/70",
917
+ style: { ...backdropStyle, zIndex: scrimZIndex },
918
+ onClick: close,
919
+ "aria-hidden": "true"
920
+ }
921
+ ),
922
+ document.body
923
+ ) : null;
924
+ return /* @__PURE__ */ jsxs(DropdownSheetDepthContext.Provider, { value: depth, children: [
925
+ mobileScrim,
926
+ /* @__PURE__ */ jsx(
927
+ Popover,
928
+ {
929
+ placement: "bottom",
930
+ containerPadding: 0,
931
+ offset: 0,
932
+ ...props,
933
+ isExiting: isMobileSheetExiting,
934
+ "data-dropdown-mobile-sheet": true,
935
+ style: { ...panelStyle, zIndex: sheetZIndex, ...style },
936
+ className: (state) => cx(
937
+ "fixed! inset-x-0! bottom-0! top-auto! right-0! left-0! flex max-h-[min(90dvh,calc(100dvh-env(safe-area-inset-bottom,0px)))] 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 outline-hidden",
938
+ resolvedMobile.sheetClassName,
939
+ typeof className === "function" ? className(state) : className
940
+ ),
941
+ children: /* @__PURE__ */ jsx(DropdownSheetChrome, { title: resolvedMobile.title, onClose: close, children: typeof children === "function" ? null : children })
942
+ }
943
+ )
944
+ ] });
945
+ };
946
+ var Dropdown = {
947
+ Root: MenuTrigger,
948
+ Popover: DropdownPopover,
949
+ Menu: DropdownMenu,
950
+ Item: DropdownItem};
951
+ var inputFocusRingShadow = "border-brand ring-1 ring-inset ring-brand";
952
+ var inputErrorFocusRingShadow = "border-error ring-1 ring-inset ring-error";
953
+ var InputBase = ({
954
+ ref,
955
+ tooltip,
956
+ shortcut,
957
+ groupRef,
958
+ size = "md",
959
+ isInvalid,
960
+ isDisabled,
961
+ isRequired,
962
+ icon: Icon,
963
+ placeholder,
964
+ wrapperClassName,
965
+ tooltipClassName,
966
+ inputClassName,
967
+ iconClassName,
968
+ type = "text",
969
+ ...inputProps
970
+ }) => {
971
+ const [isPasswordVisible, setIsPasswordVisible] = useState(false);
972
+ const hasTrailingIcon = tooltip || isInvalid;
973
+ const hasLeadingIcon = Icon;
974
+ const context = useContext(TextFieldContext);
975
+ const inputSize = context?.size || size;
976
+ const sizes3 = sortCx({
977
+ sm: {
978
+ root: cx("px-3 py-2 text-sm", hasLeadingIcon && "pl-9", hasTrailingIcon && "pr-9"),
979
+ iconLeading: "left-3 size-4 stroke-[2.25px]",
980
+ iconTrailing: "right-3",
981
+ shortcut: "pr-1.5"
982
+ },
983
+ md: {
984
+ root: cx("px-3 py-2 text-md", hasLeadingIcon && "pl-10", hasTrailingIcon && "pr-9"),
985
+ iconLeading: "left-3 size-5",
986
+ iconTrailing: "right-3",
987
+ shortcut: "pr-2"
988
+ },
989
+ lg: {
990
+ root: cx("px-3.5 py-2.5 text-md", hasLeadingIcon && "pl-10.5", hasTrailingIcon && "pr-9.5"),
991
+ iconLeading: "left-3.5 size-5",
992
+ iconTrailing: "right-3.5",
993
+ shortcut: "pr-2.5"
994
+ }
995
+ });
996
+ return /* @__PURE__ */ jsxs(
997
+ Group,
998
+ {
999
+ ...{ isDisabled, isInvalid },
1000
+ ref: groupRef,
1001
+ className: ({ isFocusWithin, isDisabled: isDisabled2, isInvalid: isInvalid2 }) => cx(
1002
+ "group/input relative flex w-full flex-row place-content-center place-items-center rounded-lg border border-solid border-primary bg-primary shadow-xs transition-[border-color,box-shadow] duration-100 ease-linear",
1003
+ isFocusWithin && !isDisabled2 && !isInvalid2 && inputFocusRingShadow,
1004
+ // Disabled state styles
1005
+ isDisabled2 && "cursor-not-allowed opacity-50",
1006
+ "group-disabled:cursor-not-allowed group-disabled:opacity-50",
1007
+ // Invalid state styles
1008
+ isInvalid2 && !isFocusWithin && "border-error_subtle",
1009
+ "group-invalid:border-error_subtle",
1010
+ "group-invalid:focus-within:border-error group-invalid:focus-within:ring-1 group-invalid:focus-within:ring-inset group-invalid:focus-within:ring-error",
1011
+ // Invalid + focus — darker error stroke (not brand)
1012
+ isInvalid2 && isFocusWithin && inputErrorFocusRingShadow,
1013
+ context?.wrapperClassName,
1014
+ wrapperClassName
1015
+ ),
1016
+ children: [
1017
+ Icon && /* @__PURE__ */ jsx(Icon, { className: cx("pointer-events-none absolute text-fg-quaternary", sizes3[inputSize].iconLeading, context?.iconClassName, iconClassName) }),
1018
+ /* @__PURE__ */ jsx(
1019
+ Input,
1020
+ {
1021
+ ...inputProps,
1022
+ ref,
1023
+ required: isRequired,
1024
+ type: type === "password" && isPasswordVisible ? "text" : type,
1025
+ placeholder,
1026
+ className: cx(
1027
+ "m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed",
1028
+ sizes3[inputSize].root,
1029
+ context?.inputClassName,
1030
+ inputClassName
1031
+ )
1032
+ }
1033
+ ),
1034
+ tooltip && type !== "password" && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, placement: "top", children: /* @__PURE__ */ jsx(
1035
+ TooltipTrigger,
1036
+ {
1037
+ className: cx(
1038
+ "absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover",
1039
+ sizes3[inputSize].iconTrailing,
1040
+ context?.tooltipClassName,
1041
+ tooltipClassName
1042
+ ),
1043
+ children: /* @__PURE__ */ jsx(QuestionIcon, { className: "size-4 stroke-[2.25px]" })
1044
+ }
1045
+ ) }),
1046
+ type !== "password" && /* @__PURE__ */ jsx(
1047
+ InfoIcon,
1048
+ {
1049
+ className: cx(
1050
+ "pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block",
1051
+ sizes3[inputSize].iconTrailing,
1052
+ context?.tooltipClassName,
1053
+ tooltipClassName
1054
+ )
1055
+ }
1056
+ ),
1057
+ type === "password" && /* @__PURE__ */ jsx(
1058
+ Button$1,
1059
+ {
1060
+ "aria-label": "Toggle password visibility",
1061
+ onClick: () => setIsPasswordVisible(!isPasswordVisible),
1062
+ className: cx(
1063
+ "absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden",
1064
+ sizes3[inputSize].iconTrailing
1065
+ ),
1066
+ children: isPasswordVisible ? /* @__PURE__ */ jsx(EyeSlashIcon, { className: "size-4 stroke-[2.25px]" }) : /* @__PURE__ */ jsx(EyeIcon, { className: "size-4 stroke-[2.25px]" })
1067
+ }
1068
+ ),
1069
+ shortcut && /* @__PURE__ */ jsx(
1070
+ "div",
1071
+ {
1072
+ className: cx(
1073
+ "pointer-events-none 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",
1074
+ sizes3[inputSize].shortcut
1075
+ ),
1076
+ children: /* @__PURE__ */ jsx(
1077
+ "span",
1078
+ {
1079
+ "aria-hidden": "true",
1080
+ className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
1081
+ children: typeof shortcut === "string" ? shortcut : "\u2318K"
1082
+ }
1083
+ )
1084
+ }
1085
+ )
1086
+ ]
1087
+ }
1088
+ );
1089
+ };
1090
+ InputBase.displayName = "InputBase";
1091
+ var TextFieldContext = createContext({});
1092
+ var DropdownSearchAdvanced = () => {
1093
+ const [selectedUsers, setSelectedUsers] = useState(/* @__PURE__ */ new Set(["untitledui", "shutterframe"]));
1094
+ let { contains } = useFilter({ sensitivity: "base" });
1095
+ return /* @__PURE__ */ jsxs(Dropdown.Root, { children: [
1096
+ /* @__PURE__ */ jsx(
1097
+ Button,
1098
+ {
1099
+ size: "sm",
1100
+ className: "group",
1101
+ color: "secondary",
1102
+ iconTrailing: (props) => /* @__PURE__ */ jsx(CaretDownIcon, { "data-icon": "trailing", ...props, className: "size-4! stroke-[2.25px]!" }),
1103
+ children: "Manage access"
1104
+ }
1105
+ ),
1106
+ /* @__PURE__ */ jsx(Dropdown.Popover, { className: "w-60", children: /* @__PURE__ */ jsxs(Autocomplete, { filter: contains, children: [
1107
+ /* @__PURE__ */ jsx(SearchField, { className: "flex gap-3 border-b border-secondary p-3", children: /* @__PURE__ */ jsx(InputBase, { size: "md", placeholder: "Search", icon: MagnifyingGlassIcon }) }),
1108
+ /* @__PURE__ */ jsxs(Dropdown.Menu, { selectionMode: "multiple", selectedKeys: selectedUsers, onSelectionChange: setSelectedUsers, children: [
1109
+ /* @__PURE__ */ jsxs(SubmenuTrigger, { children: [
1110
+ /* @__PURE__ */ jsx(Dropdown.Item, { id: "untitledui", textValue: "Olivia Rhye", selectionIndicator: "checkbox", children: "Untitled UI" }),
1111
+ /* @__PURE__ */ jsx(Dropdown.Popover, { placement: "right top", offset: -6, className: "w-50", children: /* @__PURE__ */ jsxs(Dropdown.Menu, { selectionMode: "multiple", children: [
1112
+ /* @__PURE__ */ jsx(
1113
+ Dropdown.Item,
1114
+ {
1115
+ id: "olivia",
1116
+ selectionIndicator: "checkbox",
1117
+ avatarUrl: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80",
1118
+ children: "Olivia Rhye"
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ jsx(
1122
+ Dropdown.Item,
1123
+ {
1124
+ id: "phoenix",
1125
+ selectionIndicator: "checkbox",
1126
+ avatarUrl: "https://www.untitledui.com/images/avatars/phoenix-baker?fm=webp&q=80",
1127
+ children: "Phoenix Baker"
1128
+ }
1129
+ ),
1130
+ /* @__PURE__ */ jsx(
1131
+ Dropdown.Item,
1132
+ {
1133
+ id: "lana",
1134
+ selectionIndicator: "checkbox",
1135
+ avatarUrl: "https://www.untitledui.com/images/avatars/lana-steiner?fm=webp&q=80",
1136
+ children: "Lana Steiner"
1137
+ }
1138
+ ),
1139
+ /* @__PURE__ */ jsx(
1140
+ Dropdown.Item,
1141
+ {
1142
+ id: "demi",
1143
+ selectionIndicator: "checkbox",
1144
+ avatarUrl: "https://www.untitledui.com/images/avatars/demi-wilkinson?fm=webp&q=80",
1145
+ children: "Demi Wilkinson"
1146
+ }
1147
+ )
1148
+ ] }) })
1149
+ ] }),
1150
+ /* @__PURE__ */ jsx(Dropdown.Item, { id: "shutterframe", textValue: "Phoenix Baker", selectionIndicator: "checkbox", children: "Shutterframe" }),
1151
+ /* @__PURE__ */ jsx(Dropdown.Item, { id: "warpspeed", textValue: "Lana Steiner", selectionIndicator: "checkbox", children: "Warpspeed" }),
1152
+ /* @__PURE__ */ jsx(Dropdown.Item, { id: "contrastai", textValue: "Demi Wilkinson", selectionIndicator: "checkbox", children: "ContrastAI" }),
1153
+ /* @__PURE__ */ jsx(Dropdown.Item, { id: "launchsimple", textValue: "Candice Wu", selectionIndicator: "checkbox", children: "LaunchSimple" }),
1154
+ /* @__PURE__ */ jsx(Dropdown.Item, { id: "elasticware", textValue: "Natali Craig", selectionIndicator: "checkbox", children: "Elasticware" })
1155
+ ] }),
1156
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3 border-t border-secondary p-3", children: /* @__PURE__ */ jsx(Button, { size: "xs", color: "secondary", iconLeading: PlusIcon, children: "Create team" }) })
1157
+ ] }) })
1158
+ ] });
1159
+ };
1160
+
1161
+ export { DropdownSearchAdvanced };
1162
+ //# sourceMappingURL=dropdown-search-advanced.js.map
1163
+ //# sourceMappingURL=dropdown-search-advanced.js.map