@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,12 +1,10 @@
1
1
  import { jsxs as e, jsx as i } from "react/jsx-runtime";
2
- import "react";
3
- import t from "prop-types";
4
- import d from "styled-components";
2
+ import t from "styled-components";
5
3
  import { Box as o } from "../Box/Box.js";
6
- import { Divider as m } from "../Divider/Divider.js";
7
- import { Flex as s } from "../Flex/Flex.js";
8
- import { Typography as a } from "../Typography/Typography.js";
9
- const c = d(o)`
4
+ import { Divider as a } from "../Divider/Divider.js";
5
+ import { Flex as m } from "../Flex/Flex.js";
6
+ import { Typography as p } from "../Typography/Typography.js";
7
+ const s = t(o)`
10
8
  height: ${24 / 16}rem;
11
9
  width: ${24 / 16}rem;
12
10
  border-radius: 50%;
@@ -22,22 +20,12 @@ const c = d(o)`
22
20
  svg path {
23
21
  fill: ${({ theme: r }) => r.colors.primary600};
24
22
  }
25
- `, l = d(o)`
23
+ `, l = t(o)`
26
24
  border-radius: 0 0 ${({ theme: r }) => r.borderRadius} ${({ theme: r }) => r.borderRadius};
27
25
  display: block;
28
26
  width: 100%;
29
27
  border: none;
30
- `, h = ({ children: r, icon: n, ...p }) => /* @__PURE__ */ e("div", { children: [
31
- /* @__PURE__ */ i(m, {}),
32
- /* @__PURE__ */ i(l, { as: "button", background: "primary100", padding: 5, ...p, children: /* @__PURE__ */ e(s, { children: [
33
- /* @__PURE__ */ i(c, { "aria-hidden": !0, background: "primary200", children: n }),
34
- /* @__PURE__ */ i(o, { paddingLeft: 3, children: /* @__PURE__ */ i(a, { variant: "pi", fontWeight: "bold", textColor: "primary600", children: r }) })
35
- ] }) })
36
- ] });
37
- h.propTypes = {
38
- children: t.string.isRequired,
39
- icon: t.node.isRequired
40
- };
28
+ `, y = ({ children: r, icon: d, ...n }) => e("div", { children: [i(a, {}), i(l, { as: "button", background: "primary100", padding: 5, ...n, children: e(m, { children: [i(s, { "aria-hidden": !0, background: "primary200", children: d }), i(o, { paddingLeft: 3, children: i(p, { variant: "pi", fontWeight: "bold", textColor: "primary600", children: r }) })] }) })] });
41
29
  export {
42
- h as TFooter
30
+ y as TFooter
43
31
  };
@@ -1,19 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),w=require("prop-types"),x=require("styled-components"),T=require("../RawTable/RawTable.cjs"),n=require("../Box/Box.cjs"),c=e=>e&&e.__esModule?e:{default:e},i=c(w),a=c(x),R=a.default(n.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),f=require("styled-components"),h=require("../RawTable/RawTable.cjs"),s=require("../Box/Box.cjs"),b=t=>t&&t.__esModule?t:{default:t},a=b(f),g=a.default(s.Box)`
2
2
  overflow: hidden;
3
- border: 1px solid ${({theme:e})=>e.colors.neutral150};
4
- `,S=a.default(T.RawTable)`
3
+ border: 1px solid ${({theme:t})=>t.colors.neutral150};
4
+ `,w=a.default(h.RawTable)`
5
5
  width: 100%;
6
6
  white-space: nowrap;
7
- `,y=a.default(n.Box)`
7
+ `,p=a.default(s.Box)`
8
8
  &:before {
9
9
  // TODO: make sure to add a token for this weird stuff
10
10
  background: linear-gradient(90deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
11
11
  opacity: 0.2;
12
12
  position: absolute;
13
13
  height: 100%;
14
- content: ${({overflowing:e})=>e==="both"||e==="left"?"''":void 0};
15
- box-shadow: ${({theme:e})=>e.shadows.tableShadow};
16
- width: ${({theme:e})=>e.spaces[2]};
14
+ content: ${({overflowing:t})=>t==="both"||t==="left"?"''":void 0};
15
+ box-shadow: ${({theme:t})=>t.shadows.tableShadow};
16
+ width: ${({theme:t})=>t.spaces[2]};
17
17
  left: 0;
18
18
  }
19
19
 
@@ -23,12 +23,12 @@
23
23
  opacity: 0.2;
24
24
  position: absolute;
25
25
  height: 100%;
26
- content: ${({overflowing:e})=>e==="both"||e==="right"?"''":void 0};
27
- box-shadow: ${({theme:e})=>e.shadows.tableShadow};
28
- width: ${({theme:e})=>e.spaces[2]};
26
+ content: ${({overflowing:t})=>t==="both"||t==="right"?"''":void 0};
27
+ box-shadow: ${({theme:t})=>t.shadows.tableShadow};
28
+ width: ${({theme:t})=>t.spaces[2]};
29
29
  right: 0;
30
30
  top: 0;
31
31
  }
