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