@atom-learning/components 6.16.0-beta.2 → 6.16.0-beta.3

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 (355) hide show
  1. package/dist/components/accordion/Accordion.js.map +1 -1
  2. package/dist/components/accordion/AccordionContent.js.map +1 -1
  3. package/dist/components/accordion/AccordionItem.js.map +1 -1
  4. package/dist/components/accordion/AccordionTrigger.js.map +1 -1
  5. package/dist/components/action-icon/ActionIcon.constants.js.map +1 -1
  6. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  7. package/dist/components/alert-dialog/AlertDialog.js.map +1 -1
  8. package/dist/components/alert-dialog/AlertDialogContent.js.map +1 -1
  9. package/dist/components/alert-dialog/alert-context/AlertContext.js.map +1 -1
  10. package/dist/components/alert-dialog/alert-context/AlertDialog.js.map +1 -1
  11. package/dist/components/alert-dialog/alert-context/AlertDialogIcon.js.map +1 -1
  12. package/dist/components/alert-dialog/alert-context/reducer.js.map +1 -1
  13. package/dist/components/avatar/Avatar.js.map +1 -1
  14. package/dist/components/avatar/AvatarContext.js.map +1 -1
  15. package/dist/components/avatar/AvatarIcon.js.map +1 -1
  16. package/dist/components/avatar/AvatarImage.js.map +1 -1
  17. package/dist/components/avatar/AvatarInitial.js.map +1 -1
  18. package/dist/components/avatar/AvatarPlaceholder.js.map +1 -1
  19. package/dist/components/badge/Badge.colorscheme.config.js.map +1 -1
  20. package/dist/components/badge/Badge.context.js.map +1 -1
  21. package/dist/components/badge/Badge.js.map +1 -1
  22. package/dist/components/badge/BadgeIcon.js.map +1 -1
  23. package/dist/components/badge/BadgeText.js.map +1 -1
  24. package/dist/components/banner/Banner.js.map +1 -1
  25. package/dist/components/banner/BannerContainer.js.map +1 -1
  26. package/dist/components/banner/BannerContext.js.map +1 -1
  27. package/dist/components/banner/banner-regular/BannerRegular.js.map +1 -1
  28. package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
  29. package/dist/components/banner/banner-regular/BannerRegularButton.js.map +1 -1
  30. package/dist/components/banner/banner-regular/BannerRegularContainer.js.map +1 -1
  31. package/dist/components/banner/banner-regular/BannerRegularContent.js.map +1 -1
  32. package/dist/components/banner/banner-regular/BannerRegularDismiss.js.map +1 -1
  33. package/dist/components/banner/banner-regular/BannerRegularHeading.js.map +1 -1
  34. package/dist/components/banner/banner-regular/BannerRegularImage.js.map +1 -1
  35. package/dist/components/banner/banner-regular/BannerRegularText.js.map +1 -1
  36. package/dist/components/banner/banner-slim/BannerSlim.js.map +1 -1
  37. package/dist/components/banner/banner-slim/BannerSlimActions.js.map +1 -1
  38. package/dist/components/banner/banner-slim/BannerSlimButton.js.map +1 -1
  39. package/dist/components/banner/banner-slim/BannerSlimContainer.js.map +1 -1
  40. package/dist/components/banner/banner-slim/BannerSlimContent.js.map +1 -1
  41. package/dist/components/banner/banner-slim/BannerSlimDismiss.js.map +1 -1
  42. package/dist/components/banner/banner-slim/BannerSlimImage.js.map +1 -1
  43. package/dist/components/banner/banner-slim/BannerSlimText.js.map +1 -1
  44. package/dist/components/box/Box.js.map +1 -1
  45. package/dist/components/button/Button.js.map +1 -1
  46. package/dist/components/calendar/Calendar.js.map +1 -1
  47. package/dist/components/calendar/Day.js.map +1 -1
  48. package/dist/components/calendar/constants.js.map +1 -1
  49. package/dist/components/carousel/Carousel.js.map +1 -1
  50. package/dist/components/carousel/CarouselArrows.js.map +1 -1
  51. package/dist/components/carousel/CarouselPagination.js.map +1 -1
  52. package/dist/components/carousel/CarouselSlide.js.map +1 -1
  53. package/dist/components/carousel/CarouselSlider.js.map +1 -1
  54. package/dist/components/checkbox/Checkbox.js.map +1 -1
  55. package/dist/components/checkbox-field/CheckboxField.js +1 -6
  56. package/dist/components/checkbox-field/CheckboxField.js.map +1 -1
  57. package/dist/components/checkbox-group/CheckboxGroup.js.map +1 -1
  58. package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
  59. package/dist/components/checkbox-group/CheckboxGroupItem.js.map +1 -1
  60. package/dist/components/checkbox-group/CheckboxGroupSub.js.map +1 -1
  61. package/dist/components/checkbox-group/context/CheckboxGroupChecked.context.js.map +1 -1
  62. package/dist/components/checkbox-group/context/CheckboxGroupMounted.context.js.map +1 -1
  63. package/dist/components/checkbox-tree/CheckboxTree.js.map +1 -1
  64. package/dist/components/checkbox-tree/CheckboxTreeCollapsible.js.map +1 -1
  65. package/dist/components/checkbox-tree/CheckboxTreeCollapsibleContent.js.map +1 -1
  66. package/dist/components/checkbox-tree/CheckboxTreeCollapsibleTrigger.js.map +1 -1
  67. package/dist/components/checkbox-tree/CheckboxTreeItem.js.map +1 -1
  68. package/dist/components/checkbox-tree/CheckboxTreeItemContent.js.map +1 -1
  69. package/dist/components/chip/Chip.js.map +1 -1
  70. package/dist/components/chip/ChipGroup.js.map +1 -1
  71. package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.js.map +1 -1
  72. package/dist/components/chip-dismissible-group/ChipDismissibleGroupRoot.js.map +1 -1
  73. package/dist/components/chip-toggle-group/ChipToggleGroupItem.js.map +1 -1
  74. package/dist/components/chip-toggle-group/ChipToggleGroupRoot.js.map +1 -1
  75. package/dist/components/combobox/Combobox.js.map +1 -1
  76. package/dist/components/combobox/ComboboxInput.js.map +1 -1
  77. package/dist/components/combobox/ComboboxList.js.map +1 -1
  78. package/dist/components/combobox/ComboboxOption.js.map +1 -1
  79. package/dist/components/combobox/ComboboxPopover.js.map +1 -1
  80. package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
  81. package/dist/components/data-table/DataTable.js +88 -0
  82. package/dist/components/data-table/DataTable.js.map +1 -1
  83. package/dist/components/data-table/DataTable.types.js.map +1 -1
  84. package/dist/components/data-table/DataTableBody.js.map +1 -1
  85. package/dist/components/data-table/DataTableBulkActions.js.map +1 -1
  86. package/dist/components/data-table/DataTableBulkActionsFloating.js.map +1 -1
  87. package/dist/components/data-table/DataTableBulkActionsSelectedRowActions.js.map +1 -1
  88. package/dist/components/data-table/DataTableContext.js.map +1 -1
  89. package/dist/components/data-table/DataTableDataCell.js.map +1 -1
  90. package/dist/components/data-table/DataTableEmptyState.js.map +1 -1
  91. package/dist/components/data-table/DataTableError.js.map +1 -1
  92. package/dist/components/data-table/DataTableGlobalFilter.js.map +1 -1
  93. package/dist/components/data-table/DataTableHead.js.map +1 -1
  94. package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
  95. package/dist/components/data-table/DataTableLoading.js.map +1 -1
  96. package/dist/components/data-table/DataTableMetaData.js.map +1 -1
  97. package/dist/components/data-table/DataTableRow.js.map +1 -1
  98. package/dist/components/data-table/DataTableRowSelectionCheckbox.js.map +1 -1
  99. package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
  100. package/dist/components/data-table/DataTableTable.js.map +1 -1
  101. package/dist/components/data-table/drag-and-drop/DragAndDropTable.js.map +1 -1
  102. package/dist/components/data-table/drag-and-drop/DragAndDropTableBody.js.map +1 -1
  103. package/dist/components/data-table/drag-and-drop/DragAndDropTableRow.js.map +1 -1
  104. package/dist/components/data-table/getNewAsyncData.js.map +1 -1
  105. package/dist/components/data-table/pagination/Pagination.js.map +1 -1
  106. package/dist/components/data-table/usePagination.js.map +1 -1
  107. package/dist/components/data-table/useSorting.js.map +1 -1
  108. package/dist/components/date-field/DateField.js.map +1 -1
  109. package/dist/components/date-input/DateInput.js.map +1 -1
  110. package/dist/components/dialog/Dialog.js.map +1 -1
  111. package/dist/components/dialog/DialogActionBar.js.map +1 -1
  112. package/dist/components/dialog/DialogBackground.js.map +1 -1
  113. package/dist/components/dialog/DialogContent.js.map +1 -1
  114. package/dist/components/dialog/DialogFooter.js.map +1 -1
  115. package/dist/components/dialog/DialogHeading.js.map +1 -1
  116. package/dist/components/dialog/DialogNavigationBar.js.map +1 -1
  117. package/dist/components/dialog/DialogScrollableContent.js.map +1 -1
  118. package/dist/components/dismissible/DismissibleRoot.js.map +1 -1
  119. package/dist/components/dismissible/DismissibleTrigger.js.map +1 -1
  120. package/dist/components/dismissible/index.js.map +1 -1
  121. package/dist/components/dismissible-group/DismissibleGroupItem.js.map +1 -1
  122. package/dist/components/dismissible-group/DismissibleGroupRoot.js.map +1 -1
  123. package/dist/components/dismissible-group/index.js.map +1 -1
  124. package/dist/components/divider/Divider.js.map +1 -1
  125. package/dist/components/drawer/Drawer.context.js.map +1 -1
  126. package/dist/components/drawer/Drawer.js.map +1 -1
  127. package/dist/components/drawer/DrawerClose.js.map +1 -1
  128. package/dist/components/drawer/DrawerContent.js.map +1 -1
  129. package/dist/components/drawer/DrawerFooter.js.map +1 -1
  130. package/dist/components/drawer/DrawerHeader.js.map +1 -1
  131. package/dist/components/drawer/DrawerMain.js.map +1 -1
  132. package/dist/components/drawer/DrawerOverlay.js.map +1 -1
  133. package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -1
  134. package/dist/components/dropdown-menu/DropdownMenuContent.js.map +1 -1
  135. package/dist/components/dropdown-menu/DropdownMenuItem.js.map +1 -1
  136. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
  137. package/dist/components/dropdown-menu/DropdownMenuSeparator.js.map +1 -1
  138. package/dist/components/dropdown-menu/DropdownMenuTrigger.js.map +1 -1
  139. package/dist/components/empty-state/EmptyState.context.js.map +1 -1
  140. package/dist/components/empty-state/EmptyState.js.map +1 -1
  141. package/dist/components/empty-state/EmptyStateBody.js.map +1 -1
  142. package/dist/components/empty-state/EmptyStateImage.js.map +1 -1
  143. package/dist/components/empty-state/EmptyStateTitle.js.map +1 -1
  144. package/dist/components/field-wrapper/FieldDescription.js.map +1 -1
  145. package/dist/components/field-wrapper/FieldWrapper.js.map +1 -1
  146. package/dist/components/field-wrapper/InlineFieldWrapper.js.map +1 -1
  147. package/dist/components/file-drop/FileDrop.js.map +1 -1
  148. package/dist/components/file-drop/FileDropContext.js.map +1 -1
  149. package/dist/components/file-drop/useFileDrop.js.map +1 -1
  150. package/dist/components/file-input/FileInput.js.map +1 -1
  151. package/dist/components/flex/Flex.js.map +1 -1
  152. package/dist/components/form/Form.js.map +1 -1
  153. package/dist/components/form/useFieldError.js.map +1 -1
  154. package/dist/components/form/useFormCustomContext.js.map +1 -1
  155. package/dist/components/grid/Grid.js.map +1 -1
  156. package/dist/components/heading/Heading.js.map +1 -1
  157. package/dist/components/icon/Icon.js.map +1 -1
  158. package/dist/components/image/Image.js.map +1 -1
  159. package/dist/components/inline-message/InlineMessage.config.js.map +1 -1
  160. package/dist/components/inline-message/InlineMessage.js.map +1 -1
  161. package/dist/components/input/Input.js.map +1 -1
  162. package/dist/components/input-field/InputField.js.map +1 -1
  163. package/dist/components/keyboard-shortcut/KeyboardShortcut.js.map +1 -1
  164. package/dist/components/keyboard-shortcut/index.js.map +1 -1
  165. package/dist/components/label/Label.js.map +1 -1
  166. package/dist/components/link/Link.js.map +1 -1
  167. package/dist/components/list/List.js.map +1 -1
  168. package/dist/components/loader/Loader.js.map +1 -1
  169. package/dist/components/markdown-content/MarkdownContent.js.map +1 -1
  170. package/dist/components/markdown-content/components/MarkdownCode.js.map +1 -1
  171. package/dist/components/markdown-content/components/MarkdownEmphasis.js.map +1 -1
  172. package/dist/components/markdown-content/components/MarkdownHeading.js.map +1 -1
  173. package/dist/components/markdown-content/components/MarkdownImage.js.map +1 -1
  174. package/dist/components/markdown-content/components/MarkdownInlineCode.js.map +1 -1
  175. package/dist/components/markdown-content/components/MarkdownLink.js.map +1 -1
  176. package/dist/components/markdown-content/components/MarkdownList.js.map +1 -1
  177. package/dist/components/markdown-content/components/MarkdownListItem.js.map +1 -1
  178. package/dist/components/markdown-content/components/MarkdownParagraph.js.map +1 -1
  179. package/dist/components/markdown-content/components/MarkdownStrong.js.map +1 -1
  180. package/dist/components/markdown-content/components/MarkdownThematicBreak.js.map +1 -1
  181. package/dist/components/navigation/NavigationMenu.colorscheme.config.js.map +1 -1
  182. package/dist/components/navigation/NavigationMenu.d.ts +2 -0
  183. package/dist/components/navigation/NavigationMenu.js.map +1 -1
  184. package/dist/components/navigation/NavigationMenu.styles.js.map +1 -1
  185. package/dist/components/navigation/NavigationMenuContext.js.map +1 -1
  186. package/dist/components/navigation/NavigationMenuDropdown.js.map +1 -1
  187. package/dist/components/navigation/NavigationMenuDropdownContent.js.map +1 -1
  188. package/dist/components/navigation/NavigationMenuDropdownItem.d.ts +1 -0
  189. package/dist/components/navigation/NavigationMenuDropdownItem.js.map +1 -1
  190. package/dist/components/navigation/NavigationMenuDropdownTrigger.js.map +1 -1
  191. package/dist/components/navigation/NavigationMenuLink.d.ts +1 -0
  192. package/dist/components/navigation/NavigationMenuLink.js +22 -11
  193. package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
  194. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.colorscheme.config.js.map +1 -1
  195. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.js.map +1 -1
  196. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.styles.js.map +1 -1
  197. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.js.map +1 -1
  198. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.js.map +1 -1
  199. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js.map +1 -1
  200. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalIcon.js.map +1 -1
  201. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalItem.js.map +1 -1
  202. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalItemContent.js.map +1 -1
  203. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
  204. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalList.js.map +1 -1
  205. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalText.js.map +1 -1
  206. package/dist/components/notification-badge/NotificationBadge.js.map +1 -1
  207. package/dist/components/number-input/NumberInput.js.map +1 -1
  208. package/dist/components/number-input/NumberInputStepper.js.map +1 -1
  209. package/dist/components/number-input-field/NumberInputField.js.map +1 -1
  210. package/dist/components/pagination/Pagination.js.map +1 -1
  211. package/dist/components/pagination/PaginationItems.js.map +1 -1
  212. package/dist/components/pagination/PaginationNextButton.js.map +1 -1
  213. package/dist/components/pagination/PaginationPage.js.map +1 -1
  214. package/dist/components/pagination/PaginationPopover.js.map +1 -1
  215. package/dist/components/pagination/PaginationPreviousButton.js.map +1 -1
  216. package/dist/components/pagination/pagination-context/PaginationContext.js.map +1 -1
  217. package/dist/components/pagination/pagination.constants.js.map +1 -1
  218. package/dist/components/pagination/pagination.helper.js.map +1 -1
  219. package/dist/components/pagination/usePagination.js.map +1 -1
  220. package/dist/components/password-field/PasswordField.js.map +1 -1
  221. package/dist/components/password-input/PasswordInput.js.map +1 -1
  222. package/dist/components/popover/Popover.js.map +1 -1
  223. package/dist/components/popover/PopoverContent.js.map +1 -1
  224. package/dist/components/progress-bar/ProgressBar.js.map +1 -1
  225. package/dist/components/radio-button/RadioButton.js.map +1 -1
  226. package/dist/components/radio-button/RadioButtonGroup.js.map +1 -1
  227. package/dist/components/radio-button-field/RadioButtonField.js.map +1 -1
  228. package/dist/components/radio-button-field/RadioField.js.map +1 -1
  229. package/dist/components/radio-card/RadioCard.js.map +1 -1
  230. package/dist/components/radio-card/RadioCardGroup.js.map +1 -1
  231. package/dist/components/router-provider/RouterProvider.js.map +1 -1
  232. package/dist/components/search-field/SearchField.js.map +1 -1
  233. package/dist/components/search-input/SearchInput.js +4 -9
  234. package/dist/components/search-input/SearchInput.js.map +1 -1
  235. package/dist/components/section-message/SectionMessage.js.map +1 -1
  236. package/dist/components/section-message/SectionMessageContext.js.map +1 -1
  237. package/dist/components/section-message/SectionMessageDescription.js.map +1 -1
  238. package/dist/components/section-message/SectionMessageDismiss.js.map +1 -1
  239. package/dist/components/section-message/SectionMessageIcon.js.map +1 -1
  240. package/dist/components/section-message/SectionMessageLayout.js.map +1 -1
  241. package/dist/components/section-message/SectionMessageTitle.js.map +1 -1
  242. package/dist/components/segmented-control/SegmentedControl.js.map +1 -1
  243. package/dist/components/segmented-control/SegmentedControlBadge.js.map +1 -1
  244. package/dist/components/segmented-control/SegmentedControlContext.js.map +1 -1
  245. package/dist/components/segmented-control/SegmentedControlDescription.js.map +1 -1
  246. package/dist/components/segmented-control/SegmentedControlHeading.js.map +1 -1
  247. package/dist/components/segmented-control/SegmentedControlIcon.js.map +1 -1
  248. package/dist/components/segmented-control/SegmentedControlItem.js.map +1 -1
  249. package/dist/components/segmented-control/SegmentedControlItemList.js.map +1 -1
  250. package/dist/components/segmented-control/SegmentedControlRoot.js.map +1 -1
  251. package/dist/components/select/Select.js.map +1 -1
  252. package/dist/components/select-field/SelectField.js.map +1 -1
  253. package/dist/components/side-bar/SideBar.js.map +1 -1
  254. package/dist/components/side-bar/SideBarComponents.js.map +1 -1
  255. package/dist/components/side-bar/SideBarContext.js.map +1 -1
  256. package/dist/components/skeleton-loader/Skeleton.js.map +1 -1
  257. package/dist/components/skeleton-loader/SkeletonBarChart.js.map +1 -1
  258. package/dist/components/skeleton-loader/SkeletonButton.js.map +1 -1
  259. package/dist/components/skeleton-loader/SkeletonCard.js.map +1 -1
  260. package/dist/components/skeleton-loader/SkeletonColumnChart.js.map +1 -1
  261. package/dist/components/skeleton-loader/SkeletonDoughnutChart.js.map +1 -1
  262. package/dist/components/skeleton-loader/SkeletonHeading.js.map +1 -1
  263. package/dist/components/skeleton-loader/SkeletonPanelList.js.map +1 -1
  264. package/dist/components/skeleton-loader/SkeletonSubjectList.js.map +1 -1
  265. package/dist/components/skeleton-loader/SkeletonTable.js.map +1 -1
  266. package/dist/components/skeleton-loader/SkeletonTabs.js.map +1 -1
  267. package/dist/components/slider/Slider.js.map +1 -1
  268. package/dist/components/slider/SliderSteps.js.map +1 -1
  269. package/dist/components/slider/SliderValue.js.map +1 -1
  270. package/dist/components/slider-field/SliderField.js.map +1 -1
  271. package/dist/components/sortable/Handle.js.map +1 -1
  272. package/dist/components/sortable/SortableHandle.js.map +1 -1
  273. package/dist/components/sortable/SortableItem.js.map +1 -1
  274. package/dist/components/sortable/SortableRoot.js.map +1 -1
  275. package/dist/components/spacer/Spacer.js.map +1 -1
  276. package/dist/components/stepper/Stepper.js.map +1 -1
  277. package/dist/components/stepper/StepperStepBack.js.map +1 -1
  278. package/dist/components/stepper/StepperStepBullet.js.map +1 -1
  279. package/dist/components/stepper/StepperStepContainer.js.map +1 -1
  280. package/dist/components/stepper/StepperStepForward.js.map +1 -1
  281. package/dist/components/stepper/StepperStepLabel.js.map +1 -1
  282. package/dist/components/stepper/StepperSteps.js.map +1 -1
  283. package/dist/components/stepper/stepper-context/StepperContext.js.map +1 -1
  284. package/dist/components/stepper/types.js.map +1 -1
  285. package/dist/components/switch/Switch.js.map +1 -1
  286. package/dist/components/table/Table.js.map +1 -1
  287. package/dist/components/table/TableBody.js.map +1 -1
  288. package/dist/components/table/TableCell.js.map +1 -1
  289. package/dist/components/table/TableFooter.js.map +1 -1
  290. package/dist/components/table/TableFooterCell.js.map +1 -1
  291. package/dist/components/table/TableHeader.js.map +1 -1
  292. package/dist/components/table/TableHeaderCell.js.map +1 -1
  293. package/dist/components/table/TableRow.js.map +1 -1
  294. package/dist/components/table/TableStickyColumnsContainer.js.map +1 -1
  295. package/dist/components/table/useStickyColumnsCss.js.map +1 -1
  296. package/dist/components/tabs/Tabs.js.map +1 -1
  297. package/dist/components/tabs/TabsContent.js.map +1 -1
  298. package/dist/components/tabs/TabsTrigger.js.map +1 -1
  299. package/dist/components/tabs/TabsTriggerList.js.map +1 -1
  300. package/dist/components/text/Text.js.map +1 -1
  301. package/dist/components/textarea/Textarea.js.map +1 -1
  302. package/dist/components/textarea-field/TextareaField.js.map +1 -1
  303. package/dist/components/tile/Tile.js.map +1 -1
  304. package/dist/components/tile-interactive/TileInteractive.js.map +1 -1
  305. package/dist/components/tile-toggle-group/TileToggleGroupItem.js.map +1 -1
  306. package/dist/components/tile-toggle-group/TileToggleGroupRoot.js.map +1 -1
  307. package/dist/components/toast/Toast.js.map +1 -1
  308. package/dist/components/toast/ToastCloseButton.js.map +1 -1
  309. package/dist/components/toast/ToastContext.js.map +1 -1
  310. package/dist/components/toast/ToastIcon.js.map +1 -1
  311. package/dist/components/toast/ToastProvider.js.map +1 -1
  312. package/dist/components/toggle-group/ToggleGroupButton.js.map +1 -1
  313. package/dist/components/toggle-group/ToggleGroupItem.js.map +1 -1
  314. package/dist/components/toggle-group/ToggleGroupRoot.js.map +1 -1
  315. package/dist/components/toggle-group/index.js.map +1 -1
  316. package/dist/components/tooltip/Tooltip.js.map +1 -1
  317. package/dist/components/tooltip/TooltipContent.js.map +1 -1
  318. package/dist/components/top-bar/TopBar.colorscheme.config.js.map +1 -1
  319. package/dist/components/top-bar/TopBar.js.map +1 -1
  320. package/dist/components/top-bar/TopBarActionIcon.js.map +1 -1
  321. package/dist/components/top-bar/TopBarBrand.js.map +1 -1
  322. package/dist/components/tree/Tree.js.map +1 -1
  323. package/dist/components/tree/TreeCollapsible.js.map +1 -1
  324. package/dist/components/tree/TreeCollapsibleContent.js.map +1 -1
  325. package/dist/components/tree/TreeCollapsibleTrigger.js.map +1 -1
  326. package/dist/components/tree/TreeIcon.js.map +1 -1
  327. package/dist/components/tree/TreeItem.js.map +1 -1
  328. package/dist/components/tree/TreeItemContent.js.map +1 -1
  329. package/dist/components/tree/TreeList.js.map +1 -1
  330. package/dist/components/tree/TreeListItem.js.map +1 -1
  331. package/dist/components/tree/TreeText.js.map +1 -1
  332. package/dist/components/video/Video.js.map +1 -1
  333. package/dist/docgen.json +1 -1
  334. package/dist/experiments/color-scheme/ColorScheme.config.js.map +1 -1
  335. package/dist/experiments/color-scheme/ColorScheme.js.map +1 -1
  336. package/dist/index.cjs.js +133 -46
  337. package/dist/index.cjs.js.map +1 -1
  338. package/dist/styled.js +1 -2
  339. package/dist/styled.js.map +1 -1
  340. package/dist/utilities/css-wrapper/CSSWrapper.js.map +1 -1
  341. package/dist/utilities/event/preventEvent.js.map +1 -1
  342. package/dist/utilities/hooks/useCallbackRef.js.map +1 -1
  343. package/dist/utilities/hooks/useIsMountedRef.js.map +1 -1
  344. package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
  345. package/dist/utilities/hooks/useScrollPosition.js.map +1 -1
  346. package/dist/utilities/hooks/useSize.js.map +1 -1
  347. package/dist/utilities/hooks/useWindowScrollPosition.js.map +1 -1
  348. package/dist/utilities/optional-tooltip-wrapper/OptionalTooltipWrapper.js.map +1 -1
  349. package/dist/utilities/override-styled-variant-value/overrideStyledVariantValue.js.map +1 -1
  350. package/dist/utilities/radix-overrides/toggle-group/ToggleGroupRoot.js.map +1 -1
  351. package/dist/utilities/radix-overrides/toggle-group/index.js.map +1 -1
  352. package/dist/utilities/style/backdrop-overlay.js.map +1 -1
  353. package/dist/utilities/style/get-icon-size.js.map +1 -1
  354. package/dist/utilities/uri/index.js.map +1 -1
  355. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationPage.js","names":[],"sources":["../../../src/components/pagination/PaginationPage.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport type { PaginationPageProps } from './types'\nimport { usePagination } from './usePagination'\n\nconst StyledButton = styled('button', {\n base: [\n 'items-center',\n 'border',\n 'border-transparent',\n 'rounded-sm',\n 'cursor-pointer',\n 'font-body',\n 'justify-center',\n 'whitespace-nowrap',\n 'w-max',\n 'flex',\n 'flex-col',\n 'p-0',\n 'font-normal',\n 'text-text-subtle',\n 'bg-(--base-1)',\n 'relative',\n 'not-disabled:active:bg-(--base-3)',\n 'not-disabled:active:text-(--text-bold)',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:bg-(--base-2)',\n 'not-disabled:hover:text-text-regular',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none'\n ],\n variants: {\n size: {\n md: ['size-10']\n },\n selected: {\n true: [\n 'border',\n 'border-(--accent-9)',\n 'font-semibold',\n 'not-disabled:active:border-(--accent-11)',\n 'not-disabled:active:text-(--accent-11)',\n 'not-disabled:hover:border-(--accent-10)',\n 'not-disabled:hover:text-(--accent-10)',\n 'text-(--accent-9)'\n ]\n },\n indicated: {\n true: [\n 'bg-(--accent-9)',\n 'font-semibold',\n 'not-disabled:active:bg-(--accent-11)',\n 'not-disabled:active:text-white',\n 'not-disabled:hover:bg-(--accent-10)',\n 'not-disabled:hover:text-white',\n 'text-white'\n ]\n }\n },\n compoundVariants: [\n {\n selected: true,\n indicated: true,\n class: [\n 'bg-(--accent-9)',\n 'font-semibold',\n 'not-disabled:active:bg-(--accent-11)',\n 'not-disabled:active:text-white',\n 'not-disabled:hover:bg-(--accent-10)',\n 'not-disabled:hover:text-white',\n 'not-focus-visible:border-white!',\n 'shadow-[var(--accent-9)_0px_0px_0px_1px]',\n 'text-white'\n ]\n }\n ]\n})\n\nexport const PaginationPage = ({\n pageNumber,\n className,\n onClick\n}: PaginationPageProps) => {\n const { currentPage, goToPage, indicatedPages, disabledPages, onItemHover } =\n usePagination()\n\n const isIndicated = indicatedPages.includes(pageNumber)\n const isDisabled = disabledPages.includes(pageNumber)\n\n const isSelected = currentPage === pageNumber\n\n const handleOnHover = () => {\n if (isSelected || isDisabled) return\n onItemHover?.(pageNumber)\n }\n\n const handleOnClick = (pageNumber) => {\n onClick?.()\n goToPage(pageNumber)\n }\n\n return (\n <StyledButton\n selected={isSelected}\n size=\"md\"\n onClick={() => handleOnClick(pageNumber)}\n className={className}\n indicated={isIndicated}\n disabled={isDisabled}\n aria-current={isSelected && 'page'}\n aria-disabled={isDisabled}\n onMouseOver={handleOnHover}\n >\n {pageNumber}\n </StyledButton>\n )\n}\n"],"mappings":";;;;AAOA,IAAM,eAAe,OAAO,UAAU;CACpC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU;EACR,MAAM,EACJ,IAAI,CAAC,UAAU,EAChB;EACD,UAAU,EACR,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,EACF;EACD,WAAW,EACT,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACD,EACF;EACF;CACD,kBAAkB,CAChB;EACE,UAAU;EACV,WAAW;EACX,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACF,CACF;CACF,CAAC;AAEF,IAAa,kBAAkB,EAC7B,YACA,WACA,cACyB;CACzB,MAAM,EAAE,aAAa,UAAU,gBAAgB,eAAe,gBAC5D,eAAe;CAEjB,MAAM,cAAc,eAAe,SAAS,WAAW;CACvD,MAAM,aAAa,cAAc,SAAS,WAAW;CAErD,MAAM,aAAa,gBAAgB;CAEnC,MAAM,sBAAsB;AAC1B,MAAI,cAAc,WAAY;AAC9B,gBAAc,WAAW;;CAG3B,MAAM,iBAAiB,eAAe;AACpC,aAAW;AACX,WAAS,WAAW;;AAGtB,QACE,wBAAA,cAAC,cAAD;EACE,UAAU;EACV,MAAK;EACL,eAAe,cAAc,WAAW;EAC7B;EACX,WAAW;EACX,UAAU;EACV,gBAAc,cAAc;EAC5B,iBAAe;EACf,aAAa;EAGA,EADZ,WACY"}
