@strapi/design-system 1.8.0 → 1.8.1

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 (57) hide show
  1. package/dist/Button/Button.cjs +2 -2
  2. package/dist/Button/Button.js +4 -4
  3. package/dist/Combobox/Combobox.cjs +3 -3
  4. package/dist/Combobox/Combobox.js +12 -12
  5. package/dist/DatePicker/DatePicker.cjs +14 -14
  6. package/dist/DatePicker/DatePicker.js +257 -224
  7. package/dist/DateTimePicker/DateTimePicker.cjs +3 -3
  8. package/dist/DateTimePicker/DateTimePicker.js +69 -63
  9. package/dist/Grid/Grid.cjs +3 -3
  10. package/dist/Grid/Grid.js +6 -3
  11. package/dist/MainNav/MainNav.cjs +2 -2
  12. package/dist/MainNav/MainNav.js +9 -31
  13. package/dist/MainNav/MainNavContext.cjs +1 -1
  14. package/dist/MainNav/MainNavContext.js +1 -1
  15. package/dist/MainNav/NavBrand.cjs +3 -3
  16. package/dist/MainNav/NavBrand.js +12 -38
  17. package/dist/MainNav/NavCondense.cjs +2 -2
  18. package/dist/MainNav/NavCondense.js +15 -23
  19. package/dist/MainNav/NavFooter.cjs +1 -1
  20. package/dist/MainNav/NavFooter.js +4 -10
  21. package/dist/MainNav/NavLink.cjs +9 -9
  22. package/dist/MainNav/NavLink.js +13 -35
  23. package/dist/MainNav/NavSection.cjs +1 -1
  24. package/dist/MainNav/NavSection.js +9 -43
  25. package/dist/MainNav/NavSections.cjs +2 -2
  26. package/dist/MainNav/NavSections.js +7 -21
  27. package/dist/MainNav/NavUser.cjs +2 -2
  28. package/dist/MainNav/NavUser.js +13 -27
  29. package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
  30. package/dist/SimpleMenu/SimpleMenu.js +62 -151
  31. package/dist/SubNav/SubNav.cjs +5 -5
  32. package/dist/SubNav/SubNav.js +8 -13
  33. package/dist/SubNav/SubNavHeader.cjs +3 -3
  34. package/dist/SubNav/SubNavHeader.js +29 -76
  35. package/dist/SubNav/SubNavLink.cjs +13 -13
  36. package/dist/SubNav/SubNavLink.js +20 -52
  37. package/dist/SubNav/SubNavLinkSection.cjs +4 -4
  38. package/dist/SubNav/SubNavLinkSection.js +19 -35
  39. package/dist/SubNav/SubNavSection.cjs +2 -2
  40. package/dist/SubNav/SubNavSection.js +15 -55
  41. package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
  42. package/dist/SubNav/SubNavSectionLabel.js +10 -38
  43. package/dist/SubNav/SubNavSections.cjs +1 -1
  44. package/dist/SubNav/SubNavSections.js +4 -18
  45. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  46. package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
  47. package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
  48. package/dist/v2/Breadcrumbs/Crumb.js +6 -25
  49. package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
  50. package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
  51. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
  52. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
  53. package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
  54. package/dist/v2/Breadcrumbs/Divider.js +3 -4
  55. package/dist/v2/SimpleMenu/Menu.cjs +10 -10
  56. package/dist/v2/SimpleMenu/Menu.js +11 -11
  57. package/package.json +10 -10
@@ -1,86 +1,39 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { useState as w, useRef as f, useEffect as D } from "react";
3
- import { Search as I } from "@strapi/icons";
4
- import r from "prop-types";
5
- import K from "styled-components";
6
- import { KeyboardKeys as P } from "../helpers/keyboardKeys.js";
2
+ import { useState as R, useRef as p, useEffect as w } from "react";
3
+ import { Search as D } from "@strapi/icons";
4
+ import I from "styled-components";
5
+ import { KeyboardKeys as K } from "../helpers/keyboardKeys.js";
7
6
  import { useId as j } from "../hooks/useId.js";
8
7
  import { usePrevious as k } from "../hooks/usePrevious.js";
9
8
  import { SearchForm as E } from "../Searchbar/SearchForm.js";
10
- import { Searchbar as O } from "../Searchbar/Searchbar.js";
11
- import { Divider as F } from "../Divider/Divider.js";
12
- import { Box as a } from "../Box/Box.js";
13
- import { Flex as $ } from "../Flex/Flex.js";
14
- import { Typography as q } from "../Typography/Typography.js";
15
- import { IconButton as z } from "../IconButton/IconButton.js";
16
- const m = K(F)`
9
+ import { Searchbar as L } from "../Searchbar/Searchbar.js";
10
+ import { Divider as O } from "../Divider/Divider.js";
11
+ import { Box as n } from "../Box/Box.js";
12
+ import { Flex as F } from "../Flex/Flex.js";
13
+ import { Typography as P } from "../Typography/Typography.js";
14
+ import { IconButton as $ } from "../IconButton/IconButton.js";
15
+ const f = I(O)`
17
16
  width: ${24 / 16}rem;
18
17
  background-color: ${({ theme: i }) => i.colors.neutral200};
