@strapi/design-system 1.7.7 → 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 (69) hide show
  1. package/dist/Box/Box.cjs +2 -2
  2. package/dist/Box/Box.js +1 -1
  3. package/dist/Grid/Grid.cjs +3 -3
  4. package/dist/Grid/Grid.js +8 -22
  5. package/dist/Grid/GridItem.cjs +2 -2
  6. package/dist/Grid/GridItem.js +10 -27
  7. package/dist/Layout/ActionLayout.cjs +1 -9
  8. package/dist/Layout/ActionLayout.js +4 -27
  9. package/dist/Layout/ContentLayout.cjs +1 -1
  10. package/dist/Layout/ContentLayout.js +4 -9
  11. package/dist/Layout/GridLayout.cjs +3 -3
  12. package/dist/Layout/GridLayout.js +4 -8
  13. package/dist/Layout/HeaderLayout.cjs +4 -4
  14. package/dist/Layout/HeaderLayout.js +25 -120
  15. package/dist/Layout/Layout.cjs +4 -4
  16. package/dist/Layout/Layout.js +7 -19
  17. package/dist/Layout/TwoColsLayout.cjs +1 -1
  18. package/dist/Layout/TwoColsLayout.js +6 -15
  19. package/dist/Table/Cell.cjs +3 -3
  20. package/dist/Table/Cell.js +10 -23
  21. package/dist/Table/TFooter.cjs +3 -3
  22. package/dist/Table/TFooter.js +8 -20
  23. package/dist/Table/Table.cjs +12 -12
  24. package/dist/Table/Table.js +19 -31
  25. package/dist/Table/Tbody.cjs +2 -2
  26. package/dist/Table/Tbody.js +4 -5
  27. package/dist/Table/Thead.cjs +2 -2
  28. package/dist/Table/Thead.js +6 -7
  29. package/dist/Table/Tr.cjs +1 -1
  30. package/dist/Table/Tr.js +3 -4
  31. package/dist/v2/MainNav/MainNav.cjs +2 -2
  32. package/dist/v2/MainNav/MainNav.js +9 -31
  33. package/dist/v2/MainNav/MainNavContext.cjs +1 -1
  34. package/dist/v2/MainNav/MainNavContext.js +1 -1
  35. package/dist/v2/MainNav/NavBrand.cjs +3 -3
  36. package/dist/v2/MainNav/NavBrand.js +13 -36
  37. package/dist/v2/MainNav/NavCondense.cjs +2 -5
  38. package/dist/v2/MainNav/NavCondense.js +15 -22
  39. package/dist/v2/MainNav/NavFooter.cjs +1 -1
  40. package/dist/v2/MainNav/NavFooter.js +4 -10
  41. package/dist/v2/MainNav/NavLink.cjs +10 -10
  42. package/dist/v2/MainNav/NavLink.js +18 -39
  43. package/dist/v2/MainNav/NavSection.cjs +1 -1
  44. package/dist/v2/MainNav/NavSection.js +8 -42
  45. package/dist/v2/MainNav/NavSections.cjs +2 -2
  46. package/dist/v2/MainNav/NavSections.js +8 -22
  47. package/dist/v2/MainNav/NavUser.cjs +2 -2
  48. package/dist/v2/MainNav/NavUser.js +13 -27
  49. package/dist/v2/Pagination/Pagination.cjs +1 -5
  50. package/dist/v2/Pagination/Pagination.js +7 -21
  51. package/dist/v2/Pagination/components.cjs +7 -10
  52. package/dist/v2/Pagination/components.js +32 -65
  53. package/dist/v2/SubNav/SubNav.cjs +5 -5
  54. package/dist/v2/SubNav/SubNav.js +8 -13
  55. package/dist/v2/SubNav/SubNavHeader.cjs +3 -3
  56. package/dist/v2/SubNav/SubNavHeader.js +30 -77
  57. package/dist/v2/SubNav/SubNavLink.cjs +5 -5
  58. package/dist/v2/SubNav/SubNavLink.js +13 -47
  59. package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
  60. package/dist/v2/SubNav/SubNavLinkSection.js +19 -34
  61. package/dist/v2/SubNav/SubNavSection.cjs +2 -2
  62. package/dist/v2/SubNav/SubNavSection.js +16 -55
  63. package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
  64. package/dist/v2/SubNav/SubNavSectionLabel.js +10 -38
  65. package/dist/v2/SubNav/SubNavSections.cjs +1 -1
  66. package/dist/v2/SubNav/SubNavSections.js +4 -18
  67. package/package.json +4 -4
  68. package/dist/Grid/GridContext.cjs +0 -1
  69. package/dist/Grid/GridContext.js +0 -6
@@ -1,27 +1,26 @@
1
1
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
- import f from "react";
3
- import e from "prop-types";
2
+ import $ from "react";
4
3
  import t from "styled-components";
5
- import { useMainNav as y } from "./MainNavContext.js";
6
- import { Box as b } from "../../Box/Box.js";
4
+ import { useMainNav as f } from "./MainNavContext.js";
5
+ import { Box as g } from "../../Box/Box.js";
7
6
  import { BaseLink as v } from "../../BaseLink/BaseLink.js";
8
- import { Typography as i } from "../../Typography/Typography.js";
9
- import { Flex as $ } from "../../Flex/Flex.js";
10
- import { Badge as k } from "../../Badge/Badge.js";
11
- import { Tooltip as x } from "../../Tooltip/Tooltip.js";
12
- const m = t(b)`
7
+ import { Typography as e } from "../../Typography/Typography.js";
8
+ import { Flex as h } from "../../Flex/Flex.js";
9
+ import { Badge as y } from "../../Badge/Badge.js";
10
+ import { Tooltip as b } from "../../Tooltip/Tooltip.js";
11
+ const p = t(g)`
13
12
  svg {
14
13
  width: 1rem;
15
14
  height: 1rem;
16
15
  }
