@atom-learning/components 9.0.0-beta.5 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/components/alert-dialog/AlertDialog.context.js +9 -6
  2. package/dist/components/alert-dialog/AlertDialog.context.js.map +1 -1
  3. package/dist/components/alert-dialog/alert-context/reducer.js +1 -5
  4. package/dist/components/alert-dialog/alert-context/reducer.js.map +1 -1
  5. package/dist/components/alert-dialog/alert-context/types.d.ts +1 -2
  6. package/dist/components/avatar/Avatar.js +5 -6
  7. package/dist/components/avatar/Avatar.js.map +1 -1
  8. package/dist/components/avatar/AvatarIcon.js +2 -2
  9. package/dist/components/avatar/AvatarIcon.js.map +1 -1
  10. package/dist/components/avatar/AvatarInitial.js +2 -2
  11. package/dist/components/avatar/AvatarInitial.js.map +1 -1
  12. package/dist/components/badge/Badge.context.js +12 -13
  13. package/dist/components/badge/Badge.context.js.map +1 -1
  14. package/dist/components/badge/Badge.js +4 -3
  15. package/dist/components/badge/Badge.js.map +1 -1
  16. package/dist/components/badge/BadgeText.js +3 -3
  17. package/dist/components/badge/BadgeText.js.map +1 -1
  18. package/dist/components/banner/Banner.context.js +13 -14
  19. package/dist/components/banner/Banner.context.js.map +1 -1
  20. package/dist/components/banner/banner-regular/BannerRegularActions.js +2 -8
  21. package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
  22. package/dist/components/banner/banner-regular/BannerRegularButton.js +2 -2
  23. package/dist/components/banner/banner-regular/BannerRegularButton.js.map +1 -1
  24. package/dist/components/banner/banner-regular/BannerRegularDismiss.js +1 -1
  25. package/dist/components/banner/banner-regular/BannerRegularDismiss.js.map +1 -1
  26. package/dist/components/banner/banner-slim/BannerSlimButton.js +2 -2
  27. package/dist/components/banner/banner-slim/BannerSlimButton.js.map +1 -1
  28. package/dist/components/banner/banner-slim/BannerSlimContainer.js +4 -13
  29. package/dist/components/banner/banner-slim/BannerSlimContainer.js.map +1 -1
  30. package/dist/components/button/Button.js +5 -1
  31. package/dist/components/button/Button.js.map +1 -1
  32. package/dist/components/calendar/Calendar.d.ts +1 -1
  33. package/dist/components/calendar/Calendar.js +4 -2
  34. package/dist/components/calendar/Calendar.js.map +1 -1
  35. package/dist/components/carousel/Carousel.js +2 -2
  36. package/dist/components/carousel/Carousel.js.map +1 -1
  37. package/dist/components/carousel/CarouselSlide.js +1 -1
  38. package/dist/components/carousel/CarouselSlide.js.map +1 -1
  39. package/dist/components/carousel/CarouselSlider.js +1 -1
  40. package/dist/components/carousel/CarouselSlider.js.map +1 -1
  41. package/dist/components/checkbox/Checkbox.js +2 -2
  42. package/dist/components/checkbox/Checkbox.js.map +1 -1
  43. package/dist/components/checkbox-field/CheckboxField.js +7 -3
  44. package/dist/components/checkbox-field/CheckboxField.js.map +1 -1
  45. package/dist/components/checkbox-group/CheckboxGroupAllItem.js +2 -2
  46. package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
  47. package/dist/components/checkbox-group/CheckboxGroupChecked.context.js +13 -14
  48. package/dist/components/checkbox-group/CheckboxGroupChecked.context.js.map +1 -1
  49. package/dist/components/checkbox-group/CheckboxGroupItem.js +2 -2
  50. package/dist/components/checkbox-group/CheckboxGroupItem.js.map +1 -1
  51. package/dist/components/checkbox-group/CheckboxGroupMounted.context.js +6 -7
  52. package/dist/components/checkbox-group/CheckboxGroupMounted.context.js.map +1 -1
  53. package/dist/components/chip/Chip.js +4 -5
  54. package/dist/components/chip/Chip.js.map +1 -1
  55. package/dist/components/create-password-field/CreatePasswordField.js +1 -1
  56. package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
  57. package/dist/components/data-table/DataTable.context.js +43 -26
  58. package/dist/components/data-table/DataTable.context.js.map +1 -1
  59. package/dist/components/data-table/DataTable.types.d.ts +1 -0
  60. package/dist/components/data-table/DataTable.types.js.map +1 -1
  61. package/dist/components/data-table/DataTableBulkActionsFloating.js +2 -6
  62. package/dist/components/data-table/DataTableBulkActionsFloating.js.map +1 -1
  63. package/dist/components/data-table/DataTableGlobalFilter.js +16 -8
  64. package/dist/components/data-table/DataTableGlobalFilter.js.map +1 -1
  65. package/dist/components/data-table/DataTableHead.js +5 -14
  66. package/dist/components/data-table/DataTableHead.js.map +1 -1
  67. package/dist/components/data-table/DataTableRowSelectionCheckbox.js +1 -0
  68. package/dist/components/data-table/DataTableRowSelectionCheckbox.js.map +1 -1
  69. package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js +2 -1
  70. package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
  71. package/dist/components/data-table/DataTableTable.js +8 -6
  72. package/dist/components/data-table/DataTableTable.js.map +1 -1
  73. package/dist/components/data-table/drag-and-drop/DragAndDropTable.js +1 -1
  74. package/dist/components/data-table/drag-and-drop/DragAndDropTable.js.map +1 -1
  75. package/dist/components/data-table/pagination/Pagination.js +3 -2
  76. package/dist/components/data-table/pagination/Pagination.js.map +1 -1
  77. package/dist/components/data-table/usePagination.d.ts +1 -0
  78. package/dist/components/data-table/usePagination.js +7 -2
  79. package/dist/components/data-table/usePagination.js.map +1 -1
  80. package/dist/components/date-input/DateInput.js +4 -3
  81. package/dist/components/date-input/DateInput.js.map +1 -1
  82. package/dist/components/dialog/DialogContent.js +19 -6
  83. package/dist/components/dialog/DialogContent.js.map +1 -1
  84. package/dist/components/dismissible/DismissibleRoot.js +15 -16
  85. package/dist/components/dismissible/DismissibleRoot.js.map +1 -1
  86. package/dist/components/dismissible/DismissibleTrigger.js +1 -1
  87. package/dist/components/dismissible/DismissibleTrigger.js.map +1 -1
  88. package/dist/components/dismissible-group/DismissibleGroupItem.js +1 -1
  89. package/dist/components/dismissible-group/DismissibleGroupItem.js.map +1 -1
  90. package/dist/components/dismissible-group/DismissibleGroupRoot.js +5 -6
  91. package/dist/components/dismissible-group/DismissibleGroupRoot.js.map +1 -1
  92. package/dist/components/drawer/Drawer.context.js +2 -3
  93. package/dist/components/drawer/Drawer.context.js.map +1 -1
  94. package/dist/components/drawer/DrawerContent.js +1 -1
  95. package/dist/components/drawer/DrawerContent.js.map +1 -1
  96. package/dist/components/empty-state/EmptyState.context.js +2 -3
  97. package/dist/components/empty-state/EmptyState.context.js.map +1 -1
  98. package/dist/components/empty-state/EmptyStateBody.js +1 -1
  99. package/dist/components/empty-state/EmptyStateBody.js.map +1 -1
  100. package/dist/components/empty-state/EmptyStateImage.js +1 -1
  101. package/dist/components/empty-state/EmptyStateImage.js.map +1 -1
  102. package/dist/components/empty-state/EmptyStateTitle.js +1 -1
  103. package/dist/components/empty-state/EmptyStateTitle.js.map +1 -1
  104. package/dist/components/file-drop/FileDrop.js +3 -3
  105. package/dist/components/file-drop/FileDrop.js.map +1 -1
  106. package/dist/components/file-drop/useFileDrop.js +1 -1
  107. package/dist/components/file-drop/useFileDrop.js.map +1 -1
  108. package/dist/components/form/Form.js +7 -6
  109. package/dist/components/form/Form.js.map +1 -1
  110. package/dist/components/form/useFormCustomContext.js +1 -1
  111. package/dist/components/form/useFormCustomContext.js.map +1 -1
  112. package/dist/components/index.d.ts +0 -3
  113. package/dist/components/index.js +1 -4
  114. package/dist/components/index.js.map +1 -1
  115. package/dist/components/input/Input.js +2 -2
  116. package/dist/components/input/Input.js.map +1 -1
  117. package/dist/components/keyboard-shortcut/KeyboardShortcut.js +10 -7
  118. package/dist/components/keyboard-shortcut/KeyboardShortcut.js.map +1 -1
  119. package/dist/components/markdown-content/MarkdownContent.d.ts +1 -1
  120. package/dist/components/markdown-content/MarkdownContent.js +4 -4
  121. package/dist/components/markdown-content/MarkdownContent.js.map +1 -1
  122. package/dist/components/navigation/NavigationMenu.context.js +1 -1
  123. package/dist/components/navigation/NavigationMenu.context.js.map +1 -1
  124. package/dist/components/navigation/NavigationMenu.js +7 -6
  125. package/dist/components/navigation/NavigationMenu.js.map +1 -1
  126. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.d.ts +2 -2
  127. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.js +3 -3
  128. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.js.map +1 -1
  129. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.js +1 -1
  130. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.js.map +1 -1
  131. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js +1 -1
  132. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js.map +1 -1
  133. package/dist/components/number-input/NumberInput.js +15 -16
  134. package/dist/components/number-input/NumberInput.js.map +1 -1
  135. package/dist/components/number-input-field/NumberInputField.js +7 -3
  136. package/dist/components/number-input-field/NumberInputField.js.map +1 -1
  137. package/dist/components/pagination/Pagination.context.js +29 -22
  138. package/dist/components/pagination/Pagination.context.js.map +1 -1
  139. package/dist/components/pagination/usePagination.js +1 -1
  140. package/dist/components/pagination/usePagination.js.map +1 -1
  141. package/dist/components/password-input/PasswordInput.js +1 -2
  142. package/dist/components/password-input/PasswordInput.js.map +1 -1
  143. package/dist/components/radio-button-field/RadioButtonField.js +7 -3
  144. package/dist/components/radio-button-field/RadioButtonField.js.map +1 -1
  145. package/dist/components/search-input/SearchInput.js +7 -11
  146. package/dist/components/search-input/SearchInput.js.map +1 -1
  147. package/dist/components/section-message/SectionMessage.context.js +15 -16
  148. package/dist/components/section-message/SectionMessage.context.js.map +1 -1
  149. package/dist/components/segmented-control/SegmentedControlBadge.js +1 -1
  150. package/dist/components/segmented-control/SegmentedControlBadge.js.map +1 -1
  151. package/dist/components/segmented-control/SegmentedControlDescription.js +1 -1
  152. package/dist/components/segmented-control/SegmentedControlDescription.js.map +1 -1
  153. package/dist/components/segmented-control/SegmentedControlHeading.js +1 -1
  154. package/dist/components/segmented-control/SegmentedControlHeading.js.map +1 -1
  155. package/dist/components/segmented-control/SegmentedControlIcon.js +1 -1
  156. package/dist/components/segmented-control/SegmentedControlIcon.js.map +1 -1
  157. package/dist/components/segmented-control/SegmentedControlItem.js +1 -1
  158. package/dist/components/segmented-control/SegmentedControlItem.js.map +1 -1
  159. package/dist/components/segmented-control/SegmentedControlItemList.js +20 -14
  160. package/dist/components/segmented-control/SegmentedControlItemList.js.map +1 -1
  161. package/dist/components/segmented-control/SegmentedControlRoot.js +18 -19
  162. package/dist/components/segmented-control/SegmentedControlRoot.js.map +1 -1
  163. package/dist/components/select-menu/SelectMenu.context.js +1 -1
  164. package/dist/components/select-menu/SelectMenu.context.js.map +1 -1
  165. package/dist/components/select-menu/SelectMenu.js +18 -12
  166. package/dist/components/select-menu/SelectMenu.js.map +1 -1
  167. package/dist/components/side-bar/SideBar.context.js +1 -1
  168. package/dist/components/side-bar/SideBar.context.js.map +1 -1
  169. package/dist/components/side-bar/SideBar.js +2 -2
  170. package/dist/components/side-bar/SideBar.js.map +1 -1
  171. package/dist/components/skeleton-loader/SkeletonCard.js.map +1 -1
  172. package/dist/components/slider-field/SliderField.js +8 -3
  173. package/dist/components/slider-field/SliderField.js.map +1 -1
  174. package/dist/components/sortable/SortableRoot.js +5 -3
  175. package/dist/components/sortable/SortableRoot.js.map +1 -1
  176. package/dist/components/stepper/Stepper.context.js +38 -30
  177. package/dist/components/stepper/Stepper.context.js.map +1 -1
  178. package/dist/components/toast/Toast.context.js +1 -1
  179. package/dist/components/toast/Toast.context.js.map +1 -1
  180. package/dist/components/toast/ToastProvider.js +3 -3
  181. package/dist/components/toast/ToastProvider.js.map +1 -1
  182. package/dist/components/top-bar/TopBar.js +4 -4
  183. package/dist/components/top-bar/TopBar.js.map +1 -1
  184. package/dist/components/tree/TreeCollapsible.d.ts +2 -2
  185. package/dist/components/tree/TreeCollapsible.js +3 -3
  186. package/dist/components/tree/TreeCollapsible.js.map +1 -1
  187. package/dist/components/tree/TreeCollapsibleContent.js +1 -1
  188. package/dist/components/tree/TreeCollapsibleContent.js.map +1 -1
  189. package/dist/components/tree/TreeCollapsibleTrigger.js +1 -1
  190. package/dist/components/tree/TreeCollapsibleTrigger.js.map +1 -1
  191. package/dist/docgen.json +1 -1
  192. package/dist/index.cjs.js +553 -595
  193. package/dist/index.cjs.js.map +1 -1
  194. package/dist/index.js +1 -4
  195. package/dist/styled.js +5 -1
  196. package/dist/styled.js.map +1 -1
  197. package/dist/utilities/hooks/useCallbackRef.d.ts +3 -3
  198. package/dist/utilities/hooks/useCallbackRef.js +4 -1
  199. package/dist/utilities/hooks/useCallbackRef.js.map +1 -1
  200. package/dist/utilities/hooks/useResizeObserver.js +13 -3
  201. package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
  202. package/dist/utilities/hooks/useScrollPosition.js +22 -17
  203. package/dist/utilities/hooks/useScrollPosition.js.map +1 -1
  204. package/dist/utilities/hooks/useWindowScrollPosition.js +19 -15
  205. package/dist/utilities/hooks/useWindowScrollPosition.js.map +1 -1
  206. package/dist/utilities/uri/index.js +1 -6
  207. package/dist/utilities/uri/index.js.map +1 -1
  208. package/package.json +31 -31
  209. package/src/index.css +2 -0
  210. package/src/responsive-variant-classes.css +1 -1
  211. package/src/utilities.css +6 -0
  212. package/dist/components/box/Box.d.ts +0 -1
  213. package/dist/components/box/Box.js +0 -8
  214. package/dist/components/box/Box.js.map +0 -1
  215. package/dist/components/flex/Flex.d.ts +0 -7
  216. package/dist/components/flex/Flex.js +0 -88
  217. package/dist/components/flex/Flex.js.map +0 -1
  218. package/dist/components/grid/Grid.d.ts +0 -13
  219. package/dist/components/grid/Grid.js +0 -35
  220. package/dist/components/grid/Grid.js.map +0 -1