19
- `, u = ({ as: i, label: h, searchLabel: l, searchable: g, onChange: b, value: S, onClear: y, onSubmit: C, id: v }) => {
20
- const [n, s] = w(!1), p = k(n), B = j(v), t = f(), c = f();
21
- D(() => {
22
- n && t.current && t.current.focus(), p && !n && c.current && c.current.focus();
23
- }, [n, p]);
24
- const T = () => {
25
- s((o) => !o);
26
- }, x = (o) => {
27
- y(o), t.current.focus();
28
- }, R = (o) => {
29
- o.relatedTarget?.id !== B && s(!1);
30
- }, L = (o) => {
31
- o.key === P.ESCAPE && s(!1);
18
+ `, Z = ({ as: i = "h2", label: m, searchLabel: l = "", searchable: u, onChange: h = () => {
19
+ }, value: g = "", onClear: S = () => {
20
+ }, onSubmit: b = () => {
21
+ }, id: y }) => {
22
+ const [o, a] = R(!1), s = k(o), B = j(y), t = p(null), c = p(null);
23
+ w(() => {
24
+ o && t.current && t.current.focus(), s && !o && c.current && c.current.focus();
25
+ }, [o, s]);
26
+ const C = () => {
27
+ a((r) => !r);
28
+ }, v = (r) => {
29
+ S(r), t?.current && t.current.focus();
30
+ }, x = (r) => {
31
+ r.relatedTarget?.id !== B && a(!1);
32
+ }, T = (r) => {
33
+ r.key === K.ESCAPE && a(!1);
32
34
  };
33
- return n ? /* @__PURE__ */ d(a, { paddingLeft: 4, paddingTop: 5, paddingBottom: 2, paddingRight: 4, children: [
34
- /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
35
- O,
36
- {
37
- name: "searchbar",
38
- value: S,
39
- onChange: b,
40
- placeholder: "e.g: strapi-plugin-abcd",
41
- onKeyDown: L,
42
- ref: t,
43
- onBlur: R,
44
- onClear: x,
45
- onSubmit: C,
46
- clearLabel: "Clear",
47
- size: "S",
48
- children: l
49
- }
50
- ) }),
51
- /* @__PURE__ */ e(a, { paddingLeft: 2, paddingTop: 4, children: /* @__PURE__ */ e(m, {}) })
52
- ] }) : /* @__PURE__ */ d(a, { paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
53
- /* @__PURE__ */ d($, { justifyContent: "space-between", alignItems: "flex-start", children: [
54
- /* @__PURE__ */ e(q, { variant: "beta", as: i, children: h }),
55
- g && /* @__PURE__ */ e(z, { ref: c, onClick: T, label: l, icon: /* @__PURE__ */ e(I, {}) })
56
- ] }),
57
- /* @__PURE__ */ e(a, { paddingTop: 4, children: /* @__PURE__ */ e(m, {}) })
58
- ] });
59
- };
60
- u.defaultProps = {
61
- as: "h2",
62
- searchable: !1,
63
- onChange() {
64
- },
65
- onClear() {
66
- },
67
- onSubmit() {
68
- },
69
- value: "",
70
- searchLabel: "",
71
- id: void 0
72
- };
73
- u.propTypes = {
74
- as: r.string,
75
- id: r.string,
76
- label: r.string.isRequired,
77
- onChange: r.func,
78
- onClear: r.func,
79
- onSubmit: r.func,
80
- searchLabel: r.string,
81
- searchable: r.bool,
82
- value: r.string
35
+ return o ? d(n, { paddingLeft: 4, paddingTop: 5, paddingBottom: 2, paddingRight: 4, children: [e(E, { children: e(L, { name: "searchbar", value: g, onChange: h, placeholder: "e.g: strapi-plugin-abcd", onKeyDown: T, ref: t, onBlur: x, onClear: v, onSubmit: b, clearLabel: "Clear", size: "S", children: l }) }), e(n, { paddingLeft: 2, paddingTop: 4, children: e(f, {}) })] }) : d(n, { paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [d(F, { justifyContent: "space-between", alignItems: "flex-start", children: [e(P, { variant: "beta", as: i, children: m }), u && e($, { ref: c, onClick: C, label: l, icon: e(D, {}) })] }), e(n, { paddingTop: 4, children: e(f, {}) })] });
83
36
  };
84
37
  export {
85
- u as SubNavHeader
38
+ Z as SubNavHeader
86
39
  };
