@strapi/design-system 1.6.2 → 1.6.4

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 (287) hide show
  1. package/dist/Accordion/Accordion.cjs +5 -5
  2. package/dist/Accordion/Accordion.js +45 -44
  3. package/dist/Accordion/AccordionContent.cjs +1 -1
  4. package/dist/Accordion/AccordionContent.js +4 -4
  5. package/dist/Accordion/AccordionGroup.cjs +4 -4
  6. package/dist/Accordion/AccordionGroup.js +18 -18
  7. package/dist/Accordion/AccordionToggle.cjs +2 -2
  8. package/dist/Accordion/AccordionToggle.js +11 -11
  9. package/dist/Alert/Alert.cjs +1 -1
  10. package/dist/Alert/Alert.js +8 -8
  11. package/dist/Avatar/Avatar.cjs +5 -5
  12. package/dist/Avatar/Avatar.js +11 -11
  13. package/dist/Avatar/AvatarGroup.cjs +2 -2
  14. package/dist/Avatar/AvatarGroup.js +4 -4
  15. package/dist/BaseButton/BaseButton.cjs +5 -11
  16. package/dist/BaseButton/BaseButton.js +31 -38
  17. package/dist/BaseCheckbox/BaseCheckbox.cjs +3 -3
  18. package/dist/BaseCheckbox/BaseCheckbox.js +22 -22
  19. package/dist/BaseRadio/BaseRadio.cjs +2 -2
  20. package/dist/BaseRadio/BaseRadio.js +4 -4
  21. package/dist/BaseRadio/RadioGroup.cjs +1 -1
  22. package/dist/BaseRadio/RadioGroup.js +28 -26
  23. package/dist/Box/Box.cjs +2 -2
  24. package/dist/Box/Box.js +36 -33
  25. package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
  26. package/dist/Breadcrumbs/Breadcrumbs.js +12 -12
  27. package/dist/Button/Button.cjs +10 -27
  28. package/dist/Button/Button.js +65 -85
  29. package/dist/Button/utils.cjs +22 -22
  30. package/dist/Button/utils.js +2 -2
  31. package/dist/Card/Card.cjs +1 -1
  32. package/dist/Card/Card.js +15 -14
  33. package/dist/Card/CardAsset.js +4 -4
  34. package/dist/Card/CardBody.cjs +1 -1
  35. package/dist/Card/CardBody.js +4 -4
  36. package/dist/Card/CardCheckbox.cjs +1 -1
  37. package/dist/Card/CardCheckbox.js +6 -6
  38. package/dist/Card/CardTitle.cjs +1 -1
  39. package/dist/Card/CardTitle.js +1 -1
  40. package/dist/CarouselInput/Carousel.cjs +2 -2
  41. package/dist/CarouselInput/Carousel.js +19 -64
  42. package/dist/CarouselInput/CarouselActions.js +1 -9
  43. package/dist/CarouselInput/CarouselImage.js +1 -10
  44. package/dist/CarouselInput/CarouselInput.cjs +1 -1
  45. package/dist/CarouselInput/CarouselInput.js +19 -24
  46. package/dist/CarouselInput/CarouselSlide.js +13 -9
  47. package/dist/Checkbox/Checkbox.cjs +2 -2
  48. package/dist/Checkbox/Checkbox.js +7 -26
  49. package/dist/Combobox/Combobox.cjs +1 -1
  50. package/dist/Combobox/Combobox.js +106 -120
  51. package/dist/Combobox/ComboboxOption.cjs +1 -1
  52. package/dist/Combobox/ComboboxOption.js +18 -17
  53. package/dist/DatePicker/DatePicker.cjs +1 -1
  54. package/dist/DatePicker/DatePicker.js +47 -46
  55. package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
  56. package/dist/DatePicker/DatePickerCalendar.js +28 -61
  57. package/dist/DatePicker/DatePickerTd.js +1 -12
  58. package/dist/DatePicker/DatePickerTh.cjs +3 -3
  59. package/dist/DatePicker/DatePickerTh.js +7 -16
  60. package/dist/DatePicker/components.cjs +3 -3
  61. package/dist/DatePicker/components.js +6 -6
  62. package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
  63. package/dist/DateTimePicker/DateTimePicker.js +64 -61
  64. package/dist/DateTimePicker/DateTimePickerProps.js +1 -3
  65. package/dist/Dialog/Dialog.cjs +4 -4
  66. package/dist/Dialog/Dialog.js +26 -37
  67. package/dist/Dialog/DialogBody.cjs +1 -1
  68. package/dist/Dialog/DialogBody.js +2 -11
  69. package/dist/Dialog/DialogFooter.cjs +1 -1
  70. package/dist/Dialog/DialogFooter.js +2 -7
  71. package/dist/DismissibleLayer/DismissibleLayer.js +1 -4
  72. package/dist/Divider/Divider.js +1 -5
  73. package/dist/EmptyStateLayout/EmptyStateLayout.cjs +1 -1
  74. package/dist/EmptyStateLayout/EmptyStateLayout.js +2 -16
  75. package/dist/EmptyStateLayout/story-assets/Illo.js +60 -45
  76. package/dist/Field/Field.cjs +1 -1
  77. package/dist/Field/Field.js +12 -13
  78. package/dist/Field/FieldAction.cjs +1 -1
  79. package/dist/Field/FieldAction.js +2 -6
  80. package/dist/Field/FieldError.js +1 -7
  81. package/dist/Field/FieldHint.js +1 -6
  82. package/dist/Field/FieldInput.cjs +4 -4
  83. package/dist/Field/FieldInput.js +26 -34
  84. package/dist/Field/FieldLabel.cjs +1 -1
  85. package/dist/Field/FieldLabel.js +3 -16
  86. package/dist/FocusTrap/FocusTrap.js +1 -5
  87. package/dist/Grid/Grid.cjs +3 -3
  88. package/dist/Grid/Grid.js +12 -15
  89. package/dist/Grid/GridItem.cjs +2 -2
  90. package/dist/Grid/GridItem.js +5 -13
  91. package/dist/IconButton/IconButton.cjs +7 -12
  92. package/dist/IconButton/IconButton.js +88 -84
  93. package/dist/JSONInput/JSONInput.cjs +1 -1
  94. package/dist/JSONInput/JSONInput.js +85 -78
  95. package/dist/JSONInput/JSONInputContainer.cjs +10 -10
  96. package/dist/JSONInput/JSONInputContainer.js +22 -15
  97. package/dist/Layout/ActionLayout.js +1 -13
  98. package/dist/Layout/ContentLayout.js +1 -4
  99. package/dist/Layout/HeaderLayout.cjs +1 -1
  100. package/dist/Layout/HeaderLayout.js +35 -64
  101. package/dist/Layout/Layout.js +1 -5
  102. package/dist/Layout/TwoColsLayout.js +1 -17
  103. package/dist/Link/Link.cjs +5 -5
  104. package/dist/Link/Link.js +55 -57
  105. package/dist/LinkButton/LinkButton.cjs +7 -24
  106. package/dist/LinkButton/LinkButton.js +60 -87
  107. package/dist/LiveRegions/LiveRegions.cjs +1 -1
  108. package/dist/LiveRegions/LiveRegions.js +1 -1
  109. package/dist/Loader/Loader.cjs +4 -4
  110. package/dist/Loader/Loader.js +26 -24
  111. package/dist/Main/Main.js +1 -6
  112. package/dist/Main/SkipToContent.cjs +2 -2
  113. package/dist/Main/SkipToContent.js +17 -13
  114. package/dist/MainNav/MainNav.cjs +2 -2
  115. package/dist/MainNav/MainNav.js +21 -20
  116. package/dist/MainNav/NavBrand.cjs +2 -2
  117. package/dist/MainNav/NavBrand.js +4 -38
  118. package/dist/MainNav/NavCondense.cjs +2 -2
  119. package/dist/MainNav/NavCondense.js +10 -18
  120. package/dist/MainNav/NavFooter.js +1 -3
  121. package/dist/MainNav/NavLink.cjs +4 -4
  122. package/dist/MainNav/NavLink.js +8 -34
  123. package/dist/MainNav/NavSection.cjs +1 -1
  124. package/dist/MainNav/NavSection.js +5 -38
  125. package/dist/MainNav/NavSections.cjs +2 -2
  126. package/dist/MainNav/NavSections.js +4 -15
  127. package/dist/MainNav/NavUser.cjs +2 -2
  128. package/dist/MainNav/NavUser.js +6 -27
  129. package/dist/ModalLayout/ModalBody.js +1 -4
  130. package/dist/ModalLayout/ModalFooter.cjs +1 -1
  131. package/dist/ModalLayout/ModalFooter.js +2 -10
  132. package/dist/ModalLayout/ModalHeader.cjs +2 -2
  133. package/dist/ModalLayout/ModalHeader.js +8 -20
  134. package/dist/ModalLayout/ModalLayout.cjs +3 -3
  135. package/dist/ModalLayout/ModalLayout.js +23 -31
  136. package/dist/NumberInput/NumberInput.cjs +2 -2
  137. package/dist/NumberInput/NumberInput.js +54 -59
  138. package/dist/Pagination/Pagination.cjs +2 -2
  139. package/dist/Pagination/Pagination.js +11 -16
  140. package/dist/Pagination/components.cjs +3 -3
  141. package/dist/Pagination/components.js +31 -38
  142. package/dist/Popover/Popover.cjs +3 -3
  143. package/dist/Popover/Popover.js +111 -102
  144. package/dist/Popover/index.cjs +1 -1
  145. package/dist/Popover/index.js +9 -3
  146. package/dist/Portal/Portal.cjs +1 -1
  147. package/dist/Portal/Portal.js +10 -12
  148. package/dist/ProgressBar/ProgressBar.js +17 -14
  149. package/dist/Radio/Radio.cjs +2 -2
  150. package/dist/Radio/Radio.js +4 -11
  151. package/dist/RawTable/RawCell.cjs +1 -1
  152. package/dist/RawTable/RawCell.js +5 -14
  153. package/dist/RawTable/RawTable.cjs +1 -1
  154. package/dist/RawTable/RawTable.js +36 -35
  155. package/dist/RawTable/RawTbody.js +1 -3
  156. package/dist/RawTable/RawThead.js +1 -3
  157. package/dist/RawTable/RawTr.js +1 -4
  158. package/dist/Searchbar/SearchForm.js +1 -4
  159. package/dist/Searchbar/Searchbar.cjs +3 -3
  160. package/dist/Searchbar/Searchbar.js +21 -25
  161. package/dist/Select/MultiSelectNested.js +2 -14
  162. package/dist/Select/OptGroup.cjs +1 -1
  163. package/dist/Select/OptGroup.js +14 -10
  164. package/dist/Select/Option.cjs +3 -3
  165. package/dist/Select/Option.js +31 -33
  166. package/dist/Select/Select.cjs +2 -2
  167. package/dist/Select/Select.js +87 -107
  168. package/dist/Select/SelectButton.cjs +1 -1
  169. package/dist/Select/SelectButton.js +14 -11
  170. package/dist/Select/SelectList.cjs +1 -1
  171. package/dist/Select/SelectList.js +20 -16
  172. package/dist/Select/SelectTags.cjs +3 -3
  173. package/dist/Select/SelectTags.js +17 -15
  174. package/dist/Select/SingleSelect.cjs +1 -1
  175. package/dist/Select/SingleSelect.js +1 -1
  176. package/dist/SimpleMenu/SimpleMenu.cjs +3 -3
  177. package/dist/SimpleMenu/SimpleMenu.js +43 -67
  178. package/dist/Status/Status.js +15 -13
  179. package/dist/SubNav/SubNav.cjs +2 -2
  180. package/dist/SubNav/SubNav.js +5 -9
  181. package/dist/SubNav/SubNavHeader.cjs +2 -2
  182. package/dist/SubNav/SubNavHeader.js +31 -53
  183. package/dist/SubNav/SubNavLink.cjs +3 -3
  184. package/dist/SubNav/SubNavLink.js +18 -22
  185. package/dist/SubNav/SubNavLinkSection.cjs +2 -2
  186. package/dist/SubNav/SubNavLinkSection.js +5 -30
  187. package/dist/SubNav/SubNavSection.cjs +2 -2
  188. package/dist/SubNav/SubNavSection.js +23 -30
  189. package/dist/SubNav/SubNavSectionLabel.cjs +2 -2
  190. package/dist/SubNav/SubNavSectionLabel.js +15 -24
  191. package/dist/SubNav/SubNavSections.cjs +1 -1
  192. package/dist/SubNav/SubNavSections.js +3 -12
  193. package/dist/Switch/Switch.cjs +2 -2
  194. package/dist/Switch/Switch.js +16 -17
  195. package/dist/Table/Cell.cjs +1 -1
  196. package/dist/Table/Cell.js +3 -8
  197. package/dist/Table/TFooter.cjs +2 -2
  198. package/dist/Table/TFooter.js +3 -17
  199. package/dist/Table/Table.cjs +1 -1
  200. package/dist/Table/Table.js +2 -18
  201. package/dist/Table/Tbody.js +1 -3
  202. package/dist/Table/Thead.js +1 -3
  203. package/dist/Table/Tr.js +1 -3
  204. package/dist/Tabs/TabGroup.cjs +1 -1
  205. package/dist/Tabs/TabGroup.js +30 -27
  206. package/dist/Tabs/TabPanels.js +2 -10
  207. package/dist/Tabs/Tabs.cjs +1 -1
  208. package/dist/Tabs/Tabs.js +43 -51
  209. package/dist/Tag/Tag.cjs +1 -1
  210. package/dist/Tag/Tag.js +20 -23
  211. package/dist/TextButton/TextButton.cjs +6 -6
  212. package/dist/TextButton/TextButton.js +15 -15
  213. package/dist/TextInput/TextInput.cjs +1 -1
  214. package/dist/TextInput/TextInput.js +14 -32
  215. package/dist/Textarea/Textarea.cjs +2 -2
  216. package/dist/Textarea/Textarea.js +10 -25
  217. package/dist/Textarea/TextareaInput.cjs +1 -1
  218. package/dist/Textarea/TextareaInput.js +15 -15
  219. package/dist/TimePicker/TimePicker.cjs +2 -2
  220. package/dist/TimePicker/TimePicker.js +27 -26
  221. package/dist/ToggleCheckbox/ToggleCheckbox.cjs +5 -5
  222. package/dist/ToggleCheckbox/ToggleCheckbox.js +85 -60
  223. package/dist/ToggleInput/ToggleInput.cjs +3 -3
  224. package/dist/ToggleInput/ToggleInput.js +14 -32
  225. package/dist/Tooltip/Tooltip.cjs +2 -2
  226. package/dist/Tooltip/Tooltip.js +62 -53
  227. package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -1
  228. package/dist/Tooltip/hooks/useTooltipHandlers.js +7 -7
  229. package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -1
  230. package/dist/Tooltip/hooks/useTooltipLayout.js +8 -5
  231. package/dist/Typography/Typography.cjs +3 -2
  232. package/dist/Typography/Typography.js +17 -14
  233. package/dist/helpers/objects.cjs +1 -1
  234. package/dist/helpers/objects.js +1 -1
  235. package/dist/hooks/useId.cjs +1 -0
  236. package/dist/hooks/useId.js +13 -0
  237. package/dist/index.cjs +1 -1
  238. package/dist/index.js +136 -134
  239. package/dist/themes/extendTheme.cjs +1 -1
  240. package/dist/themes/extendTheme.js +4 -4
  241. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  242. package/dist/v2/Breadcrumbs/Breadcrumbs.js +4 -13
  243. package/dist/v2/Breadcrumbs/Crumb.js +11 -12
  244. package/dist/v2/Breadcrumbs/CrumbLink.js +1 -3
  245. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
  246. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +5 -11
  247. package/dist/v2/Breadcrumbs/Divider.js +1 -8
  248. package/dist/v2/Link/Link.cjs +2 -2
  249. package/dist/v2/Link/Link.js +5 -24
  250. package/dist/v2/LinkButton/LinkButton.cjs +11 -24
  251. package/dist/v2/LinkButton/LinkButton.js +62 -84
  252. package/dist/v2/MainNav/MainNav.cjs +2 -2
  253. package/dist/v2/MainNav/MainNav.js +21 -20
  254. package/dist/v2/MainNav/NavBrand.cjs +2 -2
  255. package/dist/v2/MainNav/NavBrand.js +4 -38
  256. package/dist/v2/MainNav/NavCondense.cjs +2 -2
  257. package/dist/v2/MainNav/NavCondense.js +10 -18
  258. package/dist/v2/MainNav/NavFooter.js +1 -3
  259. package/dist/v2/MainNav/NavLink.cjs +4 -4
  260. package/dist/v2/MainNav/NavLink.js +10 -39
  261. package/dist/v2/MainNav/NavSection.cjs +1 -1
  262. package/dist/v2/MainNav/NavSection.js +5 -38
  263. package/dist/v2/MainNav/NavSections.cjs +2 -2
  264. package/dist/v2/MainNav/NavSections.js +4 -15
  265. package/dist/v2/MainNav/NavUser.cjs +2 -2
  266. package/dist/v2/MainNav/NavUser.js +6 -27
  267. package/dist/v2/Pagination/Pagination.cjs +2 -2
  268. package/dist/v2/Pagination/Pagination.js +11 -16
  269. package/dist/v2/Pagination/components.cjs +2 -2
  270. package/dist/v2/Pagination/components.js +11 -39
  271. package/dist/v2/SimpleMenu/SimpleMenu.cjs +4 -4
  272. package/dist/v2/SimpleMenu/SimpleMenu.js +42 -65
  273. package/dist/v2/SubNav/SubNav.cjs +2 -2
  274. package/dist/v2/SubNav/SubNav.js +5 -9
  275. package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
  276. package/dist/v2/SubNav/SubNavHeader.js +31 -53
  277. package/dist/v2/SubNav/SubNavLink.cjs +2 -2
  278. package/dist/v2/SubNav/SubNavLink.js +18 -22
  279. package/dist/v2/SubNav/SubNavLinkSection.cjs +2 -2
  280. package/dist/v2/SubNav/SubNavLinkSection.js +5 -30
  281. package/dist/v2/SubNav/SubNavSection.cjs +2 -2
  282. package/dist/v2/SubNav/SubNavSection.js +26 -33
  283. package/dist/v2/SubNav/SubNavSectionLabel.cjs +2 -2
  284. package/dist/v2/SubNav/SubNavSectionLabel.js +15 -24
  285. package/dist/v2/SubNav/SubNavSections.cjs +1 -1
  286. package/dist/v2/SubNav/SubNavSections.js +3 -12
  287. package/package.json +7 -4
