@strapi/design-system 1.7.5 → 1.7.7

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 (77) hide show
  1. package/dist/BaseButton/BaseButton.cjs +3 -3
  2. package/dist/BaseButton/BaseButton.js +5 -5
  3. package/dist/CarouselInput/Carousel.cjs +6 -7
  4. package/dist/CarouselInput/Carousel.js +25 -79
  5. package/dist/CarouselInput/CarouselActions.cjs +1 -1
  6. package/dist/CarouselInput/CarouselActions.js +1 -14
  7. package/dist/CarouselInput/CarouselImage.cjs +3 -4
  8. package/dist/CarouselInput/CarouselImage.js +13 -23
  9. package/dist/CarouselInput/CarouselInput.cjs +1 -1
  10. package/dist/CarouselInput/CarouselInput.js +12 -75
  11. package/dist/CarouselInput/CarouselSlide.cjs +1 -3
  12. package/dist/CarouselInput/CarouselSlide.js +4 -29
  13. package/dist/Checkbox/Checkbox.cjs +3 -3
  14. package/dist/Checkbox/Checkbox.js +18 -40
  15. package/dist/Dialog/Dialog.cjs +5 -5
  16. package/dist/Dialog/Dialog.js +21 -49
  17. package/dist/Dialog/DialogBody.cjs +2 -2
  18. package/dist/Dialog/DialogBody.js +6 -19
  19. package/dist/Dialog/DialogFooter.cjs +2 -2
  20. package/dist/Dialog/DialogFooter.js +7 -21
  21. package/dist/EmptyStateLayout/story-assets/Illo.cjs +1 -1
  22. package/dist/EmptyStateLayout/story-assets/Illo.js +2 -70
  23. package/dist/ModalLayout/ModalBody.cjs +2 -2
  24. package/dist/ModalLayout/ModalBody.js +4 -5
  25. package/dist/ModalLayout/ModalContext.cjs +1 -1
  26. package/dist/ModalLayout/ModalContext.js +2 -1
  27. package/dist/ModalLayout/ModalFooter.cjs +2 -6
  28. package/dist/ModalLayout/ModalFooter.js +9 -26
  29. package/dist/ModalLayout/ModalHeader.cjs +2 -2
  30. package/dist/ModalLayout/ModalHeader.js +10 -22
  31. package/dist/ModalLayout/ModalLayout.cjs +3 -5
  32. package/dist/ModalLayout/ModalLayout.js +10 -30
  33. package/dist/NumberInput/NumberInput.cjs +2 -2
  34. package/dist/NumberInput/NumberInput.js +68 -168
  35. package/dist/Pagination/Pagination.cjs +1 -5
  36. package/dist/Pagination/Pagination.js +7 -21
  37. package/dist/Pagination/components.cjs +7 -10
  38. package/dist/Pagination/components.js +34 -81
  39. package/dist/Popover/Popover.cjs +3 -3
  40. package/dist/Popover/Popover.js +93 -48
  41. package/dist/ProgressBar/ProgressBar.cjs +5 -5
  42. package/dist/ProgressBar/ProgressBar.js +6 -37
  43. package/dist/Radio/Radio.cjs +1 -4
  44. package/dist/Radio/Radio.js +5 -18
  45. package/dist/Searchbar/SearchForm.cjs +1 -1
  46. package/dist/Searchbar/SearchForm.js +2 -3
  47. package/dist/Searchbar/Searchbar.cjs +10 -11
  48. package/dist/Searchbar/Searchbar.js +25 -54
  49. package/dist/Status/Status.cjs +6 -6
  50. package/dist/Status/Status.js +8 -46
  51. package/dist/Switch/Switch.cjs +5 -5
  52. package/dist/Switch/Switch.js +16 -52
  53. package/dist/Tabs/TabGroup.cjs +1 -1
  54. package/dist/Tabs/TabGroup.js +13 -37
  55. package/dist/Tabs/TabPanels.cjs +1 -1
  56. package/dist/Tabs/TabPanels.js +11 -22
  57. package/dist/Tabs/Tabs.cjs +2 -2
  58. package/dist/Tabs/Tabs.js +55 -110
  59. package/dist/Tabs/TabsContext.cjs +1 -1
  60. package/dist/Tabs/TabsContext.js +11 -4
  61. package/dist/Textarea/Textarea.cjs +14 -12
  62. package/dist/Textarea/Textarea.js +33 -55
  63. package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
  64. package/dist/ToggleCheckbox/ToggleCheckbox.js +25 -121
  65. package/dist/ToggleInput/ToggleInput.cjs +3 -3
  66. package/dist/ToggleInput/ToggleInput.js +17 -70
  67. package/dist/Typography/Typography.cjs +1 -1
  68. package/dist/Typography/Typography.js +6 -6
  69. package/dist/hooks/useControllableState.cjs +1 -1
  70. package/dist/hooks/useControllableState.js +6 -6
  71. package/dist/themes/utils.cjs +2 -2
  72. package/dist/themes/utils.js +1 -1
  73. package/package.json +8 -5
  74. package/dist/Tabs/useTabsFocus.cjs +0 -1
  75. package/dist/Tabs/useTabsFocus.js +0 -17
  76. package/dist/Textarea/TextareaInput.cjs +0 -30
  77. package/dist/Textarea/TextareaInput.js +0 -65
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("react"),d=require("styled-components"),c=require("../themes/utils.cjs"),p=require("../Flex/Flex.cjs"),t=e=>e&&e.__esModule?e:{default:e},f=t(i),B=t(d),r=B.default(p.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),l=require("react"),c=require("styled-components"),i=require("../themes/utils.cjs"),d=require("../Flex/Flex.cjs"),p=e=>e&&e.__esModule?e:{default:e};function f(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const b=f(l),g=p(c),o=g.default(d.Flex)`
2
2
  > svg {
3
3
  height: ${({theme:e})=>e.spaces[3]};
4
4
  width: ${({theme:e})=>e.spaces[3]};
@@ -13,5 +13,5 @@
13
13
  pointer-events: none;
14
14
  }
15
15
 
16
- ${c.buttonFocusStyle}
17
- `,s=f.default.forwardRef(({disabled:e,children:a,background:o="neutral0",...u},n)=>l.jsx(r,{ref:n,"aria-disabled":e,as:"button",type:"button",disabled:e,padding:2,hasRadius:!0,background:o,borderColor:"neutral200",cursor:"pointer",...u,children:a}));s.displayName="BaseButton";exports.BaseButton=s;exports.BaseButtonWrapper=r;
16
+ ${i.buttonFocusStyle}
17
+ `,a=b.forwardRef(({disabled:e,children:r,background:t="neutral0",...n},s)=>u.jsx(o,{ref:s,"aria-disabled":e,as:"button",type:"button",disabled:e,padding:2,hasRadius:!0,background:t,borderColor:"neutral200",cursor:"pointer",...n,children:r}));a.displayName="BaseButton";exports.BaseButton=a;exports.BaseButtonWrapper=o;
@@ -1,9 +1,9 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import n from "react";
2
+ import * as n from "react";
3
3
  import i from "styled-components";
4
- import { buttonFocusStyle as u } from "../themes/utils.js";
5
- import { Flex as p } from "../Flex/Flex.js";
6
- const d = i(p)`
4
+ import { buttonFocusStyle as p } from "../themes/utils.js";
5
+ import { Flex as u } from "../Flex/Flex.js";
6
+ const d = i(u)`
7
7
  > svg {
8
8
  height: ${({ theme: t }) => t.spaces[3]};
9
9
  width: ${({ theme: t }) => t.spaces[3]};
@@ -18,7 +18,7 @@ const d = i(p)`
18
18
  pointer-events: none;
19
19
  }