@@ -1,22 +1,22 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const g=require("@strapi/icons"),y=require("prop-types"),x=require("react-router-dom"),h=require("styled-components"),i=require("../Box/Box.cjs"),u=require("../Typography/Typography.cjs"),n=require("../Flex/Flex.cjs"),c=e=>e&&e.__esModule?e:{default:e},t=c(y),s=c(h),b=s.default(i.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@strapi/icons"),p=require("react-router-dom"),g=require("styled-components"),t=require("../Box/Box.cjs"),n=require("../Typography/Typography.cjs"),i=require("../Flex/Flex.cjs"),f=r=>r&&r.__esModule?r:{default:r},s=f(g),x=s.default(t.Box)`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: space-between;
5
5
  text-decoration: none;
6
- color: ${({theme:e})=>e.colors.neutral800};
6
+ color: ${({theme:r})=>r.colors.neutral800};
7
7
  svg > * {
8
- fill: ${({theme:e})=>e.colors.neutral600};
8
+ fill: ${({theme:r})=>r.colors.neutral600};
9
9
  }
10
10
 
11
11
  &.active {
12
- ${({theme:e})=>`
13
- background-color: ${e.colors.primary100};
14
- border-right: 2px solid ${e.colors.primary600};
12
+ ${({theme:r})=>`
13
+ background-color: ${r.colors.primary100};
14
+ border-right: 2px solid ${r.colors.primary600};
15
15
  svg > * {
16
- fill: ${e.colors.primary700};
16
+ fill: ${r.colors.primary700};
17
17
  }
18
- ${u.Typography} {
19
- color: ${e.colors.primary700};
18
+ ${n.Typography} {
19
+ color: ${r.colors.primary700};
20
20
  font-weight: 500;
21
21
  }
22
22
  `}
@@ -25,15 +25,15 @@
25
25
  &:focus-visible {
26
26
  outline-offset: -2px;
27
27
  }
28
- `,a=s.default(g.Dot)`
28
+ `,l=s.default(d.Dot)`
29
29
  width: ${12/16}rem;
30
30
  height: ${4/16}rem;
31
31
  * {
32
- fill: ${({theme:e,$active:o})=>o?e.colors.primary600:e.colors.neutral600};
32
+ fill: ${({theme:r,$active:o})=>o?r.colors.primary600:r.colors.neutral600};
33
33
  }
34
- `,$=s.default.div`
34
+ `,y=s.default.div`
35
35
  svg {
36
36
  height: ${12/16}rem;
37
37
  width: ${12/16}rem;
38
38
  }
39
- `,l=({children:e,icon:o,withBullet:d,isSubSectionChild:p,...f})=>r.jsxs(b,{as:x.NavLink,icon:o,background:"neutral100",paddingLeft:p?9:7,paddingBottom:2,paddingTop:2,...f,children:[r.jsxs(n.Flex,{children:[o?r.jsx($,{children:o}):r.jsx(a,{}),r.jsx(i.Box,{paddingLeft:2,children:r.jsx(u.Typography,{as:"span",children:e})})]}),d&&r.jsx(i.Box,{as:n.Flex,paddingRight:4,children:r.jsx(a,{$active:!0})})]});l.displayName="SubNavLink";l.defaultProps={icon:null,isSubSectionChild:!1,withBullet:!1};l.propTypes={children:t.default.node.isRequired,icon:t.default.element,isSubSectionChild:t.default.bool,withBullet:t.default.bool};exports.SubNavLink=l;
39
+ `,h=({children:r,icon:o,withBullet:a=!1,isSubSectionChild:c=!1,...u})=>e.jsxs(x,{as:p.NavLink,icon:o,background:"neutral100",paddingLeft:c?9:7,paddingBottom:2,paddingTop:2,...u,children:[e.jsxs(i.Flex,{children:[o?e.jsx(y,{children:o}):e.jsx(l,{}),e.jsx(t.Box,{paddingLeft:2,children:e.jsx(n.Typography,{as:"span",children:r})})]}),a&&e.jsx(t.Box,{as:i.Flex,paddingRight:4,children:e.jsx(l,{$active:!0})})]});exports.SubNavLink=h;
@@ -1,31 +1,29 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import { Dot as f } from "@strapi/icons";
4
- import e from "prop-types";
5
- import { NavLink as g } from "react-router-dom";
6
- import l from "styled-components";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { Dot as m } from "@strapi/icons";
3
+ import { NavLink as f } from "react-router-dom";
4
+ import e from "styled-components";
7
5
  import { Box as t } from "../Box/Box.js";
8
- import { Typography as c } from "../Typography/Typography.js";
9
- import { Flex as p } from "../Flex/Flex.js";
10
- const h = l(t)`
6
+ import { Typography as s } from "../Typography/Typography.js";
7
+ import { Flex as n } from "../Flex/Flex.js";
8
+ const g = e(t)`
11
9
  display: flex;
12
10
  align-items: center;
13
11
  justify-content: space-between;
14
12
  text-decoration: none;
15
- color: ${({ theme: o }) => o.colors.neutral800};
13
+ color: ${({ theme: r }) => r.colors.neutral800};
16
14
  svg > * {
17
- fill: ${({ theme: o }) => o.colors.neutral600};
15
+ fill: ${({ theme: r }) => r.colors.neutral600};
18
16
  }
19
17
 
20
18
  &.active {
21
- ${({ theme: o }) => `
22
- background-color: ${o.colors.primary100};
23
- border-right: 2px solid ${o.colors.primary600};
19
+ ${({ theme: r }) => `
20
+ background-color: ${r.colors.primary100};
21
+ border-right: 2px solid ${r.colors.primary600};
24
22
  svg > * {
25
- fill: ${o.colors.primary700};
23
+ fill: ${r.colors.primary700};
26
24
  }
27
- ${c} {
28
- color: ${o.colors.primary700};
25
+ ${s} {
26
+ color: ${r.colors.primary700};
29
27
  font-weight: 500;
30
28
  }
31
29
  `}
@@ -34,48 +32,18 @@ const h = l(t)`
34
32
  &:focus-visible {
35
33
  outline-offset: -2px;
36
34
  }
37
- `, a = l(f)`
35
+ `, a = e(m)`
38
36
  width: ${12 / 16}rem;
39
37
  height: ${4 / 16}rem;
40
38
  * {
41
- fill: ${({ theme: o, $active: i }) => i ? o.colors.primary600 : o.colors.neutral600};
39
+ fill: ${({ theme: r, $active: i }) => i ? r.colors.primary600 : r.colors.neutral600};
42
40
  }
43
- `, $ = l.div`
41
+ `, u = e.div`
44
42
  svg {
45
43
  height: ${12 / 16}rem;
46
44
  width: ${12 / 16}rem;
47
45
  }
48
- `, n = ({ children: o, icon: i, withBullet: d, isSubSectionChild: m, ...u }) => /* @__PURE__ */ s(
49
- h,
50
- {
51
- as: g,
52
- icon: i,
53
- background: "neutral100",
54
- paddingLeft: m ? 9 : 7,
55
- paddingBottom: 2,
56
- paddingTop: 2,
57
- ...u,
58
- children: [
59
- /* @__PURE__ */ s(p, { children: [
60
- i ? /* @__PURE__ */ r($, { children: i }) : /* @__PURE__ */ r(a, {}),
61
- /* @__PURE__ */ r(t, { paddingLeft: 2, children: /* @__PURE__ */ r(c, { as: "span", children: o }) })
62
- ] }),
63
- d && /* @__PURE__ */ r(t, { as: p, paddingRight: 4, children: /* @__PURE__ */ r(a, { $active: !0 }) })
64
- ]
65
- }
66
- );
67
- n.displayName = "SubNavLink";
68
- n.defaultProps = {
69
- icon: null,
70
- isSubSectionChild: !1,
71
- withBullet: !1
72
- };
73
- n.propTypes = {
74
- children: e.node.isRequired,
75
- icon: e.element,
76
- isSubSectionChild: e.bool,
77
- withBullet: e.bool
78
- };
46
+ `, L = ({ children: r, icon: i, withBullet: c = !1, isSubSectionChild: p = !1, ...d }) => l(g, { as: f, icon: i, background: "neutral100", paddingLeft: p ? 9 : 7, paddingBottom: 2, paddingTop: 2, ...d, children: [l(n, { children: [i ? o(u, { children: i }) : o(a, {}), o(t, { paddingLeft: 2, children: o(s, { as: "span", children: r }) })] }), c && o(t, { as: n, paddingRight: 4, children: o(a, { $active: !0 }) })] });
79
47
  export {
80
- n as SubNavLink
48
+ L as SubNavLink
81
49
  };
@@ -1,19 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),f=require("@strapi/icons"),y=require("prop-types"),j=require("styled-components"),b=require("../hooks/useId.cjs"),o=require("../Box/Box.cjs"),S=require("../Flex/Flex.cjs"),m=require("../Typography/Typography.cjs"),c=e=>e&&e.__esModule?e:{default:e},i=c(y),s=c(j),q=s.default(o.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("react"),g=require("@strapi/icons"),f=require("styled-components"),j=require("../hooks/useId.cjs"),i=require("../Box/Box.cjs"),y=require("../Flex/Flex.cjs"),S=require("../Typography/Typography.cjs"),d=e=>e&&e.__esModule?e:{default:e},a=d(h),o=d(f),b=o.default(i.Box)`
2
2
  svg {
3
3
  height: ${4/16}rem;
4
4
  path {
5
5
  fill: ${({theme:e})=>e.colors.neutral700};
6
6
  }
7
7
  }
8
- `,v=s.default.button`
8
+ `,m=o.default.button`
9
9
  border: none;
10
10
  padding: 0;
11
11
  background: transparent;
12
12
  display: flex;
13
13
  align-items: center;
14
- `,k=s.default.div`
14
+ `,k=o.default.div`
15
15
  display: flex;
16
16
  align-items: center;
17
17
  width: ${12/16}rem;
18
18
  transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
19
- `,d=({label:e,children:u,id:p})=>{const[n,h]=l.useState(!0),a=b.useId(p),g=()=>{h(r=>!r)};return t.jsxs(o.Box,{children:[t.jsx(q,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsx(S.Flex,{justifyContent:"space-between",children:t.jsxs(v,{onClick:g,"aria-expanded":n,"aria-controls":a,children:[t.jsx(k,{rotated:n,children:t.jsx(f.CarretDown,{"aria-hidden":!0})}),t.jsx(o.Box,{paddingLeft:2,children:t.jsx(m.Typography,{as:"span",fontWeight:"semiBold",textColor:"neutral800",children:e})})]})})}),n&&t.jsx("ul",{id:a,children:l.Children.map(u,(r,x)=>t.jsx("li",{children:r},x))})]})};d.defaultProps={children:void 0,id:void 0};d.propTypes={children:i.default.node,id:i.default.string,label:i.default.string.isRequired};exports.SubNavLinkSection=d;
19
+ `,q=({label:e,children:l,id:c})=>{const[n,u]=a.default.useState(!0),s=j.useId(c),p=()=>{u(r=>!r)};return t.jsxs(i.Box,{children:[t.jsx(b,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsx(y.Flex,{justifyContent:"space-between",children:t.jsxs(m,{onClick:p,"aria-expanded":n,"aria-controls":s,children:[t.jsx(k,{rotated:n,children:t.jsx(g.CarretDown,{"aria-hidden":!0})}),t.jsx(i.Box,{paddingLeft:2,children:t.jsx(S.Typography,{as:"span",fontWeight:"semiBold",textColor:"neutral800",children:e})})]})})}),n&&t.jsx("ul",{id:s,children:a.default.Children.map(l,(r,x)=>t.jsx("li",{children:r},x))})]})};exports.SubNavLinkSection=q;
@@ -1,51 +1,35 @@
1
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
- import { useState as f, Children as g } from "react";
3
- import { CarretDown as u } from "@strapi/icons";
4
- import t from "prop-types";
5
- import d from "styled-components";
6
- import { useId as x } from "../hooks/useId.js";
7
- import { Box as o } from "../Box/Box.js";
8
- import { Flex as b } from "../Flex/Flex.js";
9
- import { Typography as k } from "../Typography/Typography.js";
10
- const y = d(o)`
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { CarretDown as h } from "@strapi/icons";
4
+ import o from "styled-components";
5
+ import { useId as f } from "../hooks/useId.js";
6
+ import { Box as i } from "../Box/Box.js";
7
+ import { Flex as u } from "../Flex/Flex.js";
8
+ import { Typography as g } from "../Typography/Typography.js";
9
+ const x = o(i)`
11
10
  svg {
12
11
  height: ${4 / 16}rem;
13
12
  path {
14
- fill: ${({ theme: r }) => r.colors.neutral700};
13
+ fill: ${({ theme: t }) => t.colors.neutral700};
15
14
  }
16
15
  }
17
- `, v = d.button`
16
+ `, k = o.button`
18
17
  border: none;
19
18
  padding: 0;
20
19
  background: transparent;
21
20
  display: flex;
22
21
  align-items: center;
23
- `, C = d.div`
22
+ `, b = o.div`
24
23
  display: flex;
25
24
  align-items: center;
26
25
  width: ${12 / 16}rem;
27
- transform: rotateX(${({ rotated: r }) => r ? "0deg" : "180deg"});
28
- `, l = ({ label: r, children: s, id: c }) => {
29
- const [i, m] = f(!0), a = x(c);
30
- return /* @__PURE__ */ p(o, { children: [
31
- /* @__PURE__ */ e(y, { paddingLeft: 7, paddingTop: 2, paddingBottom: 2, paddingRight: 4, children: /* @__PURE__ */ e(b, { justifyContent: "space-between", children: /* @__PURE__ */ p(v, { onClick: () => {
32
- m((n) => !n);
33
- }, "aria-expanded": i, "aria-controls": a, children: [
34
- /* @__PURE__ */ e(C, { rotated: i, children: /* @__PURE__ */ e(u, { "aria-hidden": !0 }) }),
35
- /* @__PURE__ */ e(o, { paddingLeft: 2, children: /* @__PURE__ */ e(k, { as: "span", fontWeight: "semiBold", textColor: "neutral800", children: r }) })
36
- ] }) }) }),
37
- i && /* @__PURE__ */ e("ul", { id: a, children: g.map(s, (n, h) => /* @__PURE__ */ e("li", { children: n }, h)) })
38
- ] });
39
- };
40
- l.defaultProps = {
41
- children: void 0,
42
- id: void 0
43
- };
44
- l.propTypes = {
45
- children: t.node,
46
- id: t.string,
47
- label: t.string.isRequired
26
+ transform: rotateX(${({ rotated: t }) => t ? "0deg" : "180deg"});
27
+ `, D = ({ label: t, children: p, id: s }) => {
28
+ const [n, c] = l.useState(!0), d = f(s);
29
+ return a(i, { children: [e(x, { paddingLeft: 7, paddingTop: 2, paddingBottom: 2, paddingRight: 4, children: e(u, { justifyContent: "space-between", children: a(k, { onClick: () => {
30
+ c((r) => !r);
31
+ }, "aria-expanded": n, "aria-controls": d, children: [e(b, { rotated: n, children: e(h, { "aria-hidden": !0 }) }), e(i, { paddingLeft: 2, children: e(g, { as: "span", fontWeight: "semiBold", textColor: "neutral800", children: t }) })] }) }) }), n && e("ul", { id: d, children: l.Children.map(p, (r, m) => e("li", { children: r }, m)) })] });
48
32
  };
49
33
  export {
50
- l as SubNavLinkSection
34
+ D as SubNavLinkSection
51
35
  };
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),b=require("prop-types"),S=require("styled-components"),q=require("./SubNavSectionLabel.cjs"),v=require("../hooks/useId.cjs"),d=require("../Box/Box.cjs"),j=require("../Flex/Flex.cjs"),m=require("../Badge/Badge.cjs"),u=e=>e&&e.__esModule?e:{default:e},n=u(b),y=u(S),_=y.default(d.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("react"),S=require("styled-components"),f=require("./SubNavSectionLabel.cjs"),j=require("../hooks/useId.cjs"),l=require("../Box/Box.cjs"),b=require("../Flex/Flex.cjs"),m=require("../Badge/Badge.cjs"),a=e=>e&&e.__esModule?e:{default:e},s=a(x),q=a(S),v=q.default(l.Box)`
2
2
  svg {
3
3
  height: ${4/16}rem;
4
4
  path {
5
5
  fill: ${({theme:e})=>e.colors.neutral500};
6
6
  }
7
7
  }
8
- `,o=({collapsable:e,label:c,badgeLabel:r,children:p,id:g})=>{const[l,h]=a.useState(!0),s=v.useId(g),f=()=>{h(i=>!i)};return t.jsxs(j.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(_,{paddingLeft:6,paddingTop:1,paddingBottom:1,paddingRight:4,children:t.jsxs(d.Box,{position:"relative",paddingRight:r?6:0,children:[t.jsx(q.SubNavSectionLabel,{onClick:f,ariaExpanded:l,ariaControls:s,collapsable:e,label:c}),r&&t.jsx(m.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:r})]})}),(!e||l)&&t.jsx("ol",{id:s,children:a.Children.map(p,(i,x)=>t.jsx("li",{children:i},x))})]})};o.defaultProps={badgeLabel:null,children:void 0,collapsable:!1,id:void 0};o.propTypes={badgeLabel:n.default.string,children:n.default.node,collapsable:n.default.bool,id:n.default.string,label:n.default.string.isRequired};exports.SubNavSection=o;
8
+ `,_=({collapsable:e=!1,label:c,badgeLabel:n,children:d,id:u})=>{const[r,p]=s.default.useState(!0),i=j.useId(u),g=()=>{p(o=>!o)};return t.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(v,{paddingLeft:6,paddingTop:1,paddingBottom:1,paddingRight:4,children:t.jsxs(l.Box,{position:"relative",paddingRight:n?6:0,children:[t.jsx(f.SubNavSectionLabel,{onClick:g,ariaExpanded:r,ariaControls:i,collapsable:e,label:c}),n&&t.jsx(m.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:n})]})}),(!e||r)&&t.jsx("ol",{id:i,children:s.default.Children.map(d,(o,h)=>t.jsx("li",{children:o},h))})]})};exports.SubNavSection=_;
@@ -1,64 +1,24 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
- import { useState as u, Children as f } from "react";
3
- import r from "prop-types";
4
- import b from "styled-components";
5
- import { SubNavSectionLabel as v } from "./SubNavSectionLabel.js";
6
- import { useId as x } from "../hooks/useId.js";
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import u from "styled-components";
4
+ import { SubNavSectionLabel as f } from "./SubNavSectionLabel.js";
5
+ import { useId as g } from "../hooks/useId.js";
7
6
  import { Box as d } from "../Box/Box.js";
8
- import { Flex as C } from "../Flex/Flex.js";
9
- import { Badge as S } from "../Badge/Badge.js";
10
- const k = b(d)`
7
+ import { Flex as x } from "../Flex/Flex.js";
8
+ import { Badge as C } from "../Badge/Badge.js";
9
+ const S = u(d)`
11
10
  svg {
12
11
  height: ${4 / 16}rem;
13
12
  path {
14
- fill: ${({ theme: i }) => i.colors.neutral500};
13
+ fill: ${({ theme: o }) => o.colors.neutral500};
15
14
  }
16
15
  }
17
- `, p = ({ collapsable: i, label: s, badgeLabel: t, children: c, id: m }) => {
18
- const [n, h] = u(!0), l = x(m);
19
- return /* @__PURE__ */ a(C, { direction: "column", alignItems: "stretch", gap: 1, children: [
20
- /* @__PURE__ */ o(k, { paddingLeft: 6, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ a(d, { position: "relative", paddingRight: t ? 6 : 0, children: [
21
- /* @__PURE__ */ o(
22
- v,
23
- {
24
- onClick: () => {
25
- h((e) => !e);
26
- },
27
- ariaExpanded: n,
28
- ariaControls: l,
29
- collapsable: i,
30
- label: s
31
- }
32
- ),
33
- t && /* @__PURE__ */ o(
34
- S,
35
- {
36
- backgroundColor: "neutral150",
37
- textColor: "neutral600",
38
- position: "absolute",
39
- right: 0,
40
- top: "50%",
41
- transform: "translateY(-50%)",
42
- children: t
43
- }
44
- )
45
- ] }) }),
46
- (!i || n) && /* @__PURE__ */ o("ol", { id: l, children: f.map(c, (e, g) => /* @__PURE__ */ o("li", { children: e }, g)) })
47
- ] });
48
- };
49
- p.defaultProps = {
50
- badgeLabel: null,
51
- children: void 0,
52
- collapsable: !1,
53
- id: void 0
54
- };
55
- p.propTypes = {
56
- badgeLabel: r.string,
57
- children: r.node,
58
- collapsable: r.bool,
59
- id: r.string,
60
- label: r.string.isRequired
16
+ `, _ = ({ collapsable: o = !1, label: p, badgeLabel: r, children: s, id: c }) => {
17
+ const [e, m] = a.useState(!0), n = g(c);
18
+ return l(x, { direction: "column", alignItems: "stretch", gap: 1, children: [t(S, { paddingLeft: 6, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: l(d, { position: "relative", paddingRight: r ? 6 : 0, children: [t(f, { onClick: () => {
19
+ m((i) => !i);
20
+ }, ariaExpanded: e, ariaControls: n, collapsable: o, label: p }), r && t(C, { backgroundColor: "neutral150", textColor: "neutral600", position: "absolute", right: 0, top: "50%", transform: "translateY(-50%)", children: r })] }) }), (!o || e) && t("ol", { id: n, children: a.Children.map(s, (i, h) => t("li", { children: i }, h)) })] });
61
21
  };
62
22
  export {
63
- p as SubNavSection
23
+ _ as SubNavSection
64
24
  };
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const x=require("@strapi/icons"),f=require("prop-types"),g=require("styled-components"),b=require("../Flex/Flex.cjs"),l=require("../Box/Box.cjs"),i=require("../Typography/Typography.cjs"),d=e=>e&&e.__esModule?e:{default:e},t=d(f),u=d(g),s=u.default(b.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("@strapi/icons"),u=require("styled-components"),x=require("../Flex/Flex.cjs"),o=require("../Box/Box.cjs"),a=require("../Typography/Typography.cjs"),g=e=>e&&e.__esModule?e:{default:e},s=g(u),i=s.default(x.Flex)`
2
2
  border: none;
3
3
  padding: 0;
4
4
  background: transparent;
5
- `,y=u.default.div`
5
+ `,p=s.default.div`
6
6
  display: flex;
7
7
  align-items: center;
8
8
  transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
9
- `,a=({collapsable:e,label:n,onClick:c,ariaExpanded:o,ariaControls:p})=>e?r.jsxs(s,{as:"button",onClick:c,"aria-expanded":o,"aria-controls":p,textAlign:"left",children:[r.jsx(l.Box,{paddingRight:1,children:r.jsx(i.Typography,{variant:"sigma",textColor:"neutral600",children:n})}),e&&r.jsx(y,{rotated:o,children:r.jsx(x.CarretDown,{"aria-hidden":!0})})]}):r.jsx(s,{children:r.jsx(l.Box,{paddingRight:1,children:r.jsx(i.Typography,{variant:"sigma",textColor:"neutral600",children:n})})});a.defaultProps={ariaControls:null,ariaExpanded:null,collapsable:!1,onClick(){}};a.propTypes={ariaControls:t.default.string,ariaExpanded:t.default.bool,collapsable:t.default.bool,label:t.default.string.isRequired,onClick:t.default.func};exports.SubNavSectionLabel=a;
9
+ `,h=({collapsable:e=!1,label:t,onClick:d=()=>{},ariaExpanded:n,ariaControls:l})=>e?r.jsxs(i,{as:"button",onClick:d,"aria-expanded":n,"aria-controls":l,textAlign:"left",children:[r.jsx(o.Box,{paddingRight:1,children:r.jsx(a.Typography,{variant:"sigma",textColor:"neutral600",children:t})}),e&&r.jsx(p,{rotated:n,children:r.jsx(c.CarretDown,{"aria-hidden":!0})})]}):r.jsx(i,{children:r.jsx(o.Box,{paddingRight:1,children:r.jsx(a.Typography,{variant:"sigma",textColor:"neutral600",children:t})})});exports.SubNavSectionLabel=h;
@@ -1,47 +1,19 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import { CarretDown as g } from "@strapi/icons";
4
- import o from "prop-types";
5
- import p from "styled-components";
6
- import { Flex as f } from "../Flex/Flex.js";
7
- import { Box as a } from "../Box/Box.js";
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { CarretDown as m } from "@strapi/icons";
3
+ import d from "styled-components";
4
+ import { Flex as s } from "../Flex/Flex.js";
5
+ import { Box as o } from "../Box/Box.js";
8
6
  import { Typography as i } from "../Typography/Typography.js";
9
- const l = p(f)`
7
+ const a = d(s)`
10
8
  border: none;
11
9
  padding: 0;
12
10
  background: transparent;
13
- `, u = p.div`
11
+ `, g = d.div`
14
12
  display: flex;
15
13
  align-items: center;
16
14
  transform: rotateX(${({ rotated: t }) => t ? "0deg" : "180deg"});
17
- `, d = ({ collapsable: t, label: e, onClick: s, ariaExpanded: n, ariaControls: c }) => t ? /* @__PURE__ */ m(
18
- l,
19
- {
20
- as: "button",
21
- onClick: s,
22
- "aria-expanded": n,
23
- "aria-controls": c,
24
- textAlign: "left",
25
- children: [
26
- /* @__PURE__ */ r(a, { paddingRight: 1, children: /* @__PURE__ */ r(i, { variant: "sigma", textColor: "neutral600", children: e }) }),
27
- t && /* @__PURE__ */ r(u, { rotated: n, children: /* @__PURE__ */ r(g, { "aria-hidden": !0 }) })
28
- ]
29
- }
30
- ) : /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(a, { paddingRight: 1, children: /* @__PURE__ */ r(i, { variant: "sigma", textColor: "neutral600", children: e }) }) });
31
- d.defaultProps = {
32
- ariaControls: null,
33
- ariaExpanded: null,
34
- collapsable: !1,
35
- onClick() {
36
- }
37
- };
38
- d.propTypes = {
39
- ariaControls: o.string,
40
- ariaExpanded: o.bool,
41
- collapsable: o.bool,
42
- label: o.string.isRequired,
43
- onClick: o.func
44
- };
15
+ `, y = ({ collapsable: t = !1, label: e, onClick: l = () => {
16
+ }, ariaExpanded: n, ariaControls: p }) => t ? c(a, { as: "button", onClick: l, "aria-expanded": n, "aria-controls": p, textAlign: "left", children: [r(o, { paddingRight: 1, children: r(i, { variant: "sigma", textColor: "neutral600", children: e }) }), t && r(g, { rotated: n, children: r(m, { "aria-hidden": !0 }) })] }) : r(a, { children: r(o, { paddingRight: 1, children: r(i, { variant: "sigma", textColor: "neutral600", children: e }) }) });
45
17
  export {
46
- d as SubNavSectionLabel
18
+ y as SubNavSectionLabel
47
19
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),l=require("prop-types"),d=require("../Box/Box.cjs"),a=require("../Flex/Flex.cjs"),p=e=>e&&e.__esModule?e:{default:e},x=p(l),n=({children:e,spacing:o=2,horizontal:t=!1,...s})=>r.jsx(d.Box,{paddingTop:2,paddingBottom:4,children:r.jsx(a.Flex,{as:"ol",gap:o,direction:t?"row":"column",alignItems:t?"center":"stretch",...s,children:u.Children.map(e,(i,c)=>r.jsx("li",{children:i},c))})});n.propTypes={children:x.default.node.isRequired};exports.SubNavSections=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),l=require("../Box/Box.cjs"),u=require("../Flex/Flex.cjs"),a=e=>e&&e.__esModule?e:{default:e},d=a(s),x=({children:e,spacing:r=2,horizontal:n=!1,...o})=>t.jsx(l.Box,{paddingTop:2,paddingBottom:4,children:t.jsx(u.Flex,{as:"ol",gap:r,direction:n?"row":"column",alignItems:n?"center":"stretch",...o,children:d.default.Children.map(e,(c,i)=>t.jsx("li",{children:c},i))})});exports.SubNavSections=x;
@@ -1,22 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { Children as m } from "react";
3
- import d from "prop-types";
4
- import { Box as c } from "../Box/Box.js";
2
+ import c from "react";
3
+ import { Box as d } from "../Box/Box.js";
5
4
  import { Flex as l } from "../Flex/Flex.js";
