@fanvue/ui 1.20.1 → 2.0.0

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 (256) hide show
  1. package/dist/charts.d.ts +1 -1
  2. package/dist/cjs/components/Accordion/AccordionContent.cjs +1 -1
  3. package/dist/cjs/components/Accordion/AccordionContent.cjs.map +1 -1
  4. package/dist/cjs/components/Accordion/AccordionItem.cjs +1 -1
  5. package/dist/cjs/components/Accordion/AccordionItem.cjs.map +1 -1
  6. package/dist/cjs/components/Accordion/AccordionTrigger.cjs +5 -5
  7. package/dist/cjs/components/Accordion/AccordionTrigger.cjs.map +1 -1
  8. package/dist/cjs/components/Alert/Alert.cjs +11 -11
  9. package/dist/cjs/components/Alert/Alert.cjs.map +1 -1
  10. package/dist/cjs/components/AudioUpload/AudioUpload.cjs +12 -12
  11. package/dist/cjs/components/AudioUpload/AudioUpload.cjs.map +1 -1
  12. package/dist/cjs/components/AudioUpload/AudioWaveform.cjs +1 -1
  13. package/dist/cjs/components/AudioUpload/AudioWaveform.cjs.map +1 -1
  14. package/dist/cjs/components/Autocomplete/Autocomplete.cjs +12 -12
  15. package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  16. package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs +3 -3
  17. package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs.map +1 -1
  18. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs +3 -3
  19. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs.map +1 -1
  20. package/dist/cjs/components/Autocomplete/AutocompleteTag.cjs +2 -2
  21. package/dist/cjs/components/Autocomplete/AutocompleteTag.cjs.map +1 -1
  22. package/dist/cjs/components/Avatar/Avatar.cjs +3 -3
  23. package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -1
  24. package/dist/cjs/components/Badge/Badge.cjs +23 -23
  25. package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
  26. package/dist/cjs/components/Banner/Banner.cjs +71 -0
  27. package/dist/cjs/components/Banner/Banner.cjs.map +1 -0
  28. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs +1 -1
  29. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
  30. package/dist/cjs/components/BottomNavigation/BottomNavigationAction.cjs +2 -2
  31. package/dist/cjs/components/BottomNavigation/BottomNavigationAction.cjs.map +1 -1
  32. package/dist/cjs/components/Breadcrumb/Breadcrumb.cjs +3 -3
  33. package/dist/cjs/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
  34. package/dist/cjs/components/Button/Button.cjs +10 -10
  35. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  36. package/dist/cjs/components/Card/Card.cjs +6 -6
  37. package/dist/cjs/components/Card/Card.cjs.map +1 -1
  38. package/dist/cjs/components/Chart/ChartCard.cjs +6 -6
  39. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  40. package/dist/cjs/components/Chart/ChartCenterLabel.cjs +2 -2
  41. package/dist/cjs/components/Chart/ChartCenterLabel.cjs.map +1 -1
  42. package/dist/cjs/components/Chart/ChartContainer.cjs +7 -7
  43. package/dist/cjs/components/Chart/ChartContainer.cjs.map +1 -1
  44. package/dist/cjs/components/Chart/ChartLegend.cjs +1 -1
  45. package/dist/cjs/components/Chart/ChartLegend.cjs.map +1 -1
  46. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +1 -1
  47. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  48. package/dist/cjs/components/Chart/ChartPieLegend.cjs +2 -2
  49. package/dist/cjs/components/Chart/ChartPieLegend.cjs.map +1 -1
  50. package/dist/cjs/components/Chart/ChartSeriesToggle.cjs +2 -2
  51. package/dist/cjs/components/Chart/ChartSeriesToggle.cjs.map +1 -1
  52. package/dist/cjs/components/Chart/ChartTooltip.cjs +4 -4
  53. package/dist/cjs/components/Chart/ChartTooltip.cjs.map +1 -1
  54. package/dist/cjs/components/Checkbox/Checkbox.cjs +13 -13
  55. package/dist/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
  56. package/dist/cjs/components/Chip/Chip.cjs +7 -7
  57. package/dist/cjs/components/Chip/Chip.cjs.map +1 -1
  58. package/dist/cjs/components/Count/Count.cjs +7 -7
  59. package/dist/cjs/components/Count/Count.cjs.map +1 -1
  60. package/dist/cjs/components/DatePicker/DatePicker.cjs +14 -14
  61. package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
  62. package/dist/cjs/components/Dialog/Dialog.cjs +6 -6
  63. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  64. package/dist/cjs/components/Divider/Divider.cjs +4 -4
  65. package/dist/cjs/components/Divider/Divider.cjs.map +1 -1
  66. package/dist/cjs/components/Drawer/Drawer.cjs +5 -5
  67. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  68. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +111 -0
  69. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -0
  70. package/dist/cjs/components/IconButton/IconButton.cjs +10 -10
  71. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  72. package/dist/cjs/components/Icons/LockerOffIcon.cjs +1 -1
  73. package/dist/cjs/components/Icons/LockerOffIcon.cjs.map +1 -1
  74. package/dist/cjs/components/Icons/LockerOnIcon.cjs +1 -1
  75. package/dist/cjs/components/Icons/LockerOnIcon.cjs.map +1 -1
  76. package/dist/cjs/components/InfoBox/InfoBox.cjs +6 -6
  77. package/dist/cjs/components/InfoBox/InfoBox.cjs.map +1 -1
  78. package/dist/cjs/components/Loader/Loader.cjs +1 -1
  79. package/dist/cjs/components/Loader/Loader.cjs.map +1 -1
  80. package/dist/cjs/components/Logo/Logo.cjs +13 -13
  81. package/dist/cjs/components/Logo/Logo.cjs.map +1 -1
  82. package/dist/cjs/components/MobileStepper/MobileStepper.cjs +2 -2
  83. package/dist/cjs/components/MobileStepper/MobileStepper.cjs.map +1 -1
  84. package/dist/cjs/components/OnlineBlinkingIcon/OnlineBlinkingIcon.cjs +45 -0
  85. package/dist/cjs/components/OnlineBlinkingIcon/OnlineBlinkingIcon.cjs.map +1 -0
  86. package/dist/cjs/components/Pagination/Pagination.cjs +3 -3
  87. package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
  88. package/dist/cjs/components/PasswordField/PasswordField.cjs +1 -1
  89. package/dist/cjs/components/PasswordField/PasswordField.cjs.map +1 -1
  90. package/dist/cjs/components/Pill/Pill.cjs +10 -10
  91. package/dist/cjs/components/Pill/Pill.cjs.map +1 -1
  92. package/dist/cjs/components/ProgressBar/ProgressBar.cjs +13 -13
  93. package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
  94. package/dist/cjs/components/Radio/Radio.cjs +4 -4
  95. package/dist/cjs/components/Radio/Radio.cjs.map +1 -1
  96. package/dist/cjs/components/Select/Select.cjs +13 -13
  97. package/dist/cjs/components/Select/Select.cjs.map +1 -1
  98. package/dist/cjs/components/Skeleton/Skeleton.cjs +2 -2
  99. package/dist/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
  100. package/dist/cjs/components/Slider/Slider.cjs +1 -1
  101. package/dist/cjs/components/Slider/Slider.cjs.map +1 -1
  102. package/dist/cjs/components/Slider/SliderLayout.cjs +5 -12
  103. package/dist/cjs/components/Slider/SliderLayout.cjs.map +1 -1
  104. package/dist/cjs/components/Slider/SliderThumb.cjs +6 -6
  105. package/dist/cjs/components/Slider/SliderThumb.cjs.map +1 -1
  106. package/dist/cjs/components/Snackbar/Snackbar.cjs +9 -9
  107. package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
  108. package/dist/cjs/components/Switch/Switch.cjs +3 -3
  109. package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
  110. package/dist/cjs/components/SwitchField/SwitchField.cjs +5 -5
  111. package/dist/cjs/components/SwitchField/SwitchField.cjs.map +1 -1
  112. package/dist/cjs/components/SwitchToggle/SwitchToggle.cjs +4 -4
  113. package/dist/cjs/components/SwitchToggle/SwitchToggle.cjs.map +1 -1
  114. package/dist/cjs/components/Tabs/TabsList.cjs +3 -3
  115. package/dist/cjs/components/Tabs/TabsList.cjs.map +1 -1
  116. package/dist/cjs/components/Tabs/TabsTrigger.cjs +8 -8
  117. package/dist/cjs/components/Tabs/TabsTrigger.cjs.map +1 -1
  118. package/dist/cjs/components/TextArea/TextArea.cjs +7 -7
  119. package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
  120. package/dist/cjs/components/TextField/TextField.cjs +11 -11
  121. package/dist/cjs/components/TextField/TextField.cjs.map +1 -1
  122. package/dist/cjs/components/Toast/Toast.cjs +7 -7
  123. package/dist/cjs/components/Toast/Toast.cjs.map +1 -1
  124. package/dist/cjs/components/Tooltip/Tooltip.cjs +1 -1
  125. package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  126. package/dist/cjs/index.cjs +12 -0
  127. package/dist/cjs/index.cjs.map +1 -1
  128. package/dist/components/Accordion/AccordionContent.mjs +1 -1
  129. package/dist/components/Accordion/AccordionContent.mjs.map +1 -1
  130. package/dist/components/Accordion/AccordionItem.mjs +1 -1
  131. package/dist/components/Accordion/AccordionItem.mjs.map +1 -1
  132. package/dist/components/Accordion/AccordionTrigger.mjs +5 -5
  133. package/dist/components/Accordion/AccordionTrigger.mjs.map +1 -1
  134. package/dist/components/Alert/Alert.mjs +11 -11
  135. package/dist/components/Alert/Alert.mjs.map +1 -1
  136. package/dist/components/AudioUpload/AudioUpload.mjs +12 -12
  137. package/dist/components/AudioUpload/AudioUpload.mjs.map +1 -1
  138. package/dist/components/AudioUpload/AudioWaveform.mjs +1 -1
  139. package/dist/components/AudioUpload/AudioWaveform.mjs.map +1 -1
  140. package/dist/components/Autocomplete/Autocomplete.mjs +12 -12
  141. package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
  142. package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs +3 -3
  143. package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs.map +1 -1
  144. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs +3 -3
  145. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs.map +1 -1
  146. package/dist/components/Autocomplete/AutocompleteTag.mjs +2 -2
  147. package/dist/components/Autocomplete/AutocompleteTag.mjs.map +1 -1
  148. package/dist/components/Avatar/Avatar.mjs +3 -3
  149. package/dist/components/Avatar/Avatar.mjs.map +1 -1
  150. package/dist/components/Badge/Badge.mjs +23 -23
  151. package/dist/components/Badge/Badge.mjs.map +1 -1
  152. package/dist/components/Banner/Banner.mjs +54 -0
  153. package/dist/components/Banner/Banner.mjs.map +1 -0
  154. package/dist/components/BottomNavigation/BottomNavigation.mjs +1 -1
  155. package/dist/components/BottomNavigation/BottomNavigation.mjs.map +1 -1
  156. package/dist/components/BottomNavigation/BottomNavigationAction.mjs +2 -2
  157. package/dist/components/BottomNavigation/BottomNavigationAction.mjs.map +1 -1
  158. package/dist/components/Breadcrumb/Breadcrumb.mjs +3 -3
  159. package/dist/components/Breadcrumb/Breadcrumb.mjs.map +1 -1
  160. package/dist/components/Button/Button.mjs +10 -10
  161. package/dist/components/Button/Button.mjs.map +1 -1
  162. package/dist/components/Card/Card.mjs +6 -6
  163. package/dist/components/Card/Card.mjs.map +1 -1
  164. package/dist/components/Chart/ChartCard.mjs +6 -6
  165. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  166. package/dist/components/Chart/ChartCenterLabel.mjs +2 -2
  167. package/dist/components/Chart/ChartCenterLabel.mjs.map +1 -1
  168. package/dist/components/Chart/ChartContainer.mjs +7 -7
  169. package/dist/components/Chart/ChartContainer.mjs.map +1 -1
  170. package/dist/components/Chart/ChartLegend.mjs +1 -1
  171. package/dist/components/Chart/ChartLegend.mjs.map +1 -1
  172. package/dist/components/Chart/ChartLoadingOverlay.mjs +1 -1
  173. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  174. package/dist/components/Chart/ChartPieLegend.mjs +2 -2
  175. package/dist/components/Chart/ChartPieLegend.mjs.map +1 -1
  176. package/dist/components/Chart/ChartSeriesToggle.mjs +2 -2
  177. package/dist/components/Chart/ChartSeriesToggle.mjs.map +1 -1
  178. package/dist/components/Chart/ChartTooltip.mjs +4 -4
  179. package/dist/components/Chart/ChartTooltip.mjs.map +1 -1
  180. package/dist/components/Checkbox/Checkbox.mjs +13 -13
  181. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  182. package/dist/components/Chip/Chip.mjs +7 -7
  183. package/dist/components/Chip/Chip.mjs.map +1 -1
  184. package/dist/components/Count/Count.mjs +7 -7
  185. package/dist/components/Count/Count.mjs.map +1 -1
  186. package/dist/components/DatePicker/DatePicker.mjs +14 -14
  187. package/dist/components/DatePicker/DatePicker.mjs.map +1 -1
  188. package/dist/components/Dialog/Dialog.mjs +6 -6
  189. package/dist/components/Dialog/Dialog.mjs.map +1 -1
  190. package/dist/components/Divider/Divider.mjs +4 -4
  191. package/dist/components/Divider/Divider.mjs.map +1 -1
  192. package/dist/components/Drawer/Drawer.mjs +5 -5
  193. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  194. package/dist/components/DropdownMenu/DropdownMenu.mjs +93 -0
  195. package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -0
  196. package/dist/components/IconButton/IconButton.mjs +10 -10
  197. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  198. package/dist/components/Icons/LockerOffIcon.mjs +1 -1
  199. package/dist/components/Icons/LockerOffIcon.mjs.map +1 -1
  200. package/dist/components/Icons/LockerOnIcon.mjs +1 -1
  201. package/dist/components/Icons/LockerOnIcon.mjs.map +1 -1
  202. package/dist/components/InfoBox/InfoBox.mjs +6 -6
  203. package/dist/components/InfoBox/InfoBox.mjs.map +1 -1
  204. package/dist/components/Loader/Loader.mjs +1 -1
  205. package/dist/components/Loader/Loader.mjs.map +1 -1
  206. package/dist/components/Logo/Logo.mjs +13 -13
  207. package/dist/components/Logo/Logo.mjs.map +1 -1
  208. package/dist/components/MobileStepper/MobileStepper.mjs +2 -2
  209. package/dist/components/MobileStepper/MobileStepper.mjs.map +1 -1
  210. package/dist/components/OnlineBlinkingIcon/OnlineBlinkingIcon.mjs +28 -0
  211. package/dist/components/OnlineBlinkingIcon/OnlineBlinkingIcon.mjs.map +1 -0
  212. package/dist/components/Pagination/Pagination.mjs +3 -3
  213. package/dist/components/Pagination/Pagination.mjs.map +1 -1
  214. package/dist/components/PasswordField/PasswordField.mjs +1 -1
  215. package/dist/components/PasswordField/PasswordField.mjs.map +1 -1
  216. package/dist/components/Pill/Pill.mjs +10 -10
  217. package/dist/components/Pill/Pill.mjs.map +1 -1
  218. package/dist/components/ProgressBar/ProgressBar.mjs +13 -13
  219. package/dist/components/ProgressBar/ProgressBar.mjs.map +1 -1
  220. package/dist/components/Radio/Radio.mjs +4 -4
  221. package/dist/components/Radio/Radio.mjs.map +1 -1
  222. package/dist/components/Select/Select.mjs +13 -13
  223. package/dist/components/Select/Select.mjs.map +1 -1
  224. package/dist/components/Skeleton/Skeleton.mjs +2 -2
  225. package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
  226. package/dist/components/Slider/Slider.mjs +1 -1
  227. package/dist/components/Slider/Slider.mjs.map +1 -1
  228. package/dist/components/Slider/SliderLayout.mjs +5 -12
  229. package/dist/components/Slider/SliderLayout.mjs.map +1 -1
  230. package/dist/components/Slider/SliderThumb.mjs +6 -6
  231. package/dist/components/Slider/SliderThumb.mjs.map +1 -1
  232. package/dist/components/Snackbar/Snackbar.mjs +9 -9
  233. package/dist/components/Snackbar/Snackbar.mjs.map +1 -1
  234. package/dist/components/Switch/Switch.mjs +3 -3
  235. package/dist/components/Switch/Switch.mjs.map +1 -1
  236. package/dist/components/SwitchField/SwitchField.mjs +5 -5
  237. package/dist/components/SwitchField/SwitchField.mjs.map +1 -1
  238. package/dist/components/SwitchToggle/SwitchToggle.mjs +4 -4
  239. package/dist/components/SwitchToggle/SwitchToggle.mjs.map +1 -1
  240. package/dist/components/Tabs/TabsList.mjs +3 -3
  241. package/dist/components/Tabs/TabsList.mjs.map +1 -1
  242. package/dist/components/Tabs/TabsTrigger.mjs +8 -8
  243. package/dist/components/Tabs/TabsTrigger.mjs.map +1 -1
  244. package/dist/components/TextArea/TextArea.mjs +7 -7
  245. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  246. package/dist/components/TextField/TextField.mjs +11 -11
  247. package/dist/components/TextField/TextField.mjs.map +1 -1
  248. package/dist/components/Toast/Toast.mjs +7 -7
  249. package/dist/components/Toast/Toast.mjs.map +1 -1
  250. package/dist/components/Tooltip/Tooltip.mjs +1 -1
  251. package/dist/components/Tooltip/Tooltip.mjs.map +1 -1
  252. package/dist/index.d.ts +152 -0
  253. package/dist/index.mjs +12 -0
  254. package/dist/index.mjs.map +1 -1
  255. package/dist/styles/theme.css +378 -253
  256. package/package.json +2 -1