17
- `, u = t(v)`
16
+ `, d = t(v)`
18
17
  position: relative;
19
18
  text-decoration: none;
20
19
  display: block;
21
20
  border-radius: ${({ theme: r }) => r.borderRadius};
22
21
  background: ${({ theme: r }) => r.colors.neutral0};
23
22
 
24
- ${i} {
23
+ ${e} {
25
24
  color: ${({ theme: r }) => r.colors.neutral600};
26
25
  }
27
26
 
@@ -32,7 +31,7 @@ const m = t(b)`
32
31
  &:hover {
33
32
  background: ${({ theme: r }) => r.colors.neutral100};
34
33
 
35
- ${i} {
34
+ ${e} {
36
35
  color: ${({ theme: r }) => r.colors.neutral700};
37
36
  }
38
37
 
@@ -48,22 +47,22 @@ const m = t(b)`
48
47
  fill: ${({ theme: r }) => r.colors.primary600};
49
48
  }
50
49
 
51
- ${i} {
50
+ ${e} {
52
51
  color: ${({ theme: r }) => r.colors.primary600};
53
52
  font-weight: 500;
54
53
  }
55
54
  }
56
- `, h = t($)`
55
+ `, m = t(h)`
57
56
  padding: ${({ theme: r }) => `${r.spaces[2]} ${r.spaces[3]}`};
58
- `, g = t(k)`
59
- ${({ theme: r, condensed: a }) => a && `
57
+ `, u = t(y)`
58
+ ${({ theme: r, condensed: i }) => i && `
60
59
  position: absolute;
61
60
  // Values based on visual aspect
62
61
  top: -${r.spaces[3]};
63
62
  right: -${r.spaces[1]};
64
63
  `}
65
64
 
66
- ${i} {
65
+ ${e} {
67
66
  //find a solution to remove !important
68
67
  color: ${({ theme: r }) => r.colors.neutral0} !important;
69
68
  line-height: 0;
@@ -77,27 +76,7 @@ const m = t(b)`
77
76
  padding: ${({ theme: r }) => `0 ${r.spaces[2]}`};
78
77
  border-radius: ${({ theme: r }) => r.spaces[10]};
79
78
  background: ${({ theme: r }) => r.colors.primary600};
80
- `, l = f.forwardRef(({ children: r, icon: a, badgeContent: n, badgeAriaLabel: c, ...d }, p) => y() ? /* @__PURE__ */ o(u, { ref: p, ...d, children: /* @__PURE__ */ o(x, { position: "right", label: r, children: /* @__PURE__ */ s(h, { as: "span", justifyContent: "center", children: [
81
- /* @__PURE__ */ o(m, { "aria-hidden": !0, paddingRight: 0, as: "span", children: a }),
82
- n && /* @__PURE__ */ o(g, { condensed: !0, "aria-label": c, children: n })
83
- ] }) }) }) : /* @__PURE__ */ o(u, { ref: p, ...d, children: /* @__PURE__ */ s(h, { as: "span", justifyContent: "space-between", children: [
84
- /* @__PURE__ */ s($, { children: [
85
- /* @__PURE__ */ o(m, { "aria-hidden": !0, paddingRight: 3, as: "span", children: a }),
86
- /* @__PURE__ */ o(i, { children: r })
87
- ] }),
88
- n && /* @__PURE__ */ o(g, { justifyContent: "center", "aria-label": c, children: n })
89
- ] }) }));
90
- l.displayName = "NavLink";
91
- l.defaultProps = {
92
- badgeContent: void 0,
93
- badgeAriaLabel: void 0
94
- };
95
- l.propTypes = {
96
- badgeAriaLabel: e.string,
97
- badgeContent: e.oneOfType([e.string, e.number]),
98
- children: e.string.isRequired,
99
- icon: e.node.isRequired
100
- };
79
+ `, C = $.forwardRef(({ children: r, icon: i, badgeContent: a, badgeAriaLabel: n, ...l }, c) => f() ? o(d, { ref: c, ...l, children: o(b, { position: "right", label: r, children: s(m, { as: "span", justifyContent: "center", children: [o(p, { "aria-hidden": !0, paddingRight: 0, as: "span", children: i }), a && o(u, { condensed: !0, "aria-label": n, children: a })] }) }) }) : o(d, { ref: c, ...l, children: s(m, { as: "span", justifyContent: "space-between", children: [s(h, { children: [o(p, { "aria-hidden": !0, paddingRight: 3, as: "span", children: i }), o(e, { children: r })] }), a && o(u, { justifyContent: "center", "aria-label": n, children: a })] }) }));
101
80
  export {
102
- l as NavLink
81
+ C as NavLink
103
82
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),x=require("prop-types"),g=require("./MainNavContext.cjs"),i=require("../../Flex/Flex.cjs"),l=require("../../Box/Box.cjs"),h=require("../../Divider/Divider.cjs"),m=require("../../VisuallyHidden/VisuallyHidden.cjs"),j=require("../../Typography/Typography.cjs"),q=n=>n&&n.__esModule?n:{default:n},u=q(x),p=({label:n,children:d,horizontal:r=!1,spacing:a=2,...c})=>g.useMainNav()?e.jsxs(i.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsxs(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",hasRadius:!0,as:"span",children:[e.jsx(h.Divider,{}),e.jsx(m.VisuallyHidden,{children:e.jsx("span",{children:n})})]}),e.jsx(i.Flex,{as:"ul",gap:a,direction:r?"row":"column",alignItems:r?"center":"stretch",...c,children:o.Children.map(d,(t,s)=>e.jsx("li",{children:t},s))})]}):e.jsxs(i.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsx(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",paddingRight:3,paddingLeft:3,hasRadius:!0,as:"span",children:e.jsx(j.Typography,{variant:"sigma",textColor:"neutral600",children:n})}),e.jsx(i.Flex,{as:"ul",gap:a,direction:r?"row":"column",alignItems:r?"center":"stretch",...c,children:o.Children.map(d,(t,s)=>e.jsx("li",{children:t},s))})]});p.propTypes={children:u.default.node.isRequired,label:u.default.string.isRequired};exports.NavSection=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),u=require("./MainNavContext.cjs"),r=require("../../Flex/Flex.cjs"),l=require("../../Box/Box.cjs"),x=require("../../Divider/Divider.cjs"),g=require("../../VisuallyHidden/VisuallyHidden.cjs"),p=require("../../Typography/Typography.cjs"),h=({label:s,children:a,horizontal:n=!1,spacing:d=2,...c})=>u.useMainNav()?e.jsxs(r.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsxs(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",hasRadius:!0,as:"span",children:[e.jsx(x.Divider,{}),e.jsx(g.VisuallyHidden,{children:e.jsx("span",{children:s})})]}),e.jsx(r.Flex,{as:"ul",gap:d,direction:n?"row":"column",alignItems:n?"center":"stretch",...c,children:o.Children.map(a,(i,t)=>e.jsx("li",{children:i},t))})]}):e.jsxs(r.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsx(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",paddingRight:3,paddingLeft:3,hasRadius:!0,as:"span",children:e.jsx(p.Typography,{variant:"sigma",textColor:"neutral600",children:s})}),e.jsx(r.Flex,{as:"ul",gap:d,direction:n?"row":"column",alignItems:n?"center":"stretch",...c,children:o.Children.map(a,(i,t)=>e.jsx("li",{children:i},t))})]});exports.NavSection=h;
@@ -1,46 +1,12 @@
1
1
  import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
