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

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 (225) 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 +112 -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 +17 -0
  40. package/dist/react/combobox.js +322 -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 +319 -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 +773 -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 +549 -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 +527 -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 +507 -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 +790 -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 +799 -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 +501 -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 +754 -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 +543 -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 +505 -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 +1325 -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 +998 -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 +960 -0
  86. package/dist/react/dropdown-search-simple.js.map +1 -0
  87. package/dist/react/dropdown.d.ts +32 -133
  88. package/dist/react/dropdown.js +404 -1351
  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 +89 -0
  130. package/dist/react/multi-select.js +1036 -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 +7 -73
  136. package/dist/react/popover.js +23 -569
  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 +116 -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 +13 -0
  157. package/dist/react/select-item.js +336 -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 +18 -61
  163. package/dist/react/select.js +625 -923
  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 +44 -0
  181. package/dist/react/tag-select.js +1062 -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-shared-B3Y5SMXU.d.ts +62 -0
  193. package/package.json +28 -21
  194. package/source.css +2 -13
  195. package/theme.css +883 -79
  196. package/dist/react/calendar.d.ts +0 -13
  197. package/dist/react/calendar.js +0 -4639
  198. package/dist/react/calendar.js.map +0 -1
  199. package/dist/react/card.d.ts +0 -11
  200. package/dist/react/card.js +0 -113
  201. package/dist/react/card.js.map +0 -1
  202. package/dist/react/datetime-picker.d.ts +0 -21
  203. package/dist/react/datetime-picker.js +0 -6142
  204. package/dist/react/datetime-picker.js.map +0 -1
  205. package/dist/react/pagination.d.ts +0 -28
  206. package/dist/react/pagination.js +0 -262
  207. package/dist/react/pagination.js.map +0 -1
  208. package/dist/react/table-pagination.d.ts +0 -15
  209. package/dist/react/table-pagination.js +0 -1247
  210. package/dist/react/table-pagination.js.map +0 -1
  211. package/dist/react/table-view/column-menu.d.ts +0 -15
  212. package/dist/react/table-view/column-menu.js +0 -1049
  213. package/dist/react/table-view/column-menu.js.map +0 -1
  214. package/dist/react/table-view/index.d.ts +0 -70
  215. package/dist/react/table-view/index.js +0 -2284
  216. package/dist/react/table-view/index.js.map +0 -1
  217. package/dist/react/table.d.ts +0 -86
  218. package/dist/react/table.js +0 -414
  219. package/dist/react/table.js.map +0 -1
  220. package/dist/react/tabs.d.ts +0 -34
  221. package/dist/react/tabs.js +0 -423
  222. package/dist/react/tabs.js.map +0 -1
  223. package/dist/react/time-picker.d.ts +0 -22
  224. package/dist/react/time-picker.js +0 -856
  225. package/dist/react/time-picker.js.map +0 -1