package/dist/charts.d.ts CHANGED
@@ -78,7 +78,7 @@ export declare interface ChartCenterLabelProps extends Omit<React_2.SVGAttribute
78
78
  value: React_2.ReactNode;
79
79
  /** Secondary text below the value. */
80
80
  subtitle: React_2.ReactNode;
81
- /** Custom className for the value tspan. @default "fill-foreground-default font-bold text-3xl" */
81
+ /** Custom className for the value tspan. @default "fill-content-primary font-bold text-3xl" */
82
82
  valueClassName?: string;
83
83
  }
84
84
 
@@ -39,7 +39,7 @@ const AccordionContent = React__namespace.forwardRef(({ className, children, noP
39
39
  {
40
40
  className: cn.cn(
41
41
  "overflow-wrap-anywhere min-w-0",
42
- "typography-regular-body-md text-foreground-secondary",
42
+ "typography-regular-body-md text-content-secondary",
43
43
  !noPadding && "px-3 pt-2 pb-3"
44
44
  ),
45
45
  children
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionContent.cjs","sources":["../../../../src/components/Accordion/AccordionContent.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link AccordionContent} panel component. */\nexport type AccordionContentProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Content\n> & {\n /** Remove the default inner padding (`px-3 pb-3`). Useful when you need custom content layout. */\n noPadding?: boolean;\n};\n\n/** Renders the collapsible content panel for an {@link AccordionItem}. Animates open and closed. */\nexport const AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n AccordionContentProps\n>(({ className, children, noPadding, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"overflow-hidden\",\n \"motion-safe:data-[state=closed]:animate-accordion-collapse\",\n \"motion-safe:data-[state=open]:animate-accordion-expand\",\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n \"overflow-wrap-anywhere min-w-0\",\n \"typography-regular-body-md text-foreground-secondary\",\n !noPadding && \"px-3 pt-2 pb-3\",\n )}\n >\n {children}\n </div>\n </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = \"AccordionContent\";\n"],"names":["React","jsx","AccordionPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,mBAAmBA,iBAAM,WAGpC,CAAC,EAAE,WAAW,UAAU,WAAW,GAAG,SAAS,QAC/CC,2BAAAA;AAAAA,EAACC,8BAAmB;AAAA,EAAnB;AAAA,IACC;AAAA,IACA,WAAWC,GAAAA;AAAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAED,GAAG;AAAA,IAEJ,UAAAF,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWE,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,UACA,CAAC,aAAa;AAAA,QAAA;AAAA,QAGf;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AACF,CACD;AAED,iBAAiB,cAAc;;"}
1
+ {"version":3,"file":"AccordionContent.cjs","sources":["../../../../src/components/Accordion/AccordionContent.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link AccordionContent} panel component. */\nexport type AccordionContentProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Content\n> & {\n /** Remove the default inner padding (`px-3 pb-3`). Useful when you need custom content layout. */\n noPadding?: boolean;\n};\n\n/** Renders the collapsible content panel for an {@link AccordionItem}. Animates open and closed. */\nexport const AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n AccordionContentProps\n>(({ className, children, noPadding, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className={cn(\n \"overflow-hidden\",\n \"motion-safe:data-[state=closed]:animate-accordion-collapse\",\n \"motion-safe:data-[state=open]:animate-accordion-expand\",\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n \"overflow-wrap-anywhere min-w-0\",\n \"typography-regular-body-md text-content-secondary\",\n !noPadding && \"px-3 pt-2 pb-3\",\n )}\n >\n {children}\n </div>\n </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = \"AccordionContent\";\n"],"names":["React","jsx","AccordionPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,mBAAmBA,iBAAM,WAGpC,CAAC,EAAE,WAAW,UAAU,WAAW,GAAG,SAAS,QAC/CC,2BAAAA;AAAAA,EAACC,8BAAmB;AAAA,EAAnB;AAAA,IACC;AAAA,IACA,WAAWC,GAAAA;AAAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAED,GAAG;AAAA,IAEJ,UAAAF,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWE,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,UACA,CAAC,aAAa;AAAA,QAAA;AAAA,QAGf;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AACF,CACD;AAED,iBAAiB,cAAc;;"}
@@ -27,7 +27,7 @@ const AccordionItem = React__namespace.forwardRef(({ className, ...props }, ref)
27
27
  AccordionPrimitive__namespace.Item,
28
28
  {
29
29
  ref,
30
- className: cn.cn("rounded-xl bg-surface-container", "border border-neutral-200", className),
30
+ className: cn.cn("rounded-sm bg-surface-primary", "border border-border-primary", className),
31
31
  ...props
32
32
  }
33
33
  ));
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.cjs","sources":["../../../../src/components/Accordion/AccordionItem.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link AccordionItem} component. */\nexport type AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;\n\n/** A single collapsible section within an {@link Accordion}. Contains an {@link AccordionTrigger} and {@link AccordionContent}. */\nexport const AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n AccordionItemProps\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"rounded-xl bg-surface-container\", \"border border-neutral-200\", className)}\n {...props}\n />\n));\n\nAccordionItem.displayName = \"AccordionItem\";\n"],"names":["React","jsx","AccordionPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQO,MAAM,gBAAgBA,iBAAM,WAGjC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAAA;AAAAA,EAACC,8BAAmB;AAAA,EAAnB;AAAA,IACC;AAAA,IACA,WAAWC,GAAAA,GAAG,mCAAmC,6BAA6B,SAAS;AAAA,IACtF,GAAG;AAAA,EAAA;AACN,CACD;AAED,cAAc,cAAc;;"}
1
+ {"version":3,"file":"AccordionItem.cjs","sources":["../../../../src/components/Accordion/AccordionItem.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link AccordionItem} component. */\nexport type AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;\n\n/** A single collapsible section within an {@link Accordion}. Contains an {@link AccordionTrigger} and {@link AccordionContent}. */\nexport const AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n AccordionItemProps\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"rounded-sm bg-surface-primary\", \"border border-border-primary\", className)}\n {...props}\n />\n));\n\nAccordionItem.displayName = \"AccordionItem\";\n"],"names":["React","jsx","AccordionPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQO,MAAM,gBAAgBA,iBAAM,WAGjC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAAA;AAAAA,EAACC,8BAAmB;AAAA,EAAnB;AAAA,IACC;AAAA,IACA,WAAWC,GAAAA,GAAG,iCAAiC,gCAAgC,SAAS;AAAA,IACvF,GAAG;AAAA,EAAA;AACN,CACD;AAED,cAAc,cAAc;;"}
@@ -26,19 +26,19 @@ const AccordionPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(A
26
26
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
27
27
  const AccordionTrigger = React__namespace.forwardRef(({ className, children, icon, ...props }, ref) => {
28
28
  const showIcon = icon !== null;
29
- const iconElement = icon === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon.ChevronDownIcon, { className: "size-4 shrink-0 text-foreground-secondary" }) : icon;
29
+ const iconElement = icon === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon.ChevronDownIcon, { className: "size-4 shrink-0 text-content-secondary" }) : icon;
30
30
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
31
31
  AccordionPrimitive__namespace.Trigger,
32
32
  {
33
33
  ref,
34
34
  className: cn.cn(
35
35
  "flex flex-1 items-center justify-between gap-3",
36
- "rounded-xl px-3 py-3",
37
- "typography-semibold-body-md text-foreground-default",
36
+ "rounded-sm px-3 py-3",
37
+ "typography-semibold-body-md text-content-primary",
38
38
  "cursor-pointer",
39
39
  "motion-safe:transition-colors motion-safe:duration-200 motion-safe:ease-in-out",
40
- "hover:bg-neutral-100",
41
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-page",
40
+ "hover:bg-neutral-alphas-100",
41
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-interaction-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-primary",
42
42
  "data-disabled:pointer-events-none data-disabled:opacity-50",
43
43
  className
44
44
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionTrigger.cjs","sources":["../../../../src/components/Accordion/AccordionTrigger.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\n\n/** Props for the {@link AccordionTrigger} button component. */\nexport type AccordionTriggerProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Trigger\n> & {\n /** Custom icon element. Defaults to `ChevronDownIcon`. Pass `null` to suppress the icon entirely. */\n icon?: React.ReactNode | null;\n};\n\n/** An interactive button that toggles the visibility of its associated {@link AccordionContent} panel. */\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>(({ className, children, icon, ...props }, ref) => {\n const showIcon = icon !== null;\n const iconElement =\n icon === undefined ? (\n <ChevronDownIcon className=\"size-4 shrink-0 text-foreground-secondary\" />\n ) : (\n icon\n );\n\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between gap-3\",\n \"rounded-xl px-3 py-3\",\n \"typography-semibold-body-md text-foreground-default\",\n \"cursor-pointer\",\n \"motion-safe:transition-colors motion-safe:duration-200 motion-safe:ease-in-out\",\n \"hover:bg-neutral-100\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-page\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate text-left\">{children}</span>\n {showIcon && (\n <span className=\"shrink-0 motion-safe:transition-transform motion-safe:duration-200 [[data-state=open]>&]:rotate-180\">\n {iconElement}\n </span>\n )}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n});\n\nAccordionTrigger.displayName = \"AccordionTrigger\";\n"],"names":["React","ChevronDownIcon","jsx","AccordionPrimitive","jsxs","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,mBAAmBA,iBAAM,WAGpC,CAAC,EAAE,WAAW,UAAU,MAAM,GAAG,MAAA,GAAS,QAAQ;AAClD,QAAM,WAAW,SAAS;AAC1B,QAAM,cACJ,SAAS,wCACNC,gBAAAA,iBAAA,EAAgB,WAAU,6CAA4C,IAEvE;AAGJ,SACEC,2BAAAA,IAACC,8BAAmB,QAAnB,EAA0B,WAAU,QACnC,UAAAC,2BAAAA;AAAAA,IAACD,8BAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAWE,GAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAH,2BAAAA,IAAC,QAAA,EAAK,WAAU,qCAAqC,SAAA,CAAS;AAAA,QAC7D,YACCA,2BAAAA,IAAC,QAAA,EAAK,WAAU,uGACb,UAAA,YAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,iBAAiB,cAAc;;"}
1
+ {"version":3,"file":"AccordionTrigger.cjs","sources":["../../../../src/components/Accordion/AccordionTrigger.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\n\n/** Props for the {@link AccordionTrigger} button component. */\nexport type AccordionTriggerProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Trigger\n> & {\n /** Custom icon element. Defaults to `ChevronDownIcon`. Pass `null` to suppress the icon entirely. */\n icon?: React.ReactNode | null;\n};\n\n/** An interactive button that toggles the visibility of its associated {@link AccordionContent} panel. */\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>(({ className, children, icon, ...props }, ref) => {\n const showIcon = icon !== null;\n const iconElement =\n icon === undefined ? (\n <ChevronDownIcon className=\"size-4 shrink-0 text-content-secondary\" />\n ) : (\n icon\n );\n\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between gap-3\",\n \"rounded-sm px-3 py-3\",\n \"typography-semibold-body-md text-content-primary\",\n \"cursor-pointer\",\n \"motion-safe:transition-colors motion-safe:duration-200 motion-safe:ease-in-out\",\n \"hover:bg-neutral-alphas-100\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-interaction-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-primary\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate text-left\">{children}</span>\n {showIcon && (\n <span className=\"shrink-0 motion-safe:transition-transform motion-safe:duration-200 [[data-state=open]>&]:rotate-180\">\n {iconElement}\n </span>\n )}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n});\n\nAccordionTrigger.displayName = \"AccordionTrigger\";\n"],"names":["React","ChevronDownIcon","jsx","AccordionPrimitive","jsxs","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,mBAAmBA,iBAAM,WAGpC,CAAC,EAAE,WAAW,UAAU,MAAM,GAAG,MAAA,GAAS,QAAQ;AAClD,QAAM,WAAW,SAAS;AAC1B,QAAM,cACJ,SAAS,wCACNC,gBAAAA,iBAAA,EAAgB,WAAU,0CAAyC,IAEpE;AAGJ,SACEC,2BAAAA,IAACC,8BAAmB,QAAnB,EAA0B,WAAU,QACnC,UAAAC,2BAAAA;AAAAA,IAACD,8BAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAWE,GAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAH,2BAAAA,IAAC,QAAA,EAAK,WAAU,qCAAqC,SAAA,CAAS;AAAA,QAC7D,YACCA,2BAAAA,IAAC,QAAA,EAAK,WAAU,uGACb,UAAA,YAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,iBAAiB,cAAc;;"}
@@ -34,10 +34,10 @@ const DEFAULT_ICONS = {
34
34
  error: /* @__PURE__ */ jsxRuntime.jsx(ErrorCircleIcon.ErrorCircleIcon, {})
35
35
  };
36
36
  const CLOSE_BUTTON_CLASSES = {
37
- info: "hover:bg-info-default/10 active:bg-info-default/20 text-info-default motion-safe:transition-colors motion-safe:duration-150",
38
- success: "hover:bg-success-default/10 active:bg-success-default/20 text-success-default motion-safe:transition-colors motion-safe:duration-150",
39
- warning: "hover:bg-warning-default/10 active:bg-warning-default/20 text-warning-default motion-safe:transition-colors motion-safe:duration-150",
40
- error: "hover:bg-error-default/10 active:bg-error-default/20 text-error-default motion-safe:transition-colors motion-safe:duration-150"
37
+ info: "hover:bg-info-content/10 active:bg-info-content/20 text-info-content motion-safe:transition-colors motion-safe:duration-150",
38
+ success: "hover:bg-success-content/10 active:bg-success-content/20 text-success-content motion-safe:transition-colors motion-safe:duration-150",
39
+ warning: "hover:bg-warning-content/10 active:bg-warning-content/20 text-warning-content motion-safe:transition-colors motion-safe:duration-150",
40
+ error: "hover:bg-error-content/10 active:bg-error-content/20 text-error-content motion-safe:transition-colors motion-safe:duration-150"
41
41
  };
42
42
  const Alert = React__namespace.forwardRef(
43
43
  ({
@@ -59,24 +59,24 @@ const Alert = React__namespace.forwardRef(
59
59
  role: "alert",
60
60
  "data-testid": "alert",
61
61
  className: cn.cn(
62
- "grid gap-x-3 rounded-lg p-4 text-sm leading-[18px]",
62
+ "grid gap-x-3 rounded-xs p-4 text-sm leading-[18px]",
63
63
  resolvedIcon && closable && "grid-cols-[auto_1fr_auto]",
64
64
  resolvedIcon && !closable && "grid-cols-[auto_1fr]",
65
65
  !resolvedIcon && closable && "grid-cols-[1fr_auto]",
66
66
  !resolvedIcon && !closable && "grid-cols-[1fr]",
67
67
  title && children ? "items-start" : "items-center",
68
- variant === "info" && "bg-info-background text-info-default",
69
- variant === "success" && "bg-success-background text-success-default",
70
- variant === "warning" && "bg-warning-background text-warning-default",
71
- variant === "error" && "bg-error-background text-error-default",
68
+ variant === "info" && "bg-info-surface text-info-content",
69
+ variant === "success" && "bg-success-surface text-success-content",
70
+ variant === "warning" && "bg-warning-surface text-warning-content",
71
+ variant === "error" && "bg-error-surface text-error-content",
72
72
  className
73
73
  ),
74
74
  ...props,
75
75
  children: [
76
76
  resolvedIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start", "aria-hidden": "true", children: resolvedIcon }),
77
77
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
78
- title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-semibold-body-md text-foreground-default", children: title }),
79
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-regular-body-md text-foreground-secondary", children })
78
+ title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-semibold-body-md text-content-primary", children: title }),
79
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-regular-body-md text-content-primary", children })
80
80
  ] }),
81
81
  closable && /* @__PURE__ */ jsxRuntime.jsx(
82
82
  Button.Button,
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.cjs","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { CheckCircleIcon } from \"../Icons/CheckCircleIcon\";\nimport { CrossIcon } from \"../Icons/CrossIcon\";\nimport { ErrorCircleIcon } from \"../Icons/ErrorCircleIcon\";\nimport { InfoCircleIcon } from \"../Icons/InfoCircleIcon\";\nimport { WarningTriangleIcon } from \"../Icons/WarningTriangleIcon\";\n\n/** Visual style variant of the alert. */\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nconst DEFAULT_ICONS: Record<AlertVariant, React.ReactNode> = {\n info: <InfoCircleIcon />,\n success: <CheckCircleIcon />,\n warning: <WarningTriangleIcon />,\n error: <ErrorCircleIcon />,\n};\n\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual style variant of the alert. @default \"info\" */\n variant?: AlertVariant;\n /** Optional title text displayed in bold above the description. */\n title?: string;\n /** Custom icon override. Pass `null` to hide the icon entirely. Each variant shows a default icon when left `undefined`. */\n icon?: React.ReactNode | null;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close alert\" */\n closeLabel?: string;\n}\n\nconst CLOSE_BUTTON_CLASSES: Record<AlertVariant, string> = {\n info: \"hover:bg-info-default/10 active:bg-info-default/20 text-info-default motion-safe:transition-colors motion-safe:duration-150\",\n success:\n \"hover:bg-success-default/10 active:bg-success-default/20 text-success-default motion-safe:transition-colors motion-safe:duration-150\",\n warning:\n \"hover:bg-warning-default/10 active:bg-warning-default/20 text-warning-default motion-safe:transition-colors motion-safe:duration-150\",\n error:\n \"hover:bg-error-default/10 active:bg-error-default/20 text-error-default motion-safe:transition-colors motion-safe:duration-150\",\n};\n\n/**\n * Displays a contextual feedback message to the user.\n *\n * Supports `info`, `success`, `warning`, and `error` variants with a default\n * icon per variant, optional title, description, and dismiss button.\n *\n * Each variant renders a default icon automatically. Pass a custom `icon` to\n * override, or `icon={null}` to hide the icon entirely.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" title=\"Saved\" closable onClose={handleClose}>\n * Your changes have been saved.\n * </Alert>\n * ```\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = \"info\",\n title,\n icon,\n closable = false,\n onClose,\n closeLabel = \"Close alert\",\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedIcon = icon === null ? null : (icon ?? DEFAULT_ICONS[variant]);\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n data-testid=\"alert\"\n className={cn(\n \"grid gap-x-3 rounded-lg p-4 text-sm leading-[18px]\",\n resolvedIcon && closable && \"grid-cols-[auto_1fr_auto]\",\n resolvedIcon && !closable && \"grid-cols-[auto_1fr]\",\n !resolvedIcon && closable && \"grid-cols-[1fr_auto]\",\n !resolvedIcon && !closable && \"grid-cols-[1fr]\",\n title && children ? \"items-start\" : \"items-center\",\n variant === \"info\" && \"bg-info-background text-info-default\",\n variant === \"success\" && \"bg-success-background text-success-default\",\n variant === \"warning\" && \"bg-warning-background text-warning-default\",\n variant === \"error\" && \"bg-error-background text-error-default\",\n className,\n )}\n {...props}\n >\n {resolvedIcon && (\n <span className=\"flex shrink-0 items-start\" aria-hidden=\"true\">\n {resolvedIcon}\n </span>\n )}\n\n <div className=\"flex min-w-0 flex-col gap-2\">\n {title && (\n <div className=\"typography-semibold-body-md text-foreground-default\">{title}</div>\n )}\n <div className=\"typography-regular-body-md text-foreground-secondary\">{children}</div>\n </div>\n\n {closable && (\n <Button\n variant=\"tertiary\"\n size=\"24\"\n onClick={onClose}\n className={cn(\"self-start px-0\", CLOSE_BUTTON_CLASSES[variant])}\n aria-label={closeLabel}\n >\n <CrossIcon />\n </Button>\n )}\n </div>\n );\n },\n);\n\nAlert.displayName = \"Alert\";\n"],"names":["InfoCircleIcon","CheckCircleIcon","WarningTriangleIcon","ErrorCircleIcon","React","jsxs","cn","jsx","Button","CrossIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,gBAAuD;AAAA,EAC3D,qCAAOA,eAAAA,gBAAA,EAAe;AAAA,EACtB,wCAAUC,gBAAAA,iBAAA,EAAgB;AAAA,EAC1B,wCAAUC,oBAAAA,qBAAA,EAAoB;AAAA,EAC9B,sCAAQC,gBAAAA,iBAAA,CAAA,CAAgB;AAC1B;AAiBA,MAAM,uBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,SACE;AAAA,EACF,SACE;AAAA,EACF,OACE;AACJ;AAkBO,MAAM,QAAQC,iBAAM;AAAA,EACzB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,eAAe,SAAS,OAAO,OAAQ,QAAQ,cAAc,OAAO;AAE1E,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA,gBAAgB,YAAY;AAAA,UAC5B,gBAAgB,CAAC,YAAY;AAAA,UAC7B,CAAC,gBAAgB,YAAY;AAAA,UAC7B,CAAC,gBAAgB,CAAC,YAAY;AAAA,UAC9B,SAAS,WAAW,gBAAgB;AAAA,UACpC,YAAY,UAAU;AAAA,UACtB,YAAY,aAAa;AAAA,UACzB,YAAY,aAAa;AAAA,UACzB,YAAY,WAAW;AAAA,UACvB;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,+CACE,QAAA,EAAK,WAAU,6BAA4B,eAAY,QACrD,UAAA,cACH;AAAA,UAGFD,2BAAAA,KAAC,OAAA,EAAI,WAAU,+BACZ,UAAA;AAAA,YAAA,SACCE,2BAAAA,IAAC,OAAA,EAAI,WAAU,uDAAuD,UAAA,OAAM;AAAA,YAE9EA,2BAAAA,IAAC,OAAA,EAAI,WAAU,wDAAwD,SAAA,CAAS;AAAA,UAAA,GAClF;AAAA,UAEC,YACCA,2BAAAA;AAAAA,YAACC,OAAAA;AAAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS;AAAA,cACT,WAAWF,GAAAA,GAAG,mBAAmB,qBAAqB,OAAO,CAAC;AAAA,cAC9D,cAAY;AAAA,cAEZ,yCAACG,UAAAA,WAAA,CAAA,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,MAAM,cAAc;;"}
1
+ {"version":3,"file":"Alert.cjs","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { CheckCircleIcon } from \"../Icons/CheckCircleIcon\";\nimport { CrossIcon } from \"../Icons/CrossIcon\";\nimport { ErrorCircleIcon } from \"../Icons/ErrorCircleIcon\";\nimport { InfoCircleIcon } from \"../Icons/InfoCircleIcon\";\nimport { WarningTriangleIcon } from \"../Icons/WarningTriangleIcon\";\n\n/** Visual style variant of the alert. */\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nconst DEFAULT_ICONS: Record<AlertVariant, React.ReactNode> = {\n info: <InfoCircleIcon />,\n success: <CheckCircleIcon />,\n warning: <WarningTriangleIcon />,\n error: <ErrorCircleIcon />,\n};\n\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual style variant of the alert. @default \"info\" */\n variant?: AlertVariant;\n /** Optional title text displayed in bold above the description. */\n title?: string;\n /** Custom icon override. Pass `null` to hide the icon entirely. Each variant shows a default icon when left `undefined`. */\n icon?: React.ReactNode | null;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close alert\" */\n closeLabel?: string;\n}\n\nconst CLOSE_BUTTON_CLASSES: Record<AlertVariant, string> = {\n info: \"hover:bg-info-content/10 active:bg-info-content/20 text-info-content motion-safe:transition-colors motion-safe:duration-150\",\n success:\n \"hover:bg-success-content/10 active:bg-success-content/20 text-success-content motion-safe:transition-colors motion-safe:duration-150\",\n warning:\n \"hover:bg-warning-content/10 active:bg-warning-content/20 text-warning-content motion-safe:transition-colors motion-safe:duration-150\",\n error:\n \"hover:bg-error-content/10 active:bg-error-content/20 text-error-content motion-safe:transition-colors motion-safe:duration-150\",\n};\n\n/**\n * Displays a contextual feedback message to the user.\n *\n * Supports `info`, `success`, `warning`, and `error` variants with a default\n * icon per variant, optional title, description, and dismiss button.\n *\n * Each variant renders a default icon automatically. Pass a custom `icon` to\n * override, or `icon={null}` to hide the icon entirely.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" title=\"Saved\" closable onClose={handleClose}>\n * Your changes have been saved.\n * </Alert>\n * ```\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = \"info\",\n title,\n icon,\n closable = false,\n onClose,\n closeLabel = \"Close alert\",\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedIcon = icon === null ? null : (icon ?? DEFAULT_ICONS[variant]);\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n data-testid=\"alert\"\n className={cn(\n \"grid gap-x-3 rounded-xs p-4 text-sm leading-[18px]\",\n resolvedIcon && closable && \"grid-cols-[auto_1fr_auto]\",\n resolvedIcon && !closable && \"grid-cols-[auto_1fr]\",\n !resolvedIcon && closable && \"grid-cols-[1fr_auto]\",\n !resolvedIcon && !closable && \"grid-cols-[1fr]\",\n title && children ? \"items-start\" : \"items-center\",\n variant === \"info\" && \"bg-info-surface text-info-content\",\n variant === \"success\" && \"bg-success-surface text-success-content\",\n variant === \"warning\" && \"bg-warning-surface text-warning-content\",\n variant === \"error\" && \"bg-error-surface text-error-content\",\n className,\n )}\n {...props}\n >\n {resolvedIcon && (\n <span className=\"flex shrink-0 items-start\" aria-hidden=\"true\">\n {resolvedIcon}\n </span>\n )}\n\n <div className=\"flex min-w-0 flex-col gap-2\">\n {title && <div className=\"typography-semibold-body-md text-content-primary\">{title}</div>}\n <div className=\"typography-regular-body-md text-content-primary\">{children}</div>\n </div>\n\n {closable && (\n <Button\n variant=\"tertiary\"\n size=\"24\"\n onClick={onClose}\n className={cn(\"self-start px-0\", CLOSE_BUTTON_CLASSES[variant])}\n aria-label={closeLabel}\n >\n <CrossIcon />\n </Button>\n )}\n </div>\n );\n },\n);\n\nAlert.displayName = \"Alert\";\n"],"names":["InfoCircleIcon","CheckCircleIcon","WarningTriangleIcon","ErrorCircleIcon","React","jsxs","cn","jsx","Button","CrossIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,gBAAuD;AAAA,EAC3D,qCAAOA,eAAAA,gBAAA,EAAe;AAAA,EACtB,wCAAUC,gBAAAA,iBAAA,EAAgB;AAAA,EAC1B,wCAAUC,oBAAAA,qBAAA,EAAoB;AAAA,EAC9B,sCAAQC,gBAAAA,iBAAA,CAAA,CAAgB;AAC1B;AAiBA,MAAM,uBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,SACE;AAAA,EACF,SACE;AAAA,EACF,OACE;AACJ;AAkBO,MAAM,QAAQC,iBAAM;AAAA,EACzB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAA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espace.forwardRef(
161
161
  "data-testid": "audio-upload",
162
162
  "data-state": "recording",
163
163
  className: cn.cn(
164
- "flex flex-col items-center justify-center gap-2 rounded-xl bg-neutral-100 px-4 py-3",
164
+ "flex flex-col items-center justify-center gap-2 rounded-md bg-surface-secondary px-4 py-3",
165
165
  className
166
166
  ),
167
167
  ...props,
@@ -170,9 +170,9 @@ const AudioUpload = React__namespace.forwardRef(
170
170
  /* @__PURE__ */ jsxRuntime.jsx(
171
171
  "div",
172
172
  {
173
- className: "flex size-[72px] items-center justify-center rounded-full bg-neutral-400",
173
+ className: "flex size-[72px] items-center justify-center rounded-full bg-buttons-primary",
174
174
  "aria-hidden": "true",
175
- children: /* @__PURE__ */ jsxRuntime.jsx(MicrophoneIcon.MicrophoneIcon, { className: "size-5 text-foreground-inverse" })
175
+ children: /* @__PURE__ */ jsxRuntime.jsx(MicrophoneIcon.MicrophoneIcon, { className: "size-5 text-content-primary-inverted" })
176
176
  }
177
177
  ),
178
178
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -180,7 +180,7 @@ const AudioUpload = React__namespace.forwardRef(
180
180
  {
181
181
  role: "timer",
182
182
  "aria-label": "Recording time",
183
- className: "typography-regular-body-lg text-foreground-default",
183
+ className: "typography-regular-body-lg text-content-primary",
184
184
  children: [
185
185
  formattedElapsed,
186
186
  " / ",
@@ -203,7 +203,7 @@ const AudioUpload = React__namespace.forwardRef(
203
203
  ref: stopButtonRef,
204
204
  type: "button",
205
205
  onClick: handleStopClick,
206
- className: "mt-1 flex size-11 items-center justify-center rounded-full bg-error-default text-foreground-onaccentinverse transition-colors hover:bg-error-default/80 focus:shadow-focus-ring focus-visible:outline-none",
206
+ className: "mt-1 flex size-11 items-center justify-center rounded-full bg-error-content text-content-on-brand-inverted transition-colors hover:bg-error-content/80 focus:shadow-focus-ring focus-visible:outline-none",
207
207
  "aria-label": stopButtonAriaLabel,
208
208
  children: /* @__PURE__ */ jsxRuntime.jsx(StopIcon.StopIcon, { className: "size-5" })
209
209
  }
@@ -228,8 +228,8 @@ const AudioUpload = React__namespace.forwardRef(
228
228
  onDragOver: handleDragOver,
229
229
  onDragLeave: handleDragLeave,
230
230
  className: cn.cn(
231
- "flex flex-col items-center justify-center gap-2 rounded-xl bg-neutral-100 px-4 py-3 transition-colors",
232
- isDragActive && "bg-brand-accent-muted ring-2 ring-brand-accent-default",
231
+ "flex flex-col items-center justify-center gap-2 rounded-md bg-surface-secondary px-4 py-3 transition-colors",
232
+ isDragActive && "bg-brand-primary-muted ring-2 ring-brand-primary-default",
233
233
  disabled && "pointer-events-none opacity-50",
234
234
  className
235
235
  ),
@@ -252,15 +252,15 @@ const AudioUpload = React__namespace.forwardRef(
252
252
  "label",
253
253
  {
254
254
  htmlFor: inputId,
255
- className: "flex cursor-pointer flex-col items-center gap-2 rounded-lg px-2 py-1 peer-focus-visible:shadow-focus-ring",
255
+ className: "flex cursor-pointer flex-col items-center gap-2 rounded-xs px-2 py-1 peer-focus-visible:shadow-focus-ring",
256
256
  children: [
257
- /* @__PURE__ */ jsxRuntime.jsx(UploadCloudIcon.UploadCloudIcon, { className: "size-5 text-foreground-default" }),
258
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-semibold-body-lg text-center text-foreground-default", children: uploadTitle }),
257
+ /* @__PURE__ */ jsxRuntime.jsx(UploadCloudIcon.UploadCloudIcon, { className: "size-5 text-content-primary" }),
258
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-semibold-body-lg text-center text-content-primary", children: uploadTitle }),
259
259
  /* @__PURE__ */ jsxRuntime.jsx(
260
260
  "span",
261
261
  {
262
262
  id: descriptionId,
263
- className: "typography-regular-body-md text-center text-foreground-default",
263
+ className: "typography-regular-body-md text-center text-content-primary",
264
264
  children: uploadDescription
265
265
  }
266
266
  )
@@ -268,7 +268,7 @@ const AudioUpload = React__namespace.forwardRef(
268
268
  }
269
269
  ),
270
270
  allowRecording && isRecordingSupported && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
271
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-regular-body-md text-center text-foreground-default", children: separatorText }),
271
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "typography-regular-body-md text-center text-content-primary", children: separatorText }),
272
272
  /* @__PURE__ */ jsxRuntime.jsx(
273
273
  Button.Button,
274
274
  {
@@ -1 +1 @@
1
- {"version":3,"file":"AudioUpload.cjs","sources":["../../../../src/components/AudioUpload/AudioUpload.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { MicrophoneIcon } from \"../Icons/MicrophoneIcon\";\nimport { StopIcon } from \"../Icons/StopIcon\";\nimport { UploadCloudIcon } from \"../Icons/UploadCloudIcon\";\nimport { AudioWaveform } from \"./AudioWaveform\";\nimport { type AudioValidationError, formatAudioTime, validateAudioFile } from \"./audioUtils\";\nimport {\n DEFAULT_ACCEPTED_TYPES,\n DEFAULT_MAX_FILE_SIZE,\n DEFAULT_MAX_RECORDING_DURATION,\n DEFAULT_MIN_RECORDING_DURATION,\n} from \"./constants\";\nimport { useAudioRecorder } from \"./useAudioRecorder\";\n\n/** A file that was rejected during drop or browse, along with the reasons. */\nexport interface AudioFileRejection {\n /** The rejected file. */\n file: File;\n /** One or more validation errors explaining why the file was rejected. */\n errors: AudioValidationError[];\n}\n\nexport interface AudioUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onDrop\"> {\n /** Maximum file size in bytes. @default 10_485_760 (10MB) */\n maxFileSize?: number;\n /** Accepted audio MIME types. @default DEFAULT_ACCEPTED_TYPES */\n accept?: readonly string[];\n /** Maximum number of files per drop. @default 1 */\n maxFiles?: number;\n /** Whether to show the record audio button. @default true */\n allowRecording?: boolean;\n /** Maximum recording duration in seconds. @default 30 */\n maxRecordingDuration?: number;\n /** Minimum recording duration in seconds. @default 5 */\n minRecordingDuration?: number;\n\n /** Called when valid files are accepted via drop or browse */\n onFilesAccepted?: (files: File[]) => void;\n /** Called when files are rejected (wrong type, too large, etc.) */\n onFilesRejected?: (rejections: AudioFileRejection[]) => void;\n /** Called when a recording completes and meets minimum duration */\n onRecordingComplete?: (blob: Blob, durationMs: number) => void;\n /** Called when recording is stopped but does not meet minimum duration */\n onRecordingTooShort?: (durationMs: number, minDurationMs: number) => void;\n /** Called when microphone permission is denied or unavailable */\n onPermissionError?: (error: Error) => void;\n /** Called when an unexpected recording error occurs */\n onRecordingError?: (error: Error) => void;\n\n /** Upload area title text. @default \"Click to upload, or drag & drop\" */\n uploadTitle?: string;\n /** Upload area description text. @default \"Audio files only, up to 10MB each\" */\n uploadDescription?: string;\n /** Separator text between upload and record. @default \"or\" */\n separatorText?: string;\n /** Record button label. @default \"Record audio\" */\n recordButtonLabel?: string;\n /** Stop recording button aria-label. @default \"Stop recording\" */\n stopButtonAriaLabel?: string;\n\n /** Whether the component is disabled. @default false */\n disabled?: boolean;\n}\n\nfunction partitionFiles(\n files: File[],\n maxFileSize: number,\n accept: readonly string[],\n maxFiles: number,\n): { accepted: File[]; rejected: AudioFileRejection[] } {\n const accepted: File[] = [];\n const rejected: AudioFileRejection[] = [];\n\n for (const file of files) {\n const errors = validateAudioFile(file, { maxFileSize, acceptedTypes: accept });\n if (errors.length > 0) {\n rejected.push({ file, errors });\n } else {\n accepted.push(file);\n }\n }\n\n if (maxFiles > 0 && accepted.length > maxFiles) {\n const excess = accepted.splice(maxFiles);\n for (const file of excess) {\n rejected.push({\n file,\n errors: [{ code: \"too-many-files\", message: `Too many files. Maximum is ${maxFiles}` }],\n });\n }\n }\n\n return { accepted, rejected };\n}\n\n/**\n * Audio file upload with drag-and-drop and optional in-browser recording.\n * Supports file validation, multiple files, and real-time waveform visualization during recording.\n *\n * @example\n * ```tsx\n * <AudioUpload\n * onFilesAccepted={(files) => console.log(files)}\n * onRecordingComplete={(blob, duration) => console.log(blob, duration)}\n * />\n * ```\n */\nexport const AudioUpload = React.forwardRef<HTMLDivElement, AudioUploadProps>(\n (\n {\n className,\n maxFileSize = DEFAULT_MAX_FILE_SIZE,\n accept = DEFAULT_ACCEPTED_TYPES,\n maxFiles = 1,\n allowRecording = true,\n maxRecordingDuration = DEFAULT_MAX_RECORDING_DURATION,\n minRecordingDuration = DEFAULT_MIN_RECORDING_DURATION,\n onFilesAccepted,\n onFilesRejected,\n onRecordingComplete,\n onRecordingTooShort,\n onPermissionError,\n onRecordingError,\n uploadTitle = \"Click to upload, or drag & drop\",\n uploadDescription = \"Audio files only, up to 10MB each\",\n separatorText = \"or\",\n recordButtonLabel = \"Record audio\",\n stopButtonAriaLabel = \"Stop recording\",\n disabled = false,\n ...props\n },\n ref,\n ) => {\n const inputId = React.useId();\n const descriptionId = React.useId();\n const [isDragActive, setIsDragActive] = React.useState(false);\n const stopButtonRef = React.useRef<HTMLButtonElement>(null);\n\n const {\n isRecording,\n elapsedMs,\n startRecording,\n stopRecording,\n analyserNode,\n isSupported: isRecordingSupported,\n } = useAudioRecorder({\n maxDuration: maxRecordingDuration,\n minDuration: minRecordingDuration,\n onComplete: onRecordingComplete,\n onTooShort: onRecordingTooShort,\n onPermissionError,\n onError: onRecordingError,\n });\n\n const acceptString = accept.join(\",\");\n\n // Move focus to stop button when recording starts\n React.useEffect(() => {\n if (isRecording) {\n stopButtonRef.current?.focus();\n }\n }, [isRecording]);\n\n const validateAndAcceptFiles = React.useCallback(\n (files: FileList | File[]) => {\n const { accepted, rejected } = partitionFiles(\n Array.from(files),\n maxFileSize,\n accept,\n maxFiles,\n );\n if (accepted.length > 0) onFilesAccepted?.(accepted);\n if (rejected.length > 0) onFilesRejected?.(rejected);\n },\n [maxFileSize, accept, maxFiles, onFilesAccepted, onFilesRejected],\n );\n\n const handleDrop = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n\n if (disabled) return;\n\n const { files } = e.dataTransfer;\n if (files.length > 0) {\n validateAndAcceptFiles(files);\n }\n };\n\n const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) {\n setIsDragActive(true);\n }\n };\n\n const handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n };\n\n const handleFileInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const { files } = e.target;\n if (files && files.length > 0) {\n validateAndAcceptFiles(files);\n }\n // Reset input so same file can be selected again\n e.target.value = \"\";\n };\n\n const handleRecordClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n startRecording();\n };\n\n const handleStopClick = () => {\n stopRecording();\n };\n\n if (isRecording) {\n const formattedElapsed = formatAudioTime(elapsedMs);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> would break the public HTMLDivElement ref/props API\n <div\n ref={ref}\n role=\"group\"\n aria-label=\"Audio recording in progress\"\n data-testid=\"audio-upload\"\n data-state=\"recording\"\n className={cn(\n \"flex flex-col items-center justify-center gap-2 rounded-xl bg-neutral-100 px-4 py-3\",\n className,\n )}\n {...props}\n >\n <div className=\"flex flex-1 flex-col items-center gap-2\">\n <div\n className=\"flex size-[72px] items-center justify-center rounded-full bg-neutral-400\"\n aria-hidden=\"true\"\n >\n <MicrophoneIcon className=\"size-5 text-foreground-inverse\" />\n </div>\n\n <p\n role=\"timer\"\n aria-label=\"Recording time\"\n className=\"typography-regular-body-lg text-foreground-default\"\n >\n {formattedElapsed} / {formatAudioTime(maxRecordingDuration * 1000)}\n </p>\n </div>\n\n <div className=\"flex w-full items-center gap-2.5\" aria-hidden=\"true\">\n <AudioWaveform\n analyserNode={analyserNode}\n isRecording={isRecording}\n className=\"flex-1\"\n />\n </div>\n\n <button\n ref={stopButtonRef}\n type=\"button\"\n onClick={handleStopClick}\n className=\"mt-1 flex size-11 items-center justify-center rounded-full bg-error-default text-foreground-onaccentinverse transition-colors hover:bg-error-default/80 focus:shadow-focus-ring focus-visible:outline-none\"\n aria-label={stopButtonAriaLabel}\n >\n <StopIcon className=\"size-5\" />\n </button>\n </div>\n );\n }\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> would break the public HTMLDivElement ref/props API\n <div\n ref={ref}\n role=\"group\"\n aria-label=\"Audio upload\"\n data-testid=\"audio-upload\"\n data-state=\"idle\"\n aria-disabled={disabled || undefined}\n onDrop={handleDrop}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n className={cn(\n \"flex flex-col items-center justify-center gap-2 rounded-xl bg-neutral-100 px-4 py-3 transition-colors\",\n isDragActive && \"bg-brand-accent-muted ring-2 ring-brand-accent-default\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n {...props}\n >\n <input\n id={inputId}\n type=\"file\"\n accept={acceptString}\n multiple={maxFiles > 1}\n onChange={handleFileInputChange}\n className=\"peer sr-only\"\n disabled={disabled}\n aria-describedby={descriptionId}\n />\n\n <label\n htmlFor={inputId}\n className=\"flex cursor-pointer flex-col items-center gap-2 rounded-lg px-2 py-1 peer-focus-visible:shadow-focus-ring\"\n >\n <UploadCloudIcon className=\"size-5 text-foreground-default\" />\n\n <span className=\"typography-semibold-body-lg text-center text-foreground-default\">\n {uploadTitle}\n </span>\n\n <span\n id={descriptionId}\n className=\"typography-regular-body-md text-center text-foreground-default\"\n >\n {uploadDescription}\n </span>\n </label>\n\n {allowRecording && isRecordingSupported && (\n <>\n <p className=\"typography-regular-body-md text-center text-foreground-default\">\n {separatorText}\n </p>\n\n <Button\n variant=\"brand\"\n size=\"40\"\n leftIcon={<MicrophoneIcon className=\"size-5\" />}\n onClick={handleRecordClick}\n disabled={disabled}\n type=\"button\"\n >\n {recordButtonLabel}\n </Button>\n </>\n )}\n </div>\n );\n },\n);\n\nAudioUpload.displayName = \"AudioUpload\";\n"],"names":["validateAudioFile","React","DEFAULT_MAX_FILE_SIZE","DEFAULT_ACCEPTED_TYPES","DEFAULT_MAX_RECORDING_DURATION","DEFAULT_MIN_RECORDING_DURATION","useAudioRecorder","formatAudioTime","jsxs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,IAAI;AAAA,sBACJ,WAAU;AAAA,sBAET,UAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA;AAAA,YAAA;AAAA,YAGD,kBAAkB,wBACjBF,2BAAAA,KAAAO,WAAAA,UAAA,EACE,UAAA;AAAA,cAAAL,2BAAAA,IAAC,KAAA,EAAE,WAAU,kEACV,UAAA,eACH;AAAA,cAEAA,2BAAAA;AAAAA,gBAACM,OAAAA;AAAAA,gBAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,UAAUN,2BAAAA,IAACC,eAAAA,gBAAA,EAAe,WAAU,SAAA,CAAS;AAAA,kBAC7C,SAAS;AAAA,kBACT;AAAA,kBACA,MAAK;AAAA,kBAEJ,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;;"}
1
+ {"version":3,"file":"AudioUpload.cjs","sources":["../../../../src/components/AudioUpload/AudioUpload.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { MicrophoneIcon } from \"../Icons/MicrophoneIcon\";\nimport { StopIcon } from \"../Icons/StopIcon\";\nimport { UploadCloudIcon } from \"../Icons/UploadCloudIcon\";\nimport { AudioWaveform } from \"./AudioWaveform\";\nimport { type AudioValidationError, formatAudioTime, validateAudioFile } from \"./audioUtils\";\nimport {\n DEFAULT_ACCEPTED_TYPES,\n DEFAULT_MAX_FILE_SIZE,\n DEFAULT_MAX_RECORDING_DURATION,\n DEFAULT_MIN_RECORDING_DURATION,\n} from \"./constants\";\nimport { useAudioRecorder } from \"./useAudioRecorder\";\n\n/** A file that was rejected during drop or browse, along with the reasons. */\nexport interface AudioFileRejection {\n /** The rejected file. */\n file: File;\n /** One or more validation errors explaining why the file was rejected. */\n errors: AudioValidationError[];\n}\n\nexport interface AudioUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onDrop\"> {\n /** Maximum file size in bytes. @default 10_485_760 (10MB) */\n maxFileSize?: number;\n /** Accepted audio MIME types. @default DEFAULT_ACCEPTED_TYPES */\n accept?: readonly string[];\n /** Maximum number of files per drop. @default 1 */\n maxFiles?: number;\n /** Whether to show the record audio button. @default true */\n allowRecording?: boolean;\n /** Maximum recording duration in seconds. @default 30 */\n maxRecordingDuration?: number;\n /** Minimum recording duration in seconds. @default 5 */\n minRecordingDuration?: number;\n\n /** Called when valid files are accepted via drop or browse */\n onFilesAccepted?: (files: File[]) => void;\n /** Called when files are rejected (wrong type, too large, etc.) */\n onFilesRejected?: (rejections: AudioFileRejection[]) => void;\n /** Called when a recording completes and meets minimum duration */\n onRecordingComplete?: (blob: Blob, durationMs: number) => void;\n /** Called when recording is stopped but does not meet minimum duration */\n onRecordingTooShort?: (durationMs: number, minDurationMs: number) => void;\n /** Called when microphone permission is denied or unavailable */\n onPermissionError?: (error: Error) => void;\n /** Called when an unexpected recording error occurs */\n onRecordingError?: (error: Error) => void;\n\n /** Upload area title text. @default \"Click to upload, or drag & drop\" */\n uploadTitle?: string;\n /** Upload area description text. @default \"Audio files only, up to 10MB each\" */\n uploadDescription?: string;\n /** Separator text between upload and record. @default \"or\" */\n separatorText?: string;\n /** Record button label. @default \"Record audio\" */\n recordButtonLabel?: string;\n /** Stop recording button aria-label. @default \"Stop recording\" */\n stopButtonAriaLabel?: string;\n\n /** Whether the component is disabled. @default false */\n disabled?: boolean;\n}\n\nfunction partitionFiles(\n files: File[],\n maxFileSize: number,\n accept: readonly string[],\n maxFiles: number,\n): { accepted: File[]; rejected: AudioFileRejection[] } {\n const accepted: File[] = [];\n const rejected: AudioFileRejection[] = [];\n\n for (const file of files) {\n const errors = validateAudioFile(file, { maxFileSize, acceptedTypes: accept });\n if (errors.length > 0) {\n rejected.push({ file, errors });\n } else {\n accepted.push(file);\n }\n }\n\n if (maxFiles > 0 && accepted.length > maxFiles) {\n const excess = accepted.splice(maxFiles);\n for (const file of excess) {\n rejected.push({\n file,\n errors: [{ code: \"too-many-files\", message: `Too many files. Maximum is ${maxFiles}` }],\n });\n }\n }\n\n return { accepted, rejected };\n}\n\n/**\n * Audio file upload with drag-and-drop and optional in-browser recording.\n * Supports file validation, multiple files, and real-time waveform visualization during recording.\n *\n * @example\n * ```tsx\n * <AudioUpload\n * onFilesAccepted={(files) => console.log(files)}\n * onRecordingComplete={(blob, duration) => console.log(blob, duration)}\n * />\n * ```\n */\nexport const AudioUpload = React.forwardRef<HTMLDivElement, AudioUploadProps>(\n (\n {\n className,\n maxFileSize = DEFAULT_MAX_FILE_SIZE,\n accept = DEFAULT_ACCEPTED_TYPES,\n maxFiles = 1,\n allowRecording = true,\n maxRecordingDuration = DEFAULT_MAX_RECORDING_DURATION,\n minRecordingDuration = DEFAULT_MIN_RECORDING_DURATION,\n onFilesAccepted,\n onFilesRejected,\n onRecordingComplete,\n onRecordingTooShort,\n onPermissionError,\n onRecordingError,\n uploadTitle = \"Click to upload, or drag & drop\",\n uploadDescription = \"Audio files only, up to 10MB each\",\n separatorText = \"or\",\n recordButtonLabel = \"Record audio\",\n stopButtonAriaLabel = \"Stop recording\",\n disabled = false,\n ...props\n },\n ref,\n ) => {\n const inputId = React.useId();\n const descriptionId = React.useId();\n const [isDragActive, setIsDragActive] = React.useState(false);\n const stopButtonRef = React.useRef<HTMLButtonElement>(null);\n\n const {\n isRecording,\n elapsedMs,\n startRecording,\n stopRecording,\n analyserNode,\n isSupported: isRecordingSupported,\n } = useAudioRecorder({\n maxDuration: maxRecordingDuration,\n minDuration: minRecordingDuration,\n onComplete: onRecordingComplete,\n onTooShort: onRecordingTooShort,\n onPermissionError,\n onError: onRecordingError,\n });\n\n const acceptString = accept.join(\",\");\n\n // Move focus to stop button when recording starts\n React.useEffect(() => {\n if (isRecording) {\n stopButtonRef.current?.focus();\n }\n }, [isRecording]);\n\n const validateAndAcceptFiles = React.useCallback(\n (files: FileList | File[]) => {\n const { accepted, rejected } = partitionFiles(\n Array.from(files),\n maxFileSize,\n accept,\n maxFiles,\n );\n if (accepted.length > 0) onFilesAccepted?.(accepted);\n if (rejected.length > 0) onFilesRejected?.(rejected);\n },\n [maxFileSize, accept, maxFiles, onFilesAccepted, onFilesRejected],\n );\n\n const handleDrop = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n\n if (disabled) return;\n\n const { files } = e.dataTransfer;\n if (files.length > 0) {\n validateAndAcceptFiles(files);\n }\n };\n\n const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) {\n setIsDragActive(true);\n }\n };\n\n const handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragActive(false);\n };\n\n const handleFileInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const { files } = e.target;\n if (files && files.length > 0) {\n validateAndAcceptFiles(files);\n }\n // Reset input so same file can be selected again\n e.target.value = \"\";\n };\n\n const handleRecordClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n startRecording();\n };\n\n const handleStopClick = () => {\n stopRecording();\n };\n\n if (isRecording) {\n const formattedElapsed = formatAudioTime(elapsedMs);\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> would break the public HTMLDivElement ref/props API\n <div\n ref={ref}\n role=\"group\"\n aria-label=\"Audio recording in progress\"\n data-testid=\"audio-upload\"\n data-state=\"recording\"\n className={cn(\n \"flex flex-col items-center justify-center gap-2 rounded-md bg-surface-secondary px-4 py-3\",\n className,\n )}\n {...props}\n >\n <div className=\"flex flex-1 flex-col items-center gap-2\">\n <div\n className=\"flex size-[72px] items-center justify-center rounded-full bg-buttons-primary\"\n aria-hidden=\"true\"\n >\n <MicrophoneIcon className=\"size-5 text-content-primary-inverted\" />\n </div>\n\n <p\n role=\"timer\"\n aria-label=\"Recording time\"\n className=\"typography-regular-body-lg text-content-primary\"\n >\n {formattedElapsed} / {formatAudioTime(maxRecordingDuration * 1000)}\n </p>\n </div>\n\n <div className=\"flex w-full items-center gap-2.5\" aria-hidden=\"true\">\n <AudioWaveform\n analyserNode={analyserNode}\n isRecording={isRecording}\n className=\"flex-1\"\n />\n </div>\n\n <button\n ref={stopButtonRef}\n type=\"button\"\n onClick={handleStopClick}\n className=\"mt-1 flex size-11 items-center justify-center rounded-full bg-error-content text-content-on-brand-inverted transition-colors hover:bg-error-content/80 focus:shadow-focus-ring focus-visible:outline-none\"\n aria-label={stopButtonAriaLabel}\n >\n <StopIcon className=\"size-5\" />\n </button>\n </div>\n );\n }\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> would break the public HTMLDivElement ref/props API\n <div\n ref={ref}\n role=\"group\"\n aria-label=\"Audio upload\"\n data-testid=\"audio-upload\"\n data-state=\"idle\"\n aria-disabled={disabled || undefined}\n onDrop={handleDrop}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n className={cn(\n \"flex flex-col items-center justify-center gap-2 rounded-md bg-surface-secondary px-4 py-3 transition-colors\",\n isDragActive && \"bg-brand-primary-muted ring-2 ring-brand-primary-default\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n {...props}\n >\n <input\n id={inputId}\n type=\"file\"\n accept={acceptString}\n multiple={maxFiles > 1}\n onChange={handleFileInputChange}\n className=\"peer sr-only\"\n disabled={disabled}\n aria-describedby={descriptionId}\n />\n\n <label\n htmlFor={inputId}\n className=\"flex cursor-pointer flex-col items-center gap-2 rounded-xs px-2 py-1 peer-focus-visible:shadow-focus-ring\"\n >\n <UploadCloudIcon className=\"size-5 text-content-primary\" />\n\n <span className=\"typography-semibold-body-lg text-center text-content-primary\">\n {uploadTitle}\n </span>\n\n <span\n id={descriptionId}\n className=\"typography-regular-body-md text-center text-content-primary\"\n >\n {uploadDescription}\n </span>\n </label>\n\n {allowRecording && isRecordingSupported && (\n <>\n <p className=\"typography-regular-body-md text-center text-content-primary\">\n {separatorText}\n </p>\n\n <Button\n variant=\"brand\"\n size=\"40\"\n leftIcon={<MicrophoneIcon className=\"size-5\" />}\n onClick={handleRecordClick}\n disabled={disabled}\n type=\"button\"\n >\n {recordButtonLabel}\n </Button>\n </>\n )}\n </div>\n );\n },\n);\n\nAudioUpload.displayName = \"AudioUpload\";\n"],"names":["validateAudioFile","React","DEFAULT_MAX_FILE_SIZE","DEFAULT_ACCEPTED_TYPES","DEFAULT_MAX_RECORDING_DURATION","DEFAULT_MIN_RECORDING_DURATION","useAudioRecorder","formatAudioTime","jsxs","cn","jsx","MicrophoneIcon","AudioWaveform","StopIcon","UploadCloudIcon","Fragment","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,SAAS,eACP,OACA,aACA,QACA,UACsD;AACtD,QAAM,WAAmB,CAAA;AACzB,QAAM,WAAiC,CAAA;AAEvC,aAAW,QAAQ,OAAO;AACxB,UAAM,SAASA,WAAAA,kBAAkB,MAAM,EAAE,aAAa,eAAe,QAAQ;AAC7E,QAAI,OAAO,SAAS,GAAG;AACrB,eAAS,KAAK,EAAE,MAAM,OAAA,CAAQ;AAAA,IAChC,OAAO;AACL,eAAS,KAAK,IAAI;AAAA,IACpB;AAAA,EACF;AAEA,MAAI,WAAW,KAAK,SAAS,SAAS,UAAU;AAC9C,UAAM,SAAS,SAAS,OAAO,QAAQ;AACvC,eAAW,QAAQ,QAAQ;AACzB,eAAS,KAAK;AAAA,QACZ;AAAA,QACA,QAAQ,CAAC,EAAE,MAAM,kBAAkB,SAAS,8BAA8B,QAAQ,GAAA,CAAI;AAAA,MAAA,CACvF;AAAA,IACH;AAAA,EACF;AAEA,SAAO,EAAE,UAAU,SAAA;AACrB;AAcO,MAAM,cAAcC,iBAAM;AAAA,EAC/B,CACE;AAAA,IACE;AAAA,IACA,cAAcC,UAAAA;AAAAA,IACd,SAASC,UAAAA;AAAAA,IACT,WAAW;AAAA,IACX,iBAAiB;AAAA,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V,WAAU;AAAA,gBACV;AAAA,gBACA,oBAAkB;AAAA,cAAA;AAAA,YAAA;AAAA,YAGpBF,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,SAAS;AAAA,gBACT,WAAU;AAAA,gBAEV,UAAA;AAAA,kBAAAE,2BAAAA,IAACI,gBAAAA,iBAAA,EAAgB,WAAU,8BAAA,CAA8B;AAAA,kBAEzDJ,2BAAAA,IAAC,QAAA,EAAK,WAAU,gEACb,UAAA,aACH;AAAA,kBAEAA,2BAAAA;AAAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,IAAI;AAAA,sBACJ,WAAU;AAAA,sBAET,UAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA;AAAA,YAAA;AAAA,YAGD,kBAAkB,wBACjBF,2BAAAA,KAAAO,WAAAA,UAAA,EACE,UAAA;AAAA,cAAAL,2BAAAA,IAAC,KAAA,EAAE,WAAU,+DACV,UAAA,eACH;AAAA,cAEAA,2BAAAA;AAAAA,gBAACM,OAAAA;AAAAA,gBAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,UAAUN,2BAAAA,IAACC,eAAAA,gBAAA,EAAe,WAAU,SAAA,CAAS;AAAA,kBAC7C,SAAS;AAAA,kBACT;AAAA,kBACA,MAAK;AAAA,kBAEJ,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;;"}
@@ -115,7 +115,7 @@ function AudioWaveform({ analyserNode, isRecording, className }) {
115
115
  observer.disconnect();
116
116
  };
117
117
  }, [analyserNode, isRecording]);
118
- return /* @__PURE__ */ jsxRuntime.jsx("canvas", { ref: canvasRef, className: cn.cn("h-5 w-full text-foreground-secondary", className) });
118
+ return /* @__PURE__ */ jsxRuntime.jsx("canvas", { ref: canvasRef, className: cn.cn("h-5 w-full text-content-secondary", className) });
119
119
  }
120
120
  exports.AudioWaveform = AudioWaveform;
121
121
  //# sourceMappingURL=AudioWaveform.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AudioWaveform.cjs","sources":["../../../../src/components/AudioUpload/AudioWaveform.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\n\ninterface AudioWaveformProps {\n /** AnalyserNode from useAudioRecorder for frequency data */\n analyserNode: AnalyserNode | null;\n /** Whether recording is active (affects rendering mode) */\n isRecording: boolean;\n /** Additional className */\n className?: string;\n}\n\nconst BAR_WIDTH = 3;\nconst BAR_GAP = 4;\nconst BAR_RADIUS = 1.5;\nconst MIN_BAR_HEIGHT = 3;\nconst IDLE_DOT_SIZE = 3;\n\n/** Draw a rounded rect, falling back to a plain rect if unsupported. */\nfunction drawRoundedRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n w: number,\n h: number,\n r: number,\n) {\n ctx.beginPath();\n if (ctx.roundRect) {\n ctx.roundRect(x, y, w, h, r);\n } else {\n ctx.rect(x, y, w, h);\n }\n ctx.fill();\n}\n\n/**\n * Canvas-based waveform visualization for audio recording.\n * Shows animated frequency bars when recording, static dots when idle.\n *\n * @internal Not exported from the library — used internally by AudioUpload.\n */\nexport function AudioWaveform({ analyserNode, isRecording, className }: AudioWaveformProps) {\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\n const rafRef = React.useRef<number>(0);\n\n React.useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n\n // Cache color, dimensions, and frequency buffer outside the animation loop\n let cachedColor = \"\";\n let cachedWidth = 0;\n let cachedHeight = 0;\n let dataArray: Uint8Array<ArrayBuffer> | null = null;\n\n const resizeCanvas = () => {\n const rect = canvas.getBoundingClientRect();\n const dpr = window.devicePixelRatio || 1;\n canvas.width = rect.width * dpr;\n canvas.height = rect.height * dpr;\n ctx.scale(dpr, dpr);\n cachedColor = getComputedStyle(canvas).color || \"#151515\";\n cachedWidth = rect.width;\n cachedHeight = rect.height;\n };\n\n resizeCanvas();\n\n const drawIdle = () => {\n ctx.clearRect(0, 0, cachedWidth, cachedHeight);\n ctx.fillStyle = cachedColor;\n\n const totalBarSpace = IDLE_DOT_SIZE + BAR_GAP;\n const barCount = Math.floor(cachedWidth / totalBarSpace);\n const startX = (cachedWidth - barCount * totalBarSpace + BAR_GAP) / 2;\n const y = cachedHeight / 2 - IDLE_DOT_SIZE / 2;\n\n for (let i = 0; i < barCount; i++) {\n const x = startX + i * totalBarSpace;\n ctx.beginPath();\n ctx.arc(x + IDLE_DOT_SIZE / 2, y + IDLE_DOT_SIZE / 2, IDLE_DOT_SIZE / 2, 0, Math.PI * 2);\n ctx.fill();\n }\n };\n\n const drawRecording = () => {\n if (!analyserNode) {\n drawIdle();\n return;\n }\n\n ctx.clearRect(0, 0, cachedWidth, cachedHeight);\n\n // Reuse typed array across frames\n const bufferLength = analyserNode.frequencyBinCount;\n if (!dataArray || dataArray.length !== bufferLength) {\n dataArray = new Uint8Array(bufferLength);\n }\n analyserNode.getByteFrequencyData(dataArray);\n\n ctx.fillStyle = cachedColor;\n\n const totalBarSpace = BAR_WIDTH + BAR_GAP;\n const barCount = Math.floor(cachedWidth / totalBarSpace);\n const startX = (cachedWidth - barCount * totalBarSpace + BAR_GAP) / 2;\n\n const step = bufferLength / barCount;\n\n for (let i = 0; i < barCount; i++) {\n const dataIndex = Math.floor(i * step);\n const value = (dataArray[dataIndex] ?? 0) / 255;\n const barHeight = Math.max(MIN_BAR_HEIGHT, value * (cachedHeight - 4));\n const x = startX + i * totalBarSpace;\n const y = (cachedHeight - barHeight) / 2;\n\n drawRoundedRect(ctx, x, y, BAR_WIDTH, barHeight, BAR_RADIUS);\n }\n\n rafRef.current = requestAnimationFrame(drawRecording);\n };\n\n if (isRecording && analyserNode) {\n rafRef.current = requestAnimationFrame(drawRecording);\n } else {\n drawIdle();\n }\n\n const observer = new ResizeObserver(() => {\n resizeCanvas();\n if (!isRecording || !analyserNode) {\n drawIdle();\n }\n });\n observer.observe(canvas);\n\n return () => {\n cancelAnimationFrame(rafRef.current);\n observer.disconnect();\n };\n }, [analyserNode, isRecording]);\n\n return (\n <canvas ref={canvasRef} className={cn(\"h-5 w-full text-foreground-secondary\", className)} />\n );\n}\n"],"names":["React","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAY;AAClB,MAAM,UAAU;AAChB,MAAM,aAAa;AACnB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AAGtB,SAAS,gBACP,KACA,GACA,GACA,GACA,GACA,GACA;AACA,MAAI,UAAA;AACJ,MAAI,IAAI,WAAW;AACjB,QAAI,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC;AAAA,EAC7B,OAAO;AACL,QAAI,KAAK,GAAG,GAAG,GAAG,CAAC;AAAA,EACrB;AACA,MAAI,KAAA;AACN;AAQO,SAAS,cAAc,EAAE,cAAc,aAAa,aAAiC;AAC1F,QAAM,YAAYA,iBAAM,OAA0B,IAAI;AACtD,QAAM,SAASA,iBAAM,OAAe,CAAC;AAErCA,mBAAM,UAAU,MAAM;AACpB,UAAM,SAAS,UAAU;AACzB,QAAI,CAAC,OAAQ;AAEb,UAAM,MAAM,OAAO,WAAW,IAAI;AAClC,QAAI,CAAC,IAAK;AAGV,QAAI,cAAc;AAClB,QAAI,cAAc;AAClB,QAAI,eAAe;AACnB,QAAI,YAA4C;AAEhD,UAAM,eAAe,MAAM;AACzB,YAAM,OAAO,OAAO,sBAAA;AACpB,YAAM,MAAM,OAAO,oBAAoB;AACvC,aAAO,QAAQ,KAAK,QAAQ;AAC5B,aAAO,SAAS,KAAK,SAAS;AAC9B,UAAI,MAAM,KAAK,GAAG;AAClB,oBAAc,iBAAiB,MAAM,EAAE,SAAS;AAChD,oBAAc,KAAK;AACnB,qBAAe,KAAK;AAAA,IACtB;AAEA,iBAAA;AAEA,UAAM,WAAW,MAAM;AAC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e,cAAc;AAC/B,aAAO,UAAU,sBAAsB,aAAa;AAAA,IACtD,OAAO;AACL,eAAA;AAAA,IACF;AAEA,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,mBAAA;AACA,UAAI,CAAC,eAAe,CAAC,cAAc;AACjC,iBAAA;AAAA,MACF;AAAA,IACF,CAAC;AACD,aAAS,QAAQ,MAAM;AAEvB,WAAO,MAAM;AACX,2BAAqB,OAAO,OAAO;AACnC,eAAS,WAAA;AAAA,IACX;AAAA,EACF,GAAG,CAAC,cAAc,WAAW,CAAC;AAE9B,SACEC,2BAAAA,IAAC,YAAO,KAAK,WAAW,WAAWC,MAAG,wCAAwC,SAAS,GAAG;AAE9F;;"}
1
+ {"version":3,"file":"AudioWaveform.cjs","sources":["../../../../src/components/AudioUpload/AudioWaveform.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\n\ninterface AudioWaveformProps {\n /** AnalyserNode from useAudioRecorder for frequency data */\n analyserNode: AnalyserNode | null;\n /** Whether recording is active (affects rendering mode) */\n isRecording: boolean;\n /** Additional className */\n className?: string;\n}\n\nconst BAR_WIDTH = 3;\nconst BAR_GAP = 4;\nconst BAR_RADIUS = 1.5;\nconst MIN_BAR_HEIGHT = 3;\nconst IDLE_DOT_SIZE = 3;\n\n/** Draw a rounded rect, falling back to a plain rect if unsupported. */\nfunction drawRoundedRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n w: number,\n h: number,\n r: number,\n) {\n ctx.beginPath();\n if (ctx.roundRect) {\n ctx.roundRect(x, y, w, h, r);\n } else {\n ctx.rect(x, y, w, h);\n }\n ctx.fill();\n}\n\n/**\n * Canvas-based waveform visualization for audio recording.\n * Shows animated frequency bars when recording, static dots when idle.\n *\n * @internal Not exported from the library — used internally by AudioUpload.\n */\nexport function AudioWaveform({ analyserNode, isRecording, className }: AudioWaveformProps) {\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\n const rafRef = React.useRef<number>(0);\n\n React.useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n\n // Cache color, dimensions, and frequency buffer outside the animation loop\n let cachedColor = \"\";\n let cachedWidth = 0;\n let cachedHeight = 0;\n let dataArray: Uint8Array<ArrayBuffer> | null = null;\n\n const resizeCanvas = () => {\n const rect = canvas.getBoundingClientRect();\n const dpr = window.devicePixelRatio || 1;\n canvas.width = rect.width * dpr;\n canvas.height = rect.height * dpr;\n ctx.scale(dpr, dpr);\n cachedColor = getComputedStyle(canvas).color || \"#151515\";\n cachedWidth = rect.width;\n cachedHeight = rect.height;\n };\n\n resizeCanvas();\n\n const drawIdle = () => {\n ctx.clearRect(0, 0, cachedWidth, cachedHeight);\n ctx.fillStyle = cachedColor;\n\n const totalBarSpace = IDLE_DOT_SIZE + BAR_GAP;\n const barCount = Math.floor(cachedWidth / totalBarSpace);\n const startX = (cachedWidth - barCount * totalBarSpace + BAR_GAP) / 2;\n const y = cachedHeight / 2 - IDLE_DOT_SIZE / 2;\n\n for (let i = 0; i < barCount; i++) {\n const x = startX + i * totalBarSpace;\n ctx.beginPath();\n ctx.arc(x + IDLE_DOT_SIZE / 2, y + IDLE_DOT_SIZE / 2, IDLE_DOT_SIZE / 2, 0, Math.PI * 2);\n ctx.fill();\n }\n };\n\n const drawRecording = () => {\n if (!analyserNode) {\n drawIdle();\n return;\n }\n\n ctx.clearRect(0, 0, cachedWidth, cachedHeight);\n\n // Reuse typed array across frames\n const bufferLength = analyserNode.frequencyBinCount;\n if (!dataArray || dataArray.length !== bufferLength) {\n dataArray = new Uint8Array(bufferLength);\n }\n analyserNode.getByteFrequencyData(dataArray);\n\n ctx.fillStyle = cachedColor;\n\n const totalBarSpace = BAR_WIDTH + BAR_GAP;\n const barCount = Math.floor(cachedWidth / totalBarSpace);\n const startX = (cachedWidth - barCount * totalBarSpace + BAR_GAP) / 2;\n\n const step = bufferLength / barCount;\n\n for (let i = 0; i < barCount; i++) {\n const dataIndex = Math.floor(i * step);\n const value = (dataArray[dataIndex] ?? 0) / 255;\n const barHeight = Math.max(MIN_BAR_HEIGHT, value * (cachedHeight - 4));\n const x = startX + i * totalBarSpace;\n const y = (cachedHeight - barHeight) / 2;\n\n drawRoundedRect(ctx, x, y, BAR_WIDTH, barHeight, BAR_RADIUS);\n }\n\n rafRef.current = requestAnimationFrame(drawRecording);\n };\n\n if (isRecording && analyserNode) {\n rafRef.current = requestAnimationFrame(drawRecording);\n } else {\n drawIdle();\n }\n\n const observer = new ResizeObserver(() => {\n resizeCanvas();\n if (!isRecording || !analyserNode) {\n drawIdle();\n }\n });\n observer.observe(canvas);\n\n return () => {\n cancelAnimationFrame(rafRef.current);\n observer.disconnect();\n };\n }, [analyserNode, isRecording]);\n\n return <canvas ref={canvasRef} className={cn(\"h-5 w-full text-content-secondary\", className)} />;\n}\n"],"names":["React","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAY;AAClB,MAAM,UAAU;AAChB,MAAM,aAAa;AACnB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AAGtB,SAAS,gBACP,KACA,GACA,GACA,GACA,GACA,GACA;AACA,MAAI,UAAA;AACJ,MAAI,IAAI,WAAW;AACjB,QAAI,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC;AAAA,EAC7B,OAAO;AACL,QAAI,KAAK,GAAG,GAAG,GAAG,CAAC;AAAA,EACrB;AACA,MAAI,KAAA;AACN;AAQO,SAAS,cAAc,EAAE,cAAc,aAAa,aAAiC;AAC1F,QAAM,YAAYA,iBAAM,OAA0B,IAAI;AACtD,QAAM,SAASA,iBAAM,OAAe,CAAC;AAErCA,mBAAM,UAAU,MAAM;AACpB,UAAM,SAAS,UAAU;AACzB,QAAI,CAAC,OAAQ;AAEb,UAAM,MAAM,OAAO,WAAW,IAAI;AAClC,QAAI,CAAC,IAAK;AAGV,QAAI,cAAc;AAClB,QAAI,cAAc;AAClB,QAAI,eAAe;AAC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AK;AACjC,cAAM,YAAY,KAAK,MAAM,IAAI,IAAI;AACrC,cAAM,SAAS,UAAU,SAAS,KAAK,KAAK;AAC5C,cAAM,YAAY,KAAK,IAAI,gBAAgB,SAAS,eAAe,EAAE;AACrE,cAAM,IAAI,SAAS,IAAI;AACvB,cAAM,KAAK,eAAe,aAAa;AAEvC,wBAAgB,KAAK,GAAG,GAAG,WAAW,WAAW,UAAU;AAAA,MAC7D;AAEA,aAAO,UAAU,sBAAsB,aAAa;AAAA,IACtD;AAEA,QAAI,eAAe,cAAc;AAC/B,aAAO,UAAU,sBAAsB,aAAa;AAAA,IACtD,OAAO;AACL,eAAA;AAAA,IACF;AAEA,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,mBAAA;AACA,UAAI,CAAC,eAAe,CAAC,cAAc;AACjC,iBAAA;AAAA,MACF;AAAA,IACF,CAAC;AACD,aAAS,QAAQ,MAAM;AAEvB,WAAO,MAAM;AACX,2BAAqB,OAAO,OAAO;AACnC,eAAS,WAAA;AAAA,IACX;AAAA,EACF,GAAG,CAAC,cAAc,WAAW,CAAC;AAE9B,SAAOC,2BAAAA,IAAC,YAAO,KAAK,WAAW,WAAWC,MAAG,qCAAqC,SAAS,GAAG;AAChG;;"}
@@ -91,7 +91,7 @@ const Autocomplete = React__namespace.forwardRef((props, ref) => {
91
91
  "label",
92
92
  {
93
93
  htmlFor: ac.inputId,
94
- className: "typography-semibold-body-sm px-1 pt-1 pb-2 text-foreground-default",
94
+ className: "typography-semibold-body-sm px-1 pt-1 pb-2 text-content-primary",
95
95
  children: label
96
96
  }
97
97
  ),
@@ -99,17 +99,17 @@ const Autocomplete = React__namespace.forwardRef((props, ref) => {
99
99
  "div",
100
100
  {
101
101
  className: cn.cn(
102
- "flex flex-wrap items-center overflow-hidden rounded-xl border bg-neutral-100 has-focus-visible:outline-none motion-safe:transition-colors",
103
- error ? "border-error-default" : "border-transparent",
104
- !disabled && !error && "hover:border-neutral-400",
105
- ac.isOpen && !error && !disabled && "border-neutral-400",
102
+ "flex flex-wrap items-center overflow-hidden rounded-sm border bg-neutral-alphas-100 has-focus-visible:outline-none motion-safe:transition-colors",
103
+ error ? "border-error-content" : "border-transparent",
104
+ !disabled && !error && "hover:border-neutral-alphas-400",
105
+ ac.isOpen && !error && !disabled && "border-neutral-alphas-400",
106
106
  CONTAINER_HEIGHT[size],
107
107
  PADDING_CLASSES[size],
108
108
  disabled && "opacity-50"
109
109
  ),
110
110
  onClick: ac.handleContainerClick,
111
111
  children: [
112
- leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-5 shrink-0 items-center justify-center text-foreground-secondary", children: leftIcon }),
112
+ leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-5 shrink-0 items-center justify-center text-content-secondary", children: leftIcon }),
113
113
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-1.5", children: [
114
114
  ac.isMulti && ac.selectedMultiOptions.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
115
115
  AutocompleteTag.AutocompleteTag,
@@ -145,26 +145,26 @@ const Autocomplete = React__namespace.forwardRef((props, ref) => {
145
145
  onFocus: ac.handleFocus,
146
146
  onBlur: ac.handleBlur,
147
147
  className: cn.cn(
148
- "min-w-[40px] flex-1 truncate rounded-xl bg-transparent text-foreground-default no-underline placeholder:text-foreground-secondary placeholder:opacity-40 focus:outline-none disabled:cursor-not-allowed",
148
+ "min-w-[40px] flex-1 truncate bg-transparent text-content-primary no-underline placeholder:text-content-secondary placeholder:opacity-40 focus:outline-none disabled:cursor-not-allowed",
149
149
  INPUT_SIZE_CLASSES[size]
150
150
  )
151
151
  }
152
152
  )
153
153
  ] }),
154
154
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
155
- loading && /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: "size-4 animate-spin text-foreground-secondary" }),
155
+ loading && /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: "size-4 animate-spin text-content-secondary" }),
156
156
  clearable && ac.hasClearableValue && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
157
157
  "button",
158
158
  {
159
159
  type: "button",
160
160
  tabIndex: -1,
161
161
  "aria-label": clearAriaLabel,
162
- className: "flex size-5 shrink-0 cursor-pointer items-center justify-center text-foreground-secondary hover:text-foreground-default active:scale-95",
162
+ className: "flex size-5 shrink-0 cursor-pointer items-center justify-center text-content-secondary hover:text-content-primary active:scale-95",
163
163
  onClick: ac.handleClear,
164
164
  children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon.CloseIcon, { className: "size-4" })
165
165
  }
166
166
  ),
167
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-5 shrink-0 items-center justify-center text-foreground-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(
167
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-5 shrink-0 items-center justify-center text-content-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(
168
168
  ChevronDownIcon.ChevronDownIcon,
169
169
  {
170
170
  className: cn.cn("size-5 transition-transform", ac.isOpen && "rotate-180")
@@ -183,7 +183,7 @@ const Autocomplete = React__namespace.forwardRef((props, ref) => {
183
183
  onCloseAutoFocus: (e) => e.preventDefault(),
184
184
  style: { zIndex: "var(--fanvue-ui-portal-z-index, 50)" },
185
185
  className: cn.cn(
186
- "w-(--radix-popover-trigger-width) min-w-(--radix-popper-anchor-width) overflow-hidden rounded-xl border border-neutral-200 bg-surface-page text-foreground-default shadow-[0_4px_16px_rgba(0,0,0,0.10)]",
186
+ "w-(--radix-popover-trigger-width) min-w-(--radix-popper-anchor-width) overflow-hidden rounded-sm border border-neutral-alphas-200 bg-bg-primary text-content-primary shadow-[0_4px_16px_rgba(0,0,0,0.10)]",
187
187
  "data-[state=closed]:animate-out data-[state=open]:animate-in",
188
188
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
189
189
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -225,7 +225,7 @@ const Autocomplete = React__namespace.forwardRef((props, ref) => {
225
225
  id: ac.helperTextId,
226
226
  className: cn.cn(
227
227
  "typography-regular-body-sm px-2 pt-1 pb-0.5",
228
- error ? "text-error-default" : "text-foreground-secondary"
228
+ error ? "text-error-content" : "text-content-secondary"
229
229
  ),
230
230
  children: bottomText
231
231
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.cjs","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\nimport { AutocompleteDropdownContent } from \"./AutocompleteDropdownContent\";\nimport { AutocompleteTag } from \"./AutocompleteTag\";\nimport { useAutocomplete } from \"./useAutocomplete\";\n\nexport type AutocompleteSize = \"48\" | \"40\" | \"32\";\n\nexport interface AutocompleteOption {\n value: string;\n label?: string;\n disabled?: boolean;\n}\n\ninterface AutocompleteBaseProps {\n label?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n helperText?: string;\n /** @default \"48\" */\n size?: AutocompleteSize;\n /** @default false */\n error?: boolean;\n errorMessage?: string;\n placeholder?: string;\n leftIcon?: React.ReactNode;\n /** @default false */\n fullWidth?: boolean;\n /** @default false */\n disabled?: boolean;\n /** @default false */\n clearable?: boolean;\n clearAriaLabel?: string;\n id?: string;\n className?: string;\n options: AutocompleteOption[];\n inputValue?: string;\n onInputChange?: (value: string) => void;\n filterFn?: (option: AutocompleteOption, query: string) => boolean;\n /** @default false */\n creatable?: boolean;\n creatableLabel?: (inputValue: string) => string;\n onCreate?: (inputValue: string) => void;\n /** @default false */\n loading?: boolean;\n loadingText?: string;\n emptyText?: string;\n renderOption?: (\n option: AutocompleteOption,\n state: { selected: boolean; active: boolean },\n ) => React.ReactNode;\n renderTag?: (option: AutocompleteOption, onRemove: () => void) => React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\ninterface AutocompleteSingleProps extends AutocompleteBaseProps {\n multiple?: false;\n value?: string | null;\n defaultValue?: string | null;\n onChange?: (value: string | null) => void;\n}\n\ninterface AutocompleteMultiProps extends AutocompleteBaseProps {\n multiple: true;\n value?: string[];\n defaultValue?: string[];\n onChange?: (values: string[]) => void;\n}\n\nexport type AutocompleteProps = AutocompleteSingleProps | AutocompleteMultiProps;\n\nconst CONTAINER_HEIGHT: Record<AutocompleteSize, string> = {\n \"48\": \"min-h-12\",\n \"40\": \"min-h-10\",\n \"32\": \"min-h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"typography-regular-body-lg\",\n \"40\": \"typography-regular-body-lg\",\n \"32\": \"typography-regular-body-md\",\n};\n\nconst PADDING_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"px-4 py-1.5 gap-3\",\n \"40\": \"px-4 py-1 gap-3\",\n \"32\": \"px-3 py-1 gap-2\",\n};\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"Autocomplete: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Conditional JSX branches in the render template\nexport const Autocomplete = React.forwardRef<HTMLInputElement, AutocompleteProps>((props, ref) => {\n const {\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n placeholder,\n leftIcon,\n fullWidth = false,\n disabled = false,\n clearable = false,\n clearAriaLabel = \"Clear\",\n className,\n loading = false,\n loadingText,\n emptyText = \"No results\",\n renderOption,\n renderTag,\n } = props;\n\n const ac = useAutocomplete(props);\n\n React.useImperativeHandle(ref, () => ac.inputRef.current as HTMLInputElement);\n\n warnMissingAccessibleName(label, ariaLabel, ariaLabelledby);\n\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n return (\n <Popover.Root open={ac.isOpen && !disabled} onOpenChange={ac.handleOpenChange}>\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-autocomplete-root=\"\"\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={ac.inputId}\n className=\"typography-semibold-body-sm px-1 pt-1 pb-2 text-foreground-default\"\n >\n {label}\n </label>\n )}\n\n <Popover.Anchor asChild>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: Container delegates click to the inner input */}\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: Keyboard interaction is handled by the inner combobox input */}\n <div\n className={cn(\n \"flex flex-wrap items-center overflow-hidden rounded-xl border bg-neutral-100 has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-default\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-400\",\n ac.isOpen && !error && !disabled && \"border-neutral-400\",\n CONTAINER_HEIGHT[size],\n PADDING_CLASSES[size],\n disabled && \"opacity-50\",\n )}\n onClick={ac.handleContainerClick}\n >\n {leftIcon && (\n <div className=\"flex size-5 shrink-0 items-center justify-center text-foreground-secondary\">\n {leftIcon}\n </div>\n )}\n\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-1.5\">\n {ac.isMulti &&\n ac.selectedMultiOptions.map((opt) => (\n <AutocompleteTag\n key={opt.value}\n option={opt}\n disabled={disabled}\n onRemove={() => ac.toggleMulti(opt.value)}\n renderTag={renderTag}\n />\n ))}\n\n <input\n ref={ac.inputRef}\n id={ac.inputId}\n role=\"combobox\"\n type=\"text\"\n disabled={disabled}\n aria-expanded={ac.isOpen}\n aria-controls={ac.isOpen ? ac.listboxId : undefined}\n aria-activedescendant={ac.activeDescendantId}\n aria-autocomplete=\"list\"\n aria-describedby={bottomText ? ac.helperTextId : undefined}\n aria-invalid={error || undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n autoComplete=\"off\"\n placeholder={\n ac.isMulti && ac.selectedMultiValues.length > 0 ? undefined : placeholder\n }\n value={ac.displayInputValue}\n onChange={ac.handleInputChange}\n onKeyDown={ac.handleKeyDown}\n onFocus={ac.handleFocus}\n onBlur={ac.handleBlur}\n className={cn(\n \"min-w-[40px] flex-1 truncate rounded-xl bg-transparent text-foreground-default no-underline placeholder:text-foreground-secondary placeholder:opacity-40 focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n )}\n />\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\n {loading && <SpinnerIcon className=\"size-4 animate-spin text-foreground-secondary\" />}\n {clearable && ac.hasClearableValue && !disabled && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={clearAriaLabel}\n className=\"flex size-5 shrink-0 cursor-pointer items-center justify-center text-foreground-secondary hover:text-foreground-default active:scale-95\"\n onClick={ac.handleClear}\n >\n <CloseIcon className=\"size-4\" />\n </button>\n )}\n <div className=\"flex size-5 shrink-0 items-center justify-center text-foreground-secondary\">\n <ChevronDownIcon\n className={cn(\"size-5 transition-transform\", ac.isOpen && \"rotate-180\")}\n />\n </div>\n </div>\n </div>\n </Popover.Anchor>\n\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n collisionPadding={8}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\" }}\n className={cn(\n \"w-(--radix-popover-trigger-width) min-w-(--radix-popper-anchor-width) overflow-hidden rounded-xl border border-neutral-200 bg-surface-page text-foreground-default shadow-[0_4px_16px_rgba(0,0,0,0.10)]\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n >\n <div\n ref={ac.listRef}\n id={ac.listboxId}\n role=\"listbox\"\n aria-label={label ?? ariaLabel ?? \"Options\"}\n aria-multiselectable={ac.isMulti || undefined}\n className=\"max-h-60 overflow-y-auto p-1\"\n >\n <AutocompleteDropdownContent\n loading={loading}\n loadingText={loadingText}\n emptyText={emptyText}\n visibleOptions={ac.visibleOptions}\n listboxId={ac.listboxId}\n activeIndex={ac.activeIndex}\n isMulti={ac.isMulti}\n selectedMultiValues={ac.selectedMultiValues}\n selectedValue={ac.selectedValue}\n onSelect={ac.handleSelect}\n onMouseEnter={ac.setActiveIndex}\n renderOption={renderOption}\n />\n </div>\n </Popover.Content>\n </Popover.Portal>\n\n {bottomText && (\n <p\n id={ac.helperTextId}\n className={cn(\n \"typography-regular-body-sm px-2 pt-1 pb-0.5\",\n error ? \"text-error-default\" : \"text-foreground-secondary\",\n )}\n >\n {bottomText}\n </p>\n )}\n </div>\n </Popover.Root>\n );\n});\n\nAutocomplete.displayName = \"Autocomplete\";\n"],"names":["React","useAutocomplete","jsx","Popover","jsxs","cn","AutocompleteTag","SpinnerIcon","CloseIcon","ChevronDownIcon","AutocompleteDropdownContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,MAAM,mBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,kBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,0BAA0B,OAAgB,WAAoB,gBAAyB;A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AAA,gBACR,IAAI,GAAG;AAAA,gBACP,MAAK;AAAA,gBACL,cAAY,SAAS,aAAa;AAAA,gBAClC,wBAAsB,GAAG,WAAW;AAAA,gBACpC,WAAU;AAAA,gBAEV,UAAAA,2BAAAA;AAAAA,kBAACQ,4BAAAA;AAAAA,kBAAA;AAAA,oBACC;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA,gBAAgB,GAAG;AAAA,oBACnB,WAAW,GAAG;AAAA,oBACd,aAAa,GAAG;AAAA,oBAChB,SAAS,GAAG;AAAA,oBACZ,qBAAqB,GAAG;AAAA,oBACxB,eAAe,GAAG;AAAA,oBAClB,UAAU,GAAG;AAAA,oBACb,cAAc,GAAG;AAAA,oBACjB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GAEJ;AAAA,QAEC,cACCR,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,GAAG;AAAA,YACP,WAAWG,GAAAA;AAAAA,cACT;AAAA,cACA,QAAQ,uBAAuB;AAAA,YAAA;AAAA,YAGhC,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,aAAa,cAAc;;"}
1
+ {"version":3,"file":"Autocomplete.cjs","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\nimport { AutocompleteDropdownContent } from \"./AutocompleteDropdownContent\";\nimport { AutocompleteTag } from \"./AutocompleteTag\";\nimport { useAutocomplete } from \"./useAutocomplete\";\n\nexport type AutocompleteSize = \"48\" | \"40\" | \"32\";\n\nexport interface AutocompleteOption {\n value: string;\n label?: string;\n disabled?: boolean;\n}\n\ninterface AutocompleteBaseProps {\n label?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n helperText?: string;\n /** @default \"48\" */\n size?: AutocompleteSize;\n /** @default false */\n error?: boolean;\n errorMessage?: string;\n placeholder?: string;\n leftIcon?: React.ReactNode;\n /** @default false */\n fullWidth?: boolean;\n /** @default false */\n disabled?: boolean;\n /** @default false */\n clearable?: boolean;\n clearAriaLabel?: string;\n id?: string;\n className?: string;\n options: AutocompleteOption[];\n inputValue?: string;\n onInputChange?: (value: string) => void;\n filterFn?: (option: AutocompleteOption, query: string) => boolean;\n /** @default false */\n creatable?: boolean;\n creatableLabel?: (inputValue: string) => string;\n onCreate?: (inputValue: string) => void;\n /** @default false */\n loading?: boolean;\n loadingText?: string;\n emptyText?: string;\n renderOption?: (\n option: AutocompleteOption,\n state: { selected: boolean; active: boolean },\n ) => React.ReactNode;\n renderTag?: (option: AutocompleteOption, onRemove: () => void) => React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\ninterface AutocompleteSingleProps extends AutocompleteBaseProps {\n multiple?: false;\n value?: string | null;\n defaultValue?: string | null;\n onChange?: (value: string | null) => void;\n}\n\ninterface AutocompleteMultiProps extends AutocompleteBaseProps {\n multiple: true;\n value?: string[];\n defaultValue?: string[];\n onChange?: (values: string[]) => void;\n}\n\nexport type AutocompleteProps = AutocompleteSingleProps | AutocompleteMultiProps;\n\nconst CONTAINER_HEIGHT: Record<AutocompleteSize, string> = {\n \"48\": \"min-h-12\",\n \"40\": \"min-h-10\",\n \"32\": \"min-h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"typography-regular-body-lg\",\n \"40\": \"typography-regular-body-lg\",\n \"32\": \"typography-regular-body-md\",\n};\n\nconst PADDING_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"px-4 py-1.5 gap-3\",\n \"40\": \"px-4 py-1 gap-3\",\n \"32\": \"px-3 py-1 gap-2\",\n};\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"Autocomplete: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Conditional JSX branches in the render template\nexport const Autocomplete = React.forwardRef<HTMLInputElement, AutocompleteProps>((props, ref) => {\n const {\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n placeholder,\n leftIcon,\n fullWidth = false,\n disabled = false,\n clearable = false,\n clearAriaLabel = \"Clear\",\n className,\n loading = false,\n loadingText,\n emptyText = \"No results\",\n renderOption,\n renderTag,\n } = props;\n\n const ac = useAutocomplete(props);\n\n React.useImperativeHandle(ref, () => ac.inputRef.current as HTMLInputElement);\n\n warnMissingAccessibleName(label, ariaLabel, ariaLabelledby);\n\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n return (\n <Popover.Root open={ac.isOpen && !disabled} onOpenChange={ac.handleOpenChange}>\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-autocomplete-root=\"\"\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={ac.inputId}\n className=\"typography-semibold-body-sm px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <Popover.Anchor asChild>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: Container delegates click to the inner input */}\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: Keyboard interaction is handled by the inner combobox input */}\n <div\n className={cn(\n \"flex flex-wrap items-center overflow-hidden rounded-sm border bg-neutral-alphas-100 has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n ac.isOpen && !error && !disabled && \"border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n PADDING_CLASSES[size],\n disabled && \"opacity-50\",\n )}\n onClick={ac.handleContainerClick}\n >\n {leftIcon && (\n <div className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\">\n {leftIcon}\n </div>\n )}\n\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-1.5\">\n {ac.isMulti &&\n ac.selectedMultiOptions.map((opt) => (\n <AutocompleteTag\n key={opt.value}\n option={opt}\n disabled={disabled}\n onRemove={() => ac.toggleMulti(opt.value)}\n renderTag={renderTag}\n />\n ))}\n\n <input\n ref={ac.inputRef}\n id={ac.inputId}\n role=\"combobox\"\n type=\"text\"\n disabled={disabled}\n aria-expanded={ac.isOpen}\n aria-controls={ac.isOpen ? ac.listboxId : undefined}\n aria-activedescendant={ac.activeDescendantId}\n aria-autocomplete=\"list\"\n aria-describedby={bottomText ? ac.helperTextId : undefined}\n aria-invalid={error || undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n autoComplete=\"off\"\n placeholder={\n ac.isMulti && ac.selectedMultiValues.length > 0 ? undefined : placeholder\n }\n value={ac.displayInputValue}\n onChange={ac.handleInputChange}\n onKeyDown={ac.handleKeyDown}\n onFocus={ac.handleFocus}\n onBlur={ac.handleBlur}\n className={cn(\n \"min-w-[40px] flex-1 truncate bg-transparent text-content-primary no-underline placeholder:text-content-secondary placeholder:opacity-40 focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n )}\n />\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\n {loading && <SpinnerIcon className=\"size-4 animate-spin text-content-secondary\" />}\n {clearable && ac.hasClearableValue && !disabled && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={clearAriaLabel}\n className=\"flex size-5 shrink-0 cursor-pointer items-center justify-center text-content-secondary hover:text-content-primary active:scale-95\"\n onClick={ac.handleClear}\n >\n <CloseIcon className=\"size-4\" />\n </button>\n )}\n <div className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\">\n <ChevronDownIcon\n className={cn(\"size-5 transition-transform\", ac.isOpen && \"rotate-180\")}\n />\n </div>\n </div>\n </div>\n </Popover.Anchor>\n\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n collisionPadding={8}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\" }}\n className={cn(\n \"w-(--radix-popover-trigger-width) min-w-(--radix-popper-anchor-width) overflow-hidden rounded-sm border border-neutral-alphas-200 bg-bg-primary text-content-primary shadow-[0_4px_16px_rgba(0,0,0,0.10)]\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n >\n <div\n ref={ac.listRef}\n id={ac.listboxId}\n role=\"listbox\"\n aria-label={label ?? ariaLabel ?? \"Options\"}\n aria-multiselectable={ac.isMulti || undefined}\n className=\"max-h-60 overflow-y-auto p-1\"\n >\n <AutocompleteDropdownContent\n loading={loading}\n loadingText={loadingText}\n emptyText={emptyText}\n visibleOptions={ac.visibleOptions}\n listboxId={ac.listboxId}\n activeIndex={ac.activeIndex}\n isMulti={ac.isMulti}\n selectedMultiValues={ac.selectedMultiValues}\n selectedValue={ac.selectedValue}\n onSelect={ac.handleSelect}\n onMouseEnter={ac.setActiveIndex}\n renderOption={renderOption}\n />\n </div>\n </Popover.Content>\n </Popover.Portal>\n\n {bottomText && (\n <p\n id={ac.helperTextId}\n className={cn(\n \"typography-regular-body-sm px-2 pt-1 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {bottomText}\n </p>\n )}\n </div>\n </Popover.Root>\n );\n});\n\nAutocomplete.displayName = \"Autocomplete\";\n"],"names":["React","useAutocomplete","jsx","Popover","jsxs","cn","AutocompleteTag","SpinnerIcon","CloseIcon","ChevronDownIcon","AutocompleteDropdownContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,MAAM,mBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,kBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,0BAA0B,OAAgB,WAAoB,gBAAyB;AAC9F,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,SAAS,CAAC,aAAa,CAAC,gBAAgB;AAC3C,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AACF;AAGO,MAAM,eAAeA,iBAAM,WAAgD,CAAC,OAAO,QAAQ;AAChG,QAAM;AAAA,IACJ;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,EAAA,IACE;AAEJ,QAAM,KAAKC,gBAAAA,gBAAgB,KAAK;AAEhCD,mBAAM,oBAAoB,KAAK,MAAM,GAAG,SAAS,OAA2B;AAE5E,4BAA0B,OAAO,WAAW,cAAc;AAE1D,QAAM,aAAa,SAAS,eAAe,eAAe;AAE1D,SACEE,2BAAAA,IAACC,4BAAQ,MAAR,EAAa,MAAM,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A;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,aAAa,cAAc;;"}
@@ -22,13 +22,13 @@ function AutocompleteDropdownContent({
22
22
  return (
23
23
  // biome-ignore lint/a11y/useSemanticElements: <output> is not appropriate here; using role="status" for live region announcements
24
24
  /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", className: "flex items-center justify-center py-4", children: [
25
- /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: "size-5 animate-spin text-foreground-secondary" }),
26
- loadingText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-regular-body-md ml-2 text-foreground-secondary", children: loadingText })
25
+ /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: "size-5 animate-spin text-content-secondary" }),
26
+ loadingText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-regular-body-md ml-2 text-content-secondary", children: loadingText })
27
27
  ] })
28
28
  );
29
29
  }
30
30
  if (visibleOptions.length === 0) {
31
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-regular-body-md block px-3 py-4 text-center text-foreground-secondary", children: emptyText });
31
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-regular-body-md block px-3 py-4 text-center text-content-secondary", children: emptyText });
32
32
  }
33
33
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: visibleOptions.map((option, index) => {
34
34
  const isSelected = isMulti ? selectedMultiValues.includes(option.value) : option.value === selectedValue;