- import { Children as m } from "react";
3
- import p from "prop-types";
4
- import { useMainNav as u } from "./MainNavContext.js";
5
- import { Flex as i } from "../../Flex/Flex.js";
2
+ import { Children as s } from "react";
3
+ import { useMainNav as p } from "./MainNavContext.js";
4
+ import { Flex as e } from "../../Flex/Flex.js";
6
5
  import { Box as l } from "../../Box/Box.js";
7
- import { Divider as g } from "../../Divider/Divider.js";
8
- import { VisuallyHidden as h } from "../../VisuallyHidden/VisuallyHidden.js";
9
- import { Typography as f } from "../../Typography/Typography.js";
10
- const x = ({ label: o, children: a, horizontal: e = !1, spacing: s = 2, ...c }) => u() ? /* @__PURE__ */ d(i, { direction: "column", alignItems: "stretch", gap: 2, children: [
11
- /* @__PURE__ */ d(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: !0, as: "span", children: [
12
- /* @__PURE__ */ r(g, {}),
13
- /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r("span", { children: o }) })
14
- ] }),
15
- /* @__PURE__ */ r(
16
- i,
17
- {
18
- as: "ul",
19
- gap: s,
20
- direction: e ? "row" : "column",
21
- alignItems: e ? "center" : "stretch",
22
- ...c,
23
- children: m.map(a, (n, t) => /* @__PURE__ */ r("li", { children: n }, t))
24
- }
25
- )
26
- ] }) : /* @__PURE__ */ d(i, { direction: "column", alignItems: "stretch", gap: 2, children: [
27
- /* @__PURE__ */ r(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: !0, as: "span", children: /* @__PURE__ */ r(f, { variant: "sigma", textColor: "neutral600", children: o }) }),
28
- /* @__PURE__ */ r(
29
- i,
30
- {
31
- as: "ul",
32
- gap: s,
33
- direction: e ? "row" : "column",
34
- alignItems: e ? "center" : "stretch",
35
- ...c,
36
- children: m.map(a, (n, t) => /* @__PURE__ */ r("li", { children: n }, t))
37
- }
38
- )
39
- ] });
40
- x.propTypes = {
41
- children: p.node.isRequired,
42
- label: p.string.isRequired
43
- };
6
+ import { Divider as u } from "../../Divider/Divider.js";
7
+ import { VisuallyHidden as g } from "../../VisuallyHidden/VisuallyHidden.js";
8
+ import { Typography as h } from "../../Typography/Typography.js";
9
+ const k = ({ label: o, children: a, horizontal: n = !1, spacing: c = 2, ...m }) => p() ? d(e, { direction: "column", alignItems: "stretch", gap: 2, children: [d(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: !0, as: "span", children: [r(u, {}), r(g, { children: r("span", { children: o }) })] }), r(e, { as: "ul", gap: c, direction: n ? "row" : "column", alignItems: n ? "center" : "stretch", ...m, children: s.map(a, (i, t) => r("li", { children: i }, t)) })] }) : d(e, { direction: "column", alignItems: "stretch", gap: 2, children: [r(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: !0, as: "span", children: r(h, { variant: "sigma", textColor: "neutral600", children: o }) }), r(e, { as: "ul", gap: c, direction: n ? "row" : "column", alignItems: n ? "center" : "stretch", ...m, children: s.map(a, (i, t) => r("li", { children: i }, t)) })] });
44
10
  export {
45
- x as NavSection
11
+ k as NavSection
46
12
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),u=require("prop-types"),a=require("styled-components"),p=require("../../Box/Box.cjs"),f=require("../../Flex/Flex.cjs"),o=e=>e&&e.__esModule?e:{default:e},g=o(u),x=o(a),y=x.default(p.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),c=require("styled-components"),d=require("../../Box/Box.cjs"),u=require("../../Flex/Flex.cjs"),a=e=>e&&e.__esModule?e:{default:e},g=a(c),x=g.default(d.Box)`
2
2
  flex-grow: 1;
3
3
  overflow-y: auto;
4
- `,n=({children:e,spacing:s=4,horizontal:r=!1,...i})=>t.jsx(y,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8,children:t.jsx(f.Flex,{as:"ul",gap:s,direction:r?"row":"column",alignItems:r?"center":"stretch",...i,children:c.Children.map(e,(d,l)=>t.jsx("li",{children:d},l))})});n.propTypes={children:g.default.node.isRequired};exports.NavSections=n;
4
+ `,f=({children:e,spacing:r=4,horizontal:o=!1,...n})=>t.jsx(x,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8,children:t.jsx(u.Flex,{as:"ul",gap:r,direction:o?"row":"column",alignItems:o?"center":"stretch",...n,children:l.Children.map(e,(i,s)=>t.jsx("li",{children:i},s))})});exports.NavSections=f;
@@ -1,26 +1,12 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { Children as d } from "react";
3
- import m from "prop-types";
4
- import l from "styled-components";
5
- import { Box as s } from "../../Box/Box.js";
6
- import { Flex as c } from "../../Flex/Flex.js";
7
- const a = l(s)`
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Children as m } from "react";
3
+ import p from "styled-components";
4
+ import { Box as l } from "../../Box/Box.js";
5
+ import { Flex as a } from "../../Flex/Flex.js";
6
+ const c = p(l)`
8
7
  flex-grow: 1;
9
8
  overflow-y: auto;
10
- `, f = ({ children: e, spacing: i = 4, horizontal: o = !1, ...t }) => /* @__PURE__ */ r(a, { paddingLeft: 3, paddingRight: 2, paddingTop: 3, paddingBottom: 8, children: /* @__PURE__ */ r(
11
- c,
12
- {
13
- as: "ul",
14
- gap: i,
15
- direction: o ? "row" : "column",
16
- alignItems: o ? "center" : "stretch",
17
- ...t,
18
- children: d.map(e, (p, n) => /* @__PURE__ */ r("li", { children: p }, n))
19
- }
20
- ) });
21
- f.propTypes = {
22
- children: m.node.isRequired
23
- };
9
+ `, u = ({ children: t, spacing: e = 4, horizontal: r = !1, ...i }) => o(c, { paddingLeft: 3, paddingRight: 2, paddingTop: 3, paddingBottom: 8, children: o(a, { as: "ul", gap: e, direction: r ? "row" : "column", alignItems: r ? "center" : "stretch", ...i, children: m.map(t, (n, d) => o("li", { children: n }, d)) }) });
24
10
  export {
25
- f as NavSections
11
+ u as NavSections
26
12
  };
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),p=require("react"),x=require("prop-types"),f=require("styled-components"),y=require("./MainNavContext.cjs"),d=require("../../Box/Box.cjs"),v=require("../../Flex/Flex.cjs"),a=require("../../Avatar/Avatar.cjs"),g=require("../../VisuallyHidden/VisuallyHidden.cjs"),j=require("../../Typography/Typography.cjs"),i=e=>e&&e.__esModule?e:{default:e},q=i(p),s=i(x),h=i(f),_=h.default(d.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),c=require("styled-components"),x=require("./MainNavContext.cjs"),i=require("../../Box/Box.cjs"),p=require("../../Flex/Flex.cjs"),s=require("../../Avatar/Avatar.cjs"),f=require("../../VisuallyHidden/VisuallyHidden.cjs"),h=require("../../Typography/Typography.cjs"),o=e=>e&&e.__esModule?e:{default:e},j=o(u),y=o(c),g=y.default(i.Box)`
2
2
  border-top: 1px solid ${({theme:e})=>e.colors.neutral150};
