@spark-ui/components 17.9.0-beta.1 → 17.9.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 (314) hide show
  1. package/dist/FormFieldRequiredIndicator-CEB8Ez-q.js.map +1 -1
  2. package/dist/FormFieldRequiredIndicator-CzdpinIz.mjs.map +1 -1
  3. package/dist/accordion/AccordionItem.d.ts +3 -0
  4. package/dist/accordion/index.js.map +1 -1
  5. package/dist/accordion/index.mjs.map +1 -1
  6. package/dist/alert-dialog/AlertDialogAction.d.ts +3 -0
  7. package/dist/alert-dialog/AlertDialogBody.d.ts +3 -0
  8. package/dist/alert-dialog/AlertDialogCancel.d.ts +3 -0
  9. package/dist/alert-dialog/AlertDialogContent.d.ts +3 -0
  10. package/dist/alert-dialog/AlertDialogDescription.d.ts +3 -0
  11. package/dist/alert-dialog/AlertDialogFooter.d.ts +3 -0
  12. package/dist/alert-dialog/AlertDialogHeader.d.ts +3 -0
  13. package/dist/alert-dialog/AlertDialogOverlay.d.ts +3 -0
  14. package/dist/alert-dialog/AlertDialogPortal.d.ts +3 -0
  15. package/dist/alert-dialog/AlertDialogTitle.d.ts +3 -0
  16. package/dist/alert-dialog/AlertDialogTrigger.d.ts +3 -0
  17. package/dist/alert-dialog/index.js.map +1 -1
  18. package/dist/alert-dialog/index.mjs.map +1 -1
  19. package/dist/avatar/AvatarAction.d.ts +3 -0
  20. package/dist/avatar/AvatarImage.d.ts +3 -0
  21. package/dist/avatar/AvatarOnlineBadge.d.ts +3 -0
  22. package/dist/avatar/AvatarPlaceholder.d.ts +3 -0
  23. package/dist/avatar/AvatarUser.d.ts +3 -0
  24. package/dist/avatar/index.js.map +1 -1
  25. package/dist/avatar/index.mjs.map +1 -1
  26. package/dist/badge/index.js +1 -1
  27. package/dist/badge/index.js.map +1 -1
  28. package/dist/badge/index.mjs +3 -3
  29. package/dist/badge/index.mjs.map +1 -1
  30. package/dist/breadcrumb/BreadcrumbCurrentPage.d.ts +3 -0
  31. package/dist/breadcrumb/BreadcrumbItem.d.ts +3 -0
  32. package/dist/breadcrumb/BreadcrumbLink.d.ts +3 -0
  33. package/dist/breadcrumb/BreadcrumbSeparator.d.ts +3 -0
  34. package/dist/breadcrumb/index.js +1 -1
  35. package/dist/breadcrumb/index.js.map +1 -1
  36. package/dist/breadcrumb/index.mjs +1 -1
  37. package/dist/breadcrumb/index.mjs.map +1 -1
  38. package/dist/card/Backdrop.d.ts +17 -0
  39. package/dist/card/Content.d.ts +3 -0
  40. package/dist/card/index.js.map +1 -1
  41. package/dist/card/index.mjs.map +1 -1
  42. package/dist/carousel/CarouselControls.d.ts +3 -0
  43. package/dist/carousel/CarouselNextButton.d.ts +3 -0
  44. package/dist/carousel/CarouselPageIndicator.d.ts +3 -0
  45. package/dist/carousel/CarouselPagePicker.d.ts +3 -0
  46. package/dist/carousel/CarouselPrevButton.d.ts +3 -0
  47. package/dist/carousel/CarouselSlide.d.ts +3 -0
  48. package/dist/carousel/CarouselSlides.d.ts +3 -0
  49. package/dist/carousel/CarouselViewport.d.ts +3 -0
  50. package/dist/carousel/index.js.map +1 -1
  51. package/dist/carousel/index.mjs.map +1 -1
  52. package/dist/chip/ChipClearButton.d.ts +3 -0
  53. package/dist/chip/ChipContent.d.ts +3 -0
  54. package/dist/chip/ChipLeadingIcon.d.ts +3 -0
  55. package/dist/chip/ChipTrailingIcon.d.ts +3 -0
  56. package/dist/chip/index.js.map +1 -1
  57. package/dist/chip/index.mjs.map +1 -1
  58. package/dist/circular-meter/CircularMeterContent.d.ts +3 -0
  59. package/dist/circular-meter/CircularMeterLabel.d.ts +3 -0
  60. package/dist/circular-meter/CircularMeterTrack.d.ts +3 -0
  61. package/dist/circular-meter/CircularMeterValue.d.ts +3 -0
  62. package/dist/circular-meter/index.js.map +1 -1
  63. package/dist/circular-meter/index.mjs.map +1 -1
  64. package/dist/collapsible/Content.d.ts +3 -0
  65. package/dist/collapsible/Trigger.d.ts +3 -0
  66. package/dist/collapsible/index.js.map +1 -1
  67. package/dist/collapsible/index.mjs.map +1 -1
  68. package/dist/combobox/ComboboxClearButton.d.ts +3 -0
  69. package/dist/combobox/ComboboxDisclosure.d.ts +3 -0
  70. package/dist/combobox/ComboboxEmpty.d.ts +3 -0
  71. package/dist/combobox/ComboboxGroup.d.ts +3 -0
  72. package/dist/combobox/ComboboxInput.d.ts +3 -0
  73. package/dist/combobox/ComboboxItem.d.ts +3 -0
  74. package/dist/combobox/ComboboxItemIndicator.d.ts +3 -0
  75. package/dist/combobox/ComboboxItemText.d.ts +3 -0
  76. package/dist/combobox/ComboboxItems.d.ts +3 -0
  77. package/dist/combobox/ComboboxLabel.d.ts +3 -0
  78. package/dist/combobox/ComboboxLeadingIcon.d.ts +3 -0
  79. package/dist/combobox/ComboboxPopover.d.ts +3 -0
  80. package/dist/combobox/ComboboxPortal.d.ts +3 -0
  81. package/dist/combobox/ComboboxSelectedItems.d.ts +3 -0
  82. package/dist/combobox/ComboboxTrigger.d.ts +3 -0
  83. package/dist/combobox/index.js.map +1 -1
  84. package/dist/combobox/index.mjs.map +1 -1
  85. package/dist/dialog/DialogBody.d.ts +3 -0
  86. package/dist/dialog/DialogClose.d.ts +3 -0
  87. package/dist/dialog/DialogContent.d.ts +3 -0
  88. package/dist/dialog/DialogDescription.d.ts +3 -0
  89. package/dist/dialog/DialogFooter.d.ts +3 -0
  90. package/dist/dialog/DialogHeader.d.ts +3 -0
  91. package/dist/dialog/DialogOverlay.d.ts +3 -0
  92. package/dist/dialog/DialogPortal.d.ts +3 -0
  93. package/dist/dialog/DialogTitle.d.ts +3 -0
  94. package/dist/dialog/DialogTrigger.d.ts +3 -0
  95. package/dist/dialog/index.js.map +1 -1
  96. package/dist/dialog/index.mjs.map +1 -1
  97. package/dist/divider/DividerContent.d.ts +3 -0
  98. package/dist/divider/index.js.map +1 -1
  99. package/dist/divider/index.mjs.map +1 -1
  100. package/dist/drawer/DrawerBody.d.ts +3 -0
  101. package/dist/drawer/DrawerClose.d.ts +3 -0
  102. package/dist/drawer/DrawerCloseButton.d.ts +3 -0
  103. package/dist/drawer/DrawerContent.d.ts +3 -0
  104. package/dist/drawer/DrawerDescription.d.ts +3 -0
  105. package/dist/drawer/DrawerFooter.d.ts +3 -0
  106. package/dist/drawer/DrawerHeader.d.ts +3 -0
  107. package/dist/drawer/DrawerOverlay.d.ts +3 -0
  108. package/dist/drawer/DrawerPortal.d.ts +3 -0
  109. package/dist/drawer/DrawerTitle.d.ts +3 -0
  110. package/dist/drawer/DrawerTrigger.d.ts +3 -0
  111. package/dist/drawer/index.js.map +1 -1
  112. package/dist/drawer/index.mjs.map +1 -1
  113. package/dist/dropdown/DropdownDivider.d.ts +3 -0
  114. package/dist/dropdown/DropdownGroup.d.ts +3 -0
  115. package/dist/dropdown/DropdownItem.d.ts +3 -0
  116. package/dist/dropdown/DropdownItemIndicator.d.ts +3 -0
  117. package/dist/dropdown/DropdownItemText.d.ts +3 -0
  118. package/dist/dropdown/DropdownItems.d.ts +3 -0
  119. package/dist/dropdown/DropdownLabel.d.ts +3 -0
  120. package/dist/dropdown/DropdownLeadingIcon.d.ts +3 -0
  121. package/dist/dropdown/DropdownPopover.d.ts +3 -0
  122. package/dist/dropdown/DropdownPortal.d.ts +3 -0
  123. package/dist/dropdown/DropdownTrigger.d.ts +3 -0
  124. package/dist/dropdown/DropdownValue.d.ts +3 -0
  125. package/dist/dropdown/index.js.map +1 -1
  126. package/dist/dropdown/index.mjs.map +1 -1
  127. package/dist/file-upload/FileUploadAcceptedFile.d.ts +1 -0
  128. package/dist/file-upload/FileUploadContext.d.ts +1 -0
  129. package/dist/file-upload/FileUploadDropzone.d.ts +3 -0
  130. package/dist/file-upload/FileUploadItemDeleteTrigger.d.ts +3 -0
  131. package/dist/file-upload/FileUploadPreviewImage.d.ts +1 -0
  132. package/dist/file-upload/FileUploadRejectedFile.d.ts +1 -0
  133. package/dist/file-upload/FileUploadRejectedFileDeleteTrigger.d.ts +1 -0
  134. package/dist/file-upload/FileUploadTrigger.d.ts +3 -0
  135. package/dist/file-upload/index.js.map +1 -1
  136. package/dist/file-upload/index.mjs.map +1 -1
  137. package/dist/form-field/FormFieldAlertMessage.d.ts +1 -0
  138. package/dist/form-field/FormFieldCharactersCount.d.ts +1 -0
  139. package/dist/form-field/FormFieldControl.d.ts +1 -0
  140. package/dist/form-field/FormFieldErrorMessage.d.ts +1 -0
  141. package/dist/form-field/FormFieldHelperMessage.d.ts +1 -0
  142. package/dist/form-field/FormFieldLabel.d.ts +1 -0
  143. package/dist/form-field/FormFieldRequiredIndicator.d.ts +1 -0
  144. package/dist/form-field/FormFieldStateMessage.d.ts +3 -0
  145. package/dist/form-field/FormFieldSuccessMessage.d.ts +1 -0
  146. package/dist/form-field/index.js +1 -1
  147. package/dist/form-field/index.mjs +1 -1
  148. package/dist/{form-field-CYGgse45.js → form-field-1sKqNg7F.js} +2 -2
  149. package/dist/form-field-1sKqNg7F.js.map +1 -0
  150. package/dist/{form-field-CV5dzt-I.mjs → form-field-OhKW7u5I.mjs} +2 -2
  151. package/dist/form-field-OhKW7u5I.mjs.map +1 -0
  152. package/dist/input/InputLeadingIcon.d.ts +1 -0
  153. package/dist/input/InputTrailingIcon.d.ts +1 -0
  154. package/dist/input-BIuBpTEq.mjs.map +1 -1
  155. package/dist/input-Cx5cfgE8.js.map +1 -1
  156. package/dist/input-otp/InputOTPGroup.d.ts +3 -0
  157. package/dist/input-otp/InputOTPSeparator.d.ts +3 -0
  158. package/dist/input-otp/InputOTPSlot.d.ts +3 -0
  159. package/dist/input-otp/index.js.map +1 -1
  160. package/dist/input-otp/index.mjs.map +1 -1
  161. package/dist/kbd/index.js +1 -1
  162. package/dist/kbd/index.js.map +1 -1
  163. package/dist/kbd/index.mjs +1 -1
  164. package/dist/kbd/index.mjs.map +1 -1
  165. package/dist/label/LabelRequiredIndicator.d.ts +3 -0
  166. package/dist/label-BCSEss4U.js.map +1 -1
  167. package/dist/label-DDBRKLUX.mjs.map +1 -1
  168. package/dist/link-box/LinkBoxLink.d.ts +3 -0
  169. package/dist/link-box/LinkBoxRaised.d.ts +24 -0
  170. package/dist/link-box/index.js.map +1 -1
  171. package/dist/link-box/index.mjs.map +1 -1
  172. package/dist/menu/Menu.d.ts +15 -0
  173. package/dist/menu/MenuCheckboxItem.d.ts +20 -0
  174. package/dist/menu/MenuCheckboxItemIndicator.d.ts +25 -0
  175. package/dist/menu/MenuGroup.d.ts +12 -0
  176. package/dist/menu/MenuGroupLabel.d.ts +19 -0
  177. package/dist/menu/MenuItem.d.ts +19 -0
  178. package/dist/menu/MenuItemStyles.d.ts +5 -0
  179. package/dist/menu/MenuLinkItem.d.ts +27 -0
  180. package/dist/menu/MenuPopup.d.ts +19 -0
  181. package/dist/menu/MenuPortal.d.ts +12 -0
  182. package/dist/menu/MenuPositioner.d.ts +12 -0
  183. package/dist/menu/MenuRadioGroup.d.ts +12 -0
  184. package/dist/menu/MenuRadioItem.d.ts +20 -0
  185. package/dist/menu/MenuRadioItemIndicator.d.ts +25 -0
  186. package/dist/menu/MenuSeparator.d.ts +12 -0
  187. package/dist/menu/MenuSubmenu.d.ts +16 -0
  188. package/dist/menu/MenuSubmenuContext.d.ts +8 -0
  189. package/dist/menu/MenuSubmenuTrigger.d.ts +19 -0
  190. package/dist/menu/MenuTrigger.d.ts +21 -0
  191. package/dist/menu/index.d.mts +49 -0
  192. package/dist/menu/index.d.ts +49 -0
  193. package/dist/menu/index.js +2 -0
  194. package/dist/menu/index.js.map +1 -0
  195. package/dist/menu/index.mjs +289 -0
  196. package/dist/menu/index.mjs.map +1 -0
  197. package/dist/menu/useRenderSlot.d.ts +1 -0
  198. package/dist/meter/MeterLabel.d.ts +3 -0
  199. package/dist/meter/MeterTrack.d.ts +3 -0
  200. package/dist/meter/MeterValue.d.ts +3 -0
  201. package/dist/meter/index.js.map +1 -1
  202. package/dist/meter/index.mjs.map +1 -1
  203. package/dist/pagination/PaginationEllipsis.d.ts +3 -0
  204. package/dist/pagination/PaginationFirstPageTrigger.d.ts +3 -0
  205. package/dist/pagination/PaginationLastPageTrigger.d.ts +3 -0
  206. package/dist/pagination/PaginationNextTrigger.d.ts +3 -0
  207. package/dist/pagination/PaginationPages.d.ts +3 -0
  208. package/dist/pagination/PaginationPrevTrigger.d.ts +3 -0
  209. package/dist/pagination/index.js.map +1 -1
  210. package/dist/pagination/index.mjs.map +1 -1
  211. package/dist/popover/PopoverAnchor.d.ts +3 -0
  212. package/dist/popover/PopoverArrow.d.ts +3 -0
  213. package/dist/popover/PopoverCloseButton.d.ts +3 -0
  214. package/dist/popover/PopoverContent.d.ts +3 -0
  215. package/dist/popover/PopoverHeader.d.ts +3 -0
  216. package/dist/popover/PopoverPortal.d.ts +3 -0
  217. package/dist/popover/PopoverTrigger.d.ts +3 -0
  218. package/dist/popover-DKa4WOQV.mjs.map +1 -1
  219. package/dist/popover-ayPbAw59.js.map +1 -1
  220. package/dist/progress/ProgressLabel.d.ts +3 -0
  221. package/dist/progress/ProgressTrack.d.ts +1 -0
  222. package/dist/progress/ProgressValue.d.ts +1 -0
  223. package/dist/progress-C-Zs94G2.mjs.map +1 -1
  224. package/dist/progress-DaQt4olK.js.map +1 -1
  225. package/dist/progress-tracker/ProgressTrackerStep.d.ts +1 -0
  226. package/dist/progress-tracker/ProgressTrackerStepIndicator.d.ts +1 -0
  227. package/dist/progress-tracker/ProgressTrackerStepLabel.d.ts +1 -0
  228. package/dist/progress-tracker/index.js +1 -1
  229. package/dist/progress-tracker/index.js.map +1 -1
  230. package/dist/progress-tracker/index.mjs +2 -2
  231. package/dist/progress-tracker/index.mjs.map +1 -1
  232. package/dist/radio-group/Radio.d.ts +3 -0
  233. package/dist/radio-group/index.js.map +1 -1
  234. package/dist/radio-group/index.mjs.map +1 -1
  235. package/dist/rating/index.js +1 -1
  236. package/dist/rating/index.js.map +1 -1
  237. package/dist/rating/index.mjs +2 -2
  238. package/dist/rating/index.mjs.map +1 -1
  239. package/dist/rating-display/RatingDisplayCount.d.ts +1 -0
  240. package/dist/rating-display/RatingDisplayStars.d.ts +1 -0
  241. package/dist/rating-display/RatingDisplayValue.d.ts +1 -0
  242. package/dist/rating-display/index.js +1 -1
  243. package/dist/rating-display/index.js.map +1 -1
  244. package/dist/rating-display/index.mjs +4 -4
  245. package/dist/rating-display/index.mjs.map +1 -1
  246. package/dist/scrolling-list/ScrollingListControls.d.ts +1 -0
  247. package/dist/scrolling-list/ScrollingListItem.d.ts +1 -0
  248. package/dist/scrolling-list/ScrollingListItems.d.ts +1 -0
  249. package/dist/scrolling-list/ScrollingListNextButton.d.ts +1 -0
  250. package/dist/scrolling-list/ScrollingListPrevButton.d.ts +1 -0
  251. package/dist/scrolling-list/ScrollingListSkipButton.d.ts +1 -0
  252. package/dist/scrolling-list/index.js.map +1 -1
  253. package/dist/scrolling-list/index.mjs.map +1 -1
  254. package/dist/segmented-control/SegmentedControlIndicator.d.ts +1 -0
  255. package/dist/segmented-control/SegmentedControlItem.d.ts +1 -0
  256. package/dist/segmented-control/index.js.map +1 -1
  257. package/dist/segmented-control/index.mjs.map +1 -1
  258. package/dist/segmented-gauge/SegmentedGaugeLabel.d.ts +1 -0
  259. package/dist/segmented-gauge/SegmentedGaugeSegment.d.ts +3 -0
  260. package/dist/segmented-gauge/SegmentedGaugeTrack.d.ts +1 -0
  261. package/dist/segmented-gauge/index.js.map +1 -1
  262. package/dist/segmented-gauge/index.mjs.map +1 -1
  263. package/dist/select/SelectGroup.d.ts +3 -0
  264. package/dist/select/SelectItem.d.ts +3 -0
  265. package/dist/select/SelectItems.d.ts +3 -0
  266. package/dist/select/SelectLabel.d.ts +3 -0
  267. package/dist/select/SelectLeadingIcon.d.ts +3 -0
  268. package/dist/select/SelectPlaceholder.d.ts +3 -0
  269. package/dist/select/SelectTrigger.d.ts +3 -0
  270. package/dist/select/SelectValue.d.ts +3 -0
  271. package/dist/select/index.js.map +1 -1
  272. package/dist/select/index.mjs.map +1 -1
  273. package/dist/skeleton/SkeletonItem.d.ts +3 -0
  274. package/dist/skeleton/index.js.map +1 -1
  275. package/dist/skeleton/index.mjs.map +1 -1
  276. package/dist/slider/SliderControl.d.ts +1 -0
  277. package/dist/slider/SliderIndicator.d.ts +1 -0
  278. package/dist/slider/SliderLabel.d.ts +1 -0
  279. package/dist/slider/SliderMaxValue.d.ts +1 -0
  280. package/dist/slider/SliderMinValue.d.ts +1 -0
  281. package/dist/slider/SliderThumb.d.ts +1 -0
  282. package/dist/slider/SliderTrack.d.ts +1 -0
  283. package/dist/slider/SliderValue.d.ts +1 -3
  284. package/dist/slider/index.js.map +1 -1
  285. package/dist/slider/index.mjs.map +1 -1
  286. package/dist/stepper/index.js.map +1 -1
  287. package/dist/stepper/index.mjs.map +1 -1
  288. package/dist/table/TableBody.d.ts +1 -0
  289. package/dist/table/TableBulkBar.d.ts +15 -0
  290. package/dist/table/TableCell.d.ts +1 -0
  291. package/dist/table/TableColumn.d.ts +1 -0
  292. package/dist/table/TableHeader.d.ts +1 -0
  293. package/dist/table/TableRow.d.ts +1 -0
  294. package/dist/table/index.js.map +1 -1
  295. package/dist/table/index.mjs.map +1 -1
  296. package/dist/tabs/TabsContent.d.ts +1 -0
  297. package/dist/tabs/TabsList.d.ts +1 -0
  298. package/dist/tabs/TabsTrigger.d.ts +1 -0
  299. package/dist/tabs/index.js +1 -1
  300. package/dist/tabs/index.js.map +1 -1
  301. package/dist/tabs/index.mjs +1 -1
  302. package/dist/tabs/index.mjs.map +1 -1
  303. package/dist/text-link/index.js +1 -1
  304. package/dist/text-link/index.js.map +1 -1
  305. package/dist/text-link/index.mjs +1 -1
  306. package/dist/text-link/index.mjs.map +1 -1
  307. package/dist/textarea/TextareaClearButton.d.ts +1 -0
  308. package/dist/textarea/TextareaLeadingIcon.d.ts +1 -0
  309. package/dist/textarea/TextareaTrailingIcon.d.ts +1 -0
  310. package/dist/textarea/index.js.map +1 -1
  311. package/dist/textarea/index.mjs.map +1 -1
  312. package/package.json +5 -5
  313. package/dist/form-field-CV5dzt-I.mjs.map +0 -1
  314. package/dist/form-field-CYGgse45.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/useRenderSlot.tsx","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps & {\n orientation?: 'horizontal' | 'vertical'\n forceMount?: boolean\n}\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsProps\n extends\n Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <BaseTabs.Root\n ref={ref}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[hidden]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsContentProps extends PropsWithChildren<\n Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>\n> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\nexport const TabsContent = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n children,\n asChild = false,\n className,\n ref,\n forceMount,\n ...rest\n}: TabsContentProps) => {\n const { forceMount: contextForceMount } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n const keepMounted = contextForceMount || forceMount\n\n return (\n <BaseTabs.Panel\n data-spark-component=\"tabs-content\"\n ref={ref}\n keepMounted={keepMounted}\n className={contentStyles({ className, forceMount: keepMounted })}\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Panel>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useRenderSlot } from './useRenderSlot'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps extends Omit<\n ComponentProps<typeof BaseTabs.List>,\n 'render' | 'loopFocus'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\nexport const TabsList = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <BaseTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n render={renderSlot}\n loopFocus={loop}\n activateOnFocus\n {...rest}\n >\n {children}\n </BaseTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[active]:font-medium',\n 'not-data-[active]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[active]:text-main data-[active]:after:bg-main'],\n support: ['data-[active]:text-support data-[active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { type ComponentProps, type FocusEvent, type ReactNode, Ref, useRef } from 'react'\n\ntype TabKeyDownEvent = Parameters<NonNullable<ComponentProps<typeof BaseTabs.Tab>['onKeyDown']>>[0]\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TabsTrigger = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n const renderSlot = useRenderSlot(asChild)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: TabKeyDownEvent) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <BaseTabs.Tab\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n render={renderSlot}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </BaseTabs.Tab>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\n/**\n * A set of layered sections of content that users can navigate between using tab controls.\n */\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"mappings":"qnBASA,IAAa,GAAA,EAAA,EAAA,eAAkD,EAAE,CAAyB,CAE7E,MAAuB,CAClC,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAY,CAEvC,GAAI,CAAC,EACH,MAAM,MAAM,4DAA4D,CAG1E,OAAO,GChBI,GAAA,EAAA,EAAA,KAAiB,CAC5B,OACA,yCACA,uCACA,aACD,CAAC,CCLF,SAAgB,EAAc,EAAkB,CAC9C,OAAO,GAAW,CAAE,GAAG,MAAoB,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,GAAI,EAAS,CAAA,CAAG,IAAA,GC2BnE,IAAa,GAAQ,CACnB,SAAS,UACT,OAAO,KAKP,UAAU,GACV,aAAa,GACb,cAAc,aACd,WACA,YACA,MACA,GAAG,KACY,CACf,IAAM,EAAa,EAAc,EAAQ,CAEzC,OACE,EAAA,EAAA,KAAC,EAAY,SAAb,CACE,MAAO,CACL,SACA,OACA,cACA,aACD,WAED,EAAA,EAAA,KAAC,EAAA,KAAS,KAAV,CACO,MACQ,cACb,UAAW,EAAW,CAAE,YAAW,CAAC,CACpC,uBAAqB,OACrB,OAAQ,EACR,GAAI,EAEH,WACa,CAAA,CACK,CAAA,EAI3B,EAAK,YAAc,OCpEnB,IAAa,GAAA,EAAA,EAAA,KAAoB,CAAC,cAAe,gCAAgC,CAAE,CACjF,SAAU,CACR,WAAY,CACV,KAAM,uBACN,MAAO,GACR,CACF,CACF,CAAC,CCiBW,GAA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,UACA,YAAa,GAAe,aAC5B,YACD,CAAC,CACF,OAAQ,EACE,WACH,QACP,SAAU,CAAE,YACV,EAAO,eAAe,CACpB,SAAU,SACV,MAAO,UACP,OAAQ,UACT,CAAC,CAEJ,UAAW,EACX,gBAAe,EAAU,OAAS,IAAA,GAClC,GAAI,EAEH,WACY,CAAA,CAOjB,OAJK,GAKH,EAAA,EAAA,MAAC,MAAD,CAAK,UAAW,IAAgB,WAAa,kBAAoB,oBAAjE,CACG,GACD,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,iFACb,EAAA,EAAA,KAAC,EAAD,CAAsB,cAAgC,6BACnD,GAAsB,IAAa,CAAE,QAAS,EAAoB,CAAC,CAC5D,CAAA,CACN,CAAA,CACF,GAXC,GAeX,EAAY,YAAc,eCtH1B,IAAa,EAIT,OAAO,OAAO,EAAM,CACtB,KAAA,EACA,QAAA,EACA,QAAA,EACD,CAAC,CAEF,EAAK,YAAc,OACnB,EAAK,YAAc,YACnB,EAAQ,YAAc,eACtB,EAAQ,YAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/useRenderSlot.tsx","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps & {\n orientation?: 'horizontal' | 'vertical'\n forceMount?: boolean\n}\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsProps\n extends\n Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <BaseTabs.Root\n ref={ref}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[hidden]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsContentProps extends PropsWithChildren<\n Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>\n> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\n/** The panel that displays content associated with a tab. Renders a <div> element. */\nexport const TabsContent = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n children,\n asChild = false,\n className,\n ref,\n forceMount,\n ...rest\n}: TabsContentProps) => {\n const { forceMount: contextForceMount } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n const keepMounted = contextForceMount || forceMount\n\n return (\n <BaseTabs.Panel\n data-spark-component=\"tabs-content\"\n ref={ref}\n keepMounted={keepMounted}\n className={contentStyles({ className, forceMount: keepMounted })}\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Panel>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useRenderSlot } from './useRenderSlot'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps extends Omit<\n ComponentProps<typeof BaseTabs.List>,\n 'render' | 'loopFocus'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\n/** The container for the tab triggers. Renders a <div> element. */\nexport const TabsList = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <BaseTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n render={renderSlot}\n loopFocus={loop}\n activateOnFocus\n {...rest}\n >\n {children}\n </BaseTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[active]:font-bold',\n 'not-data-[active]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[active]:text-main data-[active]:after:bg-main'],\n support: ['data-[active]:text-support data-[active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { type ComponentProps, type FocusEvent, type ReactNode, Ref, useRef } from 'react'\n\ntype TabKeyDownEvent = Parameters<NonNullable<ComponentProps<typeof BaseTabs.Tab>['onKeyDown']>>[0]\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\n/** A button that activates a tab panel. Renders a <button> element. */\nexport const TabsTrigger = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n const renderSlot = useRenderSlot(asChild)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: TabKeyDownEvent) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <BaseTabs.Tab\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n render={renderSlot}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </BaseTabs.Tab>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\n/**\n * A set of layered sections of content that users can navigate between using tab controls.\n */\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"mappings":"qnBASA,IAAa,GAAA,EAAA,EAAA,eAAkD,EAAE,CAAyB,CAE7E,MAAuB,CAClC,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAY,CAEvC,GAAI,CAAC,EACH,MAAM,MAAM,4DAA4D,CAG1E,OAAO,GChBI,GAAA,EAAA,EAAA,KAAiB,C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,QAAA,EACA,QAAA,EACD,CAAC,CAEF,EAAK,YAAc,OACnB,EAAK,YAAc,YACnB,EAAQ,YAAc,eACtB,EAAQ,YAAc"}
@@ -256,7 +256,7 @@ var z = a([
256
256
  "border-outline",
257
257
  "hover:not-disabled:bg-surface-hovered",
258
258
  "after:absolute",
259
- "data-[active]:font-medium",
259
+ "data-[active]:font-bold",
260
260
  "not-data-[active]:not-disabled:cursor-pointer",
261
261
  "data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2",
262
262
  "data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/useRenderSlot.tsx","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps & {\n orientation?: 'horizontal' | 'vertical'\n forceMount?: boolean\n}\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsProps\n extends\n Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <BaseTabs.Root\n ref={ref}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[hidden]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsContentProps extends PropsWithChildren<\n Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>\n> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\nexport const TabsContent = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n children,\n asChild = false,\n className,\n ref,\n forceMount,\n ...rest\n}: TabsContentProps) => {\n const { forceMount: contextForceMount } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n const keepMounted = contextForceMount || forceMount\n\n return (\n <BaseTabs.Panel\n data-spark-component=\"tabs-content\"\n ref={ref}\n keepMounted={keepMounted}\n className={contentStyles({ className, forceMount: keepMounted })}\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Panel>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useRenderSlot } from './useRenderSlot'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps extends Omit<\n ComponentProps<typeof BaseTabs.List>,\n 'render' | 'loopFocus'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\nexport const TabsList = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <BaseTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n render={renderSlot}\n loopFocus={loop}\n activateOnFocus\n {...rest}\n >\n {children}\n </BaseTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[active]:font-medium',\n 'not-data-[active]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[active]:text-main data-[active]:after:bg-main'],\n support: ['data-[active]:text-support data-[active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { type ComponentProps, type FocusEvent, type ReactNode, Ref, useRef } from 'react'\n\ntype TabKeyDownEvent = Parameters<NonNullable<ComponentProps<typeof BaseTabs.Tab>['onKeyDown']>>[0]\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TabsTrigger = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n const renderSlot = useRenderSlot(asChild)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: TabKeyDownEvent) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <BaseTabs.Tab\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n render={renderSlot}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </BaseTabs.Tab>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\n/**\n * A set of layered sections of content that users can navigate between using tab controls.\n */\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"mappings":";;;;;;;;;;;;;;;AASA,IAAa,IAAc,EAAoC,EAAE,CAAyB,EAE7E,UAAuB;CAClC,IAAM,IAAU,EAAW,EAAY;AAEvC,KAAI,CAAC,EACH,OAAM,MAAM,4DAA4D;AAG1E,QAAO;GChBI,IAAa,EAAI;CAC5B;CACA;CACA;CACA;CACD,CAAC;;;ACLF,SAAgB,EAAc,GAAkB;AAC9C,QAAO,KAAW,EAAE,GAAG,QAAoB,kBAAC,GAAD,EAAM,GAAI,GAAS,CAAA,GAAG,KAAA;;;;AC2BnE,IAAa,KAAQ,EACnB,YAAS,WACT,UAAO,MAKP,aAAU,IACV,gBAAa,IACb,iBAAc,cACd,aACA,cACA,QACA,GAAG,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ClC,GAAI;EAEH;EACY,CAAA;AAOjB,QAJK,IAKH,kBAAC,OAAD;EAAK,WAAW,MAAgB,aAAa,oBAAoB;YAAjE,CACG,GACD,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IAAsB;IAAgC;eACnD,MAAsB,IAAa,EAAE,SAAS,GAAoB,CAAC;IAC5D,CAAA;GACN,CAAA,CACF;MAXC;;AAeX,EAAY,cAAc;;;ACtH1B,IAAa,IAIT,OAAO,OAAO,GAAM;CACtB,MAAA;CACA,SAAA;CACA,SAAA;CACD,CAAC;AAEF,EAAK,cAAc,QACnB,EAAK,cAAc,aACnB,EAAQ,cAAc,gBACtB,EAAQ,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/tabs/TabsContext.tsx","../../src/tabs/TabsRoot.styles.ts","../../src/tabs/useRenderSlot.tsx","../../src/tabs/Tabs.tsx","../../src/tabs/TabsContent.styles.ts","../../src/tabs/TabsContent.tsx","../../src/tabs/TabsList.styles.ts","../../src/tabs/useResizeObserver.ts","../../src/tabs/TabsList.tsx","../../src/tabs/TabsPopoverAbstraction.tsx","../../src/tabs/TabsTrigger.styles.ts","../../src/tabs/TabsTrigger.tsx","../../src/tabs/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\n\nexport type TabsContextInterface = TabsTriggerVariantsProps & {\n orientation?: 'horizontal' | 'vertical'\n forceMount?: boolean\n}\n\nexport const TabsContext = createContext<TabsContextInterface>({} as TabsContextInterface)\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext)\n\n if (!context) {\n throw Error('useTabsContext must be used within a TabsContext Provider')\n }\n\n return context\n}\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex',\n 'data-[orientation=horizontal]:flex-col',\n 'data-[orientation=vertical]:flex-row',\n 'max-w-full',\n])\n","import { Slot } from '../slot'\n\nexport function useRenderSlot(asChild: boolean) {\n return asChild ? ({ ...props }: object) => <Slot {...props} /> : undefined\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { TabsContext } from './TabsContext'\nimport { rootStyles } from './TabsRoot.styles'\nimport type { TabsTriggerVariantsProps } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsProps\n extends\n Omit<ComponentProps<typeof BaseTabs.Root>, 'render'>,\n PropsWithChildren<Omit<TabsTriggerVariantsProps, 'orientation'>> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Whether to keep inactive tabs content in the DOM.\n * @default false\n */\n forceMount?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * @deprecated\n */\nexport type TabsRootProps = TabsProps\n\nexport const Tabs = ({\n intent = 'support',\n size = 'md',\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n forceMount = false,\n orientation = 'horizontal',\n children,\n className,\n ref,\n ...rest\n}: TabsProps) => {\n const renderSlot = useRenderSlot(asChild)\n\n return (\n <TabsContext.Provider\n value={{\n intent,\n size,\n orientation,\n forceMount,\n }}\n >\n <BaseTabs.Root\n ref={ref}\n orientation={orientation}\n className={rootStyles({ className })}\n data-spark-component=\"tabs\"\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n )\n}\n\nTabs.displayName = 'Tabs'\n","import { cva } from 'class-variance-authority'\n\nexport const contentStyles = cva(['w-full p-lg', 'focus-visible:u-outline-inset'], {\n variants: {\n forceMount: {\n true: 'data-[hidden]:hidden',\n false: '',\n },\n },\n})\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { type ComponentProps, type PropsWithChildren, Ref } from 'react'\n\nimport { contentStyles } from './TabsContent.styles'\nimport { useTabsContext } from './TabsContext'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsContentProps extends PropsWithChildren<\n Omit<ComponentProps<typeof BaseTabs.Panel>, 'keepMounted' | 'render'>\n> {\n /**\n * A unique value that associates the content with a trigger.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true\n ref?: Ref<HTMLDivElement>\n}\n\n/** The panel that displays content associated with a tab. Renders a <div> element. */\nexport const TabsContent = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n children,\n asChild = false,\n className,\n ref,\n forceMount,\n ...rest\n}: TabsContentProps) => {\n const { forceMount: contextForceMount } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n const keepMounted = contextForceMount || forceMount\n\n return (\n <BaseTabs.Panel\n data-spark-component=\"tabs-content\"\n ref={ref}\n keepMounted={keepMounted}\n className={contentStyles({ className, forceMount: keepMounted })}\n render={renderSlot}\n {...rest}\n >\n {children}\n </BaseTabs.Panel>\n )\n}\n\nTabsContent.displayName = 'Tabs.Content'\n","import { cva } from 'class-variance-authority'\n\nexport const wrapperStyles = cva(['relative flex'])\n\nexport const listStyles = cva([\n 'flex w-full',\n 'data-[orientation=horizontal]:flex-row',\n 'data-[orientation=vertical]:flex-col',\n 'overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden',\n 'after:flex after:shrink after:grow after:border-outline',\n 'data-[orientation=horizontal]:after:border-b-sm',\n 'data-[orientation=vertical]:after:border-r-sm',\n])\n\nexport const navigationArrowStyles = cva([\n 'h-auto! flex-none',\n 'border-b-sm border-outline',\n 'outline-hidden',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!',\n])\n","import { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface Size {\n width?: number\n height?: number\n}\n\ntype ResizeCallback = (entry?: ResizeObserverEntry) => void\n\nexport const useResizeObserver = <T extends HTMLElement>(\n target: RefObject<T | null> | T | null,\n onResize?: ResizeCallback\n): Size => {\n const [size, setSize] = useState<Size>({ width: undefined, height: undefined })\n const resizeObserverRef = useRef<ResizeObserver>(null)\n const resizeCallbackRef = useRef<ResizeCallback | undefined>(onResize)\n\n useEffect(() => {\n resizeCallbackRef.current = onResize\n }, [onResize])\n\n useEffect(() => {\n const targetElm = target && 'current' in target ? target.current : target\n if (!targetElm || resizeObserverRef.current) {\n return\n }\n\n resizeObserverRef.current = new ResizeObserver(([entry]) => {\n const { inlineSize: width, blockSize: height } = entry?.borderBoxSize?.[0] ?? {}\n resizeCallbackRef.current?.(entry)\n\n setSize({ width, height })\n })\n\n resizeObserverRef.current.observe(targetElm as unknown as HTMLElement)\n\n return () => {\n resizeObserverRef.current &&\n resizeObserverRef.current.unobserve(targetElm as unknown as HTMLElement)\n }\n }, [target, resizeObserverRef, resizeCallbackRef])\n\n return size\n}\n","/* eslint-disable max-lines-per-function */\nimport { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { type ComponentProps, type ReactElement, Ref, useEffect, useRef, useState } from 'react'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useTabsContext } from './TabsContext'\nimport { listStyles, navigationArrowStyles, wrapperStyles } from './TabsList.styles'\nimport { useRenderSlot } from './useRenderSlot'\nimport { useResizeObserver } from './useResizeObserver'\n\nexport interface TabsListProps extends Omit<\n ComponentProps<typeof BaseTabs.List>,\n 'render' | 'loopFocus'\n> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa.\n * @default false\n */\n loop?: boolean\n children: ReactElement[] | ReactElement\n ref?: Ref<HTMLDivElement>\n}\n\ntype ArrowState = 'visible' | 'hidden' | 'disabled'\n\n/** The container for the tab triggers. Renders a <div> element. */\nexport const TabsList = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n loop = false,\n children,\n className,\n ref,\n ...rest\n}: TabsListProps) => {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef(null)\n const listRef = ref || innerRef\n const { orientation } = useTabsContext()\n const renderSlot = useRenderSlot(asChild)\n\n const { width } = useResizeObserver(wrapperRef)\n\n const [arrows, setArrows] = useState<Record<'prev' | 'next', ArrowState>>({\n prev: 'hidden',\n next: 'hidden',\n })\n\n useEffect(() => {\n /**\n * Show/hide arrows\n */\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n if (orientation !== 'horizontal') {\n setArrows({ prev: 'hidden', next: 'hidden' })\n } else {\n setArrows({\n prev: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n next: listRef.current.scrollWidth > listRef.current.clientWidth ? 'visible' : 'hidden',\n })\n }\n }, [orientation, listRef, width])\n\n useEffect(() => {\n /**\n * Enable/disable arrows\n */\n if (typeof listRef === 'function' || !listRef.current || arrows.prev === 'hidden' || loop) {\n return\n }\n\n const toggleArrowsVisibility = (target: HTMLDivElement) => {\n setArrows({\n prev: target.scrollLeft > 0 ? 'visible' : 'disabled',\n next: target.scrollLeft + target.clientWidth < target.scrollWidth ? 'visible' : 'disabled',\n })\n }\n\n const currentList = listRef.current\n\n toggleArrowsVisibility(currentList)\n\n currentList.addEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n\n return () =>\n currentList.removeEventListener('scroll', ({ target }) =>\n toggleArrowsVisibility(target as HTMLDivElement)\n )\n }, [listRef, arrows.prev, loop])\n\n const handlePrevClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopForward = loop && listRef.current.scrollLeft <= 0\n\n listRef.current.scrollTo({\n left: shouldLoopForward\n ? listRef.current.scrollLeft + listRef.current.scrollWidth - listRef.current.clientWidth\n : listRef.current.scrollLeft - listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n const handleNextClick = () => {\n if (typeof listRef === 'function' || !listRef.current) {\n return\n }\n\n const shouldLoopBackward =\n loop &&\n listRef.current.scrollLeft + listRef.current.clientWidth >= listRef.current.scrollWidth\n\n listRef.current.scrollTo({\n left: shouldLoopBackward ? 0 : listRef.current.scrollLeft + listRef.current.clientWidth,\n behavior: 'smooth',\n })\n }\n\n return (\n <div className={wrapperStyles({ className })} ref={wrapperRef}>\n {arrows.prev !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handlePrevClick}\n disabled={arrows.prev === 'disabled'}\n aria-label=\"Scroll left\"\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </Button>\n )}\n\n <BaseTabs.List\n data-spark-component=\"tabs-list\"\n ref={listRef}\n className={listStyles()}\n render={renderSlot}\n loopFocus={loop}\n activateOnFocus\n {...rest}\n >\n {children}\n </BaseTabs.List>\n\n {arrows.next !== 'hidden' && (\n <Button\n shape=\"square\"\n intent=\"surface\"\n size=\"sm\"\n className={navigationArrowStyles()}\n onClick={handleNextClick}\n disabled={arrows.next === 'disabled'}\n aria-label=\"Scroll right\"\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </Button>\n )}\n </div>\n )\n}\n\nTabsList.displayName = 'Tabs.List'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { MoreMenuHorizontal } from '@spark-ui/icons/MoreMenuHorizontal'\nimport { cx } from 'class-variance-authority'\nimport {\n type ComponentType,\n createContext,\n forwardRef,\n type ReactNode,\n type RefObject,\n useContext,\n useMemo,\n} from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { Popover as SparkPopover } from '../popover'\nimport type { PopoverProps } from '../popover/Popover'\nimport type { ContentProps as PopoverContentProps } from '../popover/PopoverContent'\nimport type { TriggerProps as PopoverTriggerProps } from '../popover/PopoverTrigger'\n\ninterface TabsPopoverContextValue {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n}\n\nconst TabsPopoverContext = createContext<TabsPopoverContextValue | undefined>(undefined)\n\nconst useTabsPopoverContext = () => {\n const context = useContext(TabsPopoverContext)\n if (!context) {\n throw new Error('TabsPopover components must be used within TabsPopover')\n }\n\n return context\n}\n\n// Trigger component that uses context\ninterface TabsPopoverTriggerProps extends Omit<PopoverTriggerProps, 'asChild' | 'children'> {\n 'aria-label': string\n children?: ReactNode\n}\n\nconst TabsPopoverTrigger = forwardRef<HTMLButtonElement, TabsPopoverTriggerProps>(\n ({ 'aria-label': ariaLabel, children: iconChildren, ...triggerProps }, forwardedRef) => {\n const { popoverTriggerRef } = useTabsPopoverContext()\n const mergedRef = useMergeRefs(forwardedRef, popoverTriggerRef)\n\n return (\n <SparkPopover.Trigger asChild {...triggerProps}>\n <IconButton\n ref={mergedRef}\n size=\"sm\"\n intent=\"surfaceInverse\"\n design=\"ghost\"\n aria-label={ariaLabel}\n tabIndex={-1}\n >\n <Icon>{iconChildren || <MoreMenuHorizontal />}</Icon>\n </IconButton>\n </SparkPopover.Trigger>\n )\n }\n)\n\nTabsPopoverTrigger.displayName = 'Popover.Trigger'\n\n// Content component that uses context\nconst TabsPopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n ({ side, align = 'start', className, ...contentProps }, ref) => {\n const { popoverSide } = useTabsPopoverContext()\n const mergedClassName = cx('gap-sm flex flex-col', className)\n\n return (\n <SparkPopover.Content\n ref={ref}\n {...contentProps}\n side={side ?? popoverSide}\n align={align}\n className={mergedClassName}\n />\n )\n }\n)\n\nTabsPopoverContent.displayName = 'Popover.Content'\n\n// Export types\nexport type TabsPopoverTriggerComponent = typeof TabsPopoverTrigger\nexport type TabsPopoverContentComponent = typeof TabsPopoverContent\n\n// Create a type that extends SparkPopover but overrides Content and Trigger\n// Use ComponentType for JSX compatibility and Omit to exclude only Content and Trigger,\n// then add them back with the overridden types\nexport type ConfiguredPopoverComponent = ComponentType<PopoverProps> &\n Omit<typeof SparkPopover, 'Content' | 'Trigger'> & {\n Content: TabsPopoverContentComponent\n Trigger: TabsPopoverTriggerComponent\n }\n\ninterface PopoverAbstractionProps {\n popoverSide: 'right' | 'bottom'\n popoverTriggerRef: RefObject<HTMLButtonElement | null>\n children: (Popover: ConfiguredPopoverComponent) => ReactNode\n}\n\nexport const Popover = ({ popoverSide, popoverTriggerRef, children }: PopoverAbstractionProps) => {\n const contextValue = useMemo(\n () => ({ popoverSide, popoverTriggerRef }),\n [popoverSide, popoverTriggerRef]\n )\n\n const PopoverWrapper: typeof SparkPopover = ((props: PopoverProps) => (\n <TabsPopoverContext.Provider value={contextValue}>\n <SparkPopover {...props}>{props.children}</SparkPopover>\n </TabsPopoverContext.Provider>\n )) as typeof SparkPopover\n\n const PopoverComponent = Object.assign(PopoverWrapper, SparkPopover, {\n Content: TabsPopoverContent,\n Trigger: TabsPopoverTrigger,\n }) as ConfiguredPopoverComponent\n\n return (\n <TabsPopoverContext.Provider value={contextValue}>\n {children(PopoverComponent)}\n </TabsPopoverContext.Provider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const triggerVariants = cva(\n [\n 'px-md',\n 'relative flex flex-none items-center',\n 'border-outline',\n 'hover:not-disabled:bg-surface-hovered',\n 'after:absolute',\n 'data-[active]:font-bold',\n 'not-data-[active]:not-disabled:cursor-pointer',\n 'data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2',\n 'data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2',\n 'focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md',\n '[&>svg:last-child:first-child]:mx-auto',\n ],\n {\n variants: {\n /**\n * Change the color scheme of the tabs\n * @default support\n */\n intent: makeVariants<'intent', ['main', 'support']>({\n main: ['data-[active]:text-main data-[active]:after:bg-main'],\n support: ['data-[active]:text-support data-[active]:after:bg-support'],\n }),\n /**\n * Change the size of the tabs\n * @default md\n */\n size: {\n xs: ['h-sz-32 min-w-sz-32 text-caption'],\n sm: ['h-sz-36 min-w-sz-36 text-body-2'],\n md: ['h-sz-40 min-w-sz-40 text-body-1'],\n },\n hasMenu: {\n true: 'pr-3xl',\n },\n orientation: {\n horizontal: '',\n vertical: '',\n },\n },\n compoundVariants: [\n {\n hasMenu: true,\n orientation: 'vertical',\n class: 'w-full',\n },\n ],\n defaultVariants: {\n intent: 'support',\n size: 'md',\n hasMenu: false,\n orientation: 'horizontal',\n },\n }\n)\n\nexport type TabsTriggerVariantsProps = VariantProps<typeof triggerVariants>\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { type ComponentProps, type FocusEvent, type ReactNode, Ref, useRef } from 'react'\n\ntype TabKeyDownEvent = Parameters<NonNullable<ComponentProps<typeof BaseTabs.Tab>['onKeyDown']>>[0]\n\nimport { useTabsContext } from './TabsContext'\nimport { type ConfiguredPopoverComponent, Popover } from './TabsPopoverAbstraction'\nimport { triggerVariants } from './TabsTrigger.styles'\nimport { useRenderSlot } from './useRenderSlot'\n\nexport interface TabsTriggerProps extends Omit<ComponentProps<typeof BaseTabs.Tab>, 'render'> {\n /**\n * A unique value that associates the trigger with a content.\n */\n value: string\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n * @default false\n */\n asChild?: boolean\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean\n /**\n * Function that receives a pre-configured Popover component and returns the popover structure.\n * @example\n * renderMenu={({ Popover }) => (\n * <Popover>\n * <Popover.Trigger aria-label=\"Options\">\n * <CustomIcon />\n * </Popover.Trigger>\n * <Popover.Content>\n * <Button>Action</Button>\n * </Popover.Content>\n * </Popover>\n * )}\n */\n renderMenu?: (props: { Popover: ConfiguredPopoverComponent }) => ReactNode\n ref?: Ref<HTMLButtonElement>\n}\n\n/** A button that activates a tab panel. Renders a <button> element. */\nexport const TabsTrigger = ({\n /**\n * Default Base UI Primitive values\n * see https://base-ui.com/react/components/tabs\n */\n asChild = false,\n value,\n disabled = false,\n children,\n className,\n ref,\n onKeyDown,\n renderMenu,\n ...rest\n}: TabsTriggerProps) => {\n const { intent, size, orientation } = useTabsContext()\n const popoverTriggerRef = useRef<HTMLButtonElement>(null)\n const tabsTriggerRef = useRef<HTMLButtonElement>(null)\n const renderSlot = useRenderSlot(asChild)\n\n // Combine internal ref with forwarded ref\n const mergedRef = useMergeRefs(ref, tabsTriggerRef)\n\n const handleKeyDown = (e: TabKeyDownEvent) => {\n // Handle Shift+F10 for popover\n if (e.key === 'F10' && e.shiftKey && renderMenu && popoverTriggerRef.current) {\n e.preventDefault()\n popoverTriggerRef.current.click()\n }\n\n // Call original onKeyDown if provided\n onKeyDown?.(e)\n }\n\n const hasMenu = !!renderMenu\n const popoverSide = orientation === 'vertical' ? 'right' : 'bottom'\n\n const trigger = (\n <BaseTabs.Tab\n data-spark-component=\"tabs-trigger\"\n ref={mergedRef}\n className={triggerVariants({\n intent,\n size,\n hasMenu,\n orientation: orientation ?? 'horizontal',\n className,\n })}\n render={renderSlot}\n disabled={disabled}\n value={value}\n onFocus={({ target }: FocusEvent<HTMLButtonElement>) =>\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n onKeyDown={handleKeyDown}\n aria-haspopup={hasMenu ? 'true' : undefined}\n {...rest}\n >\n {children}\n </BaseTabs.Tab>\n )\n\n if (!hasMenu) {\n return trigger\n }\n\n return (\n <div className={orientation === 'vertical' ? 'relative w-full' : 'relative'}>\n {trigger}\n <div className=\"right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2\">\n <Popover popoverSide={popoverSide} popoverTriggerRef={popoverTriggerRef}>\n {PopoverAbstraction => renderMenu?.({ Popover: PopoverAbstraction })}\n </Popover>\n </div>\n </div>\n )\n}\n\nTabsTrigger.displayName = 'Tabs.Trigger'\n","import { Tabs as Root } from './Tabs'\nimport { TabsContent as Content } from './TabsContent'\nimport { TabsList as List } from './TabsList'\nimport { TabsTrigger as Trigger } from './TabsTrigger'\n\n/**\n * A set of layered sections of content that users can navigate between using tab controls.\n */\nexport const Tabs: typeof Root & {\n List: typeof List\n Trigger: typeof Trigger\n Content: typeof Content\n} = Object.assign(Root, {\n List,\n Trigger,\n Content,\n})\n\nTabs.displayName = 'Tabs'\nList.displayName = 'Tabs.List'\nTrigger.displayName = 'Tabs.Trigger'\nContent.displayName = 'Tabs.Content'\n\nexport { type TabsContentProps } from './TabsContent'\nexport { type TabsListProps } from './TabsList'\nexport { type TabsProps, type TabsRootProps } from './Tabs'\nexport { type TabsTriggerProps } from './TabsTrigger'\n"],"mappings":";;;;;;;;;;;;;;;AASA,IAAa,IAAc,EAAoC,EAAE,CAAyB,EAE7E,UAAuB;CAClC,IAAM,IAAU,EAAW,EAAY;AAEvC,KAAI,CAAC,EACH,OAAM,MAAM,4DAA4D;AAG1E,QAAO;GChBI,IAAa,EAAI;CAC5B;CACA;CACA;CACA;CACD,CAAC;;;ACLF,SAAgB,EAAc,GAAkB;AAC9C,QAAO,KAAW,EAAE,GAAG,QAAoB,kBAAC,GAAD,EAAM,GAAI,GAAS,CAAA,GAAG,KAAA;;;;AC2BnE,IAAa,KAAQ,EACnB,YAAS,WACT,UAAO,MAKP,aAAU,IACV,gBAAa,IACb,iBAAc,cACd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IAAU,SAAS,KAAA;EAClC,GAAI;EAEH;EACY,CAAA;AAOjB,QAJK,IAKH,kBAAC,OAAD;EAAK,WAAW,MAAgB,aAAa,oBAAoB;YAAjE,CACG,GACD,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IAAsB;IAAgC;eACnD,MAAsB,IAAa,EAAE,SAAS,GAAoB,CAAC;IAC5D,CAAA;GACN,CAAA,CACF;MAXC;;AAeX,EAAY,cAAc;;;ACvH1B,IAAa,IAIT,OAAO,OAAO,GAAM;CACtB,MAAA;CACA,SAAA;CACA,SAAA;CACD,CAAC;AAEF,EAAK,cAAc,QACnB,EAAK,cAAc,aACnB,EAAQ,cAAc,gBACtB,EAAQ,cAAc"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../slot/index.js`);let t=require(`class-variance-authority`),n=require(`react/jsx-runtime`);var r=(0,t.cva)([`inline-flex items-center focus-visible:u-outline`],{variants:{intent:{current:`text-current hover:opacity-dim-1`,main:`text-main hover:text-main-hovered`,support:`text-support hover:text-support-hovered`,accent:`text-accent hover:text-accent-hovered`,success:`text-success hover:text-success-hovered`,alert:`text-alert hover:text-alert-hovered`,danger:`text-error hover:text-error-hovered`,info:`text-info hover:text-info-hovered`,neutral:`text-neutral hover:text-neutral-hovered`},bold:{true:`font-medium`},underline:{true:`underline`,false:`hover:underline focus:underline`}},defaultVariants:{intent:`current`,bold:!1,underline:!0}}),i=({asChild:t=!1,bold:i=!1,children:a,className:o,intent:s=`current`,underline:c=!0,ref:l,...u})=>(0,n.jsx)(t?e.Slot:`a`,{"data-spark-component":`text-link`,ref:l,className:r({className:o,bold:i,intent:s,underline:c}),...u,children:a});exports.TextLink=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../slot/index.js`);let t=require(`class-variance-authority`),n=require(`react/jsx-runtime`);var r=(0,t.cva)([`inline-flex items-center focus-visible:u-outline`],{variants:{intent:{current:`text-current hover:opacity-dim-1`,main:`text-main hover:text-main-hovered`,support:`text-support hover:text-support-hovered`,accent:`text-accent hover:text-accent-hovered`,success:`text-success hover:text-success-hovered`,alert:`text-alert hover:text-alert-hovered`,danger:`text-error hover:text-error-hovered`,info:`text-info hover:text-info-hovered`,neutral:`text-neutral hover:text-neutral-hovered`},bold:{true:`font-bold`},underline:{true:`underline`,false:`hover:underline focus:underline`}},defaultVariants:{intent:`current`,bold:!1,underline:!0}}),i=({asChild:t=!1,bold:i=!1,children:a,className:o,intent:s=`current`,underline:c=!0,ref:l,...u})=>(0,n.jsx)(t?e.Slot:`a`,{"data-spark-component":`text-link`,ref:l,className:r({className:o,bold:i,intent:s,underline:c}),...u,children:a});exports.TextLink=i;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/text-link/TextLink.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-medium',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\n/**\n * A clickable text element that navigates users to another page or section.\n */\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n data-spark-component=\"text-link\"\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n"],"mappings":"gNAKA,IAAM,GAAA,EAAA,EAAA,KAAqB,CAAC,mDAAmD,CAAE,CAC/E,SAAU,CACR,OAAQ,CACN,QAAS,mCACT,KAAM,oCACN,QAAS,0CACT,OAAQ,wCACR,QAAS,0CACT,MAAO,sCACP,OAAQ,sCACR,KAAM,oCACN,QAAS,0CACV,CAED,KAAM,CACJ,KAAM,cACP,CAKD,UAAW,CACT,KAAM,YACN,MAAO,kCACR,CACF,CACD,gBAAiB,CACf,OAAQ,UACR,KAAM,GACN,UAAW,GACZ,CACF,CAAC,CAeW,GAAY,CACvB,UAAU,GACV,OAAO,GACP,WACA,YACA,SAAS,UACT,YAAY,GACZ,MACA,GAAG,MAKD,EAAA,EAAA,KAHgB,EAAU,EAAA,KAAO,IAGjC,CACE,uBAAqB,YAChB,MACL,UAAW,EAAe,CAAE,YAAW,OAAM,SAAQ,YAAW,CAAC,CACjE,GAAI,EAEH,WACS,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/text-link/TextLink.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-bold',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\n/**\n * A clickable text element that navigates users to another page or section.\n */\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n data-spark-component=\"text-link\"\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n"],"mappings":"gNAKA,IAAM,GAAA,EAAA,EAAA,KAAqB,CAAC,mDAAmD,CAAE,CAC/E,SAAU,CACR,OAAQ,CACN,QAAS,mCACT,KAAM,oCACN,QAAS,0CACT,OAAQ,wCACR,QAAS,0CACT,MAAO,sCACP,OAAQ,sCACR,KAAM,oCACN,QAAS,0CACV,CAED,KAAM,CACJ,KAAM,YACP,CAKD,UAAW,CACT,KAAM,YACN,MAAO,kCACR,CACF,CACD,gBAAiB,CACf,OAAQ,UACR,KAAM,GACN,UAAW,GACZ,CACF,CAAC,CAeW,GAAY,CACvB,UAAU,GACV,OAAO,GACP,WACA,YACA,SAAS,UACT,YAAY,GACZ,MACA,GAAG,MAKD,EAAA,EAAA,KAHgB,EAAU,EAAA,KAAO,IAGjC,CACE,uBAAqB,YAChB,MACL,UAAW,EAAe,CAAE,YAAW,OAAM,SAAQ,YAAW,CAAC,CACjE,GAAI,EAEH,WACS,CAAA"}
