@strapi/design-system 1.7.6 → 1.7.8

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 (143) hide show
  1. package/dist/BaseButton/BaseButton.cjs +3 -3
  2. package/dist/BaseButton/BaseButton.js +5 -5
  3. package/dist/Box/Box.cjs +2 -2
  4. package/dist/Box/Box.js +1 -1
  5. package/dist/CarouselInput/Carousel.cjs +6 -7
  6. package/dist/CarouselInput/Carousel.js +25 -79
  7. package/dist/CarouselInput/CarouselActions.cjs +1 -1
  8. package/dist/CarouselInput/CarouselActions.js +1 -14
  9. package/dist/CarouselInput/CarouselImage.cjs +3 -4
  10. package/dist/CarouselInput/CarouselImage.js +13 -23
  11. package/dist/CarouselInput/CarouselInput.cjs +1 -1
  12. package/dist/CarouselInput/CarouselInput.js +12 -75
  13. package/dist/CarouselInput/CarouselSlide.cjs +1 -3
  14. package/dist/CarouselInput/CarouselSlide.js +4 -29
  15. package/dist/Checkbox/Checkbox.cjs +3 -3
  16. package/dist/Checkbox/Checkbox.js +18 -40
  17. package/dist/Dialog/Dialog.cjs +5 -5
  18. package/dist/Dialog/Dialog.js +21 -49
  19. package/dist/Dialog/DialogBody.cjs +2 -2
  20. package/dist/Dialog/DialogBody.js +6 -19
  21. package/dist/Dialog/DialogFooter.cjs +2 -2
  22. package/dist/Dialog/DialogFooter.js +7 -21
  23. package/dist/Grid/Grid.cjs +3 -3
  24. package/dist/Grid/Grid.js +8 -22
  25. package/dist/Grid/GridItem.cjs +2 -2
  26. package/dist/Grid/GridItem.js +10 -27
  27. package/dist/Layout/ActionLayout.cjs +1 -9
  28. package/dist/Layout/ActionLayout.js +4 -27
  29. package/dist/Layout/ContentLayout.cjs +1 -1
  30. package/dist/Layout/ContentLayout.js +4 -9
  31. package/dist/Layout/GridLayout.cjs +3 -3
  32. package/dist/Layout/GridLayout.js +4 -8
  33. package/dist/Layout/HeaderLayout.cjs +4 -4
  34. package/dist/Layout/HeaderLayout.js +25 -120
  35. package/dist/Layout/Layout.cjs +4 -4
  36. package/dist/Layout/Layout.js +7 -19
  37. package/dist/Layout/TwoColsLayout.cjs +1 -1
  38. package/dist/Layout/TwoColsLayout.js +6 -15
  39. package/dist/ModalLayout/ModalBody.cjs +2 -2
  40. package/dist/ModalLayout/ModalBody.js +4 -5
  41. package/dist/ModalLayout/ModalContext.cjs +1 -1
  42. package/dist/ModalLayout/ModalContext.js +2 -1
  43. package/dist/ModalLayout/ModalFooter.cjs +2 -6
  44. package/dist/ModalLayout/ModalFooter.js +9 -26
  45. package/dist/ModalLayout/ModalHeader.cjs +2 -2
  46. package/dist/ModalLayout/ModalHeader.js +10 -22
  47. package/dist/ModalLayout/ModalLayout.cjs +3 -5
  48. package/dist/ModalLayout/ModalLayout.js +10 -30
  49. package/dist/NumberInput/NumberInput.cjs +2 -2
  50. package/dist/NumberInput/NumberInput.js +68 -168
  51. package/dist/Pagination/Pagination.cjs +1 -5
  52. package/dist/Pagination/Pagination.js +7 -21
  53. package/dist/Pagination/components.cjs +7 -10
  54. package/dist/Pagination/components.js +34 -81
  55. package/dist/Popover/Popover.cjs +3 -3
  56. package/dist/Popover/Popover.js +67 -66
  57. package/dist/ProgressBar/ProgressBar.cjs +5 -5
  58. package/dist/ProgressBar/ProgressBar.js +6 -37
  59. package/dist/Radio/Radio.cjs +1 -4
  60. package/dist/Radio/Radio.js +5 -18
  61. package/dist/Searchbar/SearchForm.cjs +1 -1
  62. package/dist/Searchbar/SearchForm.js +2 -3
  63. package/dist/Searchbar/Searchbar.cjs +10 -11
  64. package/dist/Searchbar/Searchbar.js +25 -54
  65. package/dist/Status/Status.cjs +6 -6
  66. package/dist/Status/Status.js +8 -46
  67. package/dist/Switch/Switch.cjs +5 -5
  68. package/dist/Switch/Switch.js +16 -52
  69. package/dist/Table/Cell.cjs +3 -3
  70. package/dist/Table/Cell.js +10 -23
  71. package/dist/Table/TFooter.cjs +3 -3
  72. package/dist/Table/TFooter.js +8 -20
  73. package/dist/Table/Table.cjs +12 -12
  74. package/dist/Table/Table.js +19 -31
  75. package/dist/Table/Tbody.cjs +2 -2
  76. package/dist/Table/Tbody.js +4 -5
  77. package/dist/Table/Thead.cjs +2 -2
  78. package/dist/Table/Thead.js +6 -7
  79. package/dist/Table/Tr.cjs +1 -1
  80. package/dist/Table/Tr.js +3 -4
  81. package/dist/Tabs/TabGroup.cjs +1 -1
  82. package/dist/Tabs/TabGroup.js +13 -37
  83. package/dist/Tabs/TabPanels.cjs +1 -1
  84. package/dist/Tabs/TabPanels.js +11 -22
  85. package/dist/Tabs/Tabs.cjs +2 -2
  86. package/dist/Tabs/Tabs.js +55 -110
  87. package/dist/Tabs/TabsContext.cjs +1 -1
  88. package/dist/Tabs/TabsContext.js +11 -4
  89. package/dist/Textarea/Textarea.cjs +14 -12
  90. package/dist/Textarea/Textarea.js +33 -55
  91. package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
  92. package/dist/ToggleCheckbox/ToggleCheckbox.js +25 -121
  93. package/dist/ToggleInput/ToggleInput.cjs +3 -3
  94. package/dist/ToggleInput/ToggleInput.js +17 -70
  95. package/dist/Typography/Typography.cjs +1 -1
  96. package/dist/Typography/Typography.js +6 -6
  97. package/dist/hooks/useControllableState.cjs +1 -1
  98. package/dist/hooks/useControllableState.js +6 -6
  99. package/dist/themes/utils.cjs +2 -2
  100. package/dist/themes/utils.js +1 -1
  101. package/dist/v2/MainNav/MainNav.cjs +2 -2
  102. package/dist/v2/MainNav/MainNav.js +9 -31
  103. package/dist/v2/MainNav/MainNavContext.cjs +1 -1
  104. package/dist/v2/MainNav/MainNavContext.js +1 -1
  105. package/dist/v2/MainNav/NavBrand.cjs +3 -3
  106. package/dist/v2/MainNav/NavBrand.js +13 -36
  107. package/dist/v2/MainNav/NavCondense.cjs +2 -5
  108. package/dist/v2/MainNav/NavCondense.js +15 -22
  109. package/dist/v2/MainNav/NavFooter.cjs +1 -1
  110. package/dist/v2/MainNav/NavFooter.js +4 -10
  111. package/dist/v2/MainNav/NavLink.cjs +10 -10
  112. package/dist/v2/MainNav/NavLink.js +18 -39
  113. package/dist/v2/MainNav/NavSection.cjs +1 -1
  114. package/dist/v2/MainNav/NavSection.js +8 -42
  115. package/dist/v2/MainNav/NavSections.cjs +2 -2
  116. package/dist/v2/MainNav/NavSections.js +8 -22
  117. package/dist/v2/MainNav/NavUser.cjs +2 -2
  118. package/dist/v2/MainNav/NavUser.js +13 -27
  119. package/dist/v2/Pagination/Pagination.cjs +1 -5
  120. package/dist/v2/Pagination/Pagination.js +7 -21
  121. package/dist/v2/Pagination/components.cjs +7 -10
  122. package/dist/v2/Pagination/components.js +32 -65
  123. package/dist/v2/SubNav/SubNav.cjs +5 -5
  124. package/dist/v2/SubNav/SubNav.js +8 -13
  125. package/dist/v2/SubNav/SubNavHeader.cjs +3 -3
  126. package/dist/v2/SubNav/SubNavHeader.js +30 -77
  127. package/dist/v2/SubNav/SubNavLink.cjs +5 -5
  128. package/dist/v2/SubNav/SubNavLink.js +13 -47
  129. package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
  130. package/dist/v2/SubNav/SubNavLinkSection.js +19 -34
  131. package/dist/v2/SubNav/SubNavSection.cjs +2 -2
  132. package/dist/v2/SubNav/SubNavSection.js +16 -55
  133. package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
  134. package/dist/v2/SubNav/SubNavSectionLabel.js +10 -38
  135. package/dist/v2/SubNav/SubNavSections.cjs +1 -1
  136. package/dist/v2/SubNav/SubNavSections.js +4 -18
  137. package/package.json +4 -4
  138. package/dist/Grid/GridContext.cjs +0 -1
  139. package/dist/Grid/GridContext.js +0 -6
  140. package/dist/Tabs/useTabsFocus.cjs +0 -1
  141. package/dist/Tabs/useTabsFocus.js +0 -17
  142. package/dist/Textarea/TextareaInput.cjs +0 -30
  143. package/dist/Textarea/TextareaInput.js +0 -65
