@strapi/design-system 1.7.7 → 1.7.9
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.
- package/dist/Box/Box.cjs +2 -2
- package/dist/Box/Box.js +1 -1
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +8 -22
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +10 -27
- package/dist/Layout/ActionLayout.cjs +1 -9
- package/dist/Layout/ActionLayout.js +4 -27
- package/dist/Layout/ContentLayout.cjs +1 -1
- package/dist/Layout/ContentLayout.js +4 -9
- package/dist/Layout/GridLayout.cjs +3 -3
- package/dist/Layout/GridLayout.js +4 -8
- package/dist/Layout/HeaderLayout.cjs +4 -4
- package/dist/Layout/HeaderLayout.js +25 -120
- package/dist/Layout/Layout.cjs +4 -4
- package/dist/Layout/Layout.js +7 -19
- package/dist/Layout/TwoColsLayout.cjs +1 -1
- package/dist/Layout/TwoColsLayout.js +6 -15
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +10 -23
- package/dist/Table/TFooter.cjs +3 -3
- package/dist/Table/TFooter.js +8 -20
- package/dist/Table/Table.cjs +12 -12
- package/dist/Table/Table.js +19 -31
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +4 -5
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +6 -7
- package/dist/Table/Tr.cjs +1 -1
- package/dist/Table/Tr.js +3 -4
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +9 -31
- package/dist/v2/MainNav/MainNavContext.cjs +1 -1
- package/dist/v2/MainNav/MainNavContext.js +1 -1
- package/dist/v2/MainNav/NavBrand.cjs +3 -3
- package/dist/v2/MainNav/NavBrand.js +13 -36
- package/dist/v2/MainNav/NavCondense.cjs +2 -5
- package/dist/v2/MainNav/NavCondense.js +15 -22
- package/dist/v2/MainNav/NavFooter.cjs +1 -1
- package/dist/v2/MainNav/NavFooter.js +4 -10
- package/dist/v2/MainNav/NavLink.cjs +10 -10
- package/dist/v2/MainNav/NavLink.js +18 -39
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +8 -42
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +8 -22
- package/dist/v2/MainNav/NavUser.cjs +2 -2
- package/dist/v2/MainNav/NavUser.js +13 -27
- package/dist/v2/Pagination/Pagination.cjs +1 -5
- package/dist/v2/Pagination/Pagination.js +7 -21
- package/dist/v2/Pagination/components.cjs +7 -10
- package/dist/v2/Pagination/components.js +32 -65
- package/dist/v2/SubNav/SubNav.cjs +5 -5
- package/dist/v2/SubNav/SubNav.js +8 -13
- package/dist/v2/SubNav/SubNavHeader.cjs +3 -3
- package/dist/v2/SubNav/SubNavHeader.js +30 -77
- package/dist/v2/SubNav/SubNavLink.cjs +5 -5
- package/dist/v2/SubNav/SubNavLink.js +13 -47
- package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/v2/SubNav/SubNavLinkSection.js +19 -34
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +16 -55
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/v2/SubNav/SubNavSectionLabel.js +10 -38
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +4 -18
- package/package.json +4 -4
- package/dist/Grid/GridContext.cjs +0 -1
- package/dist/Grid/GridContext.js +0 -6
|
@@ -1,86 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Search as
|
|
4
|
-
import
|
|
5
|
-
import K from "
|
|
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
|
|
11
|
-
import { SearchForm as
|
|
12
|
-
import { Searchbar as
|
|
13
|
-
import { Flex as
|
|
14
|
-
import { Typography as
|
|
15
|
-
import { IconButton as
|
|
16
|
-
const
|
|
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
|
-
`,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
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
|
-
|
|
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"),
|
|
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
|
-
${
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
34
|
+
`,v=s.default.div`
|
|
35
35
|
svg {
|
|
36
36
|
height: ${12/16}rem;
|
|
37
37
|
width: ${12/16}rem;
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { Dot as
|
|
4
|
-
import
|
|
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
|
|
8
|
-
import { Flex as
|
|
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
|
|
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
|
-
${
|
|
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
|
-
`,
|
|
36
|
+
`, a = e(g)`
|
|
38
37
|
width: ${12 / 16}rem;
|
|
39
38
|
height: ${4 / 16}rem;
|
|
40
39
|
* {
|
|
41
|
-
fill: ${({ theme: r, $active:
|
|
40
|
+
fill: ${({ theme: r, $active: i }) => i ? r.colors.primary600 : r.colors.neutral600};
|
|
42
41
|
}
|
|
43
|
-
`,
|
|
42
|
+
`, y = e.div`
|
|
44
43
|
svg {
|
|
45
44
|
height: ${12 / 16}rem;
|
|
46
45
|
width: ${12 / 16}rem;
|
|
47
46
|
}
|
|
48
|
-
`,
|
|
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
|
-
|
|
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"),
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
2
|
-
import { useState as
|
|
3
|
-
import { CarretDown as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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:
|
|
13
|
+
fill: ${({ theme: t }) => t.colors.neutral700};
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
`,
|
|
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
|
-
`,
|
|
22
|
+
`, C = o.div`
|
|
24
23
|
display: flex;
|
|
25
24
|
align-items: center;
|
|
26
25
|
width: ${12 / 16}rem;
|
|
27
|
-
transform: rotateX(${({ rotated:
|
|
28
|
-
`,
|
|
29
|
-
const [
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
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"),
|
|
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
|
-
`,
|
|
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
|
|
2
|
-
import { useState as h, Children as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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:
|
|
13
|
+
fill: ${({ theme: o }) => o.colors.neutral500};
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
`,
|
|
18
|
-
const [n,
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
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")
|
|
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
|
-
`,
|
|
5
|
+
`,p=s.default.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
|
|
9
|
-
`,
|
|
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
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
7
|
+
const a = d(s)`
|
|
10
8
|
border: none;
|
|
11
9
|
padding: 0;
|
|
12
10
|
background: transparent;
|
|
13
|
-
`,
|
|
11
|
+
`, g = d.div`
|
|
14
12
|
display: flex;
|
|
15
13
|
align-items: center;
|
|
16
14
|
transform: rotateX(${({ rotated: t }) => t ? "0deg" : "180deg"});
|
|
17
|
-
`,
|
|
18
|
-
|
|
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
|
-
|
|
18
|
+
y as SubNavSectionLabel
|
|
47
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
|
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
|
|
6
|
-
const
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "1.7.9",
|
|
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.
|
|
27
|
+
"@strapi/ui-primitives": "^1.7.9",
|
|
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.
|
|
36
|
+
"@strapi/icons": "^1.7.9",
|
|
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": "
|
|
67
|
+
"gitHead": "33bc1d7e6ff1ecbc74558af0f155f55293a39e4e"
|
|
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;
|