32
- `,q=a.default(n.Box)`
32
+ `,x=a.default(s.Box)`
33
33
  overflow-x: auto;
34
- `,d=({colCount:e,rowCount:u,footer:f,...h})=>{const s=l.useRef(null),[b,o]=l.useState(),g=t=>{const p=t.target.scrollWidth-t.target.clientWidth;if(t.target.scrollLeft===0){o("right");return}if(t.target.scrollLeft===p){o("left");return}t.target.scrollLeft>0&&o("both")};return l.useEffect(()=>{s.current.scrollWidth>s.current.clientWidth&&o("right")},[]),r.jsxs(R,{shadow:"tableShadow",hasRadius:!0,background:"neutral0",children:[r.jsx(y,{overflowing:b,position:"relative",children:r.jsx(q,{ref:s,onScroll:g,paddingLeft:6,paddingRight:6,children:r.jsx(S,{colCount:e,rowCount:u,...h})})}),f]})};d.defaultProps={footer:void 0};d.propTypes={colCount:i.default.number.isRequired,footer:i.default.node,rowCount:i.default.number.isRequired};exports.Table=d;
34
+ `,S=({footer:t,...i})=>{const l=n.useRef(null),[d,o]=n.useState(),c=e=>{const u=e.target.scrollWidth-e.target.clientWidth;if(e.target.scrollLeft===0){o("right");return}if(e.target.scrollLeft===u){o("left");return}e.target.scrollLeft>0&&o("both")};return n.useEffect(()=>{l.current.scrollWidth>l.current.clientWidth&&o("right")},[]),r.jsxs(g,{shadow:"tableShadow",hasRadius:!0,background:"neutral0",children:[r.jsx(p,{overflowing:d,position:"relative",children:r.jsx(x,{ref:l,onScroll:c,paddingLeft:6,paddingRight:6,children:r.jsx(w,{...i})})}),t]})};exports.Table=S;
@@ -1,16 +1,15 @@
1
- import { jsxs as b, jsx as i } from "react/jsx-runtime";
2
- import { useRef as g, useState as w, useEffect as m } from "react";
3
- import s from "prop-types";
1
+ import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
+ import { useRef as h, useState as u, useEffect as g } from "react";
4
3
  import r from "styled-components";
5
- import { RawTable as x } from "../RawTable/RawTable.js";
4
+ import { RawTable as b } from "../RawTable/RawTable.js";
6
5
  import { Box as n } from "../Box/Box.js";
7
- const T = r(n)`
6
+ const p = r(n)`
8
7
  overflow: hidden;
9
8
  border: 1px solid ${({ theme: t }) => t.colors.neutral150};
10
- `, S = r(x)`
9
+ `, w = r(b)`
11
10
  width: 100%;
12
11
  white-space: nowrap;