@@ -0,0 +1,754 @@
1
+ import { CaretDownIcon } from '@phosphor-icons/react/dist/csr/CaretDown';
2
+ import { MenuTrigger, MenuSection, SubmenuTrigger, Link, Button as Button$1, Popover, Menu, MenuItem, Separator } from 'react-aria-components';
3
+ import { createContext, isValidElement, useCallback, useState, useRef, useLayoutEffect } from 'react';
4
+ import { extendTailwindMerge } from 'tailwind-merge';
5
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
+ import { CheckIcon } from '@phosphor-icons/react/dist/csr/Check';
7
+ import { CaretRightIcon } from '@phosphor-icons/react/dist/csr/CaretRight';
8
+ import '@phosphor-icons/react/dist/csr/DotsThreeVertical';
9
+ import { UserIcon } from '@phosphor-icons/react/dist/csr/User';
10
+ import '@phosphor-icons/react/dist/csr/Plus';
11
+
12
+ var twMerge = extendTailwindMerge({
13
+ extend: {
14
+ theme: {
15
+ text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
16
+ }
17
+ }
18
+ });
19
+ var cx = twMerge;
20
+ function sortCx(classes) {
21
+ return classes;
22
+ }
23
+
24
+ // ../../utils/is-react-component.ts
25
+ var isFunctionComponent = (component) => {
26
+ return typeof component === "function";
27
+ };
28
+ var isClassComponent = (component) => {
29
+ return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
30
+ };
31
+ var isForwardRefComponent = (component) => {
32
+ return typeof component === "object" && component !== null && component.$$typeof.toString() === "Symbol(react.forward_ref)";
33
+ };
34
+ var isReactComponent = (component) => {
35
+ return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
36
+ };
37
+ 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)]";
38
+ 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)]";
39
+ var skeuomorphicGradientBorderClass = [
40
+ "ring-1 ring-inset ring-transparent",
41
+ "before:pointer-events-none before:absolute before:inset-px before:rounded-[inherit] before:border before:border-[#ffffff1f] before:content-['']",
42
+ "before:[mask-image:linear-gradient(to_bottom,#000,transparent)]"
43
+ ].join(" ");
44
+ var skeuomorphicShadowClass = ["shadow-xs-skeuomorphic", focusShadowSkeuomorphic, "overflow-hidden"].join(" ");
45
+ 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)]";
46
+ 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)]";
47
+ var secondaryShadowClass = ["relative overflow-hidden shadow-xs", secondaryInnerShadow, focusShadowSecondary].join(" ");
48
+ var inputNumberButtonClass = [
49
+ "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",
50
+ "in-data-number-input:before:hidden in-data-number-input:after:hidden",
51
+ "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]"
52
+ ].join(" ");
53
+ var inputAddonButtonClass = [
54
+ "in-data-input-wrapper:border-0 in-data-input-wrapper:shadow-none in-data-input-wrapper:!rounded-none in-data-input-wrapper:overflow-hidden",
55
+ "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",
56
+ "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",
57
+ "in-data-input-wrapper:group-invalid:in-data-trailing:border-error_subtle in-data-input-wrapper:group-invalid:in-data-leading:border-error_subtle",
58
+ "in-data-input-wrapper:before:hidden in-data-input-wrapper:after:hidden",
59
+ "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]"
60
+ ].join(" ");
61
+ var styles = sortCx({
62
+ common: {
63
+ root: [
64
+ "group relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-full font-body outline-none before:absolute",
65
+ "font-semibold transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out",
66
+ "pressed:scale-[0.985] pressed:duration-100 pressed:ease-linear motion-reduce:pressed:scale-100",
67
+ "disabled:pointer-events-none disabled:cursor-not-allowed in-data-input-wrapper:disabled:opacity-100",
68
+ inputAddonButtonClass,
69
+ inputNumberButtonClass,
70
+ // Stretch to InputGroup row height; padding/typography follow `data-input-size` on the field (Figma 85:1269).
71
+ "in-data-input-wrapper:!h-full in-data-input-wrapper:!min-h-0 in-data-input-wrapper:self-stretch",
72
+ "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",
73
+ "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",
74
+ "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",
75
+ "*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:transition-inherit-all"
76
+ ].join(" "),
77
+ icon: "pointer-events-none shrink-0 transition-inherit-all"
78
+ },
79
+ sizes: {
80
+ xs: {
81
+ root: [
82
+ "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",
83
+ "in-data-input-wrapper:data-icon-only:p-2.5",
84
+ "*:data-icon:size-4"
85
+ ].join(" "),
86
+ linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
87
+ },
88
+ sm: {
89
+ root: [
90
+ "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",
91
+ "in-data-input-wrapper:data-icon-only:p-2.5",
92
+ "*:data-icon:size-5"
93
+ ].join(" "),
94
+ linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
95
+ },
96
+ md: {
97
+ root: [
98
+ "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",
99
+ "in-data-input-wrapper:data-icon-only:p-3",
100
+ "*:data-icon:size-5"
101
+ ].join(" "),
102
+ linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-4"
103
+ },
104
+ lg: {
105
+ 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",
106
+ linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
107
+ },
108
+ xl: {
109
+ 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",
110
+ linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
111
+ }
112
+ },
113
+ colors: {
114
+ /** Figma Hierarchy=Primary — dark neutral solid; hover lightens to fg-tertiary_hover (#404040). */
115
+ primary: {
116
+ root: [
117
+ "bg-primary-solid text-white",
118
+ skeuomorphicShadowClass,
119
+ skeuomorphicGradientBorderClass,
120
+ "hover:bg-fg-tertiary_hover dark:hover:bg-quaternary",
121
+ "disabled:opacity-30",
122
+ "data-loading:bg-fg-tertiary_hover dark:data-loading:bg-quaternary",
123
+ "*:data-icon:not([data-icon=loading]):text-white/70"
124
+ ].join(" ")
125
+ },
126
+ /** Figma Hierarchy=Brand — purple solid; hover darkens to bg-brand-solid_hover (#6d28d9). */
127
+ brand: {
128
+ root: [
129
+ "bg-brand-solid text-primary_on-brand",
130
+ skeuomorphicShadowClass,
131
+ skeuomorphicGradientBorderClass,
132
+ "hover:bg-brand-solid_hover",
133
+ "disabled:opacity-50",
134
+ "data-loading:bg-brand-solid_hover",
135
+ "*:data-icon:not([data-icon=loading]):text-primary_on-brand"
136
+ ].join(" ")
137
+ },
138
+ /** Figma Hierarchy=Secondary — border-primary + shadow-xs + skeuomorphic inner rim overlay. */
139
+ secondary: {
140
+ root: [
141
+ "border border-solid border-primary bg-primary text-secondary",
142
+ secondaryShadowClass,
143
+ "hover:bg-primary_hover hover:text-secondary_hover",
144
+ "disabled:opacity-50",
145
+ "data-loading:bg-primary_hover",
146
+ "*:data-icon:text-fg-secondary hover:*:data-icon:text-fg-quaternary_hover"
147
+ ].join(" ")
148
+ },
149
+ /** Figma Hierarchy=Tertiary */
150
+ tertiary: {
151
+ root: [
152
+ "border border-transparent bg-transparent text-tertiary",
153
+ focusShadowPlain,
154
+ "hover:bg-primary_hover hover:text-tertiary_hover",
155
+ "disabled:opacity-50",
156
+ "*:data-icon:text-fg-tertiary hover:*:data-icon:text-fg-quaternary_hover"
157
+ ].join(" ")
158
+ },
159
+ /** Figma Hierarchy=Link color — text + icons share brand-secondary; hover underlines with fg-brand-secondary. */
160
+ "link-color": {
161
+ root: [
162
+ "h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-brand-secondary shadow-none",
163
+ focusShadowPlain,
164
+ "hover:text-brand-secondary_hover",
165
+ "disabled:opacity-50",
166
+ "*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-brand-secondary"
167
+ ].join(" ")
168
+ },
169
+ /** Figma Hierarchy=Link gray — text + icons share tertiary; hover underlines with fg-quaternary. */
170
+ "link-gray": {
171
+ root: [
172
+ "h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-tertiary shadow-none",
173
+ focusShadowPlain,
174
+ "hover:text-tertiary_hover",
175
+ "disabled:opacity-50",
176
+ "*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-quaternary"
177
+ ].join(" ")
178
+ },
179
+ "primary-destructive": {
180
+ root: [
181
+ "bg-error-solid text-white",
182
+ skeuomorphicShadowClass,
183
+ skeuomorphicGradientBorderClass,
184
+ "hover:bg-error-solid_hover",
185
+ "disabled:opacity-50",
186
+ "data-loading:bg-error-solid_hover",
187
+ "*:data-icon:not([data-icon=loading]):text-white/70"
188
+ ].join(" ")
189
+ },
190
+ "secondary-destructive": {
191
+ root: [
192
+ "border border-solid border-primary bg-primary text-error-primary",
193
+ secondaryShadowClass,
194
+ "hover:bg-error-primary hover:text-error-primary_hover",
195
+ "disabled:opacity-50",
196
+ "data-loading:bg-error-primary",
197
+ "*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
198
+ ].join(" ")
199
+ },
200
+ "tertiary-destructive": {
201
+ root: [
202
+ "border border-transparent bg-transparent text-error-primary",
203
+ focusShadowPlain,
204
+ "hover:bg-error-primary hover:text-error-primary_hover",
205
+ "disabled:opacity-50",
206
+ "*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
207
+ ].join(" ")
208
+ },
209
+ /** Figma Hierarchy=Link (destructive) — text + icons share error-primary; hover underlines. */
210
+ "link-destructive": {
211
+ root: [
212
+ "h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-error-primary shadow-none",
213
+ focusShadowPlain,
214
+ "hover:text-error-primary_hover",
215
+ "disabled:opacity-50",
216
+ "*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-current"
217
+ ].join(" ")
218
+ }
219
+ }
220
+ });
221
+ var Button = ({
222
+ size = "md",
223
+ color = "primary",
224
+ children,
225
+ className,
226
+ noTextPadding,
227
+ iconLeading: IconLeading,
228
+ iconTrailing: IconTrailing,
229
+ isDisabled: disabled,
230
+ isLoading: loading,
231
+ showTextWhileLoading,
232
+ ...props
233
+ }) => {
234
+ const href = "href" in props ? props.href : void 0;
235
+ const isIcon = (IconLeading || IconTrailing) && !children;
236
+ const isLinkType = ["link-gray", "link-color", "link-destructive"].includes(color);
237
+ noTextPadding = isLinkType || noTextPadding;
238
+ const commonChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
239
+ isValidElement(IconLeading) && IconLeading,
240
+ isReactComponent(IconLeading) && /* @__PURE__ */ jsx(IconLeading, { "data-icon": "leading", className: styles.common.icon }),
241
+ loading && /* @__PURE__ */ jsx(
242
+ "svg",
243
+ {
244
+ fill: "none",
245
+ "data-icon": "loading",
246
+ viewBox: "0 0 256 256",
247
+ "aria-hidden": true,
248
+ className: cx(
249
+ styles.common.icon,
250
+ "size-5 animate-spin",
251
+ !showTextWhileLoading && "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
252
+ ),
253
+ children: /* @__PURE__ */ jsx(
254
+ "path",
255
+ {
256
+ fill: "currentColor",
257
+ 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"
258
+ }
259
+ )
260
+ }
261
+ ),
262
+ children && /* @__PURE__ */ jsx("span", { "data-text": true, className: cx("transition-inherit-all", !noTextPadding && !isLinkType && "px-0.5"), children }),
263
+ isValidElement(IconTrailing) && IconTrailing,
264
+ isReactComponent(IconTrailing) && /* @__PURE__ */ jsx(IconTrailing, { "data-icon": "trailing", className: styles.common.icon })
265
+ ] });
266
+ const commonProps = {
267
+ "data-icon-only": isIcon ? true : void 0,
268
+ "data-loading": loading ? true : void 0,
269
+ ...props,
270
+ isDisabled: disabled || loading,
271
+ className: cx(
272
+ styles.common.root,
273
+ styles.sizes[size].root,
274
+ styles.colors[color].root,
275
+ isLinkType && styles.sizes[size].linkRoot,
276
+ (loading || href && (disabled || loading)) && "pointer-events-none",
277
+ loading && (showTextWhileLoading ? "[&>*:not([data-icon=loading]):not([data-text])]:hidden" : "[&>*:not([data-icon=loading])]:invisible"),
278
+ className
279
+ ),
280
+ children: commonChildren
281
+ };
282
+ if ("href" in commonProps) {
283
+ return /* @__PURE__ */ jsx(Link, { ...commonProps, href: disabled || loading ? void 0 : href });
284
+ }
285
+ return /* @__PURE__ */ jsx(Button$1, { ...commonProps, type: commonProps.type || "button", isPending: loading });
286
+ };
287
+ var sizes = {
288
+ xs: "size-1.5",
289
+ sm: "size-2",
290
+ md: "size-2.5",
291
+ lg: "size-3",
292
+ xl: "size-3.5",
293
+ "2xl": "size-4",
294
+ "3xl": "size-4.5",
295
+ "4xl": "size-5"
296
+ };
297
+ var AvatarOnlineIndicator = ({ size, status, className }) => /* @__PURE__ */ jsx(
298
+ "span",
299
+ {
300
+ className: cx(
301
+ "absolute right-0 bottom-0 flex justify-center rounded-full ring-[1.5px] ring-bg-primary",
302
+ status === "online" ? "bg-fg-success-secondary" : "bg-utility-neutral-300",
303
+ sizes[size],
304
+ className
305
+ ),
306
+ style: {
307
+ 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%)"
308
+ },
309
+ children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 7.2 2.85", fill: "none", className: "mt-[10%] h-[20%] w-[60%]", children: [
310
+ /* @__PURE__ */ jsx(
311
+ "path",
312
+ {
313
+ 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",
314
+ fill: "url(#reflection-gradient)",
315
+ fillOpacity: "0.4"
316
+ }
317
+ ),
318
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "reflection-gradient", x1: "3.6", y1: "0", x2: "3.6", y2: "2.4", gradientUnits: "userSpaceOnUse", children: [
319
+ /* @__PURE__ */ jsx("stop", { stopColor: "white" }),
320
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.1" })
321
+ ] }) })
322
+ ] })
323
+ }
324
+ );
325
+ var sizes2 = {
326
+ xs: "size-2.5",
327
+ sm: "size-3",
328
+ md: "size-3.5",
329
+ lg: "size-4",
330
+ xl: "size-4.5",
331
+ "2xl": "size-5",
332
+ "3xl": "size-6",
333
+ "4xl": "size-8"
334
+ };
335
+ 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: [
336
+ /* @__PURE__ */ jsx(
337
+ "path",
338
+ {
339
+ 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",
340
+ className: "fill-current"
341
+ }
342
+ ),
343
+ /* @__PURE__ */ jsx(
344
+ "path",
345
+ {
346
+ fillRule: "evenodd",
347
+ clipRule: "evenodd",
348
+ 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",
349
+ fill: "white"
350
+ }
351
+ )
352
+ ] });
353
+ 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 }) });
354
+ var styles2 = {
355
+ xs: { root: "size-6", rootWithBorder: "p-px", initials: "text-xs font-semibold", icon: "size-4" },
356
+ sm: { root: "size-8", rootWithBorder: "p-px", initials: "text-sm font-semibold", icon: "size-5" },
357
+ md: { root: "size-10", rootWithBorder: "p-px", initials: "text-md font-semibold", icon: "size-6" },
358
+ lg: { root: "size-12", rootWithBorder: "p-[1.5px]", initials: "text-lg font-semibold", icon: "size-7" },
359
+ xl: { root: "size-14", rootWithBorder: "p-0.5", initials: "text-xl font-semibold", icon: "size-8" },
360
+ "2xl": { root: "size-16", rootWithBorder: "p-0.5", initials: "text-display-xs font-semibold", icon: "size-8" }
361
+ };
362
+ var Avatar = ({
363
+ size = "md",
364
+ src,
365
+ alt,
366
+ initials,
367
+ placeholder,
368
+ placeholderIcon: PlaceholderIcon,
369
+ border,
370
+ badge,
371
+ status,
372
+ verified,
373
+ count,
374
+ focusable = false,
375
+ rounded = true,
376
+ className,
377
+ contentClassName
378
+ }) => {
379
+ const [isFailed, setIsFailed] = useState(false);
380
+ const canShowImage = src && !isFailed;
381
+ const renderMainContent = () => {
382
+ if (canShowImage) {
383
+ return /* @__PURE__ */ jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src, alt, onError: () => setIsFailed(true) });
384
+ }
385
+ if (initials) {
386
+ return /* @__PURE__ */ jsx("span", { className: cx("text-quaternary", styles2[size].initials), children: initials });
387
+ }
388
+ if (PlaceholderIcon) {
389
+ return /* @__PURE__ */ jsx(PlaceholderIcon, { className: cx("text-fg-quaternary", styles2[size].icon) });
390
+ }
391
+ return placeholder || /* @__PURE__ */ jsx(UserIcon, { className: cx("text-fg-quaternary", styles2[size].icon) });
392
+ };
393
+ const renderBadgeContent = () => {
394
+ if (status) {
395
+ return /* @__PURE__ */ jsx(AvatarOnlineIndicator, { status, size });
396
+ }
397
+ if (verified) {
398
+ return /* @__PURE__ */ jsx(VerifiedTick, { size, className: cx("absolute right-0 bottom-0", size === "xs" && "-right-px -bottom-px") });
399
+ }
400
+ if (count) {
401
+ return /* @__PURE__ */ jsx(AvatarCount, { count });
402
+ }
403
+ return badge;
404
+ };
405
+ return /* @__PURE__ */ jsxs(
406
+ "div",
407
+ {
408
+ "data-avatar": true,
409
+ className: cx(
410
+ "relative inline-flex shrink-0 rounded-[7px]",
411
+ rounded && "rounded-full",
412
+ // Focus styles
413
+ focusable && "outline-none group-focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
414
+ border && "ring-1 ring-secondary_alt",
415
+ border && styles2[size].rootWithBorder,
416
+ styles2[size].root,
417
+ className
418
+ ),
419
+ children: [
420
+ /* @__PURE__ */ jsx(
421
+ "div",
422
+ {
423
+ className: cx(
424
+ "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]",
425
+ rounded && "rounded-full",
426
+ 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%)]",
427
+ contentClassName
428
+ ),
429
+ children: renderMainContent()
430
+ }
431
+ ),
432
+ renderBadgeContent()
433
+ ]
434
+ }
435
+ );
436
+ };
437
+ var CHECKBOX_TICK_DELAY_MS = 60;
438
+ var CHECKBOX_TICK_DRAW_MS = 100;
439
+ function CheckboxAnimatedCheckMark({ className }) {
440
+ const pathRef = useRef(null);
441
+ useLayoutEffect(() => {
442
+ const path = pathRef.current;
443
+ if (!path || typeof path.getTotalLength !== "function") return;
444
+ const len = path.getTotalLength();
445
+ if (len <= 0) return;
446
+ path.style.strokeDasharray = `${len}`;
447
+ path.style.strokeDashoffset = `${len}`;
448
+ if (typeof path.animate !== "function") {
449
+ path.style.strokeDashoffset = "0";
450
+ return;
451
+ }
452
+ const anim = path.animate([{ strokeDashoffset: len }, { strokeDashoffset: 0 }], {
453
+ duration: CHECKBOX_TICK_DRAW_MS,
454
+ delay: CHECKBOX_TICK_DELAY_MS,
455
+ easing: "cubic-bezier(0.45, 0, 0.2, 1)",
456
+ fill: "forwards"
457
+ });
458
+ return () => anim.cancel();
459
+ }, []);
460
+ return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 14 14", fill: "none", className: cx("block shrink-0", className), children: /* @__PURE__ */ jsx(
461
+ "path",
462
+ {
463
+ ref: pathRef,
464
+ d: "M2.33325 7L5.24992 9.91667L11.6666 3.5",
465
+ stroke: "currentColor",
466
+ strokeWidth: "2",
467
+ strokeLinecap: "round",
468
+ strokeLinejoin: "round"
469
+ }
470
+ ) });
471
+ }
472
+ var focusRingShadow = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
473
+ var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = "sm", isFocusVisible = false }) => {
474
+ const isChecked = isSelected || isIndeterminate;
475
+ const iconClassName = size === "sm" ? "size-2.5" : "size-3.5";
476
+ return /* @__PURE__ */ jsxs(
477
+ "div",
478
+ {
479
+ className: cx(
480
+ "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center border border-solid border-primary",
481
+ size === "sm" ? "size-4 rounded-xs" : "size-5 rounded-sm",
482
+ isChecked ? "border-transparent bg-brand-solid" : "bg-primary",
483
+ isDisabled && "cursor-not-allowed opacity-50",
484
+ isDisabled && !isChecked && "bg-tertiary",
485
+ isFocusVisible && !isDisabled && focusRingShadow,
486
+ className
487
+ ),
488
+ children: [
489
+ isIndeterminate && /* @__PURE__ */ jsx(
490
+ "svg",
491
+ {
492
+ "aria-hidden": "true",
493
+ viewBox: "0 0 14 14",
494
+ fill: "none",
495
+ className: cx("pointer-events-none block shrink-0 text-fg-white", iconClassName),
496
+ children: /* @__PURE__ */ jsx("path", { d: "M2.91675 7H11.0834", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
497
+ }
498
+ ),
499
+ isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { className: cx("pointer-events-none text-fg-white", iconClassName) })
500
+ ]
501
+ }
502
+ );
503
+ };
504
+ CheckboxBase.displayName = "CheckboxBase";
505
+ var RADIO_DOT_DELAY_MS = 60;
506
+ var RADIO_DOT_POP_MS = 100;
507
+ function RadioAnimatedDot({ className }) {
508
+ const dotRef = useRef(null);
509
+ useLayoutEffect(() => {
510
+ const dot = dotRef.current;
511
+ if (!dot) return;
512
+ if (typeof dot.animate !== "function") {
513
+ dot.style.opacity = "1";
514
+ dot.style.transform = "scale(1)";
515
+ return;
516
+ }
517
+ const anim = dot.animate(
518
+ [
519
+ { opacity: 0, transform: "scale(0)" },
520
+ { opacity: 1, transform: "scale(1)" }
521
+ ],
522
+ {
523
+ duration: RADIO_DOT_POP_MS,
524
+ delay: RADIO_DOT_DELAY_MS,
525
+ easing: "cubic-bezier(0.45, 0, 0.2, 1)",
526
+ fill: "forwards"
527
+ }
528
+ );
529
+ return () => anim.cancel();
530
+ }, []);
531
+ return /* @__PURE__ */ jsx("div", { ref: dotRef, "aria-hidden": "true", className: cx("rounded-full bg-fg-white", className), style: { opacity: 0, transform: "scale(0)" } });
532
+ }
533
+ var focusRingShadow2 = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
534
+ createContext(null);
535
+ var RadioButtonBase = ({ className, isFocusVisible, isSelected, isDisabled, size = "sm" }) => {
536
+ const dotClassName = size === "sm" ? "size-1.5" : "size-2";
537
+ return /* @__PURE__ */ jsx(
538
+ "div",
539
+ {
540
+ className: cx(
541
+ "relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip rounded-full border border-solid border-primary bg-primary",
542
+ size === "sm" ? "size-4" : "size-5",
543
+ isSelected && "border-transparent bg-brand-solid",
544
+ isDisabled && "cursor-not-allowed opacity-50",
545
+ isDisabled && !isSelected && "bg-tertiary",
546
+ isFocusVisible && !isDisabled && focusRingShadow2,
547
+ className
548
+ ),
549
+ children: isSelected && /* @__PURE__ */ jsx(RadioAnimatedDot, { className: cx("pointer-events-none", dotClassName) })
550
+ }
551
+ );
552
+ };
553
+ RadioButtonBase.displayName = "RadioButtonBase";
554
+ var focusRingShadow3 = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
555
+ var ToggleBase = ({ className, isHovered, isDisabled, isFocusVisible, isSelected, slim, size = "sm" }) => {
556
+ const styles3 = {
557
+ default: {
558
+ sm: {
559
+ track: "h-5 w-9 p-0.5",
560
+ thumb: "size-4",
561
+ thumbPosition: isSelected ? "left-[calc(100%-1rem-0.125rem)]" : "left-0.5"
562
+ },
563
+ md: {
564
+ track: "h-6 w-11 p-0.5",
565
+ thumb: "size-5",
566
+ thumbPosition: isSelected ? "left-[calc(100%-1.25rem-0.125rem)]" : "left-0.5"
567
+ }
568
+ },
569
+ slim: {
570
+ sm: {
571
+ track: "h-4 w-8",
572
+ thumb: "size-4",
573
+ thumbPosition: isSelected ? "left-4" : "left-0"
574
+ },
575
+ md: {
576
+ track: "h-5 w-10",
577
+ thumb: "size-5",
578
+ thumbPosition: isSelected ? "left-5" : "left-0"
579
+ }
580
+ }
581
+ };
582
+ const classes = slim ? styles3.slim[size] : styles3.default[size];
583
+ const offTrackBackground = (() => {
584
+ if (isDisabled) return "bg-tertiary";
585
+ if (isHovered) return slim ? "bg-tertiary" : "bg-brand-primary";
586
+ return "bg-quaternary";
587
+ })();
588
+ return /* @__PURE__ */ jsx(
589
+ "div",
590
+ {
591
+ className: cx(
592
+ "relative inline-flex shrink-0 cursor-pointer overflow-clip rounded-full outline-none transition duration-150 ease-linear",
593
+ !isSelected && offTrackBackground,
594
+ !slim && "ring-[0.5px] ring-secondary ring-inset",
595
+ slim && "ring-1 ring-secondary ring-inset",
596
+ isSelected && "bg-brand-solid",
597
+ isSelected && isHovered && "bg-brand-solid_hover",
598
+ isSelected && "ring-transparent",
599
+ isDisabled && "cursor-not-allowed opacity-50",
600
+ isFocusVisible && !isDisabled && focusRingShadow3,
601
+ classes.track,
602
+ className
603
+ ),
604
+ children: /* @__PURE__ */ jsx(
605
+ "div",
606
+ {
607
+ className: cx(
608
+ "absolute rounded-full bg-fg-white shadow-sm transition-[left] duration-150 ease-in-out",
609
+ slim ? "top-0 shadow-xs" : "top-0.5",
610
+ slim && "border border-toggle-border",
611
+ slim && isSelected && "border-toggle-slim-border_pressed",
612
+ slim && isSelected && isHovered && "border-toggle-slim-border_pressed-hover",
613
+ classes.thumb,
614
+ classes.thumbPosition
615
+ )
616
+ }
617
+ )
618
+ }
619
+ );
620
+ };
621
+ var focusShadowInset = "[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
622
+ var DropdownItem = ({ label, children, addon, icon: Icon, avatarUrl, unstyled, selectionIndicator = "checkmark", ...props }) => {
623
+ const SelectionIndicator = useCallback(
624
+ (state) => {
625
+ if (selectionIndicator === "checkmark") {
626
+ return /* @__PURE__ */ jsx(
627
+ CheckIcon,
628
+ {
629
+ "aria-hidden": "true",
630
+ className: cx("size-4 shrink-0 stroke-[2.25px] text-fg-brand-primary", !state.isSelected && "invisible", state.className)
631
+ }
632
+ );
633
+ }
634
+ if (selectionIndicator === "checkbox") {
635
+ return /* @__PURE__ */ jsx(
636
+ CheckboxBase,
637
+ {
638
+ isSelected: state.isSelected && !state.hasSubmenu,
639
+ isIndeterminate: state.isSelected && state.hasSubmenu,
640
+ size: "sm",
641
+ className: cx("shrink-0", state.className)
642
+ }
643
+ );
644
+ }
645
+ if (selectionIndicator === "radio") {
646
+ return /* @__PURE__ */ jsx(RadioButtonBase, { isSelected: state.isSelected, className: cx("shrink-0", state.className) });
647
+ }
648
+ if (selectionIndicator === "toggle") {
649
+ return /* @__PURE__ */ jsx(ToggleBase, { slim: true, size: "sm", isSelected: state.isSelected, className: cx("shrink-0", state.className) });
650
+ }
651
+ return null;
652
+ },
653
+ [selectionIndicator]
654
+ );
655
+ if (unstyled) {
656
+ return /* @__PURE__ */ jsx(MenuItem, { id: label, textValue: label, ...props });
657
+ }
658
+ return /* @__PURE__ */ jsx(
659
+ MenuItem,
660
+ {
661
+ ...props,
662
+ className: (state) => cx(
663
+ "group block cursor-pointer px-1.5 py-px outline-hidden",
664
+ state.isDisabled && "cursor-not-allowed opacity-50",
665
+ typeof props.className === "function" ? props.className(state) : props.className
666
+ ),
667
+ children: (state) => /* @__PURE__ */ jsxs(
668
+ "div",
669
+ {
670
+ className: cx(
671
+ "relative flex items-center rounded-md px-2.5 py-2 transition duration-100 ease-linear",
672
+ !state.isDisabled && "group-hover:bg-primary_hover",
673
+ state.isFocused && "bg-primary_hover",
674
+ state.isFocusVisible && focusShadowInset,
675
+ state.hasSubmenu && "pr-1.5"
676
+ ),
677
+ children: [
678
+ state.selectionMode !== "none" && !avatarUrl && !Icon && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "mr-2" }),
679
+ 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" }) }),
680
+ Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: "mr-2 size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" }),
681
+ /* @__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) }),
682
+ addon && /* @__PURE__ */ jsx("span", { className: "ml-1 shrink-0 pr-1 text-xs font-medium text-quaternary", children: addon }),
683
+ state.selectionMode !== "none" && (avatarUrl || Icon) && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "ml-1" }),
684
+ state.hasSubmenu && /* @__PURE__ */ jsx(CaretRightIcon, { "aria-hidden": "true", className: "ml-auto size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" })
685
+ ]
686
+ }
687
+ )
688
+ }
689
+ );
690
+ };
691
+ var DropdownMenu = (props) => {
692
+ return /* @__PURE__ */ jsx(
693
+ Menu,
694
+ {
695
+ ...props,
696
+ className: (state) => cx("h-min overflow-y-auto py-1 outline-hidden select-none", typeof props.className === "function" ? props.className(state) : props.className)
697
+ }
698
+ );
699
+ };
700
+ var DropdownPopover = (props) => {
701
+ return /* @__PURE__ */ jsx(
702
+ Popover,
703
+ {
704
+ placement: "bottom right",
705
+ ...props,
706
+ className: (state) => cx(
707
+ "w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
708
+ 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",
709
+ 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",
710
+ typeof props.className === "function" ? props.className(state) : props.className
711
+ ),
712
+ children: props.children
713
+ }
714
+ );
715
+ };
716
+ var DropdownSeparator = (props) => {
717
+ return /* @__PURE__ */ jsx(Separator, { ...props, className: cx("my-1 h-px w-full bg-border-secondary", props.className) });
718
+ };
719
+ var Dropdown = {
720
+ Root: MenuTrigger,
721
+ Popover: DropdownPopover,
722
+ Menu: DropdownMenu,
723
+ Section: MenuSection,
724
+ Item: DropdownItem,
725
+ Separator: DropdownSeparator};
726
+ var DropdownButtonSimple = () => /* @__PURE__ */ jsxs(Dropdown.Root, { children: [
727
+ /* @__PURE__ */ jsx(Button, { size: "sm", color: "secondary", iconTrailing: CaretDownIcon, className: "group *:data-icon:size-4 *:data-icon:stroke-[2.25px]!", children: "Account" }),
728
+ /* @__PURE__ */ jsx(Dropdown.Popover, { className: "w-54", children: /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
729
+ /* @__PURE__ */ jsxs(Dropdown.Section, { children: [
730
+ /* @__PURE__ */ jsx(Dropdown.Item, { addon: "\u2318X", children: "Cut" }),
731
+ /* @__PURE__ */ jsx(Dropdown.Item, { addon: "\u2318C", children: "Copy" }),
732
+ /* @__PURE__ */ jsx(Dropdown.Item, { addon: "\u2318V", children: "Paste" })
733
+ ] }),
734
+ /* @__PURE__ */ jsx(Dropdown.Separator, {}),
735
+ /* @__PURE__ */ jsxs(Dropdown.Section, { children: [
736
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "Edit" }),
737
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "Duplicate" }),
738
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "Delete" })
739
+ ] }),
740
+ /* @__PURE__ */ jsx(Dropdown.Separator, {}),
741
+ /* @__PURE__ */ jsx(Dropdown.Section, { children: /* @__PURE__ */ jsxs(SubmenuTrigger, { children: [
742
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "View details" }),
743
+ /* @__PURE__ */ jsx(Dropdown.Popover, { placement: "right top", offset: -6, className: "w-50", children: /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
744
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "Share" }),
745
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "Save as" }),
746
+ /* @__PURE__ */ jsx(Dropdown.Item, { children: "Archive" })
747
+ ] }) })
748
+ ] }) })
749
+ ] }) })
750
+ ] });
751
+
752
+ export { DropdownButtonSimple };
753
+ //# sourceMappingURL=dropdown-button-simple.js.map
754
+ //# sourceMappingURL=dropdown-button-simple.js.map