@@ -1,17 +1,8 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import o from "prop-types";
4
- import { Grid as a } from "../Grid/Grid.js";
5
- import { GridItem as e } from "../Grid/GridItem.js";
6
- import { Box as d } from "../Box/Box.js";
7
- const l = ({ startCol: i, endCol: t }) => /* @__PURE__ */ s(a, { gap: 4, children: [
8
- /* @__PURE__ */ r(e, { col: 9, s: 12, children: /* @__PURE__ */ r(d, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: i }) }),
9
- /* @__PURE__ */ r(e, { col: 3, s: 12, children: /* @__PURE__ */ r(d, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: t }) })
10
- ] });
11
- l.propTypes = {
12
- endCol: o.node.isRequired,
13
- startCol: o.node.isRequired
14
- };
1
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
+ import { Grid as i } from "../Grid/Grid.js";
3
+ import { GridItem as o } from "../Grid/GridItem.js";
4
+ import { Box as a } from "../Box/Box.js";
5
+ const c = ({ startCol: d, endCol: t }) => e(i, { gap: 4, children: [r(o, { col: 9, s: 12, children: r(a, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: d }) }), r(o, { col: 3, s: 12, children: r(a, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: t }) })] });
15
6
  export {
16
- l as TwoColsLayout
7
+ c as TwoColsLayout
17
8
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const t=require("styled-components"),r=require("../Box/Box.cjs"),d=e=>e&&e.__esModule?e:{default:e},u=d(t),l=u.default(r.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("styled-components"),d=require("../Box/Box.cjs"),r=e=>e&&e.__esModule?e:{default:e},l=r(t),s=l.default(d.Box)`
2
2
  overflow: auto;
3
3
  max-height: 60vh;
4
- `,s=e=>o.jsx(l,{padding:7,...e});exports.ModalBody=s;
4
+ `,u=e=>o.jsx(s,{padding:7,...e});exports.ModalBody=u;
@@ -1,11 +1,10 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
2
  import t from "styled-components";
4
- import { Box as m } from "../Box/Box.js";
5
- const p = t(m)`
3
+ import { Box as d } from "../Box/Box.js";
4
+ const m = t(d)`
6
5
  overflow: auto;
7
6
  max-height: 60vh;
8
- `, f = (o) => /* @__PURE__ */ r(p, { padding: 7, ...o });
7
+ `, i = (o) => r(m, { padding: 7, ...o });
9
8
  export {
10
- f as ModalBody
9
+ i as ModalBody
11
10
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(),o=()=>e.useContext(t);exports.ModalContext=t;exports.useModal=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(()=>{}),o=()=>e.useContext(t);exports.ModalContext=t;exports.useModal=o;
@@ -1,5 +1,6 @@
1
1
  import { createContext as t, useContext as o } from "react";
2
- const e = t(), r = () => o(e);
2
+ const e = t(() => {
3
+ }), r = () => o(e);
3
4
  export {
4
5
  e as ModalContext,
5
6
  r as useModal
@@ -1,8 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const l=require("prop-types"),u=require("styled-components"),c=require("../Box/Box.cjs"),s=require("../Flex/Flex.cjs"),n=e=>e&&e.__esModule?e:{default:e},r=n(l),i=n(u),p=i.default(c.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),d=require("styled-components"),n=require("../Box/Box.cjs"),r=require("../Flex/Flex.cjs"),s=e=>e&&e.__esModule?e:{default:e},l=s(d),a=l.default(n.Box)`
2
2
  border-radius: 0 0 ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius};
3
3
  border-top: 1px solid ${({theme:e})=>e.colors.neutral150};
4
- `,d=i.default(s.Flex)`
5
- & > * + * {
6
- margin-left: ${({theme:e})=>e.spaces[2]};
7
- }
8
- `,o=({startActions:e,endActions:a})=>t.jsx(p,{paddingTop:4,paddingBottom:4,paddingLeft:5,paddingRight:5,background:"neutral100",children:t.jsxs(s.Flex,{justifyContent:"space-between",children:[t.jsx(d,{children:e}),t.jsx(d,{children:a})]})});o.defaultProps={endActions:void 0,startActions:void 0};o.propTypes={endActions:r.default.node,startActions:r.default.node};exports.ModalFooter=o;
4
+ `,i=({startActions:e,endActions:t})=>o.jsx(a,{paddingTop:4,paddingBottom:4,paddingLeft:5,paddingRight:5,background:"neutral100",children:o.jsxs(r.Flex,{justifyContent:"space-between",children:[o.jsx(r.Flex,{gap:2,children:e}),o.jsx(r.Flex,{gap:2,children:t})]})});exports.ModalFooter=i;
@@ -1,28 +1,11 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import "react";
3
- import t from "prop-types";
4
- import d from "styled-components";
5
- import { Box as a } from "../Box/Box.js";
6
- import { Flex as i } from "../Flex/Flex.js";
7
- const c = d(a)`
8
- border-radius: 0 0 ${({ theme: o }) => o.borderRadius} ${({ theme: o }) => o.borderRadius};
9
- border-top: 1px solid ${({ theme: o }) => o.colors.neutral150};
10
- `, e = d(i)`
11
- & > * + * {
12
- margin-left: ${({ theme: o }) => o.spaces[2]};
13
- }
14
- `, n = ({ startActions: o, endActions: p }) => /* @__PURE__ */ r(c, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ s(i, { justifyContent: "space-between", children: [
15
- /* @__PURE__ */ r(e, { children: o }),
16
- /* @__PURE__ */ r(e, { children: p })
17
- ] }) });
18
- n.defaultProps = {
19
- endActions: void 0,
20
- startActions: void 0
21
- };
22
- n.propTypes = {
23
- endActions: t.node,
24
- startActions: t.node
25
- };
1
+ import { jsx as o, jsxs as t } from "react/jsx-runtime";
2
+ import i from "styled-components";
3
+ import { Box as n } from "../Box/Box.js";
4
+ import { Flex as d } from "../Flex/Flex.js";
5
+ const p = i(n)`
6
+ border-radius: 0 0 ${({ theme: r }) => r.borderRadius} ${({ theme: r }) => r.borderRadius};
7
+ border-top: 1px solid ${({ theme: r }) => r.colors.neutral150};
8
+ `, m = ({ startActions: r, endActions: e }) => o(p, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: t(d, { justifyContent: "space-between", children: [o(d, { gap: 2, children: r }), o(d, { gap: 2, children: e })] }) });
26
9
  export {
27
- n as ModalFooter
10
+ m as ModalFooter
28
11
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const l=require("@strapi/icons"),a=require("prop-types"),i=require("styled-components"),u=require("./ModalContext.cjs"),c=require("../IconButton/IconButton.cjs"),p=require("../Box/Box.cjs"),b=require("../Flex/Flex.cjs"),s=e=>e&&e.__esModule?e:{default:e},t=s(a),f=s(i),x=f.default(p.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("@strapi/icons"),d=require("styled-components"),s=require("./ModalContext.cjs"),a=require("../IconButton/IconButton.cjs"),l=require("../Box/Box.cjs"),i=require("../Flex/Flex.cjs"),u=e=>e&&e.__esModule?e:{default:e},c=u(d),p=c.default(l.Box)`
2
2
  border-radius: ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius} 0 0;
3
3
  border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
4
- `,r=({children:e,closeLabel:d})=>{const n=u.useModal();return o.jsx(x,{paddingTop:4,paddingBottom:4,paddingLeft:5,paddingRight:5,background:"neutral100",children:o.jsxs(b.Flex,{justifyContent:"space-between",children:[e,o.jsx(c.IconButton,{onClick:n,"aria-label":d,icon:o.jsx(l.Cross,{})})]})})};r.defaultProps={closeLabel:"Close the modal"};r.propTypes={children:t.default.node.isRequired,closeLabel:t.default.string};exports.ModalHeader=r;
4
+ `,x=({children:e,closeLabel:t="Close the modal"})=>{const r=s.useModal();return o.jsx(p,{paddingTop:4,paddingBottom:4,paddingLeft:5,paddingRight:5,background:"neutral100",children:o.jsxs(i.Flex,{justifyContent:"space-between",children:[e,o.jsx(a.IconButton,{onClick:r,"aria-label":t,icon:o.jsx(n.Cross,{})})]})})};exports.ModalHeader=x;
@@ -1,29 +1,17 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import "react";
3
- import { Cross as p } from "@strapi/icons";
4
- import e from "prop-types";
1
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
+ import { Cross as i } from "@strapi/icons";
5
3
  import a from "styled-components";
6
4
  import { useModal as n } from "./ModalContext.js";
7
- import { IconButton as l } from "../IconButton/IconButton.js";
8
- import { Box as m } from "../Box/Box.js";
9
- import { Flex as c } from "../Flex/Flex.js";
10
- const u = a(m)`
5
+ import { IconButton as s } from "../IconButton/IconButton.js";
6
+ import { Box as l } from "../Box/Box.js";
7
+ import { Flex as m } from "../Flex/Flex.js";
8
+ const p = a(l)`
11
9
  border-radius: ${({ theme: o }) => o.borderRadius} ${({ theme: o }) => o.borderRadius} 0 0;
12
10
  border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral150};
13
- `, t = ({ children: o, closeLabel: d }) => {
14
- const i = n();
15
- return /* @__PURE__ */ r(u, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ s(c, { justifyContent: "space-between", children: [
16
- o,
17
- /* @__PURE__ */ r(l, { onClick: i, "aria-label": d, icon: /* @__PURE__ */ r(p, {}) })
18
- ] }) });
19
- };
20
- t.defaultProps = {
21
- closeLabel: "Close the modal"
22
- };
23
- t.propTypes = {
24
- children: e.node.isRequired,
25
- closeLabel: e.string
11
+ `, h = ({ children: o, closeLabel: e = "Close the modal" }) => {
12
+ const t = n();
13
+ return r(p, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: d(m, { justifyContent: "space-between", children: [o, r(s, { onClick: t, "aria-label": e, icon: r(i, {}) })] }) });
26
14
  };
27
15
  export {
28
- t as ModalHeader
16
+ h as ModalHeader
29
17
  };
@@ -1,6 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const u=require("prop-types"),d=require("styled-components"),c=require("./ModalContext.cjs"),p=require("../DismissibleLayer/index.cjs"),x=require("../hooks/useLockScroll.cjs"),y=require("../Flex/Flex.cjs"),f=require("../Box/Box.cjs"),q=require("../Portal/Portal.cjs"),g=require("../FocusTrap/FocusTrap.cjs"),t=e=>e&&e.__esModule?e:{default:e},r=t(u),n=t(d),h=n.default(y.Flex)`
2
- inset: 0;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("styled-components"),a=require("./ModalContext.cjs"),s=require("../DismissibleLayer/index.cjs"),d=require("../hooks/useLockScroll.cjs"),l=require("../Flex/Flex.cjs"),u=require("../Portal/Portal.cjs"),c=require("../FocusTrap/FocusTrap.cjs"),x=require("../Box/Box.cjs"),p=e=>e&&e.__esModule?e:{default:e},h=p(i),y=h.default(l.Flex)`
3
2
  background: ${({theme:e})=>`${e.colors.neutral800}1F`};
4
- `,j=n.default(f.Box)`
5
- width: ${830/16}rem;
6
- `,s=({onClose:e,labelledBy:i,...a})=>(x(!0),o.jsx(q.Portal,{children:o.jsx(c.ModalContext.Provider,{value:e,children:o.jsx(h,{justifyContent:"center",paddingLeft:8,paddingRight:8,position:"fixed",zIndex:4,children:o.jsx(g.FocusTrap,{children:o.jsx(p.DismissibleLayer,{onEscapeKeyDown:e,onPointerDownOutside:e,children:o.jsx(j,{"aria-labelledby":i,onClick:l=>l.stopPropagation(),background:"neutral0",hasRadius:!0,shadow:"popupShadow",role:"dialog","aria-modal":!0,...a})})})})})}));s.propTypes={labelledBy:r.default.string.isRequired,onClose:r.default.func.isRequired};exports.ModalLayout=s;
3
+ inset: 0;
4
+ `,g=({onClose:e,labelledBy:r,...t})=>(d(!0),o.jsx(u.Portal,{children:o.jsx(a.ModalContext.Provider,{value:e,children:o.jsx(y,{justifyContent:"center",paddingLeft:8,paddingRight:8,position:"fixed",zIndex:4,children:o.jsx(c.FocusTrap,{children:o.jsx(s.DismissibleLayer,{onEscapeKeyDown:e,onPointerDownOutside:e,children:o.jsx(x.Box,{"aria-labelledby":r,"aria-modal":!0,onClick:n=>n.stopPropagation(),background:"neutral0",hasRadius:!0,role:"dialog",shadow:"popupShadow",width:`${830/16}rem`,...t})})})})})}));exports.ModalLayout=g;
@@ -1,36 +1,16 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import "react";
3
- import e from "prop-types";
4
- import i from "styled-components";
2
+ import a from "styled-components";
5
3
  import { ModalContext as d } from "./ModalContext.js";
6
- import { DismissibleLayer as p } from "../DismissibleLayer/index.js";
4
+ import { DismissibleLayer as n } from "../DismissibleLayer/index.js";
7
5
  import l from "../hooks/useLockScroll.js";
8
- import { Flex as m } from "../Flex/Flex.js";
9
- import { Box as s } from "../Box/Box.js";
10
- import { Portal as u } from "../Portal/Portal.js";
11
- import { FocusTrap as c } from "../FocusTrap/FocusTrap.js";
12
- const f = i(m)`
13
- inset: 0;
6
+ import { Flex as p } from "../Flex/Flex.js";
7
+ import { Portal as m } from "../Portal/Portal.js";
8
+ import { FocusTrap as s } from "../FocusTrap/FocusTrap.js";
9
+ import { Box as c } from "../Box/Box.js";
10
+ const u = a(p)`
14
11
  background: ${({ theme: r }) => `${r.colors.neutral800}1F`};
15
- `, h = i(s)`
16
- width: ${830 / 16}rem;
17
- `, y = ({ onClose: r, labelledBy: t, ...n }) => (l(!0), /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(d.Provider, { value: r, children: /* @__PURE__ */ o(f, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: 4, children: /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(p, { onEscapeKeyDown: r, onPointerDownOutside: r, children: /* @__PURE__ */ o(
18
- h,
19
- {
20
- "aria-labelledby": t,
21
- onClick: (a) => a.stopPropagation(),
22
- background: "neutral0",
23
- hasRadius: !0,
24
- shadow: "popupShadow",
25
- role: "dialog",
26
- "aria-modal": !0,
27
- ...n
28
- }
29
- ) }) }) }) }) }));
30
- y.propTypes = {
31
- labelledBy: e.string.isRequired,
32
- onClose: e.func.isRequired
33
- };
12
+ inset: 0;
13
+ `, P = ({ onClose: r, labelledBy: t, ...i }) => (l(!0), o(m, { children: o(d.Provider, { value: r, children: o(u, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: 4, children: o(s, { children: o(n, { onEscapeKeyDown: r, onPointerDownOutside: r, children: o(c, { "aria-labelledby": t, "aria-modal": !0, onClick: (e) => e.stopPropagation(), background: "neutral0", hasRadius: !0, role: "dialog", shadow: "popupShadow", width: `${830 / 16}rem`, ...i }) }) }) }) }) }));
34
14
  export {
35
- y as ModalLayout
15
+ P as ModalLayout
36
16
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("react"),x=require("@internationalized/number"),q=require("@strapi/icons"),$=require("prop-types"),z=require("styled-components"),B=require("../helpers/getDefaultLocale.cjs"),N=require("../helpers/keyboardKeys.cjs"),E=require("../hooks/useControllableState.cjs"),M=require("../hooks/useId.cjs"),U=require("../themes/sizes.cjs"),H=require("../Field/Field.cjs"),W=require("../Flex/Flex.cjs"),X=require("../Field/FieldLabel.cjs"),Y=require("../Field/FieldInput.cjs"),v=require("../Icon/Icon.cjs"),G=require("../Field/FieldHint.cjs"),J=require("../Field/FieldError.cjs"),m=r=>r&&r.__esModule?r:{default:r},Q=m(f),t=m($),Z=m(z),I=Z.default.button`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),x=require("@internationalized/number"),g=require("@strapi/icons"),v=require("styled-components"),M=require("../helpers/getDefaultLocale.cjs"),h=require("../helpers/keyboardKeys.cjs"),B=require("../hooks/useControllableState.cjs"),E=require("../hooks/useId.cjs"),U=require("../Field/Field.cjs"),H=require("../Flex/Flex.cjs"),O=require("../Field/FieldLabel.cjs"),T=require("../Field/FieldInput.cjs"),N=require("../Icon/Icon.cjs"),z=require("../Field/FieldHint.cjs"),W=require("../Field/FieldError.cjs"),q=r=>r&&r.__esModule?r:{default:r},X=q(l),Y=q(v),y=Y.default.button`
2
2
  display: flex;
3
3
  height: 1rem;
4
4
  align-items: ${({reverse:r})=>r?"flex-end":"flex-start"};
@@ -9,4 +9,4 @@
9
9
  height: ${4/16}rem;
10
10
  transform: ${({reverse:r})=>r?"rotateX(180deg)":void 0};
11
11
  }
12
- `,ee="",c=Q.default.forwardRef(({size:r,startAction:F,name:w,hint:j,error:D,label:p,labelAction:A,locale:V,id:C,onValueChange:R,value:b,step:s,required:_,disabled:u,...P},k)=>{const K=M.useId(C),g=V||B.getDefaultLocale(),l=f.useRef(new x.NumberParser(g,{style:"decimal"})),d=f.useRef(new x.NumberFormatter(g,{maximumFractionDigits:20})),[o,S]=E.useControllableState({prop(e){const a=String(b);return isNaN(a)||a!==e&&e!==""?e:d.current.format(b)},defaultProp:ee,onChange(e){const a=l.current.parse(e);R(isNaN(a)?void 0:a)}}),i=e=>{S(String(e))},L=({target:{value:e}})=>{l.current.isValidPartialNumber(e)&&i(e)},y=()=>{if(!o){i(s);return}const e=l.current.parse(o),a=isNaN(e)?s:e+s;i(d.current.format(a))},h=()=>{if(!o){i(-s);return}const e=l.current.parse(o),a=isNaN(e)?-s:e-s;i(d.current.format(a))},O=e=>{if(!u)switch(e.key){case N.KeyboardKeys.DOWN:{e.preventDefault(),h();break}case N.KeyboardKeys.UP:{e.preventDefault(),y();break}}},T=()=>{if(o){const e=l.current.parse(o),a=isNaN(e)?"":d.current.format(e);i(a)}};return n.jsx(H.Field,{name:w,hint:j,error:D,id:K,required:_,children:n.jsxs(W.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[p&&n.jsx(X.FieldLabel,{action:A,children:p}),n.jsx(Y.FieldInput,{ref:k,startAction:F,disabled:u,type:"text",inputmode:"decimal",onChange:L,onKeyDown:O,onBlur:T,value:o,size:r,endAction:n.jsxs(n.Fragment,{children:[n.jsx(I,{disabled:u,"aria-hidden":!0,reverse:!0,onClick:y,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:n.jsx(v.Icon,{as:q.CarretDown,color:"neutral500"})}),n.jsx(I,{disabled:u,"aria-hidden":!0,onClick:h,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:n.jsx(v.Icon,{as:q.CarretDown,color:"neutral500"})})]}),...P}),n.jsx(G.FieldHint,{}),n.jsx(J.FieldError,{})]})})});c.displayName="NumberInput";c.defaultProps={"aria-label":void 0,disabled:!1,error:void 0,hint:void 0,id:void 0,label:void 0,labelAction:void 0,locale:void 0,required:!1,size:"M",startAction:void 0,step:1,value:void 0};c.propTypes={"aria-label":t.default.string,disabled:t.default.bool,error:t.default.string,hint:t.default.oneOfType([t.default.string,t.default.node,t.default.arrayOf(t.default.node)]),id:t.default.string,label:t.default.string,labelAction:t.default.element,locale:t.default.string,name:t.default.string.isRequired,onValueChange:t.default.func.isRequired,required:t.default.bool,size:t.default.oneOf(Object.keys(U.sizes.input)),startAction:t.default.element,step:t.default.number,value:t.default.number};exports.NumberInput=c;
12
+ `,G="",J=X.default.forwardRef(({size:r="M",startAction:I,name:F,hint:w,error:j,label:d,labelAction:D,locale:V,id:C,onValueChange:A,value:f,step:a=1,required:R=!1,disabled:u=!1,..._},k)=>{const K=E.useId(C),m=V||M.getDefaultLocale(),i=l.useRef(new x.NumberParser(m,{style:"decimal"})),c=l.useRef(new x.NumberFormatter(m,{maximumFractionDigits:20})),[o,S]=B.useControllableState({prop(e){const n=String(f);return isNaN(Number(n))||n!==e&&e!==""?e:c.current.format(Number(f))},defaultProp:G,onChange(e){const n=i.current.parse(e??"");A(isNaN(n)?void 0:n)}}),s=e=>{S(String(e))},L=({target:{value:e}})=>{i.current.isValidPartialNumber(e)&&s(e)},b=()=>{if(!o){s(a);return}const e=i.current.parse(o),n=isNaN(e)?a:e+a;s(c.current.format(n))},p=()=>{if(!o){s(-a);return}const e=i.current.parse(o),n=isNaN(e)?-a:e-a;s(c.current.format(n))},P=e=>{if(!u)switch(e.key){case h.KeyboardKeys.DOWN:{e.preventDefault(),p();break}case h.KeyboardKeys.UP:{e.preventDefault(),b();break}}},$=()=>{if(o){const e=i.current.parse(o),n=isNaN(e)?"":c.current.format(e);s(n)}};return t.jsx(U.Field,{name:F,hint:w,error:j,id:K,required:R,children:t.jsxs(H.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[d&&t.jsx(O.FieldLabel,{action:D,children:d}),t.jsx(T.FieldInput,{ref:k,startAction:I,disabled:u,type:"text",inputMode:"decimal",onChange:L,onKeyDown:P,onBlur:$,value:o,size:r,endAction:t.jsxs(t.Fragment,{children:[t.jsx(y,{disabled:u,"aria-hidden":!0,reverse:!0,onClick:b,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:t.jsx(N.Icon,{as:g.CarretDown,color:"neutral500"})}),t.jsx(y,{disabled:u,"aria-hidden":!0,onClick:p,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:t.jsx(N.Icon,{as:g.CarretDown,color:"neutral500"})})]}),..._}),t.jsx(z.FieldHint,{}),t.jsx(W.FieldError,{})]})})});exports.NumberInput=J;
@@ -1,179 +1,79 @@
1
- import { jsx as n, jsxs as h, Fragment as L } from "react/jsx-runtime";
2
- import S, { useRef as y } from "react";
3
- import { NumberParser as T, NumberFormatter as j } from "@internationalized/number";
1
+ import { jsx as n, jsxs as h, Fragment as U } from "react/jsx-runtime";
2
+ import _, { useRef as b } from "react";
3
+ import { NumberParser as j, NumberFormatter as E } from "@internationalized/number";
4
4
  import { CarretDown as N } from "@strapi/icons";
5
- import r from "prop-types";
6
- import z from "styled-components";
7
- import { getDefaultLocale as U } from "../helpers/getDefaultLocale.js";
8
- import { KeyboardKeys as v } from "../helpers/keyboardKeys.js";
9
- import { useControllableState as _ } from "../hooks/useControllableState.js";
10
- import { useId as E } from "../hooks/useId.js";
11
- import { sizes as H } from "../themes/sizes.js";
12
- import { Field as M } from "../Field/Field.js";
13
- import { Flex as W } from "../Flex/Flex.js";
14
- import { FieldLabel as X } from "../Field/FieldLabel.js";
15
- import { FieldInput as Y } from "../Field/FieldInput.js";
5
+ import M from "styled-components";
6
+ import { getDefaultLocale as q } from "../helpers/getDefaultLocale.js";
7
+ import { KeyboardKeys as g } from "../helpers/keyboardKeys.js";
8
+ import { useControllableState as z } from "../hooks/useControllableState.js";
9
+ import { useId as H } from "../hooks/useId.js";
10
+ import { Field as O } from "../Field/Field.js";
11
+ import { Flex as T } from "../Flex/Flex.js";
12
+ import { FieldLabel as W } from "../Field/FieldLabel.js";
13
+ import { FieldInput as X } from "../Field/FieldInput.js";
16
14
  import { Icon as w } from "../Icon/Icon.js";
17
- import { FieldHint as G } from "../Field/FieldHint.js";
18
- import { FieldError as J } from "../Field/FieldError.js";
19
- const x = z.button`
15
+ import { FieldHint as Y } from "../Field/FieldHint.js";
16
+ import { FieldError as G } from "../Field/FieldError.js";
17
+ const x = M.button`
20
18
  display: flex;
21
19
  height: 1rem;
22
- align-items: ${({ reverse: o }) => o ? "flex-end" : "flex-start"};
23
- transform: translateY(${({ reverse: o }) => o ? "-2px" : "2px"});
24
- cursor: ${({ disabled: o }) => o ? "not-allowed" : void 0};
20
+ align-items: ${({ reverse: t }) => t ? "flex-end" : "flex-start"};
21
+ transform: translateY(${({ reverse: t }) => t ? "-2px" : "2px"});
22
+ cursor: ${({ disabled: t }) => t ? "not-allowed" : void 0};
25
23
  svg {
26
24
  display: block;
27
25
  height: ${4 / 16}rem;
28
- transform: ${({ reverse: o }) => o ? "rotateX(180deg)" : void 0};
26
+ transform: ${({ reverse: t }) => t ? "rotateX(180deg)" : void 0};
29
27
  }
30
- `, Q = "", u = S.forwardRef(
31
- ({
32
- size: o,
33
- startAction: I,
34
- name: A,
35
- hint: V,
36
- error: D,
37
- label: c,
38
- labelAction: F,
39
- locale: C,
40
- id: k,
41
- onValueChange: P,
42
- value: p,
43
- step: i,
44
- required: R,
45
- disabled: d,
46
- ...K
47
- }, O) => {
48
- const $ = E(k), f = C || U(), s = y(new T(f, { style: "decimal" })), m = y(new j(f, { maximumFractionDigits: 20 })), [a, q] = _({
49
- prop(e) {
50
- const t = String(p);
51
- return isNaN(t) || t !== e && e !== "" ? e : m.current.format(p);
52
- },
53
- defaultProp: Q,
54
- onChange(e) {
55
- const t = s.current.parse(e);
56
- P(isNaN(t) ? void 0 : t);
57
- }
58
- }), l = (e) => {
59
- q(String(e));
60
- }, B = ({ target: { value: e } }) => {
61
- s.current.isValidPartialNumber(e) && l(e);
62
- }, b = () => {
63
- if (!a) {
64
- l(i);
65
- return;
66
- }
67
- const e = s.current.parse(a), t = isNaN(e) ? i : e + i;
68
- l(m.current.format(t));
69
- }, g = () => {
70
- if (!a) {
71
- l(-i);
72
- return;
73
- }
74
- const e = s.current.parse(a), t = isNaN(e) ? -i : e - i;
75
- l(m.current.format(t));
76
- };
77
- return /* @__PURE__ */ n(M, { name: A, hint: V, error: D, id: $, required: R, children: /* @__PURE__ */ h(W, { direction: "column", alignItems: "stretch", gap: 1, children: [
78
- c && /* @__PURE__ */ n(X, { action: F, children: c }),
79
- /* @__PURE__ */ n(
80
- Y,
81
- {
82
- ref: O,
83
- startAction: I,
84
- disabled: d,
85
- type: "text",
86
- inputmode: "decimal",
87
- onChange: B,
88
- onKeyDown: (e) => {
89
- if (!d)
90
- switch (e.key) {
91
- case v.DOWN: {
92
- e.preventDefault(), g();
93
- break;
94
- }
95
- case v.UP: {
96
- e.preventDefault(), b();
97
- break;
98
- }
99
- }
100
- },
101
- onBlur: () => {
102
- if (a) {
103
- const e = s.current.parse(a), t = isNaN(e) ? "" : m.current.format(e);
104
- l(t);
105
- }
106
- },
107
- value: a,
108
- size: o,
109
- endAction: /* @__PURE__ */ h(L, { children: [
110
- /* @__PURE__ */ n(
111
- x,
112
- {
113
- disabled: d,
114
- "aria-hidden": !0,
115
- reverse: !0,
116
- onClick: b,
117
- tabIndex: -1,
118
- type: "button",
119
- "data-testid": "ArrowUp",
120
- children: /* @__PURE__ */ n(w, { as: N, color: "neutral500" })
121
- }
122
- ),
123
- /* @__PURE__ */ n(
124
- x,
125
- {
126
- disabled: d,
127
- "aria-hidden": !0,
128
- onClick: g,
129
- tabIndex: -1,
130
- type: "button",
131
- "data-testid": "ArrowDown",
132
- children: /* @__PURE__ */ n(w, { as: N, color: "neutral500" })
133
- }
134
- )
135
- ] }),
136
- ...K
28
+ `, J = "", pr = _.forwardRef(({ size: t = "M", startAction: y, name: I, hint: F, error: V, label: c, labelAction: D, locale: A, id: C, onValueChange: k, value: d, step: a = 1, required: P = !1, disabled: m = !1, ...R }, $) => {
29
+ const K = H(C), u = A || q(), s = b(new j(u, { style: "decimal" })), l = b(new E(u, { maximumFractionDigits: 20 })), [o, L] = z({
30
+ prop(r) {
31
+ const e = String(d);
32
+ return isNaN(Number(e)) || e !== r && r !== "" ? r : l.current.format(Number(d));
33
+ },
34
+ defaultProp: J,
35
+ onChange(r) {
36
+ const e = s.current.parse(r ?? "");
37
+ k(isNaN(e) ? void 0 : e);
38
+ }
39
+ }), i = (r) => {
40
+ L(String(r));
41
+ }, S = ({ target: { value: r } }) => {
42
+ s.current.isValidPartialNumber(r) && i(r);
43
+ }, f = () => {
44
+ if (!o) {
45
+ i(a);
46
+ return;
47
+ }
48
+ const r = s.current.parse(o), e = isNaN(r) ? a : r + a;
49
+ i(l.current.format(e));
50
+ }, p = () => {
51
+ if (!o) {
52
+ i(-a);
53
+ return;
54
+ }
55
+ const r = s.current.parse(o), e = isNaN(r) ? -a : r - a;
56
+ i(l.current.format(e));
57
+ }, v = (r) => {
58
+ if (!m)
59
+ switch (r.key) {
60
+ case g.DOWN: {
61
+ r.preventDefault(), p();
62
+ break;
137
63
  }
138
- ),
139
- /* @__PURE__ */ n(G, {}),
140
- /* @__PURE__ */ n(J, {})
141
- ] }) });
142
- }
143
- );
144
- u.displayName = "NumberInput";
145
- u.defaultProps = {
146
- "aria-label": void 0,
147
- disabled: !1,
148
- error: void 0,
149
- hint: void 0,
150
- id: void 0,
151
- label: void 0,
152
- labelAction: void 0,
153
- locale: void 0,
154
- required: !1,
155
- size: "M",
156
- startAction: void 0,
157
- step: 1,
158
- value: void 0
159
- };
160
- u.propTypes = {
161
- "aria-label": r.string,
162
- disabled: r.bool,
163
- error: r.string,
164
- hint: r.oneOfType([r.string, r.node, r.arrayOf(r.node)]),
165
- id: r.string,
166
- label: r.string,
167
- labelAction: r.element,
168
- locale: r.string,
169
- name: r.string.isRequired,
170
- onValueChange: r.func.isRequired,
171
- required: r.bool,
172
- size: r.oneOf(Object.keys(H.input)),
173
- startAction: r.element,
174
- step: r.number,
175
- value: r.number
176
- };
64
+ case g.UP: {
65
+ r.preventDefault(), f();
66
+ break;
67
+ }
68
+ }
69
+ }, B = () => {
70
+ if (o) {
71
+ const r = s.current.parse(o), e = isNaN(r) ? "" : l.current.format(r);
72
+ i(e);
73
+ }
74
+ };
75
+ return n(O, { name: I, hint: F, error: V, id: K, required: P, children: h(T, { direction: "column", alignItems: "stretch", gap: 1, children: [c && n(W, { action: D, children: c }), n(X, { ref: $, startAction: y, disabled: m, type: "text", inputMode: "decimal", onChange: S, onKeyDown: v, onBlur: B, value: o, size: t, endAction: h(U, { children: [n(x, { disabled: m, "aria-hidden": !0, reverse: !0, onClick: f, tabIndex: -1, type: "button", "data-testid": "ArrowUp", children: n(w, { as: N, color: "neutral500" }) }), n(x, { disabled: m, "aria-hidden": !0, onClick: p, tabIndex: -1, type: "button", "data-testid": "ArrowDown", children: n(w, { as: N, color: "neutral500" }) })] }), ...R }), n(Y, {}), n(G, {})] }) });
76
+ });
177
77
  export {
178
- u as NumberInput
78
+ pr as NumberInput
179
79
  };
@@ -1,5 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),p=require("react"),g=require("prop-types"),b=require("styled-components"),P=require("./PaginationContext.cjs"),_=require("../Flex/Flex.cjs"),s=e=>e&&e.__esModule?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 t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const l=m(p),a=s(g),u=s(b),j=u.default.nav``,x=u.default(_.Flex)`
2
- & > * + * {
3
- margin-left: ${({theme:e})=>e.spaces[1]};
4
- }
5
- `,o=({children:e,label:n,activePage:t,pageCount:r})=>{const c=l.useMemo(()=>({activePage:t,pageCount:r}),[t,r]);return i.jsx(P.PaginationContext.Provider,{value:c,children:i.jsx(j,{"aria-label":n,children:i.jsx(x,{as:"ul",children:l.Children.map(e,(d,f)=>i.jsx("li",{children:d},f))})})})};o.defaultProps={label:"pagination"};o.propTypes={activePage:a.default.number.isRequired,children:a.default.node.isRequired,label:a.default.string,pageCount:a.default.number.isRequired};exports.Pagination=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("react"),u=require("./PaginationContext.cjs"),d=require("../Box/Box.cjs"),x=require("../Flex/Flex.cjs");function g(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=g(l),f=({children:e,label:n="Pagination",activePage:t,pageCount:r})=>{const a=i.useMemo(()=>({activePage:t,pageCount:r}),[t,r]);return o.jsx(u.PaginationContext.Provider,{value:a,children:o.jsx(d.Box,{"aria-label":n,as:"nav",children:o.jsx(x.Flex,{as:"ol",gap:1,children:i.Children.map(e,(c,s)=>o.jsx("li",{children:c},s))})})})};exports.Pagination=f;
@@ -1,26 +1,12 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import * as t from "react";
3
- import e from "prop-types";
4
- import a from "styled-components";
2
+ import * as n from "react";
5
3
  import { PaginationContext as c } from "./PaginationContext.js";
6
- import { Flex as u } from "../Flex/Flex.js";
7
- const f = a.nav``, g = a(u)`
8
- & > * + * {
9
- margin-left: ${({ theme: i }) => i.spaces[1]};
10
- }
11
- `, l = ({ children: i, label: s, activePage: n, pageCount: o }) => {
12
- const p = t.useMemo(() => ({ activePage: n, pageCount: o }), [n, o]);
13
- return /* @__PURE__ */ r(c.Provider, { value: p, children: /* @__PURE__ */ r(f, { "aria-label": s, children: /* @__PURE__ */ r(g, { as: "ul", children: t.Children.map(i, (m, d) => /* @__PURE__ */ r("li", { children: m }, d)) }) }) });
14
- };
15
- l.defaultProps = {
16
- label: "pagination"
17
- };
18
- l.propTypes = {
19
- activePage: e.number.isRequired,
20
- children: e.node.isRequired,
21
- label: e.string,
22
- pageCount: e.number.isRequired
4
+ import { Box as p } from "../Box/Box.js";
5
+ import { Flex as s } from "../Flex/Flex.js";
6
+ const u = ({ children: t, label: a = "Pagination", activePage: o, pageCount: i }) => {
7
+ const e = n.useMemo(() => ({ activePage: o, pageCount: i }), [o, i]);
8
+ return r(c.Provider, { value: e, children: r(p, { "aria-label": a, as: "nav", children: r(s, { as: "ol", gap: 1, children: n.Children.map(t, (m, l) => r("li", { children: m }, l)) }) }) });
23
9
  };
24
10
  export {
25
- l as Pagination
11
+ u as Pagination
26
12
  };
@@ -1,22 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const g=require("@strapi/icons"),q=require("prop-types"),j=require("react-router-dom"),k=require("styled-components"),u=require("./PaginationContext.cjs"),L=require("../themes/utils.cjs"),m=require("../Typography/Typography.cjs"),d=require("../VisuallyHidden/VisuallyHidden.cjs"),y=e=>e&&e.__esModule?e:{default:e},a=y(q),n=y(k),f=n.default(m.Typography)`
2
- line-height: revert;
3
- `,T={active:!0},c=n.default(j.NavLink).withConfig({shouldForwardProp:(e,i)=>!T[e]&&i(e)})`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("@strapi/icons"),v=require("react-router-dom"),y=require("styled-components"),d=require("./PaginationContext.cjs"),b=require("../themes/utils.cjs"),o=require("../VisuallyHidden/VisuallyHidden.cjs"),c=require("../Typography/Typography.cjs"),P=require("../Box/Box.cjs"),j=e=>e&&e.__esModule?e:{default:e},l=j(y),k={active:!0},h=l.default(v.NavLink).withConfig({shouldForwardProp:(e,i)=>!k[e]&&i(e)})`
4
2
  padding: ${({theme:e})=>e.spaces[3]};
5
3
  border-radius: ${({theme:e})=>e.borderRadius};
6
4
  box-shadow: ${({active:e,theme:i})=>e?i.shadows.filterShadow:void 0};
7
5
  text-decoration: none;
8
6
  display: flex;
9
7
 
10
- ${L.buttonFocusStyle}
11
- `,$=n.default(c)`
8
+ ${b.buttonFocusStyle}
9
+ `,L=l.default(h)`
12
10
  color: ${({theme:e,active:i})=>i?e.colors.primary700:e.colors.neutral800};
13
11
  background: ${({theme:e,active:i})=>i?e.colors.neutral0:void 0};
14
12
 
15
13
  &:hover {
16
14
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
17
15
  }
18
- `,x=n.default(c)`
19
- font-size: 0.7rem;
16
+ `,g=l.default(h)`
17
+ font-size: ${11/16}rem;
18
+
20
19
  svg path {
21
20
  fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral600};
22
21
  }
@@ -31,6 +30,4 @@
31
30
  ${e=>e["aria-disabled"]?`
32
31
  pointer-events: none;
33
32
  `:void 0}
34
- `,R=n.default(c)`
35
- color: ${({theme:e})=>e.colors.neutral800};
36
- `,p=({children:e,to:i,...o})=>{const{activePage:s}=u.usePagination(),t=s===1;return r.jsxs(x,{to:t?"#":i,"aria-disabled":t,tabIndex:t?-1:void 0,...o,children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(g.ChevronLeft,{"aria-hidden":!0})]})};p.displayName="PreviousLink";const h=({children:e,to:i,...o})=>{const{activePage:s,pageCount:t}=u.usePagination(),l=s===t;return r.jsxs(x,{to:l?"#":i,"aria-disabled":l,tabIndex:l?-1:void 0,...o,children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(g.ChevronRight,{"aria-hidden":!0})]})};h.displayName="NextLink";const v=({number:e,children:i,...o})=>{const{activePage:s}=u.usePagination(),t=s===e;return r.jsxs($,{...o,active:t,children:[r.jsx(d.VisuallyHidden,{children:i}),r.jsx(f,{"aria-hidden":!0,variant:"pi",fontWeight:t?"bold":null,children:e})]})};v.displayName="PageLink";const P=({children:e,...i})=>r.jsxs(R,{...i,as:"div",children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(f,{"aria-hidden":!0,variant:"pi",children:"…"})]});v.propTypes={children:a.default.node.isRequired,number:a.default.number.isRequired};const b={children:a.default.node.isRequired,to:a.default.string.isRequired};h.propTypes=b;p.propTypes=b;P.propTypes={children:a.default.node.isRequired};exports.Dots=P;exports.NextLink=h;exports.PageLink=v;exports.PreviousLink=p;
33
+ `,x=({children:e,to:i,...r})=>{const{activePage:a}=d.usePagination(),t=a===1;return n.jsxs(g,{to:t?"#":i,"aria-disabled":t,tabIndex:t?-1:void 0,...r,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(u.ChevronLeft,{"aria-hidden":!0})]})};x.displayName="PreviousLink";const f=({children:e,to:i,...r})=>{const{activePage:a,pageCount:t}=d.usePagination(),s=a===t;return n.jsxs(g,{to:s?"#":i,"aria-disabled":s,tabIndex:s?-1:void 0,...r,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(u.ChevronRight,{"aria-hidden":!0})]})};f.displayName="NextLink";const p=({number:e,children:i,...r})=>{const{activePage:a}=d.usePagination(),t=a===e;return n.jsxs(L,{...r,active:t,children:[n.jsx(o.VisuallyHidden,{children:i}),n.jsx(c.Typography,{"aria-hidden":!0,fontWeight:t?"bold":void 0,lineHeight:"revert",variant:"pi",children:e})]})};p.displayName="PageLink";const $=({children:e,...i})=>n.jsxs(P.Box,{...i,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(c.Typography,{"aria-hidden":!0,lineHeight:"revert",textColor:"neutral800",variant:"pi",children:"…"})]});exports.Dots=$;exports.NextLink=f;exports.PageLink=p;exports.PreviousLink=x;