@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,86 +1,39 @@
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";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
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 { Divider as E } from "../../Divider/Divider.js";
10
- import { Box as a } from "../../Box/Box.js";
11
- import { SearchForm as O } from "../../Searchbar/SearchForm.js";
12
- import { Searchbar as F } from "../../Searchbar/Searchbar.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(E)`
9
+ import { Box as t } from "../../Box/Box.js";
10
+ import { SearchForm as L } from "../../Searchbar/SearchForm.js";
11
+ import { Searchbar as O } from "../../Searchbar/Searchbar.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 l = I(E)`
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: s = "", searchable: u = !1, onChange: h = () => {
19
+ }, value: g = "", onClear: S = () => {
20
+ }, onSubmit: b = () => {
21
+ }, id: y }) => {
22
+ const [o, a] = R(!1), f = k(o), B = j(y), n = p(void 0), d = p(void 0);
23
+ w(() => {
24
+ o && n.current && n.current.focus(), f && !o && d.current && d.current.focus();
25
+ }, [o, f]);
26
+ const C = () => {
27
+ a((r) => !r);
28
+ }, v = (r) => {
29
+ S(r), n.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(O, { children: /* @__PURE__ */ e(
35
- F,
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 ? c(t, { paddingLeft: 4, paddingTop: 5, paddingBottom: 2, paddingRight: 4, children: [e(L, { children: e(O, { name: "searchbar", value: g, onChange: h, placeholder: "e.g: strapi-plugin-abcd", onKeyDown: T, ref: n, onBlur: x, onClear: v, onSubmit: b, clearLabel: "Clear", size: "S", children: s }) }), e(t, { paddingLeft: 2, paddingTop: 4, children: e(l, {}) })] }) : c(t, { paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [c(F, { justifyContent: "space-between", alignItems: "flex-start", children: [e(P, { variant: "beta", as: i, children: m }), u && e($, { ref: d, onClick: C, label: s, icon: e(D, {}) })] }), e(t, { paddingTop: 4, children: e(l, {}) })] });
83
36
  };
84
37
  export {
85
- u as SubNavHeader
38
+ Z as SubNavHeader
86
39
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),x=require("react"),h=require("@strapi/icons"),b=require("prop-types"),$=require("styled-components"),s=require("../../Box/Box.cjs"),c=require("../../Typography/Typography.cjs"),a=require("../../Flex/Flex.cjs"),m=require("../../BaseLink/BaseLink.cjs"),i=e=>e&&e.__esModule?e:{default:e},v=i(x),t=i(b),n=i($),j=n.default(s.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),x=require("@strapi/icons"),y=require("styled-components"),t=require("../../Box/Box.cjs"),n=require("../../Typography/Typography.cjs"),i=require("../../Flex/Flex.cjs"),h=require("../../BaseLink/BaseLink.cjs"),a=e=>e&&e.__esModule?e:{default:e},$=a(g),s=a(y),j=s.default(t.Box)`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: space-between;
@@ -15,7 +15,7 @@
15
15
  svg > * {
16
16
  fill: ${e.colors.primary700};
17
17
  }
18
- ${c.Typography} {
18
+ ${n.Typography} {
19
19
  color: ${e.colors.primary700};
20
20
  font-weight: 500;
21
21
  }
@@ -25,15 +25,15 @@
25
25
  &:focus-visible {
26
26
  outline-offset: -2px;
27
27
  }
28
- `,u=n.default(h.Dot)`
28
+ `,l=s.default(x.Dot)`
29
29
  width: ${12/16}rem;
30
30
  height: ${4/16}rem;
31
31
  * {
32
32
  fill: ${({theme:e,$active:o})=>o?e.colors.primary600:e.colors.neutral600};
33
33
  }
34
- `,q=n.default.div`
34
+ `,v=s.default.div`
35
35
  svg {
36
36
  height: ${12/16}rem;
37
37
  width: ${12/16}rem;
38
38
  }
39
- `,l=v.default.forwardRef(({children:e,icon:o,withBullet:d,as:p,isSubSectionChild:f,...y},g)=>r.jsxs(j,{as:p,icon:o,background:"neutral100",paddingLeft:f?9:7,paddingBottom:2,paddingTop:2,ref:g,...y,children:[r.jsxs(a.Flex,{children:[o?r.jsx(q,{children:o}):r.jsx(u,{}),r.jsx(s.Box,{paddingLeft:2,children:r.jsx(c.Typography,{as:"span",children:e})})]}),d&&r.jsx(s.Box,{as:a.Flex,paddingRight:4,children:r.jsx(u,{$active:!0})})]}));l.displayName="SubNavLink";l.defaultProps={as:m.BaseLink,icon:null,isSubSectionChild:!1,withBullet:!1};l.propTypes={as:t.default.elementType,children:t.default.node.isRequired,icon:t.default.element,isSubSectionChild:t.default.bool,withBullet:t.default.bool};exports.SubNavLink=l;
39
+ `,b=$.default.forwardRef(({children:e,icon:o=null,withBullet:c=!1,as:u=h.BaseLink,isSubSectionChild:d=!1,...p},f)=>r.jsxs(j,{as:u,icon:o,background:"neutral100",paddingLeft:d?9:7,paddingBottom:2,paddingTop:2,ref:f,...p,children:[r.jsxs(i.Flex,{children:[o?r.jsx(v,{children:o}):r.jsx(l,{}),r.jsx(t.Box,{paddingLeft:2,children:r.jsx(n.Typography,{as:"span",children:e})})]}),c&&r.jsx(t.Box,{as:i.Flex,paddingRight:4,children:r.jsx(l,{$active:!0})})]}));exports.SubNavLink=b;
@@ -1,13 +1,12 @@
1
- import { jsxs as s, jsx as o } from "react/jsx-runtime";
2
- import h from "react";
3
- import { Dot as y } from "@strapi/icons";
4
- import i from "prop-types";
5
- import l from "styled-components";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { Dot as g } from "@strapi/icons";
4
+ import e from "styled-components";
6
5
  import { Box as t } from "../../Box/Box.js";
7
- import { Typography as c } from "../../Typography/Typography.js";
8
- import { Flex as a } from "../../Flex/Flex.js";
6
+ import { Typography as s } from "../../Typography/Typography.js";
7
+ import { Flex as n } from "../../Flex/Flex.js";
9
8
  import { BaseLink as $ } from "../../BaseLink/BaseLink.js";
10
- const b = l(t)`
9
+ const h = e(t)`
11
10
  display: flex;
12
11
  align-items: center;
13
12
  justify-content: space-between;
@@ -24,7 +23,7 @@ const b = l(t)`
24
23
  svg > * {
25
24
  fill: ${r.colors.primary700};
26
25
  }
27
- ${c} {
26
+ ${s} {
28
27
  color: ${r.colors.primary700};
29
28
  font-weight: 500;
30
29
  }
@@ -34,51 +33,18 @@ const b = l(t)`
34
33
  &:focus-visible {
35
34
  outline-offset: -2px;
36
35
  }
37
- `, p = l(y)`
36
+ `, a = e(g)`
38
37
  width: ${12 / 16}rem;
39
38
  height: ${4 / 16}rem;
40
39
  * {
41
- fill: ${({ theme: r, $active: e }) => e ? r.colors.primary600 : r.colors.neutral600};
40
+ fill: ${({ theme: r, $active: i }) => i ? r.colors.primary600 : r.colors.neutral600};
42
41
  }
43
- `, v = l.div`
42
+ `, y = e.div`
44
43
  svg {
45
44
  height: ${12 / 16}rem;
46
45
  width: ${12 / 16}rem;
47
46
  }
48
- `, n = h.forwardRef(({ children: r, icon: e, withBullet: d, as: m, isSubSectionChild: f, ...u }, g) => /* @__PURE__ */ s(
49
- b,
50
- {
51
- as: m,
52
- icon: e,
53
- background: "neutral100",
54
- paddingLeft: f ? 9 : 7,
55
- paddingBottom: 2,
56
- paddingTop: 2,
57
- ref: g,
58
- ...u,
59
- children: [
60
- /* @__PURE__ */ s(a, { children: [
61
- e ? /* @__PURE__ */ o(v, { children: e }) : /* @__PURE__ */ o(p, {}),
62
- /* @__PURE__ */ o(t, { paddingLeft: 2, children: /* @__PURE__ */ o(c, { as: "span", children: r }) })
63
- ] }),
64
- d && /* @__PURE__ */ o(t, { as: a, paddingRight: 4, children: /* @__PURE__ */ o(p, { $active: !0 }) })
65
- ]
66
- }
67
- ));
68
- n.displayName = "SubNavLink";
69
- n.defaultProps = {
70
- as: $,
71
- icon: null,
72
- isSubSectionChild: !1,
73
- withBullet: !1
74
- };
75
- n.propTypes = {
76
- as: i.elementType,
77
- children: i.node.isRequired,
78
- icon: i.element,
79
- isSubSectionChild: i.bool,
80
- withBullet: i.bool
81
- };
47
+ `, R = u.forwardRef(({ children: r, icon: i = null, withBullet: c = !1, as: p = $, isSubSectionChild: d = !1, ...f }, m) => l(h, { as: p, icon: i, background: "neutral100", paddingLeft: d ? 9 : 7, paddingBottom: 2, paddingTop: 2, ref: m, ...f, children: [l(n, { children: [i ? o(y, { 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 }) })] }));
82
48
  export {
83
- n as SubNavLink
49
+ R as SubNavLink
84
50
  };
@@ -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"),q=require("../../Flex/Flex.cjs"),S=require("../../Typography/Typography.cjs"),c=e=>e&&e.__esModule?e:{default:e},i=c(y),s=c(j),m=s.default(o.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("react"),x=require("@strapi/icons"),h=require("styled-components"),g=require("../../hooks/useId.cjs"),i=require("../../Box/Box.cjs"),f=require("../../Flex/Flex.cjs"),j=require("../../Typography/Typography.cjs"),y=e=>e&&e.__esModule?e:{default:e},o=y(h),S=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
- `,k=s.default.button`
8
+ `,b=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
- `,v=s.default.div`
14
+ `,m=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,g]=l.useState(!0),a=b.useId(p),h=()=>{g(r=>!r)};return t.jsxs(o.Box,{children:[t.jsx(m,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsx(q.Flex,{justifyContent:"space-between",children:t.jsxs(k,{onClick:h,"aria-expanded":n,"aria-controls":a,children:[t.jsx(v,{rotated:n,children:t.jsx(f.CarretDown,{"aria-hidden":!0})}),t.jsx(o.Box,{paddingLeft:2,children:t.jsx(S.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={id:void 0};d.propTypes={children:i.default.node.isRequired,id:i.default.string,label:i.default.string.isRequired};exports.SubNavLinkSection=d;
19
+ `,k=({label:e,children:a,id:l})=>{const[n,c]=d.useState(!0),s=g.useId(l),u=()=>{c(r=>!r)};return t.jsxs(i.Box,{children:[t.jsx(S,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsx(f.Flex,{justifyContent:"space-between",children:t.jsxs(b,{onClick:u,"aria-expanded":n,"aria-controls":s,children:[t.jsx(m,{rotated:n,children:t.jsx(x.CarretDown,{"aria-hidden":!0})}),t.jsx(i.Box,{paddingLeft:2,children:t.jsx(j.Typography,{as:"span",fontWeight:"semiBold",textColor:"neutral800",children:e})})]})})}),n&&t.jsx("ul",{id:s,children:d.Children.map(a,(r,p)=>t.jsx("li",{children:r},p))})]})};exports.SubNavLinkSection=k;
@@ -1,50 +1,35 @@
1
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
- import { useState as u, Children as f } from "react";
3
- import { CarretDown as g } from "@strapi/icons";
4
- import n 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 { useState as m, Children as h } from "react";
3
+ import { CarretDown as f } from "@strapi/icons";
4
+ import o from "styled-components";
5
+ import { useId as g } 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 x } from "../../Typography/Typography.js";
9
+ const k = 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
- `, C = d.button`
16
+ `, b = o.button`
18
17
  border: none;
19
18
  padding: 0;
20
19
  background: transparent;
21
20
  display: flex;
22
21
  align-items: center;
23
- `, S = d.div`
22
+ `, C = 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] = u(!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(C, { onClick: () => {
32
- m((t) => !t);
33
- }, "aria-expanded": i, "aria-controls": a, children: [
34
- /* @__PURE__ */ e(S, { rotated: i, children: /* @__PURE__ */ e(g, { "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: f.map(s, (t, h) => /* @__PURE__ */ e("li", { children: t }, h)) })
38
- ] });
39
- };
40
- l.defaultProps = {
41
- id: void 0
42
- };
43
- l.propTypes = {
44
- children: n.node.isRequired,
45
- id: n.string,
46
- label: n.string.isRequired
26
+ transform: rotateX(${({ rotated: t }) => t ? "0deg" : "180deg"});
27
+ `, I = ({ label: t, children: l, id: p }) => {
28
+ const [n, s] = m(!0), d = g(p);
29
+ return a(i, { children: [e(k, { paddingLeft: 7, paddingTop: 2, paddingBottom: 2, paddingRight: 4, children: e(u, { justifyContent: "space-between", children: a(b, { onClick: () => {
30
+ s((r) => !r);
31
+ }, "aria-expanded": n, "aria-controls": d, children: [e(C, { rotated: n, children: e(f, { "aria-hidden": !0 }) }), e(i, { paddingLeft: 2, children: e(x, { as: "span", fontWeight: "semiBold", textColor: "neutral800", children: t }) })] }) }) }), n && e("ul", { id: d, children: h.map(l, (r, c) => e("li", { children: r }, c)) })] });
47
32
  };
48
33
  export {
49
- l as SubNavLinkSection
34
+ I as SubNavLinkSection
50
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"),j=require("../../hooks/useId.cjs"),d=require("../../Box/Box.cjs"),v=require("../../Flex/Flex.cjs"),m=require("../../Badge/Badge.cjs"),u=e=>e&&e.__esModule?e:{default:e},r=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"),s=require("react"),h=require("styled-components"),x=require("./SubNavSectionLabel.cjs"),S=require("../../hooks/useId.cjs"),l=require("../../Box/Box.cjs"),f=require("../../Flex/Flex.cjs"),j=require("../../Badge/Badge.cjs"),b=e=>e&&e.__esModule?e:{default:e},m=b(h),q=m.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:i,children:p,id:g})=>{const[s,f]=a.useState(!0),l=j.useId(g),h=()=>{f(n=>!n)};return t.jsxs(v.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(_,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsxs(d.Box,{position:"relative",paddingRight:i?6:0,children:[t.jsx(q.SubNavSectionLabel,{onClick:h,ariaExpanded:s,ariaControls:l,collapsable:e,label:c}),i&&t.jsx(m.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:i})]})}),(!e||s)&&t.jsx("ol",{id:l,children:a.Children.map(p,(n,x)=>t.jsx("li",{children:n},x))})]})};o.defaultProps={badgeLabel:null,collapsable:!1,id:void 0};o.propTypes={badgeLabel:r.default.string,children:r.default.node.isRequired,collapsable:r.default.bool,id:r.default.string,label:r.default.string.isRequired};exports.SubNavSection=o;
8
+ `,v=({collapsable:e=!1,label:a,badgeLabel:n,children:c,id:d})=>{const[i,u]=s.useState(!0),o=S.useId(d),p=()=>{u(r=>!r)};return t.jsxs(f.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(q,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsxs(l.Box,{position:"relative",paddingRight:n?6:0,children:[t.jsx(x.SubNavSectionLabel,{onClick:p,ariaExpanded:i,ariaControls:o,collapsable:e,label:a}),n&&t.jsx(j.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:n})]})}),(!e||i)&&t.jsx("ol",{id:o,children:s.Children.map(c,(r,g)=>t.jsx("li",{children:r},g))})]})};exports.SubNavSection=v;
@@ -1,63 +1,24 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { useState as h, Children as f } from "react";
3
- import o from "prop-types";
4
- import b from "styled-components";
5
- import { SubNavSectionLabel as x } from "./SubNavSectionLabel.js";
6
- import { useId as C } from "../../hooks/useId.js";
7
- import { Box as d } from "../../Box/Box.js";
8
- import { Flex as S } from "../../Flex/Flex.js";
9
- import { Badge as v } from "../../Badge/Badge.js";
10
- const k = b(d)`
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { useState as h, Children as u } from "react";
3
+ import f from "styled-components";
4
+ import { SubNavSectionLabel as g } from "./SubNavSectionLabel.js";
5
+ import { useId as x } from "../../hooks/useId.js";
6
+ import { Box as a } from "../../Box/Box.js";
7
+ import { Flex as C } from "../../Flex/Flex.js";
8
+ import { Badge as S } from "../../Badge/Badge.js";
9
+ const k = f(a)`
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
- `, s = ({ collapsable: i, label: p, badgeLabel: t, children: c, id: m }) => {
18
- const [n, u] = h(!0), l = C(m);
19
- return /* @__PURE__ */ a(S, { direction: "column", alignItems: "stretch", gap: 1, children: [
20
- /* @__PURE__ */ r(k, { paddingLeft: 6, paddingTop: 2, paddingBottom: 2, paddingRight: 4, children: /* @__PURE__ */ a(d, { position: "relative", paddingRight: t ? 6 : 0, children: [
21
- /* @__PURE__ */ r(
22
- x,
23
- {
24
- onClick: () => {
25
- u((e) => !e);
26
- },
27
- ariaExpanded: n,
28
- ariaControls: l,
29
- collapsable: i,
30
- label: p
31
- }
32
- ),
33
- t && /* @__PURE__ */ r(
34
- v,
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__ */ r("ol", { id: l, children: f.map(c, (e, g) => /* @__PURE__ */ r("li", { children: e }, g)) })
47
- ] });
48
- };
49
- s.defaultProps = {
50
- badgeLabel: null,
51
- collapsable: !1,
52
- id: void 0
53
- };
54
- s.propTypes = {
55
- badgeLabel: o.string,
56
- children: o.node.isRequired,
57
- collapsable: o.bool,
58
- id: o.string,
59
- label: o.string.isRequired
16
+ `, y = ({ collapsable: o = !1, label: d, badgeLabel: r, children: p, id: s }) => {
17
+ const [n, c] = h(!0), e = x(s);
18
+ return l(C, { direction: "column", alignItems: "stretch", gap: 1, children: [t(k, { paddingLeft: 6, paddingTop: 2, paddingBottom: 2, paddingRight: 4, children: l(a, { position: "relative", paddingRight: r ? 6 : 0, children: [t(g, { onClick: () => {
19
+ c((i) => !i);
20
+ }, ariaExpanded: n, ariaControls: e, collapsable: o, label: d }), r && t(S, { backgroundColor: "neutral150", textColor: "neutral600", position: "absolute", right: 0, top: "50%", transform: "translateY(-50%)", children: r })] }) }), (!o || n) && t("ol", { id: e, children: u.map(p, (i, m) => t("li", { children: i }, m)) })] });
60
21
  };
61
22
  export {
62
- s as SubNavSection
23
+ y as SubNavSection
63
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 e=require("react/jsx-runtime"),s=require("react"),l=require("../../Box/Box.cjs"),u=require("../../Flex/Flex.cjs"),a=({children:t,spacing:n=2,horizontal:r=!1,...i})=>e.jsx(l.Box,{paddingTop:2,paddingBottom:4,children:e.jsx(u.Flex,{as:"ol",gap:n,direction:r?"row":"column",alignItems:r?"center":"stretch",...i,children:s.Children.map(t,(o,c)=>e.jsx("li",{children:o},c))})});exports.SubNavSections=a;
@@ -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";
2
+ import { Children as p } from "react";
4
3
  import { Box as c } from "../../Box/Box.js";
5
- 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
- };
4
+ import { Flex as d } from "../../Flex/Flex.js";
5
+ const g = ({ children: e, spacing: t = 2, horizontal: o = !1, ...i }) => r(c, { paddingTop: 2, paddingBottom: 4, children: r(d, { as: "ol", gap: t, direction: o ? "row" : "column", alignItems: o ? "center" : "stretch", ...i, children: p.map(e, (n, m) => r("li", { children: n }, m)) }) });
20
6
  export {
21
- s as SubNavSections
7
+ g as SubNavSections
22
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/design-system",
3
- "version": "1.7.7",
3
+ "version": "1.7.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,7 +24,7 @@
24
24
  "@radix-ui/react-dismissable-layer": "^1.0.3",
25
25
  "@radix-ui/react-dropdown-menu": "^2.0.4",
26
26
  "@radix-ui/react-focus-scope": "1.0.2",
27
- "@strapi/ui-primitives": "^1.7.7",
27
+ "@strapi/ui-primitives": "^1.7.8",
28
28
  "@uiw/react-codemirror": "^4.19.16",
29
29
  "aria-hidden": "^1.2.3",
30
30
  "compute-scroll-into-view": "^3.0.3",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@playwright/test": "1.33.0",
36
- "@strapi/icons": "^1.7.7",
36
+ "@strapi/icons": "^1.7.8",
37
37
  "@types/react-router-dom": "^5.3.3",
38
38
  "@types/styled-components": "^5.1.26",
39
39
  "axe-playwright": "^1.2.3",
@@ -64,5 +64,5 @@
64
64
  "test:e2e:watch": "chokidar '**/__tests__/*.e2e.js' -c 'npm run test:e2e -- --retries=0 {path}'",
65
65
  "test:e2e:debug": "cross-env PWDEBUG=1 playwright test"
66
66
  },
67
- "gitHead": "95a02179f945511d2c5fb50efb880ed13f3169c9"
67
+ "gitHead": "d82da913a5a9f8d8abd785e95f893fa4100d5793"
68
68
  }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext({gap:0,gridCols:12}),o=()=>e.useContext(t);exports.GridContext=t;exports.useGrid=o;
@@ -1,6 +0,0 @@
1
- import { createContext as t, useContext as o } from "react";
2
- const e = t({ gap: 0, gridCols: 12 }), n = () => o(e);
3
- export {
4
- e as GridContext,
5
- n as useGrid
6
- };