@@ -1,30 +1,25 @@
1
- import e, { Children as s } from "react";
2
- import a from "styled-components";
1
+ import * as e from "react";
3
2
  import r from "prop-types";
4
- import { Flex as u } from "../Flex/Flex.js";
3
+ import i from "styled-components";
5
4
  import { PaginationContext as c } from "./PaginationContext.js";
6
- const d = a.nav``, g = a(u)`
5
+ import { Flex as u } from "../Flex/Flex.js";
6
+ const d = i.nav``, f = i(u)`
7
7
  & > * + * {
8
8
  margin-left: ${({ theme: t }) => t.spaces[1]};
9
9
  }
10
- `, i = ({ children: t, label: n, activePage: o, pageCount: l }) => /* @__PURE__ */ e.createElement(c.Provider, {
11
- value: { activePage: o, pageCount: l }
12
- }, /* @__PURE__ */ e.createElement(d, {
13
- "aria-label": n
14
- }, /* @__PURE__ */ e.createElement(g, {
15
- as: "ul"
16
- }, s.map(t, (m, p) => /* @__PURE__ */ e.createElement("li", {
17
- key: p
18
- }, m)))));
19
- i.defaultProps = {
10
+ `, o = ({ children: t, label: l, activePage: n, pageCount: a }) => {
11
+ const m = e.useMemo(() => ({ activePage: n, pageCount: a }), [n, a]);
12
+ return /* @__PURE__ */ e.createElement(c.Provider, { value: m }, /* @__PURE__ */ e.createElement(d, { "aria-label": l }, /* @__PURE__ */ e.createElement(f, { as: "ul" }, e.Children.map(t, (s, p) => /* @__PURE__ */ e.createElement("li", { key: p }, s)))));
13
+ };
14
+ o.defaultProps = {
20
15
  label: "pagination"
21
16
  };