3
- `,r=q.default.forwardRef(({src:e,children:n,initials:l,...u},c)=>{const o=y.useMainNav();return t.jsx(_,{paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5,...u,children:t.jsxs(v.Flex,{as:"button",justifyContent:o?"center":void 0,ref:c,children:[e?t.jsx(a.Avatar,{src:e,alt:"","aria-hidden":!0}):t.jsx(a.Initials,{children:l}),o?t.jsx(g.VisuallyHidden,{children:t.jsx("span",{children:n})}):t.jsx(d.Box,{width:`${130/16}rem`,paddingLeft:2,as:"span",children:t.jsx(j.Typography,{ellipsis:!0,textColor:"neutral600",children:n})})]})})});r.displayName="NavUser";r.defaultProps={src:void 0,initials:void 0};r.propTypes={children:s.default.node.isRequired,initials:s.default.node,src:s.default.string};exports.NavUser=r;
3
+ `,q=j.default.forwardRef(({src:e,children:r,initials:a,...d},l)=>{const n=x.useMainNav();return t.jsx(g,{paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5,...d,children:t.jsxs(p.Flex,{as:"button",justifyContent:n?"center":void 0,ref:l,children:[e?t.jsx(s.Avatar,{src:e,alt:"","aria-hidden":!0}):t.jsx(s.Initials,{children:a}),n?t.jsx(f.VisuallyHidden,{children:t.jsx("span",{children:r})}):t.jsx(i.Box,{width:`${130/16}rem`,paddingLeft:2,as:"span",children:t.jsx(h.Typography,{ellipsis:!0,textColor:"neutral600",children:r})})]})})});exports.NavUser=q;
@@ -1,32 +1,18 @@
1
- import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
- import m from "react";
3
- import i from "prop-types";
4
- import f from "styled-components";
5
- import { useMainNav as c } from "./MainNavContext.js";
6
- import { Box as n } from "../../Box/Box.js";
7
- import { Flex as u } from "../../Flex/Flex.js";
8
- import { Avatar as h, Initials as g } from "../../Avatar/Avatar.js";
9
- import { VisuallyHidden as v } from "../../VisuallyHidden/VisuallyHidden.js";
1
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
+ import s from "react";
3
+ import l from "styled-components";
4
+ import { useMainNav as m } from "./MainNavContext.js";
5
+ import { Box as i } from "../../Box/Box.js";
6
+ import { Flex as f } from "../../Flex/Flex.js";
7
+ import { Avatar as c, Initials as u } from "../../Avatar/Avatar.js";
8
+ import { VisuallyHidden as h } from "../../VisuallyHidden/VisuallyHidden.js";
10
9
  import { Typography as x } from "../../Typography/Typography.js";
