@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.
Files changed (116) hide show
  1. package/README.md +9 -17
  2. package/dist/Button/Button.cjs +2 -2
  3. package/dist/Button/Button.js +4 -4
  4. package/dist/Combobox/Combobox.cjs +14 -13
  5. package/dist/Combobox/Combobox.js +73 -68
  6. package/dist/DatePicker/DatePicker.cjs +82 -6
  7. package/dist/DatePicker/DatePicker.js +414 -55
  8. package/dist/DateTimePicker/DateTimePicker.cjs +7 -1
  9. package/dist/DateTimePicker/DateTimePicker.js +97 -53
  10. package/dist/DateTimePicker/index.cjs +1 -1
  11. package/dist/DateTimePicker/index.js +3 -2
  12. package/dist/DesignSystemProvider.cjs +1 -0
  13. package/dist/DesignSystemProvider.js +10 -0
  14. package/dist/Grid/Grid.cjs +3 -3
  15. package/dist/Grid/Grid.js +6 -3
  16. package/dist/MainNav/MainNav.cjs +2 -2
  17. package/dist/MainNav/MainNav.js +9 -31
  18. package/dist/MainNav/MainNavContext.cjs +1 -1
  19. package/dist/MainNav/MainNavContext.js +1 -1
  20. package/dist/MainNav/NavBrand.cjs +3 -3
  21. package/dist/MainNav/NavBrand.js +12 -38
  22. package/dist/MainNav/NavCondense.cjs +2 -2
  23. package/dist/MainNav/NavCondense.js +15 -23
  24. package/dist/MainNav/NavFooter.cjs +1 -1
  25. package/dist/MainNav/NavFooter.js +4 -10
  26. package/dist/MainNav/NavLink.cjs +9 -9
  27. package/dist/MainNav/NavLink.js +13 -35
  28. package/dist/MainNav/NavSection.cjs +1 -1
  29. package/dist/MainNav/NavSection.js +9 -43
  30. package/dist/MainNav/NavSections.cjs +2 -2
  31. package/dist/MainNav/NavSections.js +7 -21
  32. package/dist/MainNav/NavUser.cjs +2 -2
  33. package/dist/MainNav/NavUser.js +13 -27
  34. package/dist/NumberInput/NumberInput.cjs +2 -2
  35. package/dist/NumberInput/NumberInput.js +40 -40
  36. package/dist/Popover/Popover.cjs +3 -4
  37. package/dist/Popover/Popover.js +46 -48
  38. package/dist/Popover/index.cjs +1 -1
  39. package/dist/Popover/index.js +5 -9
  40. package/dist/Popover/primitives.cjs +1 -0
  41. package/dist/Popover/primitives.js +5 -0
  42. package/dist/Searchbar/Searchbar.cjs +2 -2
  43. package/dist/Searchbar/Searchbar.js +5 -5
  44. package/dist/Select/SelectParts.cjs +1 -1
  45. package/dist/Select/SelectParts.js +1 -1
  46. package/dist/Select/SingleSelect.cjs +1 -1
  47. package/dist/Select/SingleSelect.js +36 -32
  48. package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
  49. package/dist/SimpleMenu/SimpleMenu.js +62 -151
  50. package/dist/SubNav/SubNav.cjs +5 -5
  51. package/dist/SubNav/SubNav.js +8 -13
  52. package/dist/SubNav/SubNavHeader.cjs +3 -3
  53. package/dist/SubNav/SubNavHeader.js +29 -76
  54. package/dist/SubNav/SubNavLink.cjs +13 -13
  55. package/dist/SubNav/SubNavLink.js +20 -52
  56. package/dist/SubNav/SubNavLinkSection.cjs +4 -4
  57. package/dist/SubNav/SubNavLinkSection.js +19 -35
  58. package/dist/SubNav/SubNavSection.cjs +2 -2
  59. package/dist/SubNav/SubNavSection.js +15 -55
  60. package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
  61. package/dist/SubNav/SubNavSectionLabel.js +10 -38
  62. package/dist/SubNav/SubNavSections.cjs +1 -1
  63. package/dist/SubNav/SubNavSections.js +4 -18
  64. package/dist/TextInput/TextInput.cjs +1 -1
  65. package/dist/TextInput/TextInput.js +5 -5
  66. package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
  67. package/dist/ThemeProvider/ThemeProvider.js +4 -3
  68. package/dist/TimePicker/TimePicker.cjs +5 -7
  69. package/dist/TimePicker/TimePicker.js +79 -33
  70. package/dist/TimePicker/index.cjs +1 -1
  71. package/dist/TimePicker/index.js +3 -2
  72. package/dist/helpers/context.cjs +1 -0
  73. package/dist/helpers/context.js +21 -0
  74. package/dist/helpers/getDefaultLocale.cjs +4 -1
  75. package/dist/helpers/getDefaultLocale.js +7 -2
  76. package/dist/hooks/useDateFormatter.cjs +1 -0
  77. package/dist/hooks/useDateFormatter.js +20 -0
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.js +309 -304
  80. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  81. package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
  82. package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
  83. package/dist/v2/Breadcrumbs/Crumb.js +6 -25
  84. package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
  85. package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
  86. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
  87. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
  88. package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
  89. package/dist/v2/Breadcrumbs/Divider.js +3 -4
  90. package/dist/v2/SimpleMenu/Menu.cjs +10 -10
  91. package/dist/v2/SimpleMenu/Menu.js +11 -11
  92. package/package.json +11 -10
  93. package/dist/DatePicker/DatePickerCalendar.cjs +0 -1
  94. package/dist/DatePicker/DatePickerCalendar.js +0 -43
  95. package/dist/DatePicker/DatePickerTd.cjs +0 -19
  96. package/dist/DatePicker/DatePickerTd.js +0 -29
  97. package/dist/DatePicker/DatePickerTh.cjs +0 -9
  98. package/dist/DatePicker/DatePickerTh.js +0 -18
  99. package/dist/DatePicker/compareDates.cjs +0 -1
  100. package/dist/DatePicker/compareDates.js +0 -4
  101. package/dist/DatePicker/components.cjs +0 -39
  102. package/dist/DatePicker/components.js +0 -53
  103. package/dist/DatePicker/utils/formatDate.cjs +0 -1
  104. package/dist/DatePicker/utils/formatDate.js +0 -4
  105. package/dist/DatePicker/utils/generateWeeks.cjs +0 -1
  106. package/dist/DatePicker/utils/generateWeeks.js +0 -17
  107. package/dist/DatePicker/utils/getDayOfWeek.cjs +0 -1
  108. package/dist/DatePicker/utils/getDayOfWeek.js +0 -15
  109. package/dist/DatePicker/utils/getMonths.cjs +0 -1
  110. package/dist/DatePicker/utils/getMonths.js +0 -7
  111. package/dist/DatePicker/utils/getYears.cjs +0 -1
  112. package/dist/DatePicker/utils/getYears.js +0 -9
  113. package/dist/DatePicker/utils/index.cjs +0 -1
  114. package/dist/DatePicker/utils/index.js +0 -12
  115. package/dist/DateTimePicker/parseDate.cjs +0 -1
  116. package/dist/DateTimePicker/parseDate.js +0 -8