@@ -2,6 +2,7 @@ import { styled } from "../../styled.js";
2
2
  import { Tabs } from "../tabs/Tabs.js";
3
3
  import { SegmentedControlContext } from "./SegmentedControl.context.js";
4
4
  import * as React$1 from "react";
5
+ import { composeRefs } from "@radix-ui/react-compose-refs";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/components/segmented-control/SegmentedControlItemList.tsx
7
8
  var StyledTriggerList = styled(Tabs.TriggerList, {
@@ -34,7 +35,7 @@ var SelectionIndicator = styled("div", {
34
35
  } }
35
36
  });
36
37
  var SegmentedControlItemList = (props) => {
37
- const { theme, defaultValue, value } = React$1.useContext(SegmentedControlContext);
38
+ const { theme, defaultValue, value } = React$1.use(SegmentedControlContext);
38
39
  const tabsRef = React$1.useRef([]);
39
40
  const selectedIndex = React$1.Children.toArray(props.children).findIndex((child) => child?.props.value === value);
40
41
  const [indicatorStyles, setIndicatorStyles] = React$1.useState({
@@ -53,26 +54,28 @@ var SegmentedControlItemList = (props) => {
53
54
  width: Math.round(width)
54
55
  });
55
56
  }, [selectedIndex]);
57
+ const updateIndicatorPositionRef = React$1.useRef(updateIndicatorPosition);
58
+ React$1.useLayoutEffect(() => {
59
+ updateIndicatorPositionRef.current = updateIndicatorPosition;
60
+ });
61
+ const tabCount = React$1.Children.count(props.children);
56
62
  React$1.useEffect(() => {
57
- const resizeObserver = new ResizeObserver(updateIndicatorPosition);
58
- const currentTabs = tabsRef.current;
59
- currentTabs.forEach((tab) => {
63
+ const resizeObserver = new ResizeObserver(() => updateIndicatorPositionRef.current());
64
+ tabsRef.current.forEach((tab) => {
60
65
  if (tab) resizeObserver.observe(tab);
61
66
  });
62
67
  return () => {
63
- currentTabs.forEach((tab) => {
64
- if (tab) resizeObserver.unobserve(tab);
65
- });
66
68
  resizeObserver.disconnect();
67
69
  };
68
- }, [selectedIndex, updateIndicatorPosition]);
70
+ }, [tabCount]);
69
71
  React$1.useEffect(() => {
70
- window.addEventListener("resize", updateIndicatorPosition);
72
+ const handleResize = () => updateIndicatorPositionRef.current();
73
+ window.addEventListener("resize", handleResize);
71
74
  return () => {
72
- window.removeEventListener("resize", updateIndicatorPosition);
75
+ window.removeEventListener("resize", handleResize);
73
76
  };
74
- }, [updateIndicatorPosition]);
75
- React$1.useEffect(() => {
77
+ }, []);
78
+ React$1.useLayoutEffect(() => {
76
79
  updateIndicatorPosition();
77
80
  }, [selectedIndex, updateIndicatorPosition]);
78
81
  return /* @__PURE__ */ jsxs(StyledTriggerList, {
@@ -89,9 +92,12 @@ var SegmentedControlItemList = (props) => {
89
92
  setHasInteracted(true);
90
93
  if (child.props.onClick) child.props.onClick(e);
91
94
  },
92
- ref: (el) => {
95
+ ref: composeRefs(child.props.ref, (el) => {
93
96
  tabsRef.current[index] = el;
94
- }
97
+ return () => {
98
+ tabsRef.current[index] = null;
99
+ };
100
+ })
95
101
  });
96
102
  })]
