@strapi/design-system 1.8.0 → 1.8.2
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 +16 -16
- package/dist/DatePicker/DatePicker.cjs +14 -14
- package/dist/DatePicker/DatePicker.js +257 -223
- 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/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +52 -51
- package/dist/Select/MultiSelect.cjs +5 -5
- package/dist/Select/MultiSelect.js +41 -41
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +32 -32
- 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/ToggleInput/ToggleInput.cjs +20 -4
- package/dist/ToggleInput/ToggleInput.js +43 -18
- package/dist/Typography/Typography.cjs +1 -1
- package/dist/Typography/Typography.js +6 -6
- package/dist/Typography/utils.cjs +1 -1
- package/dist/Typography/utils.js +4 -5
- 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 +15 -15
|
@@ -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,6 +1,22 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
|
|
3
|
-
`,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),b=require("styled-components"),m=require("../hooks/useControllableState.cjs"),C=require("../hooks/useId.cjs"),d=require("../Flex/Flex.cjs"),k=require("../themes/utils.cjs"),w=require("../TextButton/TextButton.cjs"),I=require("../Field/Field.cjs"),$=require("../Field/FieldLabel.cjs"),S=require("../Field/FieldHint.cjs"),B=require("../Field/FieldError.cjs"),v=require("../Field/FieldContext.cjs"),j=require("../Typography/Typography.cjs"),R=r=>r&&r.__esModule?r:{default:r},c=R(b),W=({offLabel:r,onLabel:p,disabled:e,checked:a,onChange:h,size:l="M",...g})=>{const[n=!1,u]=m.useControllableState({prop:a}),{error:s,id:o,name:x,required:f}=v.useField(),i=n!==null&&!n,q=`${o}-hint`,T=`${o}-error`;return t.jsxs(_,{position:"relative",hasRadius:!0,padding:1,background:e?"neutral150":"neutral100",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral200",wrap:"wrap",cursor:e?"not-allowed":"pointer",hasError:!!s,children:[t.jsx(F,{hasRadius:!0,flex:"1 1 50%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,justifyContent:"center",background:e&&i?"neutral200":i?"neutral0":"transparent",borderColor:e&&i?"neutral300":i?"neutral200":e?"neutral150":"neutral100",size:l,children:t.jsx(j.Typography,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:e?"neutral700":i?"danger700":"neutral600",children:r})}),t.jsx(F,{hasRadius:!0,flex:"1 1 50%",paddingLeft:3,paddingRight:3,justifyContent:"center",background:e&&n?"neutral200":n?"neutral0":"transparent",borderColor:e&&n?"neutral300":n?"neutral200":e?"neutral150":"neutral100",size:l,children:t.jsx(j.Typography,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:e?"neutral700":n?"primary600":"neutral600",children:p})}),t.jsx(E,{...g,onChange:y=>{u(y.currentTarget.checked),h?.(y)},type:"checkbox",id:o,name:x,"aria-required":f,disabled:e,"aria-disabled":e,"aria-describedby":o?`${q} ${T}`:void 0,checked:!!n})]})},_=c.default(d.Flex)`
|
|
2
|
+
${k.inputFocusStyle()}
|
|
3
|
+
`,F=c.default(d.Flex)`
|
|
4
|
+
/**
|
|
5
|
+
We declare the defined value because we want the height of the input when
|
|
6
|
+
the values are in a row to be 40px. But defining a height on the label
|
|
7
|
+
would break the input when it wraps.
|
|
8
|
+
*/
|
|
9
|
+
padding-top: ${({size:r})=>`${r==="S"?"2px":"6px"}`};
|
|
10
|
+
padding-bottom: ${({size:r})=>`${r==="S"?"2px":"6px"}`};
|
|
11
|
+
`,E=c.default.input`
|
|
12
|
+
height: 100%;
|
|
13
|
+
left: 0;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
z-index: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
`,L=({disabled:r=!1,error:p,hint:e,label:a,name:h,labelAction:l,required:g=!1,id:n,onClear:u,clearLabel:s,checked:o,...x})=>{const f=C.useId(n);return t.jsx(I.Field,{name:h,hint:e,error:p,id:f,required:g,maxWidth:"320px",children:t.jsxs(d.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsxs(d.Flex,{children:[a?t.jsx($.FieldLabel,{action:l,children:a}):null,s&&u&&o!==null&&!r&&t.jsx(M,{onClick:u,children:s})]}),t.jsx(W,{checked:o,disabled:r,...x}),t.jsx(S.FieldHint,{}),t.jsx(B.FieldError,{})]})})},M=c.default(w.TextButton)`
|
|
4
20
|
align-self: flex-end;
|
|
5
21
|
margin-left: auto;
|
|
6
|
-
|
|
22
|
+
`;exports.ToggleInput=L;
|
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Field as T } from "../Field/Field.js";
|
|
6
|
-
import { TextButton as j } from "../TextButton/TextButton.js";
|
|
1
|
+
import { jsx as r, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import c from "styled-components";
|
|
3
|
+
import { useControllableState as T } from "../hooks/useControllableState.js";
|
|
4
|
+
import { useId as I } from "../hooks/useId.js";
|
|
7
5
|
import { Flex as d } from "../Flex/Flex.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { inputFocusStyle as $ } from "../themes/utils.js";
|
|
7
|
+
import { TextButton as F } from "../TextButton/TextButton.js";
|
|
8
|
+
import { Field as B } from "../Field/Field.js";
|
|
9
|
+
import { FieldLabel as W } from "../Field/FieldLabel.js";
|
|
10
|
+
import { FieldHint as v } from "../Field/FieldHint.js";
|
|
11
|
+
import { FieldError as R } from "../Field/FieldError.js";
|
|
12
|
+
import { useField as S } from "../Field/FieldContext.js";
|
|
13
|
+
import { Typography as y } from "../Typography/Typography.js";
|
|
14
|
+
const j = ({ offLabel: n, onLabel: h, disabled: e, checked: a, onChange: s, size: l = "M", ...m }) => {
|
|
15
|
+
const [t = !1, p] = T({
|
|
16
|
+
prop: a
|
|
17
|
+
}), { error: u, id: o, name: g, required: f } = S(), i = t !== null && !t, w = `${o}-hint`, b = `${o}-error`;
|
|
18
|
+
return x(q, { position: "relative", hasRadius: !0, padding: 1, background: e ? "neutral150" : "neutral100", borderStyle: "solid", borderWidth: "1px", borderColor: "neutral200", wrap: "wrap", cursor: e ? "not-allowed" : "pointer", hasError: !!u, children: [r(C, { hasRadius: !0, flex: "1 1 50%", paddingTop: 2, paddingBottom: 2, paddingLeft: 3, paddingRight: 3, justifyContent: "center", background: e && i ? "neutral200" : i ? "neutral0" : "transparent", borderColor: e && i ? "neutral300" : i ? "neutral200" : e ? "neutral150" : "neutral100", size: l, children: r(y, { variant: "pi", fontWeight: "bold", textTransform: "uppercase", textColor: e ? "neutral700" : i ? "danger700" : "neutral600", children: n }) }), r(C, { hasRadius: !0, flex: "1 1 50%", paddingLeft: 3, paddingRight: 3, justifyContent: "center", background: e && t ? "neutral200" : t ? "neutral0" : "transparent", borderColor: e && t ? "neutral300" : t ? "neutral200" : e ? "neutral150" : "neutral100", size: l, children: r(y, { variant: "pi", fontWeight: "bold", textTransform: "uppercase", textColor: e ? "neutral700" : t ? "primary600" : "neutral600", children: h }) }), r(z, { ...m, onChange: (k) => {
|
|
19
|
+
p(k.currentTarget.checked), s?.(k);
|
|
20
|
+
}, type: "checkbox", id: o, name: g, "aria-required": f, disabled: e, "aria-disabled": e, "aria-describedby": o ? `${w} ${b}` : void 0, checked: !!t })] });
|
|
21
|
+
}, q = c(d)`
|
|
22
|
+
${$()}
|
|
23
|
+
`, C = c(d)`
|
|
24
|
+
/**
|
|
25
|
+
We declare the defined value because we want the height of the input when
|
|
26
|
+
the values are in a row to be 40px. But defining a height on the label
|
|
27
|
+
would break the input when it wraps.
|
|
28
|
+
*/
|
|
29
|
+
padding-top: ${({ size: n }) => `${n === "S" ? "2px" : "6px"}`};
|
|
30
|
+
padding-bottom: ${({ size: n }) => `${n === "S" ? "2px" : "6px"}`};
|
|
31
|
+
`, z = c.input`
|
|
32
|
+
height: 100%;
|
|
33
|
+
left: 0;
|
|
34
|
+
opacity: 0;
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
z-index: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
`, V = ({ disabled: n = !1, error: h, hint: e, label: a, name: s, labelAction: l, required: m = !1, id: t, onClear: p, clearLabel: u, checked: o, ...g }) => {
|
|
40
|
+
const f = I(t);
|
|
41
|
+
return r(B, { name: s, hint: e, error: h, id: f, required: m, maxWidth: "320px", children: x(d, { direction: "column", alignItems: "stretch", gap: 1, children: [x(d, { children: [a ? r(W, { action: l, children: a }) : null, u && p && o !== null && !n && r(E, { onClick: p, children: u })] }), r(j, { checked: o, disabled: n, ...g }), r(v, {}), r(R, {})] }) });
|
|
42
|
+
}, E = c(F)`
|
|
14
43
|
align-self: flex-end;
|
|
15
44
|
margin-left: auto;
|
|
16
|
-
|
|
17
|
-
const l = F(u);
|
|
18
|
-
return r(C, { name: a, hint: c, error: f, id: l, required: h, children: m(d, { direction: "column", alignItems: "stretch", gap: 1, children: [m(d, { children: [r(k, { action: g, children: o }), t && i && n !== null && !e && r(q, { onClick: i, children: t })] }), r(I, { id: l, size: s, checked: n, disabled: e, ...x, children: o }), r(y, {}), r(B, {})] }) });
|
|
19
|
-
};
|
|
20
|
-
w.displayName = "ToggleInput";
|
|
45
|
+
`;
|
|
21
46
|
export {
|
|
22
|
-
|
|
47
|
+
V as ToggleInput
|
|
23
48
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
font-weight: ${({theme:e,fontWeight:t})=>r.extractStyleFromTheme(e.fontWeights,t,void 0)};
|
|
8
8
|
font-size: ${({theme:e,fontSize:t})=>r.extractStyleFromTheme(e.fontSizes,t,void 0)};
|
|
9
9
|
line-height: ${({theme:e,lineHeight:t})=>r.extractStyleFromTheme(e.lineHeights,t,t)};
|
|
10
|
-
color: ${
|
|
10
|
+
color: ${({theme:e,textColor:t})=>e.colors[t||"neutral800"]};
|
|
11
11
|
text-align: ${({textAlign:e})=>e};
|
|
12
12
|
text-decoration: ${({textDecoration:e})=>e};
|
|
13
13
|
text-transform: ${({textTransform:e})=>e};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import r from "styled-components";
|
|
2
|
-
import { variantStyle as i, ellipsisStyle as n
|
|
2
|
+
import { variantStyle as i, ellipsisStyle as n } from "./utils.js";
|
|
3
3
|
import { extractStyleFromTheme as o } from "../helpers/theme.js";
|
|
4
|
-
const
|
|
4
|
+
const a = {
|
|
5
5
|
fontSize: !0,
|
|
6
6
|
fontWeight: !0
|
|
7
|
-
},
|
|
8
|
-
shouldForwardProp: (t, e) => !
|
|
7
|
+
}, h = r.span.withConfig({
|
|
8
|
+
shouldForwardProp: (t, e) => !a[t] && e(t)
|
|
9
9
|
})`
|
|
10
10
|
${i}
|
|
11
11
|
${n}
|
|
@@ -15,11 +15,11 @@ const s = {
|
|
|
15
15
|
font-weight: ${({ theme: t, fontWeight: e }) => o(t.fontWeights, e, void 0)};
|
|
16
16
|
font-size: ${({ theme: t, fontSize: e }) => o(t.fontSizes, e, void 0)};
|
|
17
17
|
line-height: ${({ theme: t, lineHeight: e }) => o(t.lineHeights, e, e)};
|
|
18
|
-
color: ${
|
|
18
|
+
color: ${({ theme: t, textColor: e }) => t.colors[e || "neutral800"]};
|
|
19
19
|
text-align: ${({ textAlign: t }) => t};
|
|
20
20
|
text-decoration: ${({ textDecoration: t }) => t};
|
|
21
21
|
text-transform: ${({ textTransform: t }) => t};
|
|
22
22
|
`;
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
h as Typography
|
|
25
25
|
};
|