@@ -1,22 +1,22 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const g=require("@strapi/icons"),y=require("prop-types"),x=require("react-router-dom"),h=require("styled-components"),i=require("../Box/Box.cjs"),u=require("../Typography/Typography.cjs"),n=require("../Flex/Flex.cjs"),c=e=>e&&e.__esModule?e:{default:e},t=c(y),s=c(h),b=s.default(i.Box)`
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:e})=>e.colors.neutral800};
6
+ color: ${({theme:r})=>r.colors.neutral800};
7
7
  svg > * {
8
- fill: ${({theme:e})=>e.colors.neutral600};
8
+ fill: ${({theme:r})=>r.colors.neutral600};
9
9
  }
10
10
 
11
11
  &.active {
12
- ${({theme:e})=>`
13
- background-color: ${e.colors.primary100};
14
- border-right: 2px solid ${e.colors.primary600};
12
+ ${({theme:r})=>`
13
+ background-color: ${r.colors.primary100};
14
+ border-right: 2px solid ${r.colors.primary600};
15
15
  svg > * {
16
- fill: ${e.colors.primary700};
16
+ fill: ${r.colors.primary700};
17
17
  }
18
- ${u.Typography} {
19
- color: ${e.colors.primary700};
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
- `,a=s.default(g.Dot)`
28
+ `,l=s.default(d.Dot)`
29
29
  width: ${12/16}rem;
30
30
  height: ${4/16}rem;
31
31
  * {
32
- fill: ${({theme:e,$active:o})=>o?e.colors.primary600:e.colors.neutral600};
32
+ fill: ${({theme:r,$active:o})=>o?r.colors.primary600:r.colors.neutral600};
33
33
  }
34
- `,$=s.default.div`
34
+ `,y=s.default.div`
35
35
  svg {
36
36
  height: ${12/16}rem;
37
37
  width: ${12/16}rem;
38
38
  }
39
- `,l=({children:e,icon:o,withBullet:d,isSubSectionChild:p,...f})=>r.jsxs(b,{as:x.NavLink,icon:o,background:"neutral100",paddingLeft:p?9:7,paddingBottom:2,paddingTop:2,...f,children:[r.jsxs(n.Flex,{children:[o?r.jsx($,{children:o}):r.jsx(a,{}),r.jsx(i.Box,{paddingLeft:2,children:r.jsx(u.Typography,{as:"span",children:e})})]}),d&&r.jsx(i.Box,{as:n.Flex,paddingRight:4,children:r.jsx(a,{$active:!0})})]});l.displayName="SubNavLink";l.defaultProps={icon:null,isSubSectionChild:!1,withBullet:!1};l.propTypes={children:t.default.node.isRequired,icon:t.default.element,isSubSectionChild:t.default.bool,withBullet:t.default.bool};exports.SubNavLink=l;
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 s, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import { Dot as f } from "@strapi/icons";
4
- import e from "prop-types";
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 c } from "../Typography/Typography.js";
9
- import { Flex as p } from "../Flex/Flex.js";
10
- const h = l(t)`
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: o }) => o.colors.neutral800};
13
+ color: ${({ theme: r }) => r.colors.neutral800};
16
14
  svg > * {
17
- fill: ${({ theme: o }) => o.colors.neutral600};
15
+ fill: ${({ theme: r }) => r.colors.neutral600};
18
16
  }
19
17
 
20
18
  &.active {
21
- ${({ theme: o }) => `
22
- background-color: ${o.colors.primary100};
23
- border-right: 2px solid ${o.colors.primary600};
19
+ ${({ theme: r }) => `
20
+ background-color: ${r.colors.primary100};
21
+ border-right: 2px solid ${r.colors.primary600};
24
22
  svg > * {
25
- fill: ${o.colors.primary700};
23
+ fill: ${r.colors.primary700};
26
24
  }
27
- ${c} {
28
- color: ${o.colors.primary700};
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 = l(f)`
35
+ `, a = e(m)`
38
36
  width: ${12 / 16}rem;
39
37
  height: ${4 / 16}rem;
40
38
  * {
41
- fill: ${({ theme: o, $active: i }) => i ? o.colors.primary600 : o.colors.neutral600};
39
+ fill: ${({ theme: r, $active: i }) => i ? r.colors.primary600 : r.colors.neutral600};
42
40
  }
43
- `, $ = l.div`
41
+ `, u = e.div`
44
42
  svg {
45
43
  height: ${12 / 16}rem;
46
44
  width: ${12 / 16}rem;
47
45
  }
48
- `, n = ({ children: o, icon: i, withBullet: d, isSubSectionChild: m, ...u }) => /* @__PURE__ */ s(
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
- n as SubNavLink
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"),l=require("react"),f=require("@strapi/icons"),y=require("prop-types"),j=require("styled-components"),b=require("../hooks/useId.cjs"),o=require("../Box/Box.cjs"),S=require("../Flex/Flex.cjs"),m=require("../Typography/Typography.cjs"),c=e=>e&&e.__esModule?e:{default:e},i=c(y),s=c(j),q=s.default(o.Box)`
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
- `,v=s.default.button`
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=s.default.div`
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
- `,d=({label:e,children:u,id:p})=>{const[n,h]=l.useState(!0),a=b.useId(p),g=()=>{h(r=>!r)};return t.jsxs(o.Box,{children:[t.jsx(q,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:t.jsx(S.Flex,{justifyContent:"space-between",children:t.jsxs(v,{onClick:g,"aria-expanded":n,"aria-controls":a,children:[t.jsx(k,{rotated:n,children:t.jsx(f.CarretDown,{"aria-hidden":!0})}),t.jsx(o.Box,{paddingLeft:2,children:t.jsx(m.Typography,{as:"span",fontWeight:"semiBold",textColor:"neutral800",children:e})})]})})}),n&&t.jsx("ul",{id:a,children:l.Children.map(u,(r,x)=>t.jsx("li",{children:r},x))})]})};d.defaultProps={children:void 0,id:void 0};d.propTypes={children:i.default.node,id:i.default.string,label:i.default.string.isRequired};exports.SubNavLinkSection=d;
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 p, jsx as e } from "react/jsx-runtime";
2
- import { useState as f, Children as g } from "react";
3
- import { CarretDown as u } from "@strapi/icons";
4
- import t from "prop-types";
5
- import d from "styled-components";
6
- import { useId as x } from "../hooks/useId.js";
7
- import { Box as o } from "../Box/Box.js";
8
- import { Flex as b } from "../Flex/Flex.js";
9
- import { Typography as k } from "../Typography/Typography.js";
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: r }) => r.colors.neutral700};
13
+ fill: ${({ theme: t }) => t.colors.neutral700};
15
14
  }
