@strapi/design-system 1.7.6 → 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.
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +5 -5
- package/dist/CarouselInput/Carousel.cjs +6 -7
- package/dist/CarouselInput/Carousel.js +25 -79
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +1 -14
- package/dist/CarouselInput/CarouselImage.cjs +3 -4
- package/dist/CarouselInput/CarouselImage.js +13 -23
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +12 -75
- package/dist/CarouselInput/CarouselSlide.cjs +1 -3
- package/dist/CarouselInput/CarouselSlide.js +4 -29
- package/dist/Checkbox/Checkbox.cjs +3 -3
- package/dist/Checkbox/Checkbox.js +18 -40
- package/dist/Dialog/Dialog.cjs +5 -5
- package/dist/Dialog/Dialog.js +21 -49
- package/dist/Dialog/DialogBody.cjs +2 -2
- package/dist/Dialog/DialogBody.js +6 -19
- package/dist/Dialog/DialogFooter.cjs +2 -2
- package/dist/Dialog/DialogFooter.js +7 -21
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +4 -5
- package/dist/ModalLayout/ModalContext.cjs +1 -1
- package/dist/ModalLayout/ModalContext.js +2 -1
- package/dist/ModalLayout/ModalFooter.cjs +2 -6
- package/dist/ModalLayout/ModalFooter.js +9 -26
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +10 -22
- package/dist/ModalLayout/ModalLayout.cjs +3 -5
- package/dist/ModalLayout/ModalLayout.js +10 -30
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +68 -168
- package/dist/Pagination/Pagination.cjs +1 -5
- package/dist/Pagination/Pagination.js +7 -21
- package/dist/Pagination/components.cjs +7 -10
- package/dist/Pagination/components.js +34 -81
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +67 -66
- package/dist/ProgressBar/ProgressBar.cjs +5 -5
- package/dist/ProgressBar/ProgressBar.js +6 -37
- package/dist/Radio/Radio.cjs +1 -4
- package/dist/Radio/Radio.js +5 -18
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +2 -3
- package/dist/Searchbar/Searchbar.cjs +10 -11
- package/dist/Searchbar/Searchbar.js +25 -54
- package/dist/Status/Status.cjs +6 -6
- package/dist/Status/Status.js +8 -46
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +16 -52
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +13 -37
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +11 -22
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +55 -110
- package/dist/Tabs/TabsContext.cjs +1 -1
- package/dist/Tabs/TabsContext.js +11 -4
- package/dist/Textarea/Textarea.cjs +14 -12
- package/dist/Textarea/Textarea.js +33 -55
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +25 -121
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +17 -70
- package/dist/Typography/Typography.cjs +1 -1
- package/dist/Typography/Typography.js +6 -6
- package/dist/hooks/useControllableState.cjs +1 -1
- package/dist/hooks/useControllableState.js +6 -6
- package/dist/themes/utils.cjs +2 -2
- package/dist/themes/utils.js +1 -1
- package/package.json +4 -4
- package/dist/Tabs/useTabsFocus.cjs +0 -1
- package/dist/Tabs/useTabsFocus.js +0 -17
- package/dist/Textarea/TextareaInput.cjs +0 -30
- package/dist/Textarea/TextareaInput.js +0 -65
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
-
${
|
|
17
|
-
`,
|
|
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
|
|
5
|
-
import { Flex as
|
|
6
|
-
const d = i(
|
|
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
|
-
${
|
|
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
|
|
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
|
-
`,
|
|
4
|
+
`,D=p.default(j.Flex)`
|
|
6
5
|
grid-area: slides;
|
|
7
|
-
`,b=
|
|
8
|
-
grid-area: ${({area:
|
|
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:
|
|
11
|
+
fill: ${({theme:e})=>e.colors.neutral900};
|
|
13
12
|
}
|
|
14
|
-
`,
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { ChevronLeft as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Icon as
|
|
10
|
-
import {
|
|
11
|
-
|
|
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
|
-
`,
|
|
14
|
+
`, F = c(g)`
|
|
17
15
|
grid-area: slides;
|
|
18
|
-
`,
|
|
19
|
-
grid-area: ${({ area:
|
|
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:
|
|
21
|
+
fill: ${({ theme: r }) => r.colors.neutral900};
|
|
24
22
|
}
|
|
25
|
-
`,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
46
|
-
|
|
31
|
+
case h.LEFT: {
|
|
32
|
+
t.preventDefault(), a?.current && a.current.focus(), u();
|
|
47
33
|
break;
|
|
48
34
|
}
|
|
49
35
|
}
|
|
50
|
-
},
|
|
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
|
-
|
|
39
|
+
J as Carousel
|
|
94
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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 }) =>
|
|
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"),
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import a from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
-
|
|
16
|
+
E as CarouselImage
|
|
27
17
|
};
|
|
@@ -1 +1 @@
|
|
|
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"),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
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
14
|
+
w as CarouselInput
|
|
78
15
|
};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
|
2
|
-
import "
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
s as CarouselSlide
|
|
31
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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:
|
|
5
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
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
|
|
2
|
-
import "
|
|
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
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { Field as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { Box as
|
|
11
|
-
import { FieldHint as
|
|
12
|
-
import { FieldError as
|
|
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
|
|
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
|
-
`,
|
|
21
|
-
const { id:
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
return
|
|
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
|
-
|
|
27
|
+
q as Checkbox
|
|
50
28
|
};
|
package/dist/Dialog/Dialog.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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("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})=>
|
|
4
|
-
`,
|
|
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=
|
|
9
|
+
`,w=t.default(b.Flex)`
|
|
10
10
|
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
11
|
-
`,
|
|
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;
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -1,59 +1,31 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
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
|
|
6
|
-
import { setOpacity as
|
|
7
|
-
import { useId as
|
|
8
|
-
import
|
|
9
|
-
import { FocusTrap as
|
|
10
|
-
import { Box as
|
|
11
|
-
import { Flex as
|
|
12
|
-
import { Portal as
|
|
13
|
-
import { Typography as
|
|
14
|
-
const
|
|
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:
|
|
17
|
-
`,
|
|
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
|
-
`,
|
|
23
|
-
border-bottom: 1px solid ${({ theme:
|
|
24
|
-
`,
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
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
|
|
29
|
-
return
|
|
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
|
-
|
|
30
|
+
C as Dialog
|
|
59
31
|
};
|