22
- i.propTypes = {
17
+ o.propTypes = {
23
18
  activePage: r.number.isRequired,
24
19
  children: r.node.isRequired,
25
20
  label: r.string,
26
21
  pageCount: r.number.isRequired
27
22
  };
28
23
  export {
29
- i as Pagination
24
+ o as Pagination
30
25
  };
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("react"),k=require("styled-components"),q=require("prop-types"),g=require("@strapi/icons"),T=require("react-router-dom"),l=require("../VisuallyHidden/VisuallyHidden.cjs"),u=require("./PaginationContext.cjs"),x=require("../Typography/Typography.cjs"),E=require("../themes/utils.cjs"),c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=c(L),s=c(k),o=c(q),v=s.default(x.Typography)`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("react"),g=require("@strapi/icons"),k=require("prop-types"),q=require("react-router-dom"),T=require("styled-components"),u=require("./PaginationContext.cjs"),x=require("../themes/utils.cjs"),E=require("../Typography/Typography.cjs"),l=require("../VisuallyHidden/VisuallyHidden.cjs"),c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=c(L),o=c(k),s=c(T),v=s.default(E.Typography)`
2
2
  line-height: revert;
3
- `,$={active:!0},p=s.default(T.NavLink).withConfig({shouldForwardProp:(e,t)=>!$[e]&&t(e)})`
3
+ `,$={active:!0},p=s.default(q.NavLink).withConfig({shouldForwardProp:(e,t)=>!$[e]&&t(e)})`
4
4
  padding: ${({theme:e})=>e.spaces[3]};
5
5
  border-radius: ${({theme:e})=>e.borderRadius};
6
6
  box-shadow: ${({active:e,theme:t})=>e?t.shadows.filterShadow:void 0};
7
7
  text-decoration: none;
8
8
  display: flex;
9
9
 
10
- ${E.buttonFocusStyle}
10
+ ${x.buttonFocusStyle}
11
11
  `,R=s.default(p)`
12
12
  color: ${({theme:e,active:t})=>t?e.colors.primary700:e.colors.neutral800};
13
13
  background: ${({theme:e,active:t})=>t?e.colors.neutral0:void 0};
@@ -1,13 +1,13 @@
1
1
  import t from "react";
2
- import s from "styled-components";
3
- import n from "prop-types";
4
2
  import { ChevronLeft as b, ChevronRight as y } from "@strapi/icons";
3
+ import n from "prop-types";
5
4
  import { NavLink as P } from "react-router-dom";
6
- import { VisuallyHidden as l } from "../VisuallyHidden/VisuallyHidden.js";
5
+ import s from "styled-components";
7
6
  import { usePagination as c } from "./PaginationContext.js";
8
- import { Typography as E } from "../Typography/Typography.js";
9
- import { buttonFocusStyle as k } from "../themes/utils.js";
10
- const u = s(E)`
7
+ import { buttonFocusStyle as E } from "../themes/utils.js";
8
+ import { Typography as k } from "../Typography/Typography.js";
9
+ import { VisuallyHidden as l } from "../VisuallyHidden/VisuallyHidden.js";
10
+ const u = s(k)`
11
11
  line-height: revert;
12
12
  `, L = {
13
13
  active: !0
@@ -20,7 +20,7 @@ const u = s(E)`
20
20
  text-decoration: none;
21
21
  display: flex;
22
22
 
23
- ${k}
23
+ ${E}
24
24
  `, $ = s(p)`
25
25
  color: ${({ theme: e, active: r }) => r ? e.colors.primary700 : e.colors.neutral800};
26
26
  background: ${({ theme: e, active: r }) => r ? e.colors.neutral0 : void 0};
@@ -48,47 +48,40 @@ const u = s(E)`
48
48
  color: ${({ theme: e }) => e.colors.neutral800};
49
49
  `, h = ({ children: e, to: r, ...a }) => {
50
50
  const { activePage: i } = c(), o = i === 1;
51
- return /* @__PURE__ */ t.createElement(m, {
52
- to: o ? "#" : r,
53
- "aria-disabled": o,
54
- tabIndex: o ? -1 : void 0,
55
- ...a
56
- }, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(b, {
57
- "aria-hidden": !0
58
- }));
51
+ return /* @__PURE__ */ t.createElement(
52
+ m,
53
+ {
54
+ to: o ? "#" : r,
55
+ "aria-disabled": o,
56
+ tabIndex: o ? -1 : void 0,
57
+ ...a
58
+ },
59
+ /* @__PURE__ */ t.createElement(l, null, e),
60
+ /* @__PURE__ */ t.createElement(b, { "aria-hidden": !0 })
61
+ );
59
62
  };
60
63
  h.displayName = "PreviousLink";
61
64
  const v = ({ children: e, to: r, ...a }) => {
62
65
  const { activePage: i, pageCount: o } = c(), d = i === o;
63
- return /* @__PURE__ */ t.createElement(m, {
64
- to: d ? "#" : r,
65
- "aria-disabled": d,
66
- tabIndex: d ? -1 : void 0,
67
- ...a
68
- }, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(y, {
69
- "aria-hidden": !0
70
- }));
66
+ return /* @__PURE__ */ t.createElement(
67
+ m,
68
+ {
69
+ to: d ? "#" : r,
70
+ "aria-disabled": d,
71
+ tabIndex: d ? -1 : void 0,
72
+ ...a
73
+ },
74
+ /* @__PURE__ */ t.createElement(l, null, e),
75
+ /* @__PURE__ */ t.createElement(y, { "aria-hidden": !0 })
76
+ );
71
77
  };
72
78
  v.displayName = "NextLink";
73
79
  const f = ({ number: e, children: r, ...a }) => {
74
80
  const { activePage: i } = c(), o = i === e;
75
- return /* @__PURE__ */ t.createElement($, {
76
- ...a,
77
- active: o
78
- }, /* @__PURE__ */ t.createElement(l, null, r), /* @__PURE__ */ t.createElement(u, {
79
- "aria-hidden": !0,
80
- variant: "pi",
81
- fontWeight: o ? "bold" : null
82
- }, e));
81
+ return /* @__PURE__ */ t.createElement($, { ...a, active: o }, /* @__PURE__ */ t.createElement(l, null, r), /* @__PURE__ */ t.createElement(u, { "aria-hidden": !0, variant: "pi", fontWeight: o ? "bold" : null }, e));
83
82
  };
84
83
  f.displayName = "PageLink";
85
- const w = ({ children: e, ...r }) => /* @__PURE__ */ t.createElement(x, {
86
- ...r,
87
- as: "div"
88
- }, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(u, {
89
- "aria-hidden": !0,
90
- variant: "pi"
91
- }, "\u2026"));
84
+ const w = ({ children: e, ...r }) => /* @__PURE__ */ t.createElement(x, { ...r, as: "div" }, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(u, { "aria-hidden": !0, variant: "pi" }, "\u2026"));
92
85
  f.propTypes = {
93
86
  children: n.node.isRequired,
94
87
  number: n.number.isRequired
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("react"),j=require("prop-types"),S=require("styled-components"),s=require("@floating-ui/react-dom"),c=require("../Box/Box.cjs"),T=require("../Portal/Portal.cjs"),$=require("../helpers/useIntersection.cjs"),b=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function M(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const o=M(q),t=b(j),m=b(S),h=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],B=m.default(c.Box)`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),w=require("react"),a=require("@floating-ui/react-dom"),y=require("styled-components"),u=require("../Box/Box.cjs"),_=require("../helpers/useIntersection.cjs"),k=require("../Portal/Portal.cjs"),v=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function S(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const l=S(w),f=v(y),O=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],$=f.default(u.Box)`
2
2
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
3
3
  z-index: 4;
4
4
  border: 1px solid ${({theme:e})=>e.colors.neutral150};
5
5
  background: ${({theme:e})=>e.colors.neutral0};
6
- `,W=m.default(c.Box)`
6
+ `,p=({source:e,children:t,spacing:o=0,fullWidth:r=!1,placement:s="bottom-start",centered:i=!1,...c})=>{const[h,g]=l.useState(void 0),{x:m,y:x,reference:d,floating:j,strategy:P}=a.useFloating({strategy:"fixed",placement:i?"bottom":s,middleware:[a.offset({mainAxis:o}),a.shift(),a.flip()],whileElementsMounted:a.autoUpdate});return l.useLayoutEffect(()=>{d(e.current)},[e,d]),l.useLayoutEffect(()=>{r&&g(e.current.offsetWidth)},[r,e]),n.jsx($,{ref:j,style:{left:m,top:x,position:P,width:h||void 0},hasRadius:!0,background:"neutral0",padding:1,...c,children:t})},b=({children:e,intersectionId:t,onReachEnd:o,...r})=>{const s=l.useRef(null);return _.useIntersection(s,o??(()=>{}),{selectorToWatch:`#${t}`,skipWhen:!t||!o}),n.jsxs(q,{ref:s,...r,children:[e,t&&o&&n.jsx(u.Box,{id:t,width:"100%",height:"1px"})]})},q=f.default(u.Box)`
7
7
  // 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
8
8
  max-height: ${3*5}rem;
9
9
  overflow-y: auto;
@@ -23,4 +23,4 @@
23
23
  border-radius: ${({theme:e})=>e.borderRadius};
24
24
  margin-right: 10px;
25
25
  }
26
- `,u=({source:e,children:n,spacing:r,fullWidth:a,placement:y,onReachEnd:i,intersectionId:l,centered:v,...x})=>{const f=o.useRef(null),[w,E]=o.useState(void 0),{x:_,y:O,reference:p,floating:k,strategy:R}=s.useFloating({strategy:"fixed",placement:v?"bottom":y,middleware:[s.offset({mainAxis:r}),s.shift(),s.flip()],whileElementsMounted:s.autoUpdate});return o.useLayoutEffect(()=>{p(e.current)},[e,p]),o.useLayoutEffect(()=>{a&&E(e.current.offsetWidth)},[a,e]),$.useIntersection(f,i,{selectorToWatch:`#${l}`,skipWhen:!l||!i}),o.createElement(B,{ref:k,style:{left:_,top:O,position:R,width:w||void 0},hasRadius:!0,background:"neutral0",padding:1},o.createElement(W,{ref:f,...x},n,l&&i&&o.createElement(c.Box,{id:l,width:"100%",height:"1px"})))},d=e=>o.createElement(T.Portal,null,o.createElement(u,{...e})),g={fullWidth:!1,intersectionId:void 0,onReachEnd:void 0,centered:!1,placement:"bottom-start",spacing:0},P={centered:t.default.bool,children:t.default.node.isRequired,fullWidth:t.default.bool,intersectionId:t.default.string,onReachEnd:t.default.func,placement:t.default.oneOf(h),source:t.default.shape({current:(typeof Element>"u"?t.default.any:t.default.instanceOf(Element)).isRequired}).isRequired,spacing:t.default.number};u.propTypes=P;u.defaultProps=g;d.propTypes=P;d.defaultProps=g;exports.POPOVER_PLACEMENTS=h;exports.Popover=d;
26
+ `,E=({children:e,source:t,spacing:o,fullWidth:r,placement:s,centered:i,...c})=>n.jsx(k.Portal,{children:n.jsx(p,{source:t,spacing:o,fullWidth:r,placement:s,centered:i,children:n.jsx(b,{...c,children:e})})});exports.Content=p;exports.POPOVER_PLACEMENTS=O;exports.Popover=E;exports.Scrolling=b;
@@ -1,29 +1,83 @@
1
- import * as o from "react";
2
- import t from "prop-types";
3
- import d from "styled-components";
4
- import { useFloating as R, offset as $, shift as W, flip as T, autoUpdate as O } from "@floating-ui/react-dom";
5
- import { Box as s } from "../Box/Box.js";
1
+ import { jsx as i, jsxs as x } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { useFloating as w, offset as k, shift as y, flip as $, autoUpdate as v } from "@floating-ui/react-dom";
4
+ import c from "styled-components";
5
+ import { Box as d } from "../Box/Box.js";
6
+ import { useIntersection as P } from "../helpers/useIntersection.js";
6
7
  import { Portal as S } from "../Portal/Portal.js";
7
- import { useIntersection as q } from "../helpers/useIntersection.js";
8
- const L = [
9
- "top",
10
- "top-start",
11
- "top-end",
12
- "right",
13
- "right-start",
14
- "right-end",
15
- "bottom",
16
- "bottom-start",
17
- "bottom-end",
18
- "left",
19
- "left-start",
20
- "left-end"
21
- ], z = d(s)`
22
- box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
8
+ const T = ["top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end"], W = c(d)`
9
+ box-shadow: ${({
10
+ theme: t
11
+ }) => t.shadows.filterShadow};
23
12
  z-index: 4;
24
- border: 1px solid ${({ theme: e }) => e.colors.neutral150};
25
- background: ${({ theme: e }) => e.colors.neutral0};
26
- `, A = d(s)`
13
+ border: 1px solid ${({
14
+ theme: t
15
+ }) => t.colors.neutral150};
16
+ background: ${({
17
+ theme: t
18
+ }) => t.colors.neutral0};
19
+ `, E = ({
20
+ source: t,
21
+ children: e,
22
+ spacing: o = 0,
23
+ fullWidth: r = !1,
24
+ placement: s = "bottom-start",
25
+ centered: n = !1,
26
+ ...l
27
+ }) => {
28
+ const [p, u] = a.useState(void 0), {
29
+ x: h,
30
+ y: m,
31
+ reference: f,
32
+ floating: b,
33
+ strategy: g
34
+ } = w({
35
+ strategy: "fixed",
36
+ placement: n ? "bottom" : s,
37
+ middleware: [k({
38
+ mainAxis: o
39
+ }), y(), $()],
40
+ whileElementsMounted: v
41
+ });
42
+ return a.useLayoutEffect(() => {
43
+ f(t.current);
44
+ }, [t, f]), a.useLayoutEffect(() => {
45
+ r && u(t.current.offsetWidth);
46
+ }, [r, t]), i(W, {
47
+ ref: b,
48
+ style: {
49
+ left: h,
50
+ top: m,
51
+ position: g,
52
+ width: p || void 0
53
+ },
54
+ hasRadius: !0,
55
+ background: "neutral0",
56
+ padding: 1,
57
+ ...l,
58
+ children: e
59
+ });
60
+ }, R = ({
61
+ children: t,
62
+ intersectionId: e,
63
+ onReachEnd: o,
64
+ ...r
65
+ }) => {
66
+ const s = a.useRef(null);
67
+ return P(s, o ?? (() => {
68
+ }), {
69
+ selectorToWatch: `#${e}`,
70
+ skipWhen: !e || !o
71
+ }), x(L, {
72
+ ref: s,
73
+ ...r,
74
+ children: [t, e && o && i(d, {
75
+ id: e,
76
+ width: "100%",
77
+ height: "1px"
78
+ })]
79
+ });
80
+ }, L = c(d)`
27
81
  // 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
28
82
  max-height: ${3 * 5}rem;
29
83
  overflow-y: auto;
@@ -35,89 +89,44 @@ const L = [
35
89
  }
36
90
 
37
91
  &::-webkit-scrollbar-track {
38
- background: ${({ theme: e }) => e.colors.neutral0};
92
+ background: ${({
93
+ theme: t
94
+ }) => t.colors.neutral0};
39
95
  }
40
96
 
41
97
  &::-webkit-scrollbar-thumb {
42
- background: ${({ theme: e }) => e.colors.neutral150};
43
- border-radius: ${({ theme: e }) => e.borderRadius};
98
+ background: ${({
99
+ theme: t
100
+ }) => t.colors.neutral150};
101
+ border-radius: ${({
102
+ theme: t
103
+ }) => t.borderRadius};
44
104
  margin-right: 10px;
45
105
  }
46
- `, a = ({
106
+ `, B = ({
107
+ children: t,
47
108
  source: e,
48
- children: m,
49
- spacing: h,
50
- fullWidth: i,
51
- placement: b,
52
- onReachEnd: n,
53
- intersectionId: r,
54
- centered: g,
55
- ...w
56
- }) => {
57
- const l = o.useRef(null), [v, x] = o.useState(void 0), { x: y, y: E, reference: p, floating: P, strategy: k } = R({
58
- strategy: "fixed",
59
- placement: g ? "bottom" : b,
60
- middleware: [
61
- $({
62
- mainAxis: h
63
- }),
64
- W(),
65
- T()
66
- ],
67
- whileElementsMounted: O
68
- });
69
- return o.useLayoutEffect(() => {
70
- p(e.current);
71
- }, [e, p]), o.useLayoutEffect(() => {
72
- i && x(e.current.offsetWidth);
73
- }, [i, e]), q(l, n, {
74
- selectorToWatch: `#${r}`,
75
- skipWhen: !r || !n
76
- }), /* @__PURE__ */ o.createElement(z, {
77
- ref: P,
78
- style: {
79
- left: y,
80
- top: E,
81
- position: k,
82
- width: v || void 0
83
- },
84
- hasRadius: !0,
85
- background: "neutral0",
86
- padding: 1
87
- }, /* @__PURE__ */ o.createElement(A, {
88
- ref: l,
89
- ...w
90
- }, m, r && n && /* @__PURE__ */ o.createElement(s, {
91
- id: r,
92
- width: "100%",
93
- height: "1px"
94
- })));
95
- }, c = (e) => /* @__PURE__ */ o.createElement(S, null, /* @__PURE__ */ o.createElement(a, {
96
- ...e
97
- })), f = {
98
- fullWidth: !1,
99
- intersectionId: void 0,
100
- onReachEnd: void 0,
101
- centered: !1,
102
- placement: "bottom-start",
103
- spacing: 0
104
- }, u = {
105
- centered: t.bool,
106
- children: t.node.isRequired,
107
- fullWidth: t.bool,
108
- intersectionId: t.string,
109
- onReachEnd: t.func,
110
- placement: t.oneOf(L),
111
- source: t.shape({
112
- current: (typeof Element > "u" ? t.any : t.instanceOf(Element)).isRequired
113
- }).isRequired,
114
- spacing: t.number
115
- };
116
- a.propTypes = u;
117
- a.defaultProps = f;
118
- c.propTypes = u;
119
- c.defaultProps = f;
109
+ spacing: o,
110
+ fullWidth: r,
111
+ placement: s,
112
+ centered: n,
113
+ ...l
114
+ }) => i(S, {
115
+ children: i(E, {
116
+ source: e,
117
+ spacing: o,
118
+ fullWidth: r,
119
+ placement: s,
120
+ centered: n,
121
+ children: i(R, {
122
+ ...l,
123
+ children: t
124
+ })
125
+ })
126
+ });
120
127
  export {
121
- L as POPOVER_PLACEMENTS,
122
- c as Popover
128
+ E as Content,
129
+ T as POPOVER_PLACEMENTS,
130
+ B as Popover,
131
+ R as Scrolling
123
132
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Popover.cjs");exports.POPOVER_PLACEMENTS=e.POPOVER_PLACEMENTS;exports.Popover=e.Popover;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Popover.cjs"),o={Content:e.Content,Scrolling:e.Scrolling};exports.POPOVER_PLACEMENTS=e.POPOVER_PLACEMENTS;exports.Popover=e.Popover;exports.PopoverPrimitives=o;
@@ -1,5 +1,11 @@
1
- import { POPOVER_PLACEMENTS as r, Popover as E } from "./Popover.js";
1
+ import { Content as o, Scrolling as r } from "./Popover.js";
2
+ import { POPOVER_PLACEMENTS as p, Popover as m } from "./Popover.js";
3
+ const e = {
4
+ Content: o,
5
+ Scrolling: r
6
+ };
2
7
  export {
3
- r as POPOVER_PLACEMENTS,
4
- E as Popover
8
+ p as POPOVER_PLACEMENTS,
9
+ m as Popover,
10
+ e as PopoverPrimitives
5
11
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),c=require("react-dom"),a=require("prop-types"),s=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},l=s(a),u=({children:e})=>{const t=r.useRef(null),[o,n]=r.useState(!1);return r.useLayoutEffect(()=>(t.current=document.createElement("div"),t.current.setAttribute("data-react-portal","true"),document.body.appendChild(t.current),n(!0),()=>{t.current?.remove()}),[]),!o||!t.current?null:c.createPortal(e,t.current)};u.propTypes={children:l.default.node.isRequired};exports.Portal=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),c=require("react-dom");function a(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=a(o),l=({children:e})=>{const t=u.useRef(null),[r,n]=u.useState(!1);return u.useLayoutEffect(()=>(t.current=document.createElement("div"),t.current.setAttribute("data-react-portal","true"),document.body.appendChild(t.current),n(!0),()=>{t.current?.remove()}),[]),!r||!t.current?null:c.createPortal(e,t.current)};exports.Portal=l;
@@ -1,15 +1,13 @@
1
- import { useRef as u, useState as n, useLayoutEffect as c } from "react";
2
- import { createPortal as a } from "react-dom";
3
- import d from "prop-types";
4
- const p = ({ children: r }) => {
5
- const e = u(null), [t, o] = n(!1);
6
- return c(() => (e.current = document.createElement("div"), e.current.setAttribute("data-react-portal", "true"), document.body.appendChild(e.current), o(!0), () => {
7
- e.current?.remove();
8
- }), []), !t || !e.current ? null : a(r, e.current);
9
- };
10
- p.propTypes = {
11
- children: d.node.isRequired
1
+ import * as e from "react";
2
+ import { createPortal as o } from "react-dom";
3
+ const a = ({
4
+ children: r
5
+ }) => {
6
+ const t = e.useRef(null), [u, n] = e.useState(!1);
7
+ return e.useLayoutEffect(() => (t.current = document.createElement("div"), t.current.setAttribute("data-react-portal", "true"), document.body.appendChild(t.current), n(!0), () => {
8
+ t.current?.remove();
9
+ }), []), !u || !t.current ? null : o(r, t.current);
12
10
  };
13
11
  export {
14
- p as Portal
12
+ a as Portal
15
13
  };
@@ -12,20 +12,23 @@ const p = m(l)`
12
12
  top: 0;
13
13
  width: ${({ value: r }) => `${r}%`};
14
14
  }
15
- `, t = ({ min: r, max: i, value: o, children: s, size: a, ...n }) => /* @__PURE__ */ u.createElement(p, {
16
- background: "neutral600",
17
- hasRadius: !0,
18
- "aria-label": s,
19
- "aria-valuemax": i,
20
- "aria-valuemin": r,
21
- "aria-valuenow": o,
22
- height: a === "S" ? 1 : 2,
23
- position: "relative",
24
- role: "progressbar",
25
- value: o,
26
- width: a === "S" ? "78px" : "102px",
27
- ...n
28
- });
15
+ `, t = ({ min: r, max: i, value: o, children: s, size: a, ...n }) => /* @__PURE__ */ u.createElement(
16
+ p,
17
+ {
18
+ background: "neutral600",
19
+ hasRadius: !0,
20
+ "aria-label": s,
21
+ "aria-valuemax": i,
22
+ "aria-valuemin": r,
23
+ "aria-valuenow": o,
24
+ height: a === "S" ? 1 : 2,
25
+ position: "relative",
26
+ role: "progressbar",
27
+ value: o,
28
+ width: a === "S" ? "78px" : "102px",
29
+ ...n
30
+ }
31
+ );
29
32
  t.defaultProps = {
30
33
  min: 0,
31
34
  max: 100,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),d=require("prop-types"),n=require("styled-components"),u=require("../BaseRadio/BaseRadio.cjs"),c=require("../Typography/Typography.cjs"),i=require("../Box/Box.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=a(l),o=a(d),p=a(n),y=p.default(c.Typography)`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),d=require("prop-types"),n=require("styled-components"),u=require("../BaseRadio/BaseRadio.cjs"),c=require("../Box/Box.cjs"),i=require("../Typography/Typography.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=a(l),o=a(d),p=a(n),y=p.default(i.Typography)`
2
2
  display: flex;
3
3
  align-items: center;
4
- `,r=({children:e,...s})=>t.default.createElement(y,{as:"label",textColor:"neutral800"},t.default.createElement(u.BaseRadio,{...s}),t.default.createElement(i.Box,{paddingLeft:2},e));r.propTypes={children:o.default.node.isRequired,value:o.default.any.isRequired};exports.Radio=r;
4
+ `,r=({children:e,...s})=>t.default.createElement(y,{as:"label",textColor:"neutral800"},t.default.createElement(u.BaseRadio,{...s}),t.default.createElement(c.Box,{paddingLeft:2},e));r.propTypes={children:o.default.node.isRequired,value:o.default.any.isRequired};exports.Radio=r;
@@ -2,19 +2,12 @@ import e from "react";
2
2
  import r from "prop-types";
3
3
  import a from "styled-components";
4
4
  import { BaseRadio as i } from "../BaseRadio/BaseRadio.js";
5
- import { Typography as m } from "../Typography/Typography.js";
6
- import { Box as p } from "../Box/Box.js";
7
- const l = a(m)`
5
+ import { Box as m } from "../Box/Box.js";
6
+ import { Typography as p } from "../Typography/Typography.js";
7
+ const l = a(p)`
8
8
  display: flex;
9
9
  align-items: center;
10
- `, n = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, {
11
- as: "label",
12
- textColor: "neutral800"
13
- }, /* @__PURE__ */ e.createElement(i, {
14
- ...o
15
- }), /* @__PURE__ */ e.createElement(p, {
16
- paddingLeft: 2
17
- }, t));
10
+ `, n = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, { as: "label", textColor: "neutral800" }, /* @__PURE__ */ e.createElement(i, { ...o }), /* @__PURE__ */ e.createElement(m, { paddingLeft: 2 }, t));
18
11
  n.propTypes = {
19
12
  children: r.node.isRequired,
20
13
  value: r.any.isRequired
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),w=require("prop-types"),F=require("../Box/Box.cjs"),n=require("../helpers/getFocusableNodes.cjs"),f=require("../helpers/keyboardKeys.cjs"),R=require("./RawTableContext.cjs"),p=o=>o&&typeof o=="object"&&"default"in o?o:{default:o},T=p(d),s=p(w),h=o=>T.default.createElement(i,{...o,as:"th"}),i=({coords:o,as:x,...m})=>{const r=d.useRef(null),{rowIndex:E,colIndex:K,setTableValues:N}=R.useTable(),[u,b]=d.useState(!1),v=e=>{const t=n.getFocusableNodes(r.current,!0);if(t.length===0||t.length===1&&n.getFocusableNodesWithKeyboardNav(t).length===0)return;if(t.length>1&&!t.find(l=>l.tagName!=="BUTTON")){e.preventDefault();const l=t.findIndex(c=>c===document.activeElement);if(e.key===f.KeyboardKeys.RIGHT){const c=t[l+1];c&&(e.stopPropagation(),c.focus())}else if(e.key===f.KeyboardKeys.LEFT){const c=t[l-1];c&&(e.stopPropagation(),c.focus())}return}const a=e.key===f.KeyboardKeys.ENTER;if(a&&!u)b(!0);else if((e.key===f.KeyboardKeys.ESCAPE||a)&&u){if(a&&document.activeElement.tagName==="A")return;b(!1),r.current.focus()}else u&&e.stopPropagation()},y=E===o.row-1&&K===o.col-1;d.useLayoutEffect(()=>{const e=n.getFocusableNodes(r.current,!0);e.length===0||e.length===1&&n.getFocusableNodesWithKeyboardNav(e).length!==0||e.length>1&&Boolean(e.find(t=>t.tagName!=="BUTTON"))?(r.current.setAttribute("tabIndex",!u&&y?0:-1),e.forEach((t,a)=>{t.setAttribute("tabIndex",u?0:-1),u&&a===0&&t.focus()})):e.forEach(t=>{t.setAttribute("tabIndex",y?0:-1)})},[u,y]);const g=d.useCallback(()=>{const e=n.getFocusableNodes(r.current,!0);e.length>=1&&(n.getFocusableNodesWithKeyboardNav(e).length!==0||!e.find(t=>t.tagName!=="BUTTON"))&&b(!0),N({rowIndex:o.row-1,colIndex:o.col-1})},[o,N]);return d.useLayoutEffect(()=>{const e=r.current;return n.getFocusableNodes(e,!0).forEach(a=>{a.addEventListener("focus",g)}),()=>{n.getFocusableNodes(e,!0).forEach(l=>{l.removeEventListener("focus",g)})}},[g]),T.default.createElement(F.Box,{role:"gridcell",as:x,ref:r,onKeyDown:v,...m})};h.defaultProps={children:void 0,coords:{}};h.propTypes={"aria-colindex":s.default.number.isRequired,children:s.default.node,coords:s.default.shape({col:s.default.number,row:s.default.number})};i.defaultProps={as:"td",children:void 0,coords:{}};i.propTypes={"aria-colindex":s.default.number.isRequired,as:s.default.oneOf(["td","th"]),children:s.default.node,coords:s.default.shape({col:s.default.number,row:s.default.number})};exports.RawTd=i;exports.RawTh=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),w=require("prop-types"),F=require("./RawTableContext.cjs"),R=require("../Box/Box.cjs"),n=require("../helpers/getFocusableNodes.cjs"),f=require("../helpers/keyboardKeys.cjs"),p=o=>o&&typeof o=="object"&&"default"in o?o:{default:o},T=p(d),s=p(w),h=o=>T.default.createElement(i,{...o,as:"th"}),i=({coords:o,as:x,...m})=>{const r=d.useRef(null),{rowIndex:E,colIndex:K,setTableValues:N}=F.useTable(),[u,b]=d.useState(!1),v=e=>{const t=n.getFocusableNodes(r.current,!0);if(t.length===0||t.length===1&&n.getFocusableNodesWithKeyboardNav(t).length===0)return;if(t.length>1&&!t.find(l=>l.tagName!=="BUTTON")){e.preventDefault();const l=t.findIndex(c=>c===document.activeElement);if(e.key===f.KeyboardKeys.RIGHT){const c=t[l+1];c&&(e.stopPropagation(),c.focus())}else if(e.key===f.KeyboardKeys.LEFT){const c=t[l-1];c&&(e.stopPropagation(),c.focus())}return}const a=e.key===f.KeyboardKeys.ENTER;if(a&&!u)b(!0);else if((e.key===f.KeyboardKeys.ESCAPE||a)&&u){if(a&&document.activeElement.tagName==="A")return;b(!1),r.current.focus()}else u&&e.stopPropagation()},y=E===o.row-1&&K===o.col-1;d.useLayoutEffect(()=>{const e=n.getFocusableNodes(r.current,!0);e.length===0||e.length===1&&n.getFocusableNodesWithKeyboardNav(e).length!==0||e.length>1&&Boolean(e.find(t=>t.tagName!=="BUTTON"))?(r.current.setAttribute("tabIndex",!u&&y?0:-1),e.forEach((t,a)=>{t.setAttribute("tabIndex",u?0:-1),u&&a===0&&t.focus()})):e.forEach(t=>{t.setAttribute("tabIndex",y?0:-1)})},[u,y]);const g=d.useCallback(()=>{const e=n.getFocusableNodes(r.current,!0);e.length>=1&&(n.getFocusableNodesWithKeyboardNav(e).length!==0||!e.find(t=>t.tagName!=="BUTTON"))&&b(!0),N({rowIndex:o.row-1,colIndex:o.col-1})},[o,N]);return d.useLayoutEffect(()=>{const e=r.current;return n.getFocusableNodes(e,!0).forEach(a=>{a.addEventListener("focus",g)}),()=>{n.getFocusableNodes(e,!0).forEach(l=>{l.removeEventListener("focus",g)})}},[g]),T.default.createElement(R.Box,{role:"gridcell",as:x,ref:r,onKeyDown:v,...m})};h.defaultProps={children:void 0,coords:{}};h.propTypes={"aria-colindex":s.default.number.isRequired,children:s.default.node,coords:s.default.shape({col:s.default.number,row:s.default.number})};i.defaultProps={as:"td",children:void 0,coords:{}};i.propTypes={"aria-colindex":s.default.number.isRequired,as:s.default.oneOf(["td","th"]),children:s.default.node,coords:s.default.shape({col:s.default.number,row:s.default.number})};exports.RawTd=i;exports.RawTh=h;
@@ -1,14 +1,11 @@
1
1
  import g, { useRef as w, useState as R, useLayoutEffect as N, useCallback as A } from "react";