16
15
  }
17
- `, v = d.button`
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
- `, C = d.div`
22
+ `, b = o.div`
24
23
  display: flex;
25
24
  align-items: center;
26
25
  width: ${12 / 16}rem;
27
- transform: rotateX(${({ rotated: r }) => r ? "0deg" : "180deg"});
28
- `, l = ({ label: r, children: s, id: c }) => {
29
- const [i, m] = f(!0), a = x(c);
30
- return /* @__PURE__ */ p(o, { children: [
31
- /* @__PURE__ */ e(y, { paddingLeft: 7, paddingTop: 2, paddingBottom: 2, paddingRight: 4, children: /* @__PURE__ */ e(b, { justifyContent: "space-between", children: /* @__PURE__ */ p(v, { onClick: () => {
32
- m((n) => !n);
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
- l as SubNavLinkSection
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"),a=require("react"),b=require("prop-types"),S=require("styled-components"),q=require("./SubNavSectionLabel.cjs"),v=require("../hooks/useId.cjs"),d=require("../Box/Box.cjs"),j=require("../Flex/Flex.cjs"),m=require("../Badge/Badge.cjs"),u=e=>e&&e.__esModule?e:{default:e},n=u(b),y=u(S),_=y.default(d.Box)`
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
- `,o=({collapsable:e,label:c,badgeLabel:r,children:p,id:g})=>{const[l,h]=a.useState(!0),s=v.useId(g),f=()=>{h(i=>!i)};return t.jsxs(j.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(_,{paddingLeft:6,paddingTop:1,paddingBottom:1,paddingRight:4,children:t.jsxs(d.Box,{position:"relative",paddingRight:r?6:0,children:[t.jsx(q.SubNavSectionLabel,{onClick:f,ariaExpanded:l,ariaControls:s,collapsable:e,label:c}),r&&t.jsx(m.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:r})]})}),(!e||l)&&t.jsx("ol",{id:s,children:a.Children.map(p,(i,x)=>t.jsx("li",{children:i},x))})]})};o.defaultProps={badgeLabel:null,children:void 0,collapsable:!1,id:void 0};o.propTypes={badgeLabel:n.default.string,children:n.default.node,collapsable:n.default.bool,id:n.default.string,label:n.default.string.isRequired};exports.SubNavSection=o;
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 a, jsx as o } from "react/jsx-runtime";
2
- import { useState as u, Children as f } from "react";
3
- import r from "prop-types";
4
- import b from "styled-components";
5
- import { SubNavSectionLabel as v } from "./SubNavSectionLabel.js";
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 C } from "../Flex/Flex.js";
9
- import { Badge as S } from "../Badge/Badge.js";
10
- const k = b(d)`
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: i }) => i.colors.neutral500};
13
+ fill: ${({ theme: o }) => o.colors.neutral500};
15
14
  }