13
- `, k = r(n)`
12
+ `, m = r(n)`
14
13
  &:before {
15
14
  // TODO: make sure to add a token for this weird stuff
16
15
  background: linear-gradient(90deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
@@ -35,36 +34,25 @@ const T = r(n)`
35
34
  right: 0;
36
35
  top: 0;
37
36
  }
38
- `, R = r(n)`
37
+ `, x = r(n)`
39
38
  overflow-x: auto;
40
- `, l = ({ colCount: t, rowCount: d, footer: c, ...f }) => {
41
- const a = g(null), [h, e] = w(), u = (o) => {
42
- const p = o.target.scrollWidth - o.target.clientWidth;
43
- if (o.target.scrollLeft === 0) {
44
- e("right");
39
+ `, O = ({ footer: t, ...l }) => {
40
+ const a = h(null), [s, o] = u(), d = (e) => {
41
+ const c = e.target.scrollWidth - e.target.clientWidth;
42
+ if (e.target.scrollLeft === 0) {
43
+ o("right");
45
44
  return;
46
45
  }
47
- if (o.target.scrollLeft === p) {
48
- e("left");
46
+ if (e.target.scrollLeft === c) {
47
+ o("left");
49
48
  return;
50
49
  }
51
- o.target.scrollLeft > 0 && e("both");
50
+ e.target.scrollLeft > 0 && o("both");
52
51
  };
53
- return m(() => {
54
- a.current.scrollWidth > a.current.clientWidth && e("right");
55
- }, []), /* @__PURE__ */ b(T, { shadow: "tableShadow", hasRadius: !0, background: "neutral0", children: [
56
- /* @__PURE__ */ i(k, { overflowing: h, position: "relative", children: /* @__PURE__ */ i(R, { ref: a, onScroll: u, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ i(S, { colCount: t, rowCount: d, ...f }) }) }),
57
- c
58
- ] });
59
- };
60
- l.defaultProps = {
61
- footer: void 0
62
- };
63
- l.propTypes = {
64
- colCount: s.number.isRequired,
65
- footer: s.node,
66
- rowCount: s.number.isRequired
52
+ return g(() => {
53
+ a.current.scrollWidth > a.current.clientWidth && o("right");
54
+ }, []), f(p, { shadow: "tableShadow", hasRadius: !0, background: "neutral0", children: [i(m, { overflowing: s, position: "relative", children: i(x, { ref: a, onScroll: d, paddingLeft: 6, paddingRight: 6, children: i(w, { ...l }) }) }), t] });
67
55
  };
68
56
  export {
69
- l as Table
57
+ O as Table
70
58
  };
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const o=require("styled-components"),r=require("../RawTable/RawTbody.cjs"),s=e=>e&&e.__esModule?e:{default:e},d=s(o),n=d.default(r.RawTbody)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("styled-components"),d=require("../RawTable/RawTbody.cjs"),n=t=>t&&t.__esModule?t:{default:t},s=n(r),u=s.default(d.RawTbody)`
2
2
  & tr:last-of-type {
3
3
  border-bottom: none;
4
4
  }
5
- `,u=e=>t.jsx(n,{...e});exports.Tbody=u;
5
+ `,l=({children:t,...e})=>o.jsx(u,{...e,children:t});exports.Tbody=l;
@@ -1,12 +1,11 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import t from "styled-components";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import e from "styled-components";
4
3
  import { RawTbody as m } from "../RawTable/RawTbody.js";
5
- const p = t(m)`
4
+ const p = e(m)`
6
5
  & tr:last-of-type {
7
6
  border-bottom: none;
8
7
  }
9
- `, s = (o) => /* @__PURE__ */ r(p, { ...o });
8
+ `, s = ({ children: o, ...r }) => t(p, { ...r, children: o });
10
9
  export {
11
10
  s as Tbody
12
11
  };
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const r=require("styled-components"),o=require("../RawTable/RawThead.cjs"),s=e=>e&&e.__esModule?e:{default:e},a=s(r),d=a.default(o.RawThead)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("styled-components"),d=require("../RawTable/RawThead.cjs"),s=e=>e&&e.__esModule?e:{default:e},a=s(o),l=a.default(d.RawThead)`
2
2
  border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
3
- `,u=e=>t.jsx(d,{...e});exports.Thead=u;
3
+ `,n=({children:e,...t})=>r.jsx(l,{...t,children:e});exports.Thead=n;
@@ -1,10 +1,9 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import t from "styled-components";
4
- import { RawThead as e } from "../RawTable/RawThead.js";
5
- const m = t(e)`
6
- border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral150};
7
- `, i = (o) => /* @__PURE__ */ r(m, { ...o });
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import e from "styled-components";
3
+ import { RawThead as d } from "../RawTable/RawThead.js";
4
+ const m = e(d)`
5
+ border-bottom: 1px solid ${({ theme: r }) => r.colors.neutral150};
6
+ `, i = ({ children: r, ...o }) => t(m, { ...o, children: r });
8
7
  export {
9
8
  i as Thead
10
9
  };
package/dist/Table/Tr.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const r=require("styled-components"),o=require("../RawTable/RawTr.cjs"),s=t=>t&&t.__esModule?t:{default:t},d=s(r),i=d.default(o.RawTr)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("styled-components"),o=require("../RawTable/RawTr.cjs"),s=t=>t&&t.__esModule?t:{default:t},d=s(r),i=d.default(o.RawTr)`
2
2
  border-bottom: 1px solid ${({theme:t})=>t.colors.neutral150};
3
3
 
4
4
  & td,
package/dist/Table/Tr.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
2
  import o from "styled-components";
4
3
  import { RawTr as p } from "../RawTable/RawTr.js";
5
- const i = o(p)`
4
+ const d = o(p)`
6
5
  border-bottom: 1px solid ${({ theme: t }) => t.colors.neutral150};
7
6
 
8
7
  & td,
@@ -21,7 +20,7 @@ const i = o(p)`
21
20
  padding-bottom: 0;
22
21
  height: ${56 / 16}rem;
23
22
  }
24
- `, n = (t) => /* @__PURE__ */ r(i, { ...t });
23
+ `, a = (t) => r(d, { ...t });
25
24
  export {
26
- n as Tr
25
+ a as Tr
27
26
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const a=require("prop-types"),s=require("styled-components"),i=require("./MainNavContext.cjs"),l=require("../../Flex/Flex.cjs"),r=e=>e&&e.__esModule?e:{default:e},u=r(a),d=r(s),c=d.default(l.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("styled-components"),o=require("./MainNavContext.cjs"),a=require("../../Flex/Flex.cjs"),i=e=>e&&e.__esModule?e:{default:e},s=i(r),l=s.default(a.Flex)`
2
2
  width: ${({condensed:e})=>e?"max-content":`${224/16}rem`};
3
3
  border-right: 1px solid ${({theme:e})=>e.colors.neutral150};
4
- `,t=({condensed:e,...n})=>o.jsx(i.MainNavContext.Provider,{value:e,children:o.jsx(c,{alignItems:"normal",as:"nav",background:"neutral0",condensed:e,direction:"column",height:"100vh",position:"sticky",top:0,zIndex:2,...n})});t.defaultProps={condensed:!1};t.propTypes={condensed:u.default.bool};exports.MainNav=t;
4
+ `,u=({condensed:e=!1,...n})=>t.jsx(o.MainNavContext.Provider,{value:e,children:t.jsx(l,{alignItems:"normal",as:"nav",background:"neutral0",condensed:e,direction:"column",height:"100vh",position:"sticky",top:0,zIndex:2,...n})});exports.MainNav=u;
@@ -1,33 +1,11 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import n from "prop-types";
4
- import i from "styled-components";
5
- import { MainNavContext as a } from "./MainNavContext.js";
6
- import { Flex as p } from "../../Flex/Flex.js";
7
- const m = i(p)`
8
- width: ${({ condensed: o }) => o ? "max-content" : `${224 / 16}rem`};
9
- border-right: 1px solid ${({ theme: o }) => o.colors.neutral150};
10
- `, t = ({ condensed: o, ...e }) => /* @__PURE__ */ r(a.Provider, { value: o, children: /* @__PURE__ */ r(
11
- m,
12
- {
13
- alignItems: "normal",
14
- as: "nav",
15
- background: "neutral0",
16
- condensed: o,
17
- direction: "column",
18
- height: "100vh",
19
- position: "sticky",
20
- top: 0,
21
- zIndex: 2,
22
- ...e
23
- }
24
- ) });
25
- t.defaultProps = {
26
- condensed: !1
27
- };
28
- t.propTypes = {
29
- condensed: n.bool
30
- };
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import n from "styled-components";
3
+ import { MainNavContext as e } from "./MainNavContext.js";
4
+ import { Flex as i } from "../../Flex/Flex.js";
5
+ const a = n(i)`
6
+ width: ${({ condensed: r }) => r ? "max-content" : `${224 / 16}rem`};
7
+ border-right: 1px solid ${({ theme: r }) => r.colors.neutral150};
8
+ `, c = ({ condensed: r = !1, ...t }) => o(e.Provider, { value: r, children: o(a, { alignItems: "normal", as: "nav", background: "neutral0", condensed: r, direction: "column", height: "100vh", position: "sticky", top: 0, zIndex: 2, ...t }) });
31
9
  export {
32
- t as MainNav
10
+ c as MainNav
33
11
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(),n=()=>e.useContext(t);exports.MainNavContext=t;exports.useMainNav=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(!1),a=()=>e.useContext(t);exports.MainNavContext=t;exports.useMainNav=a;
@@ -1,5 +1,5 @@
1
1
  import { createContext as t, useContext as e } from "react";
2
- const o = t(), a = () => e(o);
2
+ const o = t(!1), a = () => e(o);
3
3
  export {
4
4
  o as MainNavContext,
5
5
  a as useMainNav
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),f=require("prop-types"),y=require("styled-components"),j=require("./MainNavContext.cjs"),h=require("../../BaseLink/BaseLink.cjs"),t=require("../../Box/Box.cjs"),u=require("../../VisuallyHidden/VisuallyHidden.cjs"),q=require("../../Flex/Flex.cjs"),c=require("../../Typography/Typography.cjs"),i=e=>e&&e.__esModule?e:{default:e},B=i(g),r=i(f),x=i(y),p=x.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),p=require("react"),g=require("styled-components"),f=require("./MainNavContext.cjs"),c=require("../../BaseLink/BaseLink.cjs"),d=require("../../Box/Box.cjs"),s=require("../../VisuallyHidden/VisuallyHidden.cjs"),j=require("../../Flex/Flex.cjs"),o=require("../../Typography/Typography.cjs"),u=e=>e&&e.__esModule?e:{default:e},y=u(p),h=u(g),l=h.default.div`
2
2
  border-radius: ${({theme:e})=>e.borderRadius};
3
3
 
4
4
  svg,
@@ -6,7 +6,7 @@
6
6
  height: ${({condensed:e})=>e?`${40/16}rem`:`${32/16}rem`};
7
7
  width: ${({condensed:e})=>e?`${40/16}rem`:`${32/16}rem`};
8
8
  }
9
- `,m=x.default(h.BaseLink)`
9
+ `,B=h.default(c.BaseLink)`
10
10
  text-decoration: unset;
11
11
  color: inherit;
12
- `,d=B.default.forwardRef(({workplace:e,title:s,icon:a,...o},l)=>j.useMainNav()?n.jsx(h.BaseLink,{ref:l,...o,children:n.jsx(t.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:n.jsxs(p,{condensed:!0,children:[a,n.jsxs(u.VisuallyHidden,{children:[n.jsx("span",{children:s}),n.jsx("span",{children:e})]})]})})}):n.jsx(m,{ref:l,...o,children:n.jsx(t.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:n.jsxs(q.Flex,{children:[n.jsx(p,{"aria-hidden":!0,tabIndex:-1,children:a}),n.jsxs(t.Box,{paddingLeft:2,children:[n.jsxs(c.Typography,{fontWeight:"bold",textColor:"neutral800",as:"span",children:[s,n.jsx(u.VisuallyHidden,{as:"span",children:e})]}),n.jsx(c.Typography,{variant:"pi",as:"p",textColor:"neutral600","aria-hidden":!0,children:e})]})]})})}));d.displayName="NavBrand";d.defaultProps={to:"/"};d.propTypes={icon:r.default.node.isRequired,title:r.default.string.isRequired,to:r.default.string,workplace:r.default.string.isRequired};exports.NavBrand=d;
12
+ `,m=y.default.forwardRef(({workplace:e,title:t,icon:i,...r},a)=>{const x=f.useMainNav();return r.to=r?.to??"/",x?n.jsx(c.BaseLink,{ref:a,...r,children:n.jsx(d.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:n.jsxs(l,{condensed:!0,children:[i,n.jsxs(s.VisuallyHidden,{children:[n.jsx("span",{children:t}),n.jsx("span",{children:e})]})]})})}):n.jsx(B,{ref:a,...r,children:n.jsx(d.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:n.jsxs(j.Flex,{children:[n.jsx(l,{"aria-hidden":!0,tabIndex:-1,children:i}),n.jsxs(d.Box,{paddingLeft:2,children:[n.jsxs(o.Typography,{fontWeight:"bold",textColor:"neutral800",as:"span",children:[t,n.jsx(s.VisuallyHidden,{as:"span",children:e})]}),n.jsx(o.Typography,{variant:"pi",as:"p",textColor:"neutral600","aria-hidden":!0,children:e})]})]})})})});exports.NavBrand=m;
@@ -1,14 +1,13 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
1
+ import { jsx as d, jsxs as e } from "react/jsx-runtime";
2
2
  import f from "react";
3
- import d from "prop-types";
4
- import h from "styled-components";
5
- import { useMainNav as u } from "./MainNavContext.js";
6
- import { BaseLink as g } from "../../BaseLink/BaseLink.js";
3
+ import l from "styled-components";
4
+ import { useMainNav as g } from "./MainNavContext.js";
5
+ import { BaseLink as c } from "../../BaseLink/BaseLink.js";
7
6
  import { Box as n } from "../../Box/Box.js";
8
7
  import { VisuallyHidden as m } from "../../VisuallyHidden/VisuallyHidden.js";
9
- import { Flex as x } from "../../Flex/Flex.js";
10
- import { Typography as l } from "../../Typography/Typography.js";
11
- const c = h.div`
8
+ import { Flex as u } from "../../Flex/Flex.js";
9
+ import { Typography as p } from "../../Typography/Typography.js";
10
+ const h = l.div`
12
11
  border-radius: ${({ theme: r }) => r.borderRadius};
13
12
 
14
13
  svg,
@@ -16,35 +15,13 @@ const c = h.div`
16
15
  height: ${({ condensed: r }) => r ? `${40 / 16}rem` : `${32 / 16}rem`};
17
16
  width: ${({ condensed: r }) => r ? `${40 / 16}rem` : `${32 / 16}rem`};
18
17
  }
19
- `, R = h(g)`
18
+ `, x = l(c)`
20
19
  text-decoration: unset;
21
20
  color: inherit;
22
- `, t = f.forwardRef(({ workplace: r, title: o, icon: a, ...p }, s) => u() ? /* @__PURE__ */ e(g, { ref: s, ...p, children: /* @__PURE__ */ e(n, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: /* @__PURE__ */ i(c, { condensed: !0, children: [
23
- a,
24
- /* @__PURE__ */ i(m, { children: [
25
- /* @__PURE__ */ e("span", { children: o }),
26
- /* @__PURE__ */ e("span", { children: r })
27
- ] })
28
- ] }) }) }) : /* @__PURE__ */ e(R, { ref: s, ...p, children: /* @__PURE__ */ e(n, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: /* @__PURE__ */ i(x, { children: [
29
- /* @__PURE__ */ e(c, { "aria-hidden": !0, tabIndex: -1, children: a }),
30
- /* @__PURE__ */ i(n, { paddingLeft: 2, children: [
31
- /* @__PURE__ */ i(l, { fontWeight: "bold", textColor: "neutral800", as: "span", children: [
32
- o,
33
- /* @__PURE__ */ e(m, { as: "span", children: r })
34
- ] }),
35
- /* @__PURE__ */ e(l, { variant: "pi", as: "p", textColor: "neutral600", "aria-hidden": !0, children: r })
36
- ] })
37
- ] }) }) }));
38
- t.displayName = "NavBrand";
39
- t.defaultProps = {
40
- to: "/"
41
- };
42
- t.propTypes = {
43
- icon: d.node.isRequired,
44
- title: d.string.isRequired,
45
- to: d.string,
46
- workplace: d.string.isRequired
47
- };
21
+ `, W = f.forwardRef(({ workplace: r, title: t, icon: o, ...i }, a) => {
22
+ const s = g();
23
+ return i.to = i?.to ?? "/", s ? d(c, { ref: a, ...i, children: d(n, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: e(h, { condensed: !0, children: [o, e(m, { children: [d("span", { children: t }), d("span", { children: r })] })] }) }) }) : d(x, { ref: a, ...i, children: d(n, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: e(u, { children: [d(h, { "aria-hidden": !0, tabIndex: -1, children: o }), e(n, { paddingLeft: 2, children: [e(p, { fontWeight: "bold", textColor: "neutral800", as: "span", children: [t, d(m, { as: "span", children: r })] }), d(p, { variant: "pi", as: "p", textColor: "neutral600", "aria-hidden": !0, children: r })] })] }) }) });
24
+ });
48
25
  export {
49
- t as NavBrand
26
+ W as NavBrand
50
27
  };