2
2
  import o from "prop-types";
3
- import { Box as P } from "../Box/Box.js";
3
+ import { useTable as P } from "./RawTableContext.js";
4
+ import { Box as B } from "../Box/Box.js";
4
5
  import { getFocusableNodes as l, getFocusableNodesWithKeyboardNav as b } from "../helpers/getFocusableNodes.js";
5
6
  import { KeyboardKeys as d } from "../helpers/keyboardKeys.js";
6
- import { useTable as B } from "./RawTableContext.js";
7
- const E = (r) => /* @__PURE__ */ g.createElement(h, {
8
- ...r,
9
- as: "th"
10
- }), h = ({ coords: r, as: T, ...x }) => {
11
- const s = w(null), { rowIndex: y, colIndex: v, setTableValues: p } = B(), [c, i] = R(!1), I = (e) => {
7
+ const E = (r) => /* @__PURE__ */ g.createElement(h, { ...r, as: "th" }), h = ({ coords: r, as: T, ...x }) => {
8
+ const s = w(null), { rowIndex: y, colIndex: v, setTableValues: p } = P(), [c, i] = R(!1), I = (e) => {
12
9
  const t = l(s.current, !0);
13
10
  if (t.length === 0 || t.length === 1 && b(t).length === 0)
14
11
  return;
@@ -55,13 +52,7 @@ const E = (r) => /* @__PURE__ */ g.createElement(h, {
55
52
  u.removeEventListener("focus", m);
56
53
  });
57
54
  };
58
- }, [m]), /* @__PURE__ */ g.createElement(P, {
59
- role: "gridcell",
60
- as: T,
61
- ref: s,
62
- onKeyDown: I,
63
- ...x
64
- });
55
+ }, [m]), /* @__PURE__ */ g.createElement(B, { role: "gridcell", as: T, ref: s, onKeyDown: I, ...x });
65
56
  };