20
20
 
21
- ${u}
21
+ ${p}
22
22
  `, l = n.forwardRef(({ disabled: t, children: r, background: e = "neutral0", ...o }, a) => s(d, { ref: a, "aria-disabled": t, as: "button", type: "button", disabled: t, padding: 2, hasRadius: !0, background: e, borderColor: "neutral200", cursor: "pointer", ...o, children: r }));
23
23
  l.displayName = "BaseButton";
24
24
  export {
@@ -1,14 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),g=require("@strapi/icons"),w=require("prop-types"),K=require("styled-components"),x=require("../helpers/keyboardKeys.cjs"),_=require("../Tooltip/Tooltip.cjs"),o=require("../Box/Box.cjs"),y=require("../Icon/Icon.cjs"),B=require("../Flex/Flex.cjs"),L=require("../Typography/Typography.cjs"),q=t=>t&&t.__esModule?t:{default:t},e=q(w),l=q(K),D=l.default(o.Box)`
2
- display: grid;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),_=require("react"),g=require("@strapi/icons"),T=require("styled-components"),x=require("../helpers/keyboardKeys.cjs"),k=require("../Tooltip/Tooltip.cjs"),i=require("../Box/Box.cjs"),j=require("../Flex/Flex.cjs"),y=require("../Icon/Icon.cjs"),w=require("../Typography/Typography.cjs"),A=e=>e&&e.__esModule?e:{default:e};function K(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const s=K(_),p=A(T),B=p.default(i.Box)`
3
2
  grid-template-columns: auto 1fr auto;
4
3
  grid-template-areas: 'startAction slides endAction';
5
- `,I=l.default(o.Box)`
4
+ `,D=p.default(j.Flex)`
6
5
  grid-area: slides;
7
- `,b=l.default.button`
8
- grid-area: ${({area:t})=>t};
6
+ `,b=p.default(i.Box)`
7
+ grid-area: ${({area:e})=>e};
9
8
 
10
9
  &:focus svg path,
11
10
  &:hover svg path {
12
- fill: ${({theme:t})=>t.colors.neutral900};
11
+ fill: ${({theme:e})=>e.colors.neutral900};
13
12
  }
14
- `,s=({actions:t,children:v,label:R,nextLabel:j,onNext:d,onPrevious:u,previousLabel:C,secondaryLabel:a,selectedSlide:T,...A})=>{const c=n.useRef(null),f=n.useRef(null),p=n.Children.toArray(v).map((i,k)=>n.cloneElement(i,{selected:k===T})),m=i=>{switch(i.key){case x.KeyboardKeys.RIGHT:{i.preventDefault(),f.current.focus(),d();break}case x.KeyboardKeys.LEFT:{i.preventDefault(),c.current.focus(),u();break}}},h=p.length>1;return r.jsx(o.Box,{...A,onKeyDown:m,children:r.jsxs(o.Box,{padding:2,borderColor:"neutral200",hasRadius:!0,background:"neutral100",children:[r.jsxs(D,{as:"section","aria-roledescription":"carousel","aria-label":R,position:"relative",children:[h&&r.jsx(b,{onClick:u,area:"startAction",ref:c,"aria-label":C,type:"button",children:r.jsx(y.Icon,{as:g.ChevronLeft,"aria-hidden":!0,width:"6px",height:"10px",color:"neutral600"})}),h&&r.jsx(b,{onClick:d,area:"endAction",ref:f,"aria-label":j,type:"button",children:r.jsx(y.Icon,{as:g.ChevronRight,"aria-hidden":!0,width:"6px",height:"10px",color:"neutral600"})}),r.jsx(I,{"aria-live":"polite",paddingLeft:2,paddingRight:2,width:"100%",overflow:"hidden",children:p}),t]}),a&&r.jsx(o.Box,{paddingTop:2,paddingLeft:4,paddingRight:4,children:r.jsx(_.Tooltip,{label:a,children:r.jsx(B.Flex,{justifyContent:"center",children:r.jsx(L.Typography,{variant:"pi",textColor:"neutral600",ellipsis:!0,children:a})})})})]})})};s.defaultProps={actions:void 0,error:void 0,hint:void 0,required:!1,secondaryLabel:void 0};s.propTypes={actions:e.default.node,children:e.default.node.isRequired,error:e.default.string,hint:e.default.oneOfType([e.default.string,e.default.node,e.default.arrayOf(e.default.node)]),label:e.default.string.isRequired,nextLabel:e.default.string.isRequired,onNext:e.default.func.isRequired,onPrevious:e.default.func.isRequired,previousLabel:e.default.string.isRequired,required:e.default.bool,secondaryLabel:e.default.string,selectedSlide:e.default.number.isRequired};exports.Carousel=s;
13
+ `,O=({actions:e,children:n,label:r,nextLabel:a,onNext:h,onPrevious:f,previousLabel:C,secondaryLabel:l,selectedSlide:m,...R})=>{const c=s.useRef(null),u=s.useRef(null),d=s.Children.map(n,(o,q)=>s.cloneElement(o,{selected:q===m})),v=o=>{switch(o.key){case x.KeyboardKeys.RIGHT:{o.preventDefault(),u?.current&&u.current.focus(),h();break}case x.KeyboardKeys.LEFT:{o.preventDefault(),c?.current&&c.current.focus(),f();break}}};return t.jsx(i.Box,{...R,onKeyDown:v,children:t.jsxs(i.Box,{padding:2,borderColor:"neutral200",hasRadius:!0,background:"neutral100",children:[t.jsxs(B,{as:"section","aria-roledescription":"carousel","aria-label":r,display:"grid",position:"relative",children:[d&&d.length>1&&t.jsxs(t.Fragment,{children:[t.jsx(b,{as:"button",onClick:f,area:"startAction",ref:c,"aria-label":C,type:"button",children:t.jsx(y.Icon,{as:g.ChevronLeft,"aria-hidden":!0,width:"6px",height:"10px",color:"neutral600"})}),t.jsx(b,{as:"button",onClick:h,area:"endAction",ref:u,"aria-label":a,type:"button",children:t.jsx(y.Icon,{as:g.ChevronRight,"aria-hidden":!0,width:"6px",height:"10px",color:"neutral600"})})]}),t.jsx(D,{"aria-live":"polite",paddingLeft:2,paddingRight:2,width:"100%",overflow:"hidden",children:d}),e]}),l&&t.jsx(i.Box,{paddingTop:2,paddingLeft:4,paddingRight:4,children:t.jsx(k.Tooltip,{label:l,children:t.jsx(j.Flex,{justifyContent:"center",children:t.jsx(w.Typography,{variant:"pi",textColor:"neutral600",ellipsis:!0,children:l})})})})]})})};exports.Carousel=O;
@@ -1,94 +1,40 @@
1
- import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
- import { useRef as f, Children as k, cloneElement as L } from "react";
3
- import { ChevronLeft as D, ChevronRight as K } from "@strapi/icons";
4
- import e from "prop-types";
5
- import a from "styled-components";
6
- import { KeyboardKeys as m } from "../helpers/keyboardKeys.js";
7
- import { Tooltip as j } from "../Tooltip/Tooltip.js";
8
- import { Box as t } from "../Box/Box.js";
9
- import { Icon as g } from "../Icon/Icon.js";
10
- import { Flex as E } from "../Flex/Flex.js";
11
- import { Typography as F } from "../Typography/Typography.js";
12
- const G = a(t)`
13
- display: grid;
1
+ import { jsx as e, jsxs as s, Fragment as A } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { ChevronLeft as k, ChevronRight as D } from "@strapi/icons";
4
+ import c from "styled-components";
5
+ import { KeyboardKeys as h } from "../helpers/keyboardKeys.js";
6
+ import { Tooltip as K } from "../Tooltip/Tooltip.js";
7
+ import { Box as i } from "../Box/Box.js";
8
+ import { Flex as g } from "../Flex/Flex.js";
9
+ import { Icon as f } from "../Icon/Icon.js";
10
+ import { Typography as T } from "../Typography/Typography.js";
11
+ const j = c(i)`
14
12
  grid-template-columns: auto 1fr auto;
15
13
  grid-template-areas: 'startAction slides endAction';
16
- `, I = a(t)`
14
+ `, F = c(g)`
17
15
  grid-area: slides;
18
- `, y = a.button`
19
- grid-area: ${({ area: i }) => i};
16
+ `, m = c(i)`
17
+ grid-area: ${({ area: r }) => r};
20
18
 
21
19
  &:focus svg path,
22
20
  &:hover svg path {
23
- fill: ${({ theme: i }) => i.colors.neutral900};
21
+ fill: ${({ theme: r }) => r.colors.neutral900};
24
22
  }
25
- `, b = ({
26
- actions: i,
27
- children: v,
28
- label: R,
29
- nextLabel: C,
30
- onNext: l,
31
- onPrevious: d,
32
- previousLabel: x,
33
- secondaryLabel: n,
34
- selectedSlide: q,
35
- ...A
36
- }) => {
37
- const s = f(null), c = f(null), p = k.toArray(v).map(
38
- (o, w) => L(o, { selected: w === q })
39
- ), T = (o) => {
40
- switch (o.key) {
41
- case m.RIGHT: {
42
- o.preventDefault(), c.current.focus(), l();
23
+ `, J = ({ actions: r, children: y, label: C, nextLabel: b, onNext: p, onPrevious: u, previousLabel: x, secondaryLabel: n, selectedSlide: R, ...v }) => {
24
+ const a = o.useRef(null), l = o.useRef(null), d = o.Children.map(y, (t, w) => o.cloneElement(t, { selected: w === R }));
25
+ return e(i, { ...v, onKeyDown: (t) => {
26
+ switch (t.key) {
27
+ case h.RIGHT: {
28
+ t.preventDefault(), l?.current && l.current.focus(), p();
43
29
  break;
44
30
  }
45
- case m.LEFT: {
46
- o.preventDefault(), s.current.focus(), d();
31
+ case h.LEFT: {
32
+ t.preventDefault(), a?.current && a.current.focus(), u();
47
33
  break;
48
34
  }
49
35
  }
50
- }, u = p.length > 1;
51
- return /* @__PURE__ */ r(t, { ...A, onKeyDown: T, children: /* @__PURE__ */ h(t, { padding: 2, borderColor: "neutral200", hasRadius: !0, background: "neutral100", children: [
52
- /* @__PURE__ */ h(G, { as: "section", "aria-roledescription": "carousel", "aria-label": R, position: "relative", children: [
53
- u && /* @__PURE__ */ r(
54
- y,
55
- {
56
- onClick: d,
57
- area: "startAction",
58
- ref: s,
59
- "aria-label": x,
60
- type: "button",
61
- children: /* @__PURE__ */ r(g, { as: D, "aria-hidden": !0, width: "6px", height: "10px", color: "neutral600" })
62
- }
63
- ),
64
- u && /* @__PURE__ */ r(y, { onClick: l, area: "endAction", ref: c, "aria-label": C, type: "button", children: /* @__PURE__ */ r(g, { as: K, "aria-hidden": !0, width: "6px", height: "10px", color: "neutral600" }) }),
65
- /* @__PURE__ */ r(I, { "aria-live": "polite", paddingLeft: 2, paddingRight: 2, width: "100%", overflow: "hidden", children: p }),
66
- i
67
- ] }),
68
- n && /* @__PURE__ */ r(t, { paddingTop: 2, paddingLeft: 4, paddingRight: 4, children: /* @__PURE__ */ r(j, { label: n, children: /* @__PURE__ */ r(E, { justifyContent: "center", children: /* @__PURE__ */ r(F, { variant: "pi", textColor: "neutral600", ellipsis: !0, children: n }) }) }) })
69
- ] }) });
70
- };
71
- b.defaultProps = {
72
- actions: void 0,
73
- error: void 0,
74
- hint: void 0,
75
- required: !1,
76
- secondaryLabel: void 0
77
- };
78
- b.propTypes = {
79
- actions: e.node,
80
- children: e.node.isRequired,
81
- error: e.string,
82
- hint: e.oneOfType([e.string, e.node, e.arrayOf(e.node)]),
83
- label: e.string.isRequired,
84
- nextLabel: e.string.isRequired,
85
- onNext: e.func.isRequired,
86
- onPrevious: e.func.isRequired,
87
- previousLabel: e.string.isRequired,
88
- required: e.bool,
89
- secondaryLabel: e.string,
90
- selectedSlide: e.number.isRequired
36
+ }, children: s(i, { padding: 2, borderColor: "neutral200", hasRadius: !0, background: "neutral100", children: [s(j, { as: "section", "aria-roledescription": "carousel", "aria-label": C, display: "grid", position: "relative", children: [d && d.length > 1 && s(A, { children: [e(m, { as: "button", onClick: u, area: "startAction", ref: a, "aria-label": x, type: "button", children: e(f, { as: k, "aria-hidden": !0, width: "6px", height: "10px", color: "neutral600" }) }), e(m, { as: "button", onClick: p, area: "endAction", ref: l, "aria-label": b, type: "button", children: e(f, { as: D, "aria-hidden": !0, width: "6px", height: "10px", color: "neutral600" }) })] }), e(F, { "aria-live": "polite", paddingLeft: 2, paddingRight: 2, width: "100%", overflow: "hidden", children: d }), r] }), n && e(i, { paddingTop: 2, paddingLeft: 4, paddingRight: 4, children: e(K, { label: n, children: e(g, { justifyContent: "center", children: e(T, { variant: "pi", textColor: "neutral600", ellipsis: !0, children: n }) }) }) })] }) });
91
37
  };
92
38
  export {
93
- b as Carousel
39
+ J as Carousel
94
40
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const s=require("../Flex/Flex.cjs"),i=({horizontal:e=!0,spacing:t=1,...o})=>r.jsx(s.Flex,{justifyContent:"center",gap:t,direction:e?"row":"column",alignItems:e?"center":"stretch",position:"absolute",width:"100%",bottom:1,...o});exports.CarouselActions=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("../Flex/Flex.cjs"),r=({horizontal:e=!0,spacing:t=1,...o})=>s.jsx(n.Flex,{justifyContent:"center",gap:t,direction:e?"row":"column",alignItems:e?"center":"stretch",position:"absolute",width:"100%",bottom:1,...o});exports.CarouselActions=r;
@@ -1,19 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Flex as i } from "../Flex/Flex.js";
4
- const c = ({ horizontal: t = !0, spacing: o = 1, ...e }) => /* @__PURE__ */ r(
5
- i,
6
- {
7
- justifyContent: "center",
8
- gap: o,
9
- direction: t ? "row" : "column",
10
- alignItems: t ? "center" : "stretch",
11
- position: "absolute",
12
- width: "100%",
13
- bottom: 1,
14
- ...e
15
- }
16
- );
3
+ const c = ({ horizontal: t = !0, spacing: o = 1, ...e }) => r(i, { justifyContent: "center", gap: o, direction: t ? "row" : "column", alignItems: t ? "center" : "stretch", position: "absolute", width: "100%", bottom: 1, ...e });
17
4
  export {
18
5
  c as CarouselActions
19
6
  };
@@ -1,4 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),c=require("prop-types"),d=require("styled-components"),f=require("../Typography/utils.cjs"),g=require("../Box/Box.cjs"),p=require("../Tooltip/Tooltip.cjs"),i=e=>e&&e.__esModule?e:{default:e},s=i(c),y=i(d),o=y.default(g.Box)`
2
- height: 100%;
3
- ${f.ellipsisStyle({ellipsis:!0})}
4
- `,r=e=>{const[l,u]=a.useState(!1),n=()=>{u(!0)};return l?t.jsx(p.Tooltip,{description:e.alt??"",children:t.jsx(o,{as:"img",...e})}):t.jsx(o,{as:"img",...e,onError:n})};r.defaultProps={src:void 0,alt:void 0};r.propTypes={alt:s.default.string,src:s.default.string};exports.CarouselImage=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),u=require("styled-components"),n=require("../Typography/utils.cjs"),a=require("../Box/Box.cjs"),c=require("../Tooltip/Tooltip.cjs"),d=e=>e&&e.__esModule?e:{default:e},g=d(u),r=g.default(a.Box)`
2
+ ${n.ellipsisStyle({ellipsis:!0})}
3
+ `,m=e=>{const[s,o]=l.useState(!1),i=()=>{o(!0)};return s?t.jsx(c.Tooltip,{description:e.alt??"",children:t.jsx(r,{as:"img",height:"100%",...e})}):t.jsx(r,{as:"img",height:"100%",...e,onError:i})};exports.CarouselImage=m;
@@ -1,27 +1,17 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useState as p } from "react";
3
- import t from "prop-types";
4
- import a from "styled-components";
5
- import { ellipsisStyle as n } from "../Typography/utils.js";
6
- import { Box as f } from "../Box/Box.js";
7
- import { Tooltip as c } from "../Tooltip/Tooltip.js";
8
- const e = a(f)`
9
- height: 100%;
10
- ${n({ ellipsis: !0 })}
11
- `, i = (r) => {
12
- const [s, m] = p(!1), l = () => {
13
- m(!0);
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useState as s } from "react";
3
+ import l from "styled-components";
4
+ import { ellipsisStyle as a } from "../Typography/utils.js";
5
+ import { Box as n } from "../Box/Box.js";
6
+ import { Tooltip as f } from "../Tooltip/Tooltip.js";
7
+ const o = l(n)`
8
+ ${a({ ellipsis: !0 })}
9
+ `, E = (r) => {
10
+ const [e, i] = s(!1), m = () => {
11
+ i(!0);
14
12
  };
15
- return s ? /* @__PURE__ */ o(c, { description: r.alt ?? "", children: /* @__PURE__ */ o(e, { as: "img", ...r }) }) : /* @__PURE__ */ o(e, { as: "img", ...r, onError: l });
16
- };
17
- i.defaultProps = {
18
- src: void 0,
19
- alt: void 0
20
- };
21
- i.propTypes = {
22
- alt: t.string,
23
- src: t.string
13
+ return e ? t(f, { description: r.alt ?? "", children: t(o, { as: "img", height: "100%", ...r }) }) : t(o, { as: "img", height: "100%", ...r, onError: m });
24
14
  };
25
15
  export {
26
- i as CarouselImage
16
+ E as CarouselImage
27
17
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("react");const v=require("prop-types"),y=require("./Carousel.cjs"),j=require("../hooks/useId.cjs"),R=require("../Field/Field.cjs"),h=require("../Field/FieldLabel.cjs"),m=require("../Field/FieldHint.cjs"),I=require("../Field/FieldError.cjs"),L=require("../Flex/Flex.cjs"),P=r=>r&&r.__esModule?r:{default:r},e=P(v),d=({actions:r,children:l,error:n,hint:s,label:t,labelAction:o,nextLabel:a,onNext:c,onPrevious:f,previousLabel:q,required:p,secondaryLabel:g,selectedSlide:b,id:x,...F})=>{const u=j.useId(x);return i.jsx(R.Field,{hint:s,error:n,id:u,required:p,children:i.jsxs(L.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t&&i.jsx(h.FieldLabel,{action:o,children:t}),i.jsx(y.Carousel,{actions:r,label:t,nextLabel:a,onNext:c,onPrevious:f,previousLabel:q,secondaryLabel:g,selectedSlide:b,id:u,...F,children:l}),i.jsx(m.FieldHint,{}),i.jsx(I.FieldError,{})]})})};d.defaultProps={actions:void 0,error:void 0,hint:void 0,id:void 0,labelAction:void 0,required:!1,secondaryLabel:void 0};d.propTypes={actions:e.default.node,children:e.default.node.isRequired,error:e.default.string,hint:e.default.oneOfType([e.default.string,e.default.node,e.default.arrayOf(e.default.node)]),id:e.default.string,label:e.default.string.isRequired,labelAction:e.default.element,nextLabel:e.default.string.isRequired,onNext:e.default.func.isRequired,onPrevious:e.default.func.isRequired,previousLabel:e.default.string.isRequired,required:e.default.bool,secondaryLabel:e.default.string,selectedSlide:e.default.number.isRequired};exports.CarouselInput=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./Carousel.cjs"),I=require("../hooks/useId.cjs"),g=require("../Field/Field.cjs"),p=require("../Field/FieldLabel.cjs"),L=require("../Field/FieldHint.cjs"),m=require("../Field/FieldError.cjs"),C=require("../Flex/Flex.cjs"),v=({actions:n,children:s,error:t,hint:o,label:r,labelAction:l,nextLabel:d,onNext:u,onPrevious:c,previousLabel:a,required:x,secondaryLabel:F,selectedSlide:q,id:j,...b})=>{const i=I.useId(j);return e.jsx(g.Field,{hint:o,error:t,id:i,required:x,children:e.jsxs(C.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[r&&e.jsx(p.FieldLabel,{action:l,children:r}),e.jsx(h.Carousel,{actions:n,label:r,nextLabel:d,onNext:u,onPrevious:c,previousLabel:a,secondaryLabel:F,selectedSlide:q,id:i,...b,children:s}),e.jsx(L.FieldHint,{}),e.jsx(m.FieldError,{})]})})};exports.CarouselInput=v;
@@ -1,78 +1,15 @@
1
- import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
- import "react";
3
- import e from "prop-types";
4
- import { Carousel as R } from "./Carousel.js";
5
- import { useId as x } from "../hooks/useId.js";
6
- import { Field as y } from "../Field/Field.js";
7
- import { FieldLabel as F } from "../Field/FieldLabel.js";
8
- import { FieldHint as L } from "../Field/FieldHint.js";
9
- import { FieldError as I } from "../Field/FieldError.js";
10
- import { Flex as P } from "../Flex/Flex.js";
11
- const n = ({
12
- actions: d,
13
- children: t,
14
- error: s,
15
- hint: l,
16
- label: i,
17
- labelAction: m,
18
- nextLabel: p,
19
- onNext: u,
20
- onPrevious: a,
21
- previousLabel: c,
22
- required: f,
23
- secondaryLabel: g,
24
- selectedSlide: q,
25
- id: b,
26
- ...v
27
- }) => {
28
- const o = x(b);
29
- return /* @__PURE__ */ r(y, { hint: l, error: s, id: o, required: f, children: /* @__PURE__ */ h(P, { direction: "column", alignItems: "stretch", gap: 1, children: [
30
- i && /* @__PURE__ */ r(F, { action: m, children: i }),
31
- /* @__PURE__ */ r(
32
- R,
33
- {
34
- actions: d,
35
- label: i,
36
- nextLabel: p,
37
- onNext: u,
38
- onPrevious: a,
39
- previousLabel: c,
40
- secondaryLabel: g,
41
- selectedSlide: q,
42
- id: o,
43
- ...v,
44
- children: t
45
- }
46
- ),
47
- /* @__PURE__ */ r(L, {}),
48
- /* @__PURE__ */ r(I, {})
49
- ] }) });
50
- };
51
- n.defaultProps = {
52
- actions: void 0,
53
- error: void 0,
54
- hint: void 0,
55
- id: void 0,
56
- labelAction: void 0,
57
- required: !1,
58
- secondaryLabel: void 0
59
- };
60
- n.propTypes = {
61
- actions: e.node,
62
- children: e.node.isRequired,
63
- error: e.string,
64
- hint: e.oneOfType([e.string, e.node, e.arrayOf(e.node)]),
65
- id: e.string,
66
- label: e.string.isRequired,
67
- labelAction: e.element,
68
- nextLabel: e.string.isRequired,
69
- onNext: e.func.isRequired,
70
- onPrevious: e.func.isRequired,
71
- previousLabel: e.string.isRequired,
72
- required: e.bool,
73
- secondaryLabel: e.string,
74
- selectedSlide: e.number.isRequired
1
+ import { jsx as r, jsxs as F } from "react/jsx-runtime";
2
+ import { Carousel as I } from "./Carousel.js";
3
+ import { useId as L } from "../hooks/useId.js";
4
+ import { Field as b } from "../Field/Field.js";
5
+ import { FieldLabel as g } from "../Field/FieldLabel.js";
6
+ import { FieldHint as j } from "../Field/FieldHint.js";
7
+ import { FieldError as v } from "../Field/FieldError.js";
8
+ import { Flex as C } from "../Flex/Flex.js";
9
+ const w = ({ actions: i, children: t, error: n, hint: d, label: e, labelAction: m, nextLabel: l, onNext: s, onPrevious: c, previousLabel: p, required: a, secondaryLabel: u, selectedSlide: f, id: h, ...x }) => {
10
+ const o = L(h);
11
+ return r(b, { hint: d, error: n, id: o, required: a, children: F(C, { direction: "column", alignItems: "stretch", gap: 1, children: [e && r(g, { action: m, children: e }), r(I, { actions: i, label: e, nextLabel: l, onNext: s, onPrevious: c, previousLabel: p, secondaryLabel: u, selectedSlide: f, id: o, ...x, children: t }), r(j, {}), r(v, {})] }) });
75
12
  };
76
13
  export {
77
- n as CarouselInput
14
+ w as CarouselInput
78
15
  };
@@ -1,3 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime");require("react");const d=require("prop-types"),a=require("styled-components"),n=require("../Flex/Flex.cjs"),r=e=>e&&e.__esModule?e:{default:e},l=r(d),c=r(a),p=c.default(n.Flex)`
2
- display: ${({selected:e})=>e?"flex":"none"};
3
- `,t=({label:e,children:s,selected:o,...i})=>u.jsx(p,{selected:o,role:"group","aria-roledescription":"slide","aria-label":e,justifyContent:"center",height:"124px",...i,children:s});t.defaultProps={selected:!1};t.propTypes={children:l.default.node.isRequired,label:l.default.string.isRequired,selected:l.default.bool};exports.CarouselSlide=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("../Flex/Flex.cjs"),s=({label:e,children:l,selected:r=!1,...i})=>t.jsx(o.Flex,{display:r?"flex":"none",role:"group","aria-roledescription":"slide","aria-label":e,justifyContent:"center",height:"124px",...i,children:l});exports.CarouselSlide=s;
@@ -1,31 +1,6 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import "react";
3
- import r from "prop-types";
4
- import p from "styled-components";
5
- import { Flex as d } from "../Flex/Flex.js";
6
- const a = p(d)`
7
- display: ${({ selected: e }) => e ? "flex" : "none"};
8
- `, o = ({ label: e, children: i, selected: l, ...s }) => /* @__PURE__ */ t(
9
- a,
10
- {
11
- selected: l,
12
- role: "group",
13
- "aria-roledescription": "slide",
14
- "aria-label": e,
15
- justifyContent: "center",
16
- height: "124px",
17
- ...s,
18
- children: i
19
- }
20
- );
21
- o.defaultProps = {
22
- selected: !1
23
- };
24
- o.propTypes = {
25
- children: r.node.isRequired,
26
- label: r.string.isRequired,
27
- selected: r.bool
28
- };
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { Flex as t } from "../Flex/Flex.js";
3
+ const s = ({ label: e, children: r, selected: o = !1, ...i }) => l(t, { display: o ? "flex" : "none", role: "group", "aria-roledescription": "slide", "aria-label": e, justifyContent: "center", height: "124px", ...i, children: r });
29
4
  export {
30
- o as CarouselSlide
5
+ s as CarouselSlide
31
6
  };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const f=require("prop-types"),x=require("styled-components"),p=require("../hooks/useId.cjs"),y=require("../Field/FieldContext.cjs"),b=require("../Typography/Typography.cjs"),h=require("../Field/Field.cjs"),q=require("../Flex/Flex.cjs"),g=require("../Box/Box.cjs"),j=require("../Field/FieldHint.cjs"),F=require("../Field/FieldError.cjs"),T=require("../BaseCheckbox/BaseCheckbox.cjs"),u=r=>r&&r.__esModule?r:{default:r},e=u(f),C=u(x),k=C.default(b.Typography)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("styled-components"),a=require("../hooks/useId.cjs"),u=require("../Field/FieldContext.cjs"),x=require("../Typography/Typography.cjs"),h=require("../Field/Field.cjs"),b=require("../Flex/Flex.cjs"),f=require("../Box/Box.cjs"),p=require("../Field/FieldHint.cjs"),q=require("../Field/FieldError.cjs"),j=require("../BaseCheckbox/BaseCheckbox.cjs"),y=e=>e&&e.__esModule?e:{default:e},F=y(d),g=F.default(x.Typography)`
2
2
  display: flex;
3
3
  align-items: flex-start;
4
4
  * {
5
- cursor: ${({disabled:r})=>r?"not-allowed":"pointer"};
5
+ cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
6
6
  }
7
- `,_=r=>{const{id:o}=y.useField();return t.jsx(T.BaseCheckbox,{id:o,...r})},d=({children:r,disabled:o,id:a,hint:l,error:n,...c})=>{const i=p.useId(a);let s;return n?s=`${i}-error`:l&&(s=`${i}-hint`),t.jsx(h.Field,{id:i,hint:l,error:n,children:t.jsxs(q.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsxs(k,{as:"label",textColor:"neutral800",disabled:o,children:[t.jsx(_,{disabled:o,"aria-describedby":s,...c}),t.jsx(g.Box,{paddingLeft:2,children:r})]}),t.jsx(j.FieldHint,{}),t.jsx(F.FieldError,{})]})})};d.defaultProps={disabled:!1,id:void 0,error:void 0,hint:void 0};d.propTypes={children:e.default.node.isRequired,disabled:e.default.bool,error:e.default.string,hint:e.default.oneOfType([e.default.string,e.default.node,e.default.arrayOf(e.default.node)]),id:e.default.oneOfType([e.default.string,e.default.number])};exports.Checkbox=d;
7
+ `,C=e=>{const{id:t}=u.useField();return r.jsx(j.BaseCheckbox,{id:t,...e})},k=({children:e,disabled:t=!1,id:l,hint:o,error:n,...c})=>{const i=a.useId(l);let s;return n?s=`${i}-error`:o&&(s=`${i}-hint`),r.jsx(h.Field,{id:i,hint:o,error:n,children:r.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[r.jsxs(g,{as:"label",textColor:"neutral800",disabled:t,children:[r.jsx(C,{disabled:t,"aria-describedby":s,...c}),r.jsx(f.Box,{paddingLeft:2,children:e})]}),r.jsx(p.FieldHint,{}),r.jsx(q.FieldError,{})]})})};exports.Checkbox=k;
@@ -1,50 +1,28 @@
1
- import { jsx as o, jsxs as l } from "react/jsx-runtime";
2
- import "react";
3
- import r from "prop-types";
4
- import f from "styled-components";
1
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
+ import a from "styled-components";
5
3
  import { useId as c } from "../hooks/useId.js";
6
- import { useField as h } from "../Field/FieldContext.js";
7
- import { Typography as x } from "../Typography/Typography.js";
8
- import { Field as b } from "../Field/Field.js";
9
- import { Flex as u } from "../Flex/Flex.js";
10
- import { Box as y } from "../Box/Box.js";
11
- import { FieldHint as g } from "../Field/FieldHint.js";
12
- import { FieldError as T } from "../Field/FieldError.js";
4
+ import { useField as p } from "../Field/FieldContext.js";
5
+ import { Typography as f } from "../Typography/Typography.js";
6
+ import { Field as x } from "../Field/Field.js";
7
+ import { Flex as h } from "../Flex/Flex.js";
8
+ import { Box as b } from "../Box/Box.js";
9
+ import { FieldHint as u } from "../Field/FieldHint.js";
10
+ import { FieldError as g } from "../Field/FieldError.js";
13
11
  import { BaseCheckbox as k } from "../BaseCheckbox/BaseCheckbox.js";
14
- const C = f(x)`
12
+ const y = a(f)`
15
13
  display: flex;
16
14
  align-items: flex-start;
17
15
  * {
18
16
  cursor: ${({ disabled: e }) => e ? "not-allowed" : "pointer"};
19
17
  }
20
- `, F = (e) => {
21
- const { id: i } = h();
22
- return /* @__PURE__ */ o(k, { id: i, ...e });
23
- }, m = ({ children: e, disabled: i, id: p, hint: n, error: s, ...a }) => {
24
- const t = c(p);
25
- let d;
26
- return s ? d = `${t}-error` : n && (d = `${t}-hint`), /* @__PURE__ */ o(b, { id: t, hint: n, error: s, children: /* @__PURE__ */ l(u, { direction: "column", alignItems: "stretch", gap: 1, children: [
27
- /* @__PURE__ */ l(C, { as: "label", textColor: "neutral800", disabled: i, children: [
28
- /* @__PURE__ */ o(F, { disabled: i, "aria-describedby": d, ...a }),
29
- /* @__PURE__ */ o(y, { paddingLeft: 2, children: e })
30
- ] }),
31
- /* @__PURE__ */ o(g, {}),
32
- /* @__PURE__ */ o(T, {})
33
- ] }) });
34
- };
35
- m.defaultProps = {
36
- disabled: !1,
37
- id: void 0,
38
- error: void 0,
39
- hint: void 0
40
- };
41
- m.propTypes = {
42
- children: r.node.isRequired,
43
- disabled: r.bool,
44
- error: r.string,
45
- hint: r.oneOfType([r.string, r.node, r.arrayOf(r.node)]),
46
- id: r.oneOfType([r.string, r.number])
18
+ `, C = (e) => {
19
+ const { id: o } = p();
20
+ return r(k, { id: o, ...e });
21
+ }, q = ({ children: e, disabled: o = !1, id: s, hint: l, error: m, ...n }) => {
22
+ const i = c(s);
23
+ let t;
24
+ return m ? t = `${i}-error` : l && (t = `${i}-hint`), r(x, { id: i, hint: l, error: m, children: d(h, { direction: "column", alignItems: "stretch", gap: 1, children: [d(y, { as: "label", textColor: "neutral800", disabled: o, children: [r(C, { disabled: o, "aria-describedby": t, ...n }), r(b, { paddingLeft: 2, children: e })] }), r(u, {}), r(g, {})] }) });
47
25
  };
48
26
  export {
49
- m as Checkbox
27
+ q as Checkbox
50
28
  };
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const g=require("prop-types"),x=require("styled-components"),y=require("../DismissibleLayer/index.cjs"),h=require("../helpers/setOpacity.cjs"),q=require("../hooks/useId.cjs"),b=require("../hooks/useLockScroll.cjs"),j=require("../FocusTrap/FocusTrap.cjs"),i=require("../Box/Box.cjs"),m=require("../Flex/Flex.cjs"),D=require("../Portal/Portal.cjs"),T=require("../Typography/Typography.cjs"),l=e=>e&&e.__esModule?e:{default:e},o=l(g),s=l(x),P=s.default(i.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("styled-components"),p=require("../DismissibleLayer/index.cjs"),x=require("../helpers/setOpacity.cjs"),g=require("../hooks/useId.cjs"),h=require("../hooks/useLockScroll.cjs"),y=require("../FocusTrap/FocusTrap.cjs"),o=require("../Box/Box.cjs"),b=require("../Flex/Flex.cjs"),f=require("../Portal/Portal.cjs"),j=require("../Typography/Typography.cjs"),q=e=>e&&e.__esModule?e:{default:e},t=q(c),m=t.default(o.Box)`
2
2
  inset: 0;
3
- background: ${({theme:e})=>h.setOpacity(e.colors.neutral800,.2)};
4
- `,_=s.default(i.Box)`
3
+ background: ${({theme:e})=>x.setOpacity(e.colors.neutral800,.2)};
4
+ `,D=t.default(o.Box)`
5
5
  max-width: ${412/16}rem;
6
6
  margin: 0 auto;
7
7
  overflow: hidden;
8
8
  margin-top: 10%;
9
- `,w=s.default(m.Flex)`
9
+ `,w=t.default(b.Flex)`
10
10
  border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
11
- `,t=({onClose:e,title:d,as:u,isOpen:a,id:c,...p})=>{const f=q.useId(c);if(b(a),!a)return null;const n=`${f}-label`;return r.jsx(D.Portal,{children:r.jsx(P,{padding:8,position:"fixed",zIndex:4,children:r.jsx(j.FocusTrap,{children:r.jsx(y.DismissibleLayer,{onEscapeKeyDown:e,onPointerDownOutside:e,children:r.jsxs(_,{"aria-labelledby":n,"aria-modal":!0,background:"neutral0",hasRadius:!0,shadow:"popupShadow",role:"dialog",children:[r.jsx(w,{padding:6,justifyContent:"center",children:r.jsx(T.Typography,{variant:"beta",as:u||"h2",id:n,children:d})}),r.jsx(i.Box,{...p})]})})})})})};t.displayName="Dialog";t.defaultProps={as:"h2",id:void 0};t.propTypes={as:o.default.string,id:o.default.oneOfType([o.default.string,o.default.number]),isOpen:o.default.bool.isRequired,onClose:o.default.func.isRequired,title:o.default.string.isRequired};exports.Dialog=t;
11
+ `,B=({onClose:e,title:i,as:s="h2",isOpen:n,id:l,...d})=>{const u=g.useId(l);if(h(n),!n)return null;const a=`${u}-label`;return r.jsx(f.Portal,{children:r.jsx(m,{padding:8,position:"fixed",zIndex:4,children:r.jsx(y.FocusTrap,{children:r.jsx(p.DismissibleLayer,{onEscapeKeyDown:e,onPointerDownOutside:e,children:r.jsxs(D,{"aria-labelledby":a,"aria-modal":!0,background:"neutral0",hasRadius:!0,shadow:"popupShadow",role:"dialog",children:[r.jsx(w,{padding:6,justifyContent:"center",children:r.jsx(j.Typography,{variant:"beta",as:s,id:a,children:i})}),r.jsx(o.Box,{...d})]})})})})})};exports.Dialog=B;
@@ -1,59 +1,31 @@
1
- import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
- import "react";
3
- import r from "prop-types";
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
4
2
  import e from "styled-components";
5
- import { DismissibleLayer as f } from "../DismissibleLayer/index.js";
6
- import { setOpacity as g } from "../helpers/setOpacity.js";
7
- import { useId as h } from "../hooks/useId.js";
8
- import y from "../hooks/useLockScroll.js";
9
- import { FocusTrap as b } from "../FocusTrap/FocusTrap.js";
10
- import { Box as t } from "../Box/Box.js";
11
- import { Flex as x } from "../Flex/Flex.js";
12
- import { Portal as D } from "../Portal/Portal.js";
13
- import { Typography as w } from "../Typography/Typography.js";
14
- const T = e(t)`
3
+ import { DismissibleLayer as c } from "../DismissibleLayer/index.js";
4
+ import { setOpacity as u } from "../helpers/setOpacity.js";
5
+ import { useId as f } from "../hooks/useId.js";
6
+ import h from "../hooks/useLockScroll.js";
7
+ import { FocusTrap as g } from "../FocusTrap/FocusTrap.js";
8
+ import { Box as i } from "../Box/Box.js";
9
+ import { Flex as b } from "../Flex/Flex.js";
10
+ import { Portal as x } from "../Portal/Portal.js";
11
+ import { Typography as y } from "../Typography/Typography.js";
12
+ const D = e(i)`
15
13
  inset: 0;
16
- background: ${({ theme: i }) => g(i.colors.neutral800, 0.2)};
17
- `, P = e(t)`
14
+ background: ${({ theme: r }) => u(r.colors.neutral800, 0.2)};
15
+ `, w = e(i)`
18
16
  max-width: ${412 / 16}rem;
19
17
  margin: 0 auto;
20
18
  overflow: hidden;
21
19
  margin-top: 10%;
22
- `, R = e(x)`
23
- border-bottom: 1px solid ${({ theme: i }) => i.colors.neutral150};
24
- `, a = ({ onClose: i, title: l, as: s, isOpen: n, id: p, ...m }) => {
25
- const c = h(p);
26
- if (y(n), !n)
20
+ `, $ = e(b)`
21
+ border-bottom: 1px solid ${({ theme: r }) => r.colors.neutral150};
22
+ `, C = ({ onClose: r, title: n, as: l = "h2", isOpen: t, id: d, ...m }) => {
23
+ const s = f(d);
24
+ if (h(t), !t)
27
25
  return null;
28
- const d = `${c}-label`;
29
- return /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(T, { padding: 8, position: "fixed", zIndex: 4, children: /* @__PURE__ */ o(b, { children: /* @__PURE__ */ o(f, { onEscapeKeyDown: i, onPointerDownOutside: i, children: /* @__PURE__ */ u(
30
- P,
31
- {
32
- "aria-labelledby": d,
33
- "aria-modal": !0,
34
- background: "neutral0",
35
- hasRadius: !0,
36
- shadow: "popupShadow",
37
- role: "dialog",
38
- children: [
39
- /* @__PURE__ */ o(R, { padding: 6, justifyContent: "center", children: /* @__PURE__ */ o(w, { variant: "beta", as: s || "h2", id: d, children: l }) }),
40
- /* @__PURE__ */ o(t, { ...m })
41
- ]
42
- }
43
- ) }) }) }) });
44
- };
45
- a.displayName = "Dialog";
46
- a.defaultProps = {
47
- as: "h2",
48
- id: void 0
49
- };
50
- a.propTypes = {
51
- as: r.string,
52
- id: r.oneOfType([r.string, r.number]),
53
- isOpen: r.bool.isRequired,
54
- onClose: r.func.isRequired,
55
- title: r.string.isRequired
26
+ const a = `${s}-label`;
27
+ return o(x, { children: o(D, { padding: 8, position: "fixed", zIndex: 4, children: o(g, { children: o(c, { onEscapeKeyDown: r, onPointerDownOutside: r, children: p(w, { "aria-labelledby": a, "aria-modal": !0, background: "neutral0", hasRadius: !0, shadow: "popupShadow", role: "dialog", children: [o($, { padding: 6, justifyContent: "center", children: o(y, { variant: "beta", as: l, id: a, children: n }) }), o(i, { ...m })] }) }) }) }) });
56
28
  };
57
29
  export {
58
- a as Dialog
30
+ C as Dialog
59
31
  };