@@ -1,10 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const s=require("@strapi/icons"),d=require("prop-types"),a=require("styled-components"),u=require("./MainNavContext.cjs"),l=require("../../Icon/Icon.cjs"),c=require("../../VisuallyHidden/VisuallyHidden.cjs"),o=e=>e&&e.__esModule?e:{default:e},h=o(d),p=o(a),g=p.default.button`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("@strapi/icons"),s=require("styled-components"),i=require("./MainNavContext.cjs"),d=require("../../Flex/Flex.cjs"),a=require("../../Icon/Icon.cjs"),u=require("../../VisuallyHidden/VisuallyHidden.cjs"),l=e=>e&&e.__esModule?e:{default:e},c=l(s),h=c.default(d.Flex).attrs(e=>({justifyContent:"center",...e}))`
2
2
  background: ${({theme:e})=>e.colors.neutral0};
3
3
  border: 1px solid ${({theme:e})=>e.colors.neutral150};
4
4
  border-radius: ${({theme:e})=>e.borderRadius};
5
- display: flex;
6
- align-items: center;
7
- justify-content: center;
8
5
  position: absolute;
9
6
  bottom: ${(9+4)/16}rem; // 9 is the height of the svg and 4 is the padding below
10
7
  right: ${({theme:e,condensed:t})=>t?0:e.spaces[5]};