11
- const y = f(n)`
10
+ const g = l(i)`
12
11
  border-top: 1px solid ${({ theme: o }) => o.colors.neutral150};
13
- `, t = m.forwardRef(({ src: o, children: e, initials: a, ...s }, p) => {
14
- const d = c();
15
- return /* @__PURE__ */ r(y, { paddingTop: 3, paddingBottom: 3, paddingLeft: 5, paddingRight: 5, ...s, children: /* @__PURE__ */ l(u, { as: "button", justifyContent: d ? "center" : void 0, ref: p, children: [
16
- o ? /* @__PURE__ */ r(h, { src: o, alt: "", "aria-hidden": !0 }) : /* @__PURE__ */ r(g, { children: a }),
17
- d ? /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r("span", { children: e }) }) : /* @__PURE__ */ r(n, { width: `${130 / 16}rem`, paddingLeft: 2, as: "span", children: /* @__PURE__ */ r(x, { ellipsis: !0, textColor: "neutral600", children: e }) })
18
- ] }) });
12
+ `, L = s.forwardRef(({ src: o, children: t, initials: n, ...d }, a) => {
13
+ const e = m();
14
+ return r(g, { paddingTop: 3, paddingBottom: 3, paddingLeft: 5, paddingRight: 5, ...d, children: p(f, { as: "button", justifyContent: e ? "center" : void 0, ref: a, children: [o ? r(c, { src: o, alt: "", "aria-hidden": !0 }) : r(u, { children: n }), e ? r(h, { children: r("span", { children: t }) }) : r(i, { width: `${130 / 16}rem`, paddingLeft: 2, as: "span", children: r(x, { ellipsis: !0, textColor: "neutral600", children: t }) })] }) });
19
15
  });
20
- t.displayName = "NavUser";
21
- t.defaultProps = {
22
- src: void 0,
23
- initials: void 0
24
- };
25
- t.propTypes = {
26
- children: i.node.isRequired,
27
- initials: i.node,
28
- src: i.string
29
- };
30
16
  export {
31
- t as NavUser
17
+ L as NavUser
32
18
  };
