reka-ui 2.2.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (568) hide show
  1. package/dist/Accordion/AccordionItem.cjs.map +1 -1
  2. package/dist/Accordion/AccordionItem.js.map +1 -1
  3. package/dist/Accordion/AccordionRoot.cjs.map +1 -1
  4. package/dist/Accordion/AccordionRoot.js.map +1 -1
  5. package/dist/AlertDialog/AlertDialogCancel.cjs.map +1 -1
  6. package/dist/AlertDialog/AlertDialogCancel.js.map +1 -1
  7. package/dist/AlertDialog/AlertDialogContent.cjs.map +1 -1
  8. package/dist/AlertDialog/AlertDialogContent.js.map +1 -1
  9. package/dist/AspectRatio/AspectRatio.cjs.map +1 -1
  10. package/dist/AspectRatio/AspectRatio.js.map +1 -1
  11. package/dist/Avatar/AvatarFallback.cjs +11 -14
  12. package/dist/Avatar/AvatarFallback.cjs.map +1 -1
  13. package/dist/Avatar/AvatarFallback.js +12 -15
  14. package/dist/Avatar/AvatarFallback.js.map +1 -1
  15. package/dist/Avatar/AvatarImage.cjs +3 -2
  16. package/dist/Avatar/AvatarImage.cjs.map +1 -1
  17. package/dist/Avatar/AvatarImage.js +3 -2
  18. package/dist/Avatar/AvatarImage.js.map +1 -1
  19. package/dist/Avatar/AvatarRoot.cjs +1 -1
  20. package/dist/Avatar/AvatarRoot.cjs.map +1 -1
  21. package/dist/Avatar/AvatarRoot.js +1 -1
  22. package/dist/Avatar/AvatarRoot.js.map +1 -1
  23. package/dist/Avatar/utils.cjs +43 -16
  24. package/dist/Avatar/utils.cjs.map +1 -1
  25. package/dist/Avatar/utils.js +44 -17
  26. package/dist/Avatar/utils.js.map +1 -1
  27. package/dist/Calendar/CalendarCell.cjs +2 -2
  28. package/dist/Calendar/CalendarCell.cjs.map +1 -1
  29. package/dist/Calendar/CalendarCell.js +2 -2
  30. package/dist/Calendar/CalendarCell.js.map +1 -1
  31. package/dist/Calendar/CalendarCellTrigger.cjs +5 -1
  32. package/dist/Calendar/CalendarCellTrigger.cjs.map +1 -1
  33. package/dist/Calendar/CalendarCellTrigger.js +5 -1
  34. package/dist/Calendar/CalendarCellTrigger.js.map +1 -1
  35. package/dist/Calendar/CalendarGrid.cjs.map +1 -1
  36. package/dist/Calendar/CalendarGrid.js.map +1 -1
  37. package/dist/Calendar/CalendarHeading.cjs.map +1 -1
  38. package/dist/Calendar/CalendarHeading.js.map +1 -1
  39. package/dist/Calendar/CalendarNext.cjs.map +1 -1
  40. package/dist/Calendar/CalendarNext.js.map +1 -1
  41. package/dist/Calendar/CalendarPrev.cjs.map +1 -1
  42. package/dist/Calendar/CalendarPrev.js.map +1 -1
  43. package/dist/Calendar/CalendarRoot.cjs +7 -4
  44. package/dist/Calendar/CalendarRoot.cjs.map +1 -1
  45. package/dist/Calendar/CalendarRoot.js +7 -4
  46. package/dist/Calendar/CalendarRoot.js.map +1 -1
  47. package/dist/Calendar/useCalendar.cjs +2 -2
  48. package/dist/Calendar/useCalendar.cjs.map +1 -1
  49. package/dist/Calendar/useCalendar.js +2 -2
  50. package/dist/Calendar/useCalendar.js.map +1 -1
  51. package/dist/Checkbox/CheckboxGroupRoot.cjs.map +1 -1
  52. package/dist/Checkbox/CheckboxGroupRoot.js.map +1 -1
  53. package/dist/Checkbox/CheckboxRoot.cjs.map +1 -1
  54. package/dist/Checkbox/CheckboxRoot.js.map +1 -1
  55. package/dist/Collapsible/CollapsibleContent.cjs.map +1 -1
  56. package/dist/Collapsible/CollapsibleContent.js.map +1 -1
  57. package/dist/Collapsible/CollapsibleRoot.cjs +2 -0
  58. package/dist/Collapsible/CollapsibleRoot.cjs.map +1 -1
  59. package/dist/Collapsible/CollapsibleRoot.js +2 -0
  60. package/dist/Collapsible/CollapsibleRoot.js.map +1 -1
  61. package/dist/Collection/Collection.cjs.map +1 -1
  62. package/dist/Collection/Collection.js.map +1 -1
  63. package/dist/Combobox/ComboboxContentImpl.cjs +1 -1
  64. package/dist/Combobox/ComboboxContentImpl.cjs.map +1 -1
  65. package/dist/Combobox/ComboboxContentImpl.js +1 -1
  66. package/dist/Combobox/ComboboxContentImpl.js.map +1 -1
  67. package/dist/Combobox/ComboboxGroup.cjs.map +1 -1
  68. package/dist/Combobox/ComboboxGroup.js.map +1 -1
  69. package/dist/Combobox/ComboboxInput.cjs.map +1 -1
  70. package/dist/Combobox/ComboboxInput.js.map +1 -1
  71. package/dist/Combobox/ComboboxItem.cjs.map +1 -1
  72. package/dist/Combobox/ComboboxItem.js.map +1 -1
  73. package/dist/Combobox/ComboboxRoot.cjs +1 -2
  74. package/dist/Combobox/ComboboxRoot.cjs.map +1 -1
  75. package/dist/Combobox/ComboboxRoot.js +1 -2
  76. package/dist/Combobox/ComboboxRoot.js.map +1 -1
  77. package/dist/Combobox/ComboboxTrigger.cjs.map +1 -1
  78. package/dist/Combobox/ComboboxTrigger.js.map +1 -1
  79. package/dist/Combobox/ComboboxViewport.cjs.map +1 -1
  80. package/dist/Combobox/ComboboxViewport.js.map +1 -1
  81. package/dist/Combobox/ComboboxVirtualizer.cjs.map +1 -1
  82. package/dist/Combobox/ComboboxVirtualizer.js.map +1 -1
  83. package/dist/ConfigProvider/ConfigProvider.cjs.map +1 -1
  84. package/dist/ConfigProvider/ConfigProvider.js.map +1 -1
  85. package/dist/ContextMenu/ContextMenuContent.cjs.map +1 -1
  86. package/dist/ContextMenu/ContextMenuContent.js.map +1 -1
  87. package/dist/ContextMenu/ContextMenuRoot.cjs.map +1 -1
  88. package/dist/ContextMenu/ContextMenuRoot.js.map +1 -1
  89. package/dist/ContextMenu/ContextMenuSub.cjs +1 -1
  90. package/dist/ContextMenu/ContextMenuSub.cjs.map +1 -1
  91. package/dist/ContextMenu/ContextMenuSub.js +1 -1
  92. package/dist/ContextMenu/ContextMenuSub.js.map +1 -1
  93. package/dist/ContextMenu/ContextMenuTrigger.cjs.map +1 -1
  94. package/dist/ContextMenu/ContextMenuTrigger.js.map +1 -1
  95. package/dist/DateField/DateFieldInput.cjs +1 -0
  96. package/dist/DateField/DateFieldInput.cjs.map +1 -1
  97. package/dist/DateField/DateFieldInput.js +1 -0
  98. package/dist/DateField/DateFieldInput.js.map +1 -1
  99. package/dist/DateField/DateFieldRoot.cjs +7 -1
  100. package/dist/DateField/DateFieldRoot.cjs.map +1 -1
  101. package/dist/DateField/DateFieldRoot.js +7 -1
  102. package/dist/DateField/DateFieldRoot.js.map +1 -1
  103. package/dist/DatePicker/DatePickerCellTrigger.cjs.map +1 -1
  104. package/dist/DatePicker/DatePickerCellTrigger.js.map +1 -1
  105. package/dist/DatePicker/DatePickerContent.cjs +8 -3
  106. package/dist/DatePicker/DatePickerContent.cjs.map +1 -1
  107. package/dist/DatePicker/DatePickerContent.js +9 -4
  108. package/dist/DatePicker/DatePickerContent.js.map +1 -1
  109. package/dist/DatePicker/DatePickerHeading.cjs.map +1 -1
  110. package/dist/DatePicker/DatePickerHeading.js.map +1 -1
  111. package/dist/DatePicker/DatePickerNext.cjs.map +1 -1
  112. package/dist/DatePicker/DatePickerNext.js.map +1 -1
  113. package/dist/DatePicker/DatePickerPrev.cjs.map +1 -1
  114. package/dist/DatePicker/DatePickerPrev.js.map +1 -1
  115. package/dist/DatePicker/DatePickerRoot.cjs +1 -0
  116. package/dist/DatePicker/DatePickerRoot.cjs.map +1 -1
  117. package/dist/DatePicker/DatePickerRoot.js +1 -0
  118. package/dist/DatePicker/DatePickerRoot.js.map +1 -1
  119. package/dist/DateRangeField/DateRangeFieldInput.cjs +1 -0
  120. package/dist/DateRangeField/DateRangeFieldInput.cjs.map +1 -1
  121. package/dist/DateRangeField/DateRangeFieldInput.js +1 -0
  122. package/dist/DateRangeField/DateRangeFieldInput.js.map +1 -1
  123. package/dist/DateRangeField/DateRangeFieldRoot.cjs +13 -9
  124. package/dist/DateRangeField/DateRangeFieldRoot.cjs.map +1 -1
  125. package/dist/DateRangeField/DateRangeFieldRoot.js +13 -9
  126. package/dist/DateRangeField/DateRangeFieldRoot.js.map +1 -1
  127. package/dist/DateRangePicker/DateRangePickerCalendar.cjs +2 -1
  128. package/dist/DateRangePicker/DateRangePickerCalendar.cjs.map +1 -1
  129. package/dist/DateRangePicker/DateRangePickerCalendar.js +2 -1
  130. package/dist/DateRangePicker/DateRangePickerCalendar.js.map +1 -1
  131. package/dist/DateRangePicker/DateRangePickerContent.cjs +8 -3
  132. package/dist/DateRangePicker/DateRangePickerContent.cjs.map +1 -1
  133. package/dist/DateRangePicker/DateRangePickerContent.js +9 -4
  134. package/dist/DateRangePicker/DateRangePickerContent.js.map +1 -1
  135. package/dist/DateRangePicker/DateRangePickerHeading.cjs.map +1 -1
  136. package/dist/DateRangePicker/DateRangePickerHeading.js.map +1 -1
  137. package/dist/DateRangePicker/DateRangePickerNext.cjs.map +1 -1
  138. package/dist/DateRangePicker/DateRangePickerNext.js.map +1 -1
  139. package/dist/DateRangePicker/DateRangePickerPrev.cjs.map +1 -1
  140. package/dist/DateRangePicker/DateRangePickerPrev.js.map +1 -1
  141. package/dist/DateRangePicker/DateRangePickerRoot.cjs +6 -2
  142. package/dist/DateRangePicker/DateRangePickerRoot.cjs.map +1 -1
  143. package/dist/DateRangePicker/DateRangePickerRoot.js +6 -2
  144. package/dist/DateRangePicker/DateRangePickerRoot.js.map +1 -1
  145. package/dist/Dialog/DialogContentImpl.cjs +1 -1
  146. package/dist/Dialog/DialogContentImpl.cjs.map +1 -1
  147. package/dist/Dialog/DialogContentImpl.js +1 -1
  148. package/dist/Dialog/DialogContentImpl.js.map +1 -1
  149. package/dist/Dialog/DialogContentNonModal.cjs.map +1 -1
  150. package/dist/Dialog/DialogContentNonModal.js.map +1 -1
  151. package/dist/Dialog/DialogRoot.cjs +4 -1
  152. package/dist/Dialog/DialogRoot.cjs.map +1 -1
  153. package/dist/Dialog/DialogRoot.js +4 -1
  154. package/dist/Dialog/DialogRoot.js.map +1 -1
  155. package/dist/Dialog/DialogTrigger.cjs.map +1 -1
  156. package/dist/Dialog/DialogTrigger.js.map +1 -1
  157. package/dist/DismissableLayer/DismissableLayer.cjs.map +1 -1
  158. package/dist/DismissableLayer/DismissableLayer.js.map +1 -1
  159. package/dist/DismissableLayer/DismissableLayerBranch.cjs.map +1 -1
  160. package/dist/DismissableLayer/DismissableLayerBranch.js.map +1 -1
  161. package/dist/DismissableLayer/utils.cjs +19 -7
  162. package/dist/DismissableLayer/utils.cjs.map +1 -1
  163. package/dist/DismissableLayer/utils.js +20 -8
  164. package/dist/DismissableLayer/utils.js.map +1 -1
  165. package/dist/DropdownMenu/DropdownMenuContent.cjs.map +1 -1
  166. package/dist/DropdownMenu/DropdownMenuContent.js.map +1 -1
  167. package/dist/DropdownMenu/DropdownMenuRoot.cjs +1 -1
  168. package/dist/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
  169. package/dist/DropdownMenu/DropdownMenuRoot.js +1 -1
  170. package/dist/DropdownMenu/DropdownMenuRoot.js.map +1 -1
  171. package/dist/DropdownMenu/DropdownMenuSub.cjs +1 -1
  172. package/dist/DropdownMenu/DropdownMenuSub.cjs.map +1 -1
  173. package/dist/DropdownMenu/DropdownMenuSub.js +1 -1
  174. package/dist/DropdownMenu/DropdownMenuSub.js.map +1 -1
  175. package/dist/DropdownMenu/DropdownMenuTrigger.cjs.map +1 -1
  176. package/dist/DropdownMenu/DropdownMenuTrigger.js.map +1 -1
  177. package/dist/Editable/EditableInput.cjs.map +1 -1
  178. package/dist/Editable/EditableInput.js.map +1 -1
  179. package/dist/Editable/EditableRoot.cjs +3 -3
  180. package/dist/Editable/EditableRoot.cjs.map +1 -1
  181. package/dist/Editable/EditableRoot.js +3 -3
  182. package/dist/Editable/EditableRoot.js.map +1 -1
  183. package/dist/FocusScope/FocusScope.cjs.map +1 -1
  184. package/dist/FocusScope/FocusScope.js.map +1 -1
  185. package/dist/HoverCard/HoverCardContentImpl.cjs +1 -1
  186. package/dist/HoverCard/HoverCardContentImpl.cjs.map +1 -1
  187. package/dist/HoverCard/HoverCardContentImpl.js +1 -1
  188. package/dist/HoverCard/HoverCardContentImpl.js.map +1 -1
  189. package/dist/HoverCard/HoverCardRoot.cjs +1 -1
  190. package/dist/HoverCard/HoverCardRoot.cjs.map +1 -1
  191. package/dist/HoverCard/HoverCardRoot.js +1 -1
  192. package/dist/HoverCard/HoverCardRoot.js.map +1 -1
  193. package/dist/Listbox/ListboxFilter.cjs.map +1 -1
  194. package/dist/Listbox/ListboxFilter.js.map +1 -1
  195. package/dist/Listbox/ListboxItem.cjs.map +1 -1
  196. package/dist/Listbox/ListboxItem.js.map +1 -1
  197. package/dist/Listbox/ListboxRoot.cjs +1 -1
  198. package/dist/Listbox/ListboxRoot.cjs.map +1 -1
  199. package/dist/Listbox/ListboxRoot.js +1 -1
  200. package/dist/Listbox/ListboxRoot.js.map +1 -1
  201. package/dist/Listbox/ListboxVirtualizer.cjs +3 -3
  202. package/dist/Listbox/ListboxVirtualizer.cjs.map +1 -1
  203. package/dist/Listbox/ListboxVirtualizer.js +3 -3
  204. package/dist/Listbox/ListboxVirtualizer.js.map +1 -1
  205. package/dist/Menu/MenuCheckboxItem.cjs.map +1 -1
  206. package/dist/Menu/MenuCheckboxItem.js.map +1 -1
  207. package/dist/Menu/MenuContentImpl.cjs +1 -1
  208. package/dist/Menu/MenuContentImpl.cjs.map +1 -1
  209. package/dist/Menu/MenuContentImpl.js +1 -1
  210. package/dist/Menu/MenuContentImpl.js.map +1 -1
  211. package/dist/Menu/MenuItemImpl.cjs.map +1 -1
  212. package/dist/Menu/MenuItemImpl.js.map +1 -1
  213. package/dist/Menu/MenuItemIndicator.cjs.map +1 -1
  214. package/dist/Menu/MenuItemIndicator.js.map +1 -1
  215. package/dist/Menu/MenuRadioGroup.cjs.map +1 -1
  216. package/dist/Menu/MenuRadioGroup.js.map +1 -1
  217. package/dist/Menu/MenuRoot.cjs +1 -1
  218. package/dist/Menu/MenuRoot.cjs.map +1 -1
  219. package/dist/Menu/MenuRoot.js +1 -1
  220. package/dist/Menu/MenuRoot.js.map +1 -1
  221. package/dist/Menu/MenuSub.cjs +1 -1
  222. package/dist/Menu/MenuSub.cjs.map +1 -1
  223. package/dist/Menu/MenuSub.js +1 -1
  224. package/dist/Menu/MenuSub.js.map +1 -1
  225. package/dist/Menu/MenuSubTrigger.cjs.map +1 -1
  226. package/dist/Menu/MenuSubTrigger.js.map +1 -1
  227. package/dist/Menubar/MenubarContent.cjs.map +1 -1
  228. package/dist/Menubar/MenubarContent.js.map +1 -1
  229. package/dist/Menubar/MenubarMenu.cjs.map +1 -1
  230. package/dist/Menubar/MenubarMenu.js.map +1 -1
  231. package/dist/Menubar/MenubarRoot.cjs.map +1 -1
  232. package/dist/Menubar/MenubarRoot.js.map +1 -1
  233. package/dist/Menubar/MenubarSub.cjs +1 -1
  234. package/dist/Menubar/MenubarSub.cjs.map +1 -1
  235. package/dist/Menubar/MenubarSub.js +1 -1
  236. package/dist/Menubar/MenubarSub.js.map +1 -1
  237. package/dist/Menubar/MenubarTrigger.cjs.map +1 -1
  238. package/dist/Menubar/MenubarTrigger.js.map +1 -1
  239. package/dist/NavigationMenu/NavigationMenuContent.cjs.map +1 -1
  240. package/dist/NavigationMenu/NavigationMenuContent.js.map +1 -1
  241. package/dist/NavigationMenu/NavigationMenuContentImpl.cjs +1 -1
  242. package/dist/NavigationMenu/NavigationMenuContentImpl.cjs.map +1 -1
  243. package/dist/NavigationMenu/NavigationMenuContentImpl.js +1 -1
  244. package/dist/NavigationMenu/NavigationMenuContentImpl.js.map +1 -1
  245. package/dist/NavigationMenu/NavigationMenuIndicator.cjs.map +1 -1
  246. package/dist/NavigationMenu/NavigationMenuIndicator.js.map +1 -1
  247. package/dist/NavigationMenu/NavigationMenuItem.cjs.map +1 -1
  248. package/dist/NavigationMenu/NavigationMenuItem.js.map +1 -1
  249. package/dist/NavigationMenu/NavigationMenuList.cjs.map +1 -1
  250. package/dist/NavigationMenu/NavigationMenuList.js.map +1 -1
  251. package/dist/NavigationMenu/NavigationMenuRoot.cjs.map +1 -1
  252. package/dist/NavigationMenu/NavigationMenuRoot.js.map +1 -1
  253. package/dist/NavigationMenu/NavigationMenuSub.cjs.map +1 -1
  254. package/dist/NavigationMenu/NavigationMenuSub.js.map +1 -1
  255. package/dist/NavigationMenu/NavigationMenuTrigger.cjs.map +1 -1
  256. package/dist/NavigationMenu/NavigationMenuTrigger.js.map +1 -1
  257. package/dist/NavigationMenu/NavigationMenuViewport.cjs.map +1 -1
  258. package/dist/NavigationMenu/NavigationMenuViewport.js.map +1 -1
  259. package/dist/NumberField/NumberFieldInput.cjs +2 -2
  260. package/dist/NumberField/NumberFieldInput.cjs.map +1 -1
  261. package/dist/NumberField/NumberFieldInput.js +2 -2
  262. package/dist/NumberField/NumberFieldInput.js.map +1 -1
  263. package/dist/NumberField/NumberFieldRoot.cjs +8 -5
  264. package/dist/NumberField/NumberFieldRoot.cjs.map +1 -1
  265. package/dist/NumberField/NumberFieldRoot.js +8 -5
  266. package/dist/NumberField/NumberFieldRoot.js.map +1 -1
  267. package/dist/Pagination/PaginationFirst.cjs.map +1 -1
  268. package/dist/Pagination/PaginationFirst.js.map +1 -1
  269. package/dist/Pagination/PaginationLast.cjs.map +1 -1
  270. package/dist/Pagination/PaginationLast.js.map +1 -1
  271. package/dist/Pagination/PaginationList.cjs.map +1 -1
  272. package/dist/Pagination/PaginationList.js.map +1 -1
  273. package/dist/Pagination/PaginationListItem.cjs.map +1 -1
  274. package/dist/Pagination/PaginationListItem.js.map +1 -1
  275. package/dist/Pagination/PaginationNext.cjs.map +1 -1
  276. package/dist/Pagination/PaginationNext.js.map +1 -1
  277. package/dist/Pagination/PaginationPrev.cjs.map +1 -1
  278. package/dist/Pagination/PaginationPrev.js.map +1 -1
  279. package/dist/Pagination/PaginationRoot.cjs.map +1 -1
  280. package/dist/Pagination/PaginationRoot.js.map +1 -1
  281. package/dist/PinInput/PinInputInput.cjs +14 -6
  282. package/dist/PinInput/PinInputInput.cjs.map +1 -1
  283. package/dist/PinInput/PinInputInput.js +14 -6
  284. package/dist/PinInput/PinInputInput.js.map +1 -1
  285. package/dist/PinInput/PinInputRoot.cjs +4 -2
  286. package/dist/PinInput/PinInputRoot.cjs.map +1 -1
  287. package/dist/PinInput/PinInputRoot.js +4 -2
  288. package/dist/PinInput/PinInputRoot.js.map +1 -1
  289. package/dist/Popover/PopoverAnchor.cjs.map +1 -1
  290. package/dist/Popover/PopoverAnchor.js.map +1 -1
  291. package/dist/Popover/PopoverContentImpl.cjs +1 -1
  292. package/dist/Popover/PopoverContentImpl.js +1 -1
  293. package/dist/Popover/PopoverContentModal.cjs.map +1 -1
  294. package/dist/Popover/PopoverContentModal.js.map +1 -1
  295. package/dist/Popover/PopoverContentNonModal.cjs.map +1 -1
  296. package/dist/Popover/PopoverContentNonModal.js.map +1 -1
  297. package/dist/Popover/PopoverRoot.cjs +1 -1
  298. package/dist/Popover/PopoverRoot.cjs.map +1 -1
  299. package/dist/Popover/PopoverRoot.js +1 -1
  300. package/dist/Popover/PopoverRoot.js.map +1 -1
  301. package/dist/Popover/PopoverTrigger.cjs.map +1 -1
  302. package/dist/Popover/PopoverTrigger.js.map +1 -1
  303. package/dist/Popper/PopperAnchor.cjs.map +1 -1
  304. package/dist/Popper/PopperAnchor.js.map +1 -1
  305. package/dist/Popper/PopperArrow.cjs.map +1 -1
  306. package/dist/Popper/PopperArrow.js.map +1 -1
  307. package/dist/Popper/PopperContent.cjs.map +1 -1
  308. package/dist/Popper/PopperContent.js.map +1 -1
  309. package/dist/Presence/Presence.cjs.map +1 -1
  310. package/dist/Presence/Presence.js.map +1 -1
  311. package/dist/Presence/usePresence.cjs.map +1 -1
  312. package/dist/Presence/usePresence.js.map +1 -1
  313. package/dist/Primitive/Slot.cjs +1 -9
  314. package/dist/Primitive/Slot.cjs.map +1 -1
  315. package/dist/Primitive/Slot.js +1 -9
  316. package/dist/Primitive/Slot.js.map +1 -1
  317. package/dist/Progress/ProgressRoot.cjs +3 -2
  318. package/dist/Progress/ProgressRoot.cjs.map +1 -1
  319. package/dist/Progress/ProgressRoot.js +3 -2
  320. package/dist/Progress/ProgressRoot.js.map +1 -1
  321. package/dist/RadioGroup/Radio.cjs +2 -0
  322. package/dist/RadioGroup/Radio.cjs.map +1 -1
  323. package/dist/RadioGroup/Radio.js +2 -0
  324. package/dist/RadioGroup/Radio.js.map +1 -1
  325. package/dist/RadioGroup/RadioGroupItem.cjs.map +1 -1
  326. package/dist/RadioGroup/RadioGroupItem.js.map +1 -1
  327. package/dist/RadioGroup/RadioGroupRoot.cjs.map +1 -1
  328. package/dist/RadioGroup/RadioGroupRoot.js.map +1 -1
  329. package/dist/RangeCalendar/RangeCalendarCell.cjs +2 -2
  330. package/dist/RangeCalendar/RangeCalendarCell.cjs.map +1 -1
  331. package/dist/RangeCalendar/RangeCalendarCell.js +2 -2
  332. package/dist/RangeCalendar/RangeCalendarCell.js.map +1 -1
  333. package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs +28 -9
  334. package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs.map +1 -1
  335. package/dist/RangeCalendar/RangeCalendarCellTrigger.js +28 -9
  336. package/dist/RangeCalendar/RangeCalendarCellTrigger.js.map +1 -1
  337. package/dist/RangeCalendar/RangeCalendarGrid.cjs.map +1 -1
  338. package/dist/RangeCalendar/RangeCalendarGrid.js.map +1 -1
  339. package/dist/RangeCalendar/RangeCalendarHeading.cjs.map +1 -1
  340. package/dist/RangeCalendar/RangeCalendarHeading.js.map +1 -1
  341. package/dist/RangeCalendar/RangeCalendarNext.cjs.map +1 -1
  342. package/dist/RangeCalendar/RangeCalendarNext.js.map +1 -1
  343. package/dist/RangeCalendar/RangeCalendarPrev.cjs.map +1 -1
  344. package/dist/RangeCalendar/RangeCalendarPrev.js.map +1 -1
  345. package/dist/RangeCalendar/RangeCalendarRoot.cjs +26 -9
  346. package/dist/RangeCalendar/RangeCalendarRoot.cjs.map +1 -1
  347. package/dist/RangeCalendar/RangeCalendarRoot.js +26 -9
  348. package/dist/RangeCalendar/RangeCalendarRoot.js.map +1 -1
  349. package/dist/RangeCalendar/useRangeCalendar.cjs +21 -4
  350. package/dist/RangeCalendar/useRangeCalendar.cjs.map +1 -1
  351. package/dist/RangeCalendar/useRangeCalendar.js +21 -4
  352. package/dist/RangeCalendar/useRangeCalendar.js.map +1 -1
  353. package/dist/RovingFocus/RovingFocusGroup.cjs +1 -1
  354. package/dist/RovingFocus/RovingFocusGroup.cjs.map +1 -1
  355. package/dist/RovingFocus/RovingFocusGroup.js +1 -1
  356. package/dist/RovingFocus/RovingFocusGroup.js.map +1 -1
  357. package/dist/RovingFocus/RovingFocusItem.cjs.map +1 -1
  358. package/dist/RovingFocus/RovingFocusItem.js.map +1 -1
  359. package/dist/ScrollArea/ScrollAreaCornerImpl.cjs.map +1 -1
  360. package/dist/ScrollArea/ScrollAreaCornerImpl.js.map +1 -1
  361. package/dist/ScrollArea/ScrollAreaRoot.cjs.map +1 -1
  362. package/dist/ScrollArea/ScrollAreaRoot.js.map +1 -1
  363. package/dist/ScrollArea/ScrollAreaScrollbar.cjs.map +1 -1
  364. package/dist/ScrollArea/ScrollAreaScrollbar.js.map +1 -1
  365. package/dist/ScrollArea/ScrollAreaScrollbarAuto.cjs.map +1 -1
  366. package/dist/ScrollArea/ScrollAreaScrollbarAuto.js.map +1 -1
  367. package/dist/ScrollArea/ScrollAreaScrollbarHover.cjs.map +1 -1
  368. package/dist/ScrollArea/ScrollAreaScrollbarHover.js.map +1 -1
  369. package/dist/ScrollArea/ScrollAreaScrollbarImpl.cjs.map +1 -1
  370. package/dist/ScrollArea/ScrollAreaScrollbarImpl.js.map +1 -1
  371. package/dist/ScrollArea/ScrollAreaScrollbarScroll.cjs.map +1 -1
  372. package/dist/ScrollArea/ScrollAreaScrollbarScroll.js.map +1 -1
  373. package/dist/ScrollArea/ScrollAreaScrollbarX.cjs.map +1 -1
  374. package/dist/ScrollArea/ScrollAreaScrollbarX.js.map +1 -1
  375. package/dist/ScrollArea/ScrollAreaScrollbarY.cjs.map +1 -1
  376. package/dist/ScrollArea/ScrollAreaScrollbarY.js.map +1 -1
  377. package/dist/ScrollArea/ScrollAreaThumb.cjs.map +1 -1
  378. package/dist/ScrollArea/ScrollAreaThumb.js.map +1 -1
  379. package/dist/ScrollArea/ScrollAreaViewport.cjs.map +1 -1
  380. package/dist/ScrollArea/ScrollAreaViewport.js.map +1 -1
  381. package/dist/Select/BubbleSelect.cjs.map +1 -1
  382. package/dist/Select/BubbleSelect.js.map +1 -1
  383. package/dist/Select/SelectContent.cjs.map +1 -1
  384. package/dist/Select/SelectContent.js.map +1 -1
  385. package/dist/Select/SelectContentImpl.cjs +2 -2
  386. package/dist/Select/SelectContentImpl.cjs.map +1 -1
  387. package/dist/Select/SelectContentImpl.js +2 -2
  388. package/dist/Select/SelectContentImpl.js.map +1 -1
  389. package/dist/Select/SelectItem.cjs.map +1 -1
  390. package/dist/Select/SelectItem.js.map +1 -1
  391. package/dist/Select/SelectItemAlignedPosition.cjs +1 -1
  392. package/dist/Select/SelectItemAlignedPosition.cjs.map +1 -1
  393. package/dist/Select/SelectItemAlignedPosition.js +1 -1
  394. package/dist/Select/SelectItemAlignedPosition.js.map +1 -1
  395. package/dist/Select/SelectItemText.cjs.map +1 -1
  396. package/dist/Select/SelectItemText.js.map +1 -1
  397. package/dist/Select/SelectProvider.cjs.map +1 -1
  398. package/dist/Select/SelectProvider.js.map +1 -1
  399. package/dist/Select/SelectRoot.cjs +3 -1
  400. package/dist/Select/SelectRoot.cjs.map +1 -1
  401. package/dist/Select/SelectRoot.js +3 -1
  402. package/dist/Select/SelectRoot.js.map +1 -1
  403. package/dist/Select/SelectScrollButtonImpl.cjs.map +1 -1
  404. package/dist/Select/SelectScrollButtonImpl.js.map +1 -1
  405. package/dist/Select/SelectTrigger.cjs.map +1 -1
  406. package/dist/Select/SelectTrigger.js.map +1 -1
  407. package/dist/Select/SelectValue.cjs.map +1 -1
  408. package/dist/Select/SelectValue.js.map +1 -1
  409. package/dist/Select/SelectViewport.cjs.map +1 -1
  410. package/dist/Select/SelectViewport.js.map +1 -1
  411. package/dist/Slider/SliderHorizontal.cjs +7 -4
  412. package/dist/Slider/SliderHorizontal.cjs.map +1 -1
  413. package/dist/Slider/SliderHorizontal.js +7 -4
  414. package/dist/Slider/SliderHorizontal.js.map +1 -1
  415. package/dist/Slider/SliderRange.cjs +2 -2
  416. package/dist/Slider/SliderRange.cjs.map +1 -1
  417. package/dist/Slider/SliderRange.js +2 -2
  418. package/dist/Slider/SliderRange.js.map +1 -1
  419. package/dist/Slider/SliderRoot.cjs.map +1 -1
  420. package/dist/Slider/SliderRoot.js.map +1 -1
  421. package/dist/Slider/SliderThumb.cjs.map +1 -1
  422. package/dist/Slider/SliderThumb.js.map +1 -1
  423. package/dist/Slider/SliderThumbImpl.cjs +3 -3
  424. package/dist/Slider/SliderThumbImpl.cjs.map +1 -1
  425. package/dist/Slider/SliderThumbImpl.js +3 -3
  426. package/dist/Slider/SliderThumbImpl.js.map +1 -1
  427. package/dist/Slider/SliderVertical.cjs +7 -4
  428. package/dist/Slider/SliderVertical.cjs.map +1 -1
  429. package/dist/Slider/SliderVertical.js +7 -4
  430. package/dist/Slider/SliderVertical.js.map +1 -1
  431. package/dist/Slider/utils.cjs +1 -1
  432. package/dist/Slider/utils.cjs.map +1 -1
  433. package/dist/Slider/utils.js +1 -1
  434. package/dist/Slider/utils.js.map +1 -1
  435. package/dist/Splitter/SplitterGroup.cjs.map +1 -1
  436. package/dist/Splitter/SplitterGroup.js.map +1 -1
  437. package/dist/Splitter/SplitterPanel.cjs +16 -10
  438. package/dist/Splitter/SplitterPanel.cjs.map +1 -1
  439. package/dist/Splitter/SplitterPanel.js +16 -10
  440. package/dist/Splitter/SplitterPanel.js.map +1 -1
  441. package/dist/Stepper/StepperIndicator.cjs.map +1 -1
  442. package/dist/Stepper/StepperIndicator.js.map +1 -1
  443. package/dist/Stepper/StepperItem.cjs.map +1 -1
  444. package/dist/Stepper/StepperItem.js.map +1 -1
  445. package/dist/Stepper/StepperRoot.cjs +31 -4
  446. package/dist/Stepper/StepperRoot.cjs.map +1 -1
  447. package/dist/Stepper/StepperRoot.js +31 -4
  448. package/dist/Stepper/StepperRoot.js.map +1 -1
  449. package/dist/Stepper/StepperTrigger.cjs.map +1 -1
  450. package/dist/Stepper/StepperTrigger.js.map +1 -1
  451. package/dist/Switch/SwitchRoot.cjs.map +1 -1
  452. package/dist/Switch/SwitchRoot.js.map +1 -1
  453. package/dist/Tabs/TabsContent.cjs.map +1 -1
  454. package/dist/Tabs/TabsContent.js.map +1 -1
  455. package/dist/Tabs/TabsIndicator.cjs.map +1 -1
  456. package/dist/Tabs/TabsIndicator.js.map +1 -1
  457. package/dist/Tabs/TabsList.cjs.map +1 -1
  458. package/dist/Tabs/TabsList.js.map +1 -1
  459. package/dist/Tabs/TabsRoot.cjs.map +1 -1
  460. package/dist/Tabs/TabsRoot.js.map +1 -1
  461. package/dist/Tabs/TabsTrigger.cjs.map +1 -1
  462. package/dist/Tabs/TabsTrigger.js.map +1 -1
  463. package/dist/TagsInput/TagsInputInput.cjs +1 -0
  464. package/dist/TagsInput/TagsInputInput.cjs.map +1 -1
  465. package/dist/TagsInput/TagsInputInput.js +1 -0
  466. package/dist/TagsInput/TagsInputInput.js.map +1 -1
  467. package/dist/TagsInput/TagsInputItem.cjs.map +1 -1
  468. package/dist/TagsInput/TagsInputItem.js.map +1 -1
  469. package/dist/TagsInput/TagsInputItemDelete.cjs.map +1 -1
  470. package/dist/TagsInput/TagsInputItemDelete.js.map +1 -1
  471. package/dist/TagsInput/TagsInputRoot.cjs +1 -1
  472. package/dist/TagsInput/TagsInputRoot.cjs.map +1 -1
  473. package/dist/TagsInput/TagsInputRoot.js +1 -1
  474. package/dist/TagsInput/TagsInputRoot.js.map +1 -1
  475. package/dist/TimeField/TimeFieldInput.cjs +1 -0
  476. package/dist/TimeField/TimeFieldInput.cjs.map +1 -1
  477. package/dist/TimeField/TimeFieldInput.js +1 -0
  478. package/dist/TimeField/TimeFieldInput.js.map +1 -1
  479. package/dist/TimeField/TimeFieldRoot.cjs +13 -4
  480. package/dist/TimeField/TimeFieldRoot.cjs.map +1 -1
  481. package/dist/TimeField/TimeFieldRoot.js +13 -4
  482. package/dist/TimeField/TimeFieldRoot.js.map +1 -1
  483. package/dist/Toast/ToastAnnounce.cjs.map +1 -1
  484. package/dist/Toast/ToastAnnounce.js.map +1 -1
  485. package/dist/Toast/ToastRoot.cjs.map +1 -1
  486. package/dist/Toast/ToastRoot.js.map +1 -1
  487. package/dist/Toast/ToastRootImpl.cjs +1 -1
  488. package/dist/Toast/ToastRootImpl.cjs.map +1 -1
  489. package/dist/Toast/ToastRootImpl.js +1 -1
  490. package/dist/Toast/ToastRootImpl.js.map +1 -1
  491. package/dist/Toast/ToastViewport.cjs +2 -2
  492. package/dist/Toast/ToastViewport.cjs.map +1 -1
  493. package/dist/Toast/ToastViewport.js +2 -2
  494. package/dist/Toast/ToastViewport.js.map +1 -1
  495. package/dist/Toggle/Toggle.cjs.map +1 -1
  496. package/dist/Toggle/Toggle.js.map +1 -1
  497. package/dist/ToggleGroup/ToggleGroupItem.cjs.map +1 -1
  498. package/dist/ToggleGroup/ToggleGroupItem.js.map +1 -1
  499. package/dist/ToggleGroup/ToggleGroupRoot.cjs.map +1 -1
  500. package/dist/ToggleGroup/ToggleGroupRoot.js.map +1 -1
  501. package/dist/Toolbar/ToolbarRoot.cjs.map +1 -1
  502. package/dist/Toolbar/ToolbarRoot.js.map +1 -1
  503. package/dist/Tooltip/TooltipContentImpl.cjs +2 -2
  504. package/dist/Tooltip/TooltipContentImpl.cjs.map +1 -1
  505. package/dist/Tooltip/TooltipContentImpl.js +2 -2
  506. package/dist/Tooltip/TooltipContentImpl.js.map +1 -1
  507. package/dist/Tooltip/TooltipRoot.cjs +1 -1
  508. package/dist/Tooltip/TooltipRoot.cjs.map +1 -1
  509. package/dist/Tooltip/TooltipRoot.js +1 -1
  510. package/dist/Tooltip/TooltipRoot.js.map +1 -1
  511. package/dist/Tooltip/TooltipTrigger.cjs +1 -1
  512. package/dist/Tooltip/TooltipTrigger.cjs.map +1 -1
  513. package/dist/Tooltip/TooltipTrigger.js +1 -1
  514. package/dist/Tooltip/TooltipTrigger.js.map +1 -1
  515. package/dist/Tree/TreeItem.cjs +4 -1
  516. package/dist/Tree/TreeItem.cjs.map +1 -1
  517. package/dist/Tree/TreeItem.js +4 -1
  518. package/dist/Tree/TreeItem.js.map +1 -1
  519. package/dist/Tree/TreeRoot.cjs +29 -3
  520. package/dist/Tree/TreeRoot.cjs.map +1 -1
  521. package/dist/Tree/TreeRoot.js +29 -3
  522. package/dist/Tree/TreeRoot.js.map +1 -1
  523. package/dist/Tree/TreeVirtualizer.cjs +2 -2
  524. package/dist/Tree/TreeVirtualizer.cjs.map +1 -1
  525. package/dist/Tree/TreeVirtualizer.js +2 -2
  526. package/dist/Tree/TreeVirtualizer.js.map +1 -1
  527. package/dist/Viewport/Viewport.cjs.map +1 -1
  528. package/dist/Viewport/Viewport.js.map +1 -1
  529. package/dist/VisuallyHidden/VisuallyHiddenInputBubble.cjs.map +1 -1
  530. package/dist/VisuallyHidden/VisuallyHiddenInputBubble.js.map +1 -1
  531. package/dist/component/BaseSeparator.cjs.map +1 -1
  532. package/dist/component/BaseSeparator.js.map +1 -1
  533. package/dist/date/calendar.cjs.map +1 -1
  534. package/dist/date/calendar.js.map +1 -1
  535. package/dist/date/parser.cjs +22 -7
  536. package/dist/date/parser.cjs.map +1 -1
  537. package/dist/date/parser.js +23 -8
  538. package/dist/date/parser.js.map +1 -1
  539. package/dist/date/useDateField.cjs +21 -6
  540. package/dist/date/useDateField.cjs.map +1 -1
  541. package/dist/date/useDateField.js +21 -6
  542. package/dist/date/useDateField.js.map +1 -1
  543. package/dist/date/utils.cjs +31 -2
  544. package/dist/date/utils.cjs.map +1 -1
  545. package/dist/date/utils.js +30 -3
  546. package/dist/date/utils.js.map +1 -1
  547. package/dist/index.d.ts +495 -353
  548. package/dist/shared/useBodyScrollLock.cjs +2 -2
  549. package/dist/shared/useBodyScrollLock.cjs.map +1 -1
  550. package/dist/shared/useBodyScrollLock.js +2 -2
  551. package/dist/shared/useBodyScrollLock.js.map +1 -1
  552. package/dist/shared/useDateFormatter.cjs +12 -10
  553. package/dist/shared/useDateFormatter.cjs.map +1 -1
  554. package/dist/shared/useDateFormatter.js +12 -10
  555. package/dist/shared/useDateFormatter.js.map +1 -1
  556. package/dist/shared/useDirection.cjs.map +1 -1
  557. package/dist/shared/useDirection.js.map +1 -1
  558. package/dist/shared/useGraceArea.cjs.map +1 -1
  559. package/dist/shared/useGraceArea.js.map +1 -1
  560. package/dist/shared/useId.cjs +2 -2
  561. package/dist/shared/useId.cjs.map +1 -1
  562. package/dist/shared/useId.js +2 -2
  563. package/dist/shared/useId.js.map +1 -1
  564. package/dist/shared/useLocale.cjs.map +1 -1
  565. package/dist/shared/useLocale.js.map +1 -1
  566. package/dist/shared/useNonce.cjs.map +1 -1
  567. package/dist/shared/useNonce.js.map +1 -1
  568. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"StepperRoot.js","sources":["../../src/Stepper/StepperRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { Ref } from 'vue'\nimport type { DataOrientation, Direction } from '../shared/types'\nimport { Primitive } from '@/Primitive'\nimport { createContext, useDirection, useForwardExpose } from '@/shared'\nimport { useVModel } from '@vueuse/core'\nimport { computed, nextTick, ref, toRefs, watch } from 'vue'\n\nexport interface StepperRootContext {\n modelValue: Ref<number | undefined>\n changeModelValue: (value: number) => void\n orientation: Ref<DataOrientation>\n dir: Ref<Direction>\n linear: Ref<boolean>\n totalStepperItems: Ref<Set<HTMLElement>>\n}\n\nexport interface StepperRootProps extends PrimitiveProps {\n /**\n * The value of the step that should be active when initially rendered. Use when you do not need to control the state of the steps.\n */\n defaultValue?: number\n /**\n * The orientation the steps are laid out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down).\n * @defaultValue horizontal\n */\n orientation?: DataOrientation\n /**\n * The reading direction of the combobox when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode.\n */\n dir?: Direction\n /** The controlled value of the step to activate. Can be bound as `v-model`. */\n modelValue?: number\n /** Whether or not the steps must be completed in order. */\n linear?: boolean\n}\nexport type StepperRootEmits = {\n /** Event handler called when the value changes */\n 'update:modelValue': [payload: number | undefined]\n}\n\nexport const [injectStepperRootContext, provideStepperRootContext]\n = createContext<StepperRootContext>('StepperRoot')\n</script>\n\n<script setup lang=\"ts\">\nconst props = withDefaults(defineProps<StepperRootProps>(), {\n orientation: 'horizontal',\n linear: true,\n defaultValue: 1,\n})\nconst emits = defineEmits<StepperRootEmits>()\n\ndefineSlots<{\n default: (props: {\n /** Current step */\n modelValue: number | undefined\n /** Total number of steps */\n totalSteps: number\n /** Whether or not the next step is disabled */\n isNextDisabled: boolean\n /** Whether or not the previous step is disabled */\n isPrevDisabled: boolean\n /** Whether or not the first step is active */\n isFirstStep: boolean\n /** Whether or not the last step is active */\n isLastStep: boolean\n /** Go to a specific step */\n goToStep: (step: number) => void\n /** Go to the next step */\n nextStep: () => void\n /** Go to the previous step */\n prevStep: () => void\n }) => any\n}>()\n\nconst { dir: propDir, orientation: propOrientation, linear } = toRefs(props)\nconst dir = useDirection(propDir)\nuseForwardExpose()\n\nconst totalStepperItems = ref<Set<HTMLElement>>(new Set())\n\nconst modelValue = useVModel(props, 'modelValue', emits, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n})\n\nconst totalStepperItemsArray = computed(() => Array.from(totalStepperItems.value))\n\nconst isFirstStep = computed(() => modelValue.value === 1)\nconst isLastStep = computed(() => modelValue.value === totalStepperItemsArray.value.length)\n\nconst totalSteps = computed(() => totalStepperItems.value.size)\n\nfunction goToStep(step: number) {\n if (step > totalSteps.value)\n return\n\n if (step < 1)\n return\n\n if (totalStepperItems.value.size && !!totalStepperItemsArray.value[step] && !!totalStepperItemsArray.value[step].getAttribute('disabled'))\n return\n\n if (linear.value) {\n if (step > (modelValue.value ?? 1) + 1)\n return\n }\n\n modelValue.value = step\n}\nconst nextStepperItem = ref<HTMLElement | null>(null)\nconst prevStepperItem = ref<HTMLElement | null>(null)\nconst isNextDisabled = computed(() => nextStepperItem.value ? nextStepperItem.value.getAttribute('disabled') === '' : true)\nconst isPrevDisabled = computed(() => prevStepperItem.value ? prevStepperItem.value.getAttribute('disabled') === '' : true)\n\nwatch(modelValue, async () => {\n await nextTick(() => {\n nextStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! < totalStepperItemsArray.value.length ? totalStepperItemsArray.value[modelValue.value!] : null\n prevStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! > 1 ? totalStepperItemsArray.value[modelValue.value! - 2] : null\n })\n})\nwatch(totalStepperItemsArray, async () => {\n await nextTick(() => {\n nextStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! < totalStepperItemsArray.value.length ? totalStepperItemsArray.value[modelValue.value!] : null\n prevStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! > 1 ? totalStepperItemsArray.value[modelValue.value! - 2] : null\n })\n})\n\nprovideStepperRootContext({\n modelValue,\n changeModelValue: (value: number) => {\n modelValue.value = value\n },\n orientation: propOrientation,\n dir,\n linear,\n totalStepperItems,\n})\n</script>\n\n<template>\n <Primitive\n role=\"group\"\n aria-label=\"progress\"\n :as=\"as\"\n :as-child=\"asChild\"\n :data-linear=\"linear ? '' : undefined\"\n :data-orientation=\"orientation\"\n >\n <slot\n :model-value=\"modelValue\"\n :total-steps=\"totalStepperItems.size\"\n :is-next-disabled=\"isNextDisabled\"\n :is-prev-disabled=\"isPrevDisabled\"\n :is-first-step=\"isFirstStep\"\n :is-last-step=\"isLastStep\"\n :go-to-step=\"goToStep\"\n :next-step=\"() => goToStep((modelValue ?? 1) + 1)\"\n :prev-step=\"() => goToStep((modelValue ?? 1) - 1)\"\n />\n\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n role=\"status\"\n :style=\"{\n transform: 'translateX(-100%)',\n position: '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A,OAC9I,CAAA;AAAA,KACF,CAAA;AACD,IAAA,KAAA,CAAM,wBAAwB,YAAY;AACxC,MAAA,MAAM,SAAS,MAAM;AACnB,QAAA,eAAA,CAAgB,KAAQ,GAAA,sBAAA,CAAuB,KAAM,CAAA,MAAA,IAAU,UAAW,CAAA,KAAA,GAAS,sBAAuB,CAAA,KAAA,CAAM,MAAS,GAAA,sBAAA,CAAuB,KAAM,CAAA,UAAA,CAAW,KAAM,CAAI,GAAA,IAAA;AAC3K,QAAA,eAAA,CAAgB,KAAQ,GAAA,sBAAA,CAAuB,KAAM,CAAA,MAAA,IAAU,UAAW,CAAA,KAAA,GAAS,CAAI,GAAA,sBAAA,CAAuB,KAAM,CAAA,UAAA,CAAW,KAAS,GAAA,CAAC,CAAI,GAAA,IAAA;AAAA,OAC9I,CAAA;AAAA,KACF,CAAA;AAED,IAA0B,yBAAA,CAAA;AAAA,MACxB,UAAA;AAAA,MACA,gBAAA,EAAkB,CAAC,KAAkB,KAAA;AACnC,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA;AAAA,OACrB;AAAA,MACA,WAAa,EAAA,eAAA;AAAA,MACb,GAAA;AAAA,MACA,MAAA;AAAA,MACA;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"StepperRoot.js","sources":["../../src/Stepper/StepperRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { DataOrientation, Direction } from '../shared/types'\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useVModel } from '@vueuse/core'\nimport { computed, nextTick, ref, toRefs, watch } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { createContext, useDirection, useForwardExpose } from '@/shared'\n\nexport interface StepperRootContext {\n modelValue: Ref<number | undefined>\n changeModelValue: (value: number) => void\n orientation: Ref<DataOrientation>\n dir: Ref<Direction>\n linear: Ref<boolean>\n totalStepperItems: Ref<Set<HTMLElement>>\n}\n\nexport interface StepperRootProps extends PrimitiveProps {\n /**\n * The value of the step that should be active when initially rendered. Use when you do not need to control the state of the steps.\n */\n defaultValue?: number\n /**\n * The orientation the steps are laid out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down).\n * @defaultValue horizontal\n */\n orientation?: DataOrientation\n /**\n * The reading direction of the combobox when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode.\n */\n dir?: Direction\n /** The controlled value of the step to activate. Can be bound as `v-model`. */\n modelValue?: number\n /** Whether or not the steps must be completed in order. */\n linear?: boolean\n}\nexport type StepperRootEmits = {\n /** Event handler called when the value changes */\n 'update:modelValue': [payload: number | undefined]\n}\n\nexport const [injectStepperRootContext, provideStepperRootContext]\n = createContext<StepperRootContext>('StepperRoot')\n</script>\n\n<script setup lang=\"ts\">\nconst props = withDefaults(defineProps<StepperRootProps>(), {\n orientation: 'horizontal',\n linear: true,\n defaultValue: 1,\n})\nconst emits = defineEmits<StepperRootEmits>()\n\ndefineSlots<{\n default?: (props: {\n /** Current step */\n modelValue: number | undefined\n /** Total number of steps */\n totalSteps: number\n /** Whether or not the next step is disabled */\n isNextDisabled: boolean\n /** Whether or not the previous step is disabled */\n isPrevDisabled: boolean\n /** Whether or not the first step is active */\n isFirstStep: boolean\n /** Whether or not the last step is active */\n isLastStep: boolean\n /** Go to a specific step */\n goToStep: (step: number) => void\n /** Go to the next step */\n nextStep: () => void\n /** Go to the previous step */\n prevStep: () => void\n /** Whether or not there is a next step */\n hasNext: () => boolean\n /** Whether or not there is a previous step */\n hasPrev: () => boolean\n }) => any\n}>()\n\nconst { dir: propDir, orientation: propOrientation, linear } = toRefs(props)\nconst dir = useDirection(propDir)\n\nconst totalStepperItems = ref<Set<HTMLElement>>(new Set())\n\nconst modelValue = useVModel(props, 'modelValue', emits, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n})\n\nconst totalStepperItemsArray = computed(() => Array.from(totalStepperItems.value))\n\nconst isFirstStep = computed(() => modelValue.value === 1)\nconst isLastStep = computed(() => modelValue.value === totalStepperItemsArray.value.length)\n\nconst totalSteps = computed(() => totalStepperItems.value.size)\n\nfunction goToStep(step: number) {\n if (step > totalSteps.value)\n return\n\n if (step < 1)\n return\n\n if (totalStepperItems.value.size && !!totalStepperItemsArray.value[step] && !!totalStepperItemsArray.value[step].getAttribute('disabled'))\n return\n\n if (linear.value) {\n if (step > (modelValue.value ?? 1) + 1)\n return\n }\n\n modelValue.value = step\n}\n\nfunction nextStep() {\n goToStep((modelValue.value ?? 1) + 1)\n}\n\nfunction prevStep() {\n goToStep((modelValue.value ?? 1) - 1)\n}\n\nfunction hasNext() {\n return (modelValue.value ?? 1) < totalSteps.value\n}\n\nfunction hasPrev() {\n return (modelValue.value ?? 1) > 1\n}\n\nconst nextStepperItem = ref<HTMLElement | null>(null)\nconst prevStepperItem = ref<HTMLElement | null>(null)\nconst isNextDisabled = computed(() => nextStepperItem.value ? nextStepperItem.value.getAttribute('disabled') === '' : true)\nconst isPrevDisabled = computed(() => prevStepperItem.value ? prevStepperItem.value.getAttribute('disabled') === '' : true)\n\nwatch(modelValue, async () => {\n await nextTick(() => {\n nextStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! < totalStepperItemsArray.value.length ? totalStepperItemsArray.value[modelValue.value!] : null\n prevStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! > 1 ? totalStepperItemsArray.value[modelValue.value! - 2] : null\n })\n})\nwatch(totalStepperItemsArray, async () => {\n await nextTick(() => {\n nextStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! < totalStepperItemsArray.value.length ? totalStepperItemsArray.value[modelValue.value!] : null\n prevStepperItem.value = totalStepperItemsArray.value.length && modelValue.value! > 1 ? totalStepperItemsArray.value[modelValue.value! - 2] : null\n })\n})\n\nprovideStepperRootContext({\n modelValue,\n changeModelValue: (value: number) => {\n modelValue.value = value\n },\n orientation: propOrientation,\n dir,\n linear,\n totalStepperItems,\n})\n\ndefineExpose({\n goToStep,\n nextStep,\n prevStep,\n modelValue,\n totalSteps,\n isNextDisabled,\n isPrevDisabled,\n isFirstStep,\n isLastStep,\n hasNext,\n hasPrev,\n})\n\nuseForwardExpose()\n</script>\n\n<template>\n <Primitive\n role=\"group\"\n aria-label=\"progress\"\n :as=\"as\"\n :as-child=\"asChild\"\n :data-linear=\"linear ? '' : undefined\"\n :data-orientation=\"orientation\"\n >\n <slot\n :model-value=\"modelValue\"\n :total-steps=\"totalStepperItems.size\"\n :is-next-disabled=\"isNextDisabled\"\n :is-prev-disabled=\"isPrevDisabled\"\n :is-first-step=\"isFirstStep\"\n :is-last-step=\"isLastStep\"\n :go-to-step=\"goToStep\"\n :next-step=\"nextStep\"\n :prev-step=\"prevStep\"\n :has-next=\"hasNext\"\n :has-prev=\"hasPrev\"\n />\n\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n role=\"status\"\n :style=\"{\n transform: 'translateX(-100%)',\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }\"\n >\n Step {{ modelValue }} of {{ totalStepperItems.size }}\n </div>\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA2CO,MAAM,CAAC,wBAAA,EAA0B,yBAAyB,CAAA,GAC7D,cAAkC,aAAa;;;;;;;;;;;;;;AAInD,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,KAAQ,GAAA,MAAA;AA6Bd,IAAM,MAAA,EAAE,KAAK,OAAS,EAAA,WAAA,EAAa,iBAAiB,MAAO,EAAA,GAAI,OAAO,KAAK,CAAA;AAC3E,IAAM,MAAA,GAAA,GAAM,aAAa,OAAO,CAAA;AAEhC,IAAA,MAAM,iBAAoB,GAAA,GAAA,iBAA0B,IAAA,GAAA,EAAK,CAAA;AAEzD,IAAA,MAAM,UAAa,GAAA,SAAA,CAAU,KAAO,EAAA,YAAA,EAAc,KAAO,EAAA;AAAA,MACvD,cAAc,KAAM,CAAA,YAAA;AAAA,MAC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AAS,GAAA,sBAAA,CAAuB,KAAM,CAAA,UAAA,CAAW,KAAM,CAAI,GAAA,IAAA;AAC3K,QAAA,eAAA,CAAgB,KAAQ,GAAA,sBAAA,CAAuB,KAAM,CAAA,MAAA,IAAU,UAAW,CAAA,KAAA,GAAS,CAAI,GAAA,sBAAA,CAAuB,KAAM,CAAA,UAAA,CAAW,KAAS,GAAA,CAAC,CAAI,GAAA,IAAA;AAAA,OAC9I,CAAA;AAAA,KACF,CAAA;AAED,IAA0B,yBAAA,CAAA;AAAA,MACxB,UAAA;AAAA,MACA,gBAAA,EAAkB,CAAC,KAAkB,KAAA;AACnC,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA;AAAA,OACrB;AAAA,MACA,WAAa,EAAA,eAAA;AAAA,MACb,GAAA;AAAA,MACA,MAAA;AAAA,MACA;AAAA,KACD,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA;AAAA,KACD,CAAA;AAED,IAAiB,gBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepperTrigger.cjs","sources":["../../src/Stepper/StepperTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { getActiveElement, useArrowNavigation, useForwardExpose, useKbd } from '@/shared'\nimport { computed, onMounted, onUnmounted } from 'vue'\n\nexport interface StepperTriggerProps extends PrimitiveProps {\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { injectStepperItemContext } from './StepperItem.vue'\nimport { injectStepperRootContext } from './StepperRoot.vue'\n\nwithDefaults(defineProps<StepperTriggerProps>(), {\n as: 'button',\n})\n\nconst rootContext = injectStepperRootContext()\nconst itemContext = injectStepperItemContext()\n\nconst kbd = useKbd()\nconst stepperItems = computed(() => Array.from(rootContext.totalStepperItems.value))\n\nfunction handleMouseDown(event: MouseEvent) {\n if (itemContext.disabled.value)\n return\n if (rootContext.linear.value) {\n if (itemContext.step.value <= rootContext.modelValue.value! || itemContext.step.value === rootContext.modelValue.value! + 1) {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n }\n else {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n\n // prevent focus to avoid accidental activation\n event.preventDefault()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n event.preventDefault()\n\n if (itemContext.disabled.value)\n return\n\n if ((event.key === kbd.ENTER || event.key === kbd.SPACE) && !event.ctrlKey && !event.shiftKey)\n rootContext.changeModelValue(itemContext.step.value)\n\n if ([kbd.ARROW_LEFT, kbd.ARROW_RIGHT, kbd.ARROW_UP, kbd.ARROW_DOWN].includes(event.key)) {\n useArrowNavigation(event, getActiveElement() as HTMLElement, undefined, {\n itemsArray: stepperItems.value,\n focus: true,\n loop: false,\n arrowKeyOptions: rootContext.orientation.value,\n dir: rootContext.dir.value,\n })\n }\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\n\nonMounted(() => {\n rootContext.totalStepperItems.value.add(currentElement.value)\n})\n\nonUnmounted(() => {\n rootContext.totalStepperItems.value.delete(currentElement.value)\n})\n</script>\n\n<template>\n <Primitive\n :ref=\"forwardRef\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :data-state=\"itemContext.state.value\"\n :disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n :tabindex=\"itemContext.isFocusable.value ? 0 : -1\"\n :aria-describedby=\"itemContext.descriptionId\"\n :aria-labelledby=\"itemContext.titleId\"\n @mousedown.left=\"handleMouseDown\"\n @keydown.enter.space.left.right.up.down=\"handleKeyDown\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["injectStepperRootContext","injectStepperItemContext","useKbd","computed","useArrowNavigation","getActiveElement","useForwardExpose","onMounted","onUnmounted"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAA,MAAM,cAAcA,4CAAyB,EAAA;AAC7C,IAAA,MAAM,cAAcC,4CAAyB,EAAA;AAE7C,IAAA,MAAM,MAAMC,oBAAO,EAAA;AACnB,IAAM,MAAA,YAAA,GAAeC,aAAS,MAAM,KAAA,CAAM,KAAK,WAAY,CAAA,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAEnF,IAAA,SAAS,gBAAgB,KAAmB,EAAA;AAC1C,MAAA,IAAI,YAAY,QAAS,CAAA,KAAA;AACvB,QAAA;AACF,MAAI,IAAA,WAAA,CAAY,OAAO,KAAO,EAAA;AAC5B,QAAA,IAAI,WAAY,CAAA,IAAA,CAAK,KAAS,IAAA,WAAA,CAAY,UAAW,CAAA,KAAA,IAAU,WAAY,CAAA,IAAA,CAAK,KAAU,KAAA,WAAA,CAAY,UAAW,CAAA,KAAA,GAAS,CAAG,EAAA;AAC3H,UAAI,IAAA,KAAA,CAAM,YAAY,KAAO,EAAA;AAC3B,YAAY,WAAA,CAAA,gBAAA,CAAiB,WAAY,CAAA,IAAA,CAAK,KAAK,CAAA;AACnD,YAAA;AAAA;AACF;AACF,OAEG,MAAA;AACH,QAAI,IAAA,KAAA,CAAM,YAAY,KAAO,EAAA;AAC3B,UAAY,WAAA,CAAA,gBAAA,CAAiB,WAAY,CAAA,IAAA,CAAK,KAAK,CAAA;AACnD,UAAA;AAAA;AACF;AAIF,MAAA,KAAA,CAAM,cAAe,EAAA;AAAA;AAGvB,IAAA,SAAS,cAAc,KAAsB,EAAA;AAC3C,MAAA,KAAA,CAAM,cAAe,EAAA;AAErB,MAAA,IAAI,YAAY,QAAS,CAAA,KAAA;AACvB,QAAA;AAEF,MAAA,IAAA,CAAK,KAAM,CAAA,GAAA,KAAQ,GAAI,CAAA,KAAA,IAAS,KAAM,CAAA,GAAA,KAAQ,GAAI,CAAA,KAAA,KAAU,CAAC,KAAA,CAAM,OAAW,IAAA,CAAC,KAAM,CAAA,QAAA;AACnF,QAAY,WAAA,CAAA,gBAAA,CAAiB,WAAY,CAAA,IAAA,CAAK,KAAK,CAAA;AAErD,MAAA,IAAI,CAAC,GAAA,CAAI,UAAY,EAAA,GAAA,CAAI,WAAa,EAAA,GAAA,CAAI,QAAU,EAAA,GAAA,CAAI,UAAU,CAAA,CAAE,QAAS,CAAA,KAAA,CAAM,GAAG,CAAG,EAAA;AACvF,QAAmBC,4CAAA,CAAA,KAAA,EAAOC,wCAAiB,EAAA,EAAkB,MAAW,EAAA;AAAA,UACtE,YAAY,YAAa,CAAA,KAAA;AAAA,UACzB,KAAO,EAAA,IAAA;AAAA,UACP,IAAM,EAAA,KAAA;AAAA,UACN,eAAA,EAAiB,YAAY,WAAY,CAAA,KAAA;AAAA,UACzC,GAAA,EAAK,YAAY,GAAI,CAAA;AAAA,SACtB,CAAA;AAAA;AACH;AAGF,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AAExD,IAAAC,aAAA,CAAU,MAAM;AACd,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,GAAI,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAC7D,CAAA;AAED,IAAAC,eAAA,CAAY,MAAM;AAChB,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,MAAO,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAChE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"StepperTrigger.cjs","sources":["../../src/Stepper/StepperTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { computed, onMounted, onUnmounted } from 'vue'\nimport { getActiveElement, useArrowNavigation, useForwardExpose, useKbd } from '@/shared'\n\nexport interface StepperTriggerProps extends PrimitiveProps {\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { injectStepperItemContext } from './StepperItem.vue'\nimport { injectStepperRootContext } from './StepperRoot.vue'\n\nwithDefaults(defineProps<StepperTriggerProps>(), {\n as: 'button',\n})\n\nconst rootContext = injectStepperRootContext()\nconst itemContext = injectStepperItemContext()\n\nconst kbd = useKbd()\nconst stepperItems = computed(() => Array.from(rootContext.totalStepperItems.value))\n\nfunction handleMouseDown(event: MouseEvent) {\n if (itemContext.disabled.value)\n return\n if (rootContext.linear.value) {\n if (itemContext.step.value <= rootContext.modelValue.value! || itemContext.step.value === rootContext.modelValue.value! + 1) {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n }\n else {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n\n // prevent focus to avoid accidental activation\n event.preventDefault()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n event.preventDefault()\n\n if (itemContext.disabled.value)\n return\n\n if ((event.key === kbd.ENTER || event.key === kbd.SPACE) && !event.ctrlKey && !event.shiftKey)\n rootContext.changeModelValue(itemContext.step.value)\n\n if ([kbd.ARROW_LEFT, kbd.ARROW_RIGHT, kbd.ARROW_UP, kbd.ARROW_DOWN].includes(event.key)) {\n useArrowNavigation(event, getActiveElement() as HTMLElement, undefined, {\n itemsArray: stepperItems.value,\n focus: true,\n loop: false,\n arrowKeyOptions: rootContext.orientation.value,\n dir: rootContext.dir.value,\n })\n }\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\n\nonMounted(() => {\n rootContext.totalStepperItems.value.add(currentElement.value)\n})\n\nonUnmounted(() => {\n rootContext.totalStepperItems.value.delete(currentElement.value)\n})\n</script>\n\n<template>\n <Primitive\n :ref=\"forwardRef\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :data-state=\"itemContext.state.value\"\n :disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n :tabindex=\"itemContext.isFocusable.value ? 0 : -1\"\n :aria-describedby=\"itemContext.descriptionId\"\n :aria-labelledby=\"itemContext.titleId\"\n @mousedown.left=\"handleMouseDown\"\n @keydown.enter.space.left.right.up.down=\"handleKeyDown\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["injectStepperRootContext","injectStepperItemContext","useKbd","computed","useArrowNavigation","getActiveElement","useForwardExpose","onMounted","onUnmounted"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAA,MAAM,cAAcA,4CAAyB,EAAA;AAC7C,IAAA,MAAM,cAAcC,4CAAyB,EAAA;AAE7C,IAAA,MAAM,MAAMC,oBAAO,EAAA;AACnB,IAAM,MAAA,YAAA,GAAeC,aAAS,MAAM,KAAA,CAAM,KAAK,WAAY,CAAA,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAEnF,IAAA,SAAS,gBAAgB,KAAmB,EAAA;AAC1C,MAAA,IAAI,YAAY,QAAS,CAAA,KAAA;AACvB,QAAA;AACF,MAAI,IAAA,WAAA,CAAY,OAAO,KAAO,EAAA;AAC5B,QAAA,IAAI,WAAY,CAAA,IAAA,CAAK,KAAS,IAAA,WAAA,CAAY,UAAW,CAAA,KAAA,IAAU,WAAY,CAAA,IAAA,CAAK,KAAU,KAAA,WAAA,CAAY,UAAW,CAAA,KAAA,GAAS,CAAG,EAAA;AAC3H,UAAI,IAAA,KAAA,CAAM,YAAY,KAAO,EAAA;AAC3B,YAAY,WAAA,CAAA,gBAAA,CAAiB,WAAY,CAAA,IAAA,CAAK,KAAK,CAAA;AACnD,YAAA;AAAA;AACF;AACF,OAEG,MAAA;AAC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ED,IAAAC,eAAA,CAAY,MAAM;AAChB,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,MAAO,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAChE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepperTrigger.js","sources":["../../src/Stepper/StepperTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { getActiveElement, useArrowNavigation, useForwardExpose, useKbd } from '@/shared'\nimport { computed, onMounted, onUnmounted } from 'vue'\n\nexport interface StepperTriggerProps extends PrimitiveProps {\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { injectStepperItemContext } from './StepperItem.vue'\nimport { injectStepperRootContext } from './StepperRoot.vue'\n\nwithDefaults(defineProps<StepperTriggerProps>(), {\n as: 'button',\n})\n\nconst rootContext = injectStepperRootContext()\nconst itemContext = injectStepperItemContext()\n\nconst kbd = useKbd()\nconst stepperItems = computed(() => Array.from(rootContext.totalStepperItems.value))\n\nfunction handleMouseDown(event: MouseEvent) {\n if (itemContext.disabled.value)\n return\n if (rootContext.linear.value) {\n if (itemContext.step.value <= rootContext.modelValue.value! || itemContext.step.value === rootContext.modelValue.value! + 1) {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n }\n else {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n\n // prevent focus to avoid accidental activation\n event.preventDefault()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n event.preventDefault()\n\n if (itemContext.disabled.value)\n return\n\n if ((event.key === kbd.ENTER || event.key === kbd.SPACE) && !event.ctrlKey && !event.shiftKey)\n rootContext.changeModelValue(itemContext.step.value)\n\n if ([kbd.ARROW_LEFT, kbd.ARROW_RIGHT, kbd.ARROW_UP, kbd.ARROW_DOWN].includes(event.key)) {\n useArrowNavigation(event, getActiveElement() as HTMLElement, undefined, {\n itemsArray: stepperItems.value,\n focus: true,\n loop: false,\n arrowKeyOptions: rootContext.orientation.value,\n dir: rootContext.dir.value,\n })\n }\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\n\nonMounted(() => {\n rootContext.totalStepperItems.value.add(currentElement.value)\n})\n\nonUnmounted(() => {\n rootContext.totalStepperItems.value.delete(currentElement.value)\n})\n</script>\n\n<template>\n <Primitive\n :ref=\"forwardRef\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :data-state=\"itemContext.state.value\"\n :disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n :tabindex=\"itemContext.isFocusable.value ? 0 : -1\"\n :aria-describedby=\"itemContext.descriptionId\"\n :aria-labelledby=\"itemContext.titleId\"\n @mousedown.left=\"handleMouseDown\"\n @keydown.enter.space.left.right.up.down=\"handleKeyDown\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAA,MAAM,cAAc,wBAAyB,EAAA;AAC7C,IAAA,MAAM,cAAc,wBAAyB,EAAA;AAE7C,IAAA,MAAM,MAAM,MAAO,EAAA;AACnB,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM,KAAA,CAAM,KAAK,WAAY,CAAA,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAEnF,IAAA,SAAS,gBAAgB,KAAmB,EAAA;AAC1C,MAAA,IAAI,YAAY,QAAS,CAAA,KAAA;AACvB,QAAA;AACF,MAAI,IAAA,WAAA,CAAY,OAAO,KAAO,EAAA;AAC5B,QAAA,IAAI,WAAY,CAAA,IAAA,CAAK,KAAS,IAAA,WAAA,CAAY,UAAW,CAAA,KAAA,IAAU,WAAY,CAAA,IAAA,CAAK,KAAU,KAAA,WAAA,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AGF,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AAExD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,GAAI,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAC7D,CAAA;AAED,IAAA,WAAA,CAAY,MAAM;AAChB,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,MAAO,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAChE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"StepperTrigger.js","sources":["../../src/Stepper/StepperTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { computed, onMounted, onUnmounted } from 'vue'\nimport { getActiveElement, useArrowNavigation, useForwardExpose, useKbd } from '@/shared'\n\nexport interface StepperTriggerProps extends PrimitiveProps {\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { injectStepperItemContext } from './StepperItem.vue'\nimport { injectStepperRootContext } from './StepperRoot.vue'\n\nwithDefaults(defineProps<StepperTriggerProps>(), {\n as: 'button',\n})\n\nconst rootContext = injectStepperRootContext()\nconst itemContext = injectStepperItemContext()\n\nconst kbd = useKbd()\nconst stepperItems = computed(() => Array.from(rootContext.totalStepperItems.value))\n\nfunction handleMouseDown(event: MouseEvent) {\n if (itemContext.disabled.value)\n return\n if (rootContext.linear.value) {\n if (itemContext.step.value <= rootContext.modelValue.value! || itemContext.step.value === rootContext.modelValue.value! + 1) {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n }\n else {\n if (event.ctrlKey === false) {\n rootContext.changeModelValue(itemContext.step.value)\n return\n }\n }\n\n // prevent focus to avoid accidental activation\n event.preventDefault()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n event.preventDefault()\n\n if (itemContext.disabled.value)\n return\n\n if ((event.key === kbd.ENTER || event.key === kbd.SPACE) && !event.ctrlKey && !event.shiftKey)\n rootContext.changeModelValue(itemContext.step.value)\n\n if ([kbd.ARROW_LEFT, kbd.ARROW_RIGHT, kbd.ARROW_UP, kbd.ARROW_DOWN].includes(event.key)) {\n useArrowNavigation(event, getActiveElement() as HTMLElement, undefined, {\n itemsArray: stepperItems.value,\n focus: true,\n loop: false,\n arrowKeyOptions: rootContext.orientation.value,\n dir: rootContext.dir.value,\n })\n }\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\n\nonMounted(() => {\n rootContext.totalStepperItems.value.add(currentElement.value)\n})\n\nonUnmounted(() => {\n rootContext.totalStepperItems.value.delete(currentElement.value)\n})\n</script>\n\n<template>\n <Primitive\n :ref=\"forwardRef\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :data-state=\"itemContext.state.value\"\n :disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-disabled=\"itemContext.disabled.value || !itemContext.isFocusable.value ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n :tabindex=\"itemContext.isFocusable.value ? 0 : -1\"\n :aria-describedby=\"itemContext.descriptionId\"\n :aria-labelledby=\"itemContext.titleId\"\n @mousedown.left=\"handleMouseDown\"\n @keydown.enter.space.left.right.up.down=\"handleKeyDown\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAA,MAAM,cAAc,wBAAyB,EAAA;AAC7C,IAAA,MAAM,cAAc,wBAAyB,EAAA;AAE7C,IAAA,MAAM,MAAM,MAAO,EAAA;AACnB,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM,KAAA,CAAM,KAAK,WAAY,CAAA,iBAAA,CAAkB,KAAK,CAAC,CAAA;AAEnF,IAAA,SAAS,gBAAgB,KAAmB,EAAA;AAC1C,MAAA,IAAI,YAAY,QAAS,CAAA,KAAA;AAC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AAA,KAAA;AAAA,UACzB,KAAO,EAAA,IAAA;AAAA,UACP,IAAM,EAAA,KAAA;AAAA,UACN,eAAA,EAAiB,YAAY,WAAY,CAAA,KAAA;AAAA,UACzC,GAAA,EAAK,YAAY,GAAI,CAAA;AAAA,SACtB,CAAA;AAAA;AACH;AAGF,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AAExD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,GAAI,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAC7D,CAAA;AAED,IAAA,WAAA,CAAY,MAAM;AAChB,MAAA,WAAA,CAAY,iBAAkB,CAAA,KAAA,CAAM,MAAO,CAAA,cAAA,CAAe,KAAK,CAAA;AAAA,KAChE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchRoot.cjs","sources":["../../src/Switch/SwitchRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { FormFieldProps } from '@/shared/types'\nimport type { Ref } from 'vue'\nimport { createContext, useFormControl, useForwardExpose } from '@/shared'\n\nexport interface SwitchRootProps extends PrimitiveProps, FormFieldProps {\n /** The state of the switch when it is initially rendered. Use when you do not need to control its state. */\n defaultValue?: boolean\n /** The controlled state of the switch. Can be bind as `v-model`. */\n modelValue?: boolean | null\n /** When `true`, prevents the user from interacting with the switch. */\n disabled?: boolean\n id?: string\n /** The value given as data when submitted with a `name`. */\n value?: string\n}\n\nexport type SwitchRootEmits = {\n /** Event handler called when the value of the switch changes. */\n 'update:modelValue': [payload: boolean]\n}\n\nexport interface SwitchRootContext {\n modelValue?: Ref<boolean>\n toggleCheck: () => void\n disabled: Ref<boolean>\n}\n\nexport const [injectSwitchRootContext, provideSwitchRootContext]\n = createContext<SwitchRootContext>('SwitchRoot')\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { VisuallyHiddenInput } from '@/VisuallyHidden'\nimport { useVModel } from '@vueuse/core'\nimport { computed, toRefs } from 'vue'\n\nconst props = withDefaults(defineProps<SwitchRootProps>(), {\n as: 'button',\n modelValue: undefined,\n value: 'on',\n})\nconst emit = defineEmits<SwitchRootEmits>()\n\ndefineSlots<{\n default: (props: {\n /** Current value */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { disabled } = toRefs(props)\n\nconst modelValue = useVModel(props, 'modelValue', emit, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n}) as Ref<boolean>\n\nfunction toggleCheck() {\n if (disabled.value)\n return\n\n modelValue.value = !modelValue.value\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst isFormControl = useFormControl(currentElement)\nconst ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for=\"${props.id}\"]`) as HTMLLabelElement)?.innerText : undefined)\n\nprovideSwitchRootContext({\n modelValue,\n toggleCheck,\n disabled,\n})\n</script>\n\n<template>\n <Primitive\n v-bind=\"$attrs\"\n :id=\"id\"\n :ref=\"forwardRef\"\n role=\"switch\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :value=\"value\"\n :aria-label=\"$attrs['aria-label'] || ariaLabel\"\n :aria-checked=\"modelValue\"\n :aria-required=\"required\"\n :data-state=\"modelValue ? 'checked' : 'unchecked'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :as-child=\"asChild\"\n :as=\"as\"\n :disabled=\"disabled\"\n @click=\"toggleCheck\"\n @keydown.enter.prevent=\"toggleCheck\"\n >\n <slot :model-value=\"modelValue\" />\n\n <VisuallyHiddenInput\n v-if=\"isFormControl && name\"\n type=\"checkbox\"\n :name=\"name\"\n :disabled=\"disabled\"\n :required=\"required\"\n :value=\"value\"\n :checked=\"!!modelValue\"\n />\n </Primitive>\n</template>\n"],"names":["createContext","toRefs","useVModel","useForwardExpose","useFormControl","computed"],"mappings":";;;;;;;;;;AA6BO,MAAM,CAAC,uBAAA,EAAyB,wBAAwB,CAAA,GAC3DA,mCAAiC,YAAY;;;;;;;;;;;;;;;;AASjD,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,IAAO,GAAA,MAAA;AASb,IAAA,MAAM,EAAE,QAAA,EAAa,GAAAC,UAAA,CAAO,KAAK,CAAA;AAEjC,IAAA,MAAM,UAAa,GAAAC,cAAA,CAAU,KAAO,EAAA,YAAA,EAAc,IAAM,EAAA;AAAA,MACtD,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,SAAS,WAAc,GAAA;AACrB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AAEF,MAAW,UAAA,CAAA,KAAA,GAAQ,CAAC,UAAW,CAAA,KAAA;AAAA;AAGjC,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AACxD,IAAM,MAAA,aAAA,GAAgBC,qCAAe,cAAc,CAAA;AACnD,IAAA,MAAM,SAAY,GAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,MAAM,cAAe,CAAA,KAAA,GAAS,QAAS,CAAA,aAAA,CAAc,SAAS,KAAM,CAAA,EAAE,CAAI,EAAA,CAAA,CAAA,EAAwB,YAAY,MAAS,CAAA;AAE9J,IAAyB,wBAAA,CAAA;AAAA,MACvB,UAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SwitchRoot.cjs","sources":["../../src/Switch/SwitchRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { FormFieldProps } from '@/shared/types'\nimport { createContext, useFormControl, useForwardExpose } from '@/shared'\n\nexport interface SwitchRootProps extends PrimitiveProps, FormFieldProps {\n /** The state of the switch when it is initially rendered. Use when you do not need to control its state. */\n defaultValue?: boolean\n /** The controlled state of the switch. Can be bind as `v-model`. */\n modelValue?: boolean | null\n /** When `true`, prevents the user from interacting with the switch. */\n disabled?: boolean\n id?: string\n /** The value given as data when submitted with a `name`. */\n value?: string\n}\n\nexport type SwitchRootEmits = {\n /** Event handler called when the value of the switch changes. */\n 'update:modelValue': [payload: boolean]\n}\n\nexport interface SwitchRootContext {\n modelValue?: Ref<boolean>\n toggleCheck: () => void\n disabled: Ref<boolean>\n}\n\nexport const [injectSwitchRootContext, provideSwitchRootContext]\n = createContext<SwitchRootContext>('SwitchRoot')\n</script>\n\n<script setup lang=\"ts\">\nimport { useVModel } from '@vueuse/core'\nimport { computed, toRefs } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { VisuallyHiddenInput } from '@/VisuallyHidden'\n\nconst props = withDefaults(defineProps<SwitchRootProps>(), {\n as: 'button',\n modelValue: undefined,\n value: 'on',\n})\nconst emit = defineEmits<SwitchRootEmits>()\n\ndefineSlots<{\n default?: (props: {\n /** Current value */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { disabled } = toRefs(props)\n\nconst modelValue = useVModel(props, 'modelValue', emit, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n}) as Ref<boolean>\n\nfunction toggleCheck() {\n if (disabled.value)\n return\n\n modelValue.value = !modelValue.value\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst isFormControl = useFormControl(currentElement)\nconst ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for=\"${props.id}\"]`) as HTMLLabelElement)?.innerText : undefined)\n\nprovideSwitchRootContext({\n modelValue,\n toggleCheck,\n disabled,\n})\n</script>\n\n<template>\n <Primitive\n v-bind=\"$attrs\"\n :id=\"id\"\n :ref=\"forwardRef\"\n role=\"switch\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :value=\"value\"\n :aria-label=\"$attrs['aria-label'] || ariaLabel\"\n :aria-checked=\"modelValue\"\n :aria-required=\"required\"\n :data-state=\"modelValue ? 'checked' : 'unchecked'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :as-child=\"asChild\"\n :as=\"as\"\n :disabled=\"disabled\"\n @click=\"toggleCheck\"\n @keydown.enter.prevent=\"toggleCheck\"\n >\n <slot :model-value=\"modelValue\" />\n\n <VisuallyHiddenInput\n v-if=\"isFormControl && name\"\n type=\"checkbox\"\n :name=\"name\"\n :disabled=\"disabled\"\n :required=\"required\"\n :value=\"value\"\n :checked=\"!!modelValue\"\n />\n </Primitive>\n</template>\n"],"names":["createContext","toRefs","useVModel","useForwardExpose","useFormControl","computed"],"mappings":";;;;;;;;;;AA6BO,MAAM,CAAC,uBAAA,EAAyB,wBAAwB,CAAA,GAC3DA,mCAAiC,YAAY;;;;;;;;;;;;;;;;AASjD,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,IAAO,GAAA,MAAA;AASb,IAAA,MAAM,EAAE,QAAA,EAAa,GAAAC,UAAA,CAAO,KAAK,CAAA;AAEjC,IAAA,MAAM,UAAa,GAAAC,cAAA,CAAU,KAAO,EAAA,YAAA,EAAc,IAAM,EAAA;AAAA,MACtD,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,SAAS,WAAc,GAAA;AACrB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AAEF,MAAW,UAAA,CAAA,KAAA,GAAQ,CAAC,UAAW,CAAA,KAAA;AAAA;AAGjC,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AACxD,IAAM,MAAA,aAAA,GAAgBC,qCAAe,cAAc,CAAA;AACnD,IAAA,MAAM,SAAY,GAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,MAAM,cAAe,CAAA,KAAA,GAAS,QAAS,CAAA,aAAA,CAAc,SAAS,KAAM,CAAA,EAAE,CAAI,EAAA,CAAA,CAAA,EAAwB,YAAY,MAAS,CAAA;AAE9J,IAAyB,wBAAA,CAAA;AAAA,MACvB,UAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchRoot.js","sources":["../../src/Switch/SwitchRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { FormFieldProps } from '@/shared/types'\nimport type { Ref } from 'vue'\nimport { createContext, useFormControl, useForwardExpose } from '@/shared'\n\nexport interface SwitchRootProps extends PrimitiveProps, FormFieldProps {\n /** The state of the switch when it is initially rendered. Use when you do not need to control its state. */\n defaultValue?: boolean\n /** The controlled state of the switch. Can be bind as `v-model`. */\n modelValue?: boolean | null\n /** When `true`, prevents the user from interacting with the switch. */\n disabled?: boolean\n id?: string\n /** The value given as data when submitted with a `name`. */\n value?: string\n}\n\nexport type SwitchRootEmits = {\n /** Event handler called when the value of the switch changes. */\n 'update:modelValue': [payload: boolean]\n}\n\nexport interface SwitchRootContext {\n modelValue?: Ref<boolean>\n toggleCheck: () => void\n disabled: Ref<boolean>\n}\n\nexport const [injectSwitchRootContext, provideSwitchRootContext]\n = createContext<SwitchRootContext>('SwitchRoot')\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { VisuallyHiddenInput } from '@/VisuallyHidden'\nimport { useVModel } from '@vueuse/core'\nimport { computed, toRefs } from 'vue'\n\nconst props = withDefaults(defineProps<SwitchRootProps>(), {\n as: 'button',\n modelValue: undefined,\n value: 'on',\n})\nconst emit = defineEmits<SwitchRootEmits>()\n\ndefineSlots<{\n default: (props: {\n /** Current value */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { disabled } = toRefs(props)\n\nconst modelValue = useVModel(props, 'modelValue', emit, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n}) as Ref<boolean>\n\nfunction toggleCheck() {\n if (disabled.value)\n return\n\n modelValue.value = !modelValue.value\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst isFormControl = useFormControl(currentElement)\nconst ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for=\"${props.id}\"]`) as HTMLLabelElement)?.innerText : undefined)\n\nprovideSwitchRootContext({\n modelValue,\n toggleCheck,\n disabled,\n})\n</script>\n\n<template>\n <Primitive\n v-bind=\"$attrs\"\n :id=\"id\"\n :ref=\"forwardRef\"\n role=\"switch\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :value=\"value\"\n :aria-label=\"$attrs['aria-label'] || ariaLabel\"\n :aria-checked=\"modelValue\"\n :aria-required=\"required\"\n :data-state=\"modelValue ? 'checked' : 'unchecked'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :as-child=\"asChild\"\n :as=\"as\"\n :disabled=\"disabled\"\n @click=\"toggleCheck\"\n @keydown.enter.prevent=\"toggleCheck\"\n >\n <slot :model-value=\"modelValue\" />\n\n <VisuallyHiddenInput\n v-if=\"isFormControl && name\"\n type=\"checkbox\"\n :name=\"name\"\n :disabled=\"disabled\"\n :required=\"required\"\n :value=\"value\"\n :checked=\"!!modelValue\"\n />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;AA6BO,MAAM,CAAC,uBAAA,EAAyB,wBAAwB,CAAA,GAC3D,cAAiC,YAAY;;;;;;;;;;;;;;;;AASjD,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,IAAO,GAAA,MAAA;AASb,IAAA,MAAM,EAAE,QAAA,EAAa,GAAA,MAAA,CAAO,KAAK,CAAA;AAEjC,IAAA,MAAM,UAAa,GAAA,SAAA,CAAU,KAAO,EAAA,YAAA,EAAc,IAAM,EAAA;AAAA,MACtD,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,SAAS,WAAc,GAAA;AACrB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AAEF,MAAW,UAAA,CAAA,KAAA,GAAQ,CAAC,UAAW,CAAA,KAAA;AAAA;AAGjC,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AACxD,IAAM,MAAA,aAAA,GAAgB,eAAe,cAAc,CAAA;AACnD,IAAA,MAAM,SAAY,GAAA,QAAA,CAAS,MAAM,KAAA,CAAM,MAAM,cAAe,CAAA,KAAA,GAAS,QAAS,CAAA,aAAA,CAAc,SAAS,KAAM,CAAA,EAAE,CAAI,EAAA,CAAA,CAAA,EAAwB,YAAY,MAAS,CAAA;AAE9J,IAAyB,wBAAA,CAAA;AAAA,MACvB,UAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SwitchRoot.js","sources":["../../src/Switch/SwitchRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { FormFieldProps } from '@/shared/types'\nimport { createContext, useFormControl, useForwardExpose } from '@/shared'\n\nexport interface SwitchRootProps extends PrimitiveProps, FormFieldProps {\n /** The state of the switch when it is initially rendered. Use when you do not need to control its state. */\n defaultValue?: boolean\n /** The controlled state of the switch. Can be bind as `v-model`. */\n modelValue?: boolean | null\n /** When `true`, prevents the user from interacting with the switch. */\n disabled?: boolean\n id?: string\n /** The value given as data when submitted with a `name`. */\n value?: string\n}\n\nexport type SwitchRootEmits = {\n /** Event handler called when the value of the switch changes. */\n 'update:modelValue': [payload: boolean]\n}\n\nexport interface SwitchRootContext {\n modelValue?: Ref<boolean>\n toggleCheck: () => void\n disabled: Ref<boolean>\n}\n\nexport const [injectSwitchRootContext, provideSwitchRootContext]\n = createContext<SwitchRootContext>('SwitchRoot')\n</script>\n\n<script setup lang=\"ts\">\nimport { useVModel } from '@vueuse/core'\nimport { computed, toRefs } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { VisuallyHiddenInput } from '@/VisuallyHidden'\n\nconst props = withDefaults(defineProps<SwitchRootProps>(), {\n as: 'button',\n modelValue: undefined,\n value: 'on',\n})\nconst emit = defineEmits<SwitchRootEmits>()\n\ndefineSlots<{\n default?: (props: {\n /** Current value */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { disabled } = toRefs(props)\n\nconst modelValue = useVModel(props, 'modelValue', emit, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n}) as Ref<boolean>\n\nfunction toggleCheck() {\n if (disabled.value)\n return\n\n modelValue.value = !modelValue.value\n}\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst isFormControl = useFormControl(currentElement)\nconst ariaLabel = computed(() => props.id && currentElement.value ? (document.querySelector(`[for=\"${props.id}\"]`) as HTMLLabelElement)?.innerText : undefined)\n\nprovideSwitchRootContext({\n modelValue,\n toggleCheck,\n disabled,\n})\n</script>\n\n<template>\n <Primitive\n v-bind=\"$attrs\"\n :id=\"id\"\n :ref=\"forwardRef\"\n role=\"switch\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :value=\"value\"\n :aria-label=\"$attrs['aria-label'] || ariaLabel\"\n :aria-checked=\"modelValue\"\n :aria-required=\"required\"\n :data-state=\"modelValue ? 'checked' : 'unchecked'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :as-child=\"asChild\"\n :as=\"as\"\n :disabled=\"disabled\"\n @click=\"toggleCheck\"\n @keydown.enter.prevent=\"toggleCheck\"\n >\n <slot :model-value=\"modelValue\" />\n\n <VisuallyHiddenInput\n v-if=\"isFormControl && name\"\n type=\"checkbox\"\n :name=\"name\"\n :disabled=\"disabled\"\n :required=\"required\"\n :value=\"value\"\n :checked=\"!!modelValue\"\n />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;AA6BO,MAAM,CAAC,uBAAA,EAAyB,wBAAwB,CAAA,GAC3D,cAAiC,YAAY;;;;;;;;;;;;;;;;AASjD,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,IAAO,GAAA,MAAA;AASb,IAAA,MAAM,EAAE,QAAA,EAAa,GAAA,MAAA,CAAO,KAAK,CAAA;AAEjC,IAAA,MAAM,UAAa,GAAA,SAAA,CAAU,KAAO,EAAA,YAAA,EAAc,IAAM,EAAA;AAAA,MACtD,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,SAAS,WAAc,GAAA;AACrB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AAEF,MAAW,UAAA,CAAA,KAAA,GAAQ,CAAC,UAAW,CAAA,KAAA;AAAA;AAGjC,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AACxD,IAAM,MAAA,aAAA,GAAgB,eAAe,cAAc,CAAA;AACnD,IAAA,MAAM,SAAY,GAAA,QAAA,CAAS,MAAM,KAAA,CAAM,MAAM,cAAe,CAAA,KAAA,GAAS,QAAS,CAAA,aAAA,CAAc,SAAS,KAAM,CAAA,EAAE,CAAI,EAAA,CAAA,CAAA,EAAwB,YAAY,MAAS,CAAA;AAE9J,IAAyB,wBAAA,CAAA;AAAA,MACvB,UAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsContent.cjs","sources":["../../src/Tabs/TabsContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsContentProps extends PrimitiveProps {\n /** A unique value that associates the content with a trigger. */\n value: StringOrNumber\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with Vue animation libraries.\n */\n forceMount?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Presence } from '@/Presence'\nimport { Primitive } from '@/Primitive'\nimport { computed, onMounted, ref } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = defineProps<TabsContentProps>()\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n\nconst isMountAnimationPreventedRef = ref(isSelected.value)\n\nonMounted(() => {\n requestAnimationFrame(() => {\n isMountAnimationPreventedRef.value = false\n })\n})\n</script>\n\n<template>\n <Presence\n v-slot=\"{ present }\"\n :present=\"forceMount || isSelected\"\n force-mount\n >\n <Primitive\n :id=\"contentId\"\n :ref=\"forwardRef\"\n :as-child=\"asChild\"\n :as=\"as\"\n role=\"tabpanel\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :data-orientation=\"rootContext.orientation.value\"\n :aria-labelledby=\"triggerId\"\n :hidden=\"!present\"\n tabindex=\"0\"\n :style=\"{\n animationDuration: isMountAnimationPreventedRef ? '0s' : undefined,\n }\"\n >\n <slot v-if=\"rootContext.unmountOnHide.value ? present : true\" />\n </Primitive>\n </Presence>\n</template>\n"],"names":["useForwardExpose","injectTabsRootContext","computed","makeTriggerId","makeContentId","ref","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAEd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAIA,wCAAiB,EAAA;AACxC,IAAA,MAAM,cAAcC,mCAAsB,EAAA;AAC1C,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAMC,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAYD,aAAS,MAAME,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAaF,YAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;AAE9E,IAAM,MAAA,4BAAA,GAA+BG,OAAI,CAAA,UAAA,CAAW,KAAK,CAAA;AAEzD,IAAAC,aAAA,CAAU,MAAM;AACd,MAAA,qBAAA,CAAsB,MAAM;AAC1B,QAAA,4BAAA,CAA6B,KAAQ,GAAA,KAAA;AAAA,OACtC,CAAA;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsContent.cjs","sources":["../../src/Tabs/TabsContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsContentProps extends PrimitiveProps {\n /** A unique value that associates the content with a trigger. */\n value: StringOrNumber\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with Vue animation libraries.\n */\n forceMount?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, ref } from 'vue'\nimport { Presence } from '@/Presence'\nimport { Primitive } from '@/Primitive'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = defineProps<TabsContentProps>()\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n\nconst isMountAnimationPreventedRef = ref(isSelected.value)\n\nonMounted(() => {\n requestAnimationFrame(() => {\n isMountAnimationPreventedRef.value = false\n })\n})\n</script>\n\n<template>\n <Presence\n v-slot=\"{ present }\"\n :present=\"forceMount || isSelected\"\n force-mount\n >\n <Primitive\n :id=\"contentId\"\n :ref=\"forwardRef\"\n :as-child=\"asChild\"\n :as=\"as\"\n role=\"tabpanel\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :data-orientation=\"rootContext.orientation.value\"\n :aria-labelledby=\"triggerId\"\n :hidden=\"!present\"\n tabindex=\"0\"\n :style=\"{\n animationDuration: isMountAnimationPreventedRef ? '0s' : undefined,\n }\"\n >\n <slot v-if=\"rootContext.unmountOnHide.value ? present : true\" />\n </Primitive>\n </Presence>\n</template>\n"],"names":["useForwardExpose","injectTabsRootContext","computed","makeTriggerId","makeContentId","ref","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAEd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAIA,wCAAiB,EAAA;AACxC,IAAA,MAAM,cAAcC,mCAAsB,EAAA;AAC1C,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAMC,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAYD,aAAS,MAAME,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAaF,YAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;AAE9E,IAAM,MAAA,4BAAA,GAA+BG,OAAI,CAAA,UAAA,CAAW,KAAK,CAAA;AAEzD,IAAAC,aAAA,CAAU,MAAM;AACd,MAAA,qBAAA,CAAsB,MAAM;AAC1B,QAAA,4BAAA,CAA6B,KAAQ,GAAA,KAAA;AAAA,OACtC,CAAA;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsContent.js","sources":["../../src/Tabs/TabsContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsContentProps extends PrimitiveProps {\n /** A unique value that associates the content with a trigger. */\n value: StringOrNumber\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with Vue animation libraries.\n */\n forceMount?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Presence } from '@/Presence'\nimport { Primitive } from '@/Primitive'\nimport { computed, onMounted, ref } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = defineProps<TabsContentProps>()\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n\nconst isMountAnimationPreventedRef = ref(isSelected.value)\n\nonMounted(() => {\n requestAnimationFrame(() => {\n isMountAnimationPreventedRef.value = false\n })\n})\n</script>\n\n<template>\n <Presence\n v-slot=\"{ present }\"\n :present=\"forceMount || isSelected\"\n force-mount\n >\n <Primitive\n :id=\"contentId\"\n :ref=\"forwardRef\"\n :as-child=\"asChild\"\n :as=\"as\"\n role=\"tabpanel\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :data-orientation=\"rootContext.orientation.value\"\n :aria-labelledby=\"triggerId\"\n :hidden=\"!present\"\n tabindex=\"0\"\n :style=\"{\n animationDuration: isMountAnimationPreventedRef ? '0s' : undefined,\n }\"\n >\n <slot v-if=\"rootContext.unmountOnHide.value ? present : true\" />\n </Primitive>\n </Presence>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAEd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAI,gBAAiB,EAAA;AACxC,IAAA,MAAM,cAAc,qBAAsB,EAAA;AAC1C,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;AAE9E,IAAM,MAAA,4BAAA,GAA+B,GAAI,CAAA,UAAA,CAAW,KAAK,CAAA;AAEzD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,qBAAA,CAAsB,MAAM;AAC1B,QAAA,4BAAA,CAA6B,KAAQ,GAAA,KAAA;AAAA,OACtC,CAAA;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsContent.js","sources":["../../src/Tabs/TabsContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsContentProps extends PrimitiveProps {\n /** A unique value that associates the content with a trigger. */\n value: StringOrNumber\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with Vue animation libraries.\n */\n forceMount?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, ref } from 'vue'\nimport { Presence } from '@/Presence'\nimport { Primitive } from '@/Primitive'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = defineProps<TabsContentProps>()\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n\nconst isMountAnimationPreventedRef = ref(isSelected.value)\n\nonMounted(() => {\n requestAnimationFrame(() => {\n isMountAnimationPreventedRef.value = false\n })\n})\n</script>\n\n<template>\n <Presence\n v-slot=\"{ present }\"\n :present=\"forceMount || isSelected\"\n force-mount\n >\n <Primitive\n :id=\"contentId\"\n :ref=\"forwardRef\"\n :as-child=\"asChild\"\n :as=\"as\"\n role=\"tabpanel\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :data-orientation=\"rootContext.orientation.value\"\n :aria-labelledby=\"triggerId\"\n :hidden=\"!present\"\n tabindex=\"0\"\n :style=\"{\n animationDuration: isMountAnimationPreventedRef ? '0s' : undefined,\n }\"\n >\n <slot v-if=\"rootContext.unmountOnHide.value ? present : true\" />\n </Primitive>\n </Presence>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAEd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAI,gBAAiB,EAAA;AACxC,IAAA,MAAM,cAAc,qBAAsB,EAAA;AAC1C,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;AAE9E,IAAM,MAAA,4BAAA,GAA+B,GAAI,CAAA,UAAA,CAAW,KAAK,CAAA;AAEzD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,qBAAA,CAAsB,MAAM;AAC1B,QAAA,4BAAA,CAA6B,KAAQ,GAAA,KAAA;AAAA,OACtC,CAAA;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsIndicator.cjs","sources":["../../src/Tabs/TabsIndicator.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\nimport { nextTick, ref, watch } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nexport interface TabsIndicatorProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { useResizeObserver } from '@vueuse/core'\n\nconst props = defineProps<TabsIndicatorProps>()\nconst context = injectTabsRootContext()\nuseForwardExpose()\n\ninterface IndicatorStyle {\n size: number | null\n position: number | null\n}\nconst activeTab = ref<HTMLElement | null>()\nconst indicatorStyle = ref<IndicatorStyle>({\n size: null,\n position: null,\n})\n\nwatch(() => [context.modelValue.value, context?.dir.value], async () => {\n await nextTick()\n updateIndicatorStyle()\n}, { immediate: true })\n\nuseResizeObserver([context.tabsList, activeTab], updateIndicatorStyle)\n\nfunction updateIndicatorStyle() {\n activeTab.value = context.tabsList.value?.querySelector<HTMLButtonElement>('[role=\"tab\"][data-state=\"active\"]')\n\n if (!activeTab.value)\n return\n\n if (context.orientation.value === 'horizontal') {\n indicatorStyle.value = {\n size: activeTab.value.offsetWidth,\n position: activeTab.value.offsetLeft,\n }\n }\n else {\n indicatorStyle.value = {\n size: activeTab.value.offsetHeight,\n position: activeTab.value.offsetTop,\n }\n }\n}\n</script>\n\n<template>\n <Primitive\n v-if=\"typeof indicatorStyle.size === 'number'\"\n v-bind=\"props\"\n :style=\"{\n '--reka-tabs-indicator-size': `${indicatorStyle.size}px`,\n '--reka-tabs-indicator-position': `${indicatorStyle.position}px`,\n }\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["injectTabsRootContext","useForwardExpose","ref","watch","nextTick","useResizeObserver"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAA,MAAM,KAAQ,GAA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@/Primitive'\nimport { nextTick, ref, watch } from 'vue'\nimport { useForwardExpose } from '@/shared'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nexport interface TabsIndicatorProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { useResizeObserver } from '@vueuse/core'\nimport { Primitive } from '@/Primitive'\n\nconst props = defineProps<TabsIndicatorProps>()\nconst context = injectTabsRootContext()\nuseForwardExpose()\n\ninterface IndicatorStyle {\n size: number | null\n position: number | null\n}\nconst activeTab = ref<HTMLElement | null>()\nconst indicatorStyle = ref<IndicatorStyle>({\n size: null,\n position: null,\n})\n\nwatch(() => [context.modelValue.value, context?.dir.value], async () => {\n await nextTick()\n updateIndicatorStyle()\n}, { immediate: true })\n\nuseResizeObserver([context.tabsList, activeTab], updateIndicatorStyle)\n\nfunction updateIndicatorStyle() {\n activeTab.value = context.tabsList.value?.querySelector<HTMLButtonElement>('[role=\"tab\"][data-state=\"active\"]')\n\n if (!activeTab.value)\n return\n\n if (context.orientation.value === 'horizontal') {\n indicatorStyle.value = {\n size: activeTab.value.offsetWidth,\n position: activeTab.value.offsetLeft,\n }\n }\n else {\n indicatorStyle.value = {\n size: activeTab.value.offsetHeight,\n position: activeTab.value.offsetTop,\n }\n }\n}\n</script>\n\n<template>\n <Primitive\n v-if=\"typeof indicatorStyle.size === 'number'\"\n v-bind=\"props\"\n :style=\"{\n '--reka-tabs-indicator-size': `${indicatorStyle.size}px`,\n '--reka-tabs-indicator-position': `${indicatorStyle.position}px`,\n }\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["injectTabsRootContext","useForwardExpose","ref","watch","nextTick","useResizeObserver"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,UAAUA,mCAAsB,EAAA;AACtC,IAAiBC,wCAAA,EAAA;AAMjB,IAAA,MAAM,YAAYC,OAAwB,EAAA;AAC1C,IAAA,MAAM,iBAAiBA,OAAoB,CAAA;AAAA,MACzC,IAAM,EAAA,IAAA;AAAA,MACN,QAAU,EAAA;AAAA,KACX,CAAA;AAED,IAAMC,SAAA,CAAA,MAAM,CAAC,OAAQ,CAAA,UAAA,CAAW,OAAO,OAAS,EAAA,GAAA,CAAI,KAAK,CAAA,EAAG,YAAY;AACtE,MAAA,MAAMC,YAAS,EAAA;AACf,MAAqB,oBAAA,EAAA;AAAA,KACpB,EAAA,EAAE,SAAW,EAAA,IAAA,EAAM,CAAA;AAEtB,IAAAC,sBAAA,CAAkB,CAAC,OAAA,CAAQ,QAAU,EAAA,SAAS,GAAG,oBAAoB,CAAA;AAErE,IAAA,SAAS,oBAAuB,GAAA;AAC9B,MAAA,SAAA,CAAU,KAAQ,GAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,EAAO,cAAiC,mCAAmC,CAAA;AAE9G,MAAA,IAAI,CAAC,SAAU,CAAA,KAAA;AACb,QAAA;AAEF,MAAI,IAAA,OAAA,CAAQ,WAAY,CAAA,KAAA,KAAU,YAAc,EAAA;AAC9C,QAAA,cAAA,CAAe,KAAQ,GAAA;AAAA,UACrB,IAAA,EAAM,UAAU,KAAM,CAAA,WAAA;AAAA,UACtB,QAAA,EAAU,UAAU,KAAM,CAAA;AAAA,SAC5B;AAAA,OAEG,MAAA;AACH,QAAA,cAAA,CAAe,KAAQ,GAAA;AAAA,UACrB,IAAA,EAAM,UAAU,KAAM,CAAA,YAAA;AAAA,UACtB,QAAA,EAAU,UAAU,KAAM,CAAA;AAAA,SAC5B;AAAA;AACF;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsIndicator.js","sources":["../../src/Tabs/TabsIndicator.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\nimport { nextTick, ref, watch } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nexport interface TabsIndicatorProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { useResizeObserver } from '@vueuse/core'\n\nconst props = defineProps<TabsIndicatorProps>()\nconst context = injectTabsRootContext()\nuseForwardExpose()\n\ninterface IndicatorStyle {\n size: number | null\n position: number | null\n}\nconst activeTab = ref<HTMLElement | null>()\nconst indicatorStyle = ref<IndicatorStyle>({\n size: null,\n position: null,\n})\n\nwatch(() => [context.modelValue.value, context?.dir.value], async () => {\n await nextTick()\n updateIndicatorStyle()\n}, { immediate: true })\n\nuseResizeObserver([context.tabsList, activeTab], updateIndicatorStyle)\n\nfunction updateIndicatorStyle() {\n activeTab.value = context.tabsList.value?.querySelector<HTMLButtonElement>('[role=\"tab\"][data-state=\"active\"]')\n\n if (!activeTab.value)\n return\n\n if (context.orientation.value === 'horizontal') {\n indicatorStyle.value = {\n size: activeTab.value.offsetWidth,\n position: activeTab.value.offsetLeft,\n }\n }\n else {\n indicatorStyle.value = {\n size: activeTab.value.offsetHeight,\n position: activeTab.value.offsetTop,\n }\n }\n}\n</script>\n\n<template>\n <Primitive\n v-if=\"typeof indicatorStyle.size === 'number'\"\n v-bind=\"props\"\n :style=\"{\n '--reka-tabs-indicator-size': `${indicatorStyle.size}px`,\n '--reka-tabs-indicator-position': `${indicatorStyle.position}px`,\n }\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaA,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,UAAU,qBAAsB,EAAA;AACtC,IAAiB,gBAAA,EAAA;AAMjB,IAAA,MAAM,YAAY,GAAwB,EAAA;AAC1C,IAAA,MAAM,iBAAiB,GAAoB,CAAA;AAAA,MACzC,IAAM,EAAA,IAAA;AAAA,MACN,QAAU,EAAA;AAAA,KACX,CAAA;AAED,IAAM,KAAA,CAAA,MAAM,CAAC,OAAQ,CAAA,UAAA,CAAW,OAAO,OAAS,EAAA,GAAA,CAAI,KAAK,CAAA,EAAG,YAAY;AACtE,MAAA,MAAM,QAAS,EAAA;AACf,MAAqB,oBAAA,EAAA;AAAA,KACpB,EAAA,EAAE,SAAW,EAAA,IAAA,EAAM,CAAA;AAEtB,IAAA,iBAAA,CAAkB,CAAC,OAAA,CAAQ,QAAU,EAAA,SAAS,GAAG,oBAAoB,CAAA;AAErE,IAAA,SAAS,oBAAuB,GAAA;AAC9B,MAAA,SAAA,CAAU,KAAQ,GAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,EAAO,cAAiC,mCAAmC,CAAA;AAE9G,MAAA,IAAI,CAAC,SAAU,CAAA,KAAA;AACb,QAAA;AAEF,MAAI,IAAA,OAAA,CAAQ,WAAY,CAAA,KAAA,KAAU,YAAc,EAAA;AAC9C,QAAA,cAAA,CAAe,KAAQ,GAAA;AAAA,UACrB,IAAA,EAAM,UAAU,KAAM,CAAA,WAAA;AAAA,UACtB,QAAA,EAAU,UAAU,KAAM,CAAA;AAAA,SAC5B;AAAA,OAEG,MAAA;AACH,QAAA,cAAA,CAAe,KAAQ,GAAA;AAAA,UACrB,IAAA,EAAM,UAAU,KAAM,CAAA,YAAA;AAAA,UACtB,QAAA,EAAU,UAAU,KAAM,CAAA;AAAA,SAC5B;AAAA;AACF;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsIndicator.js","sources":["../../src/Tabs/TabsIndicator.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { nextTick, ref, watch } from 'vue'\nimport { useForwardExpose } from '@/shared'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nexport interface TabsIndicatorProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { useResizeObserver } from '@vueuse/core'\nimport { Primitive } from '@/Primitive'\n\nconst props = defineProps<TabsIndicatorProps>()\nconst context = injectTabsRootContext()\nuseForwardExpose()\n\ninterface IndicatorStyle {\n size: number | null\n position: number | null\n}\nconst activeTab = ref<HTMLElement | null>()\nconst indicatorStyle = ref<IndicatorStyle>({\n size: null,\n position: null,\n})\n\nwatch(() => [context.modelValue.value, context?.dir.value], async () => {\n await nextTick()\n updateIndicatorStyle()\n}, { immediate: true })\n\nuseResizeObserver([context.tabsList, activeTab], updateIndicatorStyle)\n\nfunction updateIndicatorStyle() {\n activeTab.value = context.tabsList.value?.querySelector<HTMLButtonElement>('[role=\"tab\"][data-state=\"active\"]')\n\n if (!activeTab.value)\n return\n\n if (context.orientation.value === 'horizontal') {\n indicatorStyle.value = {\n size: activeTab.value.offsetWidth,\n position: activeTab.value.offsetLeft,\n }\n }\n else {\n indicatorStyle.value = {\n size: activeTab.value.offsetHeight,\n position: activeTab.value.offsetTop,\n }\n }\n}\n</script>\n\n<template>\n <Primitive\n v-if=\"typeof indicatorStyle.size === 'number'\"\n v-bind=\"props\"\n :style=\"{\n '--reka-tabs-indicator-size': `${indicatorStyle.size}px`,\n '--reka-tabs-indicator-position': `${indicatorStyle.position}px`,\n }\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaA,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,UAAU,qBAAsB,EAAA;AACtC,IAAiB,gBAAA,EAAA;AAMjB,IAAA,MAAM,YAAY,GAAwB,EAAA;AAC1C,IAAA,MAAM,iBAAiB,GAAoB,CAAA;AAAA,MACzC,IAAM,EAAA,IAAA;AAAA,MACN,QAAU,EAAA;AAAA,KACX,CAAA;AAED,IAAM,KAAA,CAAA,MAAM,CAAC,OAAQ,CAAA,UAAA,CAAW,OAAO,OAAS,EAAA,GAAA,CAAI,KAAK,CAAA,EAAG,YAAY;AACtE,MAAA,MAAM,QAAS,EAAA;AACf,MAAqB,oBAAA,EAAA;AAAA,KACpB,EAAA,EAAE,SAAW,EAAA,IAAA,EAAM,CAAA;AAEtB,IAAA,iBAAA,CAAkB,CAAC,OAAA,CAAQ,QAAU,EAAA,SAAS,GAAG,oBAAoB,CAAA;AAErE,IAAA,SAAS,oBAAuB,GAAA;AAC9B,MAAA,SAAA,CAAU,KAAQ,GAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,EAAO,cAAiC,mCAAmC,CAAA;AAE9G,MAAA,IAAI,CAAC,SAAU,CAAA,KAAA;AACb,QAAA;AAEF,MAAI,IAAA,OAAA,CAAQ,WAAY,CAAA,KAAA,KAAU,YAAc,EAAA;AAC9C,QAAA,cAAA,CAAe,KAAQ,GAAA;AAAA,UACrB,IAAA,EAAM,UAAU,KAAM,CAAA,WAAA;AAAA,UACtB,QAAA,EAAU,UAAU,KAAM,CAAA;AAAA,SAC5B;AAAA,OAEG,MAAA;AACH,QAAA,cAAA,CAAe,KAAQ,GAAA;AAAA,UACrB,IAAA,EAAM,UAAU,KAAM,CAAA,YAAA;AAAA,UACtB,QAAA,EAAU,UAAU,KAAM,CAAA;AAAA,SAC5B;AAAA;AACF;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsList.cjs","sources":["../../src/Tabs/TabsList.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsListProps extends PrimitiveProps {\n /** When `true`, keyboard navigation will loop from last tab to first, and vice versa. */\n loop?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusGroup } from '@/RovingFocus'\nimport { toRefs } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nconst props = withDefaults(defineProps<TabsListProps>(), {\n loop: true,\n})\nconst { loop } = toRefs(props)\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst context = injectTabsRootContext()\n\ncontext.tabsList = currentElement\n</script>\n\n<template>\n <RovingFocusGroup\n as-child\n :orientation=\"context.orientation.value\"\n :dir=\"context.dir.value\"\n :loop=\"loop\"\n >\n <Primitive\n :ref=\"forwardRef\"\n role=\"tablist\"\n :as-child=\"asChild\"\n :as=\"as\"\n :aria-orientation=\"context.orientation.value\"\n >\n <slot />\n </Primitive>\n </RovingFocusGroup>\n</template>\n"],"names":["toRefs","useForwardExpose","injectTabsRootContext"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAGd,IAAA,MAAM,EAAE,IAAA,EAAS,GAAAA,UAAA,CAAO,KAAK,CAAA;AAE7B,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AACxD,IAAA,MAAM,UAAUC,mCAAsB,EAAA;AAEtC,IAAA,OAAA,CAAQ,QAAW,GAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsList.cjs","sources":["../../src/Tabs/TabsList.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsListProps extends PrimitiveProps {\n /** When `true`, keyboard navigation will loop from last tab to first, and vice versa. */\n loop?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { toRefs } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusGroup } from '@/RovingFocus'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nconst props = withDefaults(defineProps<TabsListProps>(), {\n loop: true,\n})\nconst { loop } = toRefs(props)\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst context = injectTabsRootContext()\n\ncontext.tabsList = currentElement\n</script>\n\n<template>\n <RovingFocusGroup\n as-child\n :orientation=\"context.orientation.value\"\n :dir=\"context.dir.value\"\n :loop=\"loop\"\n >\n <Primitive\n :ref=\"forwardRef\"\n role=\"tablist\"\n :as-child=\"asChild\"\n :as=\"as\"\n :aria-orientation=\"context.orientation.value\"\n >\n <slot />\n </Primitive>\n </RovingFocusGroup>\n</template>\n"],"names":["toRefs","useForwardExpose","injectTabsRootContext"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAGd,IAAA,MAAM,EAAE,IAAA,EAAS,GAAAA,UAAA,CAAO,KAAK,CAAA;AAE7B,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AACxD,IAAA,MAAM,UAAUC,mCAAsB,EAAA;AAEtC,IAAA,OAAA,CAAQ,QAAW,GAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsList.js","sources":["../../src/Tabs/TabsList.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsListProps extends PrimitiveProps {\n /** When `true`, keyboard navigation will loop from last tab to first, and vice versa. */\n loop?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusGroup } from '@/RovingFocus'\nimport { toRefs } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nconst props = withDefaults(defineProps<TabsListProps>(), {\n loop: true,\n})\nconst { loop } = toRefs(props)\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst context = injectTabsRootContext()\n\ncontext.tabsList = currentElement\n</script>\n\n<template>\n <RovingFocusGroup\n as-child\n :orientation=\"context.orientation.value\"\n :dir=\"context.dir.value\"\n :loop=\"loop\"\n >\n <Primitive\n :ref=\"forwardRef\"\n role=\"tablist\"\n :as-child=\"asChild\"\n :as=\"as\"\n :aria-orientation=\"context.orientation.value\"\n >\n <slot />\n </Primitive>\n </RovingFocusGroup>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAGd,IAAA,MAAM,EAAE,IAAA,EAAS,GAAA,MAAA,CAAO,KAAK,CAAA;AAE7B,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AACxD,IAAA,MAAM,UAAU,qBAAsB,EAAA;AAEtC,IAAA,OAAA,CAAQ,QAAW,GAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsList.js","sources":["../../src/Tabs/TabsList.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsListProps extends PrimitiveProps {\n /** When `true`, keyboard navigation will loop from last tab to first, and vice versa. */\n loop?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { toRefs } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusGroup } from '@/RovingFocus'\nimport { injectTabsRootContext } from './TabsRoot.vue'\n\nconst props = withDefaults(defineProps<TabsListProps>(), {\n loop: true,\n})\nconst { loop } = toRefs(props)\n\nconst { forwardRef, currentElement } = useForwardExpose()\nconst context = injectTabsRootContext()\n\ncontext.tabsList = currentElement\n</script>\n\n<template>\n <RovingFocusGroup\n as-child\n :orientation=\"context.orientation.value\"\n :dir=\"context.dir.value\"\n :loop=\"loop\"\n >\n <Primitive\n :ref=\"forwardRef\"\n role=\"tablist\"\n :as-child=\"asChild\"\n :as=\"as\"\n :aria-orientation=\"context.orientation.value\"\n >\n <slot />\n </Primitive>\n </RovingFocusGroup>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAGd,IAAA,MAAM,EAAE,IAAA,EAAS,GAAA,MAAA,CAAO,KAAK,CAAA;AAE7B,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AACxD,IAAA,MAAM,UAAU,qBAAsB,EAAA;AAEtC,IAAA,OAAA,CAAQ,QAAW,GAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsRoot.cjs","sources":["../../src/Tabs/TabsRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { Ref } from 'vue'\nimport type { DataOrientation, Direction, StringOrNumber } from '../shared/types'\nimport { createContext, useDirection, useForwardExpose, useId } from '@/shared'\nimport { useVModel } from '@vueuse/core'\n\nexport interface TabsRootContext {\n modelValue: Ref<StringOrNumber | undefined>\n changeModelValue: (value: StringOrNumber) => void\n orientation: Ref<DataOrientation>\n dir: Ref<Direction>\n unmountOnHide: Ref<boolean>\n activationMode: 'automatic' | 'manual'\n baseId: string\n tabsList: Ref<HTMLElement | undefined>\n}\n\nexport interface TabsRootProps<T extends StringOrNumber = StringOrNumber> extends PrimitiveProps {\n /**\n * The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs\n */\n defaultValue?: T\n /**\n * The orientation the tabs are laid out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: DataOrientation\n /**\n * The reading direction of the combobox when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode.\n */\n dir?: Direction\n /**\n * Whether a tab is activated automatically (on focus) or manually (on click).\n * @defaultValue automatic\n */\n activationMode?: 'automatic' | 'manual'\n /** The controlled value of the tab to activate. Can be bind as `v-model`. */\n modelValue?: T\n /**\n * When `true`, the element will be unmounted on closed state.\n *\n * @defaultValue `true`\n */\n unmountOnHide?: boolean\n}\nexport type TabsRootEmits<T extends StringOrNumber = StringOrNumber> = {\n /** Event handler called when the value changes */\n 'update:modelValue': [payload: T]\n}\n\nexport const [injectTabsRootContext, provideTabsRootContext]\n = createContext<TabsRootContext>('TabsRoot')\n</script>\n\n<script setup lang=\"ts\" generic=\"T extends StringOrNumber = StringOrNumber\">\nimport { Primitive } from '@/Primitive'\nimport { ref, toRefs } from 'vue'\n\nconst props = withDefaults(defineProps<TabsRootProps<T>>(), {\n orientation: 'horizontal',\n activationMode: 'automatic',\n unmountOnHide: true,\n})\nconst emits = defineEmits<TabsRootEmits<T>>()\n\ndefineSlots<{\n default: (props: {\n /** Current input values */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { orientation, unmountOnHide, dir: propDir } = toRefs(props)\nconst dir = useDirection(propDir)\nuseForwardExpose()\n\nconst modelValue = useVModel<TabsRootProps<T>, 'modelValue', 'update:modelValue'>(props, 'modelValue', emits, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n})\n\nconst tabsList = ref<HTMLElement>()\n\nprovideTabsRootContext({\n modelValue,\n changeModelValue: (value: StringOrNumber) => {\n modelValue.value = value as T\n },\n orientation,\n dir,\n unmountOnHide,\n activationMode: props.activationMode,\n baseId: useId(undefined, 'reka-tabs'),\n tabsList,\n})\n</script>\n\n<template>\n <Primitive\n :dir=\"dir\"\n :data-orientation=\"orientation\"\n :as-child=\"asChild\"\n :as=\"as\"\n >\n <slot :model-value=\"modelValue\" />\n </Primitive>\n</template>\n"],"names":["createContext","toRefs","useDirection","useForwardExpose","useVModel","ref","useId"],"mappings":";;;;;;;;;;AAoDO,MAAM,CAAC,qBAAA,EAAuB,sBAAsB,CAAA,GACvDA,mCAA+B,UAAU;;;;;;;;;;;;;;;AAO7C,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,KAAQ,GAAA,MAAA;AASd,IAAA,MAAM,EAAE,WAAa,EAAA,aAAA,EAAe,KAAK,OAAQ,EAAA,GAAIC,WAAO,KAAK,CAAA;AACjE,IAAM,MAAA,GAAA,GAAMC,iCAAa,OAAO,CAAA;AAChC,IAAiBC,wCAAA,EAAA;AAEjB,IAAA,MAAM,UAAa,GAAAC,cAAA,CAA+D,KAAO,EAAA,YAAA,EAAc,KAAO,EAAA;AAAA,MAC5G,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,MAAM,WAAWC,OAAiB,EAAA;AAElC,IAAuB,sBAAA,CAAA;AAAA,MACrB,UAAA;AAAA,MACA,gBAAA,EAAkB,CAAC,KAA0B,KAAA;AAC3C,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA;AAAA,OACrB;AAAA,MACA,WAAA;AAAA,MACA,GAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAgB,KAAM,CAAA,cAAA;AAAA,MACtB,MAAA,EAAQC,kBAAM,CAAA,MAAA,EAAW,WAAW,CAAA;AAAA,MACpC;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsRoot.cjs","sources":["../../src/Tabs/TabsRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { DataOrientation, Direction, StringOrNumber } from '../shared/types'\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useVModel } from '@vueuse/core'\nimport { createContext, useDirection, useForwardExpose, useId } from '@/shared'\n\nexport interface TabsRootContext {\n modelValue: Ref<StringOrNumber | undefined>\n changeModelValue: (value: StringOrNumber) => void\n orientation: Ref<DataOrientation>\n dir: Ref<Direction>\n unmountOnHide: Ref<boolean>\n activationMode: 'automatic' | 'manual'\n baseId: string\n tabsList: Ref<HTMLElement | undefined>\n}\n\nexport interface TabsRootProps<T extends StringOrNumber = StringOrNumber> extends PrimitiveProps {\n /**\n * The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs\n */\n defaultValue?: T\n /**\n * The orientation the tabs are laid out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: DataOrientation\n /**\n * The reading direction of the combobox when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode.\n */\n dir?: Direction\n /**\n * Whether a tab is activated automatically (on focus) or manually (on click).\n * @defaultValue automatic\n */\n activationMode?: 'automatic' | 'manual'\n /** The controlled value of the tab to activate. Can be bind as `v-model`. */\n modelValue?: T\n /**\n * When `true`, the element will be unmounted on closed state.\n *\n * @defaultValue `true`\n */\n unmountOnHide?: boolean\n}\nexport type TabsRootEmits<T extends StringOrNumber = StringOrNumber> = {\n /** Event handler called when the value changes */\n 'update:modelValue': [payload: T]\n}\n\nexport const [injectTabsRootContext, provideTabsRootContext]\n = createContext<TabsRootContext>('TabsRoot')\n</script>\n\n<script setup lang=\"ts\" generic=\"T extends StringOrNumber = StringOrNumber\">\nimport { ref, toRefs } from 'vue'\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<TabsRootProps<T>>(), {\n orientation: 'horizontal',\n activationMode: 'automatic',\n unmountOnHide: true,\n})\nconst emits = defineEmits<TabsRootEmits<T>>()\n\ndefineSlots<{\n default?: (props: {\n /** Current input values */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { orientation, unmountOnHide, dir: propDir } = toRefs(props)\nconst dir = useDirection(propDir)\nuseForwardExpose()\n\nconst modelValue = useVModel<TabsRootProps<T>, 'modelValue', 'update:modelValue'>(props, 'modelValue', emits, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n})\n\nconst tabsList = ref<HTMLElement>()\n\nprovideTabsRootContext({\n modelValue,\n changeModelValue: (value: StringOrNumber) => {\n modelValue.value = value as T\n },\n orientation,\n dir,\n unmountOnHide,\n activationMode: props.activationMode,\n baseId: useId(undefined, 'reka-tabs'),\n tabsList,\n})\n</script>\n\n<template>\n <Primitive\n :dir=\"dir\"\n :data-orientation=\"orientation\"\n :as-child=\"asChild\"\n :as=\"as\"\n >\n <slot :model-value=\"modelValue\" />\n </Primitive>\n</template>\n"],"names":["createContext","toRefs","useDirection","useForwardExpose","useVModel","ref","useId"],"mappings":";;;;;;;;;;AAoDO,MAAM,CAAC,qBAAA,EAAuB,sBAAsB,CAAA,GACvDA,mCAA+B,UAAU;;;;;;;;;;;;;;;AAO7C,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,KAAQ,GAAA,MAAA;AASd,IAAA,MAAM,EAAE,WAAa,EAAA,aAAA,EAAe,KAAK,OAAQ,EAAA,GAAIC,WAAO,KAAK,CAAA;AACjE,IAAM,MAAA,GAAA,GAAMC,iCAAa,OAAO,CAAA;AAChC,IAAiBC,wCAAA,EAAA;AAEjB,IAAA,MAAM,UAAa,GAAAC,cAAA,CAA+D,KAAO,EAAA,YAAA,EAAc,KAAO,EAAA;AAAA,MAC5G,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,MAAM,WAAWC,OAAiB,EAAA;AAElC,IAAuB,sBAAA,CAAA;AAAA,MACrB,UAAA;AAAA,MACA,gBAAA,EAAkB,CAAC,KAA0B,KAAA;AAC3C,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA;AAAA,OACrB;AAAA,MACA,WAAA;AAAA,MACA,GAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAgB,KAAM,CAAA,cAAA;AAAA,MACtB,MAAA,EAAQC,kBAAM,CAAA,MAAA,EAAW,WAAW,CAAA;AAAA,MACpC;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsRoot.js","sources":["../../src/Tabs/TabsRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { Ref } from 'vue'\nimport type { DataOrientation, Direction, StringOrNumber } from '../shared/types'\nimport { createContext, useDirection, useForwardExpose, useId } from '@/shared'\nimport { useVModel } from '@vueuse/core'\n\nexport interface TabsRootContext {\n modelValue: Ref<StringOrNumber | undefined>\n changeModelValue: (value: StringOrNumber) => void\n orientation: Ref<DataOrientation>\n dir: Ref<Direction>\n unmountOnHide: Ref<boolean>\n activationMode: 'automatic' | 'manual'\n baseId: string\n tabsList: Ref<HTMLElement | undefined>\n}\n\nexport interface TabsRootProps<T extends StringOrNumber = StringOrNumber> extends PrimitiveProps {\n /**\n * The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs\n */\n defaultValue?: T\n /**\n * The orientation the tabs are laid out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: DataOrientation\n /**\n * The reading direction of the combobox when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode.\n */\n dir?: Direction\n /**\n * Whether a tab is activated automatically (on focus) or manually (on click).\n * @defaultValue automatic\n */\n activationMode?: 'automatic' | 'manual'\n /** The controlled value of the tab to activate. Can be bind as `v-model`. */\n modelValue?: T\n /**\n * When `true`, the element will be unmounted on closed state.\n *\n * @defaultValue `true`\n */\n unmountOnHide?: boolean\n}\nexport type TabsRootEmits<T extends StringOrNumber = StringOrNumber> = {\n /** Event handler called when the value changes */\n 'update:modelValue': [payload: T]\n}\n\nexport const [injectTabsRootContext, provideTabsRootContext]\n = createContext<TabsRootContext>('TabsRoot')\n</script>\n\n<script setup lang=\"ts\" generic=\"T extends StringOrNumber = StringOrNumber\">\nimport { Primitive } from '@/Primitive'\nimport { ref, toRefs } from 'vue'\n\nconst props = withDefaults(defineProps<TabsRootProps<T>>(), {\n orientation: 'horizontal',\n activationMode: 'automatic',\n unmountOnHide: true,\n})\nconst emits = defineEmits<TabsRootEmits<T>>()\n\ndefineSlots<{\n default: (props: {\n /** Current input values */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { orientation, unmountOnHide, dir: propDir } = toRefs(props)\nconst dir = useDirection(propDir)\nuseForwardExpose()\n\nconst modelValue = useVModel<TabsRootProps<T>, 'modelValue', 'update:modelValue'>(props, 'modelValue', emits, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n})\n\nconst tabsList = ref<HTMLElement>()\n\nprovideTabsRootContext({\n modelValue,\n changeModelValue: (value: StringOrNumber) => {\n modelValue.value = value as T\n },\n orientation,\n dir,\n unmountOnHide,\n activationMode: props.activationMode,\n baseId: useId(undefined, 'reka-tabs'),\n tabsList,\n})\n</script>\n\n<template>\n <Primitive\n :dir=\"dir\"\n :data-orientation=\"orientation\"\n :as-child=\"asChild\"\n :as=\"as\"\n >\n <slot :model-value=\"modelValue\" />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;AAoDO,MAAM,CAAC,qBAAA,EAAuB,sBAAsB,CAAA,GACvD,cAA+B,UAAU;;;;;;;;;;;;;;;AAO7C,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,KAAQ,GAAA,MAAA;AASd,IAAA,MAAM,EAAE,WAAa,EAAA,aAAA,EAAe,KAAK,OAAQ,EAAA,GAAI,OAAO,KAAK,CAAA;AACjE,IAAM,MAAA,GAAA,GAAM,aAAa,OAAO,CAAA;AAChC,IAAiB,gBAAA,EAAA;AAEjB,IAAA,MAAM,UAAa,GAAA,SAAA,CAA+D,KAAO,EAAA,YAAA,EAAc,KAAO,EAAA;AAAA,MAC5G,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,MAAM,WAAW,GAAiB,EAAA;AAElC,IAAuB,sBAAA,CAAA;AAAA,MACrB,UAAA;AAAA,MACA,gBAAA,EAAkB,CAAC,KAA0B,KAAA;AAC3C,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA;AAAA,OACrB;AAAA,MACA,WAAA;AAAA,MACA,GAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAgB,KAAM,CAAA,cAAA;AAAA,MACtB,MAAA,EAAQ,KAAM,CAAA,MAAA,EAAW,WAAW,CAAA;AAAA,MACpC;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsRoot.js","sources":["../../src/Tabs/TabsRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { DataOrientation, Direction, StringOrNumber } from '../shared/types'\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useVModel } from '@vueuse/core'\nimport { createContext, useDirection, useForwardExpose, useId } from '@/shared'\n\nexport interface TabsRootContext {\n modelValue: Ref<StringOrNumber | undefined>\n changeModelValue: (value: StringOrNumber) => void\n orientation: Ref<DataOrientation>\n dir: Ref<Direction>\n unmountOnHide: Ref<boolean>\n activationMode: 'automatic' | 'manual'\n baseId: string\n tabsList: Ref<HTMLElement | undefined>\n}\n\nexport interface TabsRootProps<T extends StringOrNumber = StringOrNumber> extends PrimitiveProps {\n /**\n * The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs\n */\n defaultValue?: T\n /**\n * The orientation the tabs are laid out.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n * @defaultValue horizontal\n */\n orientation?: DataOrientation\n /**\n * The reading direction of the combobox when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode.\n */\n dir?: Direction\n /**\n * Whether a tab is activated automatically (on focus) or manually (on click).\n * @defaultValue automatic\n */\n activationMode?: 'automatic' | 'manual'\n /** The controlled value of the tab to activate. Can be bind as `v-model`. */\n modelValue?: T\n /**\n * When `true`, the element will be unmounted on closed state.\n *\n * @defaultValue `true`\n */\n unmountOnHide?: boolean\n}\nexport type TabsRootEmits<T extends StringOrNumber = StringOrNumber> = {\n /** Event handler called when the value changes */\n 'update:modelValue': [payload: T]\n}\n\nexport const [injectTabsRootContext, provideTabsRootContext]\n = createContext<TabsRootContext>('TabsRoot')\n</script>\n\n<script setup lang=\"ts\" generic=\"T extends StringOrNumber = StringOrNumber\">\nimport { ref, toRefs } from 'vue'\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<TabsRootProps<T>>(), {\n orientation: 'horizontal',\n activationMode: 'automatic',\n unmountOnHide: true,\n})\nconst emits = defineEmits<TabsRootEmits<T>>()\n\ndefineSlots<{\n default?: (props: {\n /** Current input values */\n modelValue: typeof modelValue.value\n }) => any\n}>()\n\nconst { orientation, unmountOnHide, dir: propDir } = toRefs(props)\nconst dir = useDirection(propDir)\nuseForwardExpose()\n\nconst modelValue = useVModel<TabsRootProps<T>, 'modelValue', 'update:modelValue'>(props, 'modelValue', emits, {\n defaultValue: props.defaultValue,\n passive: (props.modelValue === undefined) as false,\n})\n\nconst tabsList = ref<HTMLElement>()\n\nprovideTabsRootContext({\n modelValue,\n changeModelValue: (value: StringOrNumber) => {\n modelValue.value = value as T\n },\n orientation,\n dir,\n unmountOnHide,\n activationMode: props.activationMode,\n baseId: useId(undefined, 'reka-tabs'),\n tabsList,\n})\n</script>\n\n<template>\n <Primitive\n :dir=\"dir\"\n :data-orientation=\"orientation\"\n :as-child=\"asChild\"\n :as=\"as\"\n >\n <slot :model-value=\"modelValue\" />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;AAoDO,MAAM,CAAC,qBAAA,EAAuB,sBAAsB,CAAA,GACvD,cAA+B,UAAU;;;;;;;;;;;;;;;AAO7C,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAA,MAAM,KAAQ,GAAA,MAAA;AASd,IAAA,MAAM,EAAE,WAAa,EAAA,aAAA,EAAe,KAAK,OAAQ,EAAA,GAAI,OAAO,KAAK,CAAA;AACjE,IAAM,MAAA,GAAA,GAAM,aAAa,OAAO,CAAA;AAChC,IAAiB,gBAAA,EAAA;AAEjB,IAAA,MAAM,UAAa,GAAA,SAAA,CAA+D,KAAO,EAAA,YAAA,EAAc,KAAO,EAAA;AAAA,MAC5G,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,OAAA,EAAU,MAAM,UAAe,KAAA;AAAA,KAChC,CAAA;AAED,IAAA,MAAM,WAAW,GAAiB,EAAA;AAElC,IAAuB,sBAAA,CAAA;AAAA,MACrB,UAAA;AAAA,MACA,gBAAA,EAAkB,CAAC,KAA0B,KAAA;AAC3C,QAAA,UAAA,CAAW,KAAQ,GAAA,KAAA;AAAA,OACrB;AAAA,MACA,WAAA;AAAA,MACA,GAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAgB,KAAM,CAAA,cAAA;AAAA,MACtB,MAAA,EAAQ,KAAM,CAAA,MAAA,EAAW,WAAW,CAAA;AAAA,MACpC;AAAA,KACD,CAAA;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsTrigger.cjs","sources":["../../src/Tabs/TabsTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsTriggerProps extends PrimitiveProps {\n /** A unique value that associates the trigger with a content. */\n value: StringOrNumber\n /** When `true`, prevents the user from interacting with the tab. */\n disabled?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusItem } from '@/RovingFocus'\nimport { computed } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = withDefaults(defineProps<TabsTriggerProps>(), {\n disabled: false,\n as: 'button',\n})\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\n\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n</script>\n\n<template>\n <RovingFocusItem\n as-child\n :focusable=\"!disabled\"\n :active=\"isSelected\"\n >\n <Primitive\n :id=\"triggerId\"\n :ref=\"forwardRef\"\n role=\"tab\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-selected=\"isSelected ? 'true' : 'false'\"\n :aria-controls=\"contentId\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :disabled=\"disabled\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n @mousedown.left=\"(event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.ctrlKey === false) {\n rootContext.changeModelValue(value);\n }\n else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\"\n @keydown.enter.space=\"rootContext.changeModelValue(value)\"\n @focus=\"() => {\n // handle 'automatic' activation if necessary\n // ie. activate tab following focus\n const isAutomaticActivation = rootContext.activationMode !== 'manual';\n if (!isSelected && !disabled && isAutomaticActivation) {\n rootContext.changeModelValue(value);\n }\n }\"\n >\n <slot />\n </Primitive>\n </RovingFocusItem>\n</template>\n"],"names":["useForwardExpose","injectTabsRootContext","computed","makeTriggerId","makeContentId"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAIA,wCAAiB,EAAA;AACxC,IAAA,MAAM,cAAcC,mCAAsB,EAAA;AAE1C,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAMC,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAYD,aAAS,MAAME,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAaF,YAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsTrigger.cjs","sources":["../../src/Tabs/TabsTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsTriggerProps extends PrimitiveProps {\n /** A unique value that associates the trigger with a content. */\n value: StringOrNumber\n /** When `true`, prevents the user from interacting with the tab. */\n disabled?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusItem } from '@/RovingFocus'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = withDefaults(defineProps<TabsTriggerProps>(), {\n disabled: false,\n as: 'button',\n})\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\n\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n</script>\n\n<template>\n <RovingFocusItem\n as-child\n :focusable=\"!disabled\"\n :active=\"isSelected\"\n >\n <Primitive\n :id=\"triggerId\"\n :ref=\"forwardRef\"\n role=\"tab\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-selected=\"isSelected ? 'true' : 'false'\"\n :aria-controls=\"contentId\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :disabled=\"disabled\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n @mousedown.left=\"(event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.ctrlKey === false) {\n rootContext.changeModelValue(value);\n }\n else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\"\n @keydown.enter.space=\"rootContext.changeModelValue(value)\"\n @focus=\"() => {\n // handle 'automatic' activation if necessary\n // ie. activate tab following focus\n const isAutomaticActivation = rootContext.activationMode !== 'manual';\n if (!isSelected && !disabled && isAutomaticActivation) {\n rootContext.changeModelValue(value);\n }\n }\"\n >\n <slot />\n </Primitive>\n </RovingFocusItem>\n</template>\n"],"names":["useForwardExpose","injectTabsRootContext","computed","makeTriggerId","makeContentId"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAIA,wCAAiB,EAAA;AACxC,IAAA,MAAM,cAAcC,mCAAsB,EAAA;AAE1C,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAMC,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAYD,aAAS,MAAME,wBAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAaF,YAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsTrigger.js","sources":["../../src/Tabs/TabsTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsTriggerProps extends PrimitiveProps {\n /** A unique value that associates the trigger with a content. */\n value: StringOrNumber\n /** When `true`, prevents the user from interacting with the tab. */\n disabled?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusItem } from '@/RovingFocus'\nimport { computed } from 'vue'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = withDefaults(defineProps<TabsTriggerProps>(), {\n disabled: false,\n as: 'button',\n})\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\n\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n</script>\n\n<template>\n <RovingFocusItem\n as-child\n :focusable=\"!disabled\"\n :active=\"isSelected\"\n >\n <Primitive\n :id=\"triggerId\"\n :ref=\"forwardRef\"\n role=\"tab\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-selected=\"isSelected ? 'true' : 'false'\"\n :aria-controls=\"contentId\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :disabled=\"disabled\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n @mousedown.left=\"(event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.ctrlKey === false) {\n rootContext.changeModelValue(value);\n }\n else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\"\n @keydown.enter.space=\"rootContext.changeModelValue(value)\"\n @focus=\"() => {\n // handle 'automatic' activation if necessary\n // ie. activate tab following focus\n const isAutomaticActivation = rootContext.activationMode !== 'manual';\n if (!isSelected && !disabled && isAutomaticActivation) {\n rootContext.changeModelValue(value);\n }\n }\"\n >\n <slot />\n </Primitive>\n </RovingFocusItem>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAI,gBAAiB,EAAA;AACxC,IAAA,MAAM,cAAc,qBAAsB,EAAA;AAE1C,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TabsTrigger.js","sources":["../../src/Tabs/TabsTrigger.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { StringOrNumber } from '@/shared/types'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TabsTriggerProps extends PrimitiveProps {\n /** A unique value that associates the trigger with a content. */\n value: StringOrNumber\n /** When `true`, prevents the user from interacting with the tab. */\n disabled?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { RovingFocusItem } from '@/RovingFocus'\nimport { injectTabsRootContext } from './TabsRoot.vue'\nimport { makeContentId, makeTriggerId } from './utils'\n\nconst props = withDefaults(defineProps<TabsTriggerProps>(), {\n disabled: false,\n as: 'button',\n})\n\nconst { forwardRef } = useForwardExpose()\nconst rootContext = injectTabsRootContext()\n\nconst triggerId = computed(() => makeTriggerId(rootContext.baseId, props.value))\nconst contentId = computed(() => makeContentId(rootContext.baseId, props.value))\n\nconst isSelected = computed(() => props.value === rootContext.modelValue.value)\n</script>\n\n<template>\n <RovingFocusItem\n as-child\n :focusable=\"!disabled\"\n :active=\"isSelected\"\n >\n <Primitive\n :id=\"triggerId\"\n :ref=\"forwardRef\"\n role=\"tab\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-selected=\"isSelected ? 'true' : 'false'\"\n :aria-controls=\"contentId\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n :disabled=\"disabled\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-orientation=\"rootContext.orientation.value\"\n @mousedown.left=\"(event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.ctrlKey === false) {\n rootContext.changeModelValue(value);\n }\n else {\n // prevent focus to avoid accidental activation\n event.preventDefault();\n }\n }\"\n @keydown.enter.space=\"rootContext.changeModelValue(value)\"\n @focus=\"() => {\n // handle 'automatic' activation if necessary\n // ie. activate tab following focus\n const isAutomaticActivation = rootContext.activationMode !== 'manual';\n if (!isSelected && !disabled && isAutomaticActivation) {\n rootContext.changeModelValue(value);\n }\n }\"\n >\n <slot />\n </Primitive>\n </RovingFocusItem>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAKd,IAAM,MAAA,EAAE,UAAW,EAAA,GAAI,gBAAiB,EAAA;AACxC,IAAA,MAAM,cAAc,qBAAsB,EAAA;AAE1C,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAC/E,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM,aAAA,CAAc,YAAY,MAAQ,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AAE/E,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM,MAAM,KAAU,KAAA,WAAA,CAAY,WAAW,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -19,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
19
19
  const context = TagsInput_TagsInputRoot.injectTagsInputRootContext();
20
20
  const { forwardRef, currentElement } = shared_useForwardExpose.useForwardExpose();
21
21
  function handleBlur(event) {
22
+ context.selectedElement.value = void 0;
22
23
  if (!context.addOnBlur.value)
23
24
  return;
24
25
  const target = event.target;
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInputInput.cjs","sources":["../../src/TagsInput/TagsInputInput.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TagsInputInputProps extends PrimitiveProps {\n /** The placeholder character to use for empty tags input. */\n placeholder?: string\n /** Focus on element when mounted. */\n autoFocus?: boolean\n /** Maximum number of character allowed. */\n maxLength?: number\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { nextTick, onMounted, ref } from 'vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nconst props = withDefaults(defineProps<TagsInputInputProps>(), {\n as: 'input',\n})\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\n\nfunction handleBlur(event: Event) {\n if (!context.addOnBlur.value)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n}\n\nfunction handleTab(event: Event) {\n if (!context.addOnTab.value)\n return\n\n handleCustomKeydown(event)\n}\n\nconst isComposing = ref(false)\nfunction onCompositionStart() {\n isComposing.value = true\n}\nfunction onCompositionEnd() {\n requestAnimationFrame(() => {\n isComposing.value = false\n })\n}\nasync function handleCustomKeydown(event: Event) {\n if (isComposing.value)\n return\n await nextTick()\n // if keydown 'Enter' or `Tab` was prevented, we let user handle updating the value themselves\n if (event.defaultPrevented)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n\n // prevent reloading when using inside of form\n event.preventDefault()\n}\n\nfunction handleInput(event: InputEvent) {\n context.isInvalidInput.value = false\n if (event.data === null)\n return\n\n const delimiter = context.delimiter.value\n const matchesDelimiter = delimiter === event.data || (delimiter instanceof RegExp && delimiter.test(event.data))\n if (matchesDelimiter) {\n const target = event.target as HTMLInputElement\n target.value = target.value.replace(delimiter, '')\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n }\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n if (context.addOnPaste.value) {\n event.preventDefault()\n const clipboardData = event.clipboardData\n if (!clipboardData)\n return\n\n const value = clipboardData.getData('text')\n if (context.delimiter.value) {\n const splitValue = value.split(context.delimiter.value)\n splitValue.forEach((v) => {\n context.onAddValue(v)\n })\n }\n else {\n context.onAddValue(value)\n }\n }\n}\n\nonMounted(() => {\n const inputEl = currentElement.value.nodeName === 'INPUT'\n ? currentElement.value\n : currentElement.value.querySelector('input')\n\n if (!inputEl)\n return\n\n setTimeout(() => {\n // make sure all DOM was flush then only capture the focus\n if (props.autoFocus)\n inputEl?.focus()\n }, 1)\n})\n</script>\n\n<template>\n <Primitive\n :id=\"context.id?.value\"\n :ref=\"forwardRef\"\n type=\"text\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n :as=\"as\"\n :as-child=\"asChild\"\n :maxlength=\"maxLength\"\n :placeholder=\"placeholder\"\n :disabled=\"context.disabled.value\"\n :data-invalid=\"context.isInvalidInput.value ? '' : undefined\"\n @input=\"handleInput\"\n @keydown.enter=\"handleCustomKeydown\"\n @keydown.tab=\"handleTab\"\n @blur=\"handleBlur\"\n @keydown=\"context.onInputKeydown\"\n @compositionstart=\"onCompositionStart\"\n @compositionend=\"onCompositionEnd\"\n @paste=\"handlePaste\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["injectTagsInputRootContext","useForwardExpose","ref","nextTick","onMounted"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAA,MAAM,UAAUA,kDAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AAExD,IAAA,SAAS,WAAW,KAAc,EAAA;AAChC,MAAI,IAAA,CAAC,QAAQ,SAAU,CAAA,KAAA;AACrB,QAAA;AAEF,MAAA,MAAM,SAAS,KAAM,CAAA,MAAA;AACrB,MAAA,IAAI,CAAC,MAAO,CAAA,KAAA;AACV,QAAA;AAEF,MAAA,MAAM,OAAU,GAAA,OAAA,CAAQ,UAAW,CAAA,MAAA,CAAO,KAAK,CAAA;AAC/C,MAAI,IAAA,OAAA;AACF,QAAA,MAAA,CAAO,KAAQ,GAAA,EAAA;AAAA;AAGnB,IAAA,SAAS,UAAU,KAAc,EAAA;AAC/B,MAAI,IAAA,CAAC,QAAQ,QAAS,CAAA,KAAA;AACpB,QAAA;AAEF,MAAA,mBAAA,CAAoB,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TagsInputInput.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TagsInputInputProps extends PrimitiveProps {\n /** The placeholder character to use for empty tags input. */\n placeholder?: string\n /** Focus on element when mounted. */\n autoFocus?: boolean\n /** Maximum number of character allowed. */\n maxLength?: number\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { nextTick, onMounted, ref } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nconst props = withDefaults(defineProps<TagsInputInputProps>(), {\n as: 'input',\n})\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\n\nfunction handleBlur(event: Event) {\n context.selectedElement.value = undefined\n\n if (!context.addOnBlur.value)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n}\n\nfunction handleTab(event: Event) {\n if (!context.addOnTab.value)\n return\n\n handleCustomKeydown(event)\n}\n\nconst isComposing = ref(false)\nfunction onCompositionStart() {\n isComposing.value = true\n}\nfunction onCompositionEnd() {\n requestAnimationFrame(() => {\n isComposing.value = false\n })\n}\nasync function handleCustomKeydown(event: Event) {\n if (isComposing.value)\n return\n await nextTick()\n // if keydown 'Enter' or `Tab` was prevented, we let user handle updating the value themselves\n if (event.defaultPrevented)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n\n // prevent reloading when using inside of form\n event.preventDefault()\n}\n\nfunction handleInput(event: InputEvent) {\n context.isInvalidInput.value = false\n if (event.data === null)\n return\n\n const delimiter = context.delimiter.value\n const matchesDelimiter = delimiter === event.data || (delimiter instanceof RegExp && delimiter.test(event.data))\n if (matchesDelimiter) {\n const target = event.target as HTMLInputElement\n target.value = target.value.replace(delimiter, '')\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n }\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n if (context.addOnPaste.value) {\n event.preventDefault()\n const clipboardData = event.clipboardData\n if (!clipboardData)\n return\n\n const value = clipboardData.getData('text')\n if (context.delimiter.value) {\n const splitValue = value.split(context.delimiter.value)\n splitValue.forEach((v) => {\n context.onAddValue(v)\n })\n }\n else {\n context.onAddValue(value)\n }\n }\n}\n\nonMounted(() => {\n const inputEl = currentElement.value.nodeName === 'INPUT'\n ? currentElement.value\n : currentElement.value.querySelector('input')\n\n if (!inputEl)\n return\n\n setTimeout(() => {\n // make sure all DOM was flush then only capture the focus\n if (props.autoFocus)\n inputEl?.focus()\n }, 1)\n})\n</script>\n\n<template>\n <Primitive\n :id=\"context.id?.value\"\n :ref=\"forwardRef\"\n type=\"text\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n :as=\"as\"\n :as-child=\"asChild\"\n :maxlength=\"maxLength\"\n :placeholder=\"placeholder\"\n :disabled=\"context.disabled.value\"\n :data-invalid=\"context.isInvalidInput.value ? '' : undefined\"\n @input=\"handleInput\"\n @keydown.enter=\"handleCustomKeydown\"\n @keydown.tab=\"handleTab\"\n @blur=\"handleBlur\"\n @keydown=\"context.onInputKeydown\"\n @compositionstart=\"onCompositionStart\"\n @compositionend=\"onCompositionEnd\"\n @paste=\"handlePaste\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["injectTagsInputRootContext","useForwardExpose","ref","nextTick","onMounted"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAA,MAAM,UAAUA,kDAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AAExD,IAAA,SAAS,WAAW,KAAc,EAAA;AAChC,MAAA,OAAA,CAAQ,gBAAgB,KAAQ,GAAA,MAAA;AAEhC,MAAI,IAAA,CAAC,QAAQ,SA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A,GAAU,cAAe,CAAA,KAAA,CAAM,QAAa,KAAA,OAAA,GAC9C,eAAe,KACf,GAAA,cAAA,CAAe,KAAM,CAAA,aAAA,CAAc,OAAO,CAAA;AAE9C,MAAA,IAAI,CAAC,OAAA;AACH,QAAA;AAEF,MAAA,UAAA,CAAW,MAAM;AAEf,QAAA,IAAI,KAAM,CAAA,SAAA;AACR,UAAA,OAAA,EAAS,KAAM,EAAA;AAAA,SAChB,CAAC,CAAA;AAAA,KACL,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,6 +17,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  const context = injectTagsInputRootContext();
18
18
  const { forwardRef, currentElement } = useForwardExpose();
19
19
  function handleBlur(event) {
20
+ context.selectedElement.value = void 0;
20
21
  if (!context.addOnBlur.value)
21
22
  return;
22
23
  const target = event.target;
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInputInput.js","sources":["../../src/TagsInput/TagsInputInput.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TagsInputInputProps extends PrimitiveProps {\n /** The placeholder character to use for empty tags input. */\n placeholder?: string\n /** Focus on element when mounted. */\n autoFocus?: boolean\n /** Maximum number of character allowed. */\n maxLength?: number\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\nimport { nextTick, onMounted, ref } from 'vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nconst props = withDefaults(defineProps<TagsInputInputProps>(), {\n as: 'input',\n})\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\n\nfunction handleBlur(event: Event) {\n if (!context.addOnBlur.value)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n}\n\nfunction handleTab(event: Event) {\n if (!context.addOnTab.value)\n return\n\n handleCustomKeydown(event)\n}\n\nconst isComposing = ref(false)\nfunction onCompositionStart() {\n isComposing.value = true\n}\nfunction onCompositionEnd() {\n requestAnimationFrame(() => {\n isComposing.value = false\n })\n}\nasync function handleCustomKeydown(event: Event) {\n if (isComposing.value)\n return\n await nextTick()\n // if keydown 'Enter' or `Tab` was prevented, we let user handle updating the value themselves\n if (event.defaultPrevented)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n\n // prevent reloading when using inside of form\n event.preventDefault()\n}\n\nfunction handleInput(event: InputEvent) {\n context.isInvalidInput.value = false\n if (event.data === null)\n return\n\n const delimiter = context.delimiter.value\n const matchesDelimiter = delimiter === event.data || (delimiter instanceof RegExp && delimiter.test(event.data))\n if (matchesDelimiter) {\n const target = event.target as HTMLInputElement\n target.value = target.value.replace(delimiter, '')\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n }\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n if (context.addOnPaste.value) {\n event.preventDefault()\n const clipboardData = event.clipboardData\n if (!clipboardData)\n return\n\n const value = clipboardData.getData('text')\n if (context.delimiter.value) {\n const splitValue = value.split(context.delimiter.value)\n splitValue.forEach((v) => {\n context.onAddValue(v)\n })\n }\n else {\n context.onAddValue(value)\n }\n }\n}\n\nonMounted(() => {\n const inputEl = currentElement.value.nodeName === 'INPUT'\n ? currentElement.value\n : currentElement.value.querySelector('input')\n\n if (!inputEl)\n return\n\n setTimeout(() => {\n // make sure all DOM was flush then only capture the focus\n if (props.autoFocus)\n inputEl?.focus()\n }, 1)\n})\n</script>\n\n<template>\n <Primitive\n :id=\"context.id?.value\"\n :ref=\"forwardRef\"\n type=\"text\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n :as=\"as\"\n :as-child=\"asChild\"\n :maxlength=\"maxLength\"\n :placeholder=\"placeholder\"\n :disabled=\"context.disabled.value\"\n :data-invalid=\"context.isInvalidInput.value ? '' : undefined\"\n @input=\"handleInput\"\n @keydown.enter=\"handleCustomKeydown\"\n @keydown.tab=\"handleTab\"\n @blur=\"handleBlur\"\n @keydown=\"context.onInputKeydown\"\n @compositionstart=\"onCompositionStart\"\n @compositionend=\"onCompositionEnd\"\n @paste=\"handlePaste\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAA,MAAM,UAAU,0BAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AAExD,IAAA,SAAS,WAAW,KAAc,EAAA;AAChC,MAAI,IAAA,CAAC,QAAQ,SAAU,CAAA,KAAA;AACrB,QAAA;AAEF,MAAA,MAAM,SAAS,KAAM,CAAA,MAAA;AACrB,MAAA,IAAI,CAAC,MAAO,CAAA,KAAA;AACV,QAAA;AAEF,MAAA,MAAM,OAAU,GAAA,OAAA,CAAQ,UAAW,CAAA,MAAA,CAAO,KAAK,CAAA;AAC/C,MAAI,IAAA,OAAA;AACF,QAAA,MAAA,CAAO,KAAQ,GAAA,EAAA;AAAA;AAGnB,IAAA,SAAS,UAAU,KAAc,EAAA;AAC/B,MAAI,IAAA,CAAC,QAAQ,QAAS,CAAA,KAAA;AACpB,QAAA;AAEF,MAAA,mBAAA,CAAoB,KAAK,CAAA;AAAA;AAG3B,IAAM,MAAA,WAAA,GAAc,IAAI,KAAK,CAAA;AAC7B,IAAA,SAAS,kBAAqB,GAAA;AAC5B,MAAA,WAAA,CAAY,KAAQ,GAAA,IAAA;AAAA;AAEtB,IAAA,SAAS,gBAAmB,GAAA;AAC1B,MAAA,qBAAA,CAAsB,MAAM;AAC1B,QAAA,WAAA,CAAY,KAAQ,GAAA,KAAA;AAAA,OACrB,CAAA;AAAA;AAEH,IAAA,eAAe,oBAAoB,KAAc,EAAA;AAC/C,MA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C5B,QAAA,IAAI,CAAC,aAAA;AACH,UAAA;AAEF,QAAM,MAAA,KAAA,GAAQ,aAAc,CAAA,OAAA,CAAQ,MAAM,CAAA;AAC1C,QAAI,IAAA,OAAA,CAAQ,UAAU,KAAO,EAAA;AAC3B,UAAA,MAAM,UAAa,GAAA,KAAA,CAAM,KAAM,CAAA,OAAA,CAAQ,UAAU,KAAK,CAAA;AACtD,UAAW,UAAA,CAAA,OAAA,CAAQ,CAAC,CAAM,KAAA;AACxB,YAAA,OAAA,CAAQ,WAAW,CAAC,CAAA;AAAA,WACrB,CAAA;AAAA,SAEE,MAAA;AACH,UAAA,OAAA,CAAQ,WAAW,KAAK,CAAA;AAAA;AAC1B;AACF;AAGF,IAAA,SAAA,CAAU,MAAM;AACd,MAAM,MAAA,OAAA,GAAU,cAAe,CAAA,KAAA,CAAM,QAAa,KAAA,OAAA,GAC9C,eAAe,KACf,GAAA,cAAA,CAAe,KAAM,CAAA,aAAA,CAAc,OAAO,CAAA;AAE9C,MAAA,IAAI,CAAC,OAAA;AACH,QAAA;AAEF,MAAA,UAAA,CAAW,MAAM;AAEf,QAAA,IAAI,KAAM,CAAA,SAAA;AACR,UAAA,OAAA,EAAS,KAAM,EAAA;AAAA,SAChB,CAAC,CAAA;AAAA,KACL,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TagsInputInput.js","sources":["../../src/TagsInput/TagsInputInput.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface TagsInputInputProps extends PrimitiveProps {\n /** The placeholder character to use for empty tags input. */\n placeholder?: string\n /** Focus on element when mounted. */\n autoFocus?: boolean\n /** Maximum number of character allowed. */\n maxLength?: number\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { nextTick, onMounted, ref } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nconst props = withDefaults(defineProps<TagsInputInputProps>(), {\n as: 'input',\n})\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\n\nfunction handleBlur(event: Event) {\n context.selectedElement.value = undefined\n\n if (!context.addOnBlur.value)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n}\n\nfunction handleTab(event: Event) {\n if (!context.addOnTab.value)\n return\n\n handleCustomKeydown(event)\n}\n\nconst isComposing = ref(false)\nfunction onCompositionStart() {\n isComposing.value = true\n}\nfunction onCompositionEnd() {\n requestAnimationFrame(() => {\n isComposing.value = false\n })\n}\nasync function handleCustomKeydown(event: Event) {\n if (isComposing.value)\n return\n await nextTick()\n // if keydown 'Enter' or `Tab` was prevented, we let user handle updating the value themselves\n if (event.defaultPrevented)\n return\n\n const target = event.target as HTMLInputElement\n if (!target.value)\n return\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n\n // prevent reloading when using inside of form\n event.preventDefault()\n}\n\nfunction handleInput(event: InputEvent) {\n context.isInvalidInput.value = false\n if (event.data === null)\n return\n\n const delimiter = context.delimiter.value\n const matchesDelimiter = delimiter === event.data || (delimiter instanceof RegExp && delimiter.test(event.data))\n if (matchesDelimiter) {\n const target = event.target as HTMLInputElement\n target.value = target.value.replace(delimiter, '')\n\n const isAdded = context.onAddValue(target.value)\n if (isAdded)\n target.value = ''\n }\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n if (context.addOnPaste.value) {\n event.preventDefault()\n const clipboardData = event.clipboardData\n if (!clipboardData)\n return\n\n const value = clipboardData.getData('text')\n if (context.delimiter.value) {\n const splitValue = value.split(context.delimiter.value)\n splitValue.forEach((v) => {\n context.onAddValue(v)\n })\n }\n else {\n context.onAddValue(value)\n }\n }\n}\n\nonMounted(() => {\n const inputEl = currentElement.value.nodeName === 'INPUT'\n ? currentElement.value\n : currentElement.value.querySelector('input')\n\n if (!inputEl)\n return\n\n setTimeout(() => {\n // make sure all DOM was flush then only capture the focus\n if (props.autoFocus)\n inputEl?.focus()\n }, 1)\n})\n</script>\n\n<template>\n <Primitive\n :id=\"context.id?.value\"\n :ref=\"forwardRef\"\n type=\"text\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n :as=\"as\"\n :as-child=\"asChild\"\n :maxlength=\"maxLength\"\n :placeholder=\"placeholder\"\n :disabled=\"context.disabled.value\"\n :data-invalid=\"context.isInvalidInput.value ? '' : undefined\"\n @input=\"handleInput\"\n @keydown.enter=\"handleCustomKeydown\"\n @keydown.tab=\"handleTab\"\n @blur=\"handleBlur\"\n @keydown=\"context.onInputKeydown\"\n @compositionstart=\"onCompositionStart\"\n @compositionend=\"onCompositionEnd\"\n @paste=\"handlePaste\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAA,MAAM,UAAU,0BAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AAExD,IAAA,SAAS,WAAW,KAAc,EAAA;AAChC,MAAA,OAAA,CAAQ,gBAAgB,KAAQ,GAAA,MAAA;AAEhC,MAAI,IAAA,CAAC,QAAQ,SAAU,CAAA,KAAA;AACrB,QAAA;AAEF,MAAA,MAAM,SAAS,KAAM,CAAA,MAAA;AACrB,MAAA,IAAI,CAAC,MAAO,CAAA,KAAA;AACV,QAAA;AAEF,MAAA,MAAM,OAAU,GAAA,OAAA,CAAQ,UAAW,CAAA,MAAA,CAAO,KAAK,CAAA;AAC/C,MAAI,IAAA,OAAA;AACF,QAAA,MAAA,CAAO,KAAQ,GAAA,EAAA;AAAA;AAGnB,IAAA,SAAS,UAAU,KAAc,EAAA;AAC/B,MAAI,IAAA,CAAC,QAAQ,QAAS,CAAA,KAAA;AACpB,QAAA;AAEF,MAAA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Item.cjs","sources":["../../src/TagsInput/TagsInputItem.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { ComputedRef, Ref } from 'vue'\nimport type { AcceptableInputValue } from './TagsInputRoot.vue'\nimport { createContext, useForwardExpose } from '@/shared'\nimport { computed, toRefs } from 'vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemProps extends PrimitiveProps {\n /** Value associated with the tags */\n value: AcceptableInputValue\n /** When `true`, prevents the user from interacting with the tags input. */\n disabled?: boolean\n}\n\nexport interface TagsInputItemContext {\n value: Ref<AcceptableInputValue>\n displayValue: ComputedRef<string>\n isSelected: Ref<boolean>\n disabled?: Ref<boolean>\n textId: string\n}\n\nexport const [injectTagsInputItemContext, provideTagsInputItemContext]\n = createContext<TagsInputItemContext>('TagsInputItem')\n</script>\n\n<script setup lang=\"ts\">\nimport { useCollection } from '@/Collection'\nimport { Primitive } from '@/Primitive'\n\nconst props = defineProps<TagsInputItemProps>()\nconst { value } = toRefs(props)\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\nconst { CollectionItem } = useCollection()\n\nconst isSelected = computed(() => context.selectedElement.value === currentElement.value)\n\nconst disabled = computed(() => props.disabled || context.disabled.value)\n\nconst itemContext = provideTagsInputItemContext({\n value,\n isSelected,\n disabled,\n textId: '',\n displayValue: computed(() => context.displayValue(value.value)),\n})\n</script>\n\n<template>\n <CollectionItem :value=\"value\">\n <Primitive\n :ref=\"forwardRef\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"isSelected\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n >\n <slot />\n </Primitive>\n </CollectionItem>\n</template>\n"],"names":["createContext","toRefs","injectTagsInputRootContext","useForwardExpose","useCollection","computed"],"mappings":";;;;;;;;;AAuBO,MAAM,CAAC,0BAAA,EAA4B,2BAA2B,CAAA,GACjEA,mCAAoC,eAAe;;;;;;;;;;AAOvD,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,UAAA,CAAO,KAAK,CAAA;AAE9B,IAAA,MAAM,UAAUC,kDAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AACxD,IAAM,MAAA,EAAE,cAAe,EAAA,GAAIC,mCAAc,EAAA;AAEzC,IAAA,MAAM,aAAaC,YAAS,CAAA,MAAM,QAAQ,eAAgB,CAAA,KAAA,KAAU,eAAe,KAAK,CAAA;AAExF,IAAA,MAAM,WAAWA,YAAS,CAAA,MAAM,MAAM,QAAY,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAExE,IAAA,MAAM,cAAc,2BAA4B,CAAA;AAAA,MAC9C,KAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAQ,EAAA,EAAA;AAAA,MACR,cAAcA,YAAS,CAAA,MAAM,QAAQ,YAAa,CAAA,KAAA,CAAM,KAAK,CAAC;AAAA,KAC/D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TagsInputItem.cjs","sources":["../../src/TagsInput/TagsInputItem.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ComputedRef, Ref } from 'vue'\nimport type { AcceptableInputValue } from './TagsInputRoot.vue'\nimport type { PrimitiveProps } from '@/Primitive'\nimport { computed, toRefs } from 'vue'\nimport { createContext, useForwardExpose } from '@/shared'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemProps extends PrimitiveProps {\n /** Value associated with the tags */\n value: AcceptableInputValue\n /** When `true`, prevents the user from interacting with the tags input. */\n disabled?: boolean\n}\n\nexport interface TagsInputItemContext {\n value: Ref<AcceptableInputValue>\n displayValue: ComputedRef<string>\n isSelected: Ref<boolean>\n disabled?: Ref<boolean>\n textId: string\n}\n\nexport const [injectTagsInputItemContext, provideTagsInputItemContext]\n = createContext<TagsInputItemContext>('TagsInputItem')\n</script>\n\n<script setup lang=\"ts\">\nimport { useCollection } from '@/Collection'\nimport { Primitive } from '@/Primitive'\n\nconst props = defineProps<TagsInputItemProps>()\nconst { value } = toRefs(props)\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\nconst { CollectionItem } = useCollection()\n\nconst isSelected = computed(() => context.selectedElement.value === currentElement.value)\n\nconst disabled = computed(() => props.disabled || context.disabled.value)\n\nconst itemContext = provideTagsInputItemContext({\n value,\n isSelected,\n disabled,\n textId: '',\n displayValue: computed(() => context.displayValue(value.value)),\n})\n</script>\n\n<template>\n <CollectionItem :value=\"value\">\n <Primitive\n :ref=\"forwardRef\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"isSelected\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n >\n <slot />\n </Primitive>\n </CollectionItem>\n</template>\n"],"names":["createContext","toRefs","injectTagsInputRootContext","useForwardExpose","useCollection","computed"],"mappings":";;;;;;;;;AAuBO,MAAM,CAAC,0BAAA,EAA4B,2BAA2B,CAAA,GACjEA,mCAAoC,eAAe;;;;;;;;;;AAOvD,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,EAAE,KAAA,EAAU,GAAAC,UAAA,CAAO,KAAK,CAAA;AAE9B,IAAA,MAAM,UAAUC,kDAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAIC,wCAAiB,EAAA;AACxD,IAAM,MAAA,EAAE,cAAe,EAAA,GAAIC,mCAAc,EAAA;AAEzC,IAAA,MAAM,aAAaC,YAAS,CAAA,MAAM,QAAQ,eAAgB,CAAA,KAAA,KAAU,eAAe,KAAK,CAAA;AAExF,IAAA,MAAM,WAAWA,YAAS,CAAA,MAAM,MAAM,QAAY,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAExE,IAAA,MAAM,cAAc,2BAA4B,CAAA;AAAA,MAC9C,KAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAQ,EAAA,EAAA;AAAA,MACR,cAAcA,YAAS,CAAA,MAAM,QAAQ,YAAa,CAAA,KAAA,CAAM,KAAK,CAAC;AAAA,KAC/D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInputItem.js","sources":["../../src/TagsInput/TagsInputItem.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { ComputedRef, Ref } from 'vue'\nimport type { AcceptableInputValue } from './TagsInputRoot.vue'\nimport { createContext, useForwardExpose } from '@/shared'\nimport { computed, toRefs } from 'vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemProps extends PrimitiveProps {\n /** Value associated with the tags */\n value: AcceptableInputValue\n /** When `true`, prevents the user from interacting with the tags input. */\n disabled?: boolean\n}\n\nexport interface TagsInputItemContext {\n value: Ref<AcceptableInputValue>\n displayValue: ComputedRef<string>\n isSelected: Ref<boolean>\n disabled?: Ref<boolean>\n textId: string\n}\n\nexport const [injectTagsInputItemContext, provideTagsInputItemContext]\n = createContext<TagsInputItemContext>('TagsInputItem')\n</script>\n\n<script setup lang=\"ts\">\nimport { useCollection } from '@/Collection'\nimport { Primitive } from '@/Primitive'\n\nconst props = defineProps<TagsInputItemProps>()\nconst { value } = toRefs(props)\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\nconst { CollectionItem } = useCollection()\n\nconst isSelected = computed(() => context.selectedElement.value === currentElement.value)\n\nconst disabled = computed(() => props.disabled || context.disabled.value)\n\nconst itemContext = provideTagsInputItemContext({\n value,\n isSelected,\n disabled,\n textId: '',\n displayValue: computed(() => context.displayValue(value.value)),\n})\n</script>\n\n<template>\n <CollectionItem :value=\"value\">\n <Primitive\n :ref=\"forwardRef\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"isSelected\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n >\n <slot />\n </Primitive>\n </CollectionItem>\n</template>\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,CAAC,0BAAA,EAA4B,2BAA2B,CAAA,GACjE,cAAoC,eAAe;;;;;;;;;;AAOvD,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAA,CAAO,KAAK,CAAA;AAE9B,IAAA,MAAM,UAAU,0BAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AACxD,IAAM,MAAA,EAAE,cAAe,EAAA,GAAI,aAAc,EAAA;AAEzC,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM,QAAQ,eAAgB,CAAA,KAAA,KAAU,eAAe,KAAK,CAAA;AAExF,IAAA,MAAM,WAAW,QAAS,CAAA,MAAM,MAAM,QAAY,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAExE,IAAA,MAAM,cAAc,2BAA4B,CAAA;AAAA,MAC9C,KAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAQ,EAAA,EAAA;AAAA,MACR,cAAc,QAAS,CAAA,MAAM,QAAQ,YAAa,CAAA,KAAA,CAAM,KAAK,CAAC;AAAA,KAC/D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TagsInputItem.js","sources":["../../src/TagsInput/TagsInputItem.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { ComputedRef, Ref } from 'vue'\nimport type { AcceptableInputValue } from './TagsInputRoot.vue'\nimport type { PrimitiveProps } from '@/Primitive'\nimport { computed, toRefs } from 'vue'\nimport { createContext, useForwardExpose } from '@/shared'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemProps extends PrimitiveProps {\n /** Value associated with the tags */\n value: AcceptableInputValue\n /** When `true`, prevents the user from interacting with the tags input. */\n disabled?: boolean\n}\n\nexport interface TagsInputItemContext {\n value: Ref<AcceptableInputValue>\n displayValue: ComputedRef<string>\n isSelected: Ref<boolean>\n disabled?: Ref<boolean>\n textId: string\n}\n\nexport const [injectTagsInputItemContext, provideTagsInputItemContext]\n = createContext<TagsInputItemContext>('TagsInputItem')\n</script>\n\n<script setup lang=\"ts\">\nimport { useCollection } from '@/Collection'\nimport { Primitive } from '@/Primitive'\n\nconst props = defineProps<TagsInputItemProps>()\nconst { value } = toRefs(props)\n\nconst context = injectTagsInputRootContext()\nconst { forwardRef, currentElement } = useForwardExpose()\nconst { CollectionItem } = useCollection()\n\nconst isSelected = computed(() => context.selectedElement.value === currentElement.value)\n\nconst disabled = computed(() => props.disabled || context.disabled.value)\n\nconst itemContext = provideTagsInputItemContext({\n value,\n isSelected,\n disabled,\n textId: '',\n displayValue: computed(() => context.displayValue(value.value)),\n})\n</script>\n\n<template>\n <CollectionItem :value=\"value\">\n <Primitive\n :ref=\"forwardRef\"\n :as=\"as\"\n :as-child=\"asChild\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"isSelected\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-state=\"isSelected ? 'active' : 'inactive'\"\n >\n <slot />\n </Primitive>\n </CollectionItem>\n</template>\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,CAAC,0BAAA,EAA4B,2BAA2B,CAAA,GACjE,cAAoC,eAAe;;;;;;;;;;AAOvD,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAA,CAAO,KAAK,CAAA;AAE9B,IAAA,MAAM,UAAU,0BAA2B,EAAA;AAC3C,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,gBAAiB,EAAA;AACxD,IAAM,MAAA,EAAE,cAAe,EAAA,GAAI,aAAc,EAAA;AAEzC,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM,QAAQ,eAAgB,CAAA,KAAA,KAAU,eAAe,KAAK,CAAA;AAExF,IAAA,MAAM,WAAW,QAAS,CAAA,MAAM,MAAM,QAAY,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAExE,IAAA,MAAM,cAAc,2BAA4B,CAAA;AAAA,MAC9C,KAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAQ,EAAA,EAAA;AAAA,MACR,cAAc,QAAS,CAAA,MAAM,QAAQ,YAAa,CAAA,KAAA,CAAM,KAAK,CAAC;AAAA,KAC/D,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInputItemDelete.cjs","sources":["../../src/TagsInput/TagsInputItemDelete.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\nimport { isEqual } from 'ohash'\nimport { computed } from 'vue'\nimport { injectTagsInputItemContext } from './TagsInputItem.vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemDeleteProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<TagsInputItemDeleteProps>(), {\n as: 'button',\n})\n\nuseForwardExpose()\nconst context = injectTagsInputRootContext()\nconst itemContext = injectTagsInputItemContext()\n\nconst disabled = computed(() => itemContext.disabled?.value || context.disabled.value)\n\nfunction handleDelete() {\n if (disabled.value)\n return\n const index = context.modelValue.value.findIndex(i => isEqual(i, itemContext.value.value))\n context.onRemoveValue(index)\n}\n</script>\n\n<template>\n <Primitive\n tabindex=\"-1\"\n v-bind=\"props\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"itemContext.isSelected.value\"\n :data-state=\"itemContext.isSelected.value ? 'active' : 'inactive'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :type=\"as === 'button' ? 'button' : undefined\"\n @click=\"handleDelete\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["useForwardExpose","injectTagsInputRootContext","injectTagsInputItemContext","computed","isEqual"],"mappings":";;;;;;;;;;;;;;;;AAcA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAiBA,wCAAA,EAAA;AACjB,IAAA,MAAM,UAAUC,kDAA2B,EAAA;AAC3C,IAAA,MAAM,cAAcC,kDAA2B,EAAA;AAE/C,IAAM,MAAA,QAAA,GAAWC,aAAS,MAAM,WAAA,CAAY,UAAU,KAAS,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAErF,IAAA,SAAS,YAAe,GAAA;AACtB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AACF,MAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,UAAA,CAAW,KAAM,CAAA,SAAA,CAAU,CAAK,CAAA,KAAAC,aAAA,CAAQ,CAAG,EAAA,WAAA,CAAY,KAAM,CAAA,KAAK,CAAC,CAAA;AACzF,MAAA,OAAA,CAAQ,cAAc,KAAK,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TagsInputItemDelete.cjs","sources":["../../src/TagsInput/TagsInputItemDelete.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { isEqual } from 'ohash'\nimport { computed } from 'vue'\nimport { useForwardExpose } from '@/shared'\nimport { injectTagsInputItemContext } from './TagsInputItem.vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemDeleteProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<TagsInputItemDeleteProps>(), {\n as: 'button',\n})\n\nuseForwardExpose()\nconst context = injectTagsInputRootContext()\nconst itemContext = injectTagsInputItemContext()\n\nconst disabled = computed(() => itemContext.disabled?.value || context.disabled.value)\n\nfunction handleDelete() {\n if (disabled.value)\n return\n const index = context.modelValue.value.findIndex(i => isEqual(i, itemContext.value.value))\n context.onRemoveValue(index)\n}\n</script>\n\n<template>\n <Primitive\n tabindex=\"-1\"\n v-bind=\"props\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"itemContext.isSelected.value\"\n :data-state=\"itemContext.isSelected.value ? 'active' : 'inactive'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :type=\"as === 'button' ? 'button' : undefined\"\n @click=\"handleDelete\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":["useForwardExpose","injectTagsInputRootContext","injectTagsInputItemContext","computed","isEqual"],"mappings":";;;;;;;;;;;;;;;;AAcA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAiBA,wCAAA,EAAA;AACjB,IAAA,MAAM,UAAUC,kDAA2B,EAAA;AAC3C,IAAA,MAAM,cAAcC,kDAA2B,EAAA;AAE/C,IAAM,MAAA,QAAA,GAAWC,aAAS,MAAM,WAAA,CAAY,UAAU,KAAS,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAErF,IAAA,SAAS,YAAe,GAAA;AACtB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AACF,MAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,UAAA,CAAW,KAAM,CAAA,SAAA,CAAU,CAAK,CAAA,KAAAC,aAAA,CAAQ,CAAG,EAAA,WAAA,CAAY,KAAM,CAAA,KAAK,CAAC,CAAA;AACzF,MAAA,OAAA,CAAQ,cAAc,KAAK,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInputItemDelete.js","sources":["../../src/TagsInput/TagsInputItemDelete.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\nimport { isEqual } from 'ohash'\nimport { computed } from 'vue'\nimport { injectTagsInputItemContext } from './TagsInputItem.vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemDeleteProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<TagsInputItemDeleteProps>(), {\n as: 'button',\n})\n\nuseForwardExpose()\nconst context = injectTagsInputRootContext()\nconst itemContext = injectTagsInputItemContext()\n\nconst disabled = computed(() => itemContext.disabled?.value || context.disabled.value)\n\nfunction handleDelete() {\n if (disabled.value)\n return\n const index = context.modelValue.value.findIndex(i => isEqual(i, itemContext.value.value))\n context.onRemoveValue(index)\n}\n</script>\n\n<template>\n <Primitive\n tabindex=\"-1\"\n v-bind=\"props\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"itemContext.isSelected.value\"\n :data-state=\"itemContext.isSelected.value ? 'active' : 'inactive'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :type=\"as === 'button' ? 'button' : undefined\"\n @click=\"handleDelete\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAcA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAiB,gBAAA,EAAA;AACjB,IAAA,MAAM,UAAU,0BAA2B,EAAA;AAC3C,IAAA,MAAM,cAAc,0BAA2B,EAAA;AAE/C,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM,WAAA,CAAY,UAAU,KAAS,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAErF,IAAA,SAAS,YAAe,GAAA;AACtB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AACF,MAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,UAAA,CAAW,KAAM,CAAA,SAAA,CAAU,CAAK,CAAA,KAAA,OAAA,CAAQ,CAAG,EAAA,WAAA,CAAY,KAAM,CAAA,KAAK,CAAC,CAAA;AACzF,MAAA,OAAA,CAAQ,cAAc,KAAK,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TagsInputItemDelete.js","sources":["../../src/TagsInput/TagsInputItemDelete.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { isEqual } from 'ohash'\nimport { computed } from 'vue'\nimport { useForwardExpose } from '@/shared'\nimport { injectTagsInputItemContext } from './TagsInputItem.vue'\nimport { injectTagsInputRootContext } from './TagsInputRoot.vue'\n\nexport interface TagsInputItemDeleteProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<TagsInputItemDeleteProps>(), {\n as: 'button',\n})\n\nuseForwardExpose()\nconst context = injectTagsInputRootContext()\nconst itemContext = injectTagsInputItemContext()\n\nconst disabled = computed(() => itemContext.disabled?.value || context.disabled.value)\n\nfunction handleDelete() {\n if (disabled.value)\n return\n const index = context.modelValue.value.findIndex(i => isEqual(i, itemContext.value.value))\n context.onRemoveValue(index)\n}\n</script>\n\n<template>\n <Primitive\n tabindex=\"-1\"\n v-bind=\"props\"\n :aria-labelledby=\"itemContext.textId\"\n :aria-current=\"itemContext.isSelected.value\"\n :data-state=\"itemContext.isSelected.value ? 'active' : 'inactive'\"\n :data-disabled=\"disabled ? '' : undefined\"\n :type=\"as === 'button' ? 'button' : undefined\"\n @click=\"handleDelete\"\n >\n <slot />\n </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAcA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAId,IAAiB,gBAAA,EAAA;AACjB,IAAA,MAAM,UAAU,0BAA2B,EAAA;AAC3C,IAAA,MAAM,cAAc,0BAA2B,EAAA;AAE/C,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM,WAAA,CAAY,UAAU,KAAS,IAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AAErF,IAAA,SAAS,YAAe,GAAA;AACtB,MAAA,IAAI,QAAS,CAAA,KAAA;AACX,QAAA;AACF,MAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,UAAA,CAAW,KAAM,CAAA,SAAA,CAAU,CAAK,CAAA,KAAA,OAAA,CAAQ,CAAG,EAAA,WAAA,CAAY,KAAM,CAAA,KAAK,CAAC,CAAA;AACzF,MAAA,OAAA,CAAQ,cAAc,KAAK,CAAA;AAAA;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- const Collection_Collection = require('../Collection/Collection.cjs');
5
4
  const core = require('@vueuse/core');
5
+ const Collection_Collection = require('../Collection/Collection.cjs');
6
6
  const shared_createContext = require('../shared/createContext.cjs');
7
7
  const shared_useDirection = require('../shared/useDirection.cjs');
8
8
  const shared_useForwardExpose = require('../shared/useForwardExpose.cjs');