@@ -17,4 +14,4 @@
17
14
  width: ${6/16}rem;
18
15
  height: ${9/16}rem;
19
16
  }
20
- `,i=({children:e,...t})=>{const n=u.useMainNav();return r.jsxs(g,{as:"button",condensed:n,...t,children:[r.jsx(l.Icon,{as:n?s.ChevronRight:s.ChevronLeft,"aria-hidden":!0,color:"neutral600"}),r.jsx(c.VisuallyHidden,{children:e})]})};i.propTypes={children:h.default.string.isRequired};exports.NavCondense=i;
17
+ `,g=({children:e,...t})=>{const r=i.useMainNav();return n.jsxs(h,{as:"button",condensed:r,...t,children:[n.jsx(a.Icon,{as:r?o.ChevronRight:o.ChevronLeft,"aria-hidden":!0,color:"neutral600"}),n.jsx(u.VisuallyHidden,{children:e})]})};exports.NavCondense=g;
@@ -1,18 +1,17 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import "react";
3
- import { ChevronRight as n, ChevronLeft as s } from "@strapi/icons";
4
- import d from "prop-types";
5
- import a from "styled-components";
6
- import { useMainNav as m } from "./MainNavContext.js";
7
- import { Icon as p } from "../../Icon/Icon.js";
8
- import { VisuallyHidden as h } from "../../VisuallyHidden/VisuallyHidden.js";
9
- const l = a.button`
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { ChevronRight as i, ChevronLeft as s } from "@strapi/icons";
3
+ import d from "styled-components";
4
+ import { useMainNav as a } from "./MainNavContext.js";
5
+ import { Flex as m } from "../../Flex/Flex.js";
6
+ import { Icon as h } from "../../Icon/Icon.js";
7
+ import { VisuallyHidden as l } from "../../VisuallyHidden/VisuallyHidden.js";
8
+ const c = d(m).attrs((r) => ({
9
+ justifyContent: "center",
10
+ ...r
11
+ }))`
10
12
  background: ${({ theme: r }) => r.colors.neutral0};