97
103
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlItemList.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlItemList.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Tabs } from '../tabs/Tabs'\nimport { SegmentedControlContext } from './SegmentedControl.context'\nimport { SegmentedControlItem } from './SegmentedControlItem'\n\nconst StyledTriggerList = styled(Tabs.TriggerList, {\n base: [\n 'relative',\n 'p-1',\n 'rounded-lg',\n 'overflow-hidden',\n '[&>div[role=tablist]]:relative',\n '[&>button]:z-2'\n ],\n variants: {\n theme: {\n primary: ['bg-primary-200'],\n marsh: ['bg-marsh-200']\n }\n }\n})\n\nconst SelectionIndicator = styled('div', {\n base: ['absolute', 'bg-white', 'rounded-md'],\n variants: {\n interacted: {\n true: ['duration-300', 'ease-in', 'transition-all'],\n false: ['transition-none']\n }\n }\n})\n\nexport const SegmentedControlItemList = (\n props: React.ComponentProps<typeof Tabs.TriggerList>\n) => {\n const { theme, defaultValue, value } = React.useContext(\n SegmentedControlContext\n )\n\n const tabsRef = React.useRef<(HTMLElement | null)[]>([])\n\n const selectedIndex = React.Children.toArray(props.children).findIndex(\n (child) =>\n (\n child as React.ReactElement<\n React.ComponentProps<typeof SegmentedControlItem>\n >\n )?.props.value === value\n )\n\n const [indicatorStyles, setIndicatorStyles] = React.useState({\n left: 0,\n height: 0,\n width: 0\n })\n const [hasInteracted, setHasInteracted] = React.useState(false)\n\n const updateIndicatorPosition = React.useCallback(() => {\n const currentTab = tabsRef.current[selectedIndex]\n if (!currentTab) return\n\n const { width, height } = currentTab.getBoundingClientRect()\n setIndicatorStyles({\n left: Math.round(currentTab.offsetLeft),\n height: Math.round(height),\n width: Math.round(width)\n })\n }, [selectedIndex])\n\n React.useEffect(() => {\n const resizeObserver = new ResizeObserver(updateIndicatorPosition)\n const currentTabs = tabsRef.current\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.observe(tab)\n })\n\n return () => {\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.unobserve(tab)\n })\n resizeObserver.disconnect()\n }\n }, [selectedIndex, updateIndicatorPosition])\n\n React.useEffect(() => {\n window.addEventListener('resize', updateIndicatorPosition)\n return () => {\n window.removeEventListener('resize', updateIndicatorPosition)\n }\n }, [updateIndicatorPosition])\n\n React.useEffect(() => {\n updateIndicatorPosition()\n }, [selectedIndex, updateIndicatorPosition])\n\n return (\n <StyledTriggerList theme={theme} defaultValue={defaultValue} {...props}>\n <SelectionIndicator interacted={hasInteracted} style={indicatorStyles} />\n {React.Children.map(props.children, (child, index) => {\n if (\n !React.isValidElement<\n React.ComponentProps<typeof SegmentedControlItem>\n >(child)\n ) {\n throw new Error(\n `Child passed to SegmentedControlItemList is not a valid element`\n )\n }\n\n return React.cloneElement(child, {\n onClick: (e) => {\n setHasInteracted(true)\n if (child.props.onClick) child.props.onClick(e)\n },\n ref: (el: HTMLElement | null) => {\n tabsRef.current[index] = el\n }\n })\n })}\n </StyledTriggerList>\n )\n}\n"],"mappings":";;;;;;AAOA,IAAM,oBAAoB,OAAO,KAAK,aAAa;CACjD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,OAAO;EACL,SAAS,CAAC,gBAAgB;EAC1B,OAAO,CAAC,cAAc;CACxB,EACF;AACF,CAAC;AAED,IAAM,qBAAqB,OAAO,OAAO;CACvC,MAAM;EAAC;EAAY;EAAY;CAAY;CAC3C,UAAU,EACR,YAAY;EACV,MAAM;GAAC;GAAgB;GAAW;EAAgB;EAClD,OAAO,CAAC,iBAAiB;CAC3B,EACF;AACF,CAAC;AAED,IAAa,4BACX,UACG;CACH,MAAM,EAAE,OAAO,cAAc,UAAU,QAAM,WAC3C,uBACF;CAEA,MAAM,UAAU,QAAM,OAA+B,CAAC,CAAC;CAEvD,MAAM,gBAAgB,QAAM,SAAS,QAAQ,MAAM,QAAQ,CAAC,CAAC,WAC1D,UAEG,OAGC,MAAM,UAAU,KACvB;CAEA,MAAM,CAAC,iBAAiB,sBAAsB,QAAM,SAAS;EAC3D,MAAM;EACN,QAAQ;EACR,OAAO;CACT,CAAC;CACD,MAAM,CAAC,eAAe,oBAAoB,QAAM,SAAS,KAAK;CAE9D,MAAM,0BAA0B,QAAM,kBAAkB;EACtD,MAAM,aAAa,QAAQ,QAAQ;EACnC,IAAI,CAAC,YAAY;EAEjB,MAAM,EAAE,OAAO,WAAW,WAAW,sBAAsB;EAC3D,mBAAmB;GACjB,MAAM,KAAK,MAAM,WAAW,UAAU;GACtC,QAAQ,KAAK,MAAM,MAAM;GACzB,OAAO,KAAK,MAAM,KAAK;EACzB,CAAC;CACH,GAAG,CAAC,aAAa,CAAC;CAElB,QAAM,gBAAgB;EACpB,MAAM,iBAAiB,IAAI,eAAe,uBAAuB;EACjE,MAAM,cAAc,QAAQ;EAC5B,YAAY,SAAS,QAAQ;GAC3B,IAAI,KAAK,eAAe,QAAQ,GAAG;EACrC,CAAC;EAED,aAAa;GACX,YAAY,SAAS,QAAQ;IAC3B,IAAI,KAAK,eAAe,UAAU,GAAG;GACvC,CAAC;GACD,eAAe,WAAW;EAC5B;CACF,GAAG,CAAC,eAAe,uBAAuB,CAAC;CAE3C,QAAM,gBAAgB;EACpB,OAAO,iBAAiB,UAAU,uBAAuB;EACzD,aAAa;GACX,OAAO,oBAAoB,UAAU,uBAAuB;EAC9D;CACF,GAAG,CAAC,uBAAuB,CAAC;CAE5B,QAAM,gBAAgB;EACpB,wBAAwB;CAC1B,GAAG,CAAC,eAAe,uBAAuB,CAAC;CAE3C,OACE,qBAAC,mBAAD;EAA0B;EAAqB;EAAc,GAAI;YAAjE,CACE,oBAAC,oBAAD;GAAoB,YAAY;GAAe,OAAO;EAAkB,CAAA,GACvE,QAAM,SAAS,IAAI,MAAM,WAAW,OAAO,UAAU;GACpD,IACE,CAAC,QAAM,eAEL,KAAK,GAEP,MAAM,IAAI,MACR,iEACF;GAGF,OAAO,QAAM,aAAa,OAAO;IAC/B,UAAU,MAAM;KACd,iBAAiB,IAAI;KACrB,IAAI,MAAM,MAAM,SAAS,MAAM,MAAM,QAAQ,CAAC;IAChD;IACA,MAAM,OAA2B;KAC/B,QAAQ,QAAQ,SAAS;IAC3B;GACF,CAAC;EACH,CAAC,CACgB;;AAEvB"}
1
+ {"version":3,"file":"SegmentedControlItemList.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlItemList.tsx"],"sourcesContent":["import { composeRefs } from '@radix-ui/react-compose-refs'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Tabs } from '../tabs/Tabs'\nimport { SegmentedControlContext } from './SegmentedControl.context'\nimport { SegmentedControlItem } from './SegmentedControlItem'\n\nconst StyledTriggerList = styled(Tabs.TriggerList, {\n base: [\n 'relative',\n 'p-1',\n 'rounded-lg',\n 'overflow-hidden',\n '[&>div[role=tablist]]:relative',\n '[&>button]:z-2'\n ],\n variants: {\n theme: {\n primary: ['bg-primary-200'],\n marsh: ['bg-marsh-200']\n }\n }\n})\n\nconst SelectionIndicator = styled('div', {\n base: ['absolute', 'bg-white', 'rounded-md'],\n variants: {\n interacted: {\n true: ['duration-300', 'ease-in', 'transition-all'],\n false: ['transition-none']\n }\n }\n})\n\nexport const SegmentedControlItemList = (\n props: React.ComponentProps<typeof Tabs.TriggerList>\n) => {\n const { theme, defaultValue, value } = React.use(SegmentedControlContext)\n\n const tabsRef = React.useRef<(HTMLElement | null)[]>([])\n\n const selectedIndex = React.Children.toArray(props.children).findIndex(\n (child) =>\n (\n child as React.ReactElement<\n React.ComponentProps<typeof SegmentedControlItem>\n >\n )?.props.value === value\n )\n\n const [indicatorStyles, setIndicatorStyles] = React.useState({\n left: 0,\n height: 0,\n width: 0\n })\n const [hasInteracted, setHasInteracted] = React.useState(false)\n\n const updateIndicatorPosition = React.useCallback(() => {\n const currentTab = tabsRef.current[selectedIndex]\n if (!currentTab) return\n\n const { width, height } = currentTab.getBoundingClientRect()\n setIndicatorStyles({\n left: Math.round(currentTab.offsetLeft),\n height: Math.round(height),\n width: Math.round(width)\n })\n }, [selectedIndex])\n\n // Latest-ref so the ResizeObserver and window listener subscribe once per\n // tab-count change instead of being torn down on every selection change\n // (updateIndicatorPosition's identity tracks selectedIndex).\n const updateIndicatorPositionRef = React.useRef(updateIndicatorPosition)\n React.useLayoutEffect(() => {\n updateIndicatorPositionRef.current = updateIndicatorPosition\n })\n\n const tabCount = React.Children.count(props.children)\n\n React.useEffect(() => {\n const resizeObserver = new ResizeObserver(() =>\n updateIndicatorPositionRef.current()\n )\n const currentTabs = tabsRef.current\n currentTabs.forEach((tab) => {\n if (tab) resizeObserver.observe(tab)\n })\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [tabCount])\n\n React.useEffect(() => {\n const handleResize = () => updateIndicatorPositionRef.current()\n window.addEventListener('resize', handleResize)\n return () => {\n window.removeEventListener('resize', handleResize)\n }\n }, [])\n\n // Layout effect: the indicator must be measured and placed before paint,\n // or it appears at its old position for a frame and visibly jumps.\n React.useLayoutEffect(() => {\n updateIndicatorPosition()\n }, [selectedIndex, updateIndicatorPosition])\n\n return (\n <StyledTriggerList theme={theme} defaultValue={defaultValue} {...props}>\n <SelectionIndicator interacted={hasInteracted} style={indicatorStyles} />\n {React.Children.map(props.children, (child, index) => {\n if (\n !React.isValidElement<\n React.ComponentProps<typeof SegmentedControlItem>\n >(child)\n ) {\n throw new Error(\n `Child passed to SegmentedControlItemList is not a valid element`\n )\n }\n\n return React.cloneElement(child, {\n onClick: (e) => {\n setHasInteracted(true)\n if (child.props.onClick) child.props.onClick(e)\n },\n // Composed so a consumer-supplied ref on the item survives the\n // clone; the cleanup empties the slot when the item detaches.\n ref: composeRefs(\n (child.props as { ref?: React.Ref<HTMLElement> }).ref,\n (el: HTMLElement | null) => {\n tabsRef.current[index] = el\n return () => {\n tabsRef.current[index] = null\n }\n }\n )\n })\n })}\n </StyledTriggerList>\n )\n}\n"],"mappings":";;;;;;;AAQA,IAAM,oBAAoB,OAAO,KAAK,aAAa;CACjD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,OAAO;EACL,SAAS,CAAC,gBAAgB;EAC1B,OAAO,CAAC,cAAc;CACxB,EACF;AACF,CAAC;AAED,IAAM,qBAAqB,OAAO,OAAO;CACvC,MAAM;EAAC;EAAY;EAAY;CAAY;CAC3C,UAAU,EACR,YAAY;EACV,MAAM;GAAC;GAAgB;GAAW;EAAgB;EAClD,OAAO,CAAC,iBAAiB;CAC3B,EACF;AACF,CAAC;AAED,IAAa,4BACX,UACG;CACH,MAAM,EAAE,OAAO,cAAc,UAAU,QAAM,IAAI,uBAAuB;CAExE,MAAM,UAAU,QAAM,OAA+B,CAAC,CAAC;CAEvD,MAAM,gBAAgB,QAAM,SAAS,QAAQ,MAAM,QAAQ,CAAC,CAAC,WAC1D,UAEG,OAGC,MAAM,UAAU,KACvB;CAEA,MAAM,CAAC,iBAAiB,sBAAsB,QAAM,SAAS;EAC3D,MAAM;EACN,QAAQ;EACR,OAAO;CACT,CAAC;CACD,MAAM,CAAC,eAAe,oBAAoB,QAAM,SAAS,KAAK;CAE9D,MAAM,0BAA0B,QAAM,kBAAkB;EACtD,MAAM,aAAa,QAAQ,QAAQ;EACnC,IAAI,CAAC,YAAY;EAEjB,MAAM,EAAE,OAAO,WAAW,WAAW,sBAAsB;EAC3D,mBAAmB;GACjB,MAAM,KAAK,MAAM,WAAW,UAAU;GACtC,QAAQ,KAAK,MAAM,MAAM;GACzB,OAAO,KAAK,MAAM,KAAK;EACzB,CAAC;CACH,GAAG,CAAC,aAAa,CAAC;CAKlB,MAAM,6BAA6B,QAAM,OAAO,uBAAuB;CACvE,QAAM,sBAAsB;EAC1B,2BAA2B,UAAU;CACvC,CAAC;CAED,MAAM,WAAW,QAAM,SAAS,MAAM,MAAM,QAAQ;CAEpD,QAAM,gBAAgB;EACpB,MAAM,iBAAiB,IAAI,qBACzB,2BAA2B,QAAQ,CACrC;EAEA,QAD4B,QAChB,SAAS,QAAQ;GAC3B,IAAI,KAAK,eAAe,QAAQ,GAAG;EACrC,CAAC;EAED,aAAa;GACX,eAAe,WAAW;EAC5B;CACF,GAAG,CAAC,QAAQ,CAAC;CAEb,QAAM,gBAAgB;EACpB,MAAM,qBAAqB,2BAA2B,QAAQ;EAC9D,OAAO,iBAAiB,UAAU,YAAY;EAC9C,aAAa;GACX,OAAO,oBAAoB,UAAU,YAAY;EACnD;CACF,GAAG,CAAC,CAAC;CAIL,QAAM,sBAAsB;EAC1B,wBAAwB;CAC1B,GAAG,CAAC,eAAe,uBAAuB,CAAC;CAE3C,OACE,qBAAC,mBAAD;EAA0B;EAAqB;EAAc,GAAI;YAAjE,CACE,oBAAC,oBAAD;GAAoB,YAAY;GAAe,OAAO;EAAkB,CAAA,GACvE,QAAM,SAAS,IAAI,MAAM,WAAW,OAAO,UAAU;GACpD,IACE,CAAC,QAAM,eAEL,KAAK,GAEP,MAAM,IAAI,MACR,iEACF;GAGF,OAAO,QAAM,aAAa,OAAO;IAC/B,UAAU,MAAM;KACd,iBAAiB,IAAI;KACrB,IAAI,MAAM,MAAM,SAAS,MAAM,MAAM,QAAQ,CAAC;IAChD;IAGA,KAAK,YACF,MAAM,MAA2C,MACjD,OAA2B;KAC1B,QAAQ,QAAQ,SAAS;KACzB,aAAa;MACX,QAAQ,QAAQ,SAAS;KAC3B;IACF,CACF;GACF,CAAC;EACH,CAAC,CACgB;;AAEvB"}
@@ -16,25 +16,24 @@ var SegmentedControlRoot = ({ size, theme = "primary", defaultValue, children, v
16
16
  const isControlled = value !== void 0;
17
17
  const [internalValue, setInternalValue] = React$1.useState(defaultValue);
18
18
  const currentValue = isControlled ? value : internalValue;
19
- const handleValueChange = isControlled ? onValueChange : setInternalValue;
20
- React$1.useEffect(() => {
21
- if (!isControlled && defaultValue) setInternalValue(defaultValue);
22
- }, [defaultValue, isControlled]);
23
- const contextValue = React$1.useMemo(() => ({
24
- size,
25
- theme,
26
- defaultValue,
27
- onValueChange: handleValueChange,
28
- value: currentValue
29
- }), [
30
- size,
31
- theme,
32
- defaultValue,
33
- handleValueChange,
34
- currentValue
35
- ]);
36
- return /* @__PURE__ */ jsx(SegmentedControlContext.Provider, {
37
- value: contextValue,
19
+ const handleValueChange = React$1.useCallback((newValue) => {
20
+ if (!isControlled) setInternalValue(newValue);
21
+ onValueChange?.(newValue);
22
+ }, [isControlled, onValueChange]);
23
+ return /* @__PURE__ */ jsx(SegmentedControlContext, {
24
+ value: React$1.useMemo(() => ({
25
+ size,
26
+ theme,
27
+ defaultValue,
28
+ onValueChange: handleValueChange,
29
+ value: currentValue
30
+ }), [
31
+ size,
32
+ theme,
33
+ defaultValue,
34
+ handleValueChange,
35
+ currentValue
36
+ ]),
38
37
  children: /* @__PURE__ */ jsx(StyledSegmentedControlRoot, {
39
38
  size,
40
39
  value: currentValue,
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControlRoot.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlRoot.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Tabs } from '../tabs/Tabs'\nimport { SegmentedControlContext } from './SegmentedControl.context'\nimport type { SegmentedControlTheme } from './SegmentedControl.types'\n\nconst StyledSegmentedControlRoot = styled(\n Tabs,\n {\n base: ['[&>div]:border-none'],\n variants: {\n size: {\n sm: ['w-[unset]!'],\n md: [],\n lg: []\n }\n }\n },\n { enableResponsiveVariants: true }\n)\n\nexport interface SegmentedControlRootProps extends React.ComponentProps<\n typeof StyledSegmentedControlRoot\n> {\n theme?: SegmentedControlTheme\n}\n\nexport const SegmentedControlRoot = ({\n size,\n theme = 'primary',\n defaultValue,\n children,\n value,\n onValueChange,\n ...rest\n}: React.PropsWithChildren<SegmentedControlRootProps>) => {\n const isControlled = value !== undefined\n\n const [internalValue, setInternalValue] = React.useState(defaultValue)\n\n const currentValue = isControlled ? value : internalValue\n const handleValueChange = isControlled ? onValueChange : setInternalValue\n\n React.useEffect(() => {\n if (!isControlled && defaultValue) {\n setInternalValue(defaultValue)\n }\n }, [defaultValue, isControlled])\n\n const contextValue = React.useMemo(\n () => ({\n size,\n theme,\n defaultValue,\n onValueChange: handleValueChange,\n value: currentValue\n }),\n [size, theme, defaultValue, handleValueChange, currentValue]\n )\n\n return (\n <SegmentedControlContext.Provider value={contextValue}>\n <StyledSegmentedControlRoot\n size={size}\n value={currentValue}\n onValueChange={handleValueChange}\n {...rest}\n >\n {children}\n </StyledSegmentedControlRoot>\n </SegmentedControlContext.Provider>\n )\n}\n"],"mappings":";;;;;;AAOA,IAAM,6BAA6B,OACjC,MACA;CACE,MAAM,CAAC,qBAAqB;CAC5B,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,YAAY;EACjB,IAAI,CAAC;EACL,IAAI,CAAC;CACP,EACF;AACF,GACA,EAAE,0BAA0B,KAAK,CACnC;AAQA,IAAa,wBAAwB,EACnC,MACA,QAAQ,WACR,cACA,UACA,OACA,eACA,GAAG,WACqD;CACxD,MAAM,eAAe,UAAU,KAAA;CAE/B,MAAM,CAAC,eAAe,oBAAoB,QAAM,SAAS,YAAY;CAErE,MAAM,eAAe,eAAe,QAAQ;CAC5C,MAAM,oBAAoB,eAAe,gBAAgB;CAEzD,QAAM,gBAAgB;EACpB,IAAI,CAAC,gBAAgB,cACnB,iBAAiB,YAAY;CAEjC,GAAG,CAAC,cAAc,YAAY,CAAC;CAE/B,MAAM,eAAe,QAAM,eAClB;EACL;EACA;EACA;EACA,eAAe;EACf,OAAO;CACT,IACA;EAAC;EAAM;EAAO;EAAc;EAAmB;CAAY,CAC7D;CAEA,OACE,oBAAC,wBAAwB,UAAzB;EAAkC,OAAO;YACvC,oBAAC,4BAAD;GACQ;GACN,OAAO;GACP,eAAe;GACf,GAAI;GAEH;EACyB,CAAA;CACI,CAAA;AAEtC"}
1
+ {"version":3,"file":"SegmentedControlRoot.js","names":[],"sources":["../../../src/components/segmented-control/SegmentedControlRoot.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { Tabs } from '../tabs/Tabs'\nimport { SegmentedControlContext } from './SegmentedControl.context'\nimport type { SegmentedControlTheme } from './SegmentedControl.types'\n\nconst StyledSegmentedControlRoot = styled(\n Tabs,\n {\n base: ['[&>div]:border-none'],\n variants: {\n size: {\n sm: ['w-[unset]!'],\n md: [],\n lg: []\n }\n }\n },\n { enableResponsiveVariants: true }\n)\n\nexport interface SegmentedControlRootProps extends React.ComponentProps<\n typeof StyledSegmentedControlRoot\n> {\n theme?: SegmentedControlTheme\n}\n\nexport const SegmentedControlRoot = ({\n size,\n theme = 'primary',\n defaultValue,\n children,\n value,\n onValueChange,\n ...rest\n}: React.PropsWithChildren<SegmentedControlRootProps>) => {\n const isControlled = value !== undefined\n\n const [internalValue, setInternalValue] = React.useState(defaultValue)\n\n const currentValue = isControlled ? value : internalValue\n // Fire the consumer's `onValueChange` in BOTH modes; only own internal state\n // when uncontrolled. (Previously `isControlled ? onValueChange :\n // setInternalValue`, which silently dropped the consumer callback in\n // uncontrolled mode once `onValueChange` stopped leaking through `...rest`.)\n const handleValueChange = React.useCallback(\n (newValue: string) => {\n if (!isControlled) setInternalValue(newValue)\n onValueChange?.(newValue)\n },\n [isControlled, onValueChange]\n )\n\n const contextValue = React.useMemo(\n () => ({\n size,\n theme,\n defaultValue,\n onValueChange: handleValueChange,\n value: currentValue\n }),\n [size, theme, defaultValue, handleValueChange, currentValue]\n )\n\n return (\n <SegmentedControlContext value={contextValue}>\n <StyledSegmentedControlRoot\n size={size}\n value={currentValue}\n onValueChange={handleValueChange}\n {...rest}\n >\n {children}\n </StyledSegmentedControlRoot>\n </SegmentedControlContext>\n )\n}\n"],"mappings":";;;;;;AAOA,IAAM,6BAA6B,OACjC,MACA;CACE,MAAM,CAAC,qBAAqB;CAC5B,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,YAAY;EACjB,IAAI,CAAC;EACL,IAAI,CAAC;CACP,EACF;AACF,GACA,EAAE,0BAA0B,KAAK,CACnC;AAQA,IAAa,wBAAwB,EACnC,MACA,QAAQ,WACR,cACA,UACA,OACA,eACA,GAAG,WACqD;CACxD,MAAM,eAAe,UAAU,KAAA;CAE/B,MAAM,CAAC,eAAe,oBAAoB,QAAM,SAAS,YAAY;CAErE,MAAM,eAAe,eAAe,QAAQ;CAK5C,MAAM,oBAAoB,QAAM,aAC7B,aAAqB;EACpB,IAAI,CAAC,cAAc,iBAAiB,QAAQ;EAC5C,gBAAgB,QAAQ;CAC1B,GACA,CAAC,cAAc,aAAa,CAC9B;CAaA,OACE,oBAAC,yBAAD;EAAyB,OAZN,QAAM,eAClB;GACL;GACA;GACA;GACA,eAAe;GACf,OAAO;EACT,IACA;GAAC;GAAM;GAAO;GAAc;GAAmB;EAAY,CAI3B;YAC9B,oBAAC,4BAAD;GACQ;GACN,OAAO;GACP,eAAe;GACf,GAAI;GAEH;EACyB,CAAA;CACL,CAAA;AAE7B"}
@@ -4,7 +4,7 @@ var SelectMenuContext = React$1.createContext({
4
4
  size: "md",
5
5
  theme: "grey"
6
6
  });
7
- var useSelectMenuContext = () => React$1.useContext(SelectMenuContext);
7
+ var useSelectMenuContext = () => React$1.use(SelectMenuContext);
8
8
  //#endregion
9
9
  export { SelectMenuContext, useSelectMenuContext };
10
10
 
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenu.context.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.context.tsx"],"sourcesContent":["import * as React from 'react'\n\ntype SelectMenuContextValue = {\n size: 'sm' | 'md' | 'lg'\n theme: 'white' | 'grey'\n state?: 'error'\n}\n\nexport const SelectMenuContext = React.createContext<SelectMenuContextValue>({\n size: 'md',\n theme: 'grey'\n})\n\nexport const useSelectMenuContext = () => React.useContext(SelectMenuContext)\n"],"mappings":";;AAQA,IAAa,oBAAoB,QAAM,cAAsC;CAC3E,MAAM;CACN,OAAO;AACT,CAAC;AAED,IAAa,6BAA6B,QAAM,WAAW,iBAAiB"}
1
+ {"version":3,"file":"SelectMenu.context.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.context.tsx"],"sourcesContent":["import * as React from 'react'\n\ntype SelectMenuContextValue = {\n size: 'sm' | 'md' | 'lg'\n theme: 'white' | 'grey'\n state?: 'error'\n}\n\nexport const SelectMenuContext = React.createContext<SelectMenuContextValue>({\n size: 'md',\n theme: 'grey'\n})\n\nexport const useSelectMenuContext = () => React.use(SelectMenuContext)\n"],"mappings":";;AAQA,IAAa,oBAAoB,QAAM,cAAsC;CAC3E,MAAM;CACN,OAAO;AACT,CAAC;AAED,IAAa,6BAA6B,QAAM,IAAI,iBAAiB"}
@@ -4,21 +4,27 @@ import { SelectMenuItem } from "./SelectMenuItem.js";
4
4
  import { SelectMenuLabel } from "./SelectMenuLabel.js";
5
5
  import { SelectMenuSeparator } from "./SelectMenuSeparator.js";
6
6
  import { SelectMenuTrigger } from "./SelectMenuTrigger.js";
7
- import "react";
7
+ import * as React$1 from "react";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import * as RadixSelect from "@radix-ui/react-select";
10
10
  //#region src/components/select-menu/SelectMenu.tsx
11
- var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest }) => /* @__PURE__ */ jsx(SelectMenuContext.Provider, {
12
- value: {
13
- size,
14
- theme,
15
- state
16
- },
17
- children: /* @__PURE__ */ jsx(RadixSelect.Root, {
18
- ...rest,
19
- children
20
- })
21
- });
11
+ var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest }) => {
12
+ return /* @__PURE__ */ jsx(SelectMenuContext, {
13
+ value: React$1.useMemo(() => ({
14
+ size,
15
+ theme,
16
+ state
17
+ }), [
18
+ size,
19
+ theme,
20
+ state
21
+ ]),
22
+ children: /* @__PURE__ */ jsx(RadixSelect.Root, {
23
+ ...rest,
24
+ children
25
+ })
26
+ });
27
+ };
22
28
  var SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {
23
29
  Trigger: SelectMenuTrigger,
24
30
  Content: SelectMenuContent,
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMenu.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.tsx"],"sourcesContent":["import * as RadixSelect from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { SelectMenuContext } from './SelectMenu.context'\nimport { SelectMenuContent } from './SelectMenuContent'\nimport { SelectMenuItem } from './SelectMenuItem'\nimport { SelectMenuLabel } from './SelectMenuLabel'\nimport { SelectMenuSeparator } from './SelectMenuSeparator'\nimport { SelectMenuTrigger } from './SelectMenuTrigger'\n\ntype SelectMenuProps = React.ComponentProps<typeof RadixSelect.Root> & {\n size?: 'sm' | 'md' | 'lg'\n theme?: 'white' | 'grey'\n state?: 'error'\n}\n\nconst SelectMenuRoot = ({\n size = 'md',\n theme = 'grey',\n state,\n children,\n ...rest\n}: SelectMenuProps) => (\n <SelectMenuContext.Provider value={{ size, theme, state }}>\n <RadixSelect.Root {...rest}>{children}</RadixSelect.Root>\n </SelectMenuContext.Provider>\n)\n\nexport const SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {\n Trigger: SelectMenuTrigger,\n Content: SelectMenuContent,\n Item: SelectMenuItem,\n Group: RadixSelect.Group,\n Label: SelectMenuLabel,\n Separator: SelectMenuSeparator\n})\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,kBAAkB,EACtB,OAAO,MACP,QAAQ,QACR,OACA,UACA,GAAG,WAEH,oBAAC,kBAAkB,UAAnB;CAA4B,OAAO;EAAE;EAAM;EAAO;CAAM;WACtD,oBAAC,YAAY,MAAb;EAAkB,GAAI;EAAO;CAA2B,CAAA;AAC9B,CAAA;AAG9B,IAAa,aAA6B,uBAAO,OAAO,gBAAgB;CACtE,SAAS;CACT,SAAS;CACT,MAAM;CACN,OAAO,YAAY;CACnB,OAAO;CACP,WAAW;AACb,CAAC"}
1
+ {"version":3,"file":"SelectMenu.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.tsx"],"sourcesContent":["import * as RadixSelect from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { SelectMenuContext } from './SelectMenu.context'\nimport { SelectMenuContent } from './SelectMenuContent'\nimport { SelectMenuItem } from './SelectMenuItem'\nimport { SelectMenuLabel } from './SelectMenuLabel'\nimport { SelectMenuSeparator } from './SelectMenuSeparator'\nimport { SelectMenuTrigger } from './SelectMenuTrigger'\n\ntype SelectMenuProps = React.ComponentProps<typeof RadixSelect.Root> & {\n size?: 'sm' | 'md' | 'lg'\n theme?: 'white' | 'grey'\n state?: 'error'\n}\n\nconst SelectMenuRoot = ({\n size = 'md',\n theme = 'grey',\n state,\n children,\n ...rest\n}: SelectMenuProps) => {\n const value = React.useMemo(\n () => ({ size, theme, state }),\n [size, theme, state]\n )\n return (\n <SelectMenuContext value={value}>\n <RadixSelect.Root {...rest}>{children}</RadixSelect.Root>\n </SelectMenuContext>\n )\n}\n\nexport const SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {\n Trigger: SelectMenuTrigger,\n Content: SelectMenuContent,\n Item: SelectMenuItem,\n Group: RadixSelect.Group,\n Label: SelectMenuLabel,\n Separator: SelectMenuSeparator\n})\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,kBAAkB,EACtB,OAAO,MACP,QAAQ,QACR,OACA,UACA,GAAG,WACkB;CAKrB,OACE,oBAAC,mBAAD;EAA0B,OALd,QAAM,eACX;GAAE;GAAM;GAAO;EAAM,IAC5B;GAAC;GAAM;GAAO;EAAK,CAGO;YACxB,oBAAC,YAAY,MAAb;GAAkB,GAAI;GAAO;EAA2B,CAAA;CACvC,CAAA;AAEvB;AAEA,IAAa,aAA6B,uBAAO,OAAO,gBAAgB;CACtE,SAAS;CACT,SAAS;CACT,MAAM;CACN,OAAO,YAAY;CACnB,OAAO;CACP,WAAW;AACb,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from "react";
2
2
  //#region src/components/side-bar/SideBar.context.tsx
3
3
  var SideBarContext = React$1.createContext({ isExpanded: void 0 });
4
- var useSidebarState = () => React$1.useContext(SideBarContext);
4
+ var useSidebarState = () => React$1.use(SideBarContext);
5
5
  //#endregion
6
6
  export { SideBarContext, useSidebarState };
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"SideBar.context.js","names":[],"sources":["../../../src/components/side-bar/SideBar.context.tsx"],"sourcesContent":["import * as React from 'react'\n\nexport const SideBarContext = React.createContext<{\n isExpanded?: boolean\n}>({\n isExpanded: undefined\n})\n\nexport const useSidebarState = () => React.useContext(SideBarContext)\n"],"mappings":";;AAEA,IAAa,iBAAiB,QAAM,cAEjC,EACD,YAAY,KAAA,EACd,CAAC;AAED,IAAa,wBAAwB,QAAM,WAAW,cAAc"}
1
+ {"version":3,"file":"SideBar.context.js","names":[],"sources":["../../../src/components/side-bar/SideBar.context.tsx"],"sourcesContent":["import * as React from 'react'\n\nexport const SideBarContext = React.createContext<{\n isExpanded?: boolean\n}>({\n isExpanded: undefined\n})\n\nexport const useSidebarState = () => React.use(SideBarContext)\n"],"mappings":";;AAEA,IAAa,iBAAiB,QAAM,cAEjC,EACD,YAAY,KAAA,EACd,CAAC;AAED,IAAa,wBAAwB,QAAM,IAAI,cAAc"}
@@ -84,8 +84,8 @@ var SideBarComponent = ({ theme, className, children, type = "expandable", offse
84
84
  ...touchProps,
85
85
  ref
86
86
  } : {};
87
- return /* @__PURE__ */ jsx(SideBarContext.Provider, {
88
- value: { isExpanded },
87
+ return /* @__PURE__ */ jsx(SideBarContext, {
88
+ value: React$1.useMemo(() => ({ isExpanded }), [isExpanded]),
89
89
  children: /* @__PURE__ */ jsx(Theme, {
90
90
  theme: theme || light,
91
91
  children: /* @__PURE__ */ jsx(Root, {
@@ -1 +1 @@
1
- {"version":3,"file":"SideBar.js","names":[],"sources":["../../../src/components/side-bar/SideBar.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFocusWithin, useHover, useInteractOutside } from 'react-aria'\n\nimport { styled, Theme, cn } from '../../styled'\nimport { SideBarContext } from './SideBar.context'\nimport {\n SideBarBody,\n SideBarBrand,\n SideBarBrandLogo,\n SideBarBrandName,\n SideBarFooter,\n SideBarHeader\n} from './SideBarComponents'\n\nconst light = {\n '--background': 'white',\n '--text': 'var(--color-grey-800)',\n '--border': 'var(--color-grey-200)'\n}\n\nconst Root = styled('div', {\n base: ['sticky', 'z-1'],\n variants: {\n type: {\n static: [],\n expandable: ['w-22']\n }\n }\n})\n\nconst Content = styled('div', {\n base: [\n 'bg-(--background)',\n 'border-r',\n 'border-r-(--border)',\n 'shadow-[4px_0_4px_-2px_rgba(31,31,31,0)]',\n 'flex',\n 'flex-col',\n 'h-full',\n 'overflow-hidden',\n 'will-change-width',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[shadow,width]'\n ],\n variants: {\n type: {\n static: [],\n expandable: []\n },\n isExpanded: {\n true: ['w-[16rem]'],\n false: ['w-22']\n }\n },\n compoundVariants: [\n {\n isExpanded: true,\n type: 'expandable',\n class: ['shadow-[4px_0_4px_-2px_rgba(31,31,31,0.1)]']\n }\n ]\n})\n\nconst PointerBlocker = styled('div', {\n base: [\n 'bottom-0',\n 'left-0',\n 'absolute',\n 'right-0',\n 'top-0',\n 'transition-all'\n ],\n variants: {\n isVisible: {\n true: ['delay-0', 'visible'],\n false: ['delay-50', 'invisible']\n }\n }\n})\n\ntype SideBarProps = React.ComponentProps<typeof Root> & {\n className?: string\n offset?: number | string\n} & React.ComponentProps<typeof Theme>\n\nconst SideBarComponent = ({\n theme,\n className,\n children,\n type = 'expandable',\n offset = '0px',\n style,\n ...rest\n}: SideBarProps) => {\n const [isExpanded, setIsExpanded] = React.useState(type === 'static')\n const ref = React.useRef<HTMLDivElement>(null)\n\n useInteractOutside({\n ref,\n onInteractOutside: () => setIsExpanded(false)\n })\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => setIsExpanded(true),\n onBlurWithin: () => setIsExpanded(false)\n })\n const { hoverProps, isHovered } = useHover({\n onHoverStart: () => setIsExpanded(true),\n onHoverEnd: () => setIsExpanded(false)\n })\n const touchProps = {\n onTouchEnd: () => setIsExpanded(true)\n }\n\n const expandableProps =\n type === 'expandable'\n ? {\n ...focusWithinProps,\n ...hoverProps,\n ...touchProps,\n ref\n }\n : {}\n\n return (\n <SideBarContext.Provider value={{ isExpanded }}>\n <Theme theme={theme || light}>\n <Root\n {...rest}\n style={{ ...style, '--offset': offset }}\n type={type}\n className={cn(\n 'h-[calc(100svh-var(--offset))]',\n 'top-(--offset)',\n className\n )}\n >\n <Content {...expandableProps} isExpanded={isExpanded} type={type}>\n {children}\n {/**\n * When the SideBar is collapsed, ensure that the initial tap event\n * is used to expand the nav first before making the items available\n */}\n {type === 'expandable' && (\n <PointerBlocker isVisible={!isHovered && !isExpanded} />\n )}\n </Content>\n </Root>\n </Theme>\n </SideBarContext.Provider>\n )\n}\n\nexport const SideBar = /* @__PURE__ */ Object.assign(SideBarComponent, {\n Brand: SideBarBrand,\n BrandLogo: SideBarBrandLogo,\n BrandName: SideBarBrandName,\n Header: SideBarHeader,\n Body: SideBarBody,\n Footer: SideBarFooter,\n displayName: 'SideBar'\n})\n"],"mappings":";;;;;;;AAcA,IAAM,QAAQ;CACZ,gBAAgB;CAChB,UAAU;CACV,YAAY;AACd;AAEA,IAAM,OAAO,OAAO,OAAO;CACzB,MAAM,CAAC,UAAU,KAAK;CACtB,UAAU,EACR,MAAM;EACJ,QAAQ,CAAC;EACT,YAAY,CAAC,MAAM;CACrB,EACF;AACF,CAAC;AAED,IAAM,UAAU,OAAO,OAAO;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,MAAM;GACJ,QAAQ,CAAC;GACT,YAAY,CAAC;EACf;EACA,YAAY;GACV,MAAM,CAAC,WAAW;GAClB,OAAO,CAAC,MAAM;EAChB;CACF;CACA,kBAAkB,CAChB;EACE,YAAY;EACZ,MAAM;EACN,OAAO,CAAC,4CAA4C;CACtD,CACF;AACF,CAAC;AAED,IAAM,iBAAiB,OAAO,OAAO;CACnC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,WAAW;EACT,MAAM,CAAC,WAAW,SAAS;EAC3B,OAAO,CAAC,YAAY,WAAW;CACjC,EACF;AACF,CAAC;AAOD,IAAM,oBAAoB,EACxB,OACA,WACA,UACA,OAAO,cACP,SAAS,OACT,OACA,GAAG,WACe;CAClB,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,SAAS,QAAQ;CACpE,MAAM,MAAM,QAAM,OAAuB,IAAI;CAE7C,mBAAmB;EACjB;EACA,yBAAyB,cAAc,KAAK;CAC9C,CAAC;CACD,MAAM,EAAE,qBAAqB,eAAe;EAC1C,qBAAqB,cAAc,IAAI;EACvC,oBAAoB,cAAc,KAAK;CACzC,CAAC;CACD,MAAM,EAAE,YAAY,cAAc,SAAS;EACzC,oBAAoB,cAAc,IAAI;EACtC,kBAAkB,cAAc,KAAK;CACvC,CAAC;CACD,MAAM,aAAa,EACjB,kBAAkB,cAAc,IAAI,EACtC;CAEA,MAAM,kBACJ,SAAS,eACL;EACE,GAAG;EACH,GAAG;EACH,GAAG;EACH;CACF,IACA,CAAC;CAEP,OACE,oBAAC,eAAe,UAAhB;EAAyB,OAAO,EAAE,WAAW;YAC3C,oBAAC,OAAD;GAAO,OAAO,SAAS;aACrB,oBAAC,MAAD;IACE,GAAI;IACJ,OAAO;KAAE,GAAG;KAAO,YAAY;IAAO;IAChC;IACN,WAAW,GACT,kCACA,kBACA,SACF;cAEA,qBAAC,SAAD;KAAS,GAAI;KAA6B;KAAkB;eAA5D,CACG,UAKA,SAAS,gBACR,oBAAC,gBAAD,EAAgB,WAAW,CAAC,aAAa,CAAC,WAAa,CAAA,CAElD;;GACL,CAAA;EACD,CAAA;CACgB,CAAA;AAE7B;AAEA,IAAa,UAA0B,uBAAO,OAAO,kBAAkB;CACrE,OAAO;CACP,WAAW;CACX,WAAW;CACX,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,aAAa;AACf,CAAC"}
1
+ {"version":3,"file":"SideBar.js","names":[],"sources":["../../../src/components/side-bar/SideBar.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFocusWithin, useHover, useInteractOutside } from 'react-aria'\n\nimport { styled, Theme, cn } from '../../styled'\nimport { SideBarContext } from './SideBar.context'\nimport {\n SideBarBody,\n SideBarBrand,\n SideBarBrandLogo,\n SideBarBrandName,\n SideBarFooter,\n SideBarHeader\n} from './SideBarComponents'\n\nconst light = {\n '--background': 'white',\n '--text': 'var(--color-grey-800)',\n '--border': 'var(--color-grey-200)'\n}\n\nconst Root = styled('div', {\n base: ['sticky', 'z-1'],\n variants: {\n type: {\n static: [],\n expandable: ['w-22']\n }\n }\n})\n\nconst Content = styled('div', {\n base: [\n 'bg-(--background)',\n 'border-r',\n 'border-r-(--border)',\n 'shadow-[4px_0_4px_-2px_rgba(31,31,31,0)]',\n 'flex',\n 'flex-col',\n 'h-full',\n 'overflow-hidden',\n 'will-change-width',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[shadow,width]'\n ],\n variants: {\n type: {\n static: [],\n expandable: []\n },\n isExpanded: {\n true: ['w-[16rem]'],\n false: ['w-22']\n }\n },\n compoundVariants: [\n {\n isExpanded: true,\n type: 'expandable',\n class: ['shadow-[4px_0_4px_-2px_rgba(31,31,31,0.1)]']\n }\n ]\n})\n\nconst PointerBlocker = styled('div', {\n base: [\n 'bottom-0',\n 'left-0',\n 'absolute',\n 'right-0',\n 'top-0',\n 'transition-all'\n ],\n variants: {\n isVisible: {\n true: ['delay-0', 'visible'],\n false: ['delay-50', 'invisible']\n }\n }\n})\n\ntype SideBarProps = React.ComponentProps<typeof Root> & {\n className?: string\n offset?: number | string\n} & React.ComponentProps<typeof Theme>\n\nconst SideBarComponent = ({\n theme,\n className,\n children,\n type = 'expandable',\n offset = '0px',\n style,\n ...rest\n}: SideBarProps) => {\n const [isExpanded, setIsExpanded] = React.useState(type === 'static')\n const ref = React.useRef<HTMLDivElement>(null)\n\n useInteractOutside({\n ref,\n onInteractOutside: () => setIsExpanded(false)\n })\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => setIsExpanded(true),\n onBlurWithin: () => setIsExpanded(false)\n })\n const { hoverProps, isHovered } = useHover({\n onHoverStart: () => setIsExpanded(true),\n onHoverEnd: () => setIsExpanded(false)\n })\n const touchProps = {\n onTouchEnd: () => setIsExpanded(true)\n }\n\n const expandableProps =\n type === 'expandable'\n ? {\n ...focusWithinProps,\n ...hoverProps,\n ...touchProps,\n ref\n }\n : {}\n\n const sideBarContextValue = React.useMemo(\n () => ({ isExpanded }),\n [isExpanded]\n )\n\n return (\n <SideBarContext value={sideBarContextValue}>\n <Theme theme={theme || light}>\n <Root\n {...rest}\n style={{ ...style, '--offset': offset }}\n type={type}\n className={cn(\n 'h-[calc(100svh-var(--offset))]',\n 'top-(--offset)',\n className\n )}\n >\n <Content {...expandableProps} isExpanded={isExpanded} type={type}>\n {children}\n {/**\n * When the SideBar is collapsed, ensure that the initial tap event\n * is used to expand the nav first before making the items available\n */}\n {type === 'expandable' && (\n <PointerBlocker isVisible={!isHovered && !isExpanded} />\n )}\n </Content>\n </Root>\n </Theme>\n </SideBarContext>\n )\n}\n\nexport const SideBar = /* @__PURE__ */ Object.assign(SideBarComponent, {\n Brand: SideBarBrand,\n BrandLogo: SideBarBrandLogo,\n BrandName: SideBarBrandName,\n Header: SideBarHeader,\n Body: SideBarBody,\n Footer: SideBarFooter,\n displayName: 'SideBar'\n})\n"],"mappings":";;;;;;;AAcA,IAAM,QAAQ;CACZ,gBAAgB;CAChB,UAAU;CACV,YAAY;AACd;AAEA,IAAM,OAAO,OAAO,OAAO;CACzB,MAAM,CAAC,UAAU,KAAK;CACtB,UAAU,EACR,MAAM;EACJ,QAAQ,CAAC;EACT,YAAY,CAAC,MAAM;CACrB,EACF;AACF,CAAC;AAED,IAAM,UAAU,OAAO,OAAO;CAC5B,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,MAAM;GACJ,QAAQ,CAAC;GACT,YAAY,CAAC;EACf;EACA,YAAY;GACV,MAAM,CAAC,WAAW;GAClB,OAAO,CAAC,MAAM;EAChB;CACF;CACA,kBAAkB,CAChB;EACE,YAAY;EACZ,MAAM;EACN,OAAO,CAAC,4CAA4C;CACtD,CACF;AACF,CAAC;AAED,IAAM,iBAAiB,OAAO,OAAO;CACnC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,WAAW;EACT,MAAM,CAAC,WAAW,SAAS;EAC3B,OAAO,CAAC,YAAY,WAAW;CACjC,EACF;AACF,CAAC;AAOD,IAAM,oBAAoB,EACxB,OACA,WACA,UACA,OAAO,cACP,SAAS,OACT,OACA,GAAG,WACe;CAClB,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,SAAS,QAAQ;CACpE,MAAM,MAAM,QAAM,OAAuB,IAAI;CAE7C,mBAAmB;EACjB;EACA,yBAAyB,cAAc,KAAK;CAC9C,CAAC;CACD,MAAM,EAAE,qBAAqB,eAAe;EAC1C,qBAAqB,cAAc,IAAI;EACvC,oBAAoB,cAAc,KAAK;CACzC,CAAC;CACD,MAAM,EAAE,YAAY,cAAc,SAAS;EACzC,oBAAoB,cAAc,IAAI;EACtC,kBAAkB,cAAc,KAAK;CACvC,CAAC;CACD,MAAM,aAAa,EACjB,kBAAkB,cAAc,IAAI,EACtC;CAEA,MAAM,kBACJ,SAAS,eACL;EACE,GAAG;EACH,GAAG;EACH,GAAG;EACH;CACF,IACA,CAAC;CAOP,OACE,oBAAC,gBAAD;EAAgB,OANU,QAAM,eACzB,EAAE,WAAW,IACpB,CAAC,UAAU,CAIY;YACrB,oBAAC,OAAD;GAAO,OAAO,SAAS;aACrB,oBAAC,MAAD;IACE,GAAI;IACJ,OAAO;KAAE,GAAG;KAAO,YAAY;IAAO;IAChC;IACN,WAAW,GACT,kCACA,kBACA,SACF;cAEA,qBAAC,SAAD;KAAS,GAAI;KAA6B;KAAkB;eAA5D,CACG,UAKA,SAAS,gBACR,oBAAC,gBAAD,EAAgB,WAAW,CAAC,aAAa,CAAC,WAAa,CAAA,CAElD;;GACL,CAAA;EACD,CAAA;CACO,CAAA;AAEpB;AAEA,IAAa,UAA0B,uBAAO,OAAO,kBAAkB;CACrE,OAAO;CACP,WAAW;CACX,WAAW;CACX,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,aAAa;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SkeletonCard.js","names":[],"sources":["../../../src/components/skeleton-loader/SkeletonCard.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '../../styled'\nimport { Flex } from '../flex/Flex'\nimport { Tile } from '../tile/Tile'\nimport { SkeletonLoader } from './Skeleton'\nimport { SkeletonButton } from './SkeletonButton'\nimport { SkeletonDoughnutChart } from './SkeletonDoughnutChart'\n\nexport const SkeletonCard = ({\n numberOfRows = 3,\n withChart,\n className\n}: {\n numberOfRows?: number\n withChart?: boolean\n className?: string\n}) => (\n <Tile\n className={cn(\n 'relative',\n 'w-full',\n 'flex-col',\n 'items-center',\n 'gap-6',\n 'p-6',\n className\n )}\n >\n <div className=\"align-center flex w-full gap-6\">\n {withChart && <SkeletonDoughnutChart />}\n <div className=\"flex grow flex-col gap-6\">\n {Array.from({ length: numberOfRows }, (_, index) => index).map(\n (rowNumber) => (\n <SkeletonLoader\n key={rowNumber}\n className=\"bg-grey-200 h-10 w-full min-w-25 rounded-md\"\n />\n )\n )}\n </div>\n </div>\n <SkeletonButton />\n </Tile>\n)\n"],"mappings":";;;;;;;;AASA,IAAa,gBAAgB,EAC3B,eAAe,GACf,WACA,gBAMA,qBAAC,MAAD;CACE,WAAW,GACT,YACA,UACA,YACA,gBACA,SACA,OACA,SACF;WATF,CAWE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,aAAa,oBAAC,uBAAD,CAAwB,CAAA,GACtC,oBAAC,OAAD;GAAK,WAAU;aACZ,MAAM,KAAK,EAAE,QAAQ,aAAa,IAAI,GAAG,UAAU,KAAK,CAAC,CAAC,KACxD,cACC,oBAAC,gBAAD,EAEE,WAAU,8CACX,GAFM,SAEN,CAEL;EACG,CAAA,CACF;KACL,oBAAC,gBAAD,CAAiB,CAAA,CACb"}
1
+ {"version":3,"file":"SkeletonCard.js","names":[],"sources":["../../../src/components/skeleton-loader/SkeletonCard.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '../../styled'\nimport { Tile } from '../tile/Tile'\nimport { SkeletonLoader } from './Skeleton'\nimport { SkeletonButton } from './SkeletonButton'\nimport { SkeletonDoughnutChart } from './SkeletonDoughnutChart'\n\nexport const SkeletonCard = ({\n numberOfRows = 3,\n withChart,\n className\n}: {\n numberOfRows?: number\n withChart?: boolean\n className?: string\n}) => (\n <Tile\n className={cn(\n 'relative',\n 'w-full',\n 'flex-col',\n 'items-center',\n 'gap-6',\n 'p-6',\n className\n )}\n >\n <div className=\"align-center flex w-full gap-6\">\n {withChart && <SkeletonDoughnutChart />}\n <div className=\"flex grow flex-col gap-6\">\n {Array.from({ length: numberOfRows }, (_, index) => index).map(\n (rowNumber) => (\n <SkeletonLoader\n key={rowNumber}\n className=\"bg-grey-200 h-10 w-full min-w-25 rounded-md\"\n />\n )\n )}\n </div>\n </div>\n <SkeletonButton />\n </Tile>\n)\n"],"mappings":";;;;;;;;AAQA,IAAa,gBAAgB,EAC3B,eAAe,GACf,WACA,gBAMA,qBAAC,MAAD;CACE,WAAW,GACT,YACA,UACA,YACA,gBACA,SACA,OACA,SACF;WATF,CAWE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,aAAa,oBAAC,uBAAD,CAAwB,CAAA,GACtC,oBAAC,OAAD;GAAK,WAAU;aACZ,MAAM,KAAK,EAAE,QAAQ,aAAa,IAAI,GAAG,UAAU,KAAK,CAAC,CAAC,KACxD,cACC,oBAAC,gBAAD,EAEE,WAAU,8CACX,GAFM,SAEN,CAEL;EACG,CAAA,CACF;KACL,oBAAC,gBAAD,CAAiB,CAAA,CACb"}
@@ -5,16 +5,21 @@ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useController, useFormContext } from "react-hook-form";
6
6
  //#region src/components/slider-field/SliderField.tsx
7
7
  var SliderField = ({ className, hideLabel, label, name, defaultValue, value, validation, outputLabel, min = 0, max = 100, steps = [], ...rest }) => {
8
- const { control } = useFormContext();
8
+ const { control, setValue } = useFormContext();
9
9
  const { field: { ref, onChange, value: innerValue, name: innerName } } = useController({
10
10
  name,
11
11
  control,
12
12
  rules: validation,
13
13
  defaultValue
14
14
  });
15
+ const serializedValue = JSON.stringify(value);
15
16
  React$1.useEffect(() => {
16
- if (value?.length) onChange(value);
17
- }, [JSON.stringify(value)]);
17
+ if (typeof value !== "undefined") setValue(name, value, { shouldDirty: false });
18
+ }, [
19
+ serializedValue,
20
+ name,
21
+ setValue
22
+ ]);
18
23
  return /* @__PURE__ */ jsx(FieldWrapper, {
19
24
  className,
20
25
  fieldId: name,
@@ -1 +1 @@
1
- {"version":3,"file":"SliderField.js","names":[],"sources":["../../../src/components/slider-field/SliderField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport {\n type FieldElementWrapperProps,\n FieldWrapper\n} from '../field-wrapper/FieldWrapper'\nimport { Slider, type SliderProps } from '../slider/Slider'\nimport type { SliderStepsType } from '../slider/SliderSteps'\nimport type { SliderValueType } from '../slider/SliderValue'\n\ntype SliderFieldProps = SliderProps &\n SliderStepsType &\n SliderValueType &\n FieldElementWrapperProps\n\nexport const SliderField = ({\n className,\n hideLabel,\n label,\n name,\n defaultValue,\n value,\n validation,\n outputLabel,\n min = 0,\n max = 100,\n steps = [],\n ...rest\n}: SliderFieldProps) => {\n const { control } = useFormContext()\n const {\n field: { ref, onChange, value: innerValue, name: innerName }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n\n React.useEffect(() => {\n // Update the react-hook-form inner value to match what is passed in.\n if (value?.length) onChange(value)\n }, [JSON.stringify(value)])\n\n return (\n <FieldWrapper\n className={className}\n fieldId={name}\n label={label}\n hideLabel={hideLabel}\n >\n <Slider\n ref={ref}\n name={innerName}\n onValueChange={onChange}\n value={innerValue}\n min={min}\n max={max}\n {...rest}\n >\n <Slider.Steps min={min} max={max} steps={steps} />\n\n <Slider.Value value={innerValue} outputLabel={outputLabel} />\n </Slider>\n </FieldWrapper>\n )\n}\n\nSliderField.displayName = 'SliderField'\n"],"mappings":";;;;;;AAgBA,IAAa,eAAe,EAC1B,WACA,WACA,OACA,MACA,cACA,OACA,YACA,aACA,MAAM,GACN,MAAM,KACN,QAAQ,CAAC,GACT,GAAG,WACmB;CACtB,MAAM,EAAE,YAAY,eAAe;CACnC,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,YAAY,MAAM,gBAC/C,cAAc;EAChB;EACA;EACA,OAAO;EACP;CACF,CAAC;CAED,QAAM,gBAAgB;EAEpB,IAAI,OAAO,QAAQ,SAAS,KAAK;CACnC,GAAG,CAAC,KAAK,UAAU,KAAK,CAAC,CAAC;CAE1B,OACE,oBAAC,cAAD;EACa;EACX,SAAS;EACF;EACI;YAEX,qBAAC,QAAD;GACO;GACL,MAAM;GACN,eAAe;GACf,OAAO;GACF;GACA;GACL,GAAI;aAPN,CASE,oBAAC,OAAO,OAAR;IAAmB;IAAU;IAAY;GAAQ,CAAA,GAEjD,oBAAC,OAAO,OAAR;IAAc,OAAO;IAAyB;GAAc,CAAA,CACtD;;CACI,CAAA;AAElB;AAEA,YAAY,cAAc"}
1
+ {"version":3,"file":"SliderField.js","names":[],"sources":["../../../src/components/slider-field/SliderField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport {\n type FieldElementWrapperProps,\n FieldWrapper\n} from '../field-wrapper/FieldWrapper'\nimport { Slider, type SliderProps } from '../slider/Slider'\nimport type { SliderStepsType } from '../slider/SliderSteps'\nimport type { SliderValueType } from '../slider/SliderValue'\n\ntype SliderFieldProps = SliderProps &\n SliderStepsType &\n SliderValueType &\n FieldElementWrapperProps\n\nexport const SliderField = ({\n className,\n hideLabel,\n label,\n name,\n defaultValue,\n value,\n validation,\n outputLabel,\n min = 0,\n max = 100,\n steps = [],\n ...rest\n}: SliderFieldProps) => {\n const { control, setValue } = useFormContext()\n const {\n field: { ref, onChange, value: innerValue, name: innerName }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n\n // Serialized so an inline `value` array with a fresh identity per render\n // doesn't re-fire the sync effect.\n const serializedValue = JSON.stringify(value)\n React.useEffect(() => {\n // Sync an externally-controlled `value` into react-hook-form without\n // marking the field dirty/touched — this isn't user input. An empty\n // array is a valid value (clearing) and must sync too.\n if (typeof value !== 'undefined')\n setValue(name, value, { shouldDirty: false })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [serializedValue, name, setValue])\n\n return (\n <FieldWrapper\n className={className}\n fieldId={name}\n label={label}\n hideLabel={hideLabel}\n >\n <Slider\n ref={ref}\n name={innerName}\n onValueChange={onChange}\n value={innerValue}\n min={min}\n max={max}\n {...rest}\n >\n <Slider.Steps min={min} max={max} steps={steps} />\n\n <Slider.Value value={innerValue} outputLabel={outputLabel} />\n </Slider>\n </FieldWrapper>\n )\n}\n\nSliderField.displayName = 'SliderField'\n"],"mappings":";;;;;;AAgBA,IAAa,eAAe,EAC1B,WACA,WACA,OACA,MACA,cACA,OACA,YACA,aACA,MAAM,GACN,MAAM,KACN,QAAQ,CAAC,GACT,GAAG,WACmB;CACtB,MAAM,EAAE,SAAS,aAAa,eAAe;CAC7C,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,YAAY,MAAM,gBAC/C,cAAc;EAChB;EACA;EACA,OAAO;EACP;CACF,CAAC;CAID,MAAM,kBAAkB,KAAK,UAAU,KAAK;CAC5C,QAAM,gBAAgB;EAIpB,IAAI,OAAO,UAAU,aACnB,SAAS,MAAM,OAAO,EAAE,aAAa,MAAM,CAAC;CAEhD,GAAG;EAAC;EAAiB;EAAM;CAAQ,CAAC;CAEpC,OACE,oBAAC,cAAD;EACa;EACX,SAAS;EACF;EACI;YAEX,qBAAC,QAAD;GACO;GACL,MAAM;GACN,eAAe;GACf,OAAO;GACF;GACA;GACL,GAAI;aAPN,CASE,oBAAC,OAAO,OAAR;IAAmB;IAAU;IAAY;GAAQ,CAAA,GAEjD,oBAAC,OAAO,OAAR;IAAc,OAAO;IAAyB;GAAc,CAAA,CACtD;;CACI,CAAA;AAElB;AAEA,YAAY,cAAc"}
@@ -5,9 +5,11 @@ import { DndContext, KeyboardSensor, PointerSensor, closestCenter, useSensor, us
5
5
  //#region src/components/sortable/SortableRoot.tsx
6
6
  var SortableRoot = ({ sortableIds, onSortChange, children }) => {
7
7
  const [order, setOrder] = React$1.useState(sortableIds);
8
- React$1.useEffect(() => {
9
- setOrder(sortableIds);
10
- }, [sortableIds]);
8
+ const [prevIds, setPrevIds] = React$1.useState(sortableIds);
9
+ if (prevIds !== sortableIds) {
10
+ setPrevIds(sortableIds);
11
+ if (prevIds.length !== sortableIds.length || sortableIds.some((id, index) => id !== prevIds[index])) setOrder(sortableIds);
12
+ }
11
13
  const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
12
14
  const handleDragEnd = (event) => {
13
15
  const { active, over } = event;
@@ -1 +1 @@
1
- {"version":3,"file":"SortableRoot.js","names":[],"sources":["../../../src/components/sortable/SortableRoot.tsx"],"sourcesContent":["import type { DragEndEvent, UniqueIdentifier } from '@dnd-kit/core'\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors\n} from '@dnd-kit/core'\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates\n} from '@dnd-kit/sortable'\nimport * as React from 'react'\n\ntype SortableRootProps = {\n sortableIds: (string | number)[]\n onSortChange: (onSortChangeData: {\n order: UniqueIdentifier[]\n oldIndex: number\n newIndex: number\n }) => void\n}\n\nexport const SortableRoot = ({\n sortableIds,\n onSortChange,\n children\n}: React.PropsWithChildren<SortableRootProps>) => {\n const [order, setOrder] = React.useState<(string | number)[]>(sortableIds)\n React.useEffect(() => {\n setOrder(sortableIds)\n }, [sortableIds])\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates\n })\n )\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event\n if (active.id && over?.id && active.id !== over?.id) {\n setOrder((order) => {\n const oldIndex = order.indexOf(active.id)\n const newIndex = order.indexOf(over.id)\n const newOrder = arrayMove(order, oldIndex, newIndex)\n onSortChange({ order: newOrder, oldIndex, newIndex })\n return newOrder\n })\n }\n }\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext items={order}>{children}</SortableContext>\n </DndContext>\n )\n}\n\nSortableRoot.displayName = 'SortableRoot'\n"],"mappings":";;;;;AAyBA,IAAa,gBAAgB,EAC3B,aACA,cACA,eACgD;CAChD,MAAM,CAAC,OAAO,YAAY,QAAM,SAA8B,WAAW;CACzE,QAAM,gBAAgB;EACpB,SAAS,WAAW;CACtB,GAAG,CAAC,WAAW,CAAC;CAEhB,MAAM,UAAU,WACd,UAAU,aAAa,GACvB,UAAU,gBAAgB,EACxB,kBAAkB,4BACpB,CAAC,CACH;CAEA,MAAM,iBAAiB,UAAwB;EAC7C,MAAM,EAAE,QAAQ,SAAS;EACzB,IAAI,OAAO,MAAM,MAAM,MAAM,OAAO,OAAO,MAAM,IAC/C,UAAU,UAAU;GAClB,MAAM,WAAW,MAAM,QAAQ,OAAO,EAAE;GACxC,MAAM,WAAW,MAAM,QAAQ,KAAK,EAAE;GACtC,MAAM,WAAW,UAAU,OAAO,UAAU,QAAQ;GACpD,aAAa;IAAE,OAAO;IAAU;IAAU;GAAS,CAAC;GACpD,OAAO;EACT,CAAC;CAEL;CAEA,OACE,oBAAC,YAAD;EACW;EACT,oBAAoB;EACpB,WAAW;YAEX,oBAAC,iBAAD;GAAiB,OAAO;GAAQ;EAA0B,CAAA;CAChD,CAAA;AAEhB;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"SortableRoot.js","names":[],"sources":["../../../src/components/sortable/SortableRoot.tsx"],"sourcesContent":["import type { DragEndEvent, UniqueIdentifier } from '@dnd-kit/core'\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors\n} from '@dnd-kit/core'\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates\n} from '@dnd-kit/sortable'\nimport * as React from 'react'\n\ntype SortableRootProps = {\n sortableIds: (string | number)[]\n onSortChange: (onSortChangeData: {\n order: UniqueIdentifier[]\n oldIndex: number\n newIndex: number\n }) => void\n}\n\nexport const SortableRoot = ({\n sortableIds,\n onSortChange,\n children\n}: React.PropsWithChildren<SortableRootProps>) => {\n const [order, setOrder] = React.useState<(string | number)[]>(sortableIds)\n // Reconcile the external ids during render (React's \"adjusting state when\n // props change\" pattern — no stale frame), comparing by content rather than\n // identity so a parent passing an inline array doesn't reset the order and\n // discard in-flight drag state on every render.\n const [prevIds, setPrevIds] = React.useState(sortableIds)\n if (prevIds !== sortableIds) {\n setPrevIds(sortableIds)\n const contentChanged =\n prevIds.length !== sortableIds.length ||\n sortableIds.some((id, index) => id !== prevIds[index])\n if (contentChanged) setOrder(sortableIds)\n }\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates\n })\n )\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event\n if (active.id && over?.id && active.id !== over?.id) {\n setOrder((order) => {\n const oldIndex = order.indexOf(active.id)\n const newIndex = order.indexOf(over.id)\n const newOrder = arrayMove(order, oldIndex, newIndex)\n onSortChange({ order: newOrder, oldIndex, newIndex })\n return newOrder\n })\n }\n }\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext items={order}>{children}</SortableContext>\n </DndContext>\n )\n}\n\nSortableRoot.displayName = 'SortableRoot'\n"],"mappings":";;;;;AAyBA,IAAa,gBAAgB,EAC3B,aACA,cACA,eACgD;CAChD,MAAM,CAAC,OAAO,YAAY,QAAM,SAA8B,WAAW;CAKzE,MAAM,CAAC,SAAS,cAAc,QAAM,SAAS,WAAW;CACxD,IAAI,YAAY,aAAa;EAC3B,WAAW,WAAW;EAItB,IAFE,QAAQ,WAAW,YAAY,UAC/B,YAAY,MAAM,IAAI,UAAU,OAAO,QAAQ,MAAM,GACnC,SAAS,WAAW;CAC1C;CAEA,MAAM,UAAU,WACd,UAAU,aAAa,GACvB,UAAU,gBAAgB,EACxB,kBAAkB,4BACpB,CAAC,CACH;CAEA,MAAM,iBAAiB,UAAwB;EAC7C,MAAM,EAAE,QAAQ,SAAS;EACzB,IAAI,OAAO,MAAM,MAAM,MAAM,OAAO,OAAO,MAAM,IAC/C,UAAU,UAAU;GAClB,MAAM,WAAW,MAAM,QAAQ,OAAO,EAAE;GACxC,MAAM,WAAW,MAAM,QAAQ,KAAK,EAAE;GACtC,MAAM,WAAW,UAAU,OAAO,UAAU,QAAQ;GACpD,aAAa;IAAE,OAAO;IAAU;IAAU;GAAS,CAAC;GACpD,OAAO;EACT,CAAC;CAEL;CAEA,OACE,oBAAC,YAAD;EACW;EACT,oBAAoB;EACpB,WAAW;YAEX,oBAAC,iBAAD;GAAiB,OAAO;GAAQ;EAA0B,CAAA;CAChD,CAAA;AAEhB;AAEA,aAAa,cAAc"}
@@ -1,43 +1,37 @@
1
1
  import * as React$1 from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/components/stepper/Stepper.context.tsx
4
- var StepperContext = React$1.createContext({
5
- steps: [],
6
- goToPreviousStep: () => null,
7
- goToNextStep: () => null,
8
- goToStep: () => null,
9
- activeStep: 0,
10
- viewedSteps: [],
11
- allowSkip: false,
12
- direction: "horizontal",
13
- hideLabels: false,
14
- completedSteps: [],
15
- showCompletedIcons: false
16
- });
4
+ var StepperContext = React$1.createContext(null);
17
5
  var StepperProvider = ({ children, stepCount, allowSkip, onComplete, onStepChange, direction, steps, hideLabels, showCompletedIcons }) => {
18
6
  const [activeStep, setActiveStep] = React$1.useState(0);
19
7
  const [viewedSteps, setviewedSteps] = React$1.useState([0]);
20
8
  const [completedSteps, setCompletedSteps] = React$1.useState([]);
21
9
  const isControlled = !stepCount;
22
- React$1.useEffect(() => {
23
- setviewedSteps((prev) => prev.includes(activeStep) ? prev : [...prev, activeStep]);
24
- onStepChange?.(activeStep);
25
- }, [activeStep, onStepChange]);
26
- const goToNextStep = () => {
10
+ const changeStep = React$1.useCallback((nextStep) => {
11
+ setActiveStep(nextStep);
12
+ setviewedSteps((prev) => prev.includes(nextStep) ? prev : [...prev, nextStep]);
13
+ onStepChange?.(nextStep);
14
+ }, [onStepChange]);
15
+ const goToNextStep = React$1.useCallback(() => {
27
16
  const isCompleted = onComplete && activeStep === stepCount - 1;
28
17
  const isNextStep = activeStep < stepCount - 1;
29
18
  if (onComplete || isNextStep) setCompletedSteps((prev) => prev.includes(activeStep) ? prev : [...prev, activeStep]);
30
19
  if (isCompleted) return onComplete?.();
31
- if (isNextStep) return setActiveStep((current) => current + 1);
32
- };
33
- const goToPreviousStep = () => {
34
- setActiveStep((current) => current - 1);
35
- };
36
- const goToStep = (index) => {
37
- setActiveStep(index);
38
- };
39
- return /* @__PURE__ */ jsx(StepperContext.Provider, {
40
- value: {
20
+ if (isNextStep) return changeStep(activeStep + 1);
21
+ }, [
22
+ activeStep,
23
+ stepCount,
24
+ onComplete,
25
+ changeStep
26
+ ]);
27
+ const goToPreviousStep = React$1.useCallback(() => {
28
+ changeStep(activeStep - 1);
29
+ }, [activeStep, changeStep]);
30
+ const goToStep = React$1.useCallback((index) => {
31
+ changeStep(index);
32
+ }, [changeStep]);
33
+ return /* @__PURE__ */ jsx(StepperContext, {
34
+ value: React$1.useMemo(() => ({
41
35
  steps: steps || Array(stepCount).fill(""),
42
36
  goToPreviousStep: isControlled ? void 0 : goToPreviousStep,
43
37
  goToNextStep: isControlled ? void 0 : goToNextStep,
@@ -49,12 +43,26 @@ var StepperProvider = ({ children, stepCount, allowSkip, onComplete, onStepChang
49
43
  direction,
50
44
  hideLabels,
51
45
  showCompletedIcons
52
- },
46
+ }), [
47
+ steps,
48
+ stepCount,
49
+ isControlled,
50
+ goToPreviousStep,
51
+ goToNextStep,
52
+ goToStep,
53
+ activeStep,
54
+ viewedSteps,
55
+ completedSteps,
56
+ allowSkip,
57
+ direction,
58
+ hideLabels,
59
+ showCompletedIcons
60
+ ]),
53
61
  children
54
62
  });
55
63
  };
56
64
  var useStepper = () => {
57
- const context = React$1.useContext(StepperContext);
65
+ const context = React$1.use(StepperContext);
58
66
  if (!context) throw new Error("Ensure that you wrap any components with the root component Stepper");
59
67
  return context;
60
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.context.js","names":[],"sources":["../../../src/components/stepper/Stepper.context.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport type { Context, StepperProviderProps } from './types'\n\nconst StepperContext = React.createContext<Context>({\n steps: [],\n goToPreviousStep: () => null,\n goToNextStep: () => null,\n goToStep: () => null,\n activeStep: 0,\n viewedSteps: [],\n allowSkip: false,\n direction: 'horizontal',\n hideLabels: false,\n completedSteps: [],\n showCompletedIcons: false\n})\n\nexport const StepperProvider = ({\n children,\n stepCount,\n allowSkip,\n onComplete,\n onStepChange,\n direction,\n steps,\n hideLabels,\n showCompletedIcons\n}: React.PropsWithChildren<StepperProviderProps>) => {\n const [activeStep, setActiveStep] = React.useState(0)\n\n const [viewedSteps, setviewedSteps] = React.useState<number[]>([0])\n const [completedSteps, setCompletedSteps] = React.useState<number[]>([])\n\n const isControlled = !stepCount\n\n React.useEffect(() => {\n setviewedSteps((prev) =>\n prev.includes(activeStep) ? prev : [...prev, activeStep]\n )\n\n onStepChange?.(activeStep)\n }, [activeStep, onStepChange])\n\n const goToNextStep = () => {\n const isCompleted = onComplete && activeStep === stepCount - 1\n const isNextStep = activeStep < stepCount - 1\n\n if (onComplete || isNextStep) {\n setCompletedSteps((prev) =>\n prev.includes(activeStep) ? prev : [...prev, activeStep]\n )\n }\n\n if (isCompleted) {\n return onComplete?.()\n }\n if (isNextStep) {\n return setActiveStep((current) => current + 1)\n }\n }\n\n const goToPreviousStep = () => {\n setActiveStep((current) => current - 1)\n }\n\n const goToStep = (index: number) => {\n setActiveStep(index)\n }\n\n return (\n <StepperContext.Provider\n value={{\n steps: steps || Array(stepCount).fill(''),\n goToPreviousStep: isControlled ? undefined : goToPreviousStep,\n goToNextStep: isControlled ? undefined : goToNextStep,\n goToStep: isControlled ? undefined : goToStep,\n activeStep,\n viewedSteps,\n completedSteps,\n allowSkip,\n direction,\n hideLabels,\n showCompletedIcons\n }}\n >\n {children}\n </StepperContext.Provider>\n )\n}\n\nexport const useStepper = (): Context => {\n const context = React.useContext(StepperContext)\n if (!context)\n throw new Error(\n 'Ensure that you wrap any components with the root component Stepper'\n )\n\n return context\n}\n"],"mappings":";;;AAIA,IAAM,iBAAiB,QAAM,cAAuB;CAClD,OAAO,CAAC;CACR,wBAAwB;CACxB,oBAAoB;CACpB,gBAAgB;CAChB,YAAY;CACZ,aAAa,CAAC;CACd,WAAW;CACX,WAAW;CACX,YAAY;CACZ,gBAAgB,CAAC;CACjB,oBAAoB;AACtB,CAAC;AAED,IAAa,mBAAmB,EAC9B,UACA,WACA,WACA,YACA,cACA,WACA,OACA,YACA,yBACmD;CACnD,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,CAAC;CAEpD,MAAM,CAAC,aAAa,kBAAkB,QAAM,SAAmB,CAAC,CAAC,CAAC;CAClE,MAAM,CAAC,gBAAgB,qBAAqB,QAAM,SAAmB,CAAC,CAAC;CAEvE,MAAM,eAAe,CAAC;CAEtB,QAAM,gBAAgB;EACpB,gBAAgB,SACd,KAAK,SAAS,UAAU,IAAI,OAAO,CAAC,GAAG,MAAM,UAAU,CACzD;EAEA,eAAe,UAAU;CAC3B,GAAG,CAAC,YAAY,YAAY,CAAC;CAE7B,MAAM,qBAAqB;EACzB,MAAM,cAAc,cAAc,eAAe,YAAY;EAC7D,MAAM,aAAa,aAAa,YAAY;EAE5C,IAAI,cAAc,YAChB,mBAAmB,SACjB,KAAK,SAAS,UAAU,IAAI,OAAO,CAAC,GAAG,MAAM,UAAU,CACzD;EAGF,IAAI,aACF,OAAO,aAAa;EAEtB,IAAI,YACF,OAAO,eAAe,YAAY,UAAU,CAAC;CAEjD;CAEA,MAAM,yBAAyB;EAC7B,eAAe,YAAY,UAAU,CAAC;CACxC;CAEA,MAAM,YAAY,UAAkB;EAClC,cAAc,KAAK;CACrB;CAEA,OACE,oBAAC,eAAe,UAAhB;EACE,OAAO;GACL,OAAO,SAAS,MAAM,SAAS,CAAC,CAAC,KAAK,EAAE;GACxC,kBAAkB,eAAe,KAAA,IAAY;GAC7C,cAAc,eAAe,KAAA,IAAY;GACzC,UAAU,eAAe,KAAA,IAAY;GACrC;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEC;CACsB,CAAA;AAE7B;AAEA,IAAa,mBAA4B;CACvC,MAAM,UAAU,QAAM,WAAW,cAAc;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MACR,qEACF;CAEF,OAAO;AACT"}
1
+ {"version":3,"file":"Stepper.context.js","names":[],"sources":["../../../src/components/stepper/Stepper.context.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport type { Context, StepperProviderProps } from './types'\n\n// null default so useStepper's missing-provider guard can fire a full\n// default object would silently render a zero-step stepper instead.\nconst StepperContext = React.createContext<Context | null>(null)\n\nexport const StepperProvider = ({\n children,\n stepCount,\n allowSkip,\n onComplete,\n onStepChange,\n direction,\n steps,\n hideLabels,\n showCompletedIcons\n}: React.PropsWithChildren<StepperProviderProps>) => {\n const [activeStep, setActiveStep] = React.useState(0)\n\n const [viewedSteps, setviewedSteps] = React.useState<number[]>([0])\n const [completedSteps, setCompletedSteps] = React.useState<number[]>([])\n\n const isControlled = !stepCount\n\n // Step changes (and their side effects) happen in the navigation handlers,\n // not an effect: an effect would fire onStepChange on mount (twice under\n // StrictMode) and again whenever the callback identity changed.\n const changeStep = React.useCallback(\n (nextStep: number) => {\n setActiveStep(nextStep)\n setviewedSteps((prev) =>\n prev.includes(nextStep) ? prev : [...prev, nextStep]\n )\n onStepChange?.(nextStep)\n },\n [onStepChange]\n )\n\n const goToNextStep = React.useCallback(() => {\n const isCompleted = onComplete && activeStep === stepCount - 1\n const isNextStep = activeStep < stepCount - 1\n\n if (onComplete || isNextStep) {\n setCompletedSteps((prev) =>\n prev.includes(activeStep) ? prev : [...prev, activeStep]\n )\n }\n\n if (isCompleted) {\n return onComplete?.()\n }\n if (isNextStep) {\n return changeStep(activeStep + 1)\n }\n }, [activeStep, stepCount, onComplete, changeStep])\n\n const goToPreviousStep = React.useCallback(() => {\n changeStep(activeStep - 1)\n }, [activeStep, changeStep])\n\n const goToStep = React.useCallback(\n (index: number) => {\n changeStep(index)\n },\n [changeStep]\n )\n\n const value = React.useMemo<Context>(\n () => ({\n steps: steps || Array(stepCount).fill(''),\n goToPreviousStep: isControlled ? undefined : goToPreviousStep,\n goToNextStep: isControlled ? undefined : goToNextStep,\n goToStep: isControlled ? undefined : goToStep,\n activeStep,\n viewedSteps,\n completedSteps,\n allowSkip,\n direction,\n hideLabels,\n showCompletedIcons\n }),\n [\n steps,\n stepCount,\n isControlled,\n goToPreviousStep,\n goToNextStep,\n goToStep,\n activeStep,\n viewedSteps,\n completedSteps,\n allowSkip,\n direction,\n hideLabels,\n showCompletedIcons\n ]\n )\n\n return <StepperContext value={value}>{children}</StepperContext>\n}\n\nexport const useStepper = (): Context => {\n const context = React.use(StepperContext)\n if (!context)\n throw new Error(\n 'Ensure that you wrap any components with the root component Stepper'\n )\n\n return context\n}\n"],"mappings":";;;AAMA,IAAM,iBAAiB,QAAM,cAA8B,IAAI;AAE/D,IAAa,mBAAmB,EAC9B,UACA,WACA,WACA,YACA,cACA,WACA,OACA,YACA,yBACmD;CACnD,MAAM,CAAC,YAAY,iBAAiB,QAAM,SAAS,CAAC;CAEpD,MAAM,CAAC,aAAa,kBAAkB,QAAM,SAAmB,CAAC,CAAC,CAAC;CAClE,MAAM,CAAC,gBAAgB,qBAAqB,QAAM,SAAmB,CAAC,CAAC;CAEvE,MAAM,eAAe,CAAC;CAKtB,MAAM,aAAa,QAAM,aACtB,aAAqB;EACpB,cAAc,QAAQ;EACtB,gBAAgB,SACd,KAAK,SAAS,QAAQ,IAAI,OAAO,CAAC,GAAG,MAAM,QAAQ,CACrD;EACA,eAAe,QAAQ;CACzB,GACA,CAAC,YAAY,CACf;CAEA,MAAM,eAAe,QAAM,kBAAkB;EAC3C,MAAM,cAAc,cAAc,eAAe,YAAY;EAC7D,MAAM,aAAa,aAAa,YAAY;EAE5C,IAAI,cAAc,YAChB,mBAAmB,SACjB,KAAK,SAAS,UAAU,IAAI,OAAO,CAAC,GAAG,MAAM,UAAU,CACzD;EAGF,IAAI,aACF,OAAO,aAAa;EAEtB,IAAI,YACF,OAAO,WAAW,aAAa,CAAC;CAEpC,GAAG;EAAC;EAAY;EAAW;EAAY;CAAU,CAAC;CAElD,MAAM,mBAAmB,QAAM,kBAAkB;EAC/C,WAAW,aAAa,CAAC;CAC3B,GAAG,CAAC,YAAY,UAAU,CAAC;CAE3B,MAAM,WAAW,QAAM,aACpB,UAAkB;EACjB,WAAW,KAAK;CAClB,GACA,CAAC,UAAU,CACb;CAiCA,OAAO,oBAAC,gBAAD;EAAuB,OA/BhB,QAAM,eACX;GACL,OAAO,SAAS,MAAM,SAAS,CAAC,CAAC,KAAK,EAAE;GACxC,kBAAkB,eAAe,KAAA,IAAY;GAC7C,cAAc,eAAe,KAAA,IAAY;GACzC,UAAU,eAAe,KAAA,IAAY;GACrC;GACA;GACA;GACA;GACA;GACA;GACA;EACF,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAG4B;EAAQ;CAAyB,CAAA;AACjE;AAEA,IAAa,mBAA4B;CACvC,MAAM,UAAU,QAAM,IAAI,cAAc;CACxC,IAAI,CAAC,SACH,MAAM,IAAI,MACR,qEACF;CAEF,OAAO;AACT"}
@@ -2,7 +2,7 @@ import * as React$1 from "react";
2
2
  //#region src/components/toast/Toast.context.tsx
3
3
  var ToastContext = React$1.createContext(null);
4
4
  var useToastContext = () => {
5
- const context = React$1.useContext(ToastContext);
5
+ const context = React$1.use(ToastContext);
6
6
  if (!context) throw new Error("useToastContext must be used within a ToastProvider");
7
7
  return context;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.context.js","names":[],"sources":["../../../src/components/toast/Toast.context.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Toast } from 'react-hot-toast'\n\nexport const ToastContext = React.createContext<Pick<\n Toast,\n 'type' | 'id' | 'message'\n> | null>(null)\n\nexport const useToastContext = () => {\n const context = React.useContext(ToastContext)\n\n if (!context) {\n throw new Error('useToastContext must be used within a ToastProvider')\n }\n\n return context\n}\n"],"mappings":";;AAGA,IAAa,eAAe,QAAM,cAGxB,IAAI;AAEd,IAAa,wBAAwB;CACnC,MAAM,UAAU,QAAM,WAAW,YAAY;CAE7C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,qDAAqD;CAGvE,OAAO;AACT"}
1
+ {"version":3,"file":"Toast.context.js","names":[],"sources":["../../../src/components/toast/Toast.context.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Toast } from 'react-hot-toast'\n\nexport const ToastContext = React.createContext<Pick<\n Toast,\n 'type' | 'id' | 'message'\n> | null>(null)\n\nexport const useToastContext = () => {\n const context = React.use(ToastContext)\n\n if (!context) {\n throw new Error('useToastContext must be used within a ToastProvider')\n }\n\n return context\n}\n"],"mappings":";;AAGA,IAAa,eAAe,QAAM,cAGxB,IAAI;AAEd,IAAa,wBAAwB;CACnC,MAAM,UAAU,QAAM,IAAI,YAAY;CAEtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,qDAAqD;CAGvE,OAAO;AACT"}
@@ -11,9 +11,9 @@ import { toast as toast$1, useToaster } from "react-hot-toast";
11
11
  var ToastProviderBase = /* @__PURE__ */ styled("div", { base: [
12
12
  "fixed",
13
13
  "z-2147483647",
14
- "inset-2",
14
+ "inset-safe-offset-2",
15
15
  "pointer-events-none",
16
- "sm:top-3"
16
+ "sm:top-safe-offset-3"
17
17
  ] });
18
18
  var ToastWrapper = /* @__PURE__ */ styled("div", {
19
19
  base: [
@@ -56,7 +56,7 @@ var ToastProvider = ({ children, className }) => {
56
56
  "aria-live": toast.ariaProps["aria-live"],
57
57
  style: { "--offset": `${offset}px` },
58
58
  className: "top-(--offset)",
59
- children: /* @__PURE__ */ jsx(ToastContext.Provider, {
59
+ children: /* @__PURE__ */ jsx(ToastContext, {
60
60
  value: toast,
61
61
  children: typeof children === "function" ? children(toast) : React$1.isValidElement(children) ? children : /* @__PURE__ */ jsxs(Toast, {
62
62
  className: "w-100",
@@ -1 +1 @@
1
- {"version":3,"file":"ToastProvider.js","names":[],"sources":["../../../src/components/toast/ToastProvider.tsx"],"sourcesContent":["import { Error } from '@atom-learning/icons'\nimport * as React from 'react'\nimport { useToaster } from 'react-hot-toast'\n\nimport { styled } from '../../styled'\nimport { Spacer } from '../spacer/Spacer'\nimport { Text } from '../text/Text'\nimport { Toast } from './Toast'\nimport { ToastContext } from './Toast.context'\n\nexport { toast } from 'react-hot-toast'\nexport { useToastContext } from './Toast.context'\n\nconst ToastProviderBase = /* @__PURE__ */ styled('div', {\n base: ['fixed', 'z-2147483647', 'inset-2', 'pointer-events-none', 'sm:top-3']\n})\n\nconst ToastWrapper = /* @__PURE__ */ styled('div', {\n base: [\n 'absolute',\n 'w-full',\n 'flex',\n 'justify-center',\n 'items-center',\n 'rounded-sm',\n 'box-border',\n 'min-h-12',\n '[--slide-opacity-out:0]',\n '[--slide-direction-out-y:-100%]'\n ],\n variants: {\n visible: {\n true: ['motion-safe:animate-slide-direction-in'],\n false: ['opacity-0', 'motion-safe:animate-slide-direction-out']\n }\n }\n})\n\nexport const ToastProvider = ({\n children,\n className\n}: React.PropsWithChildren<{ className?: string }>) => {\n const { toasts, handlers } = useToaster()\n const { startPause, endPause, calculateOffset, updateHeight } = handlers\n\n return (\n <>\n <ToastProviderBase\n onMouseEnter={startPause}\n onMouseLeave={endPause}\n className={className}\n >\n {toasts.map((toast) => {\n const { message: children } = toast\n\n const offset = calculateOffset(toast, {\n reverseOrder: true,\n gutter: 8\n })\n\n const ref = (el: HTMLDivElement | null) => {\n if (el && toast.height === undefined) {\n updateHeight(toast.id, el.getBoundingClientRect().height)\n }\n }\n\n return (\n <ToastWrapper\n key={toast.id}\n ref={ref}\n visible={toast.visible}\n role={toast.ariaProps.role}\n aria-live={toast.ariaProps['aria-live']}\n style={{ '--offset': `${offset}px` }}\n className=\"top-(--offset)\"\n >\n <ToastContext.Provider value={toast}>\n {typeof children === 'function' ? (\n children(toast)\n ) : React.isValidElement(children) ? (\n children\n ) : (\n <Toast className=\"w-100\">\n {toast.type === 'error' && <Toast.Icon is={Error} />}\n <Text>{children}</Text>\n <Spacer />\n <Toast.Close />\n </Toast>\n )}\n </ToastContext.Provider>\n </ToastWrapper>\n )\n })}\n </ToastProviderBase>\n {children}\n </>\n )\n}\n\nToastProvider.displayName = 'ToastProvider'\n"],"mappings":";;;;;;;;;;AAaA,IAAM,oBAAoC,uBAAO,OAAO,EACtD,MAAM;CAAC;CAAS;CAAgB;CAAW;CAAuB;AAAU,EAC9E,CAAC;AAED,IAAM,eAA+B,uBAAO,OAAO;CACjD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,SAAS;EACP,MAAM,CAAC,wCAAwC;EAC/C,OAAO,CAAC,aAAa,yCAAyC;CAChE,EACF;AACF,CAAC;AAED,IAAa,iBAAiB,EAC5B,UACA,gBACqD;CACrD,MAAM,EAAE,QAAQ,aAAa,WAAW;CACxC,MAAM,EAAE,YAAY,UAAU,iBAAiB,iBAAiB;CAEhE,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,mBAAD;EACE,cAAc;EACd,cAAc;EACH;YAEV,OAAO,KAAK,UAAU;GACrB,MAAM,EAAE,SAAS,aAAa;GAE9B,MAAM,SAAS,gBAAgB,OAAO;IACpC,cAAc;IACd,QAAQ;GACV,CAAC;GAED,MAAM,OAAO,OAA8B;IACzC,IAAI,MAAM,MAAM,WAAW,KAAA,GACzB,aAAa,MAAM,IAAI,GAAG,sBAAsB,CAAC,CAAC,MAAM;GAE5D;GAEA,OACE,oBAAC,cAAD;IAEO;IACL,SAAS,MAAM;IACf,MAAM,MAAM,UAAU;IACtB,aAAW,MAAM,UAAU;IAC3B,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI;IACnC,WAAU;cAEV,oBAAC,aAAa,UAAd;KAAuB,OAAO;eAC3B,OAAO,aAAa,aACnB,SAAS,KAAK,IACZ,QAAM,eAAe,QAAQ,IAC/B,WAEA,qBAAC,OAAD;MAAO,WAAU;gBAAjB;OACG,MAAM,SAAS,WAAW,oBAAC,MAAM,MAAP,EAAY,IAAI,MAAQ,CAAA;OACnD,oBAAC,MAAD,EAAO,SAAe,CAAA;OACtB,oBAAC,QAAD,CAAS,CAAA;OACT,oBAAC,MAAM,OAAP,CAAc,CAAA;MACT;;IAEY,CAAA;GACX,GAtBP,MAAM,EAsBC;EAElB,CAAC;CACgB,CAAA,GAClB,QACD,EAAA,CAAA;AAEN;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"ToastProvider.js","names":[],"sources":["../../../src/components/toast/ToastProvider.tsx"],"sourcesContent":["import { Error } from '@atom-learning/icons'\nimport * as React from 'react'\nimport { useToaster } from 'react-hot-toast'\n\nimport { styled } from '../../styled'\nimport { Spacer } from '../spacer/Spacer'\nimport { Text } from '../text/Text'\nimport { Toast } from './Toast'\nimport { ToastContext } from './Toast.context'\n\nexport { toast } from 'react-hot-toast'\nexport { useToastContext } from './Toast.context'\n\nconst ToastProviderBase = /* @__PURE__ */ styled('div', {\n base: [\n 'fixed',\n 'z-2147483647',\n 'inset-safe-offset-2',\n 'pointer-events-none',\n 'sm:top-safe-offset-3'\n ]\n})\n\nconst ToastWrapper = /* @__PURE__ */ styled('div', {\n base: [\n 'absolute',\n 'w-full',\n 'flex',\n 'justify-center',\n 'items-center',\n 'rounded-sm',\n 'box-border',\n 'min-h-12',\n '[--slide-opacity-out:0]',\n '[--slide-direction-out-y:-100%]'\n ],\n variants: {\n visible: {\n true: ['motion-safe:animate-slide-direction-in'],\n false: ['opacity-0', 'motion-safe:animate-slide-direction-out']\n }\n }\n})\n\nexport const ToastProvider = ({\n children,\n className\n}: React.PropsWithChildren<{ className?: string }>) => {\n const { toasts, handlers } = useToaster()\n const { startPause, endPause, calculateOffset, updateHeight } = handlers\n\n return (\n <>\n <ToastProviderBase\n onMouseEnter={startPause}\n onMouseLeave={endPause}\n className={className}\n >\n {toasts.map((toast) => {\n const { message: children } = toast\n\n const offset = calculateOffset(toast, {\n reverseOrder: true,\n gutter: 8\n })\n\n const ref = (el: HTMLDivElement | null) => {\n if (el && toast.height === undefined) {\n updateHeight(toast.id, el.getBoundingClientRect().height)\n }\n }\n\n return (\n <ToastWrapper\n key={toast.id}\n ref={ref}\n visible={toast.visible}\n role={toast.ariaProps.role}\n aria-live={toast.ariaProps['aria-live']}\n style={{ '--offset': `${offset}px` }}\n className=\"top-(--offset)\"\n >\n <ToastContext value={toast}>\n {typeof children === 'function' ? (\n children(toast)\n ) : React.isValidElement(children) ? (\n children\n ) : (\n <Toast className=\"w-100\">\n {toast.type === 'error' && <Toast.Icon is={Error} />}\n <Text>{children}</Text>\n <Spacer />\n <Toast.Close />\n </Toast>\n )}\n </ToastContext>\n </ToastWrapper>\n )\n })}\n </ToastProviderBase>\n {children}\n </>\n )\n}\n\nToastProvider.displayName = 'ToastProvider'\n"],"mappings":";;;;;;;;;;AAaA,IAAM,oBAAoC,uBAAO,OAAO,EACtD,MAAM;CACJ;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,eAA+B,uBAAO,OAAO;CACjD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,SAAS;EACP,MAAM,CAAC,wCAAwC;EAC/C,OAAO,CAAC,aAAa,yCAAyC;CAChE,EACF;AACF,CAAC;AAED,IAAa,iBAAiB,EAC5B,UACA,gBACqD;CACrD,MAAM,EAAE,QAAQ,aAAa,WAAW;CACxC,MAAM,EAAE,YAAY,UAAU,iBAAiB,iBAAiB;CAEhE,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,mBAAD;EACE,cAAc;EACd,cAAc;EACH;YAEV,OAAO,KAAK,UAAU;GACrB,MAAM,EAAE,SAAS,aAAa;GAE9B,MAAM,SAAS,gBAAgB,OAAO;IACpC,cAAc;IACd,QAAQ;GACV,CAAC;GAED,MAAM,OAAO,OAA8B;IACzC,IAAI,MAAM,MAAM,WAAW,KAAA,GACzB,aAAa,MAAM,IAAI,GAAG,sBAAsB,CAAC,CAAC,MAAM;GAE5D;GAEA,OACE,oBAAC,cAAD;IAEO;IACL,SAAS,MAAM;IACf,MAAM,MAAM,UAAU;IACtB,aAAW,MAAM,UAAU;IAC3B,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI;IACnC,WAAU;cAEV,oBAAC,cAAD;KAAc,OAAO;eAClB,OAAO,aAAa,aACnB,SAAS,KAAK,IACZ,QAAM,eAAe,QAAQ,IAC/B,WAEA,qBAAC,OAAD;MAAO,WAAU;gBAAjB;OACG,MAAM,SAAS,WAAW,oBAAC,MAAM,MAAP,EAAY,IAAI,MAAQ,CAAA;OACnD,oBAAC,MAAD,EAAO,SAAe,CAAA;OACtB,oBAAC,QAAD,CAAS,CAAA;OACT,oBAAC,MAAM,OAAP,CAAc,CAAA;MACT;;IAEG,CAAA;GACF,GAtBP,MAAM,EAsBC;EAElB,CAAC;CACgB,CAAA,GAClB,QACD,EAAA,CAAA;AAEN;AAEA,cAAc,cAAc"}
@@ -25,21 +25,21 @@ var StyledRoot = styled("header", {
25
25
  variants: {
26
26
  hasScrolled: { true: ["shadow-[0px_4px_4px_-2px_rgba(31,31,31,0.1)]"] },
27
27
  size: {
28
- md: ["h-16"],
29
- lg: ["h-24"]
28
+ md: ["h-safe-offset-top-16", "pt-safe"],
29
+ lg: ["h-safe-offset-top-24", "pt-safe"]
30
30
  },
31
31
  diffused: { true: ["supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]", "supports-color-mix:backdrop-blur-sm"] },
32
32
  appearance: {
33
33
  standard: [
34
34
  "w-screen",
35
35
  "max-w-full",
36
- "top-0",
36
+ "top-safe",
37
37
  "border-b",
38
38
  "border-b-(--border-bottom)"
39
39
  ],
40
40
  rounded: [
41
41
  "w-full",
42
- "top-2",
42
+ "top-safe-offset-2",
43
43
  "p-2",
44
44
  "border",
45
45
  "border-white",