@strapi/design-system 1.7.10 → 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/README.md +9 -17
- package/dist/Button/Button.cjs +2 -2
- package/dist/Button/Button.js +4 -4
- package/dist/Combobox/Combobox.cjs +14 -13
- package/dist/Combobox/Combobox.js +73 -68
- package/dist/DatePicker/DatePicker.cjs +82 -6
- package/dist/DatePicker/DatePicker.js +414 -55
- package/dist/DateTimePicker/DateTimePicker.cjs +7 -1
- package/dist/DateTimePicker/DateTimePicker.js +97 -53
- package/dist/DateTimePicker/index.cjs +1 -1
- package/dist/DateTimePicker/index.js +3 -2
- package/dist/DesignSystemProvider.cjs +1 -0
- package/dist/DesignSystemProvider.js +10 -0
- 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/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +40 -40
- package/dist/Popover/Popover.cjs +3 -4
- package/dist/Popover/Popover.js +46 -48
- package/dist/Popover/index.cjs +1 -1
- package/dist/Popover/index.js +5 -9
- package/dist/Popover/primitives.cjs +1 -0
- package/dist/Popover/primitives.js +5 -0
- package/dist/Searchbar/Searchbar.cjs +2 -2
- package/dist/Searchbar/Searchbar.js +5 -5
- package/dist/Select/SelectParts.cjs +1 -1
- package/dist/Select/SelectParts.js +1 -1
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +36 -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/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +5 -5
- package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/ThemeProvider/ThemeProvider.js +4 -3
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +79 -33
- package/dist/TimePicker/index.cjs +1 -1
- package/dist/TimePicker/index.js +3 -2
- package/dist/helpers/context.cjs +1 -0
- package/dist/helpers/context.js +21 -0
- package/dist/helpers/getDefaultLocale.cjs +4 -1
- package/dist/helpers/getDefaultLocale.js +7 -2
- package/dist/hooks/useDateFormatter.cjs +1 -0
- package/dist/hooks/useDateFormatter.js +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +309 -304
- 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 +11 -10
- package/dist/DatePicker/DatePickerCalendar.cjs +0 -1
- package/dist/DatePicker/DatePickerCalendar.js +0 -43
- package/dist/DatePicker/DatePickerTd.cjs +0 -19
- package/dist/DatePicker/DatePickerTd.js +0 -29
- package/dist/DatePicker/DatePickerTh.cjs +0 -9
- package/dist/DatePicker/DatePickerTh.js +0 -18
- package/dist/DatePicker/compareDates.cjs +0 -1
- package/dist/DatePicker/compareDates.js +0 -4
- package/dist/DatePicker/components.cjs +0 -39
- package/dist/DatePicker/components.js +0 -53
- package/dist/DatePicker/utils/formatDate.cjs +0 -1
- package/dist/DatePicker/utils/formatDate.js +0 -4
- package/dist/DatePicker/utils/generateWeeks.cjs +0 -1
- package/dist/DatePicker/utils/generateWeeks.js +0 -17
- package/dist/DatePicker/utils/getDayOfWeek.cjs +0 -1
- package/dist/DatePicker/utils/getDayOfWeek.js +0 -15
- package/dist/DatePicker/utils/getMonths.cjs +0 -1
- package/dist/DatePicker/utils/getMonths.js +0 -7
- package/dist/DatePicker/utils/getYears.cjs +0 -1
- package/dist/DatePicker/utils/getYears.js +0 -9
- package/dist/DatePicker/utils/index.cjs +0 -1
- package/dist/DatePicker/utils/index.js +0 -12
- package/dist/DateTimePicker/parseDate.cjs +0 -1
- package/dist/DateTimePicker/parseDate.js +0 -8
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),F=require("../hooks/useId.cjs"),I=require("../Field/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),F=require("../hooks/useId.cjs"),I=require("../Field/Field.cjs"),q=require("../Flex/Flex.cjs"),j=require("../Field/FieldLabel.cjs"),h=require("../Field/FieldInput.cjs"),m=require("../Field/FieldHint.cjs"),f=require("../Field/FieldError.cjs"),s=t.forwardRef(({name:l,hint:d,error:o,label:r,labelAction:u,id:c,required:a,...i},p)=>{const x=F.useId(c),n=t.useRef(null);if(!r&&!i["aria-label"])throw new Error('The TextInput component needs a "label" or an "aria-label" props');return t.useImperativeHandle(p,()=>({inputWrapperRef:n})),e.jsx("div",{ref:n,children:e.jsx(I.Field,{name:l,hint:d,error:o,id:x,required:a,children:e.jsxs(q.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[r&&e.jsx(j.FieldLabel,{action:u,children:r}),e.jsx(h.FieldInput,{...i}),e.jsx(m.FieldHint,{}),e.jsx(f.FieldError,{})]})})})});s.displayName="TextInput";exports.TextInput=s;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c, useRef as u, useImperativeHandle as h } from "react";
|
|
3
3
|
import { useId as I } from "../hooks/useId.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Field as x } from "../Field/Field.js";
|
|
5
|
+
import { Flex as F } from "../Flex/Flex.js";
|
|
6
|
+
import { FieldLabel as T } from "../Field/FieldLabel.js";
|
|
7
|
+
import { FieldInput as g } from "../Field/FieldInput.js";
|
|
8
8
|
import { FieldHint as w } from "../Field/FieldHint.js";
|
|
9
9
|
import { FieldError as R } from "../Field/FieldError.js";
|
|
10
10
|
const b = c(({ name: t, hint: n, error: m, label: e, labelAction: p, id: d, required: a, ...i }, l) => {
|
|
@@ -13,7 +13,7 @@ const b = c(({ name: t, hint: n, error: m, label: e, labelAction: p, id: d, requ
|
|
|
13
13
|
throw new Error('The TextInput component needs a "label" or an "aria-label" props');
|
|
14
14
|
return h(l, () => ({
|
|
15
15
|
inputWrapperRef: o
|
|
16
|
-
})), r("div", { ref: o, children: r(
|
|
16
|
+
})), r("div", { ref: o, children: r(x, { name: t, hint: n, error: m, id: f, required: a, children: s(F, { direction: "column", alignItems: "stretch", gap: 1, children: [e && r(T, { action: p, children: e }), r(g, { ...i }), r(w, {}), r(R, {})] }) }) });
|
|
17
17
|
});
|
|
18
18
|
b.displayName = "TextInput";
|
|
19
19
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("styled-components"),r=require("../LiveRegions/LiveRegions.cjs"),n=t.createGlobalStyle`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("styled-components"),r=require("../LiveRegions/LiveRegions.cjs"),n=require("../themes/lightTheme/index.cjs"),s=t.createGlobalStyle`
|
|
2
2
|
/* http://meyerweb.com/eric/tools/css/reset/
|
|
3
3
|
v2.0 | 20110126
|
|
4
4
|
License: none (public domain)
|
|
@@ -170,4 +170,4 @@
|
|
|
170
170
|
height: 100vh;
|
|
171
171
|
overflow-y: hidden;
|
|
172
172
|
}
|
|
173
|
-
`,
|
|
173
|
+
`,l=({children:e,theme:i=n.lightTheme})=>o.jsxs(t.ThemeProvider,{theme:i,children:[e,o.jsx(r.LiveRegions,{}),o.jsx(s,{})]});exports.ThemeProvider=l;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { createGlobalStyle as i, ThemeProvider as n } from "styled-components";
|
|
3
3
|
import { LiveRegions as l } from "../LiveRegions/LiveRegions.js";
|
|
4
|
-
|
|
4
|
+
import { lightTheme as s } from "../themes/lightTheme/index.js";
|
|
5
|
+
const a = i`
|
|
5
6
|
/* http://meyerweb.com/eric/tools/css/reset/
|
|
6
7
|
v2.0 | 20110126
|
|
7
8
|
License: none (public domain)
|
|
@@ -173,7 +174,7 @@ const s = i`
|
|
|
173
174
|
height: 100vh;
|
|
174
175
|
overflow-y: hidden;
|
|
175
176
|
}
|
|
176
|
-
`,
|
|
177
|
+
`, h = ({ children: e, theme: t = s }) => r(n, { theme: t, children: [e, o(l, {}), o(a, {})] });
|
|
177
178
|
export {
|
|
178
|
-
|
|
179
|
+
h as ThemeProvider
|
|
179
180
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
width: 1rem;
|
|
5
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),V=require("react"),M=require("@strapi/icons"),O=require("styled-components"),C=require("../Combobox/Combobox.cjs"),N=require("../DesignSystemProvider.cjs"),v=require("../hooks/useControllableState.cjs"),A=require("../hooks/useDateFormatter.cjs"),T=require("../hooks/useId.cjs"),B=require("../Field/Field.cjs"),L=require("../Flex/Flex.cjs"),$=require("../Field/FieldLabel.cjs"),E=require("../Field/FieldHint.cjs"),R=require("../Field/FieldError.cjs"),z=t=>t&&t.__esModule?t:{default:t};function H(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,u.get?u:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const m=H(V),Z=z(O),x=t=>!!t.match(/^[^a-zA-Z]*$/),F=({id:t,step:n=15,ariaLabel:s,selectButtonTitle:u,value:a,defaultValue:f,onChange:p,...d})=>{const _=N.useDesignSystem("TimePicker"),k=T.useId(t),[I,l]=m.useState(""),[g,h]=v.useControllableState({prop:a,defaultProp:f,onChange:p}),c=A.useDateFormatter(_.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),b=m.useMemo(()=>{const e=c.formatToParts(new Date),{value:r}=e.find(i=>i.type==="literal");return r},[c]),S=m.useMemo(()=>{const e=60/n;return[...Array(24).keys()].flatMap(r=>[...Array(e).keys()].map(i=>c.format(new Date(0,0,0,r,i*n))))},[n,c]),w=e=>{(!e||x(e))&&l(e)},y=e=>{const[r,i]=e.split(b);if(!r&&!i)return;const j=Number(r??"0"),q=Number(i??"0");if(!(j>23||q>59))return c.format(new Date(0,0,0,j,q))},D=e=>{const r=y(e.target.value);r?(l(r),h(r)):l(g)},P=e=>{if(typeof e<"u"){const r=y(e);h(r)}else h(e)};return m.useEffect(()=>{const e=typeof a>"u"?"":a;x(e)&&l(e)},[a,l]),o.jsx(C.ComboboxInput,{...d,value:g,onChange:P,isPrintableCharacter:x,allowCustomValue:!0,placeholder:`--${b}--`,autocomplete:"none",startIcon:o.jsx(G,{}),id:k,inputMode:"numeric",pattern:`\\d{2}${b}\\d{2}`,textValue:I,onTextValueChange:w,onBlur:D,children:S.map(e=>o.jsx(C.Option,{value:e,children:e},e))})},G=Z.default(M.Clock)`
|
|
2
|
+
height: 1rem;
|
|
3
|
+
width: 1rem;
|
|
6
4
|
|
|
7
|
-
& >
|
|
5
|
+
& > path {
|
|
8
6
|
fill: ${({theme:t})=>t.colors.neutral500};
|
|
9
7
|
}
|
|
10
|
-
|
|
8
|
+
`,J=({label:t,error:n,hint:s,id:u,required:a,labelAction:f,...p})=>{const d=T.useId(u);return o.jsx(B.Field,{hint:s,error:n,id:d,required:a,children:o.jsxs(L.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[o.jsx($.FieldLabel,{action:f,children:t}),o.jsx(F,{id:d,error:n,required:a,...p}),o.jsx(E.FieldHint,{}),o.jsx(R.FieldError,{})]})})};exports.TimePicker=J;exports.TimePickerInput=F;
|