16
15
  }
17
- `, p = ({ collapsable: i, label: s, badgeLabel: t, children: c, id: m }) => {
18
- const [n, h] = u(!0), l = x(m);
19
- return /* @__PURE__ */ a(C, { direction: "column", alignItems: "stretch", gap: 1, children: [
20
- /* @__PURE__ */ o(k, { paddingLeft: 6, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ a(d, { position: "relative", paddingRight: t ? 6 : 0, children: [
21
- /* @__PURE__ */ o(
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
- p as SubNavSection
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");require("react");const x=require("@strapi/icons"),f=require("prop-types"),g=require("styled-components"),b=require("../Flex/Flex.cjs"),l=require("../Box/Box.cjs"),i=require("../Typography/Typography.cjs"),d=e=>e&&e.__esModule?e:{default:e},t=d(f),u=d(g),s=u.default(b.Flex)`
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
- `,y=u.default.div`
5
+ `,p=s.default.div`
6
6
  display: flex;
7
7
  align-items: center;
8
8
  transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
9
- `,a=({collapsable:e,label:n,onClick:c,ariaExpanded:o,ariaControls:p})=>e?r.jsxs(s,{as:"button",onClick:c,"aria-expanded":o,"aria-controls":p,textAlign:"left",children:[r.jsx(l.Box,{paddingRight:1,children:r.jsx(i.Typography,{variant:"sigma",textColor:"neutral600",children:n})}),e&&r.jsx(y,{rotated:o,children:r.jsx(x.CarretDown,{"aria-hidden":!0})})]}):r.jsx(s,{children:r.jsx(l.Box,{paddingRight:1,children:r.jsx(i.Typography,{variant:"sigma",textColor:"neutral600",children:n})})});a.defaultProps={ariaControls:null,ariaExpanded:null,collapsable:!1,onClick(){}};a.propTypes={ariaControls:t.default.string,ariaExpanded:t.default.bool,collapsable:t.default.bool,label:t.default.string.isRequired,onClick:t.default.func};exports.SubNavSectionLabel=a;
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 m, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import { CarretDown as g } from "@strapi/icons";
4
- import o from "prop-types";
5
- import p from "styled-components";
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 l = p(f)`
7
+ const a = d(s)`
10
8
  border: none;
11
9
  padding: 0;
12
10
  background: transparent;
13
- `, u = p.div`
11
+ `, g = d.div`
14
12
  display: flex;
15
13
  align-items: center;
16
14
  transform: rotateX(${({ rotated: t }) => t ? "0deg" : "180deg"});
17
- `, d = ({ collapsable: t, label: e, onClick: s, ariaExpanded: n, ariaControls: c }) => t ? /* @__PURE__ */ m(
18
- l,
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
- d as SubNavSectionLabel
18
+ y as SubNavSectionLabel
47
19
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),l=require("prop-types"),d=require("../Box/Box.cjs"),a=require("../Flex/Flex.cjs"),p=e=>e&&e.__esModule?e:{default:e},x=p(l),n=({children:e,spacing:o=2,horizontal:t=!1,...s})=>r.jsx(d.Box,{paddingTop:2,paddingBottom:4,children:r.jsx(a.Flex,{as:"ol",gap:o,direction:t?"row":"column",alignItems:t?"center":"stretch",...s,children:u.Children.map(e,(i,c)=>r.jsx("li",{children:i},c))})});n.propTypes={children:x.default.node.isRequired};exports.SubNavSections=n;
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 { Children as m } from "react";
3
- import d from "prop-types";
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 s = ({ children: e, spacing: i = 2, horizontal: o = !1, ...p }) => /* @__PURE__ */ r(c, { paddingTop: 2, paddingBottom: 4, children: /* @__PURE__ */ r(
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
- s as SubNavSections
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/FieldInput.cjs"),q=require("../Field/Field.cjs"),j=require("../Flex/Flex.cjs"),h=require("../Field/FieldLabel.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(q.Field,{name:l,hint:d,error:o,id:x,required:a,children:e.jsxs(j.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[r&&e.jsx(h.FieldLabel,{action:u,children:r}),e.jsx(I.FieldInput,{...i}),e.jsx(m.FieldHint,{}),e.jsx(f.FieldError,{})]})})})});s.displayName="TextInput";exports.TextInput=s;
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 { FieldInput as x } from "../Field/FieldInput.js";
5
- import { Field as F } from "../Field/Field.js";
6
- import { Flex as T } from "../Flex/Flex.js";
7
- import { FieldLabel as g } from "../Field/FieldLabel.js";
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(F, { name: t, hint: n, error: m, id: f, required: a, children: s(T, { direction: "column", alignItems: "stretch", gap: 1, children: [e && r(g, { action: p, children: e }), r(x, { ...i }), r(w, {}), r(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
- `,s=({children:e,theme:i})=>o.jsxs(t.ThemeProvider,{theme:i,children:[o.jsx(n,{}),e,o.jsx(r.LiveRegions,{})]});exports.ThemeProvider=s;
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
- const s = i`
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
- `, c = ({ children: e, theme: t }) => r(n, { theme: t, children: [o(s, {}), e, o(l, {})] });
177
+ `, h = ({ children: e, theme: t = s }) => r(n, { theme: t, children: [e, o(l, {}), o(a, {})] });
177
178
  export {
178
- c as ThemeProvider
179
+ h as ThemeProvider
179
180
  };
@@ -1,10 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),$=require("@strapi/icons"),b=require("styled-components"),j=require("../hooks/useId.cjs"),d=require("../Select/SingleSelect.cjs"),q=require("../Flex/Flex.cjs"),I=t=>t&&t.__esModule?t:{default:t},_=I(b),v=({id:t,value:c,step:h=15,onChange:u,...p})=>{const g=j.useId(t),m=24,s=[];let n=0;for(let e=0;e<m;e++)for(n=0;n<60;)s.push(`${e<10?`0${e}`:e}:${n<10?`0${n}`:n}`),n+=h;const f=()=>{const[e,a]=c?.split(":")??[],x=s.reduce((r,o)=>{const[l]=o.split(":");return Math.abs(l-e)<Math.abs(r-e)?l:r},s[0].split(":")[0]),M=s.reduce((r,o)=>{const l=o.split(":")[1];return Math.abs(l-a)<Math.abs(r-a)?l:r},s[0].split(":")[1]);return`${x}:${M}`},S=e=>{u&&u(e.toString())};return i.jsx(d.SingleSelect,{id:g,placeholder:"--:--",value:c?f():void 0,startIcon:i.jsx(y,{as:"span",children:i.jsx($.Clock,{})}),onChange:S,...p,children:s.map(e=>i.jsx(d.SingleSelectOption,{value:e,children:e},e))})},y=_.default(q.Flex)`
2
- & > svg {
3
- height: 1rem;
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
- & > svg path {
5
+ & > path {
8
6
  fill: ${({theme:t})=>t.colors.neutral500};
9
7
  }
10
- `;exports.TimePicker=v;
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;