@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
package/dist/Box/Box.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),o=require("../helpers/handleResponsiveValues.cjs"),r=require("../helpers/theme.cjs"),a=e=>e&&e.__esModule?e:{default:e},d=a(n),m={color:!0,cursor:!0,height:!0,width:!0},l=d.default.div.withConfig({shouldForwardProp:(e,t)=>!m[e]&&t(e)})`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),o=require("../helpers/handleResponsiveValues.cjs"),r=require("../helpers/theme.cjs"),a=e=>e&&e.__esModule?e:{default:e},m=a(n),d={color:!0,cursor:!0,height:!0,width:!0},l=m.default.div.withConfig({shouldForwardProp:(e,t)=>!d[e]&&t(e)})`
2
2
  // Font
3
3
  font-size: ${({fontSize:e,theme:t})=>r.extractStyleFromTheme(t.fontSizes,e,e)};
4
4
 
@@ -72,7 +72,7 @@
72
72
  // Text
73
73
  text-align: ${({textAlign:e})=>e};
74
74
  text-transform: ${({textTransform:e})=>e};
75
- line-height: ${({lineHeight:e})=>e};
75
+ line-height: ${({theme:e,lineHeight:t})=>r.extractStyleFromTheme(e.lineHeights,t,t)};
76
76
 
77
77
  // Cursor
78
78
  cursor: ${({cursor:e})=>e};