@@ -15,7 +15,7 @@ var r = t(["inline-flex items-center focus-visible:u-outline"], {
15
15
  info: "text-info hover:text-info-hovered",
16
16
  neutral: "text-neutral hover:text-neutral-hovered"
17
17
  },
18
- bold: { true: "font-medium" },
18
+ bold: { true: "font-bold" },
19
19
  underline: {
20
20
  true: "underline",
21
21
  false: "hover:underline focus:underline"
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/text-link/TextLink.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-medium',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\n/**\n * A clickable text element that navigates users to another page or section.\n */\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n data-spark-component=\"text-link\"\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n"],"mappings":";;;;AAKA,IAAM,IAAiB,EAAI,CAAC,mDAAmD,EAAE;CAC/E,UAAU;EACR,QAAQ;GACN,SAAS;GACT,MAAM;GACN,SAAS;GACT,QAAQ;GACR,SAAS;GACT,OAAO;GACP,QAAQ;GACR,MAAM;GACN,SAAS;GACV;EAED,MAAM,EACJ,MAAM,eACP;EAKD,WAAW;GACT,MAAM;GACN,OAAO;GACR;EACF;CACD,iBAAiB;EACf,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF,CAAC,EAeW,KAAY,EACvB,aAAU,IACV,UAAO,IACP,aACA,cACA,YAAS,WACT,eAAY,IACZ,QACA,GAAG,QAKD,kBAHgB,IAAU,IAAO,KAGjC;CACE,wBAAqB;CAChB;CACL,WAAW,EAAe;EAAE;EAAW;EAAM;EAAQ;EAAW,CAAC;CACjE,GAAI;CAEH;CACS,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/text-link/TextLink.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nconst textLinkStyles = cva(['inline-flex items-center focus-visible:u-outline'], {\n variants: {\n intent: {\n current: 'text-current hover:opacity-dim-1',\n main: 'text-main hover:text-main-hovered',\n support: 'text-support hover:text-support-hovered',\n accent: 'text-accent hover:text-accent-hovered',\n success: 'text-success hover:text-success-hovered',\n alert: 'text-alert hover:text-alert-hovered',\n danger: 'text-error hover:text-error-hovered',\n info: 'text-info hover:text-info-hovered',\n neutral: 'text-neutral hover:text-neutral-hovered',\n },\n /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */\n bold: {\n true: 'font-bold',\n },\n /**\n * Underline is enabled by default.\n * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not.\n */\n underline: {\n true: 'underline',\n false: 'hover:underline focus:underline',\n },\n },\n defaultVariants: {\n intent: 'current',\n bold: false,\n underline: true,\n },\n})\n\nexport type StylesProps = VariantProps<typeof textLinkStyles>\n\nexport type TextLinkProps = ComponentPropsWithRef<'a'> &\n StylesProps & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n }\n\n/**\n * A clickable text element that navigates users to another page or section.\n */\nexport const TextLink = ({\n asChild = false,\n bold = false,\n children,\n className,\n intent = 'current',\n underline = true,\n ref,\n ...props\n}: TextLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n data-spark-component=\"text-link\"\n ref={ref}\n className={textLinkStyles({ className, bold, intent, underline })}\n {...props}\n >\n {children}\n </Component>\n )\n}\n"],"mappings":";;;;AAKA,IAAM,IAAiB,EAAI,CAAC,mDAAmD,EAAE;CAC/E,UAAU;EACR,QAAQ;GACN,SAAS;GACT,MAAM;GACN,SAAS;GACT,QAAQ;GACR,SAAS;GACT,OAAO;GACP,QAAQ;GACR,MAAM;GACN,SAAS;GACV;EAED,MAAM,EACJ,MAAM,aACP;EAKD,WAAW;GACT,MAAM;GACN,OAAO;GACR;EACF;CACD,iBAAiB;EACf,QAAQ;EACR,MAAM;EACN,WAAW;EACZ;CACF,CAAC,EAeW,KAAY,EACvB,aAAU,IACV,UAAO,IACP,aACA,cACA,YAAS,WACT,eAAY,IACZ,QACA,GAAG,QAKD,kBAHgB,IAAU,IAAO,KAGjC;CACE,wBAAqB;CAChB;CACL,WAAW,EAAe;EAAE;EAAW;EAAM;EAAQ;EAAW,CAAC;CACjE,GAAI;CAEH;CACS,CAAA"}
@@ -3,6 +3,7 @@ export interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'butt
3
3
  'aria-label': string;
4
4
  ref?: Ref<HTMLButtonElement>;
5
5
  }
6
+ /** A button to clear the textarea value. Renders a <button> element. */
6
7
  export declare const TextareaClearButton: {
7
8
  (props: TextareaClearButtonProps): import("react/jsx-runtime").JSX.Element;
8
9
  id: string;
@@ -1,5 +1,6 @@
1
1
  import { InputLeadingIconProps } from '../input';
2
2
  export type TextareaLeadingIconProps = InputLeadingIconProps;
3
+ /** An icon displayed before the textarea text. Renders a <div> element. */
3
4
  export declare const TextareaLeadingIcon: {
4
5
  (props: InputLeadingIconProps): import("react/jsx-runtime").JSX.Element;
5
6
  id: string;
@@ -1,5 +1,6 @@
1
1
  import { InputTrailingIconProps } from '../input';
2
2
  export type TextareaTrailingIconProps = InputTrailingIconProps;
3
+ /** An icon displayed after the textarea text. Renders a <div> element. */
3
4
  export declare const TextareaTrailingIcon: {
4
5
  (props: InputTrailingIconProps): import("react/jsx-runtime").JSX.Element;
5
6
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/textarea/TextareaClearButton.tsx","../../src/textarea/TextareaGroup.tsx","../../src/textarea/TextareaLeadingIcon.tsx","../../src/textarea/TextareaTrailingIcon.tsx","../../src/textarea/Textarea.tsx","../../src/textarea/index.ts"],"sourcesContent":["import { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { InputGroup } from '../input'\n\nexport interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TextareaClearButton = (props: TextareaClearButtonProps) => {\n return (\n <InputGroup.ClearButton inline data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n )\n}\n\nTextareaClearButton.id = InputGroup.ClearButton.id\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n","import { InputGroup, InputGroupProps } from '../input'\n\nexport type TextareaGroupProps = InputGroupProps\n\nexport const TextareaGroup = (props: TextareaGroupProps) => {\n return <InputGroup {...props} />\n}\n\nTextareaGroup.displayName = 'TextareaGroup'\n","import { InputGroup, InputLeadingIconProps } from '../input'\n\nexport type TextareaLeadingIconProps = InputLeadingIconProps\n\nexport const TextareaLeadingIcon = (props: InputLeadingIconProps) => {\n return <InputGroup.LeadingIcon data-spark-component=\"textarea-group-leading-icon\" {...props} />\n}\n\nTextareaLeadingIcon.id = InputGroup.LeadingIcon.id\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\n","import { InputGroup, InputTrailingIconProps } from '../input'\n\nexport type TextareaTrailingIconProps = InputTrailingIconProps\n\nexport const TextareaTrailingIcon = (props: InputTrailingIconProps) => {\n return <InputGroup.TrailingIcon data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n}\n\nTextareaTrailingIcon.id = InputGroup.TrailingIcon.id\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nimport { Input, InputProps } from '../input'\n\ntype TextareaPrimitiveProps = ComponentPropsWithoutRef<'textarea'>\n\nexport interface TextareaProps extends TextareaPrimitiveProps, Pick<InputProps, 'onValueChange'> {\n isResizable?: boolean\n ref?: Ref<HTMLTextAreaElement>\n}\n\nconst Root = ({\n className,\n disabled,\n rows = 1,\n isResizable = true,\n ref,\n onValueChange,\n ...others\n}: PropsWithChildren<TextareaProps>) => {\n return (\n <Input\n className={cx(\n className,\n 'py-[var(--spacing-sz-10)]',\n isResizable ? 'resize-y' : 'resize-none'\n )}\n data-spark-component=\"textarea\"\n disabled={disabled}\n asChild\n onValueChange={onValueChange}\n >\n <textarea ref={ref} rows={rows} {...others} />\n </Input>\n )\n}\n\n/**\n * A multi-line text input field that allows users to enter longer text content.\n */\nexport const Textarea = Object.assign(Root, {\n id: Input.id,\n})\n\nRoot.displayName = 'Textarea'\n","import { TextareaClearButton } from './TextareaClearButton'\nimport { TextareaGroup as Root } from './TextareaGroup'\nimport { TextareaLeadingIcon } from './TextareaLeadingIcon'\nimport { TextareaTrailingIcon } from './TextareaTrailingIcon'\n\nexport * from './Textarea'\n\n/**\n * A wrapper component that combines a Textarea with icons and interactive elements\n * to create enhanced text input patterns with visual indicators and clear functionality.\n */\nexport const TextareaGroup: typeof Root & {\n LeadingIcon: typeof TextareaLeadingIcon\n TrailingIcon: typeof TextareaTrailingIcon\n ClearButton: typeof TextareaClearButton\n} = Object.assign(Root, {\n LeadingIcon: TextareaLeadingIcon,\n TrailingIcon: TextareaTrailingIcon,\n ClearButton: TextareaClearButton,\n})\n\nTextareaGroup.displayName = 'TextareaGroup'\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n\nexport { type TextareaGroupProps } from './TextareaGroup'\nexport { type TextareaLeadingIconProps } from './TextareaLeadingIcon'\nexport { type TextareaTrailingIconProps } from './TextareaTrailingIcon'\nexport { type TextareaClearButtonProps } from './TextareaClearButton'\n"],"mappings":"oNASA,IAAa,EAAuB,IAEhC,EAAA,EAAA,KAAC,EAAA,EAAW,YAAZ,CAAwB,OAAA,GAAO,uBAAqB,+BAA+B,GAAI,EAAS,CAAA,CAIpG,EAAoB,GAAK,EAAA,EAAW,YAAY,GAChD,EAAoB,YAAc,4BCZlC,IAAa,EAAiB,IACrB,EAAA,EAAA,KAAC,EAAA,EAAD,CAAY,GAAI,EAAS,CAAA,CAGlC,EAAc,YAAc,gBCJ5B,IAAa,EAAuB,IAC3B,EAAA,EAAA,KAAC,EAAA,EAAW,YAAZ,CAAwB,uBAAqB,8BAA8B,GAAI,EAAS,CAAA,CAGjG,EAAoB,GAAK,EAAA,EAAW,YAAY,GAChD,EAAoB,YAAc,4BCLlC,IAAa,EAAwB,IAC5B,EAAA,EAAA,KAAC,EAAA,EAAW,aAAZ,CAAyB,uBAAqB,+BAA+B,GAAI,EAAS,CAAA,CAGnG,EAAqB,GAAK,EAAA,EAAW,aAAa,GAClD,EAAqB,YAAc,6BCGnC,IAAM,GAAQ,CACZ,YACA,WACA,OAAO,EACP,cAAc,GACd,MACA,gBACA,GAAG,MAGD,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,WAAA,EAAA,EAAA,IACE,EACA,4BACA,EAAc,WAAa,cAC5B,CACD,uBAAqB,WACX,WACV,QAAA,GACe,0BAEf,EAAA,EAAA,KAAC,WAAD,CAAe,MAAW,OAAM,GAAI,EAAU,CAAA,CACxC,CAAA,CAOC,EAAW,OAAO,OAAO,EAAM,CAC1C,GAAI,EAAA,EAAM,GACX,CAAC,CAEF,EAAK,YAAc,WClCnB,IAAa,EAIT,OAAO,OAAO,EAAM,CACtB,YAAa,EACb,aAAc,EACd,YAAa,EACd,CAAC,CAEF,EAAc,YAAc,gBAC5B,EAAoB,YAAc,4BAClC,EAAqB,YAAc,6BACnC,EAAoB,YAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/textarea/TextareaClearButton.tsx","../../src/textarea/TextareaGroup.tsx","../../src/textarea/TextareaLeadingIcon.tsx","../../src/textarea/TextareaTrailingIcon.tsx","../../src/textarea/Textarea.tsx","../../src/textarea/index.ts"],"sourcesContent":["import { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { InputGroup } from '../input'\n\nexport interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/** A button to clear the textarea value. Renders a <button> element. */\nexport const TextareaClearButton = (props: TextareaClearButtonProps) => {\n return (\n <InputGroup.ClearButton inline data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n )\n}\n\nTextareaClearButton.id = InputGroup.ClearButton.id\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n","import { InputGroup, InputGroupProps } from '../input'\n\nexport type TextareaGroupProps = InputGroupProps\n\nexport const TextareaGroup = (props: TextareaGroupProps) => {\n return <InputGroup {...props} />\n}\n\nTextareaGroup.displayName = 'TextareaGroup'\n","import { InputGroup, InputLeadingIconProps } from '../input'\n\nexport type TextareaLeadingIconProps = InputLeadingIconProps\n\n/** An icon displayed before the textarea text. Renders a <div> element. */\nexport const TextareaLeadingIcon = (props: InputLeadingIconProps) => {\n return <InputGroup.LeadingIcon data-spark-component=\"textarea-group-leading-icon\" {...props} />\n}\n\nTextareaLeadingIcon.id = InputGroup.LeadingIcon.id\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\n","import { InputGroup, InputTrailingIconProps } from '../input'\n\nexport type TextareaTrailingIconProps = InputTrailingIconProps\n\n/** An icon displayed after the textarea text. Renders a <div> element. */\nexport const TextareaTrailingIcon = (props: InputTrailingIconProps) => {\n return <InputGroup.TrailingIcon data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n}\n\nTextareaTrailingIcon.id = InputGroup.TrailingIcon.id\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nimport { Input, InputProps } from '../input'\n\ntype TextareaPrimitiveProps = ComponentPropsWithoutRef<'textarea'>\n\nexport interface TextareaProps extends TextareaPrimitiveProps, Pick<InputProps, 'onValueChange'> {\n isResizable?: boolean\n ref?: Ref<HTMLTextAreaElement>\n}\n\nconst Root = ({\n className,\n disabled,\n rows = 1,\n isResizable = true,\n ref,\n onValueChange,\n ...others\n}: PropsWithChildren<TextareaProps>) => {\n return (\n <Input\n className={cx(\n className,\n 'py-[var(--spacing-sz-10)]',\n isResizable ? 'resize-y' : 'resize-none'\n )}\n data-spark-component=\"textarea\"\n disabled={disabled}\n asChild\n onValueChange={onValueChange}\n >\n <textarea ref={ref} rows={rows} {...others} />\n </Input>\n )\n}\n\n/**\n * A multi-line text input field that allows users to enter longer text content.\n */\nexport const Textarea = Object.assign(Root, {\n id: Input.id,\n})\n\nRoot.displayName = 'Textarea'\n","import { TextareaClearButton } from './TextareaClearButton'\nimport { TextareaGroup as Root } from './TextareaGroup'\nimport { TextareaLeadingIcon } from './TextareaLeadingIcon'\nimport { TextareaTrailingIcon } from './TextareaTrailingIcon'\n\nexport * from './Textarea'\n\n/**\n * A wrapper component that combines a Textarea with icons and interactive elements\n * to create enhanced text input patterns with visual indicators and clear functionality.\n */\nexport const TextareaGroup: typeof Root & {\n LeadingIcon: typeof TextareaLeadingIcon\n TrailingIcon: typeof TextareaTrailingIcon\n ClearButton: typeof TextareaClearButton\n} = Object.assign(Root, {\n LeadingIcon: TextareaLeadingIcon,\n TrailingIcon: TextareaTrailingIcon,\n ClearButton: TextareaClearButton,\n})\n\nTextareaGroup.displayName = 'TextareaGroup'\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n\nexport { type TextareaGroupProps } from './TextareaGroup'\nexport { type TextareaLeadingIconProps } from './TextareaLeadingIcon'\nexport { type TextareaTrailingIconProps } from './TextareaTrailingIcon'\nexport { type TextareaClearButtonProps } from './TextareaClearButton'\n"],"mappings":"oNAUA,IAAa,EAAuB,IAEhC,EAAA,EAAA,KAAC,EAAA,EAAW,YAAZ,CAAwB,OAAA,GAAO,uBAAqB,+BAA+B,GAAI,EAAS,CAAA,CAIpG,EAAoB,GAAK,EAAA,EAAW,YAAY,GAChD,EAAoB,YAAc,4BCblC,IAAa,EAAiB,IACrB,EAAA,EAAA,KAAC,EAAA,EAAD,CAAY,GAAI,EAAS,CAAA,CAGlC,EAAc,YAAc,gBCH5B,IAAa,EAAuB,IAC3B,EAAA,EAAA,KAAC,EAAA,EAAW,YAAZ,CAAwB,uBAAqB,8BAA8B,GAAI,EAAS,CAAA,CAGjG,EAAoB,GAAK,EAAA,EAAW,YAAY,GAChD,EAAoB,YAAc,4BCLlC,IAAa,EAAwB,IAC5B,EAAA,EAAA,KAAC,EAAA,EAAW,aAAZ,CAAyB,uBAAqB,+BAA+B,GAAI,EAAS,CAAA,CAGnG,EAAqB,GAAK,EAAA,EAAW,aAAa,GAClD,EAAqB,YAAc,6BCEnC,IAAM,GAAQ,CACZ,YACA,WACA,OAAO,EACP,cAAc,GACd,MACA,gBACA,GAAG,MAGD,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,WAAA,EAAA,EAAA,IACE,EACA,4BACA,EAAc,WAAa,cAC5B,CACD,uBAAqB,WACX,WACV,QAAA,GACe,0BAEf,EAAA,EAAA,KAAC,WAAD,CAAe,MAAW,OAAM,GAAI,EAAU,CAAA,CACxC,CAAA,CAOC,EAAW,OAAO,OAAO,EAAM,CAC1C,GAAI,EAAA,EAAM,GACX,CAAC,CAEF,EAAK,YAAc,WClCnB,IAAa,EAIT,OAAO,OAAO,EAAM,CACtB,YAAa,EACb,aAAc,EACd,YAAa,EACd,CAAC,CAEF,EAAc,YAAc,gBAC5B,EAAoB,YAAc,4BAClC,EAAqB,YAAc,6BACnC,EAAoB,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/textarea/TextareaClearButton.tsx","../../src/textarea/TextareaGroup.tsx","../../src/textarea/TextareaLeadingIcon.tsx","../../src/textarea/TextareaTrailingIcon.tsx","../../src/textarea/Textarea.tsx","../../src/textarea/index.ts"],"sourcesContent":["import { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { InputGroup } from '../input'\n\nexport interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TextareaClearButton = (props: TextareaClearButtonProps) => {\n return (\n <InputGroup.ClearButton inline data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n )\n}\n\nTextareaClearButton.id = InputGroup.ClearButton.id\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n","import { InputGroup, InputGroupProps } from '../input'\n\nexport type TextareaGroupProps = InputGroupProps\n\nexport const TextareaGroup = (props: TextareaGroupProps) => {\n return <InputGroup {...props} />\n}\n\nTextareaGroup.displayName = 'TextareaGroup'\n","import { InputGroup, InputLeadingIconProps } from '../input'\n\nexport type TextareaLeadingIconProps = InputLeadingIconProps\n\nexport const TextareaLeadingIcon = (props: InputLeadingIconProps) => {\n return <InputGroup.LeadingIcon data-spark-component=\"textarea-group-leading-icon\" {...props} />\n}\n\nTextareaLeadingIcon.id = InputGroup.LeadingIcon.id\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\n","import { InputGroup, InputTrailingIconProps } from '../input'\n\nexport type TextareaTrailingIconProps = InputTrailingIconProps\n\nexport const TextareaTrailingIcon = (props: InputTrailingIconProps) => {\n return <InputGroup.TrailingIcon data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n}\n\nTextareaTrailingIcon.id = InputGroup.TrailingIcon.id\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nimport { Input, InputProps } from '../input'\n\ntype TextareaPrimitiveProps = ComponentPropsWithoutRef<'textarea'>\n\nexport interface TextareaProps extends TextareaPrimitiveProps, Pick<InputProps, 'onValueChange'> {\n isResizable?: boolean\n ref?: Ref<HTMLTextAreaElement>\n}\n\nconst Root = ({\n className,\n disabled,\n rows = 1,\n isResizable = true,\n ref,\n onValueChange,\n ...others\n}: PropsWithChildren<TextareaProps>) => {\n return (\n <Input\n className={cx(\n className,\n 'py-[var(--spacing-sz-10)]',\n isResizable ? 'resize-y' : 'resize-none'\n )}\n data-spark-component=\"textarea\"\n disabled={disabled}\n asChild\n onValueChange={onValueChange}\n >\n <textarea ref={ref} rows={rows} {...others} />\n </Input>\n )\n}\n\n/**\n * A multi-line text input field that allows users to enter longer text content.\n */\nexport const Textarea = Object.assign(Root, {\n id: Input.id,\n})\n\nRoot.displayName = 'Textarea'\n","import { TextareaClearButton } from './TextareaClearButton'\nimport { TextareaGroup as Root } from './TextareaGroup'\nimport { TextareaLeadingIcon } from './TextareaLeadingIcon'\nimport { TextareaTrailingIcon } from './TextareaTrailingIcon'\n\nexport * from './Textarea'\n\n/**\n * A wrapper component that combines a Textarea with icons and interactive elements\n * to create enhanced text input patterns with visual indicators and clear functionality.\n */\nexport const TextareaGroup: typeof Root & {\n LeadingIcon: typeof TextareaLeadingIcon\n TrailingIcon: typeof TextareaTrailingIcon\n ClearButton: typeof TextareaClearButton\n} = Object.assign(Root, {\n LeadingIcon: TextareaLeadingIcon,\n TrailingIcon: TextareaTrailingIcon,\n ClearButton: TextareaClearButton,\n})\n\nTextareaGroup.displayName = 'TextareaGroup'\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n\nexport { type TextareaGroupProps } from './TextareaGroup'\nexport { type TextareaLeadingIconProps } from './TextareaLeadingIcon'\nexport { type TextareaTrailingIconProps } from './TextareaTrailingIcon'\nexport { type TextareaClearButtonProps } from './TextareaClearButton'\n"],"mappings":";;;;AASA,IAAa,KAAuB,MAEhC,kBAAC,EAAW,aAAZ;CAAwB,QAAA;CAAO,wBAAqB;CAA+B,GAAI;CAAS,CAAA;AAIpG,EAAoB,KAAK,EAAW,YAAY,IAChD,EAAoB,cAAc;;;ACZlC,IAAa,KAAiB,MACrB,kBAAC,GAAD,EAAY,GAAI,GAAS,CAAA;AAGlC,EAAc,cAAc;;;ACJ5B,IAAa,KAAuB,MAC3B,kBAAC,EAAW,aAAZ;CAAwB,wBAAqB;CAA8B,GAAI;CAAS,CAAA;AAGjG,EAAoB,KAAK,EAAW,YAAY,IAChD,EAAoB,cAAc;;;ACLlC,IAAa,KAAwB,MAC5B,kBAAC,EAAW,cAAZ;CAAyB,wBAAqB;CAA+B,GAAI;CAAS,CAAA;AAGnG,EAAqB,KAAK,EAAW,aAAa,IAClD,EAAqB,cAAc;;;ACGnC,IAAM,KAAQ,EACZ,cACA,aACA,UAAO,GACP,iBAAc,IACd,QACA,kBACA,GAAG,QAGD,kBAAC,GAAD;CACE,WAAW,EACT,GACA,6BACA,IAAc,aAAa,cAC5B;CACD,wBAAqB;CACX;CACV,SAAA;CACe;WAEf,kBAAC,YAAD;EAAe;EAAW;EAAM,GAAI;EAAU,CAAA;CACxC,CAAA,EAOC,IAAW,OAAO,OAAO,GAAM,EAC1C,IAAI,EAAM,IACX,CAAC;AAEF,EAAK,cAAc;;;AClCnB,IAAa,IAIT,OAAO,OAAO,GAAM;CACtB,aAAa;CACb,cAAc;CACd,aAAa;CACd,CAAC;AAEF,EAAc,cAAc,iBAC5B,EAAoB,cAAc,6BAClC,EAAqB,cAAc,8BACnC,EAAoB,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/textarea/TextareaClearButton.tsx","../../src/textarea/TextareaGroup.tsx","../../src/textarea/TextareaLeadingIcon.tsx","../../src/textarea/TextareaTrailingIcon.tsx","../../src/textarea/Textarea.tsx","../../src/textarea/index.ts"],"sourcesContent":["import { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { InputGroup } from '../input'\n\nexport interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/** A button to clear the textarea value. Renders a <button> element. */\nexport const TextareaClearButton = (props: TextareaClearButtonProps) => {\n return (\n <InputGroup.ClearButton inline data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n )\n}\n\nTextareaClearButton.id = InputGroup.ClearButton.id\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n","import { InputGroup, InputGroupProps } from '../input'\n\nexport type TextareaGroupProps = InputGroupProps\n\nexport const TextareaGroup = (props: TextareaGroupProps) => {\n return <InputGroup {...props} />\n}\n\nTextareaGroup.displayName = 'TextareaGroup'\n","import { InputGroup, InputLeadingIconProps } from '../input'\n\nexport type TextareaLeadingIconProps = InputLeadingIconProps\n\n/** An icon displayed before the textarea text. Renders a <div> element. */\nexport const TextareaLeadingIcon = (props: InputLeadingIconProps) => {\n return <InputGroup.LeadingIcon data-spark-component=\"textarea-group-leading-icon\" {...props} />\n}\n\nTextareaLeadingIcon.id = InputGroup.LeadingIcon.id\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\n","import { InputGroup, InputTrailingIconProps } from '../input'\n\nexport type TextareaTrailingIconProps = InputTrailingIconProps\n\n/** An icon displayed after the textarea text. Renders a <div> element. */\nexport const TextareaTrailingIcon = (props: InputTrailingIconProps) => {\n return <InputGroup.TrailingIcon data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n}\n\nTextareaTrailingIcon.id = InputGroup.TrailingIcon.id\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nimport { Input, InputProps } from '../input'\n\ntype TextareaPrimitiveProps = ComponentPropsWithoutRef<'textarea'>\n\nexport interface TextareaProps extends TextareaPrimitiveProps, Pick<InputProps, 'onValueChange'> {\n isResizable?: boolean\n ref?: Ref<HTMLTextAreaElement>\n}\n\nconst Root = ({\n className,\n disabled,\n rows = 1,\n isResizable = true,\n ref,\n onValueChange,\n ...others\n}: PropsWithChildren<TextareaProps>) => {\n return (\n <Input\n className={cx(\n className,\n 'py-[var(--spacing-sz-10)]',\n isResizable ? 'resize-y' : 'resize-none'\n )}\n data-spark-component=\"textarea\"\n disabled={disabled}\n asChild\n onValueChange={onValueChange}\n >\n <textarea ref={ref} rows={rows} {...others} />\n </Input>\n )\n}\n\n/**\n * A multi-line text input field that allows users to enter longer text content.\n */\nexport const Textarea = Object.assign(Root, {\n id: Input.id,\n})\n\nRoot.displayName = 'Textarea'\n","import { TextareaClearButton } from './TextareaClearButton'\nimport { TextareaGroup as Root } from './TextareaGroup'\nimport { TextareaLeadingIcon } from './TextareaLeadingIcon'\nimport { TextareaTrailingIcon } from './TextareaTrailingIcon'\n\nexport * from './Textarea'\n\n/**\n * A wrapper component that combines a Textarea with icons and interactive elements\n * to create enhanced text input patterns with visual indicators and clear functionality.\n */\nexport const TextareaGroup: typeof Root & {\n LeadingIcon: typeof TextareaLeadingIcon\n TrailingIcon: typeof TextareaTrailingIcon\n ClearButton: typeof TextareaClearButton\n} = Object.assign(Root, {\n LeadingIcon: TextareaLeadingIcon,\n TrailingIcon: TextareaTrailingIcon,\n ClearButton: TextareaClearButton,\n})\n\nTextareaGroup.displayName = 'TextareaGroup'\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n\nexport { type TextareaGroupProps } from './TextareaGroup'\nexport { type TextareaLeadingIconProps } from './TextareaLeadingIcon'\nexport { type TextareaTrailingIconProps } from './TextareaTrailingIcon'\nexport { type TextareaClearButtonProps } from './TextareaClearButton'\n"],"mappings":";;;;AAUA,IAAa,KAAuB,MAEhC,kBAAC,EAAW,aAAZ;CAAwB,QAAA;CAAO,wBAAqB;CAA+B,GAAI;CAAS,CAAA;AAIpG,EAAoB,KAAK,EAAW,YAAY,IAChD,EAAoB,cAAc;;;ACblC,IAAa,KAAiB,MACrB,kBAAC,GAAD,EAAY,GAAI,GAAS,CAAA;AAGlC,EAAc,cAAc;;;ACH5B,IAAa,KAAuB,MAC3B,kBAAC,EAAW,aAAZ;CAAwB,wBAAqB;CAA8B,GAAI;CAAS,CAAA;AAGjG,EAAoB,KAAK,EAAW,YAAY,IAChD,EAAoB,cAAc;;;ACLlC,IAAa,KAAwB,MAC5B,kBAAC,EAAW,cAAZ;CAAyB,wBAAqB;CAA+B,GAAI;CAAS,CAAA;AAGnG,EAAqB,KAAK,EAAW,aAAa,IAClD,EAAqB,cAAc;;;ACEnC,IAAM,KAAQ,EACZ,cACA,aACA,UAAO,GACP,iBAAc,IACd,QACA,kBACA,GAAG,QAGD,kBAAC,GAAD;CACE,WAAW,EACT,GACA,6BACA,IAAc,aAAa,cAC5B;CACD,wBAAqB;CACX;CACV,SAAA;CACe;WAEf,kBAAC,YAAD;EAAe;EAAW;EAAM,GAAI;EAAU,CAAA;CACxC,CAAA,EAOC,IAAW,OAAO,OAAO,GAAM,EAC1C,IAAI,EAAM,IACX,CAAC;AAEF,EAAK,cAAc;;;AClCnB,IAAa,IAIT,OAAO,OAAO,GAAM;CACtB,aAAa;CACb,cAAc;CACd,aAAa;CACd,CAAC;AAEF,EAAc,cAAc,iBAC5B,EAAoB,cAAc,6BAClC,EAAqB,cAAc,8BACnC,EAAoB,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/components",
3
- "version": "17.9.0-beta.1",
3
+ "version": "17.9.0",
4
4
  "license": "MIT",
5
5
  "description": "Spark (Leboncoin design system) components.",
6
6
  "exports": {
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@base-ui/react": "1.0.0",
51
- "@spark-ui/hooks": "17.9.0-beta.1",
52
- "@spark-ui/icons": "17.9.0-beta.1",
53
- "@spark-ui/internal-utils": "17.9.0-beta.1",
51
+ "@spark-ui/hooks": "17.9.0",
52
+ "@spark-ui/icons": "17.9.0",
53
+ "@spark-ui/internal-utils": "17.9.0",
54
54
  "@zag-js/pagination": "1.30.0",
55
55
  "@zag-js/react": "1.30.0",
56
56
  "class-variance-authority": "0.7.1",
@@ -62,7 +62,7 @@
62
62
  "react-snap-carousel": "0.5.1"
63
63
  },
64
64
  "peerDependencies": {
65
- "@spark-ui/theme-utils": "17.9.0-beta.1",
65
+ "@spark-ui/theme-utils": "17.9.0",
66
66
  "react": "19.2.4",
67
67
  "react-dom": "19.2.4",
68
68
  "tailwindcss": "4.1.18"
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-field-CV5dzt-I.mjs","names":[],"sources":["../src/form-field/FormFieldContext.tsx","../src/form-field/FormFieldProvider.tsx","../src/form-field/FormField.tsx","../src/form-field/FormFieldMessage.tsx","../src/form-field/FormFieldStateMessage.tsx","../src/form-field/FormFieldAlertMessage.tsx","../src/form-field/FormFieldCharactersCount.tsx","../src/form-field/FormFieldControl.tsx","../src/form-field/FormFieldDescription.tsx","../src/form-field/FormFieldErrorMessage.tsx","../src/form-field/FormFieldHelperMessage.tsx","../src/form-field/FormFieldLabel.tsx","../src/form-field/FormFieldSuccessMessage.tsx","../src/form-field/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nexport interface FormFieldContextState {\n /**\n * Generated id for the input component.\n */\n id: string\n /**\n * Generated id for the label component.\n */\n labelId?: string\n /**\n * The name of the input. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * A set of ids separated by a space used to describe the input component given by a set of messages.\n */\n description?: string\n /**\n * Disables the field and its associated input\n */\n disabled?: boolean\n /**\n * Marks the field and its associated input as read only\n */\n readOnly?: boolean\n /**\n * The validation state of the input.\n */\n state?: 'error' | 'success' | 'alert'\n /**\n * If true, the form field will be invalid.\n */\n isInvalid?: boolean\n /**\n * If true, the form field will be required.\n */\n isRequired?: boolean\n /**\n * Callback used to store a descriptive message.\n */\n onMessageIdAdd: (id: string) => void\n /**\n * Callback used to remove a descriptive message.\n */\n onMessageIdRemove: (id: string) => void\n}\n\nexport const FormFieldContext = createContext<FormFieldContextState | null>(null)\n\nexport const ID_PREFIX = ':form-field'\n\nexport const useFormField = () => {\n const context = useContext(FormFieldContext)\n\n if (!context) {\n throw Error('useFormField must be used within a FormField provider')\n }\n\n return context\n}\n","import { ReactNode, useCallback, useId, useMemo, useState } from 'react'\n\nimport { FormFieldContext, FormFieldContextState, ID_PREFIX } from './FormFieldContext'\n\nexport interface FormFieldProviderProps extends Pick<\n FormFieldContextState,\n 'id' | 'name' | 'disabled' | 'readOnly' | 'state' | 'isRequired'\n> {\n children: ReactNode\n}\n\nexport const FormFieldProvider = ({\n id,\n name,\n disabled = false,\n readOnly = false,\n state,\n isRequired,\n children,\n}: FormFieldProviderProps) => {\n const labelId = `${ID_PREFIX}-label-${useId()}`\n const [messageIds, setMessageIds] = useState<string[]>([])\n const description = messageIds.length > 0 ? messageIds.join(' ') : undefined\n\n const handleMessageIdAdd = useCallback((msgId: string) => {\n setMessageIds(ids => [...ids, msgId])\n }, [])\n\n const handleMessageIdRemove = useCallback((msgId: string) => {\n setMessageIds(ids => ids.filter(current => current !== msgId))\n }, [])\n\n const value = useMemo(() => {\n const isInvalid = state === 'error'\n\n return {\n id,\n labelId,\n name,\n disabled,\n readOnly,\n state,\n isRequired,\n isInvalid,\n description,\n onMessageIdAdd: handleMessageIdAdd,\n onMessageIdRemove: handleMessageIdRemove,\n }\n }, [\n id,\n labelId,\n name,\n disabled,\n readOnly,\n description,\n state,\n isRequired,\n handleMessageIdAdd,\n handleMessageIdRemove,\n ])\n\n return <FormFieldContext.Provider value={value}>{children}</FormFieldContext.Provider>\n}\n\nFormFieldProvider.displayName = 'FormFieldProvider'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useId } from 'react'\n\nimport { Slot } from '../slot'\nimport { FormFieldContextState, ID_PREFIX } from './FormFieldContext'\nimport { FormFieldProvider } from './FormFieldProvider'\n\nexport interface FormFieldProps\n extends\n ComponentPropsWithoutRef<'div'>,\n Pick<FormFieldContextState, 'name' | 'state' | 'isRequired'> {\n /**\n * Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.\n */\n asChild?: boolean\n /**\n * When `true`, prevents the user from interacting.\n */\n disabled?: boolean\n /**\n * Sets the component as interactive or not.\n */\n readOnly?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const FormField = ({\n className,\n disabled = false,\n readOnly = false,\n name,\n state,\n isRequired = false,\n asChild = false,\n ref,\n ...others\n}: FormFieldProps) => {\n const id = `${ID_PREFIX}-${useId()}`\n const Component = asChild ? Slot : 'div'\n\n return (\n <FormFieldProvider\n id={id}\n name={name}\n isRequired={isRequired}\n disabled={disabled}\n readOnly={readOnly}\n state={state}\n >\n <Component\n ref={ref}\n data-spark-component=\"form-field\"\n className={cx(className, 'gap-md flex flex-col')}\n {...others}\n />\n </FormFieldProvider>\n )\n}\n\nFormField.displayName = 'FormField'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useId } from 'react'\n\nimport { ID_PREFIX, useFormField } from './FormFieldContext'\n\nexport type FormFieldMessageProps = ComponentPropsWithoutRef<'span'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldMessage = ({\n id: idProp,\n className,\n ref,\n ...others\n}: FormFieldMessageProps) => {\n const { onMessageIdAdd, onMessageIdRemove } = useFormField()\n const currentId = `${ID_PREFIX}-message-${useId()}`\n const id = idProp || currentId\n\n useEffect(() => {\n onMessageIdAdd(id)\n\n return () => {\n onMessageIdRemove(id)\n }\n }, [id, onMessageIdAdd, onMessageIdRemove])\n\n return (\n <span\n ref={ref}\n id={id}\n data-spark-component=\"form-field-message\"\n className={cx(className, 'default:text-caption')}\n {...others}\n />\n )\n}\n\nFormFieldMessage.displayName = 'FormField.Message'\n","import { AlertOutline } from '@spark-ui/icons/AlertOutline'\nimport { Check } from '@spark-ui/icons/Check'\nimport { WarningOutline } from '@spark-ui/icons/WarningOutline'\nimport { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport interface FormFieldStateMessageProps extends FormFieldMessageProps {\n state: 'error' | 'alert' | 'success'\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldStateMessage = ({\n className,\n state,\n children,\n ref,\n ...others\n}: FormFieldStateMessageProps) => {\n const field = useFormField()\n\n if (field.state !== state) {\n return null\n }\n\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-state-message\"\n className={cx(\n 'gap-sm flex items-center',\n state === 'error' ? 'text-error' : 'text-on-surface/dim-1',\n className\n )}\n {...others}\n >\n {state === 'alert' && (\n <Icon size=\"sm\">\n <WarningOutline />\n </Icon>\n )}\n {state === 'error' && (\n <Icon size=\"sm\" intent=\"error\">\n <AlertOutline />\n </Icon>\n )}\n {state === 'success' && (\n <Icon size=\"sm\">\n <Check />\n </Icon>\n )}\n\n {children}\n </FormFieldMessage>\n )\n}\n\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldAlertMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldAlertMessage = ({ ref, ...props }: FormFieldAlertMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-alert-message\"\n state=\"alert\"\n {...props}\n />\n )\n}\n\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useState } from 'react'\n\nimport { FormFieldMessage } from './FormFieldMessage'\n\nexport type FormFieldCharactersCountProps = ComponentPropsWithoutRef<'span'> & {\n /**\n * This description is for the screen reader, read when the input is focused.\n */\n description?: string\n /**\n * The live announcement is for the screen read after a delay once the input value changes.\n */\n liveAnnouncement?: ({ remainingChars }: { remainingChars: number }) => string\n /**\n * Current value for the input this component belongs to.\n */\n value?: string\n /**\n * Maximum numeric value to be displayed.\n */\n maxLength: number\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldCharactersCount = ({\n className,\n value = '',\n maxLength,\n description,\n liveAnnouncement,\n ref,\n ...others\n}: FormFieldCharactersCountProps) => {\n const [throttledValue, setThrottledValue] = useState(value)\n\n /**\n * The value is throttled to avoid spamming the aria-live region (and consequently the screen reader).\n */\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n setThrottledValue(value)\n }, 1000)\n\n return () => clearTimeout(timeoutId)\n }, [value])\n\n return (\n <span className=\"ml-auto self-start\">\n {description && (\n <FormFieldMessage className=\"default:sr-only\">{description}</FormFieldMessage>\n )}\n <span\n ref={ref}\n aria-hidden\n data-spark-component=\"form-field-characters-count\"\n className={cx(className, 'text-caption', 'text-neutral')}\n {...others}\n >\n {`${value.length}/${maxLength}`}\n </span>\n\n {liveAnnouncement && (\n <span className=\"sr-only\" aria-live=\"polite\">\n {liveAnnouncement({ remainingChars: maxLength - throttledValue.length })}\n </span>\n )}\n </span>\n )\n}\n\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n","import { ReactNode, useContext } from 'react'\n\nimport { FormFieldContext, FormFieldContextState } from './FormFieldContext'\n\ntype State = Partial<\n Pick<\n FormFieldContextState,\n | 'id'\n | 'name'\n | 'description'\n | 'labelId'\n | 'disabled'\n | 'readOnly'\n | 'state'\n | 'isInvalid'\n | 'isRequired'\n >\n>\n\nexport interface FormFieldControlProps {\n children: (state: State) => ReactNode\n}\n\nexport const useFormFieldControl = () => {\n const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } =\n useContext(FormFieldContext) || {}\n\n return {\n id,\n name,\n description,\n disabled,\n readOnly,\n state,\n labelId,\n isInvalid,\n isRequired,\n } as State\n}\n\nexport const FormFieldControl = ({ children }: FormFieldControlProps) => {\n const props = useFormFieldControl()\n\n return <>{children(props)}</>\n}\n\nFormFieldControl.displayName = 'FormField.Control'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport type FormFieldDescriptionProps = FormFieldMessageProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldDescription = ({ className, ref, ...others }: FormFieldDescriptionProps) => {\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-description\"\n className={cx('text-on-surface/dim-1 text-body-2', className)}\n {...others}\n />\n )\n}\n\nFormFieldDescription.displayName = 'FormField.Description'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldErrorMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldErrorMessage = ({ ref, ...props }: FormFieldErrorMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-error-message\"\n state=\"error\"\n {...props}\n />\n )\n}\n\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { FormFieldMessage, FormFieldMessageProps } from './FormFieldMessage'\n\nexport type FormFieldHelperMessageProps = FormFieldMessageProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldHelperMessage = ({\n className,\n ref,\n ...others\n}: FormFieldHelperMessageProps) => {\n return (\n <FormFieldMessage\n ref={ref}\n data-spark-component=\"form-field-helper-message\"\n className={cx('text-on-surface/dim-1', className)}\n {...others}\n />\n )\n}\n\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, Ref } from 'react'\n\nimport { Label, LabelProps } from '../label'\nimport { Slottable } from '../slot'\nimport { useFormField } from './FormFieldContext'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\n\nexport interface FormFieldLabelProps extends LabelProps {\n /**\n * Element shown when the input is required inside the label.\n */\n requiredIndicator?: ReactNode\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const FormFieldLabel = ({\n htmlFor: htmlForProp,\n className,\n children,\n requiredIndicator = <FormFieldRequiredIndicator />,\n asChild,\n ref,\n ...others\n}: FormFieldLabelProps) => {\n const control = useFormField()\n\n const { disabled, labelId, isRequired } = control\n const htmlFor = asChild ? undefined : htmlForProp || control.id\n\n return (\n <Label\n ref={ref}\n id={labelId}\n data-spark-component=\"form-field-label\"\n htmlFor={htmlFor}\n className={cx(\n 'default:font-medium',\n className,\n disabled ? 'text-on-surface/dim-3 pointer-events-none' : undefined\n )}\n asChild={asChild}\n {...others}\n >\n <>\n <Slottable>{children}</Slottable>\n {isRequired && requiredIndicator}\n </>\n </Label>\n )\n}\n\nFormFieldLabel.displayName = 'FormField.Label'\n","import { Ref } from 'react'\n\nimport { FormFieldStateMessage, FormFieldStateMessageProps } from './FormFieldStateMessage'\n\nexport type FormFieldSuccessMessageProps = Omit<FormFieldStateMessageProps, 'state'> & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const FormFieldSuccessMessage = ({ ref, ...props }: FormFieldSuccessMessageProps) => {\n return (\n <FormFieldStateMessage\n ref={ref}\n data-spark-component=\"form-field-success-message\"\n state=\"success\"\n {...props}\n />\n )\n}\n\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\n","import { FormField as Root } from './FormField'\nimport { FormFieldAlertMessage } from './FormFieldAlertMessage'\nimport { FormFieldCharactersCount } from './FormFieldCharactersCount'\nimport { FormFieldControl } from './FormFieldControl'\nimport { FormFieldDescription } from './FormFieldDescription'\nimport { FormFieldErrorMessage } from './FormFieldErrorMessage'\nimport { FormFieldHelperMessage } from './FormFieldHelperMessage'\nimport { FormFieldLabel } from './FormFieldLabel'\nimport { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'\nimport { FormFieldStateMessage } from './FormFieldStateMessage'\nimport { FormFieldSuccessMessage } from './FormFieldSuccessMessage'\n\n/**\n * A wrapper component that provides consistent layout and accessibility features for form inputs.\n */\nexport const FormField: typeof Root & {\n Label: typeof FormFieldLabel\n Description: typeof FormFieldDescription\n Control: typeof FormFieldControl\n StateMessage: typeof FormFieldStateMessage\n SuccessMessage: typeof FormFieldSuccessMessage\n AlertMessage: typeof FormFieldAlertMessage\n ErrorMessage: typeof FormFieldErrorMessage\n HelperMessage: typeof FormFieldHelperMessage\n RequiredIndicator: typeof FormFieldRequiredIndicator\n CharactersCount: typeof FormFieldCharactersCount\n} = Object.assign(Root, {\n Label: FormFieldLabel,\n Description: FormFieldDescription,\n Control: FormFieldControl,\n StateMessage: FormFieldStateMessage,\n SuccessMessage: FormFieldSuccessMessage,\n AlertMessage: FormFieldAlertMessage,\n ErrorMessage: FormFieldErrorMessage,\n HelperMessage: FormFieldHelperMessage,\n RequiredIndicator: FormFieldRequiredIndicator,\n CharactersCount: FormFieldCharactersCount,\n})\n\nFormField.displayName = 'FormField'\nFormFieldLabel.displayName = 'FormField.Label'\nFormFieldDescription.displayName = 'FormField.Description'\nFormFieldControl.displayName = 'FormField.Control'\nFormFieldStateMessage.displayName = 'FormField.StateMessage'\nFormFieldSuccessMessage.displayName = 'FormField.SuccessMessage'\nFormFieldAlertMessage.displayName = 'FormField.AlertMessage'\nFormFieldErrorMessage.displayName = 'FormField.ErrorMessage'\nFormFieldHelperMessage.displayName = 'FormField.HelperMessage'\nFormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'\nFormFieldCharactersCount.displayName = 'FormField.CharactersCount'\n\nexport { type FormFieldProps } from './FormField'\nexport { type FormFieldStateMessageProps } from './FormFieldStateMessage'\nexport { type FormFieldControl, useFormFieldControl } from './FormFieldControl'\nexport { type FormFieldDescriptionProps } from './FormFieldDescription'\nexport { type FormFieldHelperMessageProps } from './FormFieldHelperMessage'\nexport { type FormFieldSuccessMessageProps } from './FormFieldSuccessMessage'\nexport { type FormFieldAlertMessageProps } from './FormFieldAlertMessage'\nexport { type FormFieldErrorMessageProps } from './FormFieldErrorMessage'\nexport { type FormFieldLabelProps } from './FormFieldLabel'\nexport { type FormFieldRequiredIndicatorProps } from './FormFieldRequiredIndicator'\nexport { type FormFieldCharactersCountProps } from './FormFieldCharactersCount'\n"],"mappings":";;;;;;;;;;;AAiDA,IAAa,IAAmB,EAA4C,KAAK,EAEpE,IAAY,eAEZ,UAAqB;CAChC,IAAM,IAAU,EAAW,EAAiB;AAE5C,KAAI,CAAC,EACH,OAAM,MAAM,wDAAwD;AAGtE,QAAO;GCjDI,KAAqB,EAChC,OACA,SACA,cAAW,IACX,cAAW,IACX,UACA,eACA,kBAC4B;CAC5B,IAAM,IAAU,GAAG,EAAU,SAAS,GAAO,IACvC,CAAC,GAAY,KAAiB,EAAmB,EAAE,CAAC,EACpD,I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