1
+ {"version":3,"file":"PaginationPage.js","names":[],"sources":["../../../src/components/pagination/PaginationPage.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport type { PaginationPageProps } from './types'\nimport { usePagination } from './usePagination'\n\nconst StyledButton = styled('button', {\n base: [\n 'items-center',\n 'border',\n 'border-transparent',\n 'rounded-sm',\n 'cursor-pointer',\n 'font-body',\n 'justify-center',\n 'whitespace-nowrap',\n 'w-max',\n 'flex',\n 'flex-col',\n 'p-0',\n 'font-normal',\n 'text-text-subtle',\n 'bg-(--base-1)',\n 'relative',\n 'not-disabled:active:bg-(--base-3)',\n 'not-disabled:active:text-(--text-bold)',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:bg-(--base-2)',\n 'not-disabled:hover:text-text-regular',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none'\n ],\n variants: {\n size: {\n md: ['size-10']\n },\n selected: {\n true: [\n 'border',\n 'border-(--accent-9)',\n 'font-semibold',\n 'not-disabled:active:border-(--accent-11)',\n 'not-disabled:active:text-(--accent-11)',\n 'not-disabled:hover:border-(--accent-10)',\n 'not-disabled:hover:text-(--accent-10)',\n 'text-(--accent-9)'\n ]\n },\n indicated: {\n true: [\n 'bg-(--accent-9)',\n 'font-semibold',\n 'not-disabled:active:bg-(--accent-11)',\n 'not-disabled:active:text-white',\n 'not-disabled:hover:bg-(--accent-10)',\n 'not-disabled:hover:text-white',\n 'text-white'\n ]\n }\n },\n compoundVariants: [\n {\n selected: true,\n indicated: true,\n class: [\n 'bg-(--accent-9)',\n 'font-semibold',\n 'not-disabled:active:bg-(--accent-11)',\n 'not-disabled:active:text-white',\n 'not-disabled:hover:bg-(--accent-10)',\n 'not-disabled:hover:text-white',\n 'not-focus-visible:border-white!',\n 'shadow-[var(--accent-9)_0px_0px_0px_1px]',\n 'text-white'\n ]\n }\n ]\n})\n\nexport const PaginationPage = ({\n pageNumber,\n className,\n onClick\n}: PaginationPageProps) => {\n const { currentPage, goToPage, indicatedPages, disabledPages, onItemHover } =\n usePagination()\n\n const isIndicated = indicatedPages.includes(pageNumber)\n const isDisabled = disabledPages.includes(pageNumber)\n\n const isSelected = currentPage === pageNumber\n\n const handleOnHover = () => {\n if (isSelected || isDisabled) return\n onItemHover?.(pageNumber)\n }\n\n const handleOnClick = (pageNumber) => {\n onClick?.()\n goToPage(pageNumber)\n }\n\n return (\n <StyledButton\n selected={isSelected}\n size=\"md\"\n onClick={() => handleOnClick(pageNumber)}\n className={className}\n indicated={isIndicated}\n disabled={isDisabled}\n aria-current={isSelected && 'page'}\n aria-disabled={isDisabled}\n onMouseOver={handleOnHover}\n >\n {pageNumber}\n </StyledButton>\n )\n}\n"],"mappings":";;;;AAOA,IAAM,eAAe,OAAO,UAAU;CACpC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,MAAM,EACJ,IAAI,CAAC,SAAS,EAChB;EACA,UAAU,EACR,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,EACF;EACA,WAAW,EACT,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;EACF,EACF;CACF;CACA,kBAAkB,CAChB;EACE,UAAU;EACV,WAAW;EACX,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF,CACF;AACF,CAAC;AAED,IAAa,kBAAkB,EAC7B,YACA,WACA,cACyB;CACzB,MAAM,EAAE,aAAa,UAAU,gBAAgB,eAAe,gBAC5D,cAAc;CAEhB,MAAM,cAAc,eAAe,SAAS,UAAU;CACtD,MAAM,aAAa,cAAc,SAAS,UAAU;CAEpD,MAAM,aAAa,gBAAgB;CAEnC,MAAM,sBAAsB;EAC1B,IAAI,cAAc,YAAY;EAC9B,cAAc,UAAU;CAC1B;CAEA,MAAM,iBAAiB,eAAe;EACpC,UAAU;EACV,SAAS,UAAU;CACrB;CAEA,OACE,wBAAA,cAAC,cAAD;EACE,UAAU;EACV,MAAK;EACL,eAAe,cAAc,UAAU;EAC5B;EACX,WAAW;EACX,UAAU;EACV,gBAAc,cAAc;EAC5B,iBAAe;EACf,aAAa;CAGD,GADX,UACW;AAElB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationPopover.js","names":[],"sources":["../../../src/components/pagination/PaginationPopover.tsx"],"sourcesContent":["import { Ellypsis } from '@atom-learning/icons'\nimport React from 'react'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { Popover } from '../popover/Popover'\nimport { PaginationPage } from './PaginationPage'\nimport { usePagination } from './usePagination'\n\nexport const PaginationPopover = ({\n children\n}: React.PropsWithChildren<unknown>) => {\n const { pagesCount, labels } = usePagination()\n const paginationItems = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n const [isOpen, setIsOpen] = React.useState<boolean>(false)\n\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen} defaultOpen={false}>\n <Popover.Trigger asChild>\n {children || (\n <ActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n label={labels?.popoverTriggerLabel || 'Open pagination popover'}\n data-testid=\"pagination_popover_trigger\"\n >\n <Icon is={Ellypsis} />\n </ActionIcon>\n )}\n </Popover.Trigger>\n <Popover.Content size=\"md\" showCloseButton={false} className=\"p-0\">\n <div className=\"flex flex-wrap justify-center gap-1 p-4\">\n {paginationItems?.map((pageNumber) => {\n return (\n <PaginationPage\n key={pageNumber}\n pageNumber={pageNumber}\n onClick={() => setIsOpen(false)}\n />\n )\n })}\n </div>\n </Popover.Content>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;AASA,IAAa,qBAAqB,EAChC,eACsC;CACtC,MAAM,EAAE,YAAY,WAAW,eAAe;CAC9C,MAAM,kBAAkB,MAAM,KAC5B,EAAE,QAAQ,YAAY,GACrB,GAAG,UAAU,QAAQ,EACvB;CAED,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAkB,MAAM;AAE1D,QACE,sBAAA,cAAC,SAAD;EAAS,MAAM;EAAQ,cAAc;EAAW,aAAa;EA2BnD,EA1BR,sBAAA,cAAC,QAAQ,SAAT,EAAiB,SAAA,MAYC,EAXf,YACC,sBAAA,cAAC,YAAD;EACE,YAAY;EACZ,MAAK;EACL,OAAM;EACN,OAAO,QAAQ,uBAAuB;EACtC,eAAY;EAGD,EADX,sBAAA,cAAC,MAAD,EAAM,IAAI,UAAY,CAAA,CACX,CAEC,EAClB,sBAAA,cAAC,QAAQ,SAAT;EAAiB,MAAK;EAAK,iBAAiB;EAAO,WAAU;EAY3C,EAXhB,sBAAA,cAAC,OAAD,EAAK,WAAU,2CAUT,EATH,iBAAiB,KAAK,eAAe;AACpC,SACE,sBAAA,cAAC,gBAAD;GACE,KAAK;GACO;GACZ,eAAe,UAAU,MAAM;GAC/B,CAAA;GAEJ,CACE,CACU,CACV"}
1
+ {"version":3,"file":"PaginationPopover.js","names":[],"sources":["../../../src/components/pagination/PaginationPopover.tsx"],"sourcesContent":["import { Ellypsis } from '@atom-learning/icons'\nimport React from 'react'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { Popover } from '../popover/Popover'\nimport { PaginationPage } from './PaginationPage'\nimport { usePagination } from './usePagination'\n\nexport const PaginationPopover = ({\n children\n}: React.PropsWithChildren<unknown>) => {\n const { pagesCount, labels } = usePagination()\n const paginationItems = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n const [isOpen, setIsOpen] = React.useState<boolean>(false)\n\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen} defaultOpen={false}>\n <Popover.Trigger asChild>\n {children || (\n <ActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n label={labels?.popoverTriggerLabel || 'Open pagination popover'}\n data-testid=\"pagination_popover_trigger\"\n >\n <Icon is={Ellypsis} />\n </ActionIcon>\n )}\n </Popover.Trigger>\n <Popover.Content size=\"md\" showCloseButton={false} className=\"p-0\">\n <div className=\"flex flex-wrap justify-center gap-1 p-4\">\n {paginationItems?.map((pageNumber) => {\n return (\n <PaginationPage\n key={pageNumber}\n pageNumber={pageNumber}\n onClick={() => setIsOpen(false)}\n />\n )\n })}\n </div>\n </Popover.Content>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;AASA,IAAa,qBAAqB,EAChC,eACsC;CACtC,MAAM,EAAE,YAAY,WAAW,cAAc;CAC7C,MAAM,kBAAkB,MAAM,KAC5B,EAAE,QAAQ,WAAW,IACpB,GAAG,UAAU,QAAQ,CACxB;CAEA,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAkB,KAAK;CAEzD,OACE,sBAAA,cAAC,SAAD;EAAS,MAAM;EAAQ,cAAc;EAAW,aAAa;CA2BpD,GA1BP,sBAAA,cAAC,QAAQ,SAAT,EAAiB,SAAA,KAYA,GAXd,YACC,sBAAA,cAAC,YAAD;EACE,YAAY;EACZ,MAAK;EACL,OAAM;EACN,OAAO,QAAQ,uBAAuB;EACtC,eAAY;CAGF,GADV,sBAAA,cAAC,MAAD,EAAM,IAAI,SAAW,CAAA,CACX,CAEC,GACjB,sBAAA,cAAC,QAAQ,SAAT;EAAiB,MAAK;EAAK,iBAAiB;EAAO,WAAU;CAY5C,GAXf,sBAAA,cAAC,OAAD,EAAK,WAAU,0CAUV,GATF,iBAAiB,KAAK,eAAe;EACpC,OACE,sBAAA,cAAC,gBAAD;GACE,KAAK;GACO;GACZ,eAAe,UAAU,KAAK;EAC/B,CAAA;CAEL,CAAC,CACE,CACU,CACV;AAEb"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationPreviousButton.js","names":[],"sources":["../../../src/components/pagination/PaginationPreviousButton.tsx"],"sourcesContent":["import { ChevronLeft } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { usePagination } from './usePagination'\n\nconst StyledActionIcon = styled(ActionIcon, {\n base: ['mr-1', 'disabled:opacity-30']\n})\n\nexport const PaginationPreviousButton = (\n props: Partial<React.ComponentProps<typeof StyledActionIcon>>\n) => {\n const { goToPreviousPage, labels, previousAvailablePage } = usePagination()\n\n const isDisabled = !previousAvailablePage\n\n return (\n <StyledActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n onClick={goToPreviousPage}\n disabled={isDisabled}\n {...props}\n label={labels?.previousPageButtonLabel || 'Previous page'}\n >\n <Icon is={ChevronLeft} />\n </StyledActionIcon>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,mBAAmB,OAAO,YAAY,EAC1C,MAAM,CAAC,QAAQ,sBAAsB,EACtC,CAAC;AAEF,IAAa,4BACX,UACG;CACH,MAAM,EAAE,kBAAkB,QAAQ,0BAA0B,eAAe;CAE3E,MAAM,aAAa,CAAC;AAEpB,QACE,wBAAA,cAAC,kBAAD;EACE,YAAY;EACZ,MAAK;EACL,OAAM;EACN,SAAS;EACT,UAAU;EACV,GAAI;EACJ,OAAO,QAAQ,2BAA2B;EAGzB,EADjB,wBAAA,cAAC,MAAD,EAAM,IAAI,aAAe,CAAA,CACR"}
1
+ {"version":3,"file":"PaginationPreviousButton.js","names":[],"sources":["../../../src/components/pagination/PaginationPreviousButton.tsx"],"sourcesContent":["import { ChevronLeft } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { usePagination } from './usePagination'\n\nconst StyledActionIcon = styled(ActionIcon, {\n base: ['mr-1', 'disabled:opacity-30']\n})\n\nexport const PaginationPreviousButton = (\n props: Partial<React.ComponentProps<typeof StyledActionIcon>>\n) => {\n const { goToPreviousPage, labels, previousAvailablePage } = usePagination()\n\n const isDisabled = !previousAvailablePage\n\n return (\n <StyledActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n onClick={goToPreviousPage}\n disabled={isDisabled}\n {...props}\n label={labels?.previousPageButtonLabel || 'Previous page'}\n >\n <Icon is={ChevronLeft} />\n </StyledActionIcon>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,mBAAmB,OAAO,YAAY,EAC1C,MAAM,CAAC,QAAQ,qBAAqB,EACtC,CAAC;AAED,IAAa,4BACX,UACG;CACH,MAAM,EAAE,kBAAkB,QAAQ,0BAA0B,cAAc;CAE1E,MAAM,aAAa,CAAC;CAEpB,OACE,wBAAA,cAAC,kBAAD;EACE,YAAY;EACZ,MAAK;EACL,OAAM;EACN,SAAS;EACT,UAAU;EACV,GAAI;EACJ,OAAO,QAAQ,2BAA2B;CAG1B,GADhB,wBAAA,cAAC,MAAD,EAAM,IAAI,YAAc,CAAA,CACR;AAEtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationContext.js","names":[],"sources":["../../../../src/components/pagination/pagination-context/PaginationContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { VisibleElementsAmount } from '../pagination.constants'\nimport {\n findNextAvailablePage,\n findPreviousAvailablePage,\n getPaginationElementsToRender\n} from '../pagination.helper'\nimport type { PaginationContextValue, PaginationProviderProps } from '../types'\n\nexport const PaginationContext = React.createContext<PaginationContextValue>({\n goToPage: () => null,\n goToPreviousPage: () => null,\n goToNextPage: () => null,\n currentPage: 1,\n pagesCount: 0,\n onItemHover: () => null,\n paginationItems: [],\n labels: {},\n indicatedPages: [],\n disabledPages: []\n})\n\nexport const PaginationProvider = ({\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount = VisibleElementsAmount.LESS,\n pagesCount,\n indicatedPages = [],\n disabledPages = [],\n onItemHover = () => null,\n labels = {},\n children\n}: React.PropsWithChildren<PaginationProviderProps>) => {\n const [internalCurrentPage, setInternalCurrentPage] = React.useState(1)\n\n const currentPage = selectedPage || internalCurrentPage\n\n const goToPage = React.useCallback(\n (pageNumber: number) => {\n setInternalCurrentPage(pageNumber)\n onSelectedPageChange?.(pageNumber)\n },\n [onSelectedPageChange]\n )\n\n const previousPage = currentPage - 1\n const previousAvailablePage = findPreviousAvailablePage(\n previousPage,\n disabledPages\n )\n\n const goToPreviousPage = React.useCallback(() => {\n if (previousAvailablePage) goToPage(previousAvailablePage)\n }, [goToPage, previousAvailablePage])\n\n const nextPage = currentPage + 1\n const nextAvailablePage = findNextAvailablePage(\n nextPage,\n disabledPages,\n pagesCount\n )\n const goToNextPage = React.useCallback(() => {\n if (nextAvailablePage) goToPage(nextAvailablePage)\n }, [goToPage, nextAvailablePage])\n\n const paginationItems = getPaginationElementsToRender(\n currentPage,\n pagesCount,\n visibleElementsCount\n )\n\n const value = React.useMemo(() => {\n return {\n goToNextPage,\n goToPreviousPage,\n goToPage,\n currentPage,\n paginationItems,\n indicatedPages,\n disabledPages,\n pagesCount,\n onItemHover,\n previousAvailablePage,\n nextAvailablePage,\n labels\n }\n }, [\n goToNextPage,\n goToPreviousPage,\n goToPage,\n currentPage,\n indicatedPages,\n paginationItems,\n disabledPages,\n pagesCount,\n onItemHover,\n previousAvailablePage,\n nextAvailablePage,\n labels\n ])\n\n return (\n <PaginationContext.Provider value={value}>\n {children}\n </PaginationContext.Provider>\n )\n}\n"],"mappings":";;;;AAUA,IAAa,oBAAoB,QAAM,cAAsC;CAC3E,gBAAgB;CAChB,wBAAwB;CACxB,oBAAoB;CACpB,aAAa;CACb,YAAY;CACZ,mBAAmB;CACnB,iBAAiB,EAAE;CACnB,QAAQ,EAAE;CACV,gBAAgB,EAAE;CAClB,eAAe,EAAE;CAClB,CAAC;AAEF,IAAa,sBAAsB,EACjC,sBACA,cACA,uBAAuB,sBAAsB,MAC7C,YACA,iBAAiB,EAAE,EACnB,gBAAgB,EAAE,EAClB,oBAAoB,MACpB,SAAS,EAAE,EACX,eACsD;CACtD,MAAM,CAAC,qBAAqB,0BAA0B,QAAM,SAAS,EAAE;CAEvE,MAAM,cAAc,gBAAgB;CAEpC,MAAM,WAAW,QAAM,aACpB,eAAuB;AACtB,yBAAuB,WAAW;AAClC,yBAAuB,WAAW;IAEpC,CAAC,qBAAqB,CACvB;CAGD,MAAM,wBAAwB,0BADT,cAAc,GAGjC,cACD;CAED,MAAM,mBAAmB,QAAM,kBAAkB;AAC/C,MAAI,sBAAuB,UAAS,sBAAsB;IACzD,CAAC,UAAU,sBAAsB,CAAC;CAGrC,MAAM,oBAAoB,sBADT,cAAc,GAG7B,eACA,WACD;CACD,MAAM,eAAe,QAAM,kBAAkB;AAC3C,MAAI,kBAAmB,UAAS,kBAAkB;IACjD,CAAC,UAAU,kBAAkB,CAAC;CAEjC,MAAM,kBAAkB,8BACtB,aACA,YACA,qBACD;CAED,MAAM,QAAQ,QAAM,cAAc;AAChC,SAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;IACA;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,wBAAA,cAAC,kBAAkB,UAAnB,EAAmC,OAEN,EAD1B,SAC0B"}
1
+ {"version":3,"file":"PaginationContext.js","names":[],"sources":["../../../../src/components/pagination/pagination-context/PaginationContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { VisibleElementsAmount } from '../pagination.constants'\nimport {\n findNextAvailablePage,\n findPreviousAvailablePage,\n getPaginationElementsToRender\n} from '../pagination.helper'\nimport type { PaginationContextValue, PaginationProviderProps } from '../types'\n\nexport const PaginationContext = React.createContext<PaginationContextValue>({\n goToPage: () => null,\n goToPreviousPage: () => null,\n goToNextPage: () => null,\n currentPage: 1,\n pagesCount: 0,\n onItemHover: () => null,\n paginationItems: [],\n labels: {},\n indicatedPages: [],\n disabledPages: []\n})\n\nexport const PaginationProvider = ({\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount = VisibleElementsAmount.LESS,\n pagesCount,\n indicatedPages = [],\n disabledPages = [],\n onItemHover = () => null,\n labels = {},\n children\n}: React.PropsWithChildren<PaginationProviderProps>) => {\n const [internalCurrentPage, setInternalCurrentPage] = React.useState(1)\n\n const currentPage = selectedPage || internalCurrentPage\n\n const goToPage = React.useCallback(\n (pageNumber: number) => {\n setInternalCurrentPage(pageNumber)\n onSelectedPageChange?.(pageNumber)\n },\n [onSelectedPageChange]\n )\n\n const previousPage = currentPage - 1\n const previousAvailablePage = findPreviousAvailablePage(\n previousPage,\n disabledPages\n )\n\n const goToPreviousPage = React.useCallback(() => {\n if (previousAvailablePage) goToPage(previousAvailablePage)\n }, [goToPage, previousAvailablePage])\n\n const nextPage = currentPage + 1\n const nextAvailablePage = findNextAvailablePage(\n nextPage,\n disabledPages,\n pagesCount\n )\n const goToNextPage = React.useCallback(() => {\n if (nextAvailablePage) goToPage(nextAvailablePage)\n }, [goToPage, nextAvailablePage])\n\n const paginationItems = getPaginationElementsToRender(\n currentPage,\n pagesCount,\n visibleElementsCount\n )\n\n const value = React.useMemo(() => {\n return {\n goToNextPage,\n goToPreviousPage,\n goToPage,\n currentPage,\n paginationItems,\n indicatedPages,\n disabledPages,\n pagesCount,\n onItemHover,\n previousAvailablePage,\n nextAvailablePage,\n labels\n }\n }, [\n goToNextPage,\n goToPreviousPage,\n goToPage,\n currentPage,\n indicatedPages,\n paginationItems,\n disabledPages,\n pagesCount,\n onItemHover,\n previousAvailablePage,\n nextAvailablePage,\n labels\n ])\n\n return (\n <PaginationContext.Provider value={value}>\n {children}\n </PaginationContext.Provider>\n )\n}\n"],"mappings":";;;;AAUA,IAAa,oBAAoB,QAAM,cAAsC;CAC3E,gBAAgB;CAChB,wBAAwB;CACxB,oBAAoB;CACpB,aAAa;CACb,YAAY;CACZ,mBAAmB;CACnB,iBAAiB,CAAC;CAClB,QAAQ,CAAC;CACT,gBAAgB,CAAC;CACjB,eAAe,CAAC;AAClB,CAAC;AAED,IAAa,sBAAsB,EACjC,sBACA,cACA,uBAAuB,sBAAsB,MAC7C,YACA,iBAAiB,CAAC,GAClB,gBAAgB,CAAC,GACjB,oBAAoB,MACpB,SAAS,CAAC,GACV,eACsD;CACtD,MAAM,CAAC,qBAAqB,0BAA0B,QAAM,SAAS,CAAC;CAEtE,MAAM,cAAc,gBAAgB;CAEpC,MAAM,WAAW,QAAM,aACpB,eAAuB;EACtB,uBAAuB,UAAU;EACjC,uBAAuB,UAAU;CACnC,GACA,CAAC,oBAAoB,CACvB;CAGA,MAAM,wBAAwB,0BADT,cAAc,GAGjC,aACF;CAEA,MAAM,mBAAmB,QAAM,kBAAkB;EAC/C,IAAI,uBAAuB,SAAS,qBAAqB;CAC3D,GAAG,CAAC,UAAU,qBAAqB,CAAC;CAGpC,MAAM,oBAAoB,sBADT,cAAc,GAG7B,eACA,UACF;CACA,MAAM,eAAe,QAAM,kBAAkB;EAC3C,IAAI,mBAAmB,SAAS,iBAAiB;CACnD,GAAG,CAAC,UAAU,iBAAiB,CAAC;CAEhC,MAAM,kBAAkB,8BACtB,aACA,YACA,oBACF;CAEA,MAAM,QAAQ,QAAM,cAAc;EAChC,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,wBAAA,cAAC,kBAAkB,UAAnB,EAAmC,MAEP,GADzB,QACyB;AAEhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.constants.js","names":[],"sources":["../../../src/components/pagination/pagination.constants.ts"],"sourcesContent":["export enum VisibleElementsAmount {\n LESS = 6,\n MORE = 8\n}\n\nexport const VIEW_ALL_POPOVER = 'VIEW_ALL_POPOVER'\nexport const GO_TO_PREVIOUS_PAGE = 'GO_TO_PREVIOUS_PAGE'\nexport const GO_TO_NEXT_PAGE = 'GO_TO_NEXT_PAGE'\n"],"mappings":";AAAA,IAAY,wBAAL,yBAAA,uBAAA;AACL,uBAAA,sBAAA,UAAA,KAAA;AACA,uBAAA,sBAAA,UAAA,KAAA;;KACD;AAED,IAAa,mBAAmB;AAChC,IAAa,sBAAsB;AACnC,IAAa,kBAAkB"}
1
+ {"version":3,"file":"pagination.constants.js","names":[],"sources":["../../../src/components/pagination/pagination.constants.ts"],"sourcesContent":["export enum VisibleElementsAmount {\n LESS = 6,\n MORE = 8\n}\n\nexport const VIEW_ALL_POPOVER = 'VIEW_ALL_POPOVER'\nexport const GO_TO_PREVIOUS_PAGE = 'GO_TO_PREVIOUS_PAGE'\nexport const GO_TO_NEXT_PAGE = 'GO_TO_NEXT_PAGE'\n"],"mappings":";AAAA,IAAY,wBAAL,yBAAA,uBAAA;CACL,sBAAA,sBAAA,UAAA,KAAA;CACA,sBAAA,sBAAA,UAAA,KAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAa,mBAAmB;AAChC,IAAa,sBAAsB;AACnC,IAAa,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.helper.js","names":[],"sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["import {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationItemsToRender } from './types'\n\nexport const getPaginationElementsToRender = (\n currentPage: number,\n pagesCount: number,\n visibleElementsCount: number\n): PaginationItemsToRender => {\n const paginationPages = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n /*\n * As we always show the `<` `>` arrows,\n * subtract 2 from `visibleElementsCount` (one for each of the GO_TO_PREVIOUS/NEXT_PAGE arrows)\n * to get the `visiblePagesCount`\n */\n let visiblePagesCount = visibleElementsCount - 2\n const withPreviousNextPageArrows = (paginationPages) => [\n GO_TO_PREVIOUS_PAGE,\n ...paginationPages,\n GO_TO_NEXT_PAGE\n ]\n\n /**\n * If fewer pages than threshold for truncating render them all.\n *\n * pagesCount: 6\n * visibleElementsCount: >=6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, 3, 4, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | 3 | | 4 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (pagesCount <= visiblePagesCount) {\n return withPreviousNextPageArrows(paginationPages)\n }\n\n /**\n * If current page is either at the very start or at the very end of the pages\n */\n const canFitEdgePage = visibleElementsCount >= 5\n const canFitViewAllPopover = visibleElementsCount >= 4\n const canFitPages = visibleElementsCount >= 3\n\n if (canFitViewAllPopover) {\n // Subtract one from visiblePagesCount to accomodate for us adding the `[…]` VIEW_ALL_POPOVER\n visiblePagesCount -= 1\n }\n\n if (canFitEdgePage) {\n // Subtract one more from visiblePagesCount to accomodate for us adding the GO_TO_PREVIOUS/NEXT_PAGE arrows\n visiblePagesCount -= 1\n }\n\n const firstPage = paginationPages[0]\n const lastPage = paginationPages[paginationPages.length - 1]\n\n /**\n * If we're truncating and current page is at the start of the page list,\n * render the initial truncated page list, e.g.\n *\n * pagesCount: 8\n * currentPage: 1/2\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | … | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage < visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitPages) {\n newPaginationItems.push(...paginationPages.slice(0, visiblePagesCount))\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitEdgePage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page is towards the end of the\n * page list (depending on visibleElementsCount),\n * render a truncated page list from the end, e.g.\n *\n * pagesCount: 8\n * currentPage: 7/8\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, VIEW_ALL_POPOVER, 7, 8, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | … | | 7 | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage > pagesCount - visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitEdgePage) {\n newPaginationItems.push(firstPage)\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitPages) {\n newPaginationItems.push(\n ...paginationPages.slice(pagesCount - visiblePagesCount, pagesCount)\n )\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page doesn't meet any of the previous conditions\n * (we're in the middle)\n * render a truncated page list from a specific index relative to `currentPage`, e.g.\n *\n * currentPage: 4\n * visibleElementsCount: 6 // VisibleElementsAmount.LESS\n * returns [GO_TO_PREVIOUS_PAGE, 3, 4, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 3 | | 4 | | … | | 6 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n * currentPage: 6\n * visibleElementsCount: 8 // VisibleElementsAmount.MORE\n * returns [GO_TO_PREVIOUS_PAGE, 4, 5, 6, 7, VIEW_ALL_POPOVER, 10, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 4 | | 5 | | 6 | | 7 | | … | | 10 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n */\n const canFitCurrentPage = canFitPages\n const canFitCurrentPageAndPreviousPage = visibleElementsCount >= 6\n const canFitCurrentPageAndPreviousPageAndNextPage = visibleElementsCount >= 7\n const canFitLastPage = canFitEdgePage\n\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitCurrentPageAndPreviousPageAndNextPage) {\n newPaginationItems.push(\n ...paginationPages.slice(\n currentPage + 1 - visiblePagesCount,\n currentPage + 1\n )\n )\n } else if (canFitCurrentPageAndPreviousPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - visiblePagesCount, currentPage)\n )\n } else if (canFitCurrentPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - 1, currentPage - 1 + 1)\n )\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitLastPage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n}\n\nexport const findNextAvailablePage = (\n startPage: number,\n disabledPages: number[],\n pagesCount: number\n): number | undefined => {\n if (startPage > pagesCount) return\n let nextPage = startPage\n while (disabledPages.includes(nextPage)) {\n nextPage++\n }\n return nextPage\n}\n\nexport const findPreviousAvailablePage = (\n startPage: number,\n disabledPages: number[]\n): number | undefined => {\n if (startPage < 1) return\n let previousPage = startPage\n while (disabledPages.includes(previousPage)) {\n previousPage--\n }\n return previousPage\n}\n"],"mappings":";;AAOA,IAAa,iCACX,aACA,YACA,yBAC4B;CAC5B,MAAM,kBAAkB,MAAM,KAC5B,EAAE,QAAQ,YAAY,GACrB,GAAG,UAAU,QAAQ,EACvB;CAOD,IAAI,oBAAoB,uBAAuB;CAC/C,MAAM,8BAA8B,oBAAoB;EACtD;EACA,GAAG;EACH;EACD;;;;;;;;;;;;AAaD,KAAI,cAAc,kBAChB,QAAO,2BAA2B,gBAAgB;;;;CAMpD,MAAM,iBAAiB,wBAAwB;CAC/C,MAAM,uBAAuB,wBAAwB;CACrD,MAAM,cAAc,wBAAwB;AAE5C,KAAI,qBAEF,sBAAqB;AAGvB,KAAI,eAEF,sBAAqB;CAGvB,MAAM,YAAY,gBAAgB;CAClC,MAAM,WAAW,gBAAgB,gBAAgB,SAAS;;;;;;;;;;;;;;AAe1D,KAAI,cAAc,mBAAmB;EACnC,MAAM,qBAAqB,EAAE;AAC7B,MAAI,YACF,oBAAmB,KAAK,GAAG,gBAAgB,MAAM,GAAG,kBAAkB,CAAC;AAEzE,MAAI,qBACF,oBAAmB,KAAK,iBAAiB;AAE3C,MAAI,eACF,oBAAmB,KAAK,SAAS;AAEnC,SAAO,2BAA2B,mBAAmB;;;;;;;;;;;;;;;;AAiBvD,KAAI,cAAc,aAAa,mBAAmB;EAChD,MAAM,qBAAqB,EAAE;AAC7B,MAAI,eACF,oBAAmB,KAAK,UAAU;AAEpC,MAAI,qBACF,oBAAmB,KAAK,iBAAiB;AAE3C,MAAI,YACF,oBAAmB,KACjB,GAAG,gBAAgB,MAAM,aAAa,mBAAmB,WAAW,CACrE;AAEH,SAAO,2BAA2B,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAsBvD,MAAM,oBAAoB;CAC1B,MAAM,mCAAmC,wBAAwB;CACjE,MAAM,8CAA8C,wBAAwB;CAC5E,MAAM,iBAAiB;CAEvB,MAAM,qBAAqB,EAAE;AAC7B,KAAI,4CACF,oBAAmB,KACjB,GAAG,gBAAgB,MACjB,cAAc,IAAI,mBAClB,cAAc,EACf,CACF;UACQ,iCACT,oBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,mBAAmB,YAAY,CACvE;UACQ,kBACT,oBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,GAAG,cAAc,IAAI,EAAE,CAC/D;AAEH,KAAI,qBACF,oBAAmB,KAAK,iBAAiB;AAE3C,KAAI,eACF,oBAAmB,KAAK,SAAS;AAEnC,QAAO,2BAA2B,mBAAmB;;AAGvD,IAAa,yBACX,WACA,eACA,eACuB;AACvB,KAAI,YAAY,WAAY;CAC5B,IAAI,WAAW;AACf,QAAO,cAAc,SAAS,SAAS,CACrC;AAEF,QAAO;;AAGT,IAAa,6BACX,WACA,kBACuB;AACvB,KAAI,YAAY,EAAG;CACnB,IAAI,eAAe;AACnB,QAAO,cAAc,SAAS,aAAa,CACzC;AAEF,QAAO"}
1
+ {"version":3,"file":"pagination.helper.js","names":[],"sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["import {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationItemsToRender } from './types'\n\nexport const getPaginationElementsToRender = (\n currentPage: number,\n pagesCount: number,\n visibleElementsCount: number\n): PaginationItemsToRender => {\n const paginationPages = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n /*\n * As we always show the `<` `>` arrows,\n * subtract 2 from `visibleElementsCount` (one for each of the GO_TO_PREVIOUS/NEXT_PAGE arrows)\n * to get the `visiblePagesCount`\n */\n let visiblePagesCount = visibleElementsCount - 2\n const withPreviousNextPageArrows = (paginationPages) => [\n GO_TO_PREVIOUS_PAGE,\n ...paginationPages,\n GO_TO_NEXT_PAGE\n ]\n\n /**\n * If fewer pages than threshold for truncating render them all.\n *\n * pagesCount: 6\n * visibleElementsCount: >=6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, 3, 4, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | 3 | | 4 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (pagesCount <= visiblePagesCount) {\n return withPreviousNextPageArrows(paginationPages)\n }\n\n /**\n * If current page is either at the very start or at the very end of the pages\n */\n const canFitEdgePage = visibleElementsCount >= 5\n const canFitViewAllPopover = visibleElementsCount >= 4\n const canFitPages = visibleElementsCount >= 3\n\n if (canFitViewAllPopover) {\n // Subtract one from visiblePagesCount to accomodate for us adding the `[…]` VIEW_ALL_POPOVER\n visiblePagesCount -= 1\n }\n\n if (canFitEdgePage) {\n // Subtract one more from visiblePagesCount to accomodate for us adding the GO_TO_PREVIOUS/NEXT_PAGE arrows\n visiblePagesCount -= 1\n }\n\n const firstPage = paginationPages[0]\n const lastPage = paginationPages[paginationPages.length - 1]\n\n /**\n * If we're truncating and current page is at the start of the page list,\n * render the initial truncated page list, e.g.\n *\n * pagesCount: 8\n * currentPage: 1/2\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | … | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage < visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitPages) {\n newPaginationItems.push(...paginationPages.slice(0, visiblePagesCount))\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitEdgePage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page is towards the end of the\n * page list (depending on visibleElementsCount),\n * render a truncated page list from the end, e.g.\n *\n * pagesCount: 8\n * currentPage: 7/8\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, VIEW_ALL_POPOVER, 7, 8, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | … | | 7 | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage > pagesCount - visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitEdgePage) {\n newPaginationItems.push(firstPage)\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitPages) {\n newPaginationItems.push(\n ...paginationPages.slice(pagesCount - visiblePagesCount, pagesCount)\n )\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page doesn't meet any of the previous conditions\n * (we're in the middle)\n * render a truncated page list from a specific index relative to `currentPage`, e.g.\n *\n * currentPage: 4\n * visibleElementsCount: 6 // VisibleElementsAmount.LESS\n * returns [GO_TO_PREVIOUS_PAGE, 3, 4, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 3 | | 4 | | … | | 6 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n * currentPage: 6\n * visibleElementsCount: 8 // VisibleElementsAmount.MORE\n * returns [GO_TO_PREVIOUS_PAGE, 4, 5, 6, 7, VIEW_ALL_POPOVER, 10, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 4 | | 5 | | 6 | | 7 | | … | | 10 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n */\n const canFitCurrentPage = canFitPages\n const canFitCurrentPageAndPreviousPage = visibleElementsCount >= 6\n const canFitCurrentPageAndPreviousPageAndNextPage = visibleElementsCount >= 7\n const canFitLastPage = canFitEdgePage\n\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitCurrentPageAndPreviousPageAndNextPage) {\n newPaginationItems.push(\n ...paginationPages.slice(\n currentPage + 1 - visiblePagesCount,\n currentPage + 1\n )\n )\n } else if (canFitCurrentPageAndPreviousPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - visiblePagesCount, currentPage)\n )\n } else if (canFitCurrentPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - 1, currentPage - 1 + 1)\n )\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitLastPage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n}\n\nexport const findNextAvailablePage = (\n startPage: number,\n disabledPages: number[],\n pagesCount: number\n): number | undefined => {\n if (startPage > pagesCount) return\n let nextPage = startPage\n while (disabledPages.includes(nextPage)) {\n nextPage++\n }\n return nextPage\n}\n\nexport const findPreviousAvailablePage = (\n startPage: number,\n disabledPages: number[]\n): number | undefined => {\n if (startPage < 1) return\n let previousPage = startPage\n while (disabledPages.includes(previousPage)) {\n previousPage--\n }\n return previousPage\n}\n"],"mappings":";;AAOA,IAAa,iCACX,aACA,YACA,yBAC4B;CAC5B,MAAM,kBAAkB,MAAM,KAC5B,EAAE,QAAQ,WAAW,IACpB,GAAG,UAAU,QAAQ,CACxB;CAOA,IAAI,oBAAoB,uBAAuB;CAC/C,MAAM,8BAA8B,oBAAoB;EACtD;EACA,GAAG;EACH;CACF;;;;;;;;;;;;CAaA,IAAI,cAAc,mBAChB,OAAO,2BAA2B,eAAe;;;;CAMnD,MAAM,iBAAiB,wBAAwB;CAC/C,MAAM,uBAAuB,wBAAwB;CACrD,MAAM,cAAc,wBAAwB;CAE5C,IAAI,sBAEF,qBAAqB;CAGvB,IAAI,gBAEF,qBAAqB;CAGvB,MAAM,YAAY,gBAAgB;CAClC,MAAM,WAAW,gBAAgB,gBAAgB,SAAS;;;;;;;;;;;;;;CAe1D,IAAI,cAAc,mBAAmB;EACnC,MAAM,qBAAqB,CAAC;EAC5B,IAAI,aACF,mBAAmB,KAAK,GAAG,gBAAgB,MAAM,GAAG,iBAAiB,CAAC;EAExE,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;EAE1C,IAAI,gBACF,mBAAmB,KAAK,QAAQ;EAElC,OAAO,2BAA2B,kBAAkB;CACtD;;;;;;;;;;;;;;;CAgBA,IAAI,cAAc,aAAa,mBAAmB;EAChD,MAAM,qBAAqB,CAAC;EAC5B,IAAI,gBACF,mBAAmB,KAAK,SAAS;EAEnC,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;EAE1C,IAAI,aACF,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,aAAa,mBAAmB,UAAU,CACrE;EAEF,OAAO,2BAA2B,kBAAkB;CACtD;;;;;;;;;;;;;;;;;;;;CAqBA,MAAM,oBAAoB;CAC1B,MAAM,mCAAmC,wBAAwB;CACjE,MAAM,8CAA8C,wBAAwB;CAC5E,MAAM,iBAAiB;CAEvB,MAAM,qBAAqB,CAAC;CAC5B,IAAI,6CACF,mBAAmB,KACjB,GAAG,gBAAgB,MACjB,cAAc,IAAI,mBAClB,cAAc,CAChB,CACF;MACK,IAAI,kCACT,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,mBAAmB,WAAW,CACvE;MACK,IAAI,mBACT,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,GAAG,cAAc,IAAI,CAAC,CAC/D;CAEF,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;CAE1C,IAAI,gBACF,mBAAmB,KAAK,QAAQ;CAElC,OAAO,2BAA2B,kBAAkB;AACtD;AAEA,IAAa,yBACX,WACA,eACA,eACuB;CACvB,IAAI,YAAY,YAAY;CAC5B,IAAI,WAAW;CACf,OAAO,cAAc,SAAS,QAAQ,GACpC;CAEF,OAAO;AACT;AAEA,IAAa,6BACX,WACA,kBACuB;CACvB,IAAI,YAAY,GAAG;CACnB,IAAI,eAAe;CACnB,OAAO,cAAc,SAAS,YAAY,GACxC;CAEF,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePagination.js","names":[],"sources":["../../../src/components/pagination/usePagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { PaginationContext } from './pagination-context/PaginationContext'\nimport type { PaginationContextValue } from './types'\n\nexport const usePagination = (): PaginationContextValue => {\n const context = React.useContext(PaginationContext)\n\n if (!context) {\n throw new Error(\n 'Ensure that you wrap any components with the PaginationProvider component'\n )\n }\n\n return context\n}\n"],"mappings":";;;AAKA,IAAa,sBAA8C;CACzD,MAAM,UAAU,QAAM,WAAW,kBAAkB;AAEnD,KAAI,CAAC,QACH,OAAM,IAAI,MACR,4EACD;AAGH,QAAO"}
1
+ {"version":3,"file":"usePagination.js","names":[],"sources":["../../../src/components/pagination/usePagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { PaginationContext } from './pagination-context/PaginationContext'\nimport type { PaginationContextValue } from './types'\n\nexport const usePagination = (): PaginationContextValue => {\n const context = React.useContext(PaginationContext)\n\n if (!context) {\n throw new Error(\n 'Ensure that you wrap any components with the PaginationProvider component'\n )\n }\n\n return context\n}\n"],"mappings":";;;AAKA,IAAa,sBAA8C;CACzD,MAAM,UAAU,QAAM,WAAW,iBAAiB;CAElD,IAAI,CAAC,SACH,MAAM,IAAI,MACR,2EACF;CAGF,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","names":[],"sources":["../../../src/components/password-field/PasswordField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { useFormCustomContext } from '~/components/form/useFormCustomContext'\nimport { PasswordInput } from '~/components/password-input/PasswordInput'\nimport { cn } from '~/styled'\n\ntype PasswordFieldProps = React.ComponentProps<typeof PasswordInput> &\n Omit<FieldElementWrapperProps, 'label'> & {\n label?: string\n }\n\nexport const PasswordField = ({\n className,\n hideLabel,\n label = 'Password',\n name,\n prompt = undefined,\n description,\n validation,\n appearance,\n theme,\n ...remainingProps\n}: PasswordFieldProps) => {\n const { register } = useFormContext()\n const context = useFormCustomContext()\n const { error } = useFieldError(name)\n\n const ref = validation ? register(validation) : register\n const formAppearance = context?.appearance || appearance\n const formTheme = context?.theme ?? theme\n\n return (\n <FieldWrapper\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={formAppearance}\n className={cn(className, 'relative')}\n >\n <PasswordInput\n autoComplete=\"current-password\"\n name={name}\n id={name}\n ref={ref}\n appearance={formAppearance}\n theme={formTheme}\n {...(error !== undefined && { state: 'error' })}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nPasswordField.displayName = 'PasswordField'\n"],"mappings":";;;;;;;;AAiBA,IAAa,iBAAiB,EAC5B,WACA,WACA,QAAQ,YACR,MACA,SAAS,KAAA,GACT,aACA,YACA,YACA,OACA,GAAG,qBACqB;CACxB,MAAM,EAAE,aAAa,gBAAgB;CACrC,MAAM,UAAU,sBAAsB;CACtC,MAAM,EAAE,UAAU,cAAc,KAAK;CAErC,MAAM,MAAM,aAAa,SAAS,WAAW,GAAG;CAChD,MAAM,iBAAiB,SAAS,cAAc;CAC9C,MAAM,YAAY,SAAS,SAAS;AAEpC,QACE,wBAAA,cAAC,cAAD;EACe;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,SAAS;EACvC,YAAY;EACZ,WAAW,GAAG,WAAW,WAAW;EAYvB,EAVb,wBAAA,cAAC,eAAD;EACE,cAAa;EACP;EACN,IAAI;EACC;EACL,YAAY;EACZ,OAAO;EACP,GAAK,UAAU,KAAA,KAAa,EAAE,OAAO,SAAS;EAC9C,GAAI;EACJ,CAAA,CACW;;AAInB,cAAc,cAAc"}
1
+ {"version":3,"file":"PasswordField.js","names":[],"sources":["../../../src/components/password-field/PasswordField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { useFormCustomContext } from '~/components/form/useFormCustomContext'\nimport { PasswordInput } from '~/components/password-input/PasswordInput'\nimport { cn } from '~/styled'\n\ntype PasswordFieldProps = React.ComponentProps<typeof PasswordInput> &\n Omit<FieldElementWrapperProps, 'label'> & {\n label?: string\n }\n\nexport const PasswordField = ({\n className,\n hideLabel,\n label = 'Password',\n name,\n prompt = undefined,\n description,\n validation,\n appearance,\n theme,\n ...remainingProps\n}: PasswordFieldProps) => {\n const { register } = useFormContext()\n const context = useFormCustomContext()\n const { error } = useFieldError(name)\n\n const ref = validation ? register(validation) : register\n const formAppearance = context?.appearance || appearance\n const formTheme = context?.theme ?? theme\n\n return (\n <FieldWrapper\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={formAppearance}\n className={cn(className, 'relative')}\n >\n <PasswordInput\n autoComplete=\"current-password\"\n name={name}\n id={name}\n ref={ref}\n appearance={formAppearance}\n theme={formTheme}\n {...(error !== undefined && { state: 'error' })}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nPasswordField.displayName = 'PasswordField'\n"],"mappings":";;;;;;;;AAiBA,IAAa,iBAAiB,EAC5B,WACA,WACA,QAAQ,YACR,MACA,SAAS,KAAA,GACT,aACA,YACA,YACA,OACA,GAAG,qBACqB;CACxB,MAAM,EAAE,aAAa,eAAe;CACpC,MAAM,UAAU,qBAAqB;CACrC,MAAM,EAAE,UAAU,cAAc,IAAI;CAEpC,MAAM,MAAM,aAAa,SAAS,UAAU,IAAI;CAChD,MAAM,iBAAiB,SAAS,cAAc;CAC9C,MAAM,YAAY,SAAS,SAAS;CAEpC,OACE,wBAAA,cAAC,cAAD;EACe;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,QAAQ;EACtC,YAAY;EACZ,WAAW,GAAG,WAAW,UAAU;CAYvB,GAVZ,wBAAA,cAAC,eAAD;EACE,cAAa;EACP;EACN,IAAI;EACC;EACL,YAAY;EACZ,OAAO;EACP,GAAK,UAAU,KAAA,KAAa,EAAE,OAAO,QAAQ;EAC7C,GAAI;CACL,CAAA,CACW;AAElB;AAEA,cAAc,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.js","names":[],"sources":["../../../src/components/password-input/PasswordInput.tsx"],"sourcesContent":["import { Eye, EyeCrossed } from '@atom-learning/icons'\nimport * as React from 'react'\nimport { useState } from 'react'\n\nimport { ActionIcon } from '~/components/action-icon/ActionIcon'\nimport { Icon } from '~/components/icon/Icon'\nimport type { InputProps } from '~/components/input/Input'\nimport { Input } from '~/components/input/Input'\nimport { cn } from '~/styled'\nimport { getFieldIconSize } from '~/utilities/style/get-icon-size'\n\ntype PasswordInputProps = Omit<InputProps, 'type'> & {\n hidePasswordText?: string\n showPasswordText?: string\n}\n\nexport const PasswordInput = React.forwardRef<\n HTMLInputElement,\n PasswordInputProps\n>(\n (\n {\n className,\n hidePasswordText = 'Hide password',\n showPasswordText = 'Show password',\n size = 'md',\n ...restProps\n },\n ref\n ) => {\n const [isPasswordVisible, setIsPasswordVisible] = useState<boolean>(false)\n const togglePasswordVisibility = () =>\n setIsPasswordVisible((currentState) => !currentState)\n\n const iconSize = React.useMemo(() => getFieldIconSize(size), [size])\n\n return (\n <div className={cn('relative', className)}>\n <Input\n {...restProps}\n size={size}\n type={isPasswordVisible ? 'text' : 'password'}\n ref={ref}\n className=\"pr-6\"\n />\n <ActionIcon\n appearance=\"simple\"\n theme=\"neutral\"\n label={isPasswordVisible ? hidePasswordText : showPasswordText}\n onClick={togglePasswordVisibility}\n onMouseDown={(e) => e.preventDefault()} // prevent focus being lost from password input\n size={iconSize}\n className={cn(\n size === 'lg' ? 'bottom-1' : 'bottom-0',\n 'absolute',\n 'right-0'\n )}\n >\n <Icon is={isPasswordVisible ? Eye : EyeCrossed} />\n </ActionIcon>\n </div>\n )\n }\n)\n\nPasswordInput.displayName = 'PasswordInput'\n"],"mappings":";;;;;;;;;AAgBA,IAAa,gBAAgB,QAAM,YAK/B,EACE,WACA,mBAAmB,iBACnB,mBAAmB,iBACnB,OAAO,MACP,GAAG,aAEL,QACG;CACH,MAAM,CAAC,mBAAmB,wBAAwB,SAAkB,MAAM;CAC1E,MAAM,iCACJ,sBAAsB,iBAAiB,CAAC,aAAa;CAEvD,MAAM,WAAW,QAAM,cAAc,iBAAiB,KAAK,EAAE,CAAC,KAAK,CAAC;AAEpE,QACE,wBAAA,cAAC,OAAD,EAAK,WAAW,GAAG,YAAY,UAAU,EAuBnC,EAtBJ,wBAAA,cAAC,OAAD;EACE,GAAI;EACE;EACN,MAAM,oBAAoB,SAAS;EAC9B;EACL,WAAU;EACV,CAAA,EACF,wBAAA,cAAC,YAAD;EACE,YAAW;EACX,OAAM;EACN,OAAO,oBAAoB,mBAAmB;EAC9C,SAAS;EACT,cAAc,MAAM,EAAE,gBAAgB;EACtC,MAAM;EACN,WAAW,GACT,SAAS,OAAO,aAAa,YAC7B,YACA,UACD;EAGU,EADX,wBAAA,cAAC,MAAD,EAAM,IAAI,oBAAoB,MAAM,YAAc,CAAA,CACvC,CACT;EAGX;AAED,cAAc,cAAc"}
1
+ {"version":3,"file":"PasswordInput.js","names":[],"sources":["../../../src/components/password-input/PasswordInput.tsx"],"sourcesContent":["import { Eye, EyeCrossed } from '@atom-learning/icons'\nimport * as React from 'react'\nimport { useState } from 'react'\n\nimport { ActionIcon } from '~/components/action-icon/ActionIcon'\nimport { Icon } from '~/components/icon/Icon'\nimport type { InputProps } from '~/components/input/Input'\nimport { Input } from '~/components/input/Input'\nimport { cn } from '~/styled'\nimport { getFieldIconSize } from '~/utilities/style/get-icon-size'\n\ntype PasswordInputProps = Omit<InputProps, 'type'> & {\n hidePasswordText?: string\n showPasswordText?: string\n}\n\nexport const PasswordInput = React.forwardRef<\n HTMLInputElement,\n PasswordInputProps\n>(\n (\n {\n className,\n hidePasswordText = 'Hide password',\n showPasswordText = 'Show password',\n size = 'md',\n ...restProps\n },\n ref\n ) => {\n const [isPasswordVisible, setIsPasswordVisible] = useState<boolean>(false)\n const togglePasswordVisibility = () =>\n setIsPasswordVisible((currentState) => !currentState)\n\n const iconSize = React.useMemo(() => getFieldIconSize(size), [size])\n\n return (\n <div className={cn('relative', className)}>\n <Input\n {...restProps}\n size={size}\n type={isPasswordVisible ? 'text' : 'password'}\n ref={ref}\n className=\"pr-6\"\n />\n <ActionIcon\n appearance=\"simple\"\n theme=\"neutral\"\n label={isPasswordVisible ? hidePasswordText : showPasswordText}\n onClick={togglePasswordVisibility}\n onMouseDown={(e) => e.preventDefault()} // prevent focus being lost from password input\n size={iconSize}\n className={cn(\n size === 'lg' ? 'bottom-1' : 'bottom-0',\n 'absolute',\n 'right-0'\n )}\n >\n <Icon is={isPasswordVisible ? Eye : EyeCrossed} />\n </ActionIcon>\n </div>\n )\n }\n)\n\nPasswordInput.displayName = 'PasswordInput'\n"],"mappings":";;;;;;;;;AAgBA,IAAa,gBAAgB,QAAM,YAK/B,EACE,WACA,mBAAmB,iBACnB,mBAAmB,iBACnB,OAAO,MACP,GAAG,aAEL,QACG;CACH,MAAM,CAAC,mBAAmB,wBAAwB,SAAkB,KAAK;CACzE,MAAM,iCACJ,sBAAsB,iBAAiB,CAAC,YAAY;CAEtD,MAAM,WAAW,QAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,IAAI,CAAC;CAEnE,OACE,wBAAA,cAAC,OAAD,EAAK,WAAW,GAAG,YAAY,SAAS,EAuBnC,GAtBH,wBAAA,cAAC,OAAD;EACE,GAAI;EACE;EACN,MAAM,oBAAoB,SAAS;EAC9B;EACL,WAAU;CACX,CAAA,GACD,wBAAA,cAAC,YAAD;EACE,YAAW;EACX,OAAM;EACN,OAAO,oBAAoB,mBAAmB;EAC9C,SAAS;EACT,cAAc,MAAM,EAAE,eAAe;EACrC,MAAM;EACN,WAAW,GACT,SAAS,OAAO,aAAa,YAC7B,YACA,SACF;CAGU,GADV,wBAAA,cAAC,MAAD,EAAM,IAAI,oBAAoB,MAAM,WAAa,CAAA,CACvC,CACT;AAET,CACF;AAEA,cAAc,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","names":[],"sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import { Anchor, Portal, Root, Trigger } from '@radix-ui/react-popover'\n\nimport { PopoverContent } from './PopoverContent'\n\nexport const Popover = Object.assign(Root, {\n Content: PopoverContent,\n Portal,\n Anchor,\n Trigger\n})\n\nRoot.displayName = 'Popover'\n"],"mappings":";;;AAIA,IAAa,UAAU,OAAO,OAAO,MAAM;CACzC,SAAS;CACT;CACA;CACA;CACD,CAAC;AAEF,KAAK,cAAc"}
1
+ {"version":3,"file":"Popover.js","names":[],"sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import { Anchor, Portal, Root, Trigger } from '@radix-ui/react-popover'\n\nimport { PopoverContent } from './PopoverContent'\n\nexport const Popover = Object.assign(Root, {\n Content: PopoverContent,\n Portal,\n Anchor,\n Trigger\n})\n\nRoot.displayName = 'Popover'\n"],"mappings":";;;AAIA,IAAa,UAAU,OAAO,OAAO,MAAM;CACzC,SAAS;CACT;CACA;CACA;AACF,CAAC;AAED,KAAK,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverContent.js","names":[],"sources":["../../../src/components/popover/PopoverContent.tsx"],"sourcesContent":["import { Close as CloseIcon } from '@atom-learning/icons'\nimport { Arrow, Close, Content } from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\n\nconst StyledContent = styled(Content, {\n base: [\n 'bg-white',\n 'rounded-md',\n 'shadow-lg',\n 'max-w-[90vw]',\n 'p-6',\n 'pr-10',\n 'relative',\n 'z-10',\n 'will-change-transform',\n 'will-change-opacity',\n 'animation-duration-75',\n '[--slide-opacity-out:0]',\n 'data-[side=top]:[--slide-direction-out-y:-4px]',\n 'data-[side=right]:[--slide-direction-out-x:4px]',\n 'data-[side=bottom]:[--slide-direction-out-y:4px]',\n 'data-[side=left]:[--slide-direction-out-x:-4px]',\n 'motion-safe:data-[state=open]:animate-slide-direction-in',\n 'motion-safe:data-[state=closed]:animate-slide-direction-out'\n ],\n variants: {\n size: {\n sm: ['max-w-50'],\n md: ['max-w-100'],\n lg: ['max-w-150']\n }\n }\n})\n\nconst StyledArrow = styled(Arrow, {\n base: ['fill-white', 'z-1', 'in-data-[align=end]:mx-6']\n})\n\ntype PopoverContentProps = React.ComponentProps<typeof StyledContent> &\n React.ComponentProps<typeof Content> & {\n closePopoverText?: string\n showCloseButton?: boolean\n }\n\nexport const PopoverContent = ({\n children,\n side = 'top',\n sideOffset = 8,\n closePopoverText = 'Close popover',\n showCloseButton = true,\n size = 'md',\n ...remainingProps\n}: PopoverContentProps) => (\n <StyledContent\n size={size}\n side={side}\n sideOffset={sideOffset}\n {...remainingProps}\n >\n {showCloseButton && (\n <ActionIcon\n as={Close}\n label={closePopoverText}\n size=\"md\"\n hasTooltip={false}\n theme=\"neutral\"\n className=\"absolute top-0.5 right-0.5\"\n >\n <Icon is={CloseIcon} />\n </ActionIcon>\n )}\n {children}\n <StyledArrow width={16} height={8} />\n </StyledContent>\n)\n"],"mappings":";;;;;;;AASA,IAAM,gBAAgB,OAAO,SAAS;CACpC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW;EAChB,IAAI,CAAC,YAAY;EACjB,IAAI,CAAC,YAAY;EAClB,EACF;CACF,CAAC;AAEF,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CAAC;CAAc;CAAO;CAA2B,EACxD,CAAC;AAQF,IAAa,kBAAkB,EAC7B,UACA,OAAO,OACP,aAAa,GACb,mBAAmB,iBACnB,kBAAkB,MAClB,OAAO,MACP,GAAG,qBAEH,wBAAA,cAAC,eAAD;CACQ;CACA;CACM;CACZ,GAAI;CAgBU,EAdb,mBACC,wBAAA,cAAC,YAAD;CACE,IAAI;CACJ,OAAO;CACP,MAAK;CACL,YAAY;CACZ,OAAM;CACN,WAAU;CAGC,EADX,wBAAA,cAAC,MAAD,EAAM,IAAI,OAAa,CAAA,CACZ,EAEd,UACD,wBAAA,cAAC,aAAD;CAAa,OAAO;CAAI,QAAQ;CAAK,CAAA,CACvB"}
1
+ {"version":3,"file":"PopoverContent.js","names":[],"sources":["../../../src/components/popover/PopoverContent.tsx"],"sourcesContent":["import { Close as CloseIcon } from '@atom-learning/icons'\nimport { Arrow, Close, Content } from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\n\nconst StyledContent = styled(Content, {\n base: [\n 'bg-white',\n 'rounded-md',\n 'shadow-lg',\n 'max-w-[90vw]',\n 'p-6',\n 'pr-10',\n 'relative',\n 'z-10',\n 'will-change-transform',\n 'will-change-opacity',\n 'animation-duration-75',\n '[--slide-opacity-out:0]',\n 'data-[side=top]:[--slide-direction-out-y:-4px]',\n 'data-[side=right]:[--slide-direction-out-x:4px]',\n 'data-[side=bottom]:[--slide-direction-out-y:4px]',\n 'data-[side=left]:[--slide-direction-out-x:-4px]',\n 'motion-safe:data-[state=open]:animate-slide-direction-in',\n 'motion-safe:data-[state=closed]:animate-slide-direction-out'\n ],\n variants: {\n size: {\n sm: ['max-w-50'],\n md: ['max-w-100'],\n lg: ['max-w-150']\n }\n }\n})\n\nconst StyledArrow = styled(Arrow, {\n base: ['fill-white', 'z-1', 'in-data-[align=end]:mx-6']\n})\n\ntype PopoverContentProps = React.ComponentProps<typeof StyledContent> &\n React.ComponentProps<typeof Content> & {\n closePopoverText?: string\n showCloseButton?: boolean\n }\n\nexport const PopoverContent = ({\n children,\n side = 'top',\n sideOffset = 8,\n closePopoverText = 'Close popover',\n showCloseButton = true,\n size = 'md',\n ...remainingProps\n}: PopoverContentProps) => (\n <StyledContent\n size={size}\n side={side}\n sideOffset={sideOffset}\n {...remainingProps}\n >\n {showCloseButton && (\n <ActionIcon\n as={Close}\n label={closePopoverText}\n size=\"md\"\n hasTooltip={false}\n theme=\"neutral\"\n className=\"absolute top-0.5 right-0.5\"\n >\n <Icon is={CloseIcon} />\n </ActionIcon>\n )}\n {children}\n <StyledArrow width={16} height={8} />\n </StyledContent>\n)\n"],"mappings":";;;;;;;AASA,IAAM,gBAAgB,OAAO,SAAS;CACpC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,UAAU;EACf,IAAI,CAAC,WAAW;EAChB,IAAI,CAAC,WAAW;CAClB,EACF;AACF,CAAC;AAED,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CAAC;CAAc;CAAO;AAA0B,EACxD,CAAC;AAQD,IAAa,kBAAkB,EAC7B,UACA,OAAO,OACP,aAAa,GACb,mBAAmB,iBACnB,kBAAkB,MAClB,OAAO,MACP,GAAG,qBAEH,wBAAA,cAAC,eAAD;CACQ;CACA;CACM;CACZ,GAAI;AAgBS,GAdZ,mBACC,wBAAA,cAAC,YAAD;CACE,IAAI;CACJ,OAAO;CACP,MAAK;CACL,YAAY;CACZ,OAAM;CACN,WAAU;AAGA,GADV,wBAAA,cAAC,MAAD,EAAM,IAAI,MAAY,CAAA,CACZ,GAEb,UACD,wBAAA,cAAC,aAAD;CAAa,OAAO;CAAI,QAAQ;AAAI,CAAA,CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","names":[],"sources":["../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import * as Progress from '@radix-ui/react-progress'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nconst StyledProgressBar = styled(\n Progress.Root,\n {\n base: [\n 'rounded-full',\n 'bg-grey-200',\n 'relative',\n 'overflow-hidden',\n 'w-full'\n ],\n variants: {\n size: {\n sm: ['h-1'],\n md: ['h-2']\n },\n theme: {\n primary: ['text-primary-800'],\n info: ['text-info'],\n success: ['text-success'],\n warning: ['text-warning'],\n danger: ['text-danger'],\n neutral: ['bg-grey-400', 'text-grey-800']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nconst StyledIndicator = styled(Progress.Indicator, {\n base: [\n 'bg-current',\n 'rounded-full',\n 'box-border',\n 'h-full',\n 'absolute',\n 'transition-all',\n 'duration-300',\n 'ease-out'\n ]\n})\n\ntype ProgressBarProps = React.ComponentPropsWithoutRef<\n typeof StyledProgressBar\n> &\n (\n | { id: string; 'aria-label'?: string }\n | { 'aria-label': string; id?: string }\n )\n\nexport const ProgressBar = ({\n value,\n max = 100,\n size = 'md',\n theme = 'primary',\n ...remainingProps\n}: ProgressBarProps) => (\n <StyledProgressBar\n value={value}\n max={max}\n theme={theme}\n size={size}\n {...remainingProps}\n >\n <StyledIndicator\n className=\"w-full translate-x-(--progress)\"\n style={{\n '--progress': `-${100 - ((value || 0) / max) * 100}%`\n }}\n />\n </StyledProgressBar>\n)\n\nProgressBar.displayName = 'ProgressBar'\n"],"mappings":";;;;AAKA,IAAM,oBAAoB,OACxB,SAAS,MACT;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACD;CACD,UAAU;EACR,MAAM;GACJ,IAAI,CAAC,MAAM;GACX,IAAI,CAAC,MAAM;GACZ;EACD,OAAO;GACL,SAAS,CAAC,mBAAmB;GAC7B,MAAM,CAAC,YAAY;GACnB,SAAS,CAAC,eAAe;GACzB,SAAS,CAAC,eAAe;GACzB,QAAQ,CAAC,cAAc;GACvB,SAAS,CAAC,eAAe,gBAAgB;GAC1C;EACF;CACF,EACD,EAAE,2BAA2B,MAAM,CACpC;AAED,IAAM,kBAAkB,OAAO,SAAS,WAAW,EACjD,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EACF,CAAC;AAUF,IAAa,eAAe,EAC1B,OACA,MAAM,KACN,OAAO,MACP,QAAQ,WACR,GAAG,qBAEH,wBAAA,cAAC,mBAAD;CACS;CACF;CACE;CACD;CACN,GAAI;CAQc,EANlB,wBAAA,cAAC,iBAAD;CACE,WAAU;CACV,OAAO,EACL,cAAc,IAAI,OAAQ,SAAS,KAAK,MAAO,IAAI,IACpD;CACD,CAAA,CACgB;AAGtB,YAAY,cAAc"}
1
+ {"version":3,"file":"ProgressBar.js","names":[],"sources":["../../../src/components/progress-bar/ProgressBar.tsx"],"sourcesContent":["import * as Progress from '@radix-ui/react-progress'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nconst StyledProgressBar = styled(\n Progress.Root,\n {\n base: [\n 'rounded-full',\n 'bg-grey-200',\n 'relative',\n 'overflow-hidden',\n 'w-full'\n ],\n variants: {\n size: {\n sm: ['h-1'],\n md: ['h-2']\n },\n theme: {\n primary: ['text-primary-800'],\n info: ['text-info'],\n success: ['text-success'],\n warning: ['text-warning'],\n danger: ['text-danger'],\n neutral: ['bg-grey-400', 'text-grey-800']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nconst StyledIndicator = styled(Progress.Indicator, {\n base: [\n 'bg-current',\n 'rounded-full',\n 'box-border',\n 'h-full',\n 'absolute',\n 'transition-all',\n 'duration-300',\n 'ease-out'\n ]\n})\n\ntype ProgressBarProps = React.ComponentPropsWithoutRef<\n typeof StyledProgressBar\n> &\n (\n | { id: string; 'aria-label'?: string }\n | { 'aria-label': string; id?: string }\n )\n\nexport const ProgressBar = ({\n value,\n max = 100,\n size = 'md',\n theme = 'primary',\n ...remainingProps\n}: ProgressBarProps) => (\n <StyledProgressBar\n value={value}\n max={max}\n theme={theme}\n size={size}\n {...remainingProps}\n >\n <StyledIndicator\n className=\"w-full translate-x-(--progress)\"\n style={{\n '--progress': `-${100 - ((value || 0) / max) * 100}%`\n }}\n />\n </StyledProgressBar>\n)\n\nProgressBar.displayName = 'ProgressBar'\n"],"mappings":";;;;AAKA,IAAM,oBAAoB,OACxB,SAAS,MACT;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,MAAM;GACJ,IAAI,CAAC,KAAK;GACV,IAAI,CAAC,KAAK;EACZ;EACA,OAAO;GACL,SAAS,CAAC,kBAAkB;GAC5B,MAAM,CAAC,WAAW;GAClB,SAAS,CAAC,cAAc;GACxB,SAAS,CAAC,cAAc;GACxB,QAAQ,CAAC,aAAa;GACtB,SAAS,CAAC,eAAe,eAAe;EAC1C;CACF;AACF,GACA,EAAE,2BAA2B,KAAK,CACpC;AAEA,IAAM,kBAAkB,OAAO,SAAS,WAAW,EACjD,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAUD,IAAa,eAAe,EAC1B,OACA,MAAM,KACN,OAAO,MACP,QAAQ,WACR,GAAG,qBAEH,wBAAA,cAAC,mBAAD;CACS;CACF;CACE;CACD;CACN,GAAI;AAQa,GANjB,wBAAA,cAAC,iBAAD;CACE,WAAU;CACV,OAAO,EACL,cAAc,IAAI,OAAQ,SAAS,KAAK,MAAO,IAAI,GACrD;AACD,CAAA,CACgB;AAGrB,YAAY,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","names":[],"sources":["../../../src/components/radio-button/RadioButton.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { Override } from '~/utilities/types'\n\nconst StyledRadioButton = styled(\n RadioGroup.Item,\n {\n base: [\n 'items-center',\n 'appearance-none',\n 'bg-transparent',\n 'border',\n 'border-grey-800',\n 'rounded-full',\n 'text-white',\n 'cursor-pointer',\n 'flex',\n 'justify-center',\n 'p-0',\n 'size-4',\n 'transition-all',\n 'duration-50',\n 'ease-out',\n 'focus:outline-2',\n 'focus:outline-offset-1',\n 'focus:outline-primary-800',\n 'focus:outline-solid',\n 'data-[state=checked]:bg-primary-800',\n 'data-[state=checked]:border-primary-800',\n 'disabled:bg-grey-200',\n 'disabled:border-grey-800',\n 'disabled:cursor-not-allowed',\n 'disabled:text-grey-800',\n 'disabled:data-[state=checked]:bg-grey-800',\n 'disabled:data-[state=checked]:border-grey-800'\n ],\n variants: {\n size: {\n md: ['size-4'],\n lg: ['-mt-1', 'size-6']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nconst StyledIndicator = styled(\n RadioGroup.Indicator,\n {\n base: ['size-1.5', 'rounded-full', 'bg-current', 'absolute'],\n variants: {\n size: {\n md: ['size-1.5'],\n lg: ['size-3']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\ntype RadioButtonProps = Override<\n React.ComponentProps<typeof StyledRadioButton>,\n {\n as?: never\n } & {\n 'aria-label'?: string\n }\n>\n\nexport const RadioButton = ({ size, ...props }: RadioButtonProps) => {\n return (\n <StyledRadioButton {...props} size={size}>\n <StyledIndicator size={size} />\n </StyledRadioButton>\n )\n}\n\nRadioButton.displayName = 'RadioButton'\n"],"mappings":";;;;AAMA,IAAM,oBAAoB,OACxB,WAAW,MACX;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,SAAS;EACd,IAAI,CAAC,SAAS,SAAS;EACxB,EACF;CACF,EACD,EAAE,2BAA2B,MAAM,CACpC;AAED,IAAM,kBAAkB,OACtB,WAAW,WACX;CACE,MAAM;EAAC;EAAY;EAAgB;EAAc;EAAW;CAC5D,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW;EAChB,IAAI,CAAC,SAAS;EACf,EACF;CACF,EACD,EAAE,2BAA2B,MAAM,CACpC;AAWD,IAAa,eAAe,EAAE,MAAM,GAAG,YAA8B;AACnE,QACE,wBAAA,cAAC,mBAAD;EAAmB,GAAI;EAAa;EAEhB,EADlB,wBAAA,cAAC,iBAAD,EAAuB,MAAQ,CAAA,CACb;;AAIxB,YAAY,cAAc"}
1
+ {"version":3,"file":"RadioButton.js","names":[],"sources":["../../../src/components/radio-button/RadioButton.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { Override } from '~/utilities/types'\n\nconst StyledRadioButton = styled(\n RadioGroup.Item,\n {\n base: [\n 'items-center',\n 'appearance-none',\n 'bg-transparent',\n 'border',\n 'border-grey-800',\n 'rounded-full',\n 'text-white',\n 'cursor-pointer',\n 'flex',\n 'justify-center',\n 'p-0',\n 'size-4',\n 'transition-all',\n 'duration-50',\n 'ease-out',\n 'focus:outline-2',\n 'focus:outline-offset-1',\n 'focus:outline-primary-800',\n 'focus:outline-solid',\n 'data-[state=checked]:bg-primary-800',\n 'data-[state=checked]:border-primary-800',\n 'disabled:bg-grey-200',\n 'disabled:border-grey-800',\n 'disabled:cursor-not-allowed',\n 'disabled:text-grey-800',\n 'disabled:data-[state=checked]:bg-grey-800',\n 'disabled:data-[state=checked]:border-grey-800'\n ],\n variants: {\n size: {\n md: ['size-4'],\n lg: ['-mt-1', 'size-6']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nconst StyledIndicator = styled(\n RadioGroup.Indicator,\n {\n base: ['size-1.5', 'rounded-full', 'bg-current', 'absolute'],\n variants: {\n size: {\n md: ['size-1.5'],\n lg: ['size-3']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\ntype RadioButtonProps = Override<\n React.ComponentProps<typeof StyledRadioButton>,\n {\n as?: never\n } & {\n 'aria-label'?: string\n }\n>\n\nexport const RadioButton = ({ size, ...props }: RadioButtonProps) => {\n return (\n <StyledRadioButton {...props} size={size}>\n <StyledIndicator size={size} />\n </StyledRadioButton>\n )\n}\n\nRadioButton.displayName = 'RadioButton'\n"],"mappings":";;;;AAMA,IAAM,oBAAoB,OACxB,WAAW,MACX;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,QAAQ;EACb,IAAI,CAAC,SAAS,QAAQ;CACxB,EACF;AACF,GACA,EAAE,2BAA2B,KAAK,CACpC;AAEA,IAAM,kBAAkB,OACtB,WAAW,WACX;CACE,MAAM;EAAC;EAAY;EAAgB;EAAc;CAAU;CAC3D,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,UAAU;EACf,IAAI,CAAC,QAAQ;CACf,EACF;AACF,GACA,EAAE,2BAA2B,KAAK,CACpC;AAWA,IAAa,eAAe,EAAE,MAAM,GAAG,YAA8B;CACnE,OACE,wBAAA,cAAC,mBAAD;EAAmB,GAAI;EAAa;CAEjB,GADjB,wBAAA,cAAC,iBAAD,EAAuB,KAAO,CAAA,CACb;AAEvB;AAEA,YAAY,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButtonGroup.js","names":[],"sources":["../../../src/components/radio-button/RadioButtonGroup.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\n\nimport { styled } from '~/styled'\n\nexport const RadioButtonGroup = styled(RadioGroup.Root, {\n base: ['flex', 'flex-wrap'],\n variants: {\n direction: {\n row: ['*:not-last:mr-8', 'flex-row'],\n column: ['flex-col']\n }\n }\n})\n\nRadioButtonGroup.displayName = 'RadioButtonGroup'\n"],"mappings":";;;AAIA,IAAa,mBAAmB,OAAO,WAAW,MAAM;CACtD,MAAM,CAAC,QAAQ,YAAY;CAC3B,UAAU,EACR,WAAW;EACT,KAAK,CAAC,mBAAmB,WAAW;EACpC,QAAQ,CAAC,WAAW;EACrB,EACF;CACF,CAAC;AAEF,iBAAiB,cAAc"}
1
+ {"version":3,"file":"RadioButtonGroup.js","names":[],"sources":["../../../src/components/radio-button/RadioButtonGroup.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\n\nimport { styled } from '~/styled'\n\nexport const RadioButtonGroup = styled(RadioGroup.Root, {\n base: ['flex', 'flex-wrap'],\n variants: {\n direction: {\n row: ['*:not-last:mr-8', 'flex-row'],\n column: ['flex-col']\n }\n }\n})\n\nRadioButtonGroup.displayName = 'RadioButtonGroup'\n"],"mappings":";;;AAIA,IAAa,mBAAmB,OAAO,WAAW,MAAM;CACtD,MAAM,CAAC,QAAQ,WAAW;CAC1B,UAAU,EACR,WAAW;EACT,KAAK,CAAC,mBAAmB,UAAU;EACnC,QAAQ,CAAC,UAAU;CACrB,EACF;AACF,CAAC;AAED,iBAAiB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButtonField.js","names":[],"sources":["../../../src/components/radio-button-field/RadioButtonField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport { Description as FieldDescription } from '~/components/field-wrapper/FieldDescription'\nimport { FieldElementWrapperProps } from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { InlineMessage } from '~/components/inline-message/InlineMessage'\nimport { Label } from '~/components/label/Label'\nimport { RadioButtonGroup } from '~/components/radio-button/RadioButtonGroup'\nimport { styled } from '~/styled'\n\nimport { RadioField } from './RadioField'\n\nconst Fieldset = styled('fieldset', {\n base: ['border-0', 'p-0', 'm-0', 'min-w-0']\n})\n\ntype RadioButtonFieldProps = React.ComponentProps<typeof RadioButtonGroup> &\n FieldElementWrapperProps\n\nconst RadioButtonFieldComponent = ({\n children,\n className,\n direction = 'column',\n defaultValue,\n value,\n description,\n label,\n name,\n validation,\n onValueChange,\n ...remainingProps\n}: RadioButtonFieldProps) => {\n const { control } = useFormContext()\n const {\n field: { ref, onChange, value: innerValue }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n const { error } = useFieldError(name)\n\n React.useEffect(() => {\n // Update the react-hook-form inner value to match what is passed in.\n if (typeof value !== 'undefined') onChange(value)\n }, [value])\n\n return (\n <Fieldset className={className}>\n <Label\n as=\"legend\"\n required={Boolean(validation?.required)}\n className=\"mb-3 p-0\"\n >\n {label}\n </Label>\n {description && (\n <FieldDescription className=\"mb-3\">{description}</FieldDescription>\n )}\n\n <RadioButtonGroup\n ref={ref}\n direction={direction}\n defaultValue={defaultValue}\n onValueChange={(newValue) => {\n onChange(newValue)\n onValueChange?.(newValue)\n }}\n value={innerValue}\n {...remainingProps}\n >\n {children}\n </RadioButtonGroup>\n\n {error && <InlineMessage className=\"mt-2\">{error}</InlineMessage>}\n </Fieldset>\n )\n}\n\nexport const RadioButtonField = Object.assign(RadioButtonFieldComponent, {\n Item: RadioField\n})\n\nRadioButtonFieldComponent.displayName = 'RadioButtonField'\n"],"mappings":";;;;;;;;;;AAaA,IAAM,WAAW,OAAO,YAAY,EAClC,MAAM;CAAC;CAAY;CAAO;CAAO;CAAU,EAC5C,CAAC;AAKF,IAAM,6BAA6B,EACjC,UACA,WACA,YAAY,UACZ,cACA,OACA,aACA,OACA,MACA,YACA,eACA,GAAG,qBACwB;CAC3B,MAAM,EAAE,YAAY,gBAAgB;CACpC,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,iBAC7B,cAAc;EAChB;EACA;EACA,OAAO;EACP;EACD,CAAC;CACF,MAAM,EAAE,UAAU,cAAc,KAAK;AAErC,SAAM,gBAAgB;AAEpB,MAAI,OAAO,UAAU,YAAa,UAAS,MAAM;IAChD,CAAC,MAAM,CAAC;AAEX,QACE,wBAAA,cAAC,UAAD,EAAqB,WA2BV,EA1BT,wBAAA,cAAC,OAAD;EACE,IAAG;EACH,UAAU,QAAQ,YAAY,SAAS;EACvC,WAAU;EAGJ,EADL,MACK,EACP,eACC,wBAAA,cAAC,aAAD,EAAkB,WAAU,QAAuC,EAA/B,YAA+B,EAGrE,wBAAA,cAAC,kBAAD;EACO;EACM;EACG;EACd,gBAAgB,aAAa;AAC3B,YAAS,SAAS;AAClB,mBAAgB,SAAS;;EAE3B,OAAO;EACP,GAAI;EAGa,EADhB,SACgB,EAElB,SAAS,wBAAA,cAAC,eAAD,EAAe,WAAU,QAA8B,EAAtB,MAAsB,CACxD;;AAIf,IAAa,mBAAmB,OAAO,OAAO,2BAA2B,EACvE,MAAM,YACP,CAAC;AAEF,0BAA0B,cAAc"}
1
+ {"version":3,"file":"RadioButtonField.js","names":[],"sources":["../../../src/components/radio-button-field/RadioButtonField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport { Description as FieldDescription } from '~/components/field-wrapper/FieldDescription'\nimport { FieldElementWrapperProps } from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { InlineMessage } from '~/components/inline-message/InlineMessage'\nimport { Label } from '~/components/label/Label'\nimport { RadioButtonGroup } from '~/components/radio-button/RadioButtonGroup'\nimport { styled } from '~/styled'\n\nimport { RadioField } from './RadioField'\n\nconst Fieldset = styled('fieldset', {\n base: ['border-0', 'p-0', 'm-0', 'min-w-0']\n})\n\ntype RadioButtonFieldProps = React.ComponentProps<typeof RadioButtonGroup> &\n FieldElementWrapperProps\n\nconst RadioButtonFieldComponent = ({\n children,\n className,\n direction = 'column',\n defaultValue,\n value,\n description,\n label,\n name,\n validation,\n onValueChange,\n ...remainingProps\n}: RadioButtonFieldProps) => {\n const { control } = useFormContext()\n const {\n field: { ref, onChange, value: innerValue }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n const { error } = useFieldError(name)\n\n React.useEffect(() => {\n // Update the react-hook-form inner value to match what is passed in.\n if (typeof value !== 'undefined') onChange(value)\n }, [value])\n\n return (\n <Fieldset className={className}>\n <Label\n as=\"legend\"\n required={Boolean(validation?.required)}\n className=\"mb-3 p-0\"\n >\n {label}\n </Label>\n {description && (\n <FieldDescription className=\"mb-3\">{description}</FieldDescription>\n )}\n\n <RadioButtonGroup\n ref={ref}\n direction={direction}\n defaultValue={defaultValue}\n onValueChange={(newValue) => {\n onChange(newValue)\n onValueChange?.(newValue)\n }}\n value={innerValue}\n {...remainingProps}\n >\n {children}\n </RadioButtonGroup>\n\n {error && <InlineMessage className=\"mt-2\">{error}</InlineMessage>}\n </Fieldset>\n )\n}\n\nexport const RadioButtonField = Object.assign(RadioButtonFieldComponent, {\n Item: RadioField\n})\n\nRadioButtonFieldComponent.displayName = 'RadioButtonField'\n"],"mappings":";;;;;;;;;;AAaA,IAAM,WAAW,OAAO,YAAY,EAClC,MAAM;CAAC;CAAY;CAAO;CAAO;AAAS,EAC5C,CAAC;AAKD,IAAM,6BAA6B,EACjC,UACA,WACA,YAAY,UACZ,cACA,OACA,aACA,OACA,MACA,YACA,eACA,GAAG,qBACwB;CAC3B,MAAM,EAAE,YAAY,eAAe;CACnC,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,iBAC7B,cAAc;EAChB;EACA;EACA,OAAO;EACP;CACF,CAAC;CACD,MAAM,EAAE,UAAU,cAAc,IAAI;CAEpC,QAAM,gBAAgB;EAEpB,IAAI,OAAO,UAAU,aAAa,SAAS,KAAK;CAClD,GAAG,CAAC,KAAK,CAAC;CAEV,OACE,wBAAA,cAAC,UAAD,EAAqB,UA2BX,GA1BR,wBAAA,cAAC,OAAD;EACE,IAAG;EACH,UAAU,QAAQ,YAAY,QAAQ;EACtC,WAAU;CAGL,GADJ,KACI,GACN,eACC,wBAAA,cAAC,aAAD,EAAkB,WAAU,OAAsC,GAA9B,WAA8B,GAGpE,wBAAA,cAAC,kBAAD;EACO;EACM;EACG;EACd,gBAAgB,aAAa;GAC3B,SAAS,QAAQ;GACjB,gBAAgB,QAAQ;EAC1B;EACA,OAAO;EACP,GAAI;CAGY,GADf,QACe,GAEjB,SAAS,wBAAA,cAAC,eAAD,EAAe,WAAU,OAA6B,GAArB,KAAqB,CACxD;AAEd;AAEA,IAAa,mBAAmB,OAAO,OAAO,2BAA2B,EACvE,MAAM,WACR,CAAC;AAED,0BAA0B,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioField.js","names":[],"sources":["../../../src/components/radio-button-field/RadioField.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { InlineFieldWrapper } from '~/components/field-wrapper/InlineFieldWrapper'\nimport { ValidationOptions } from '~/components/form/validation'\nimport { RadioButton } from '~/components/radio-button/RadioButton'\n\ntype RadioFieldProps = {\n className?: string\n defaultChecked?: boolean\n error?: string\n label: string\n validation?: ValidationOptions\n} & React.ComponentProps<typeof RadioButton>\n\nexport const RadioField = ({\n className,\n label,\n value,\n ...remainingProps\n}: RadioFieldProps) => (\n <InlineFieldWrapper className={className} label={label}>\n <RadioButton value={value} {...remainingProps} />\n </InlineFieldWrapper>\n)\n\nRadioField.displayName = 'RadioField'\n"],"mappings":";;;;AAcA,IAAa,cAAc,EACzB,WACA,OACA,OACA,GAAG,qBAEH,wBAAA,cAAC,oBAAD;CAA+B;CAAkB;CAE5B,EADnB,wBAAA,cAAC,aAAD;CAAoB;CAAO,GAAI;CAAkB,CAAA,CAC9B;AAGvB,WAAW,cAAc"}
1
+ {"version":3,"file":"RadioField.js","names":[],"sources":["../../../src/components/radio-button-field/RadioField.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { InlineFieldWrapper } from '~/components/field-wrapper/InlineFieldWrapper'\nimport { ValidationOptions } from '~/components/form/validation'\nimport { RadioButton } from '~/components/radio-button/RadioButton'\n\ntype RadioFieldProps = {\n className?: string\n defaultChecked?: boolean\n error?: string\n label: string\n validation?: ValidationOptions\n} & React.ComponentProps<typeof RadioButton>\n\nexport const RadioField = ({\n className,\n label,\n value,\n ...remainingProps\n}: RadioFieldProps) => (\n <InlineFieldWrapper className={className} label={label}>\n <RadioButton value={value} {...remainingProps} />\n </InlineFieldWrapper>\n)\n\nRadioField.displayName = 'RadioField'\n"],"mappings":";;;;AAcA,IAAa,cAAc,EACzB,WACA,OACA,OACA,GAAG,qBAEH,wBAAA,cAAC,oBAAD;CAA+B;CAAkB;AAE7B,GADlB,wBAAA,cAAC,aAAD;CAAoB;CAAO,GAAI;AAAiB,CAAA,CAC9B;AAGtB,WAAW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioCard.js","names":[],"sources":["../../../src/components/radio-card/RadioCard.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nconst StyledRadioCard = styled(RadioGroup.Item, {\n base: [\n 'items-center',\n 'bg-white',\n 'border',\n 'border-grey-600',\n 'rounded-sm',\n 'cursor-pointer',\n 'flex',\n 'text-left',\n 'data-[state=checked]:-outline-offset-2',\n 'data-[state=checked]:outline-2',\n 'data-[state=checked]:outline-primary-800',\n 'data-[state=checked]:outline-solid'\n ],\n variants: {\n align: {\n left: ['flex-row'],\n right: ['flex-row-reverse']\n },\n size: {\n md: ['px-4', 'py-3'],\n lg: ['px-8', 'py-4']\n },\n isFullWidth: {\n true: ['w-full'],\n false: ['w-max']\n }\n }\n})\n\nconst RadioButton = styled('div', {\n base: [\n 'items-center',\n 'appearance-none',\n 'bg-transparent',\n 'border',\n 'border-grey-900',\n 'rounded-full',\n 'flex',\n 'shrink-0',\n 'justify-center',\n 'p-0',\n 'size-4',\n 'transition-all',\n 'duration-50',\n 'ease-out',\n 'in-data-[state=checked]:bg-primary-800',\n 'in-data-[state=checked]:border-primary-800'\n ],\n variants: {\n containerIsFullWidth: {\n true: [],\n false: []\n },\n align: {\n left: ['mr-4'],\n right: []\n }\n },\n compoundVariants: [\n {\n containerIsFullWidth: true,\n align: 'right',\n class: ['ml-auto']\n },\n {\n containerIsFullWidth: false,\n align: 'right',\n class: ['ml-4']\n }\n ]\n})\n\nconst Indicator = styled(RadioGroup.Indicator, {\n base: ['bg-white', 'rounded-full', 'absolute', 'size-1.5']\n})\n\ntype RadioCardProps = React.ComponentProps<typeof StyledRadioCard>\n\nexport const RadioCard = ({\n children,\n isFullWidth = false,\n size = 'md',\n align = 'left',\n ...rest\n}: RadioCardProps) => (\n <StyledRadioCard\n {...rest}\n align={align}\n isFullWidth={isFullWidth}\n size={size}\n >\n <RadioButton align={align} containerIsFullWidth={isFullWidth}>\n <Indicator />\n </RadioButton>\n <div>{children}</div>\n </StyledRadioCard>\n)\n"],"mappings":";;;;AAKA,IAAM,kBAAkB,OAAO,WAAW,MAAM;CAC9C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU;EACR,OAAO;GACL,MAAM,CAAC,WAAW;GAClB,OAAO,CAAC,mBAAmB;GAC5B;EACD,MAAM;GACJ,IAAI,CAAC,QAAQ,OAAO;GACpB,IAAI,CAAC,QAAQ,OAAO;GACrB;EACD,aAAa;GACX,MAAM,CAAC,SAAS;GAChB,OAAO,CAAC,QAAQ;GACjB;EACF;CACF,CAAC;AAEF,IAAM,cAAc,OAAO,OAAO;CAChC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU;EACR,sBAAsB;GACpB,MAAM,EAAE;GACR,OAAO,EAAE;GACV;EACD,OAAO;GACL,MAAM,CAAC,OAAO;GACd,OAAO,EAAE;GACV;EACF;CACD,kBAAkB,CAChB;EACE,sBAAsB;EACtB,OAAO;EACP,OAAO,CAAC,UAAU;EACnB,EACD;EACE,sBAAsB;EACtB,OAAO;EACP,OAAO,CAAC,OAAO;EAChB,CACF;CACF,CAAC;AAEF,IAAM,YAAY,OAAO,WAAW,WAAW,EAC7C,MAAM;CAAC;CAAY;CAAgB;CAAY;CAAW,EAC3D,CAAC;AAIF,IAAa,aAAa,EACxB,UACA,cAAc,OACd,OAAO,MACP,QAAQ,QACR,GAAG,WAEH,wBAAA,cAAC,iBAAD;CACE,GAAI;CACG;CACM;CACP;CAMU,EAJhB,wBAAA,cAAC,aAAD;CAAoB;CAAO,sBAAsB;CAEnC,EADZ,wBAAA,cAAC,WAAA,KAAY,CACD,EACd,wBAAA,cAAC,OAAA,MAAK,SAAe,CACL"}
1
+ {"version":3,"file":"RadioCard.js","names":[],"sources":["../../../src/components/radio-card/RadioCard.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nconst StyledRadioCard = styled(RadioGroup.Item, {\n base: [\n 'items-center',\n 'bg-white',\n 'border',\n 'border-grey-600',\n 'rounded-sm',\n 'cursor-pointer',\n 'flex',\n 'text-left',\n 'data-[state=checked]:-outline-offset-2',\n 'data-[state=checked]:outline-2',\n 'data-[state=checked]:outline-primary-800',\n 'data-[state=checked]:outline-solid'\n ],\n variants: {\n align: {\n left: ['flex-row'],\n right: ['flex-row-reverse']\n },\n size: {\n md: ['px-4', 'py-3'],\n lg: ['px-8', 'py-4']\n },\n isFullWidth: {\n true: ['w-full'],\n false: ['w-max']\n }\n }\n})\n\nconst RadioButton = styled('div', {\n base: [\n 'items-center',\n 'appearance-none',\n 'bg-transparent',\n 'border',\n 'border-grey-900',\n 'rounded-full',\n 'flex',\n 'shrink-0',\n 'justify-center',\n 'p-0',\n 'size-4',\n 'transition-all',\n 'duration-50',\n 'ease-out',\n 'in-data-[state=checked]:bg-primary-800',\n 'in-data-[state=checked]:border-primary-800'\n ],\n variants: {\n containerIsFullWidth: {\n true: [],\n false: []\n },\n align: {\n left: ['mr-4'],\n right: []\n }\n },\n compoundVariants: [\n {\n containerIsFullWidth: true,\n align: 'right',\n class: ['ml-auto']\n },\n {\n containerIsFullWidth: false,\n align: 'right',\n class: ['ml-4']\n }\n ]\n})\n\nconst Indicator = styled(RadioGroup.Indicator, {\n base: ['bg-white', 'rounded-full', 'absolute', 'size-1.5']\n})\n\ntype RadioCardProps = React.ComponentProps<typeof StyledRadioCard>\n\nexport const RadioCard = ({\n children,\n isFullWidth = false,\n size = 'md',\n align = 'left',\n ...rest\n}: RadioCardProps) => (\n <StyledRadioCard\n {...rest}\n align={align}\n isFullWidth={isFullWidth}\n size={size}\n >\n <RadioButton align={align} containerIsFullWidth={isFullWidth}>\n <Indicator />\n </RadioButton>\n <div>{children}</div>\n </StyledRadioCard>\n)\n"],"mappings":";;;;AAKA,IAAM,kBAAkB,OAAO,WAAW,MAAM;CAC9C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,OAAO;GACL,MAAM,CAAC,UAAU;GACjB,OAAO,CAAC,kBAAkB;EAC5B;EACA,MAAM;GACJ,IAAI,CAAC,QAAQ,MAAM;GACnB,IAAI,CAAC,QAAQ,MAAM;EACrB;EACA,aAAa;GACX,MAAM,CAAC,QAAQ;GACf,OAAO,CAAC,OAAO;EACjB;CACF;AACF,CAAC;AAED,IAAM,cAAc,OAAO,OAAO;CAChC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,sBAAsB;GACpB,MAAM,CAAC;GACP,OAAO,CAAC;EACV;EACA,OAAO;GACL,MAAM,CAAC,MAAM;GACb,OAAO,CAAC;EACV;CACF;CACA,kBAAkB,CAChB;EACE,sBAAsB;EACtB,OAAO;EACP,OAAO,CAAC,SAAS;CACnB,GACA;EACE,sBAAsB;EACtB,OAAO;EACP,OAAO,CAAC,MAAM;CAChB,CACF;AACF,CAAC;AAED,IAAM,YAAY,OAAO,WAAW,WAAW,EAC7C,MAAM;CAAC;CAAY;CAAgB;CAAY;AAAU,EAC3D,CAAC;AAID,IAAa,aAAa,EACxB,UACA,cAAc,OACd,OAAO,MACP,QAAQ,QACR,GAAG,WAEH,wBAAA,cAAC,iBAAD;CACE,GAAI;CACG;CACM;CACP;AAMS,GAJf,wBAAA,cAAC,aAAD;CAAoB;CAAO,sBAAsB;AAEpC,GADX,wBAAA,cAAC,WAAA,IAAW,CACD,GACb,wBAAA,cAAC,OAAA,MAAK,QAAc,CACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioCardGroup.js","names":[],"sources":["../../../src/components/radio-card/RadioCardGroup.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\nimport * as React from 'react'\n\nimport { cn } from '~/styled'\nimport type { Override } from '~/utilities/types'\n\nimport { RadioCard } from './RadioCard'\n\ntype RadioCardGroupProps = Override<\n React.ComponentProps<typeof RadioCard>,\n React.ComponentProps<typeof RadioGroup.Root>\n>\n\nexport const RadioCardGroup = ({\n className,\n children,\n size,\n isFullWidth,\n align,\n ...rest\n}: RadioCardGroupProps) => (\n <RadioGroup.Root {...rest}>\n <div className={cn('flex', 'flex-row', 'flex-wrap', 'gap-3', className)}>\n {React.Children.map(children, (child) => {\n if (React.isValidElement(child) && child?.type === RadioCard) {\n return React.cloneElement(\n child as React.ReactElement<React.ComponentProps<typeof RadioCard>>,\n { size, isFullWidth, align }\n )\n }\n return child\n })}\n </div>\n </RadioGroup.Root>\n)\n"],"mappings":";;;;;AAaA,IAAa,kBAAkB,EAC7B,WACA,UACA,MACA,aACA,OACA,GAAG,WAEH,wBAAA,cAAC,WAAW,MAAS,MACnB,wBAAA,cAAC,OAAD,EAAK,WAAW,GAAG,QAAQ,YAAY,aAAa,SAAS,UAAU,EAUjE,EATH,QAAM,SAAS,IAAI,WAAW,UAAU;AACvC,KAAI,QAAM,eAAe,MAAM,IAAI,OAAO,SAAS,UACjD,QAAO,QAAM,aACX,OACA;EAAE;EAAM;EAAa;EAAO,CAC7B;AAEH,QAAO;EACP,CACE,CACU"}
1
+ {"version":3,"file":"RadioCardGroup.js","names":[],"sources":["../../../src/components/radio-card/RadioCardGroup.tsx"],"sourcesContent":["import * as RadioGroup from '@radix-ui/react-radio-group'\nimport * as React from 'react'\n\nimport { cn } from '~/styled'\nimport type { Override } from '~/utilities/types'\n\nimport { RadioCard } from './RadioCard'\n\ntype RadioCardGroupProps = Override<\n React.ComponentProps<typeof RadioCard>,\n React.ComponentProps<typeof RadioGroup.Root>\n>\n\nexport const RadioCardGroup = ({\n className,\n children,\n size,\n isFullWidth,\n align,\n ...rest\n}: RadioCardGroupProps) => (\n <RadioGroup.Root {...rest}>\n <div className={cn('flex', 'flex-row', 'flex-wrap', 'gap-3', className)}>\n {React.Children.map(children, (child) => {\n if (React.isValidElement(child) && child?.type === RadioCard) {\n return React.cloneElement(\n child as React.ReactElement<React.ComponentProps<typeof RadioCard>>,\n { size, isFullWidth, align }\n )\n }\n return child\n })}\n </div>\n </RadioGroup.Root>\n)\n"],"mappings":";;;;;AAaA,IAAa,kBAAkB,EAC7B,WACA,UACA,MACA,aACA,OACA,GAAG,WAEH,wBAAA,cAAC,WAAW,MAAS,MACnB,wBAAA,cAAC,OAAD,EAAK,WAAW,GAAG,QAAQ,YAAY,aAAa,SAAS,SAAS,EAUjE,GATF,QAAM,SAAS,IAAI,WAAW,UAAU;CACvC,IAAI,QAAM,eAAe,KAAK,KAAK,OAAO,SAAS,WACjD,OAAO,QAAM,aACX,OACA;EAAE;EAAM;EAAa;CAAM,CAC7B;CAEF,OAAO;AACT,CAAC,CACE,CACU"}
@@ -1 +1 @@
1
- {"version":3,"file":"RouterProvider.js","names":[],"sources":["../../../src/components/router-provider/RouterProvider.tsx"],"sourcesContent":["import * as React from 'react'\n\ntype LinkComponent = React.ComponentType<\n React.AnchorHTMLAttributes<HTMLAnchorElement>\n>\n\ntype RouterContextValue = {\n link?: LinkComponent\n}\n\nconst RouterContext = React.createContext<RouterContextValue>({})\n\ntype RouterProviderProps = {\n link: LinkComponent\n children: React.ReactNode\n}\n\nexport const RouterProvider = ({ link, children }: RouterProviderProps) => {\n const value = React.useMemo<RouterContextValue>(() => ({ link }), [link])\n return <RouterContext.Provider value={value}>{children}</RouterContext.Provider>\n}\n\nconst isAbsoluteUrl = (url?: string) => /^https?:\\/\\//.test(url || '')\n\nconst EMPTY: { as?: LinkComponent } = {}\n\nexport const useRouterLinkProps = (\n href?: string,\n { reloadDocument }: { reloadDocument?: boolean } = {}\n): { as?: LinkComponent } => {\n const { link } = React.useContext(RouterContext)\n\n if (!link || !href || isAbsoluteUrl(href) || reloadDocument) {\n return EMPTY\n }\n\n return { as: link }\n}\n\nRouterProvider.displayName = 'RouterProvider'\n"],"mappings":";;AAUA,IAAM,gBAAgB,QAAM,cAAkC,EAAE,CAAC;AAOjE,IAAa,kBAAkB,EAAE,MAAM,eAAoC;CACzE,MAAM,QAAQ,QAAM,eAAmC,EAAE,MAAM,GAAG,CAAC,KAAK,CAAC;AACzE,QAAO,wBAAA,cAAC,cAAc,UAAf,EAA+B,OAA0C,EAAlC,SAAkC;;AAGlF,IAAM,iBAAiB,QAAiB,eAAe,KAAK,OAAO,GAAG;AAEtE,IAAM,QAAgC,EAAE;AAExC,IAAa,sBACX,MACA,EAAE,mBAAiD,EAAE,KAC1B;CAC3B,MAAM,EAAE,SAAS,QAAM,WAAW,cAAc;AAEhD,KAAI,CAAC,QAAQ,CAAC,QAAQ,cAAc,KAAK,IAAI,eAC3C,QAAO;AAGT,QAAO,EAAE,IAAI,MAAM;;AAGrB,eAAe,cAAc"}
1
+ {"version":3,"file":"RouterProvider.js","names":[],"sources":["../../../src/components/router-provider/RouterProvider.tsx"],"sourcesContent":["import * as React from 'react'\n\ntype LinkComponent = React.ComponentType<\n React.AnchorHTMLAttributes<HTMLAnchorElement>\n>\n\ntype RouterContextValue = {\n link?: LinkComponent\n}\n\nconst RouterContext = React.createContext<RouterContextValue>({})\n\ntype RouterProviderProps = {\n link: LinkComponent\n children: React.ReactNode\n}\n\nexport const RouterProvider = ({ link, children }: RouterProviderProps) => {\n const value = React.useMemo<RouterContextValue>(() => ({ link }), [link])\n return (\n <RouterContext.Provider value={value}>{children}</RouterContext.Provider>\n )\n}\n\nconst isAbsoluteUrl = (url?: string) => /^https?:\\/\\//.test(url || '')\n\nconst EMPTY: { as?: LinkComponent } = {}\n\nexport const useRouterLinkProps = (\n href?: string,\n { reloadDocument }: { reloadDocument?: boolean } = {}\n): { as?: LinkComponent } => {\n const { link } = React.useContext(RouterContext)\n\n if (!link || !href || isAbsoluteUrl(href) || reloadDocument) {\n return EMPTY\n }\n\n return { as: link }\n}\n\nRouterProvider.displayName = 'RouterProvider'\n"],"mappings":";;AAUA,IAAM,gBAAgB,QAAM,cAAkC,CAAC,CAAC;AAOhE,IAAa,kBAAkB,EAAE,MAAM,eAAoC;CACzE,MAAM,QAAQ,QAAM,eAAmC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC;CACxE,OACE,wBAAA,cAAC,cAAc,UAAf,EAA+B,MAAyC,GAAjC,QAAiC;AAE5E;AAEA,IAAM,iBAAiB,QAAiB,eAAe,KAAK,OAAO,EAAE;AAErE,IAAM,QAAgC,CAAC;AAEvC,IAAa,sBACX,MACA,EAAE,mBAAiD,CAAC,MACzB;CAC3B,MAAM,EAAE,SAAS,QAAM,WAAW,aAAa;CAE/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,cAAc,IAAI,KAAK,gBAC3C,OAAO;CAGT,OAAO,EAAE,IAAI,KAAK;AACpB;AAEA,eAAe,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.js","names":[],"sources":["../../../src/components/search-field/SearchField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { useFormCustomContext } from '~/components/form/useFormCustomContext'\nimport {\n SearchInput,\n SearchInputProps\n} from '~/components/search-input/SearchInput'\n\ntype SearchFieldProps = SearchInputProps & FieldElementWrapperProps\n\nexport const SearchField = ({\n className,\n hideLabel,\n label,\n name,\n validation,\n prompt,\n description,\n appearance,\n theme,\n ...remainingProps\n}: SearchFieldProps) => {\n const { register } = useFormContext()\n const context = useFormCustomContext()\n const { error } = useFieldError(name)\n\n const ref = validation ? register(validation) : register\n const formAppearance = context?.appearance || appearance\n const formTheme = context?.theme ?? theme\n\n return (\n <FieldWrapper\n className={className}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={formAppearance}\n >\n <SearchInput\n id={name}\n name={name}\n ref={ref}\n appearance={formAppearance}\n theme={formTheme}\n {...(error && { state: 'error' })}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nSearchField.displayName = 'SearchField'\n"],"mappings":";;;;;;;AAgBA,IAAa,eAAe,EAC1B,WACA,WACA,OACA,MACA,YACA,QACA,aACA,YACA,OACA,GAAG,qBACmB;CACtB,MAAM,EAAE,aAAa,gBAAgB;CACrC,MAAM,UAAU,sBAAsB;CACtC,MAAM,EAAE,UAAU,cAAc,KAAK;CAErC,MAAM,MAAM,aAAa,SAAS,WAAW,GAAG;CAChD,MAAM,iBAAiB,SAAS,cAAc;CAC9C,MAAM,YAAY,SAAS,SAAS;AAEpC,QACE,wBAAA,cAAC,cAAD;EACa;EACE;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,SAAS;EACvC,YAAY;EAWC,EATb,wBAAA,cAAC,aAAD;EACE,IAAI;EACE;EACD;EACL,YAAY;EACZ,OAAO;EACP,GAAK,SAAS,EAAE,OAAO,SAAS;EAChC,GAAI;EACJ,CAAA,CACW;;AAInB,YAAY,cAAc"}
1
+ {"version":3,"file":"SearchField.js","names":[],"sources":["../../../src/components/search-field/SearchField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { useFormCustomContext } from '~/components/form/useFormCustomContext'\nimport {\n SearchInput,\n SearchInputProps\n} from '~/components/search-input/SearchInput'\n\ntype SearchFieldProps = SearchInputProps & FieldElementWrapperProps\n\nexport const SearchField = ({\n className,\n hideLabel,\n label,\n name,\n validation,\n prompt,\n description,\n appearance,\n theme,\n ...remainingProps\n}: SearchFieldProps) => {\n const { register } = useFormContext()\n const context = useFormCustomContext()\n const { error } = useFieldError(name)\n\n const ref = validation ? register(validation) : register\n const formAppearance = context?.appearance || appearance\n const formTheme = context?.theme ?? theme\n\n return (\n <FieldWrapper\n className={className}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={formAppearance}\n >\n <SearchInput\n id={name}\n name={name}\n ref={ref}\n appearance={formAppearance}\n theme={formTheme}\n {...(error && { state: 'error' })}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nSearchField.displayName = 'SearchField'\n"],"mappings":";;;;;;;AAgBA,IAAa,eAAe,EAC1B,WACA,WACA,OACA,MACA,YACA,QACA,aACA,YACA,OACA,GAAG,qBACmB;CACtB,MAAM,EAAE,aAAa,eAAe;CACpC,MAAM,UAAU,qBAAqB;CACrC,MAAM,EAAE,UAAU,cAAc,IAAI;CAEpC,MAAM,MAAM,aAAa,SAAS,UAAU,IAAI;CAChD,MAAM,iBAAiB,SAAS,cAAc;CAC9C,MAAM,YAAY,SAAS,SAAS;CAEpC,OACE,wBAAA,cAAC,cAAD;EACa;EACE;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,QAAQ;EACtC,YAAY;CAWA,GATZ,wBAAA,cAAC,aAAD;EACE,IAAI;EACE;EACD;EACL,YAAY;EACZ,OAAO;EACP,GAAK,SAAS,EAAE,OAAO,QAAQ;EAC/B,GAAI;CACL,CAAA,CACW;AAElB;AAEA,YAAY,cAAc"}
@@ -7,11 +7,6 @@ import { getFieldIconSize } from "../../utilities/style/get-icon-size.js";
7
7
  import * as React$1 from "react";
8
8
  import { Close, Search } from "@atom-learning/icons";
9
9
  //#region src/components/search-input/SearchInput.tsx
10
- var INPUT_ICON = /* @__PURE__ */ function(INPUT_ICON) {
11
- INPUT_ICON["SEARCH"] = "SEARCH";
12
- INPUT_ICON["CLEAR"] = "CLEAR";
13
- return INPUT_ICON;
14
- }(INPUT_ICON || {});
15
10
  var StyledIcon = styled(Icon, {
16
11
  base: [
17
12
  "text-grey-700",
@@ -27,11 +22,11 @@ var StyledIcon = styled(Icon, {
27
22
  var SearchInput = React$1.forwardRef(({ size = "md", appearance = "standard", theme, className, value, defaultValue = "", onValueChange, clearText = "Clear", onChange, ...remainingProps }, ref) => {
28
23
  const [inputElRef, setInputElRef] = useCallbackRef();
29
24
  const [innerValue, setInnerValue] = React$1.useState(defaultValue);
30
- const [activeIcon, setActiveIcon] = React$1.useState(defaultValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH);
25
+ const [activeIcon, setActiveIcon] = React$1.useState(defaultValue ? "CLEAR" : "SEARCH");
31
26
  React$1.useEffect(() => {
32
27
  if (typeof value === "undefined") return;
33
28
  setInnerValue(value);
34
- setActiveIcon(value ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH);
29
+ setActiveIcon(value ? "CLEAR" : "SEARCH");
35
30
  }, [value]);
36
31
  const iconSize = React$1.useMemo(() => getFieldIconSize(size), [size]);
37
32
  React$1.useImperativeHandle(ref, () => inputElRef.current);
@@ -49,10 +44,10 @@ var SearchInput = React$1.forwardRef(({ size = "md", appearance = "standard", th
49
44
  const newValue = event.target.value;
50
45
  setInnerValue(newValue);
51
46
  onValueChange?.(newValue);
52
- setActiveIcon(newValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH);
47
+ setActiveIcon(newValue ? "CLEAR" : "SEARCH");
53
48
  };
54
49
  const getIcon = () => {
55
- if (activeIcon === INPUT_ICON.SEARCH) return /* @__PURE__ */ React$1.createElement(StyledIcon, {
50
+ if (activeIcon === "SEARCH") return /* @__PURE__ */ React$1.createElement(StyledIcon, {
56
51
  is: Search,
57
52
  size,
58
53
  className: cn(size == "sm" ? "size-4" : "size-5", "top-1/2", "-translate-y-1/2")
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.js","names":[],"sources":["../../../src/components/search-input/SearchInput.tsx"],"sourcesContent":["import { Close, Search } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { ActionIcon } from '~/components/action-icon/ActionIcon'\nimport { Icon } from '~/components/icon/Icon'\nimport { Input, InputBackground, InputText } from '~/components/input/Input'\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\nimport { useCallbackRef } from '~/utilities/hooks/useCallbackRef'\nimport { getFieldIconSize } from '~/utilities/style/get-icon-size'\n\nexport type SearchInputProps = React.ComponentProps<typeof Input> & {\n size?: 'sm' | 'md' | 'lg'\n className?: string\n value?: string\n defaultValue?: string\n onValueChange?: (newValue: string) => void\n clearText?: string\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void\n}\n\nenum INPUT_ICON {\n SEARCH = 'SEARCH',\n CLEAR = 'CLEAR'\n}\n\nconst StyledIcon = styled(Icon, {\n base: ['text-grey-700', 'absolute', 'pointer-events-none'],\n variants: {\n size: {\n sm: ['right-2', 'size-4'],\n md: ['right-2.5', 'size-5'],\n lg: ['right-2.5', 'size-5']\n }\n }\n})\n\nexport const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(\n (\n {\n size = 'md',\n appearance = 'standard',\n theme,\n className,\n value,\n defaultValue = '',\n onValueChange,\n clearText = 'Clear',\n onChange,\n ...remainingProps\n },\n ref\n ) => {\n const [inputElRef, setInputElRef] = useCallbackRef()\n const [innerValue, setInnerValue] = React.useState(defaultValue)\n const [activeIcon, setActiveIcon] = React.useState<INPUT_ICON>(\n defaultValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH\n )\n React.useEffect(() => {\n if (typeof value === 'undefined') return\n setInnerValue(value)\n setActiveIcon(value ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH)\n }, [value])\n\n const iconSize = React.useMemo(() => getFieldIconSize(size), [size])\n\n React.useImperativeHandle(ref, () => inputElRef.current as HTMLInputElement)\n\n const handleClear = () => {\n const inputEl = inputElRef.current\n if (!inputEl) return\n\n // https://stackoverflow.com/a/46012210\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n 'value'\n )?.set\n nativeInputValueSetter?.call?.(inputEl, '')\n const ev2 = new Event('input', {\n bubbles: true\n })\n inputEl.dispatchEvent(ev2)\n inputEl.focus()\n onValueChange?.('')\n }\n\n const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event)\n\n const newValue = event.target.value\n setInnerValue(newValue)\n onValueChange?.(newValue)\n setActiveIcon(newValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH)\n }\n\n const getIcon = () => {\n if (activeIcon === INPUT_ICON.SEARCH)\n return (\n <StyledIcon\n is={Search}\n size={size}\n className={cn(\n size == 'sm' ? 'size-4' : 'size-5',\n 'top-1/2',\n '-translate-y-1/2'\n )}\n />\n )\n\n return (\n <ActionIcon\n label={clearText}\n theme=\"neutral\"\n size={iconSize}\n onClick={handleClear}\n className=\"absolute top-1/2 right-1 -translate-y-1/2\"\n >\n <Icon is={Close} />\n </ActionIcon>\n )\n }\n\n return (\n <InputBackground\n size={size}\n appearance={appearance}\n theme={theme}\n className={cn('relative', 'w-auto', className)}\n >\n <InputText\n ref={setInputElRef}\n size={size}\n type=\"search\"\n {...remainingProps}\n value={innerValue}\n onChange={handleOnChange}\n className={cn(\n size === 'sm' ? 'pr-8' : 'pr-10',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none'\n )}\n />\n {getIcon()}\n </InputBackground>\n )\n }\n)\n\nSearchInput.displayName = 'SearchInput'\n"],"mappings":";;;;;;;;;AAqBA,IAAK,aAAL,yBAAA,YAAA;AACE,YAAA,YAAA;AACA,YAAA,WAAA;;EAFG,cAAA,EAAA,CAGJ;AAED,IAAM,aAAa,OAAO,MAAM;CAC9B,MAAM;EAAC;EAAiB;EAAY;EAAsB;CAC1D,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW,SAAS;EACzB,IAAI,CAAC,aAAa,SAAS;EAC3B,IAAI,CAAC,aAAa,SAAS;EAC5B,EACF;CACF,CAAC;AAEF,IAAa,cAAc,QAAM,YAE7B,EACE,OAAO,MACP,aAAa,YACb,OACA,WACA,OACA,eAAe,IACf,eACA,YAAY,SACZ,UACA,GAAG,kBAEL,QACG;CACH,MAAM,CAAC,YAAY,iBAAiB,gBAAgB;CACpD,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,aAAa;CAChE,MAAM,CAAC,YAAY,iBAAiB,QAAM,SACxC,eAAe,WAAW,QAAQ,WAAW,OAC9C;AACD,SAAM,gBAAgB;AACpB,MAAI,OAAO,UAAU,YAAa;AAClC,gBAAc,MAAM;AACpB,gBAAc,QAAQ,WAAW,QAAQ,WAAW,OAAO;IAC1D,CAAC,MAAM,CAAC;CAEX,MAAM,WAAW,QAAM,cAAc,iBAAiB,KAAK,EAAE,CAAC,KAAK,CAAC;AAEpE,SAAM,oBAAoB,WAAW,WAAW,QAA4B;CAE5E,MAAM,oBAAoB;EACxB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AAOd,GAJ+B,OAAO,yBACpC,OAAO,iBAAiB,WACxB,QACD,EAAE,MACqB,OAAO,SAAS,GAAG;EAC3C,MAAM,MAAM,IAAI,MAAM,SAAS,EAC7B,SAAS,MACV,CAAC;AACF,UAAQ,cAAc,IAAI;AAC1B,UAAQ,OAAO;AACf,kBAAgB,GAAG;;CAGrB,MAAM,kBAAkB,UAA+C;AACrE,aAAW,MAAM;EAEjB,MAAM,WAAW,MAAM,OAAO;AAC9B,gBAAc,SAAS;AACvB,kBAAgB,SAAS;AACzB,gBAAc,WAAW,WAAW,QAAQ,WAAW,OAAO;;CAGhE,MAAM,gBAAgB;AACpB,MAAI,eAAe,WAAW,OAC5B,QACE,wBAAA,cAAC,YAAD;GACE,IAAI;GACE;GACN,WAAW,GACT,QAAQ,OAAO,WAAW,UAC1B,WACA,mBACD;GACD,CAAA;AAGN,SACE,wBAAA,cAAC,YAAD;GACE,OAAO;GACP,OAAM;GACN,MAAM;GACN,SAAS;GACT,WAAU;GAGC,EADX,wBAAA,cAAC,MAAD,EAAM,IAAI,OAAS,CAAA,CACR;;AAIjB,QACE,wBAAA,cAAC,iBAAD;EACQ;EACM;EACL;EACP,WAAW,GAAG,YAAY,UAAU,UAAU;EAiB9B,EAfhB,wBAAA,cAAC,WAAD;EACE,KAAK;EACC;EACN,MAAK;EACL,GAAI;EACJ,OAAO;EACP,UAAU;EACV,WAAW,GACT,SAAS,OAAO,SAAS,SACzB,kDACA,qDACA,qDACD;EACD,CAAA,EACD,SAAS,CACM;EAGvB;AAED,YAAY,cAAc"}
1
+ {"version":3,"file":"SearchInput.js","names":[],"sources":["../../../src/components/search-input/SearchInput.tsx"],"sourcesContent":["import { Close, Search } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { ActionIcon } from '~/components/action-icon/ActionIcon'\nimport { Icon } from '~/components/icon/Icon'\nimport { Input, InputBackground, InputText } from '~/components/input/Input'\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\nimport { useCallbackRef } from '~/utilities/hooks/useCallbackRef'\nimport { getFieldIconSize } from '~/utilities/style/get-icon-size'\n\nexport type SearchInputProps = React.ComponentProps<typeof Input> & {\n size?: 'sm' | 'md' | 'lg'\n className?: string\n value?: string\n defaultValue?: string\n onValueChange?: (newValue: string) => void\n clearText?: string\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void\n}\n\nenum INPUT_ICON {\n SEARCH = 'SEARCH',\n CLEAR = 'CLEAR'\n}\n\nconst StyledIcon = styled(Icon, {\n base: ['text-grey-700', 'absolute', 'pointer-events-none'],\n variants: {\n size: {\n sm: ['right-2', 'size-4'],\n md: ['right-2.5', 'size-5'],\n lg: ['right-2.5', 'size-5']\n }\n }\n})\n\nexport const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(\n (\n {\n size = 'md',\n appearance = 'standard',\n theme,\n className,\n value,\n defaultValue = '',\n onValueChange,\n clearText = 'Clear',\n onChange,\n ...remainingProps\n },\n ref\n ) => {\n const [inputElRef, setInputElRef] = useCallbackRef()\n const [innerValue, setInnerValue] = React.useState(defaultValue)\n const [activeIcon, setActiveIcon] = React.useState<INPUT_ICON>(\n defaultValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH\n )\n React.useEffect(() => {\n if (typeof value === 'undefined') return\n setInnerValue(value)\n setActiveIcon(value ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH)\n }, [value])\n\n const iconSize = React.useMemo(() => getFieldIconSize(size), [size])\n\n React.useImperativeHandle(ref, () => inputElRef.current as HTMLInputElement)\n\n const handleClear = () => {\n const inputEl = inputElRef.current\n if (!inputEl) return\n\n // https://stackoverflow.com/a/46012210\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n 'value'\n )?.set\n nativeInputValueSetter?.call?.(inputEl, '')\n const ev2 = new Event('input', {\n bubbles: true\n })\n inputEl.dispatchEvent(ev2)\n inputEl.focus()\n onValueChange?.('')\n }\n\n const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event)\n\n const newValue = event.target.value\n setInnerValue(newValue)\n onValueChange?.(newValue)\n setActiveIcon(newValue ? INPUT_ICON.CLEAR : INPUT_ICON.SEARCH)\n }\n\n const getIcon = () => {\n if (activeIcon === INPUT_ICON.SEARCH)\n return (\n <StyledIcon\n is={Search}\n size={size}\n className={cn(\n size == 'sm' ? 'size-4' : 'size-5',\n 'top-1/2',\n '-translate-y-1/2'\n )}\n />\n )\n\n return (\n <ActionIcon\n label={clearText}\n theme=\"neutral\"\n size={iconSize}\n onClick={handleClear}\n className=\"absolute top-1/2 right-1 -translate-y-1/2\"\n >\n <Icon is={Close} />\n </ActionIcon>\n )\n }\n\n return (\n <InputBackground\n size={size}\n appearance={appearance}\n theme={theme}\n className={cn('relative', 'w-auto', className)}\n >\n <InputText\n ref={setInputElRef}\n size={size}\n type=\"search\"\n {...remainingProps}\n value={innerValue}\n onChange={handleOnChange}\n className={cn(\n size === 'sm' ? 'pr-8' : 'pr-10',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none'\n )}\n />\n {getIcon()}\n </InputBackground>\n )\n }\n)\n\nSearchInput.displayName = 'SearchInput'\n"],"mappings":";;;;;;;;;AA0BA,IAAM,aAAa,OAAO,MAAM;CAC9B,MAAM;EAAC;EAAiB;EAAY;CAAqB;CACzD,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW,QAAQ;EACxB,IAAI,CAAC,aAAa,QAAQ;EAC1B,IAAI,CAAC,aAAa,QAAQ;CAC5B,EACF;AACF,CAAC;AAED,IAAa,cAAc,QAAM,YAE7B,EACE,OAAO,MACP,aAAa,YACb,OACA,WACA,OACA,eAAe,IACf,eACA,YAAY,SACZ,UACA,GAAG,kBAEL,QACG;CACH,MAAM,CAAC,YAAY,iBAAiB,eAAe;CACnD,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,YAAY;CAC/D,MAAM,CAAC,YAAY,iBAAiB,QAAM,SACxC,eAAA,UAAA,QACF;CACA,QAAM,gBAAgB;EACpB,IAAI,OAAO,UAAU,aAAa;EAClC,cAAc,KAAK;EACnB,cAAc,QAAA,UAAA,QAA4C;CAC5D,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,WAAW,QAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,IAAI,CAAC;CAEnE,QAAM,oBAAoB,WAAW,WAAW,OAA2B;CAE3E,MAAM,oBAAoB;EACxB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EAOd,CAJ+B,OAAO,yBACpC,OAAO,iBAAiB,WACxB,OACF,GAAG,MACqB,OAAO,SAAS,EAAE;EAC1C,MAAM,MAAM,IAAI,MAAM,SAAS,EAC7B,SAAS,KACX,CAAC;EACD,QAAQ,cAAc,GAAG;EACzB,QAAQ,MAAM;EACd,gBAAgB,EAAE;CACpB;CAEA,MAAM,kBAAkB,UAA+C;EACrE,WAAW,KAAK;EAEhB,MAAM,WAAW,MAAM,OAAO;EAC9B,cAAc,QAAQ;EACtB,gBAAgB,QAAQ;EACxB,cAAc,WAAA,UAAA,QAA+C;CAC/D;CAEA,MAAM,gBAAgB;EACpB,IAAI,eAAA,UACF,OACE,wBAAA,cAAC,YAAD;GACE,IAAI;GACE;GACN,WAAW,GACT,QAAQ,OAAO,WAAW,UAC1B,WACA,kBACF;EACD,CAAA;EAGL,OACE,wBAAA,cAAC,YAAD;GACE,OAAO;GACP,OAAM;GACN,MAAM;GACN,SAAS;GACT,WAAU;EAGA,GADV,wBAAA,cAAC,MAAD,EAAM,IAAI,MAAQ,CAAA,CACR;CAEhB;CAEA,OACE,wBAAA,cAAC,iBAAD;EACQ;EACM;EACL;EACP,WAAW,GAAG,YAAY,UAAU,SAAS;CAiB9B,GAff,wBAAA,cAAC,WAAD;EACE,KAAK;EACC;EACN,MAAK;EACL,GAAI;EACJ,OAAO;EACP,UAAU;EACV,WAAW,GACT,SAAS,OAAO,SAAS,SACzB,kDACA,qDACA,oDACF;CACD,CAAA,GACA,QAAQ,CACM;AAErB,CACF;AAEA,YAAY,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessage.js","names":[],"sources":["../../../src/components/section-message/SectionMessage.tsx"],"sourcesContent":["import { TooltipProvider } from '@radix-ui/react-tooltip'\nimport React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Dismissible } from '../dismissible'\nimport {\n SectionMessageProvider,\n useSectionMessageContext\n} from './SectionMessageContext'\nimport { SectionMessageDescription } from './SectionMessageDescription'\nimport { SectionMessageDismiss } from './SectionMessageDismiss'\nimport { SectionMessageIcon } from './SectionMessageIcon'\nimport {\n SectionMessageActions,\n SectionMessageContent\n} from './SectionMessageLayout'\nimport { SectionMessageTitle } from './SectionMessageTitle'\n\nconst StyledSectionMessage = styled(Dismissible, {\n base: [\n 'relative',\n 'rounded-md',\n 'flex',\n 'shrink-0',\n 'min-h-12',\n 'p-4',\n 'border',\n 'border-white'\n ],\n variants: {\n theme: {\n success: ['bg-success-light', 'text-success-dark'],\n warning: ['bg-warning-light', 'text-warning-text'],\n error: ['bg-danger-light', 'text-danger-dark'],\n neutral: ['bg-grey-100', 'text-grey-1000'],\n info: ['bg-info-light', 'text-info-dark']\n },\n hasIcon: {\n true: ['pl-10']\n },\n hasDismiss: {\n true: ['pr-12']\n }\n }\n})\n\nconst SectionMessageRoot = ({\n children,\n ...rest\n}: React.ComponentProps<typeof StyledSectionMessage> & {\n className?: string\n}) => {\n const { theme, hasIcon, hasDismiss } = useSectionMessageContext()\n\n return (\n <StyledSectionMessage\n {...rest}\n theme={theme}\n hasIcon={hasIcon}\n hasDismiss={hasDismiss}\n >\n <div className=\"flex grow justify-between gap-3\">{children}</div>\n </StyledSectionMessage>\n )\n}\n\nexport type SectionMessageTheme =\n | 'success'\n | 'warning'\n | 'error'\n | 'neutral'\n | 'info'\n\nexport type SectionMessageProps = React.ComponentProps<\n typeof SectionMessageRoot\n> & {\n theme?: SectionMessageTheme\n}\n\nexport const SectionMessage = ({\n theme = 'info',\n ...rest\n}: SectionMessageProps) => (\n <TooltipProvider>\n <SectionMessageProvider theme={theme}>\n <SectionMessageRoot {...rest} />\n </SectionMessageProvider>\n </TooltipProvider>\n)\n\nSectionMessage.Title = SectionMessageTitle\nSectionMessage.Description = SectionMessageDescription\nSectionMessage.Icon = SectionMessageIcon\nSectionMessage.Dismiss = SectionMessageDismiss\nSectionMessage.Content = SectionMessageContent\nSectionMessage.Actions = SectionMessageActions\n"],"mappings":";;;;;;;;;;;AAmBA,IAAM,uBAAuB,OAAO,aAAa;CAC/C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU;EACR,OAAO;GACL,SAAS,CAAC,oBAAoB,oBAAoB;GAClD,SAAS,CAAC,oBAAoB,oBAAoB;GAClD,OAAO,CAAC,mBAAmB,mBAAmB;GAC9C,SAAS,CAAC,eAAe,iBAAiB;GAC1C,MAAM,CAAC,iBAAiB,iBAAiB;GAC1C;EACD,SAAS,EACP,MAAM,CAAC,QAAQ,EAChB;EACD,YAAY,EACV,MAAM,CAAC,QAAQ,EAChB;EACF;CACF,CAAC;AAEF,IAAM,sBAAsB,EAC1B,UACA,GAAG,WAGC;CACJ,MAAM,EAAE,OAAO,SAAS,eAAe,0BAA0B;AAEjE,QACE,sBAAA,cAAC,sBAAD;EACE,GAAI;EACG;EACE;EACG;EAGS,EADrB,sBAAA,cAAC,OAAD,EAAK,WAAU,mCAAkD,EAAf,SAAe,CAC5C;;AAiB3B,IAAa,kBAAkB,EAC7B,QAAQ,QACR,GAAG,WAEH,sBAAA,cAAC,iBAAA,MACC,sBAAA,cAAC,wBAAD,EAA+B,OAEN,EADvB,sBAAA,cAAC,oBAAuB,KAAQ,CACT,CACT;AAGpB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,UAAU"}
1
+ {"version":3,"file":"SectionMessage.js","names":[],"sources":["../../../src/components/section-message/SectionMessage.tsx"],"sourcesContent":["import { TooltipProvider } from '@radix-ui/react-tooltip'\nimport React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Dismissible } from '../dismissible'\nimport {\n SectionMessageProvider,\n useSectionMessageContext\n} from './SectionMessageContext'\nimport { SectionMessageDescription } from './SectionMessageDescription'\nimport { SectionMessageDismiss } from './SectionMessageDismiss'\nimport { SectionMessageIcon } from './SectionMessageIcon'\nimport {\n SectionMessageActions,\n SectionMessageContent\n} from './SectionMessageLayout'\nimport { SectionMessageTitle } from './SectionMessageTitle'\n\nconst StyledSectionMessage = styled(Dismissible, {\n base: [\n 'relative',\n 'rounded-md',\n 'flex',\n 'shrink-0',\n 'min-h-12',\n 'p-4',\n 'border',\n 'border-white'\n ],\n variants: {\n theme: {\n success: ['bg-success-light', 'text-success-dark'],\n warning: ['bg-warning-light', 'text-warning-text'],\n error: ['bg-danger-light', 'text-danger-dark'],\n neutral: ['bg-grey-100', 'text-grey-1000'],\n info: ['bg-info-light', 'text-info-dark']\n },\n hasIcon: {\n true: ['pl-10']\n },\n hasDismiss: {\n true: ['pr-12']\n }\n }\n})\n\nconst SectionMessageRoot = ({\n children,\n ...rest\n}: React.ComponentProps<typeof StyledSectionMessage> & {\n className?: string\n}) => {\n const { theme, hasIcon, hasDismiss } = useSectionMessageContext()\n\n return (\n <StyledSectionMessage\n {...rest}\n theme={theme}\n hasIcon={hasIcon}\n hasDismiss={hasDismiss}\n >\n <div className=\"flex grow justify-between gap-3\">{children}</div>\n </StyledSectionMessage>\n )\n}\n\nexport type SectionMessageTheme =\n | 'success'\n | 'warning'\n | 'error'\n | 'neutral'\n | 'info'\n\nexport type SectionMessageProps = React.ComponentProps<\n typeof SectionMessageRoot\n> & {\n theme?: SectionMessageTheme\n}\n\nexport const SectionMessage = ({\n theme = 'info',\n ...rest\n}: SectionMessageProps) => (\n <TooltipProvider>\n <SectionMessageProvider theme={theme}>\n <SectionMessageRoot {...rest} />\n </SectionMessageProvider>\n </TooltipProvider>\n)\n\nSectionMessage.Title = SectionMessageTitle\nSectionMessage.Description = SectionMessageDescription\nSectionMessage.Icon = SectionMessageIcon\nSectionMessage.Dismiss = SectionMessageDismiss\nSectionMessage.Content = SectionMessageContent\nSectionMessage.Actions = SectionMessageActions\n"],"mappings":";;;;;;;;;;;AAmBA,IAAM,uBAAuB,OAAO,aAAa;CAC/C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,OAAO;GACL,SAAS,CAAC,oBAAoB,mBAAmB;GACjD,SAAS,CAAC,oBAAoB,mBAAmB;GACjD,OAAO,CAAC,mBAAmB,kBAAkB;GAC7C,SAAS,CAAC,eAAe,gBAAgB;GACzC,MAAM,CAAC,iBAAiB,gBAAgB;EAC1C;EACA,SAAS,EACP,MAAM,CAAC,OAAO,EAChB;EACA,YAAY,EACV,MAAM,CAAC,OAAO,EAChB;CACF;AACF,CAAC;AAED,IAAM,sBAAsB,EAC1B,UACA,GAAG,WAGC;CACJ,MAAM,EAAE,OAAO,SAAS,eAAe,yBAAyB;CAEhE,OACE,sBAAA,cAAC,sBAAD;EACE,GAAI;EACG;EACE;EACG;CAGQ,GADpB,sBAAA,cAAC,OAAD,EAAK,WAAU,kCAAiD,GAAd,QAAc,CAC5C;AAE1B;AAeA,IAAa,kBAAkB,EAC7B,QAAQ,QACR,GAAG,WAEH,sBAAA,cAAC,iBAAA,MACC,sBAAA,cAAC,wBAAD,EAA+B,MAEP,GADtB,sBAAA,cAAC,oBAAuB,IAAO,CACT,CACT;AAGnB,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessageContext.js","names":[],"sources":["../../../src/components/section-message/SectionMessageContext.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { SectionMessageTheme } from './SectionMessage'\n\nexport type SectionMessageContextValue = {\n theme: SectionMessageTheme\n hasIcon: boolean\n setHasIcon: React.Dispatch<React.SetStateAction<boolean>>\n hasDismiss: boolean\n setHasDismiss: React.Dispatch<React.SetStateAction<boolean>>\n}\nexport type SectionMessageProviderProps = {\n theme: SectionMessageTheme\n children: React.ReactNode\n}\n\nexport const SectionMessageContext =\n React.createContext<SectionMessageContextValue | null>(null)\n\nexport const SectionMessageProvider = ({\n theme = 'info',\n children\n}: SectionMessageProviderProps): JSX.Element => {\n const [hasIcon, setHasIcon] = React.useState(false)\n const [hasDismiss, setHasDismiss] = React.useState(false)\n\n const value = React.useMemo<SectionMessageContextValue>(\n () => ({ theme, hasIcon, setHasIcon, hasDismiss, setHasDismiss }),\n [theme, hasIcon, setHasIcon, hasDismiss, setHasDismiss]\n )\n\n return (\n <SectionMessageContext.Provider value={value}>\n {children}\n </SectionMessageContext.Provider>\n )\n}\n\nexport const useSectionMessageContext = (): SectionMessageContextValue => {\n const context = React.useContext(SectionMessageContext)\n\n if (!context) {\n throw new Error(\n 'useSectionMessageContext must be used within a SectionMessageProvider'\n )\n }\n\n return context\n}\n"],"mappings":";;AAgBA,IAAa,wBACX,MAAM,cAAiD,KAAK;AAE9D,IAAa,0BAA0B,EACrC,QAAQ,QACR,eAC8C;CAC9C,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,MAAM;CACnD,MAAM,CAAC,YAAY,iBAAiB,MAAM,SAAS,MAAM;CAEzD,MAAM,QAAQ,MAAM,eACX;EAAE;EAAO;EAAS;EAAY;EAAY;EAAe,GAChE;EAAC;EAAO;EAAS;EAAY;EAAY;EAAc,CACxD;AAED,QACE,sBAAA,cAAC,sBAAsB,UAAvB,EAAuC,OAEN,EAD9B,SAC8B;;AAIrC,IAAa,iCAA6D;CACxE,MAAM,UAAU,MAAM,WAAW,sBAAsB;AAEvD,KAAI,CAAC,QACH,OAAM,IAAI,MACR,wEACD;AAGH,QAAO"}
1
+ {"version":3,"file":"SectionMessageContext.js","names":[],"sources":["../../../src/components/section-message/SectionMessageContext.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { SectionMessageTheme } from './SectionMessage'\n\nexport type SectionMessageContextValue = {\n theme: SectionMessageTheme\n hasIcon: boolean\n setHasIcon: React.Dispatch<React.SetStateAction<boolean>>\n hasDismiss: boolean\n setHasDismiss: React.Dispatch<React.SetStateAction<boolean>>\n}\nexport type SectionMessageProviderProps = {\n theme: SectionMessageTheme\n children: React.ReactNode\n}\n\nexport const SectionMessageContext =\n React.createContext<SectionMessageContextValue | null>(null)\n\nexport const SectionMessageProvider = ({\n theme = 'info',\n children\n}: SectionMessageProviderProps): JSX.Element => {\n const [hasIcon, setHasIcon] = React.useState(false)\n const [hasDismiss, setHasDismiss] = React.useState(false)\n\n const value = React.useMemo<SectionMessageContextValue>(\n () => ({ theme, hasIcon, setHasIcon, hasDismiss, setHasDismiss }),\n [theme, hasIcon, setHasIcon, hasDismiss, setHasDismiss]\n )\n\n return (\n <SectionMessageContext.Provider value={value}>\n {children}\n </SectionMessageContext.Provider>\n )\n}\n\nexport const useSectionMessageContext = (): SectionMessageContextValue => {\n const context = React.useContext(SectionMessageContext)\n\n if (!context) {\n throw new Error(\n 'useSectionMessageContext must be used within a SectionMessageProvider'\n )\n }\n\n return context\n}\n"],"mappings":";;AAgBA,IAAa,wBACX,MAAM,cAAiD,IAAI;AAE7D,IAAa,0BAA0B,EACrC,QAAQ,QACR,eAC8C;CAC9C,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,KAAK;CAClD,MAAM,CAAC,YAAY,iBAAiB,MAAM,SAAS,KAAK;CAExD,MAAM,QAAQ,MAAM,eACX;EAAE;EAAO;EAAS;EAAY;EAAY;CAAc,IAC/D;EAAC;EAAO;EAAS;EAAY;EAAY;CAAa,CACxD;CAEA,OACE,sBAAA,cAAC,sBAAsB,UAAvB,EAAuC,MAEP,GAD7B,QAC6B;AAEpC;AAEA,IAAa,iCAA6D;CACxE,MAAM,UAAU,MAAM,WAAW,qBAAqB;CAEtD,IAAI,CAAC,SACH,MAAM,IAAI,MACR,uEACF;CAGF,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessageDescription.js","names":[],"sources":["../../../src/components/section-message/SectionMessageDescription.tsx"],"sourcesContent":["import React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Text } from '../text/Text'\n\nexport const SectionMessageDescription = ({\n className,\n ...rest\n}: React.ComponentProps<typeof Text>): JSX.Element => (\n <Text size=\"sm\" {...rest} className={cn('text-grey-900', className)} />\n)\n"],"mappings":";;;;AAMA,IAAa,6BAA6B,EACxC,WACA,GAAG,WAEH,sBAAA,cAAC,MAAD;CAAM,MAAK;CAAK,GAAI;CAAM,WAAW,GAAG,iBAAiB,UAAU;CAAI,CAAA"}
1
+ {"version":3,"file":"SectionMessageDescription.js","names":[],"sources":["../../../src/components/section-message/SectionMessageDescription.tsx"],"sourcesContent":["import React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Text } from '../text/Text'\n\nexport const SectionMessageDescription = ({\n className,\n ...rest\n}: React.ComponentProps<typeof Text>): JSX.Element => (\n <Text size=\"sm\" {...rest} className={cn('text-grey-900', className)} />\n)\n"],"mappings":";;;;AAMA,IAAa,6BAA6B,EACxC,WACA,GAAG,WAEH,sBAAA,cAAC,MAAD;CAAM,MAAK;CAAK,GAAI;CAAM,WAAW,GAAG,iBAAiB,SAAS;AAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessageDismiss.js","names":[],"sources":["../../../src/components/section-message/SectionMessageDismiss.tsx"],"sourcesContent":["import { Close } from '@atom-learning/icons'\nimport React, { useEffect } from 'react'\n\nimport { cn } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Dismissible } from '../dismissible'\nimport { Icon } from '../icon/Icon'\nimport { useSectionMessageContext } from './SectionMessageContext'\n\nexport const SectionMessageDismiss = ({\n label = 'Dismiss',\n className,\n ...rest\n}: React.ComponentProps<typeof ActionIcon>): JSX.Element => {\n const { setHasDismiss } = useSectionMessageContext()\n\n useEffect(() => {\n setHasDismiss(true)\n return () => setHasDismiss(false)\n }, [setHasDismiss])\n\n return (\n <Dismissible.Trigger asChild>\n <ActionIcon\n label={label}\n size=\"sm\"\n appearance=\"simple\"\n theme=\"neutral\"\n {...rest}\n className={cn('m-auto', 'absolute', 'top-2', 'right-2', className)}\n >\n <Icon is={Close} />\n </ActionIcon>\n </Dismissible.Trigger>\n )\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,yBAAyB,EACpC,QAAQ,WACR,WACA,GAAG,WACuD;CAC1D,MAAM,EAAE,kBAAkB,0BAA0B;AAEpD,iBAAgB;AACd,gBAAc,KAAK;AACnB,eAAa,cAAc,MAAM;IAChC,CAAC,cAAc,CAAC;AAEnB,QACE,sBAAA,cAAC,YAAY,SAAb,EAAqB,SAAA,MAWC,EAVpB,sBAAA,cAAC,YAAD;EACS;EACP,MAAK;EACL,YAAW;EACX,OAAM;EACN,GAAI;EACJ,WAAW,GAAG,UAAU,YAAY,SAAS,WAAW,UAAU;EAGvD,EADX,sBAAA,cAAC,MAAD,EAAM,IAAI,OAAS,CAAA,CACR,CACO"}
1
+ {"version":3,"file":"SectionMessageDismiss.js","names":[],"sources":["../../../src/components/section-message/SectionMessageDismiss.tsx"],"sourcesContent":["import { Close } from '@atom-learning/icons'\nimport React, { useEffect } from 'react'\n\nimport { cn } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Dismissible } from '../dismissible'\nimport { Icon } from '../icon/Icon'\nimport { useSectionMessageContext } from './SectionMessageContext'\n\nexport const SectionMessageDismiss = ({\n label = 'Dismiss',\n className,\n ...rest\n}: React.ComponentProps<typeof ActionIcon>): JSX.Element => {\n const { setHasDismiss } = useSectionMessageContext()\n\n useEffect(() => {\n setHasDismiss(true)\n return () => setHasDismiss(false)\n }, [setHasDismiss])\n\n return (\n <Dismissible.Trigger asChild>\n <ActionIcon\n label={label}\n size=\"sm\"\n appearance=\"simple\"\n theme=\"neutral\"\n {...rest}\n className={cn('m-auto', 'absolute', 'top-2', 'right-2', className)}\n >\n <Icon is={Close} />\n </ActionIcon>\n </Dismissible.Trigger>\n )\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,yBAAyB,EACpC,QAAQ,WACR,WACA,GAAG,WACuD;CAC1D,MAAM,EAAE,kBAAkB,yBAAyB;CAEnD,gBAAgB;EACd,cAAc,IAAI;EAClB,aAAa,cAAc,KAAK;CAClC,GAAG,CAAC,aAAa,CAAC;CAElB,OACE,sBAAA,cAAC,YAAY,SAAb,EAAqB,SAAA,KAWA,GAVnB,sBAAA,cAAC,YAAD;EACS;EACP,MAAK;EACL,YAAW;EACX,OAAM;EACN,GAAI;EACJ,WAAW,GAAG,UAAU,YAAY,SAAS,WAAW,SAAS;CAGvD,GADV,sBAAA,cAAC,MAAD,EAAM,IAAI,MAAQ,CAAA,CACR,CACO;AAEzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessageIcon.js","names":[],"sources":["../../../src/components/section-message/SectionMessageIcon.tsx"],"sourcesContent":["import { Danger, Error, Info, OkCircle } from '@atom-learning/icons'\nimport React, { useEffect } from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Icon } from '../icon/Icon'\nimport { useSectionMessageContext } from './SectionMessageContext'\n\nconst themeIcons = {\n success: OkCircle,\n warning: Danger,\n error: Error,\n neutral: Info,\n info: Info\n}\n\ntype SectionMessageIconProps = Partial<React.ComponentProps<typeof Icon>>\n\nexport const SectionMessageIcon = ({\n className,\n is,\n ...rest\n}: SectionMessageIconProps): JSX.Element => {\n const { theme, setHasIcon } = useSectionMessageContext()\n\n useEffect(() => {\n setHasIcon(true)\n return () => setHasIcon(false)\n }, [setHasIcon])\n\n return (\n <Icon\n is={is || themeIcons[theme]}\n size=\"sm\"\n {...rest}\n className={cn(\n 'm-auto',\n 'absolute',\n 'left-4',\n 'top-4',\n 'text-current',\n className\n )}\n />\n )\n}\n"],"mappings":";;;;;;AAQA,IAAM,aAAa;CACjB,SAAS;CACT,SAAS;CACT,OAAO;CACP,SAAS;CACT,MAAM;CACP;AAID,IAAa,sBAAsB,EACjC,WACA,IACA,GAAG,WACuC;CAC1C,MAAM,EAAE,OAAO,eAAe,0BAA0B;AAExD,iBAAgB;AACd,aAAW,KAAK;AAChB,eAAa,WAAW,MAAM;IAC7B,CAAC,WAAW,CAAC;AAEhB,QACE,sBAAA,cAAC,MAAD;EACE,IAAI,MAAM,WAAW;EACrB,MAAK;EACL,GAAI;EACJ,WAAW,GACT,UACA,YACA,UACA,SACA,gBACA,UACD;EACD,CAAA"}
1
+ {"version":3,"file":"SectionMessageIcon.js","names":[],"sources":["../../../src/components/section-message/SectionMessageIcon.tsx"],"sourcesContent":["import { Danger, Error, Info, OkCircle } from '@atom-learning/icons'\nimport React, { useEffect } from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Icon } from '../icon/Icon'\nimport { useSectionMessageContext } from './SectionMessageContext'\n\nconst themeIcons = {\n success: OkCircle,\n warning: Danger,\n error: Error,\n neutral: Info,\n info: Info\n}\n\ntype SectionMessageIconProps = Partial<React.ComponentProps<typeof Icon>>\n\nexport const SectionMessageIcon = ({\n className,\n is,\n ...rest\n}: SectionMessageIconProps): JSX.Element => {\n const { theme, setHasIcon } = useSectionMessageContext()\n\n useEffect(() => {\n setHasIcon(true)\n return () => setHasIcon(false)\n }, [setHasIcon])\n\n return (\n <Icon\n is={is || themeIcons[theme]}\n size=\"sm\"\n {...rest}\n className={cn(\n 'm-auto',\n 'absolute',\n 'left-4',\n 'top-4',\n 'text-current',\n className\n )}\n />\n )\n}\n"],"mappings":";;;;;;AAQA,IAAM,aAAa;CACjB,SAAS;CACT,SAAS;CACT,OAAO;CACP,SAAS;CACT,MAAM;AACR;AAIA,IAAa,sBAAsB,EACjC,WACA,IACA,GAAG,WACuC;CAC1C,MAAM,EAAE,OAAO,eAAe,yBAAyB;CAEvD,gBAAgB;EACd,WAAW,IAAI;EACf,aAAa,WAAW,KAAK;CAC/B,GAAG,CAAC,UAAU,CAAC;CAEf,OACE,sBAAA,cAAC,MAAD;EACE,IAAI,MAAM,WAAW;EACrB,MAAK;EACL,GAAI;EACJ,WAAW,GACT,UACA,YACA,UACA,SACA,gBACA,SACF;CACD,CAAA;AAEL"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessageLayout.js","names":[],"sources":["../../../src/components/section-message/SectionMessageLayout.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\n\nexport const SectionMessageContent = styled('div', {\n base: ['max-w-full', 'shrink-0', 'pt-0.5', '*:not-last:mb-2']\n})\n\nexport const SectionMessageActions = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => (\n <div className={cn('max-w-full', 'shrink-0', className)}>\n <div className=\"flex flex-wrap gap-3\" {...rest} />\n </div>\n)\n"],"mappings":";;;AAKA,IAAa,wBAAwB,OAAO,OAAO,EACjD,MAAM;CAAC;CAAc;CAAY;CAAU;CAAkB,EAC9D,CAAC;AAEF,IAAa,yBAAyB,EACpC,WACA,GAAG,WAEH,sBAAA,cAAC,OAAD,EAAK,WAAW,GAAG,cAAc,YAAY,UAAU,EAEjD,EADJ,sBAAA,cAAC,OAAD;CAAK,WAAU;CAAuB,GAAI;CAAQ,CAAA,CAC9C"}
1
+ {"version":3,"file":"SectionMessageLayout.js","names":[],"sources":["../../../src/components/section-message/SectionMessageLayout.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\n\nexport const SectionMessageContent = styled('div', {\n base: ['max-w-full', 'shrink-0', 'pt-0.5', '*:not-last:mb-2']\n})\n\nexport const SectionMessageActions = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => (\n <div className={cn('max-w-full', 'shrink-0', className)}>\n <div className=\"flex flex-wrap gap-3\" {...rest} />\n </div>\n)\n"],"mappings":";;;AAKA,IAAa,wBAAwB,OAAO,OAAO,EACjD,MAAM;CAAC;CAAc;CAAY;CAAU;AAAiB,EAC9D,CAAC;AAED,IAAa,yBAAyB,EACpC,WACA,GAAG,WAEH,sBAAA,cAAC,OAAD,EAAK,WAAW,GAAG,cAAc,YAAY,SAAS,EAEjD,GADH,sBAAA,cAAC,OAAD;CAAK,WAAU;CAAuB,GAAI;AAAO,CAAA,CAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionMessageTitle.js","names":[],"sources":["../../../src/components/section-message/SectionMessageTitle.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '../text/Text'\n\nexport const SectionMessageTitle = (\n props: React.ComponentProps<typeof Text>\n): JSX.Element => <Text size=\"md\" weight=\"bold\" {...props} />\n"],"mappings":";;;AAIA,IAAa,uBACX,UACgB,sBAAA,cAAC,MAAD;CAAM,MAAK;CAAK,QAAO;CAAO,GAAI;CAAS,CAAA"}
1
+ {"version":3,"file":"SectionMessageTitle.js","names":[],"sources":["../../../src/components/section-message/SectionMessageTitle.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '../text/Text'\n\nexport const SectionMessageTitle = (\n props: React.ComponentProps<typeof Text>\n): JSX.Element => <Text size=\"md\" weight=\"bold\" {...props} />\n"],"mappings":";;;AAIA,IAAa,uBACX,UACgB,sBAAA,cAAC,MAAD;CAAM,MAAK;CAAK,QAAO;CAAO,GAAI;AAAQ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControl.tsx"],"sourcesContent":["import { SegmentedControlBadge } from './SegmentedControlBadge'\nimport { SegmentedControlContent } from './SegmentedControlContent'\nimport { SegmentedControlDescription } from './SegmentedControlDescription'\nimport { SegmentedControlHeading } from './SegmentedControlHeading'\nimport { SegmentedControlIcon } from './SegmentedControlIcon'\nimport { SegmentedControlItem } from './SegmentedControlItem'\nimport { SegmentedControlItemList } from './SegmentedControlItemList'\nimport { SegmentedControlRoot } from './SegmentedControlRoot'\n\nexport const SegmentedControl = {\n Root: SegmentedControlRoot,\n Item: SegmentedControlItem,\n Heading: SegmentedControlHeading,\n Description: SegmentedControlDescription,\n Icon: SegmentedControlIcon,\n Content: SegmentedControlContent,\n Badge: SegmentedControlBadge,\n ItemList: SegmentedControlItemList\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,mBAAmB;CAC9B,MAAM;CACN,MAAM;CACN,SAAS;CACT,aAAa;CACb,MAAM;CACN,SAAS;CACT,OAAO;CACP,UAAU;CACX"}
1
+ {"version":3,"file":"SegmentedControl.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControl.tsx"],"sourcesContent":["import { SegmentedControlBadge } from './SegmentedControlBadge'\nimport { SegmentedControlContent } from './SegmentedControlContent'\nimport { SegmentedControlDescription } from './SegmentedControlDescription'\nimport { SegmentedControlHeading } from './SegmentedControlHeading'\nimport { SegmentedControlIcon } from './SegmentedControlIcon'\nimport { SegmentedControlItem } from './SegmentedControlItem'\nimport { SegmentedControlItemList } from './SegmentedControlItemList'\nimport { SegmentedControlRoot } from './SegmentedControlRoot'\n\nexport const SegmentedControl = {\n Root: SegmentedControlRoot,\n Item: SegmentedControlItem,\n Heading: SegmentedControlHeading,\n Description: SegmentedControlDescription,\n Icon: SegmentedControlIcon,\n Content: SegmentedControlContent,\n Badge: SegmentedControlBadge,\n ItemList: SegmentedControlItemList\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,mBAAmB;CAC9B,MAAM;CACN,MAAM;CACN,SAAS;CACT,aAAa;CACb,MAAM;CACN,SAAS;CACT,OAAO;CACP,UAAU;AACZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlBadge.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlBadge.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Badge } from '../badge/Badge'\nimport { SegmentedControlContext } from './SegmentedControlContext'\n\nconst badgeSizeMap = {\n sm: 'xs',\n md: 'xs',\n lg: 'sm'\n}\n\nexport const SegmentedControlBadge = ({\n className,\n ...props\n}: Omit<React.ComponentProps<typeof Badge>, 'size'>): JSX.Element => {\n const { size } = React.useContext(SegmentedControlContext)\n\n return (\n <Badge\n {...props}\n size={badgeSizeMap[size as string]}\n className={cn('border-none', className, 'font-normal')}\n />\n )\n}\n"],"mappings":";;;;;AAOA,IAAM,eAAe;CACnB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAa,yBAAyB,EACpC,WACA,GAAG,YACgE;CACnE,MAAM,EAAE,SAAS,QAAM,WAAW,wBAAwB;AAE1D,QACE,wBAAA,cAAC,OAAD;EACE,GAAI;EACJ,MAAM,aAAa;EACnB,WAAW,GAAG,eAAe,WAAW,cAAc;EACtD,CAAA"}
1
+ {"version":3,"file":"SegmentedControlBadge.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlBadge.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Badge } from '../badge/Badge'\nimport { SegmentedControlContext } from './SegmentedControlContext'\n\nconst badgeSizeMap = {\n sm: 'xs',\n md: 'xs',\n lg: 'sm'\n}\n\nexport const SegmentedControlBadge = ({\n className,\n ...props\n}: Omit<React.ComponentProps<typeof Badge>, 'size'>): JSX.Element => {\n const { size } = React.useContext(SegmentedControlContext)\n\n return (\n <Badge\n {...props}\n size={badgeSizeMap[size as string]}\n className={cn('border-none', className, 'font-normal')}\n />\n )\n}\n"],"mappings":";;;;;AAOA,IAAM,eAAe;CACnB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,IAAa,yBAAyB,EACpC,WACA,GAAG,YACgE;CACnE,MAAM,EAAE,SAAS,QAAM,WAAW,uBAAuB;CAEzD,OACE,wBAAA,cAAC,OAAD;EACE,GAAI;EACJ,MAAM,aAAa;EACnB,WAAW,GAAG,eAAe,WAAW,aAAa;CACtD,CAAA;AAEL"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlContext.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Tabs } from '../tabs/Tabs'\nimport type { SegmentedControlTheme } from './SegmentedControl.types'\nimport type { SegmentedControlRootProps } from './SegmentedControlRoot'\n\nexport interface SegmentedControlContextValue extends Pick<\n React.ComponentProps<typeof Tabs>,\n 'defaultValue' | 'value' | 'onValueChange'\n> {\n size: SegmentedControlRootProps['size']\n theme: SegmentedControlTheme\n}\n\nexport const SegmentedControlContext =\n React.createContext<SegmentedControlContextValue>({\n size: 'md',\n theme: 'primary',\n defaultValue: '',\n value: '',\n onValueChange: () => null\n })\n"],"mappings":";;AAcA,IAAa,0BACX,QAAM,cAA4C;CAChD,MAAM;CACN,OAAO;CACP,cAAc;CACd,OAAO;CACP,qBAAqB;CACtB,CAAC"}
1
+ {"version":3,"file":"SegmentedControlContext.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Tabs } from '../tabs/Tabs'\nimport type { SegmentedControlTheme } from './SegmentedControl.types'\nimport type { SegmentedControlRootProps } from './SegmentedControlRoot'\n\nexport interface SegmentedControlContextValue extends Pick<\n React.ComponentProps<typeof Tabs>,\n 'defaultValue' | 'value' | 'onValueChange'\n> {\n size: SegmentedControlRootProps['size']\n theme: SegmentedControlTheme\n}\n\nexport const SegmentedControlContext =\n React.createContext<SegmentedControlContextValue>({\n size: 'md',\n theme: 'primary',\n defaultValue: '',\n value: '',\n onValueChange: () => null\n })\n"],"mappings":";;AAcA,IAAa,0BACX,QAAM,cAA4C;CAChD,MAAM;CACN,OAAO;CACP,cAAc;CACd,OAAO;CACP,qBAAqB;AACvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlDescription.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlDescription.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Text } from '../text/Text'\nimport { SegmentedControlContext } from './SegmentedControlContext'\n\nconst StyledText = styled(\n Text,\n {\n base: ['font-body', 'text-text-subtle', 'font-normal'],\n variants: {\n size: {\n sm: ['text-xs', 'leading-[1.6]'],\n md: ['text-sm', 'leading-[1.53]'],\n lg: ['text-md', 'leading-normal']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nexport const SegmentedControlDescription = (\n props: Omit<React.ComponentProps<typeof StyledText>, 'size'>\n): JSX.Element => {\n const { size } = React.useContext(SegmentedControlContext)\n\n return <StyledText {...props} size={size} />\n}\n"],"mappings":";;;;;AAOA,IAAM,aAAa,OACjB,MACA;CACE,MAAM;EAAC;EAAa;EAAoB;EAAc;CACtD,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW,gBAAgB;EAChC,IAAI,CAAC,WAAW,iBAAiB;EACjC,IAAI,CAAC,WAAW,iBAAiB;EAClC,EACF;CACF,EACD,EAAE,2BAA2B,MAAM,CACpC;AAED,IAAa,+BACX,UACgB;CAChB,MAAM,EAAE,SAAS,QAAM,WAAW,wBAAwB;AAE1D,QAAO,wBAAA,cAAC,YAAD;EAAY,GAAI;EAAa;EAAQ,CAAA"}
1
+ {"version":3,"file":"SegmentedControlDescription.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlDescription.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Text } from '../text/Text'\nimport { SegmentedControlContext } from './SegmentedControlContext'\n\nconst StyledText = styled(\n Text,\n {\n base: ['font-body', 'text-text-subtle', 'font-normal'],\n variants: {\n size: {\n sm: ['text-xs', 'leading-[1.6]'],\n md: ['text-sm', 'leading-[1.53]'],\n lg: ['text-md', 'leading-normal']\n }\n }\n },\n { enabledResponsiveVariants: true }\n)\n\nexport const SegmentedControlDescription = (\n props: Omit<React.ComponentProps<typeof StyledText>, 'size'>\n): JSX.Element => {\n const { size } = React.useContext(SegmentedControlContext)\n\n return <StyledText {...props} size={size} />\n}\n"],"mappings":";;;;;AAOA,IAAM,aAAa,OACjB,MACA;CACE,MAAM;EAAC;EAAa;EAAoB;CAAa;CACrD,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,WAAW,eAAe;EAC/B,IAAI,CAAC,WAAW,gBAAgB;EAChC,IAAI,CAAC,WAAW,gBAAgB;CAClC,EACF;AACF,GACA,EAAE,2BAA2B,KAAK,CACpC;AAEA,IAAa,+BACX,UACgB;CAChB,MAAM,EAAE,SAAS,QAAM,WAAW,uBAAuB;CAEzD,OAAO,wBAAA,cAAC,YAAD;EAAY,GAAI;EAAa;CAAO,CAAA;AAC7C"}