package/dist/Box/Box.js CHANGED
@@ -85,7 +85,7 @@ const t = {
85
85
  // Text
86
86
  text-align: ${({ textAlign: e }) => e};
87
87
  text-transform: ${({ textTransform: e }) => e};
88
- line-height: ${({ lineHeight: e }) => e};
88
+ line-height: ${({ theme: e, lineHeight: o }) => s(e.lineHeights, o, o)};
89
89
 
90
90
  // Cursor
91
91
  cursor: ${({ cursor: e }) => e};
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("react"),l=require("prop-types"),d=require("styled-components"),i=require("./GridContext.cjs"),f=require("../helpers/handleResponsiveValues.cjs"),p=require("../Box/Box.cjs"),a=e=>e&&e.__esModule?e:{default:e};function y(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=y(c),o=a(l),_=a(d),b=_.default(p.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("styled-components"),i=require("../helpers/handleResponsiveValues.cjs"),d=require("../Box/Box.cjs"),l=e=>e&&e.__esModule?e:{default:e},n=l(o),u=n.default(d.Box)`
2
2
  display: grid;
3
3
  grid-template-columns: repeat(${({gridCols:e})=>e}, 1fr);
4
- ${({theme:e,gap:t})=>f("gap",t,e)}
5
- `,u=({gap:e,gridCols:t,...r})=>{const n=m.useMemo(()=>({gap:e,gridCols:t}),[e,t]);return s.jsx(i.GridContext.Provider,{value:n,children:s.jsx(b,{gap:e,gridCols:t,...r})})};u.defaultProps={gap:0,gridCols:12};u.propTypes={gap:o.default.oneOfType([o.default.number,o.default.arrayOf(o.default.number)]),gridCols:o.default.number};exports.Grid=u;
4
+ ${({theme:e,gap:t})=>i("gap",t,e)}
5
+ `,a=({gap:e="0",gridCols:t=12,...r})=>s.jsx(u,{gap:e,gridCols:t,...r});exports.Grid=a;
package/dist/Grid/Grid.js CHANGED
@@ -1,26 +1,12 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import e from "prop-types";
4
- import n from "styled-components";
5
- import { GridContext as a } from "./GridContext.js";
6
- import d from "../helpers/handleResponsiveValues.js";
7
- import { Box as f } from "../Box/Box.js";
8
- const l = n(f)`
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import t from "styled-components";
3
+ import i from "../helpers/handleResponsiveValues.js";
4
+ import { Box as m } from "../Box/Box.js";
5
+ const s = t(m)`
9
6
  display: grid;
10
7
  grid-template-columns: repeat(${({ gridCols: r }) => r}, 1fr);
11
- ${({ theme: r, gap: o }) => d("gap", o, r)}
12
- `, t = ({ gap: r, gridCols: o, ...m }) => {
13
- const i = s.useMemo(() => ({ gap: r, gridCols: o }), [r, o]);
14
- return /* @__PURE__ */ p(a.Provider, { value: i, children: /* @__PURE__ */ p(l, { gap: r, gridCols: o, ...m }) });
15
- };
16
- t.defaultProps = {
17
- gap: 0,
18
- gridCols: 12
19
- };
20
- t.propTypes = {
21
- gap: e.oneOfType([e.number, e.arrayOf(e.number)]),
22
- gridCols: e.number
23
- };
8
+ ${({ theme: r, gap: o }) => i("gap", o, r)}
9
+ `, f = ({ gap: r = "0", gridCols: o = 12, ...p }) => e(s, { gap: r, gridCols: o, ...p });
24
10
  export {
25
- t as Grid
11
+ f as Grid
26
12
  };
@@ -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"),c=require("styled-components"),p=require("./GridContext.cjs"),m=require("../Box/Box.cjs"),s=e=>e&&e.__esModule?e:{default:e},r=s(a),f=s(c),x=f.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),i=require("../Box/Box.cjs"),o=e=>e&&e.__esModule?e:{default:e},d=o(t),r=d.default(i.Box)`
2
2
  grid-column: span ${({col:e})=>e};
3
3
  max-width: 100%;
4
4
 
@@ -9,4 +9,4 @@
9
9
  ${({theme:e})=>e.mediaQueries.mobile} {
10
10
  grid-column: span ${({xs:e})=>e};
11
11
  }
12
- `,t=({col:e,xs:i,s:d,...u})=>{const{gap:n,gridCols:l}=p.useGrid();return o.jsx(x,{gap:n,gridCols:l,col:e,xs:i,s:d,children:o.jsx(m.Box,{...u})})};t.defaultProps={col:void 0,s:void 0,xs:void 0};t.propTypes={col:r.default.number,s:r.default.number,xs:r.default.number};exports.GridItem=t;
12
+ `;exports.GridItem=r;
@@ -1,34 +1,17 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import "react";
3
- import o from "prop-types";
4
- import n from "styled-components";
5
- import { useGrid as l } from "./GridContext.js";
6
- import { Box as u } from "../Box/Box.js";
7
- const a = n.div`
8
- grid-column: span ${({ col: r }) => r};
1
+ import m from "styled-components";
2
+ import { Box as e } from "../Box/Box.js";
3
+ const t = m(e)`
4
+ grid-column: span ${({ col: i }) => i};
9
5
  max-width: 100%;
10
6
 
11
- ${({ theme: r }) => r.mediaQueries.tablet} {
12
- grid-column: span ${({ s: r }) => r};
7
+ ${({ theme: i }) => i.mediaQueries.tablet} {
8
+ grid-column: span ${({ s: i }) => i};
13
9
  }
14
10
 
15
- ${({ theme: r }) => r.mediaQueries.mobile} {
16
- grid-column: span ${({ xs: r }) => r};
11
+ ${({ theme: i }) => i.mediaQueries.mobile} {
12
+ grid-column: span ${({ xs: i }) => i};
17
13
  }
18
- `, m = ({ col: r, xs: e, s: p, ...s }) => {
19
- const { gap: t, gridCols: d } = l();
20
- return /* @__PURE__ */ i(a, { gap: t, gridCols: d, col: r, xs: e, s: p, children: /* @__PURE__ */ i(u, { ...s }) });
21
- };
22
- m.defaultProps = {
23
- col: void 0,
24
- s: void 0,
25
- xs: void 0
26
- };
27
- m.propTypes = {
28
- col: o.number,
29
- s: o.number,
30
- xs: o.number
31
- };
14
+ `;
32
15
  export {
33
- m as GridItem
16
+ t as GridItem
34
17
  };
@@ -1,9 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const a=require("prop-types"),c=require("styled-components"),l=require("../Flex/Flex.cjs"),r=require("../Box/Box.cjs"),i=e=>e&&e.__esModule?e:{default:e},s=i(a),d=i(c),u=d.default(l.Flex)`
2
- & > * + * {
3
- margin-left: ${({theme:e})=>e.spaces[2]};
4
- }
5
-
6
- margin-left: ${({pullRight:e})=>e?"auto":void 0};
7
- `,p=d.default(u)`
8
- flex-shrink: 0;
9
- `,n=({startActions:e,endActions:o})=>e||o?t.jsx(r.Box,{paddingLeft:10,paddingRight:10,children:t.jsx(r.Box,{paddingBottom:4,children:t.jsxs(l.Flex,{justifyContent:"space-between",alignItems:"flex-start",children:[e&&t.jsx(u,{wrap:"wrap",children:e}),o&&t.jsx(p,{pullRight:!0,children:o})]})})}):null;n.defaultProps={endActions:void 0,startActions:void 0};n.propTypes={endActions:s.default.node,startActions:s.default.node};exports.ActionLayout=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../Flex/Flex.cjs"),i=({startActions:r,endActions:n})=>!r||!n?null:e.jsxs(t.Flex,{justifyContent:"space-between",alignItems:"flex-start",paddingBottom:4,paddingLeft:10,paddingRight:10,children:[e.jsx(t.Flex,{gap:2,wrap:"wrap",children:r}),e.jsx(t.Flex,{gap:2,shrink:0,wrap:"wrap",children:n})]});exports.ActionLayout=i;
@@ -1,29 +1,6 @@
1
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
- import "react";
3
- import e from "prop-types";
4
- import n from "styled-components";
5
- import { Flex as p } from "../Flex/Flex.js";
6
- import { Box as i } from "../Box/Box.js";
7
- const d = n(p)`
8
- & > * + * {
9
- margin-left: ${({ theme: t }) => t.spaces[2]};
10
- }
11
-
12
- margin-left: ${({ pullRight: t }) => t ? "auto" : void 0};
13
- `, a = n(d)`
14
- flex-shrink: 0;
15
- `, l = ({ startActions: t, endActions: r }) => t || r ? /* @__PURE__ */ o(i, { paddingLeft: 10, paddingRight: 10, children: /* @__PURE__ */ o(i, { paddingBottom: 4, children: /* @__PURE__ */ s(p, { justifyContent: "space-between", alignItems: "flex-start", children: [
16
- t && /* @__PURE__ */ o(d, { wrap: "wrap", children: t }),
17
- r && /* @__PURE__ */ o(a, { pullRight: !0, children: r })
18
- ] }) }) }) : null;
19
- l.defaultProps = {
20
- endActions: void 0,
21
- startActions: void 0
22
- };
23
- l.propTypes = {
24
- endActions: e.node,
25
- startActions: e.node
26
- };
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import { Flex as r } from "../Flex/Flex.js";
3
+ const o = ({ startActions: t, endActions: e }) => !t || !e ? null : p(r, { justifyContent: "space-between", alignItems: "flex-start", paddingBottom: 4, paddingLeft: 10, paddingRight: 10, children: [n(r, { gap: 2, wrap: "wrap", children: t }), n(r, { gap: 2, shrink: 0, wrap: "wrap", children: e })] });
27
4
  export {
28
- l as ActionLayout
5
+ o as ActionLayout
29
6
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const r=require("prop-types"),n=require("../Box/Box.cjs"),u=e=>e&&e.__esModule?e:{default:e},i=u(r),t=({children:e})=>o.jsx(n.Box,{paddingLeft:10,paddingRight:10,children:e});t.propTypes={children:i.default.node.isRequired};exports.ContentLayout=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../Box/Box.cjs"),o=({children:t})=>e.jsx(n.Box,{paddingLeft:10,paddingRight:10,children:t});exports.ContentLayout=o;
@@ -1,11 +1,6 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import p from "prop-types";
4
- import { Box as t } from "../Box/Box.js";
5
- const e = ({ children: o }) => /* @__PURE__ */ r(t, { paddingLeft: 10, paddingRight: 10, children: o });
6
- e.propTypes = {
7
- children: p.node.isRequired
8
- };
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Box as r } from "../Box/Box.js";
3
+ const d = ({ children: t }) => o(r, { paddingLeft: 10, paddingRight: 10, children: t });
9
4
  export {
10
- e as ContentLayout
5
+ d as ContentLayout
11
6
  };
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("prop-types"),o=require("styled-components"),t=e=>e&&e.__esModule?e:{default:e},s=t(d),i=t(o),r=i.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("styled-components"),a=t=>t&&t.__esModule?t:{default:t},d=a(e),i=d.default.div`
2
2
  display: grid;
3
3
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
4
- grid-gap: ${({theme:e})=>e.spaces[4]};
5
- `;r.propTypes={children:s.default.node.isRequired};exports.GridLayout=r;
4
+ grid-gap: ${({theme:t})=>t.spaces[4]};
5
+ `;exports.GridLayout=i;
@@ -1,13 +1,9 @@
1
- import p from "prop-types";
2
- import e from "styled-components";
3
- const i = e.div`
1
+ import i from "styled-components";
2
+ const a = i.div`
4
3
  display: grid;
5
4
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
6
- grid-gap: ${({ theme: r }) => r.spaces[4]};
5
+ grid-gap: ${({ theme: t }) => t.spaces[4]};
7
6
  `;
8
- i.propTypes = {
9
- children: p.node.isRequired
10
- };
11
7
  export {
12
- i as GridLayout
8
+ a as GridLayout
13
9
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),v=require("prop-types"),B=require("styled-components"),R=require("../hooks/useElementOnScreen.cjs"),b=require("../hooks/useResizeObserver.cjs"),r=require("../Box/Box.cjs"),l=require("../Flex/Flex.cjs"),u=require("../Typography/Typography.cjs"),f=e=>e&&e.__esModule?e:{default:e},m=f(c),i=f(v),T=f(B),L=()=>{const e=c.useRef(null),[a,n]=c.useState(null),[d,o]=R.useElementOnScreen({root:null,rootMargin:"0px",threshold:0});return b.useResizeObserver(d,()=>{d.current&&n(d.current.getBoundingClientRect())}),c.useEffect(()=>{e.current&&n(e.current.getBoundingClientRect())},[e]),{containerRef:d,isVisible:o,baseHeaderLayoutRef:e,headerSize:a}},p=e=>{const{containerRef:a,isVisible:n,baseHeaderLayoutRef:d,headerSize:o}=L();return t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:o?.height},ref:a,children:n&&t.jsx(s,{ref:d,...e})}),!n&&t.jsx(s,{...e,sticky:!0,width:o?.width})]})};p.displayName="HeaderLayout";const S=T.default(r.Box)`
2
- width: ${e=>e.width}px;
3
- z-index: ${({theme:e})=>e.zIndices[1]};
4
- `,s=m.default.forwardRef(({navigationAction:e,primaryAction:a,secondaryAction:n,subtitle:d,title:o,sticky:y,width:g,...h},j)=>{const x=typeof d=="string";return y?t.jsx(S,{paddingLeft:6,paddingRight:6,paddingTop:3,paddingBottom:3,position:"fixed",top:0,right:0,background:"neutral0",shadow:"tableShadow",width:g,"data-strapi-header-sticky":!0,children:t.jsxs(l.Flex,{justifyContent:"space-between",children:[t.jsxs(l.Flex,{children:[e&&t.jsx(r.Box,{paddingRight:3,children:e}),t.jsxs(r.Box,{children:[t.jsx(u.Typography,{variant:"beta",as:"h1",...h,children:o}),x?t.jsx(u.Typography,{variant:"pi",textColor:"neutral600",children:d}):d]}),n?t.jsx(r.Box,{paddingLeft:4,children:n}):null]}),t.jsx(l.Flex,{children:a?t.jsx(r.Box,{paddingLeft:2,children:a}):void 0})]})}):t.jsxs(r.Box,{ref:j,paddingLeft:10,paddingRight:10,paddingBottom:8,paddingTop:e?6:8,background:"neutral100","data-strapi-header":!0,children:[e?t.jsx(r.Box,{paddingBottom:2,children:e}):null,t.jsxs(l.Flex,{justifyContent:"space-between",children:[t.jsxs(l.Flex,{minWidth:0,children:[t.jsx(u.Typography,{as:"h1",variant:"alpha",...h,children:o}),n?t.jsx(r.Box,{paddingLeft:4,children:n}):null]}),a]}),x?t.jsx(u.Typography,{variant:"epsilon",textColor:"neutral600",as:"p",children:d}):d]})});s.displayName="BaseHeaderLayout";s.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0,sticky:!1,width:void 0};s.propTypes={navigationAction:i.default.node,primaryAction:i.default.node,secondaryAction:i.default.node,sticky:i.default.bool,subtitle:i.default.oneOfType([i.default.string,i.default.node]),title:i.default.string.isRequired,width:i.default.number};p.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0};p.propTypes={navigationAction:i.default.node,primaryAction:i.default.node,secondaryAction:i.default.node,subtitle:i.default.oneOfType([i.default.string,i.default.node]),title:i.default.string.isRequired};exports.BaseHeaderLayout=s;exports.HeaderLayout=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),y=require("styled-components"),B=require("../hooks/useElementOnScreen.cjs"),R=require("../hooks/useResizeObserver.cjs"),d=require("../Box/Box.cjs"),a=require("../Flex/Flex.cjs"),o=require("../Typography/Typography.cjs"),p=t=>t&&t.__esModule?t:{default:t},L=p(u),S=p(y),g=t=>{const r=u.useRef(null),[s,n]=u.useState(null),[i,l]=B.useElementOnScreen({root:null,rootMargin:"0px",threshold:0});return R.useResizeObserver(i,()=>{i.current&&n(i.current.getBoundingClientRect())}),u.useEffect(()=>{r.current&&n(r.current.getBoundingClientRect())},[r]),e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{height:s?.height},ref:i,children:l&&e.jsx(c,{ref:r,...t})}),!l&&e.jsx(c,{...t,sticky:!0,width:s?.width})]})};g.displayName="HeaderLayout";const b=S.default(d.Box)`
2
+ width: ${({width:t})=>t?`${t/16}rem`:void 0};
3
+ z-index: ${({theme:t})=>t.zIndices[1]};
4
+ `,c=L.default.forwardRef(({navigationAction:t,primaryAction:r,secondaryAction:s,subtitle:n,title:i,sticky:l,width:f,...h},j)=>{const x=typeof n=="string";return l?e.jsx(b,{paddingLeft:6,paddingRight:6,paddingTop:3,paddingBottom:3,position:"fixed",top:0,right:0,background:"neutral0",shadow:"tableShadow",width:f,"data-strapi-header-sticky":!0,children:e.jsxs(a.Flex,{justifyContent:"space-between",children:[e.jsxs(a.Flex,{children:[t&&e.jsx(d.Box,{paddingRight:3,children:t}),e.jsxs(d.Box,{children:[e.jsx(o.Typography,{variant:"beta",as:"h1",...h,children:i}),x?e.jsx(o.Typography,{variant:"pi",textColor:"neutral600",children:n}):n]}),s?e.jsx(d.Box,{paddingLeft:4,children:s}):null]}),e.jsx(a.Flex,{children:r?e.jsx(d.Box,{paddingLeft:2,children:r}):void 0})]})}):e.jsxs(d.Box,{ref:j,paddingLeft:10,paddingRight:10,paddingBottom:8,paddingTop:t?6:8,background:"neutral100","data-strapi-header":!0,children:[t?e.jsx(d.Box,{paddingBottom:2,children:t}):null,e.jsxs(a.Flex,{justifyContent:"space-between",children:[e.jsxs(a.Flex,{minWidth:0,children:[e.jsx(o.Typography,{as:"h1",variant:"alpha",...h,children:i}),s?e.jsx(d.Box,{paddingLeft:4,children:s}):null]}),r]}),x?e.jsx(o.Typography,{variant:"epsilon",textColor:"neutral600",as:"p",children:n}):n]})});exports.BaseHeaderLayout=c;exports.HeaderLayout=g;
@@ -1,127 +1,32 @@
1
- import { jsx as i, jsxs as s, Fragment as v } from "react/jsx-runtime";
2
- import R, { useRef as b, useState as x, useEffect as w } from "react";
3
- import t from "prop-types";
4
- import L from "styled-components";
5
- import { useElementOnScreen as S } from "../hooks/useElementOnScreen.js";
6
- import { useResizeObserver as B } from "../hooks/useResizeObserver.js";
7
- import { Box as d } from "../Box/Box.js";
8
- import { Flex as l } from "../Flex/Flex.js";
9
- import { Typography as p } from "../Typography/Typography.js";
10
- const H = () => {
11
- const e = b(null), [o, n] = x(null), [r, a] = S({
1
+ import { jsx as e, jsxs as l, Fragment as m } from "react/jsx-runtime";
2
+ import x, { useRef as R, useState as y, useEffect as L } from "react";
3
+ import w from "styled-components";
4
+ import { useElementOnScreen as B } from "../hooks/useElementOnScreen.js";
5
+ import { useResizeObserver as S } from "../hooks/useResizeObserver.js";
6
+ import { Box as n } from "../Box/Box.js";
7
+ import { Flex as o } from "../Flex/Flex.js";
8
+ import { Typography as u } from "../Typography/Typography.js";
9
+ const b = (r) => {
10
+ const t = R(null), [i, d] = y(null), [a, h] = B({
12
11
  root: null,
13
12
  rootMargin: "0px",
14
13
  threshold: 0
15
14
  });
16
- return B(r, () => {
17
- r.current && n(r.current.getBoundingClientRect());
18
- }), w(() => {
19
- e.current && n(e.current.getBoundingClientRect());
20
- }, [e]), {
21
- containerRef: r,
22
- isVisible: a,
23
- baseHeaderLayoutRef: e,
24
- headerSize: o
25
- };
26
- }, h = (e) => {
27
- const { containerRef: o, isVisible: n, baseHeaderLayoutRef: r, headerSize: a } = H();
28
- return /* @__PURE__ */ s(v, { children: [
29
- /* @__PURE__ */ i("div", { style: { height: a?.height }, ref: o, children: n && /* @__PURE__ */ i(c, { ref: r, ...e }) }),
30
- !n && /* @__PURE__ */ i(c, { ...e, sticky: !0, width: a?.width })
31
- ] });
32
- };
33
- h.displayName = "HeaderLayout";
34
- const T = L(d)`
35
- width: ${(e) => e.width}px;
36
- z-index: ${({ theme: e }) => e.zIndices[1]};
37
- `, c = R.forwardRef(
38
- ({ navigationAction: e, primaryAction: o, secondaryAction: n, subtitle: r, title: a, sticky: g, width: m, ...u }, y) => {
39
- const f = typeof r == "string";
40
- return g ? /* @__PURE__ */ i(
41
- T,
42
- {
43
- paddingLeft: 6,
44
- paddingRight: 6,
45
- paddingTop: 3,
46
- paddingBottom: 3,
47
- position: "fixed",
48
- top: 0,
49
- right: 0,
50
- background: "neutral0",
51
- shadow: "tableShadow",
52
- width: m,
53
- "data-strapi-header-sticky": !0,
54
- children: /* @__PURE__ */ s(l, { justifyContent: "space-between", children: [
55
- /* @__PURE__ */ s(l, { children: [
56
- e && /* @__PURE__ */ i(d, { paddingRight: 3, children: e }),
57
- /* @__PURE__ */ s(d, { children: [
58
- /* @__PURE__ */ i(p, { variant: "beta", as: "h1", ...u, children: a }),
59
- f ? /* @__PURE__ */ i(p, { variant: "pi", textColor: "neutral600", children: r }) : r
60
- ] }),
61
- n ? /* @__PURE__ */ i(d, { paddingLeft: 4, children: n }) : null
62
- ] }),
63
- /* @__PURE__ */ i(l, { children: o ? /* @__PURE__ */ i(d, { paddingLeft: 2, children: o }) : void 0 })
64
- ] })
65
- }
66
- ) : /* @__PURE__ */ s(
67
- d,
68
- {
69
- ref: y,
70
- paddingLeft: 10,
71
- paddingRight: 10,
72
- paddingBottom: 8,
73
- paddingTop: e ? 6 : 8,
74
- background: "neutral100",
75
- "data-strapi-header": !0,
76
- children: [
77
- e ? /* @__PURE__ */ i(d, { paddingBottom: 2, children: e }) : null,
78
- /* @__PURE__ */ s(l, { justifyContent: "space-between", children: [
79
- /* @__PURE__ */ s(l, { minWidth: 0, children: [
80
- /* @__PURE__ */ i(p, { as: "h1", variant: "alpha", ...u, children: a }),
81
- n ? /* @__PURE__ */ i(d, { paddingLeft: 4, children: n }) : null
82
- ] }),
83
- o
84
- ] }),
85
- f ? /* @__PURE__ */ i(p, { variant: "epsilon", textColor: "neutral600", as: "p", children: r }) : r
86
- ]
87
- }
88
- );
89
- }
90
- );
91
- c.displayName = "BaseHeaderLayout";
92
- c.defaultProps = {
93
- navigationAction: void 0,
94
- primaryAction: void 0,
95
- secondaryAction: void 0,
96
- subtitle: void 0,
97
- sticky: !1,
98
- width: void 0
99
- };
100
- c.propTypes = {
101
- navigationAction: t.node,
102
- primaryAction: t.node,
103
- secondaryAction: t.node,
104
- sticky: t.bool,
105
- // TODO V2: Remove the string fallback
106
- subtitle: t.oneOfType([t.string, t.node]),
107
- title: t.string.isRequired,
108
- width: t.number
109
- };
110
- h.defaultProps = {
111
- navigationAction: void 0,
112
- primaryAction: void 0,
113
- secondaryAction: void 0,
114
- subtitle: void 0
115
- };
116
- h.propTypes = {
117
- navigationAction: t.node,
118
- primaryAction: t.node,
119
- secondaryAction: t.node,
120
- // TODO V2: Remove the string fallback
121
- subtitle: t.oneOfType([t.string, t.node]),
122
- title: t.string.isRequired
15
+ return S(a, () => {
16
+ a.current && d(a.current.getBoundingClientRect());
17
+ }), L(() => {
18
+ t.current && d(t.current.getBoundingClientRect());
19
+ }, [t]), l(m, { children: [e("div", { style: { height: i?.height }, ref: a, children: h && e(p, { ref: t, ...r }) }), !h && e(p, { ...r, sticky: !0, width: i?.width })] });
123
20
  };
21
+ b.displayName = "HeaderLayout";
22
+ const C = w(n)`
23
+ width: ${({ width: r }) => r ? `${r / 16}rem` : void 0};
24
+ z-index: ${({ theme: r }) => r.zIndices[1]};
25
+ `, p = x.forwardRef(({ navigationAction: r, primaryAction: t, secondaryAction: i, subtitle: d, title: a, sticky: h, width: c, ...s }, g) => {
26
+ const f = typeof d == "string";
27
+ return h ? e(C, { paddingLeft: 6, paddingRight: 6, paddingTop: 3, paddingBottom: 3, position: "fixed", top: 0, right: 0, background: "neutral0", shadow: "tableShadow", width: c, "data-strapi-header-sticky": !0, children: l(o, { justifyContent: "space-between", children: [l(o, { children: [r && e(n, { paddingRight: 3, children: r }), l(n, { children: [e(u, { variant: "beta", as: "h1", ...s, children: a }), f ? e(u, { variant: "pi", textColor: "neutral600", children: d }) : d] }), i ? e(n, { paddingLeft: 4, children: i }) : null] }), e(o, { children: t ? e(n, { paddingLeft: 2, children: t }) : void 0 })] }) }) : l(n, { ref: g, paddingLeft: 10, paddingRight: 10, paddingBottom: 8, paddingTop: r ? 6 : 8, background: "neutral100", "data-strapi-header": !0, children: [r ? e(n, { paddingBottom: 2, children: r }) : null, l(o, { justifyContent: "space-between", children: [l(o, { minWidth: 0, children: [e(u, { as: "h1", variant: "alpha", ...s, children: a }), i ? e(n, { paddingLeft: 4, children: i }) : null] }), t] }), f ? e(u, { variant: "epsilon", textColor: "neutral600", as: "p", children: d }) : d] });
28
+ });
124
29
  export {
125
- c as BaseHeaderLayout,
126
- h as HeaderLayout
30
+ p as BaseHeaderLayout,
31
+ b as HeaderLayout
127
32
  };
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const u=require("prop-types"),l=require("styled-components"),d=require("../Box/Box.cjs"),s=e=>e&&e.__esModule?e:{default:e},r=s(u),n=s(l),a=n.default(d.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("styled-components"),o=require("../Box/Box.cjs"),l=t=>t&&t.__esModule?t:{default:t},r=l(d),s=r.default(o.Box)`
2
2
  display: grid;
3
- grid-template-columns: ${({hasSideNav:e})=>e?"auto 1fr":"1fr"};
4
- `,c=n.default(d.Box)`
3
+ grid-template-columns: ${({hasSideNav:t})=>t?"auto 1fr":"1fr"};
4
+ `,i=r.default(o.Box)`
5
5
  overflow-x: hidden;
6
- `,t=({sideNav:e,children:i})=>o.jsxs(a,{hasSideNav:!!e,children:[e,o.jsx(c,{paddingBottom:10,children:i})]});t.defaultProps={sideNav:void 0};t.propTypes={children:r.default.node.isRequired,sideNav:r.default.node};exports.Layout=t;
6
+ `,u=({sideNav:t,children:n})=>e.jsxs(s,{hasSideNav:!!t,children:[t,e.jsx(i,{paddingBottom:10,children:n})]});exports.Layout=u;
@@ -1,24 +1,12 @@
1
- import { jsxs as n, jsx as p } from "react/jsx-runtime";
2
- import "react";
3
- import r from "prop-types";
4
- import e from "styled-components";
5
- import { Box as i } from "../Box/Box.js";
6
- const s = e(i)`
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import r from "styled-components";
3
+ import { Box as t } from "../Box/Box.js";
4
+ const d = r(t)`
7
5
  display: grid;
8
6
  grid-template-columns: ${({ hasSideNav: o }) => o ? "auto 1fr" : "1fr"};
9
- `, m = e(i)`
7
+ `, m = r(t)`
10
8
  overflow-x: hidden;
11
- `, t = ({ sideNav: o, children: d }) => /* @__PURE__ */ n(s, { hasSideNav: !!o, children: [
12
- o,
13
- /* @__PURE__ */ p(m, { paddingBottom: 10, children: d })
14
- ] });
15
- t.defaultProps = {
16
- sideNav: void 0
17
- };
18
- t.propTypes = {
19
- children: r.node.isRequired,
20
- sideNav: r.node
21
- };
9
+ `, f = ({ sideNav: o, children: e }) => i(d, { hasSideNav: !!o, children: [o, n(m, { paddingBottom: 10, children: e })] });
22
10
  export {
23
- t as Layout
11
+ f as Layout
24
12
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const i=require("prop-types"),a=require("../Grid/Grid.cjs"),o=require("../Grid/GridItem.cjs"),t=require("../Box/Box.cjs"),n=e=>e&&e.__esModule?e:{default:e},s=n(i),d=({startCol:e,endCol:u})=>r.jsxs(a.Grid,{gap:4,children:[r.jsx(o.GridItem,{col:9,s:12,children:r.jsx(t.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",children:e})}),r.jsx(o.GridItem,{col:3,s:12,children:r.jsx(t.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",children:u})})]});d.propTypes={endCol:s.default.node.isRequired,startCol:s.default.node.isRequired};exports.TwoColsLayout=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../Grid/Grid.cjs"),r=require("../Grid/GridItem.cjs"),o=require("../Box/Box.cjs"),i=({startCol:s,endCol:t})=>e.jsxs(d.Grid,{gap:4,children:[e.jsx(r.GridItem,{col:9,s:12,children:e.jsx(o.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",children:s})}),e.jsx(r.GridItem,{col:3,s:12,children:e.jsx(o.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",children:t})})]});exports.TwoColsLayout=i;
@@ -1,17 +1,8 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import o from "prop-types";
4
- import { Grid as a } from "../Grid/Grid.js";
5
- import { GridItem as e } from "../Grid/GridItem.js";
6
- import { Box as d } from "../Box/Box.js";
7
- const l = ({ startCol: i, endCol: t }) => /* @__PURE__ */ s(a, { gap: 4, children: [
8
- /* @__PURE__ */ r(e, { col: 9, s: 12, children: /* @__PURE__ */ r(d, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: i }) }),
9
- /* @__PURE__ */ r(e, { col: 3, s: 12, children: /* @__PURE__ */ r(d, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: t }) })
10
- ] });
11
- l.propTypes = {
12
- endCol: o.node.isRequired,
13
- startCol: o.node.isRequired
14
- };
1
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
+ import { Grid as i } from "../Grid/Grid.js";
3
+ import { GridItem as o } from "../Grid/GridItem.js";
4
+ import { Box as a } from "../Box/Box.js";
5
+ const c = ({ startCol: d, endCol: t }) => e(i, { gap: 4, children: [r(o, { col: 9, s: 12, children: r(a, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: d }) }), r(o, { col: 3, s: 12, children: r(a, { hasRadius: !0, background: "neutral0", shadow: "tableShadow", children: t }) })] });
15
6
  export {
16
- l as TwoColsLayout
7
+ c as TwoColsLayout
17
8
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const u=require("prop-types"),d=require("styled-components"),o=require("../RawTable/RawCell.cjs"),p=require("../Flex/Flex.cjs"),s=e=>e&&e.__esModule?e:{default:e},l=s(u),n=s(d),i=n.default(o.RawTd)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("styled-components"),r=require("../RawTable/RawCell.cjs"),i=require("../Flex/Flex.cjs"),a=e=>e&&e.__esModule?e:{default:e},n=a(c),s=n.default(r.RawTd)`
2
2
  vertical-align: middle;
3
3
  text-align: left;
4
4
  color: ${({theme:e})=>e.colors.neutral600};
@@ -10,8 +10,8 @@
10
10
  input {
11
11
  vertical-align: sub;
12
12
  }
13
- `,f=n.default.span`
13
+ `,u=n.default.span`
14
14
  svg {
15
15
  height: ${4/16}rem;
16
16
  }
17
- `,r=({children:e,action:a,...c})=>t.jsx(i,{as:o.RawTh,...c,children:t.jsxs(p.Flex,{children:[e,t.jsx(f,{children:a})]})});r.defaultProps={action:void 0};r.propTypes={action:l.default.node,children:l.default.node.isRequired};const h=e=>t.jsx(i,{...e});exports.Td=h;exports.Th=r;
17
+ `,d=({children:e,action:l,...o})=>t.jsx(s,{as:r.RawTh,...o,children:t.jsxs(i.Flex,{children:[e,t.jsx(u,{children:l})]})}),h=({children:e,...l})=>t.jsx(s,{...l,children:e});exports.Td=h;exports.Th=d;
@@ -1,13 +1,11 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import "react";
3
- import e from "prop-types";
4
- import t from "styled-components";
5
- import { RawTd as a, RawTh as c } from "../RawTable/RawCell.js";
6
- import { Flex as d } from "../Flex/Flex.js";
7
- const i = t(a)`
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import o from "styled-components";
3
+ import { RawTd as c, RawTh as s } from "../RawTable/RawCell.js";
4
+ import { Flex as a } from "../Flex/Flex.js";
5
+ const l = o(c)`
8
6
  vertical-align: middle;
9
7
  text-align: left;
10
- color: ${({ theme: o }) => o.colors.neutral600};
8
+ color: ${({ theme: r }) => r.colors.neutral600};
11
9
  outline-offset: -4px;
12
10
 
13
11
  /**
@@ -16,23 +14,12 @@ const i = t(a)`
16
14
  input {
17
15
  vertical-align: sub;
18
16
  }
19
- `, m = t.span`
17
+ `, p = o.span`
20
18
  svg {
21
19
  height: ${4 / 16}rem;
22
20
  }
23
- `, n = ({ children: o, action: l, ...p }) => /* @__PURE__ */ r(i, { as: c, ...p, children: /* @__PURE__ */ s(d, { children: [
24
- o,
25
- /* @__PURE__ */ r(m, { children: l })
26
- ] }) });
27
- n.defaultProps = {
28
- action: void 0
29
- };
30
- n.propTypes = {
31
- action: e.node,
32
- children: e.node.isRequired
33
- };
34
- const k = (o) => /* @__PURE__ */ r(i, { ...o });
21
+ `, u = ({ children: r, action: e, ...i }) => t(l, { as: s, ...i, children: n(a, { children: [r, t(p, { children: e })] }) }), x = ({ children: r, ...e }) => t(l, { ...e, children: r });
35
22
  export {
36
- k as Td,
37
- n as Th
23
+ x as Td,
24
+ u as Th
38
25
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const a=require("prop-types"),l=require("styled-components"),t=require("../Box/Box.cjs"),c=require("../Divider/Divider.cjs"),p=require("../Flex/Flex.cjs"),h=require("../Typography/Typography.cjs"),o=e=>e&&e.__esModule?e:{default:e},i=o(a),d=o(l),x=d.default(t.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("styled-components"),t=require("../Box/Box.cjs"),s=require("../Divider/Divider.cjs"),a=require("../Flex/Flex.cjs"),l=require("../Typography/Typography.cjs"),c=e=>e&&e.__esModule?e:{default:e},i=c(n),u=i.default(t.Box)`
2
2
  height: ${24/16}rem;
3
3
  width: ${24/16}rem;
4
4
  border-radius: 50%;
@@ -14,9 +14,9 @@
14
14
  svg path {
15
15
  fill: ${({theme:e})=>e.colors.primary600};
16
16
  }
17
- `,y=d.default(t.Box)`
17
+ `,h=i.default(t.Box)`
18
18
  border-radius: 0 0 ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius};
19
19
  display: block;
20
20
  width: 100%;
21
21
  border: none;
22
- `,s=({children:e,icon:n,...u})=>r.jsxs("div",{children:[r.jsx(c.Divider,{}),r.jsx(y,{as:"button",background:"primary100",padding:5,...u,children:r.jsxs(p.Flex,{children:[r.jsx(x,{"aria-hidden":!0,background:"primary200",children:n}),r.jsx(t.Box,{paddingLeft:3,children:r.jsx(h.Typography,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:e})})]})})]});s.propTypes={children:i.default.string.isRequired,icon:i.default.node.isRequired};exports.TFooter=s;
22
+ `,x=({children:e,icon:o,...d})=>r.jsxs("div",{children:[r.jsx(s.Divider,{}),r.jsx(h,{as:"button",background:"primary100",padding:5,...d,children:r.jsxs(a.Flex,{children:[r.jsx(u,{"aria-hidden":!0,background:"primary200",children:o}),r.jsx(t.Box,{paddingLeft:3,children:r.jsx(l.Typography,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:e})})]})})]});exports.TFooter=x;