@@ -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"),L=require("react"),g=require("@strapi/icons"),j=require("prop-types"),q=require("styled-components"),u=require("./PaginationContext.cjs"),R=require("../../themes/utils.cjs"),m=require("../../Typography/Typography.cjs"),w=require("../../BaseLink/BaseLink.cjs"),l=require("../../VisuallyHidden/VisuallyHidden.cjs"),c=e=>e&&e.__esModule?e:{default:e},p=c(L),d=c(j),n=c(q),x=n.default(m.Typography)`
2
- line-height: revert;
3
- `,T={active:!0},h=n.default(w.BaseLink).withConfig({shouldForwardProp:(e,i)=>!T[e]&&i(e)})`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),p=require("react"),c=require("@strapi/icons"),v=require("styled-components"),d=require("./PaginationContext.cjs"),y=require("../../themes/utils.cjs"),b=require("../../BaseLink/BaseLink.cjs"),s=require("../../VisuallyHidden/VisuallyHidden.cjs"),h=require("../../Typography/Typography.cjs"),P=require("../../Box/Box.cjs"),f=e=>e&&e.__esModule?e:{default:e},l=f(p),u=f(v),j={active:!0},g=u.default(b.BaseLink).withConfig({shouldForwardProp:(e,i)=>!j[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
- ${R.buttonFocusStyle}
11
- `,$=n.default(h)`
8
+ ${y.buttonFocusStyle}
9
+ `,k=u.default(g)`
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
- `,P=n.default(h)`
19
- font-size: 0.7rem;
16
+ `,x=u.default(g)`
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
- `,_=n.default(h)`
35
- color: ${({theme:e})=>e.colors.neutral800};
36
- `,f=p.default.forwardRef(({children:e,...i},a)=>{const{activePage:s}=u.usePagination(),t=s===1;return r.jsxs(P,{ref:a,"aria-disabled":t,tabIndex:t?-1:void 0,...i,children:[r.jsx(l.VisuallyHidden,{children:e}),r.jsx(g.ChevronLeft,{"aria-hidden":!0})]})});f.displayName="PreviousLink";const v=p.default.forwardRef(({children:e,...i},a)=>{const{activePage:s,pageCount:t}=u.usePagination(),o=s===t;return r.jsxs(P,{ref:a,"aria-disabled":o,tabIndex:o?-1:void 0,...i,children:[r.jsx(l.VisuallyHidden,{children:e}),r.jsx(g.ChevronRight,{"aria-hidden":!0})]})});v.displayName="NextLink";const y=p.default.forwardRef(({number:e,children:i,...a},s)=>{const{activePage:t}=u.usePagination(),o=t===e;return r.jsxs($,{ref:s,...a,active:o,children:[r.jsx(l.VisuallyHidden,{children:i}),r.jsx(x,{"aria-hidden":!0,variant:"pi",fontWeight:o?"bold":null,children:e})]})});y.displayName="PageLink";const b=({children:e,...i})=>r.jsxs(_,{...i,as:"div",children:[r.jsx(l.VisuallyHidden,{children:e}),r.jsx(x,{"aria-hidden":!0,variant:"pi",children:"…"})]});y.propTypes={children:d.default.node.isRequired,number:d.default.number.isRequired};const k={children:d.default.node.isRequired};v.propTypes=k;f.propTypes=k;b.propTypes={children:d.default.node.isRequired};exports.Dots=b;exports.NextLink=v;exports.PageLink=y;exports.PreviousLink=f;
33
+ `,L=l.default.forwardRef(({children:e,...i},t)=>{const{activePage:a}=d.usePagination(),r=a===1;return n.jsxs(x,{ref:t,"aria-disabled":r,tabIndex:r?-1:void 0,...i,children:[n.jsx(s.VisuallyHidden,{children:e}),n.jsx(c.ChevronLeft,{"aria-hidden":!0})]})}),w=l.default.forwardRef(({children:e,...i},t)=>{const{activePage:a,pageCount:r}=d.usePagination(),o=a===r;return n.jsxs(x,{ref:t,"aria-disabled":o,tabIndex:o?-1:void 0,...i,children:[n.jsx(s.VisuallyHidden,{children:e}),n.jsx(c.ChevronRight,{"aria-hidden":!0})]})}),$=l.default.forwardRef(({number:e,children:i,...t},a)=>{const{activePage:r}=d.usePagination(),o=r===e;return n.jsxs(k,{ref:a,...t,active:o,children:[n.jsx(s.VisuallyHidden,{children:i}),n.jsx(h.Typography,{"aria-hidden":!0,fontWeight:o?"bold":void 0,lineHeight:"revert",variant:"pi",children:e})]})}),q=({children:e,...i})=>n.jsxs(P.Box,{...i,children:[n.jsx(s.VisuallyHidden,{children:e}),n.jsx(h.Typography,{"aria-hidden":!0,lineHeight:"revert",textColor:"neutral800",variant:"pi",children:"…"})]});exports.Dots=q;exports.NextLink=w;exports.PageLink=$;exports.PreviousLink=L;
@@ -1,19 +1,17 @@
1
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import p from "react";
3
- import { ChevronLeft as P, ChevronRight as x } from "@strapi/icons";
4
- import d from "prop-types";
5
- import s from "styled-components";
6
- import { usePagination as h } from "./PaginationContext.js";
7
- import { buttonFocusStyle as k } from "../../themes/utils.js";
8
- import { Typography as w } from "../../Typography/Typography.js";
9
- import { BaseLink as L } from "../../BaseLink/BaseLink.js";
10
- import { VisuallyHidden as c } from "../../VisuallyHidden/VisuallyHidden.js";
11
- const m = s(w)`
12
- line-height: revert;
13
- `, $ = {
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { ChevronLeft as m, ChevronRight as v } from "@strapi/icons";
4
+ import c from "styled-components";
5
+ import { usePagination as f } from "./PaginationContext.js";
6
+ import { buttonFocusStyle as g } from "../../themes/utils.js";
7
+ import { BaseLink as b } from "../../BaseLink/BaseLink.js";
8
+ import { VisuallyHidden as s } from "../../VisuallyHidden/VisuallyHidden.js";
9
+ import { Typography as h } from "../../Typography/Typography.js";
10
+ import { Box as x } from "../../Box/Box.js";
11
+ const w = {
14
12
  active: !0
15
- }, u = s(L).withConfig({
16
- shouldForwardProp: (e, r) => !$[e] && r(e)
13
+ }, u = c(b).withConfig({
14
+ shouldForwardProp: (e, r) => !w[e] && r(e)
17
15
  })`
18
16
  padding: ${({ theme: e }) => e.spaces[3]};
19
17
  border-radius: ${({ theme: e }) => e.borderRadius};
@@ -21,16 +19,17 @@ const m = s(w)`
21
19
  text-decoration: none;
22
20
  display: flex;
23
21
 
24
- ${k}
25
- `, R = s(u)`
22
+ ${g}
23
+ `, $ = c(u)`
26
24
  color: ${({ theme: e, active: r }) => r ? e.colors.primary700 : e.colors.neutral800};
27
25
  background: ${({ theme: e, active: r }) => r ? e.colors.neutral0 : void 0};
28
26
 
29
27
  &:hover {
30
28
  box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
31
29
  }
32
- `, f = s(u)`
33
- font-size: 0.7rem;
30
+ `, p = c(u)`
31
+ font-size: ${11 / 16}rem;
32
+
34
33
  svg path {
35
34
  fill: ${(e) => e["aria-disabled"] ? e.theme.colors.neutral300 : e.theme.colors.neutral600};
36
35
  }
@@ -45,51 +44,19 @@ const m = s(w)`
45
44
  ${(e) => e["aria-disabled"] ? `
46
45
  pointer-events: none;
47
46
  ` : void 0}
48
- `, T = s(u)`
49
- color: ${({ theme: e }) => e.colors.neutral800};
50
- `, v = p.forwardRef(({ children: e, ...r }, a) => {
51
- const { activePage: t } = h(), i = t === 1;
52
- return /* @__PURE__ */ l(f, { ref: a, "aria-disabled": i, tabIndex: i ? -1 : void 0, ...r, children: [
53
- /* @__PURE__ */ o(c, { children: e }),
54
- /* @__PURE__ */ o(P, { "aria-hidden": !0 })
55
- ] });
56
- });
57
- v.displayName = "PreviousLink";
58
- const g = p.forwardRef(({ children: e, ...r }, a) => {
59
- const { activePage: t, pageCount: i } = h(), n = t === i;
60
- return /* @__PURE__ */ l(f, { ref: a, "aria-disabled": n, tabIndex: n ? -1 : void 0, ...r, children: [
61
- /* @__PURE__ */ o(c, { children: e }),
62
- /* @__PURE__ */ o(x, { "aria-hidden": !0 })
63
- ] });
64
- });
65
- g.displayName = "NextLink";
66
- const b = p.forwardRef(({ number: e, children: r, ...a }, t) => {
67
- const { activePage: i } = h(), n = i === e;
68
- return /* @__PURE__ */ l(R, { ref: t, ...a, active: n, children: [
69
- /* @__PURE__ */ o(c, { children: r }),
70
- /* @__PURE__ */ o(m, { "aria-hidden": !0, variant: "pi", fontWeight: n ? "bold" : null, children: e })
71
- ] });
72
- });
73
- b.displayName = "PageLink";
74
- const N = ({ children: e, ...r }) => /* @__PURE__ */ l(T, { ...r, as: "div", children: [
75
- /* @__PURE__ */ o(c, { children: e }),
76
- /* @__PURE__ */ o(m, { "aria-hidden": !0, variant: "pi", children: "…" })
77
- ] });
78
- b.propTypes = {
79
- children: d.node.isRequired,
80
- number: d.number.isRequired
81
- };
82
- const y = {
83
- children: d.node.isRequired
84
- };
85
- g.propTypes = y;
86
- v.propTypes = y;
87
- N.propTypes = {
88
- children: d.node.isRequired
89
- };
47
+ `, A = l.forwardRef(({ children: e, ...r }, t) => {
48
+ const { activePage: n } = f(), i = n === 1;
49
+ return d(p, { ref: t, "aria-disabled": i, tabIndex: i ? -1 : void 0, ...r, children: [o(s, { children: e }), o(m, { "aria-hidden": !0 })] });
50
+ }), B = l.forwardRef(({ children: e, ...r }, t) => {
51
+ const { activePage: n, pageCount: i } = f(), a = n === i;
52
+ return d(p, { ref: t, "aria-disabled": a, tabIndex: a ? -1 : void 0, ...r, children: [o(s, { children: e }), o(v, { "aria-hidden": !0 })] });
53
+ }), F = l.forwardRef(({ number: e, children: r, ...t }, n) => {
54
+ const { activePage: i } = f(), a = i === e;
55
+ return d($, { ref: n, ...t, active: a, children: [o(s, { children: r }), o(h, { "aria-hidden": !0, fontWeight: a ? "bold" : void 0, lineHeight: "revert", variant: "pi", children: e })] });
56
+ }), I = ({ children: e, ...r }) => d(x, { ...r, children: [o(s, { children: e }), o(h, { "aria-hidden": !0, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })] });
90
57
  export {
91
- N as Dots,
92
- g as NextLink,
93
- b as PageLink,
94
- v as PreviousLink
58
+ I as Dots,
59
+ B as NextLink,
60
+ F as PageLink,
61
+ A as PreviousLink
95
62
  };
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("react");const u=require("prop-types"),a=require("styled-components"),n=require("../../Grid/Grid.cjs"),t=e=>e&&e.__esModule?e:{default:e},l=t(u),d=t(a),r=`${232/16}rem`,c=d.default(n.Grid)`
2
- width: ${r};
3
- background: ${({theme:e})=>e.colors.neutral100};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("styled-components"),u=require("../../Grid/Grid.cjs"),a=t=>t&&t.__esModule?t:{default:t},i=a(s),e=`${232/16}rem`,n=i.default(u.Grid)`
2
+ width: ${e};
3
+ background: ${({theme:t})=>t.colors.neutral100};
4
4
  position: sticky;
5
5
  top: 0;
6
6
  height: 100vh;
7
7
  overflow-y: auto;
8
- border-right: 1px solid ${({theme:e})=>e.colors.neutral200};
8
+ border-right: 1px solid ${({theme:t})=>t.colors.neutral200};
9
9
  z-index: 1;
10
- `,o=({ariaLabel:e,...s})=>i.jsx(c,{"aria-label":e,as:"nav",...s});o.propTypes={ariaLabel:l.default.string.isRequired};exports.SubNav=o;exports.subNavWidth=r;
10
+ `,l=({ariaLabel:t,...r})=>o.jsx(n,{"aria-label":t,as:"nav",...r});exports.SubNav=l;exports.subNavWidth=e;
@@ -1,22 +1,17 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import "react";
3
- import i from "prop-types";
4
- import e from "styled-components";
2
+ import i from "styled-components";
5
3
  import { Grid as a } from "../../Grid/Grid.js";
6
- const p = `${232 / 16}rem`, s = e(a)`
7
- width: ${p};
8
- background: ${({ theme: r }) => r.colors.neutral100};
4
+ const e = `${232 / 16}rem`, s = i(a)`
5
+ width: ${e};
6
+ background: ${({ theme: o }) => o.colors.neutral100};
9
7
  position: sticky;
10
8
  top: 0;
11
9
  height: 100vh;
12
10
  overflow-y: auto;
13
- border-right: 1px solid ${({ theme: r }) => r.colors.neutral200};
11
+ border-right: 1px solid ${({ theme: o }) => o.colors.neutral200};
14
12
  z-index: 1;
15
- `, n = ({ ariaLabel: r, ...o }) => /* @__PURE__ */ t(s, { "aria-label": r, as: "nav", ...o });
16
- n.propTypes = {
17
- ariaLabel: i.string.isRequired
18
- };
13
+ `, d = ({ ariaLabel: o, ...r }) => t(s, { "aria-label": o, as: "nav", ...r });
19
14
  export {
20
- n as SubNav,
21
- p as subNavWidth
15
+ d as SubNav,
16
+ e as subNavWidth
22
17
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),R=require("@strapi/icons"),P=require("prop-types"),_=require("styled-components"),D=require("../../helpers/keyboardKeys.cjs"),I=require("../../hooks/useId.cjs"),K=require("../../hooks/usePrevious.cjs"),L=require("../../Divider/Divider.cjs"),c=require("../../Box/Box.cjs"),k=require("../../Searchbar/SearchForm.cjs"),w=require("../../Searchbar/Searchbar.cjs"),F=require("../../Flex/Flex.cjs"),O=require("../../Typography/Typography.cjs"),E=require("../../IconButton/IconButton.cjs"),h=t=>t&&t.__esModule?t:{default:t},r=h(P),H=h(_),p=H.default(L.Divider)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),v=require("@strapi/icons"),C=require("styled-components"),R=require("../../helpers/keyboardKeys.cjs"),T=require("../../hooks/useId.cjs"),D=require("../../hooks/usePrevious.cjs"),I=require("../../Divider/Divider.cjs"),a=require("../../Box/Box.cjs"),K=require("../../Searchbar/SearchForm.cjs"),_=require("../../Searchbar/Searchbar.cjs"),k=require("../../Flex/Flex.cjs"),w=require("../../Typography/Typography.cjs"),F=require("../../IconButton/IconButton.cjs"),O=r=>r&&r.__esModule?r:{default:r},P=O(C),l=P.default(I.Divider)`
2
2
  width: ${24/16}rem;
3
- background-color: ${({theme:t})=>t.colors.neutral200};
4
- `,d=({as:t,label:g,searchLabel:l,searchable:b,onChange:x,value:y,onClear:S,onSubmit:q,id:j})=>{const[s,i]=o.useState(!1),f=K.usePrevious(s),v=I.useId(j),a=o.useRef(),u=o.useRef();o.useEffect(()=>{s&&a.current&&a.current.focus(),f&&!s&&u.current&&u.current.focus()},[s,f]);const B=()=>{i(n=>!n)},m=n=>{S(n),a.current.focus()},C=n=>{n.relatedTarget?.id!==v&&i(!1)},T=n=>{n.key===D.KeyboardKeys.ESCAPE&&i(!1)};return s?e.jsxs(c.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[e.jsx(k.SearchForm,{children:e.jsx(w.Searchbar,{name:"searchbar",value:y,onChange:x,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:T,ref:a,onBlur:C,onClear:m,onSubmit:q,clearLabel:"Clear",size:"S",children:l})}),e.jsx(c.Box,{paddingLeft:2,paddingTop:4,children:e.jsx(p,{})})]}):e.jsxs(c.Box,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[e.jsxs(F.Flex,{justifyContent:"space-between",alignItems:"flex-start",children:[e.jsx(O.Typography,{variant:"beta",as:t,children:g}),b&&e.jsx(E.IconButton,{ref:u,onClick:B,label:l,icon:e.jsx(R.Search,{})})]}),e.jsx(c.Box,{paddingTop:4,children:e.jsx(p,{})})]})};d.defaultProps={as:"h2",searchable:!1,onChange(){},onClear(){},onSubmit(){},value:"",searchLabel:"",id:void 0};d.propTypes={as:r.default.string,id:r.default.string,label:r.default.string.isRequired,onChange:r.default.func,onClear:r.default.func,onSubmit:r.default.func,searchLabel:r.default.string,searchable:r.default.bool,value:r.default.string};exports.SubNavHeader=d;
3
+ background-color: ${({theme:r})=>r.colors.neutral200};
4
+ `,E=({as:r="h2",label:f,searchLabel:u="",searchable:h=!1,onChange:p=()=>{},value:g="",onClear:x=()=>{},onSubmit:S=()=>{},id:y})=>{const[t,c]=s.useState(!1),d=D.usePrevious(t),b=T.useId(y),o=s.useRef(void 0),i=s.useRef(void 0);s.useEffect(()=>{t&&o.current&&o.current.focus(),d&&!t&&i.current&&i.current.focus()},[t,d]);const j=()=>{c(n=>!n)},q=n=>{x(n),o.current.focus()},B=n=>{n.relatedTarget?.id!==b&&c(!1)},m=n=>{n.key===R.KeyboardKeys.ESCAPE&&c(!1)};return t?e.jsxs(a.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[e.jsx(K.SearchForm,{children:e.jsx(_.Searchbar,{name:"searchbar",value:g,onChange:p,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:m,ref:o,onBlur:B,onClear:q,onSubmit:S,clearLabel:"Clear",size:"S",children:u})}),e.jsx(a.Box,{paddingLeft:2,paddingTop:4,children:e.jsx(l,{})})]}):e.jsxs(a.Box,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[e.jsxs(k.Flex,{justifyContent:"space-between",alignItems:"flex-start",children:[e.jsx(w.Typography,{variant:"beta",as:r,children:f}),h&&e.jsx(F.IconButton,{ref:i,onClick:j,label:u,icon:e.jsx(v.Search,{})})]}),e.jsx(a.Box,{paddingTop:4,children:e.jsx(l,{})})]})};exports.SubNavHeader=E;