@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.
- 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/EmptyStateLayout/story-assets/Illo.cjs +1 -1
- package/dist/EmptyStateLayout/story-assets/Illo.js +2 -70
- 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 +93 -48
- 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 +8 -5
- 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
package/dist/Popover/Popover.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { jsx as r, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { useFloating as I, offset as W, shift as A, flip as K, autoUpdate as j } from "@floating-ui/react-dom";
|
|
4
|
+
import { FocusScope as M } from "@radix-ui/react-focus-scope";
|
|
5
|
+
import { useCallbackRef as T, composeEventHandlers as v } from "@strapi/ui-primitives";
|
|
6
|
+
import { hideOthers as U } from "aria-hidden";
|
|
7
|
+
import { RemoveScroll as B } from "react-remove-scroll";
|
|
8
|
+
import x from "styled-components";
|
|
9
|
+
import { DismissibleLayer as H } from "../DismissibleLayer/index.js";
|
|
10
|
+
import { stripReactIdOfColon as k } from "../helpers/strings.js";
|
|
11
|
+
import { useComposedRefs as N } from "../hooks/useComposeRefs.js";
|
|
12
|
+
import { useId as V } from "../hooks/useId.js";
|
|
13
|
+
import { useIntersection as Z } from "../hooks/useIntersection.js";
|
|
14
|
+
import { Box as h } from "../Box/Box.js";
|
|
15
|
+
import { Portal as _ } from "../Portal/Portal.js";
|
|
16
|
+
const fe = [
|
|
11
17
|
"top",
|
|
12
18
|
"top-start",
|
|
13
19
|
"top-end",
|
|
@@ -20,42 +26,81 @@ const N = [
|
|
|
20
26
|
"left",
|
|
21
27
|
"left-start",
|
|
22
28
|
"left-end"
|
|
23
|
-
],
|
|
24
|
-
box-shadow: ${({ theme:
|
|
25
|
-
z-index: ${({ theme:
|
|
26
|
-
border: 1px solid ${({ theme:
|
|
27
|
-
background: ${({ theme:
|
|
28
|
-
`,
|
|
29
|
-
const [m,
|
|
29
|
+
], q = x(h)`
|
|
30
|
+
box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
|
|
31
|
+
z-index: ${({ theme: e }) => e.zIndices[0]};
|
|
32
|
+
border: 1px solid ${({ theme: e }) => e.colors.neutral150};
|
|
33
|
+
background: ${({ theme: e }) => e.colors.neutral0};
|
|
34
|
+
`, G = ({ source: e, children: s, spacing: n = 0, fullWidth: i = !1, placement: l = "bottom-start", centered: a = !1, onEscapeKeyDown: d, onPointerDownOutside: u, onDismiss: c, onFocusOutside: f, ...E }) => {
|
|
35
|
+
const [m, P] = o.useState(null), b = o.useRef(!1), [R, y] = o.useState(void 0), { x: C, y: D, reference: w, floating: L, strategy: O } = I({
|
|
30
36
|
strategy: "fixed",
|
|
31
|
-
placement:
|
|
37
|
+
placement: a ? "bottom" : l,
|
|
32
38
|
middleware: [
|
|
33
|
-
|
|
34
|
-
mainAxis:
|
|
39
|
+
W({
|
|
40
|
+
mainAxis: n
|
|
35
41
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
A(),
|
|
43
|
+
K()
|
|
38
44
|
],
|
|
39
|
-
whileElementsMounted:
|
|
45
|
+
whileElementsMounted: j
|
|
40
46
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
o.useLayoutEffect(() => {
|
|
48
|
+
w(e.current);
|
|
49
|
+
}, [e, w]), o.useLayoutEffect(() => {
|
|
50
|
+
i && y(e.current.offsetWidth);
|
|
51
|
+
}, [i, e]), o.useEffect(() => {
|
|
52
|
+
if (m)
|
|
53
|
+
return U(m);
|
|
54
|
+
}, [m]);
|
|
55
|
+
const g = T(c);
|
|
56
|
+
o.useEffect(() => {
|
|
57
|
+
const t = () => {
|
|
58
|
+
g();
|
|
59
|
+
};
|
|
60
|
+
return window.addEventListener("blur", t), window.addEventListener("resize", t), () => {
|
|
61
|
+
window.removeEventListener("blur", t), window.removeEventListener("resize", t);
|
|
62
|
+
};
|
|
63
|
+
}, [g]);
|
|
64
|
+
const S = N((t) => P(t), L);
|
|
65
|
+
return r(B, { allowPinchZoom: !0, children: r(M, {
|
|
66
|
+
asChild: !0,
|
|
67
|
+
loop: !0,
|
|
68
|
+
// we make sure we're not trapping once it's been closed
|
|
69
|
+
// (closed !== unmounted when animating out)
|
|
70
|
+
trapped: !0,
|
|
71
|
+
onUnmountAutoFocus: (t) => {
|
|
72
|
+
t.preventDefault(), b.current || e.current?.focus({ preventScroll: !0 });
|
|
73
|
+
},
|
|
74
|
+
children: r(H, {
|
|
75
|
+
asChild: !0,
|
|
76
|
+
disableOutsidePointerEvents: !0,
|
|
77
|
+
onEscapeKeyDown: d,
|
|
78
|
+
onPointerDownOutside: v(u, (t) => {
|
|
79
|
+
const p = t.detail.originalEvent, $ = p.button === 0 && p.ctrlKey === !0, F = p.button === 2 || $;
|
|
80
|
+
b.current = F;
|
|
81
|
+
}, { checkForDefaultPrevented: !1 }),
|
|
82
|
+
// When focus is trapped, a `focusout` event may still happen.
|
|
83
|
+
// We make sure we don't trigger our `onDismiss` in such case.
|
|
84
|
+
onFocusOutside: v(f, (t) => t.preventDefault(), {
|
|
85
|
+
checkForDefaultPrevented: !1
|
|
86
|
+
}),
|
|
87
|
+
onDismiss: c,
|
|
88
|
+
children: r(q, { ref: S, style: {
|
|
89
|
+
left: C,
|
|
90
|
+
top: D,
|
|
91
|
+
position: O,
|
|
92
|
+
width: R || void 0
|
|
93
|
+
}, hasRadius: !0, background: "neutral0", padding: 1, ...E, children: s })
|
|
94
|
+
})
|
|
95
|
+
}) });
|
|
96
|
+
}, J = ({ children: e, intersectionId: s, onReachEnd: n, ...i }) => {
|
|
97
|
+
const l = o.useRef(null), a = V();
|
|
98
|
+
return Z(l, n ?? (() => {
|
|
54
99
|
}), {
|
|
55
|
-
selectorToWatch: `#${
|
|
56
|
-
skipWhen: !
|
|
57
|
-
}),
|
|
58
|
-
},
|
|
100
|
+
selectorToWatch: `#${k(a)}`,
|
|
101
|
+
skipWhen: !s || !n
|
|
102
|
+
}), z(Q, { ref: l, ...i, children: [e, s && n && r(h, { id: k(a), width: "100%", height: "1px" })] });
|
|
103
|
+
}, Q = x(h)`
|
|
59
104
|
// 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
|
|
60
105
|
max-height: ${3 * 5}rem;
|
|
61
106
|
overflow-y: auto;
|
|
@@ -67,18 +112,18 @@ const N = [
|
|
|
67
112
|
}
|
|
68
113
|
|
|
69
114
|
&::-webkit-scrollbar-track {
|
|
70
|
-
background: ${({ theme:
|
|
115
|
+
background: ${({ theme: e }) => e.colors.neutral0};
|
|
71
116
|
}
|
|
72
117
|
|
|
73
118
|
&::-webkit-scrollbar-thumb {
|
|
74
|
-
background: ${({ theme:
|
|
75
|
-
border-radius: ${({ theme:
|
|
119
|
+
background: ${({ theme: e }) => e.colors.neutral150};
|
|
120
|
+
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
76
121
|
margin-right: 10px;
|
|
77
122
|
}
|
|
78
|
-
`,
|
|
123
|
+
`, me = ({ children: e, source: s, spacing: n, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: d, onPointerDownOutside: u, onDismiss: c, ...f }) => r(_, { children: r(G, { source: s, spacing: n, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: d, onPointerDownOutside: u, onDismiss: c, children: r(J, { ...f, children: e }) }) });
|
|
79
124
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
125
|
+
G as Content,
|
|
126
|
+
fe as POPOVER_PLACEMENTS,
|
|
127
|
+
me as Popover,
|
|
128
|
+
J as Scrolling
|
|
84
129
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
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"),i=require("styled-components"),l=require("../Box/Box.cjs"),n=r=>r&&r.__esModule?r:{default:r},d=n(i),c=d.default(l.Box)`
|
|
2
2
|
&:before {
|
|
3
|
-
background-color: ${({theme:
|
|
4
|
-
border-radius: ${({theme:
|
|
3
|
+
background-color: ${({theme:r})=>r.colors.neutral0};
|
|
4
|
+
border-radius: ${({theme:r})=>r.borderRadius};
|
|
5
5
|
bottom: 0;
|
|
6
6
|
content: '';
|
|
7
7
|
position: absolute;
|
|
8
8
|
top: 0;
|
|
9
|
-
width: ${({value:
|
|
9
|
+
width: ${({value:r})=>`${r}%`};
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,b=({min:r=0,max:t=100,value:e=0,children:a,size:o="M",...s})=>u.jsx(c,{background:"neutral600",hasRadius:!0,"aria-label":a,"aria-valuemax":t,"aria-valuemin":r,"aria-valuenow":e,height:o==="S"?1:2,position:"relative",role:"progressbar",value:e,width:o==="S"?"78px":"102px",...s});exports.ProgressBar=b;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { Box as p } from "../Box/Box.js";
|
|
6
|
-
const l = u(p)`
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import l from "styled-components";
|
|
3
|
+
import { Box as n } from "../Box/Box.js";
|
|
4
|
+
const u = l(n)`
|
|
7
5
|
&:before {
|
|
8
6
|
background-color: ${({ theme: r }) => r.colors.neutral0};
|
|
9
7
|
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
@@ -13,36 +11,7 @@ const l = u(p)`
|
|
|
13
11
|
top: 0;
|
|
14
12
|
width: ${({ value: r }) => `${r}%`};
|
|
15
13
|
}
|
|
16
|
-
`,
|
|
17
|
-
l,
|
|
18
|
-
{
|
|
19
|
-
background: "neutral600",
|
|
20
|
-
hasRadius: !0,
|
|
21
|
-
"aria-label": s,
|
|
22
|
-
"aria-valuemax": t,
|
|
23
|
-
"aria-valuemin": r,
|
|
24
|
-
"aria-valuenow": e,
|
|
25
|
-
height: a === "S" ? 1 : 2,
|
|
26
|
-
position: "relative",
|
|
27
|
-
role: "progressbar",
|
|
28
|
-
value: e,
|
|
29
|
-
width: a === "S" ? "78px" : "102px",
|
|
30
|
-
...n
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
i.defaultProps = {
|
|
34
|
-
min: 0,
|
|
35
|
-
max: 100,
|
|
36
|
-
value: 0,
|
|
37
|
-
size: "M"
|
|
38
|
-
};
|
|
39
|
-
i.propTypes = {
|
|
40
|
-
children: o.node.isRequired,
|
|
41
|
-
max: o.number,
|
|
42
|
-
min: o.number,
|
|
43
|
-
size: o.oneOf(["S", "M"]),
|
|
44
|
-
value: o.number
|
|
45
|
-
};
|
|
14
|
+
`, m = ({ min: r = 0, max: e = 100, value: o = 0, children: t, size: a = "M", ...i }) => s(u, { background: "neutral600", hasRadius: !0, "aria-label": t, "aria-valuemax": e, "aria-valuemin": r, "aria-valuenow": o, height: a === "S" ? 1 : 2, position: "relative", role: "progressbar", value: o, width: a === "S" ? "78px" : "102px", ...i });
|
|
46
15
|
export {
|
|
47
|
-
|
|
16
|
+
m as ProgressBar
|
|
48
17
|
};
|
package/dist/Radio/Radio.cjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
`,s=({children:e,...a})=>t.jsxs(p,{as:"label",textColor:"neutral800",children:[t.jsx(n.BaseRadio,{...a}),t.jsx(d.Box,{paddingLeft:2,children:e})]});s.propTypes={children:r.default.node.isRequired,value:r.default.any.isRequired};exports.Radio=s;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../BaseRadio/BaseRadio.cjs"),s=require("../Flex/Flex.cjs"),a=require("../Typography/Typography.cjs"),i=({children:r,...t})=>e.jsxs(s.Flex,{alignItems:"center",as:"label",gap:2,children:[e.jsx(o.BaseRadio,{...t}),e.jsx(a.Typography,{textColor:"neutral800",children:r})]});exports.Radio=i;
|
package/dist/Radio/Radio.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import { Typography as s } from "../Typography/Typography.js";
|
|
7
|
-
import { Box as a } from "../Box/Box.js";
|
|
8
|
-
const l = p(s)`
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
`, d = ({ children: e, ...i }) => /* @__PURE__ */ t(l, { as: "label", textColor: "neutral800", children: [
|
|
12
|
-
/* @__PURE__ */ r(m, { ...i }),
|
|
13
|
-
/* @__PURE__ */ r(a, { paddingLeft: 2, children: e })
|
|
14
|
-
] });
|
|
15
|
-
d.propTypes = {
|
|
16
|
-
children: o.node.isRequired,
|
|
17
|
-
value: o.any.isRequired
|
|
18
|
-
};
|
|
2
|
+
import { BaseRadio as a } from "../BaseRadio/BaseRadio.js";
|
|
3
|
+
import { Flex as i } from "../Flex/Flex.js";
|
|
4
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
5
|
+
const x = ({ children: o, ...e }) => t(i, { alignItems: "center", as: "label", gap: 2, children: [r(a, { ...e }), r(m, { textColor: "neutral800", children: o })] });
|
|
19
6
|
export {
|
|
20
|
-
|
|
7
|
+
x as Radio
|
|
21
8
|
};
|
|
@@ -1 +1 @@
|
|
|
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"),o=e=>r.jsx("form",{...e,role:"search"});exports.SearchForm=o;
|
|
@@ -1,29 +1,28 @@
|
|
|
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"),i=require("react"),l=require("@strapi/icons"),m=require("styled-components"),F=require("../hooks/useComposeRefs.cjs"),R=require("../themes/utils.cjs"),t=require("../Field/FieldInput.cjs"),S=require("../Field/Field.cjs"),y=require("../VisuallyHidden/VisuallyHidden.cjs"),$=require("../Field/FieldLabel.cjs"),C=require("../Field/FieldAction.cjs"),I=e=>e&&e.__esModule?e:{default:e},s=I(m),w=s.default(l.Cross)`
|
|
2
2
|
font-size: 0.5rem;
|
|
3
|
-
|
|
3
|
+
path {
|
|
4
4
|
fill: ${({theme:e})=>e.colors.neutral400};
|
|
5
5
|
}
|
|
6
|
-
`,
|
|
6
|
+
`,c=s.default(l.Search)`
|
|
7
7
|
font-size: 0.8rem;
|
|
8
|
-
|
|
9
|
-
svg path {
|
|
8
|
+
path {
|
|
10
9
|
fill: ${({theme:e})=>e.colors.neutral800};
|
|
11
10
|
}
|
|
12
|
-
`,
|
|
11
|
+
`,_=s.default.div`
|
|
13
12
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
14
13
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
15
14
|
|
|
16
15
|
&:focus-within {
|
|
17
|
-
${
|
|
18
|
-
|
|
16
|
+
${c} {
|
|
17
|
+
path {
|
|
19
18
|
fill: ${({theme:e})=>e.colors.primary600};
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
${
|
|
23
|
+
${t.InputWrapper} {
|
|
25
24
|
border: 1px solid transparent;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
${
|
|
29
|
-
`,
|
|
27
|
+
${R.inputFocusStyle(t.InputWrapper)}
|
|
28
|
+
`,g=i.forwardRef(({name:e,size:a="M",children:u,value:n="",onClear:d,clearLabel:f,...p},h)=>{const o=i.useRef(null),b=n.length>0,q=j=>{d(j),o.current.focus()},x=F.composeRefs(h,o);return r.jsx(_,{children:r.jsxs(S.Field,{name:e,children:[r.jsx(y.VisuallyHidden,{children:r.jsx($.FieldLabel,{children:u})}),r.jsx(t.FieldInput,{ref:x,value:n,startAction:r.jsx(c,{"aria-hidden":!0}),size:a,endAction:b?r.jsx(C.FieldAction,{label:f,onClick:q,children:r.jsx(w,{})}):void 0,...p})]})})});exports.Searchbar=g;
|
|
@@ -1,76 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Flex as a } from "../Flex/Flex.js";
|
|
10
|
-
import { Field as w } from "../Field/Field.js";
|
|
1
|
+
import { jsx as o, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R, useRef as S } from "react";
|
|
3
|
+
import { Cross as w, Search as x } from "@strapi/icons";
|
|
4
|
+
import e from "styled-components";
|
|
5
|
+
import { composeRefs as C } from "../hooks/useComposeRefs.js";
|
|
6
|
+
import { inputFocusStyle as F } from "../themes/utils.js";
|
|
7
|
+
import { InputWrapper as n, FieldInput as y } from "../Field/FieldInput.js";
|
|
8
|
+
import { Field as I } from "../Field/Field.js";
|
|
11
9
|
import { VisuallyHidden as z } from "../VisuallyHidden/VisuallyHidden.js";
|
|
12
|
-
import { FieldLabel as
|
|
13
|
-
import { FieldAction as
|
|
14
|
-
const
|
|
10
|
+
import { FieldLabel as A } from "../Field/FieldLabel.js";
|
|
11
|
+
import { FieldAction as g } from "../Field/FieldAction.js";
|
|
12
|
+
const j = e(w)`
|
|
15
13
|
font-size: 0.5rem;
|
|
16
|
-
|
|
14
|
+
path {
|
|
17
15
|
fill: ${({ theme: r }) => r.colors.neutral400};
|
|
18
16
|
}
|
|
19
|
-
`,
|
|
17
|
+
`, l = e(x)`
|
|
20
18
|
font-size: 0.8rem;
|
|
21
|
-
|
|
22
|
-
svg path {
|
|
19
|
+
path {
|
|
23
20
|
fill: ${({ theme: r }) => r.colors.neutral800};
|
|
24
21
|
}
|
|
25
|
-
`,
|
|
22
|
+
`, W = e.div`
|
|
26
23
|
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
27
24
|
box-shadow: ${({ theme: r }) => r.shadows.filterShadow};
|
|
28
25
|
|
|
29
26
|
&:focus-within {
|
|
30
|
-
${
|
|
31
|
-
|
|
27
|
+
${l} {
|
|
28
|
+
path {
|
|
32
29
|
fill: ${({ theme: r }) => r.colors.primary600};
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
|
|
37
|
-
${
|
|
34
|
+
${n} {
|
|
38
35
|
border: 1px solid transparent;
|
|
39
36
|
}
|
|
40
37
|
|
|
41
|
-
${
|
|
42
|
-
`,
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
F,
|
|
48
|
-
{
|
|
49
|
-
ref: h || n,
|
|
50
|
-
value: s,
|
|
51
|
-
startAction: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(C, { "aria-hidden": !0 }) }),
|
|
52
|
-
size: c,
|
|
53
|
-
endAction: b ? /* @__PURE__ */ e(I, { label: f, onClick: (R) => {
|
|
54
|
-
m(R), n.current.focus();
|
|
55
|
-
}, children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(S, {}) }) }) : void 0,
|
|
56
|
-
...u
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
] }) });
|
|
38
|
+
${F(n)}
|
|
39
|
+
`, J = R(({ name: r, size: s = "M", children: a, value: t = "", onClear: c, clearLabel: d, ...m }, p) => {
|
|
40
|
+
const i = S(null), f = t.length > 0, h = (b) => {
|
|
41
|
+
c(b), i.current.focus();
|
|
42
|
+
}, u = C(p, i);
|
|
43
|
+
return o(W, { children: $(I, { name: r, children: [o(z, { children: o(A, { children: a }) }), o(y, { ref: u, value: t, startAction: o(l, { "aria-hidden": !0 }), size: s, endAction: f ? o(g, { label: d, onClick: h, children: o(j, {}) }) : void 0, ...m })] }) });
|
|
60
44
|
});
|
|
61
|
-
t.displayName = "Searchbar";
|
|
62
|
-
t.defaultProps = {
|
|
63
|
-
value: "",
|
|
64
|
-
size: "M"
|
|
65
|
-
};
|
|
66
|
-
t.propTypes = {
|
|
67
|
-
children: o.node.isRequired,
|
|
68
|
-
clearLabel: o.string.isRequired,
|
|
69
|
-
name: o.string.isRequired,
|
|
70
|
-
onClear: o.func.isRequired,
|
|
71
|
-
size: o.oneOf(Object.keys(v.input)),
|
|
72
|
-
value: o.string
|
|
73
|
-
};
|
|
74
45
|
export {
|
|
75
|
-
|
|
46
|
+
J as Searchbar
|
|
76
47
|
};
|
package/dist/Status/Status.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
margin-right: ${({theme:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("styled-components"),b=require("../Box/Box.cjs"),x=require("../Typography/Typography.cjs"),$=require("../Flex/Flex.cjs"),h=o=>o&&o.__esModule?o:{default:o},u=h(p),y=u.default.div`
|
|
2
|
+
margin-right: ${({theme:o})=>o.spaces[3]};
|
|
3
3
|
width: ${6/16}rem;
|
|
4
4
|
height: ${6/16}rem;
|
|
5
5
|
border-radius: 50%;
|
|
6
|
-
background: ${({theme:
|
|
7
|
-
`,
|
|
6
|
+
background: ${({theme:o,backgroundColor:t})=>o.colors[t]};
|
|
7
|
+
`,f=u.default(b.Box)`
|
|
8
8
|
${x.Typography} {
|
|
9
|
-
color: ${({theme:
|
|
9
|
+
color: ${({theme:o,textColor:t})=>o.colors[t]};
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,m=({variant:o="primary",showBullet:t=!0,size:e="M",children:s,...l})=>{const c=`${o}100`,a=`${o}200`,i=`${o}600`,g=`${o}600`,d=e==="S"?2:5,n=e==="S"?1:4;return r.jsx(f,{borderColor:a,textColor:g,background:c,hasRadius:!0,paddingTop:n,paddingBottom:n,paddingLeft:d,paddingRight:d,...l,children:t?r.jsxs($.Flex,{children:[r.jsx(y,{backgroundColor:i}),s]}):s})};exports.Status=m;
|
package/dist/Status/Status.js
CHANGED
|
@@ -1,60 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import t from "prop-types";
|
|
1
|
+
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
4
2
|
import p from "styled-components";
|
|
5
|
-
import { Box as
|
|
3
|
+
import { Box as u } from "../Box/Box.js";
|
|
6
4
|
import { Typography as $ } from "../Typography/Typography.js";
|
|
7
5
|
import { Flex as b } from "../Flex/Flex.js";
|
|
8
|
-
const
|
|
6
|
+
const h = p.div`
|
|
9
7
|
margin-right: ${({ theme: o }) => o.spaces[3]};
|
|
10
8
|
width: ${6 / 16}rem;
|
|
11
9
|
height: ${6 / 16}rem;
|
|
12
10
|
border-radius: 50%;
|
|
13
11
|
background: ${({ theme: o, backgroundColor: r }) => o.colors[r]};
|
|
14
|
-
`, x = p(
|
|
12
|
+
`, x = p(u)`
|
|
15
13
|
${$} {
|
|
16
14
|
color: ${({ theme: o, textColor: r }) => o.colors[r]};
|
|
17
15
|
}
|
|
18
|
-
`,
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
x,
|
|
22
|
-
{
|
|
23
|
-
borderColor: m,
|
|
24
|
-
textColor: g,
|
|
25
|
-
background: c,
|
|
26
|
-
hasRadius: !0,
|
|
27
|
-
paddingTop: d,
|
|
28
|
-
paddingBottom: d,
|
|
29
|
-
paddingLeft: n,
|
|
30
|
-
paddingRight: n,
|
|
31
|
-
...l,
|
|
32
|
-
children: r ? /* @__PURE__ */ h(b, { children: [
|
|
33
|
-
/* @__PURE__ */ i(y, { backgroundColor: u }),
|
|
34
|
-
s
|
|
35
|
-
] }) : s
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
a.defaultProps = {
|
|
40
|
-
showBullet: !0,
|
|
41
|
-
size: "M",
|
|
42
|
-
variant: "primary"
|
|
43
|
-
};
|
|
44
|
-
a.propTypes = {
|
|
45
|
-
children: t.node.isRequired,
|
|
46
|
-
/**
|
|
47
|
-
* If `false`, the preceeding bullet of the status won't be displayed.
|
|
48
|
-
* This prop and the bullet will be removed in the next major version.
|
|
49
|
-
*/
|
|
50
|
-
showBullet: t.bool,
|
|
51
|
-
// TODO V2: remove prop and bullet
|
|
52
|
-
size: t.oneOf(["S", "M"]),
|
|
53
|
-
/**
|
|
54
|
-
* Color variation
|
|
55
|
-
*/
|
|
56
|
-
variant: t.oneOf(["alternative", "danger", "neutral", "primary", "secondary", "success", "warning"])
|
|
16
|
+
`, B = ({ variant: o = "primary", showBullet: r = !0, size: t = "M", children: d, ...c }) => {
|
|
17
|
+
const i = `${o}100`, l = `${o}200`, g = `${o}600`, m = `${o}600`, s = t === "S" ? 2 : 5, e = t === "S" ? 1 : 4;
|
|
18
|
+
return n(x, { borderColor: l, textColor: m, background: i, hasRadius: !0, paddingTop: e, paddingBottom: e, paddingLeft: s, paddingRight: s, ...c, children: r ? a(b, { children: [n(h, { backgroundColor: g }), d] }) : d });
|
|
57
19
|
};
|
|
58
20
|
export {
|
|
59
|
-
|
|
21
|
+
B as Status
|
|
60
22
|
};
|
package/dist/Switch/Switch.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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"),h=require("react"),f=require("styled-components"),p=require("../Flex/Flex.cjs"),b=require("../Box/Box.cjs"),i=e=>e&&e.__esModule?e:{default:e},g=i(h),c=i(f),n=c.default.div`
|
|
2
2
|
background: ${({theme:e})=>e.colors.danger500};
|
|
3
3
|
border: none;
|
|
4
4
|
border-radius: 16px;
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
transition: none;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,x=c.default.button`
|
|
31
31
|
background: transparent;
|
|
32
32
|
padding: 0;
|
|
33
33
|
border: none;
|
|
34
34
|
|
|
35
|
-
&[aria-checked='true'] ${
|
|
35
|
+
&[aria-checked='true'] ${n} {
|
|
36
36
|
background: ${({theme:e})=>e.colors.success500};
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
&[aria-checked='true'] ${
|
|
39
|
+
&[aria-checked='true'] ${n}:before {
|
|
40
40
|
transform: translateX(1rem);
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,m=g.default.forwardRef(({label:e,onChange:d,onLabel:o="On",offLabel:s="Off",selected:t,visibleLabels:a=!1,...u},l)=>r.jsx(x,{ref:l,role:"switch","aria-checked":t,"aria-label":e,onClick:d,visibleLabels:a,type:"button",...u,children:r.jsxs(p.Flex,{children:[r.jsxs(n,{children:[r.jsx("span",{children:o}),r.jsx("span",{children:s})]}),a&&r.jsx(b.Box,{as:"span","aria-hidden":!0,paddingLeft:2,color:t?"success600":"danger600",children:t?o:s})]})}));exports.Switch=m;
|