6
- const s = ({ children: e, spacing: i = 2, horizontal: o = !1, ...p }) => /* @__PURE__ */ r(c, { paddingTop: 2, paddingBottom: 4, children: /* @__PURE__ */ r(
7
- l,
8
- {
9
- as: "ol",
10
- gap: i,
11
- direction: o ? "row" : "column",
12
- alignItems: o ? "center" : "stretch",
13
- ...p,
14
- children: m.map(e, (t, n) => /* @__PURE__ */ r("li", { children: t }, n))
15
- }
16
- ) });
17
- s.propTypes = {
18
- children: d.node.isRequired
19
- };
5
+ const u = ({ children: o, spacing: t = 2, horizontal: e = !1, ...i }) => r(d, { paddingTop: 2, paddingBottom: 4, children: r(l, { as: "ol", gap: t, direction: e ? "row" : "column", alignItems: e ? "center" : "stretch", ...i, children: c.Children.map(o, (n, m) => r("li", { children: n }, m)) }) });
20
6
  export {
21
- s as SubNavSections
7
+ u as SubNavSections
22
8
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),f=require("prop-types"),m=require("styled-components"),p=require("./Divider.cjs"),a=require("../../Flex/Flex.cjs"),y=require("../../Box/Box.cjs"),l=e=>e&&e.__esModule?e:{default:e},r=l(f),b=l(m),g=b.default(a.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),u=require("styled-components"),h=require("./Divider.cjs"),s=require("../../Flex/Flex.cjs"),m=require("../../Box/Box.cjs"),b=e=>e&&e.__esModule?e:{default:e},f=b(u),x=f.default(s.Flex)`
2
2
  // CrumbLinks do have padding-x, because they need to have a
3
3
  // interaction effect, which mis-aligns the breadcrumbs on the left.
4
4
  // This normalizes the behavior by moving the first item to left by
@@ -6,4 +6,4 @@
6
6
  :first-child {
7
7
  margin-left: ${({theme:e})=>`calc(-1*${e.spaces[2]})`};
8
8
  }
9
- `,s=({label:e,children:d,...o})=>{const i=n.Children.toArray(d);return t.jsx(y.Box,{"aria-label":e,...o,children:t.jsx(g,{as:"ol",horizontal:!0,children:n.Children.map(i,(u,c)=>{const h=i.length>1&&c+1<i.length;return t.jsxs(a.Flex,{inline:!0,as:"li",children:[u,h&&t.jsx(p.Divider,{})]})})})})};s.displayName="Breadcrumbs";s.propTypes={children:r.default.oneOfType([r.default.arrayOf(r.default.node),r.default.node]).isRequired,label:r.default.string.isRequired};exports.Breadcrumbs=s;
9
+ `,n=({label:e,children:a,...l})=>{const r=i.Children.toArray(a);return t.jsx(m.Box,{"aria-label":e,...l,children:t.jsx(x,{as:"ol",children:i.Children.map(r,(o,c)=>{const d=r.length>1&&c+1<r.length;return t.jsxs(s.Flex,{inline:!0,as:"li",children:[o,d&&t.jsx(h.Divider,{})]})})})})};n.displayName="Breadcrumbs";exports.Breadcrumbs=n;