66
57
  E.defaultProps = {
67
58
  children: void 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),_=require("prop-types"),m=require("./RawTableContext.cjs"),r=require("../helpers/keyboardKeys.cjs"),E=require("./focusFocusable.cjs"),D=a=>a&&typeof a=="object"&&"default"in a?a:{default:a},K=D(u),o=D(_),f=({colCount:a,rowCount:l,jumpStep:n,initialCol:k,initialRow:T,...p})=>{const i=u.useRef(null),b=u.useRef(!1),[y,s]=u.useState(T),[d,c]=u.useState(k),R=u.useCallback(({colIndex:t,rowIndex:e})=>{c(t),s(e)},[]);u.useEffect(()=>{b.current&&E.focusFocusable(i.current),b.current||(b.current=!0)},[d,y]);const P=t=>{switch(t.key){case r.KeyboardKeys.RIGHT:{t.preventDefault(),c(e=>e<a-1?e+1:e);break}case r.KeyboardKeys.LEFT:{t.preventDefault(),c(e=>e>0?e-1:e);break}case r.KeyboardKeys.UP:{t.preventDefault(),s(e=>e>0?e-1:e);break}case r.KeyboardKeys.DOWN:{t.preventDefault(),s(e=>e<l-1?e+1:e);break}case r.KeyboardKeys.HOME:{t.preventDefault(),t.ctrlKey&&s(0),c(0);break}case r.KeyboardKeys.END:{t.preventDefault(),t.ctrlKey&&s(l-1),c(a-1);break}case r.KeyboardKeys.PAGE_DOWN:{t.preventDefault(),s(e=>e+n<l?e+n:l-1);break}case r.KeyboardKeys.PAGE_UP:{t.preventDefault(),s(e=>e-n>0?e-n:0);break}}};return K.default.createElement(m.RawTableContext.Provider,{value:{rowIndex:y,colIndex:d,setTableValues:R}},K.default.createElement("table",{role:"grid",ref:i,"aria-rowcount":l,"aria-colcount":a,onKeyDown:P,...p}))};f.defaultProps={jumpStep:3,initialCol:0,initialRow:0};f.propTypes={colCount:o.default.number.isRequired,initialCol:o.default.number,initialRow:o.default.number,jumpStep:o.default.number,rowCount:o.default.number.isRequired};exports.RawTable=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),_=require("prop-types"),E=require("./focusFocusable.cjs"),q=require("./RawTableContext.cjs"),r=require("../helpers/keyboardKeys.cjs"),k=a=>a&&typeof a=="object"&&"default"in a?a:{default:a},y=k(u),o=k(_),d=({colCount:a,rowCount:l,jumpStep:n,initialCol:T,initialRow:p,...R})=>{const K=u.useRef(null),f=u.useRef(!1),[b,s]=u.useState(p),[i,c]=u.useState(T),D=u.useCallback(({colIndex:t,rowIndex:e})=>{c(t),s(e)},[]);u.useEffect(()=>{f.current&&E.focusFocusable(K.current),f.current||(f.current=!0)},[i,b]);const m=t=>{switch(t.key){case r.KeyboardKeys.RIGHT:{t.preventDefault(),c(e=>e<a-1?e+1:e);break}case r.KeyboardKeys.LEFT:{t.preventDefault(),c(e=>e>0?e-1:e);break}case r.KeyboardKeys.UP:{t.preventDefault(),s(e=>e>0?e-1:e);break}case r.KeyboardKeys.DOWN:{t.preventDefault(),s(e=>e<l-1?e+1:e);break}case r.KeyboardKeys.HOME:{t.preventDefault(),t.ctrlKey&&s(0),c(0);break}case r.KeyboardKeys.END:{t.preventDefault(),t.ctrlKey&&s(l-1),c(a-1);break}case r.KeyboardKeys.PAGE_DOWN:{t.preventDefault(),s(e=>e+n<l?e+n:l-1);break}case r.KeyboardKeys.PAGE_UP:{t.preventDefault(),s(e=>e-n>0?e-n:0);break}}},P=y.default.useMemo(()=>({rowIndex:b,colIndex:i,setTableValues:D}),[i,b,D]);return y.default.createElement(q.RawTableContext.Provider,{value:P},y.default.createElement("table",{role:"grid",ref:K,"aria-rowcount":l,"aria-colcount":a,onKeyDown:m,...R}))};d.defaultProps={jumpStep:3,initialCol:0,initialRow:0};d.propTypes={colCount:o.default.number.isRequired,initialCol:o.default.number,initialRow:o.default.number,jumpStep:o.default.number,rowCount:o.default.number.isRequired};exports.RawTable=d;