11
13
  border: 1px solid ${({ theme: r }) => r.colors.neutral150};
12
14
  border-radius: ${({ theme: r }) => r.borderRadius};
13
- display: flex;
14
- align-items: center;
15
- justify-content: center;
16
15
  position: absolute;
17
16
  bottom: ${(9 + 4) / 16}rem; // 9 is the height of the svg and 4 is the padding below
18
17
  right: ${({ theme: r, condensed: e }) => e ? 0 : r.spaces[5]};
@@ -25,16 +24,10 @@ const l = a.button`
25
24
  width: ${6 / 16}rem;
26
25
  height: ${9 / 16}rem;
27
26
  }
28
- `, c = ({ children: r, ...e }) => {
29
- const o = m();
30
- return /* @__PURE__ */ i(l, { as: "button", condensed: o, ...e, children: [
31
- /* @__PURE__ */ t(p, { as: o ? n : s, "aria-hidden": !0, color: "neutral600" }),
32
- /* @__PURE__ */ t(h, { children: r })
33
- ] });
34
- };
35
- c.propTypes = {
36
- children: d.string.isRequired
27
+ `, x = ({ children: r, ...e }) => {
28
+ const o = a();
29
+ return n(c, { as: "button", condensed: o, ...e, children: [t(h, { as: o ? i : s, "aria-hidden": !0, color: "neutral600" }), t(l, { children: r })] });
37
30
  };
38
31
  export {
39
- c as NavCondense
32
+ x as NavCondense
40
33
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const t=require("prop-types"),s=require("../../Box/Box.cjs"),i=e=>e&&e.__esModule?e:{default:e},u=i(t),o=({children:e})=>r.jsx(s.Box,{position:"relative",children:e});o.displayName="NavFooter";o.propTypes={children:u.default.node.isRequired};exports.NavFooter=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("../../Box/Box.cjs"),r=({children:e})=>o.jsx(t.Box,{position:"relative",children:e});exports.NavFooter=r;
@@ -1,12 +1,6 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import "react";
3
- import p from "prop-types";
4
- import { Box as i } from "../../Box/Box.js";
5
- const o = ({ children: r }) => /* @__PURE__ */ e(i, { position: "relative", children: r });
6
- o.displayName = "NavFooter";
7
- o.propTypes = {
8
- children: p.node.isRequired
9
- };
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Box as t } from "../../Box/Box.js";
3
+ const m = ({ children: o }) => r(t, { position: "relative", children: o });
10
4
  export {
11
- o as NavFooter
5
+ m as NavFooter
12
6
  };
@@ -1,16 +1,16 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),$=require("react"),x=require("prop-types"),v=require("styled-components"),b=require("./MainNavContext.cjs"),j=require("../../Box/Box.cjs"),m=require("../../BaseLink/BaseLink.cjs"),o=require("../../Typography/Typography.cjs"),y=require("../../Flex/Flex.cjs"),q=require("../../Badge/Badge.cjs"),T=require("../../Tooltip/Tooltip.cjs"),l=e=>e&&e.__esModule?e:{default:e},k=l($),a=l(x),n=l(v),p=n.default(j.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),$=require("react"),y=require("styled-components"),f=require("./MainNavContext.cjs"),x=require("../../Box/Box.cjs"),j=require("../../BaseLink/BaseLink.cjs"),s=require("../../Typography/Typography.cjs"),h=require("../../Flex/Flex.cjs"),v=require("../../Badge/Badge.cjs"),m=require("../../Tooltip/Tooltip.cjs"),g=e=>e&&e.__esModule?e:{default:e},b=g($),a=g(y),c=a.default(x.Box)`
2
2
  svg {
3
3
  width: 1rem;
4
4
  height: 1rem;
5
5
  }
6
- `,g=n.default(m.BaseLink)`
6
+ `,d=a.default(j.BaseLink)`
7
7
  position: relative;
8
8
  text-decoration: none;
9
9
  display: block;
10
10
  border-radius: ${({theme:e})=>e.borderRadius};
11
11
  background: ${({theme:e})=>e.colors.neutral0};
12
12
 
13
- ${o.Typography} {
13
+ ${s.Typography} {
14
14
  color: ${({theme:e})=>e.colors.neutral600};
15
15
  }
16
16
 
@@ -21,7 +21,7 @@
21
21
  &:hover {
22
22
  background: ${({theme:e})=>e.colors.neutral100};
23
23
 
24
- ${o.Typography} {
24
+ ${s.Typography} {
25
25
  color: ${({theme:e})=>e.colors.neutral700};
26
26
  }
27
27
 
@@ -37,22 +37,22 @@
37
37
  fill: ${({theme:e})=>e.colors.primary600};
38
38
  }
39
39
 
40
- ${o.Typography} {
40
+ ${s.Typography} {
41
41
  color: ${({theme:e})=>e.colors.primary600};
42
42
  font-weight: 500;
43
43
  }
44
44
  }
45
- `,h=n.default(y.Flex)`
45
+ `,u=a.default(h.Flex)`
46
46
  padding: ${({theme:e})=>`${e.spaces[2]} ${e.spaces[3]}`};
47
- `,f=n.default(q.Badge)`
48
- ${({theme:e,condensed:s})=>s&&`
47
+ `,p=a.default(v.Badge)`
48
+ ${({theme:e,condensed:o})=>o&&`
49
49
  position: absolute;
50
50
  // Values based on visual aspect
51
51
  top: -${e.spaces[3]};
52
52
  right: -${e.spaces[1]};
53
53
  `}
54
54
 
55
- ${o.Typography} {
55
+ ${s.Typography} {
56
56
  //find a solution to remove !important
57
57
  color: ${({theme:e})=>e.colors.neutral0} !important;
58
58
  line-height: 0;
@@ -66,4 +66,4 @@
66
66
  padding: ${({theme:e})=>`0 ${e.spaces[2]}`};
67
67
  border-radius: ${({theme:e})=>e.spaces[10]};
68
68
  background: ${({theme:e})=>e.colors.primary600};
69
- `,i=k.default.forwardRef(({children:e,icon:s,badgeContent:t,badgeAriaLabel:c,...d},u)=>b.useMainNav()?r.jsx(g,{ref:u,...d,children:r.jsx(T.Tooltip,{position:"right",label:e,children:r.jsxs(h,{as:"span",justifyContent:"center",children:[r.jsx(p,{"aria-hidden":!0,paddingRight:0,as:"span",children:s}),t&&r.jsx(f,{condensed:!0,"aria-label":c,children:t})]})})}):r.jsx(g,{ref:u,...d,children:r.jsxs(h,{as:"span",justifyContent:"space-between",children:[r.jsxs(y.Flex,{children:[r.jsx(p,{"aria-hidden":!0,paddingRight:3,as:"span",children:s}),r.jsx(o.Typography,{children:e})]}),t&&r.jsx(f,{justifyContent:"center","aria-label":c,children:t})]})}));i.displayName="NavLink";i.defaultProps={badgeContent:void 0,badgeAriaLabel:void 0};i.propTypes={badgeAriaLabel:a.default.string,badgeContent:a.default.oneOfType([a.default.string,a.default.number]),children:a.default.string.isRequired,icon:a.default.node.isRequired};exports.NavLink=i;
69
+ `,k=b.default.forwardRef(({children:e,icon:o,badgeContent:t,badgeAriaLabel:n,...i},l)=>f.useMainNav()?r.jsx(d,{ref:l,...i,children:r.jsx(m.Tooltip,{position:"right",label:e,children:r.jsxs(u,{as:"span",justifyContent:"center",children:[r.jsx(c,{"aria-hidden":!0,paddingRight:0,as:"span",children:o}),t&&r.jsx(p,{condensed:!0,"aria-label":n,children:t})]})})}):r.jsx(d,{ref:l,...i,children:r.jsxs(u,{as:"span",justifyContent:"space-between",children:[r.jsxs(h.Flex,{children:[r.jsx(c,{"aria-hidden":!0,paddingRight:3,as:"span",children:o}),r.jsx(s.Typography,{children:e})]}),t&&r.jsx(p,{justifyContent:"center","aria-label":n,children:t})]})}));exports.NavLink=k;