@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,26 +1,12 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import e from "prop-types";
|
|
4
|
-
import a from "styled-components";
|
|
2
|
+
import * as n from "react";
|
|
5
3
|
import { PaginationContext as c } from "./PaginationContext.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
`, l = ({ children: i, label: s, activePage: n, pageCount: o }) => {
|
|
12
|
-
const p = t.useMemo(() => ({ activePage: n, pageCount: o }), [n, o]);
|
|
13
|
-
return /* @__PURE__ */ r(c.Provider, { value: p, children: /* @__PURE__ */ r(f, { "aria-label": s, children: /* @__PURE__ */ r(g, { as: "ul", children: t.Children.map(i, (m, d) => /* @__PURE__ */ r("li", { children: m }, d)) }) }) });
|
|
14
|
-
};
|
|
15
|
-
l.defaultProps = {
|
|
16
|
-
label: "pagination"
|
|
17
|
-
};
|
|
18
|
-
l.propTypes = {
|
|
19
|
-
activePage: e.number.isRequired,
|
|
20
|
-
children: e.node.isRequired,
|
|
21
|
-
label: e.string,
|
|
22
|
-
pageCount: e.number.isRequired
|
|
4
|
+
import { Box as p } from "../Box/Box.js";
|
|
5
|
+
import { Flex as s } from "../Flex/Flex.js";
|
|
6
|
+
const u = ({ children: t, label: a = "Pagination", activePage: o, pageCount: i }) => {
|
|
7
|
+
const e = n.useMemo(() => ({ activePage: o, pageCount: i }), [o, i]);
|
|
8
|
+
return r(c.Provider, { value: e, children: r(p, { "aria-label": a, as: "nav", children: r(s, { as: "ol", gap: 1, children: n.Children.map(t, (m, l) => r("li", { children: m }, l)) }) }) });
|
|
23
9
|
};
|
|
24
10
|
export {
|
|
25
|
-
|
|
11
|
+
u as Pagination
|
|
26
12
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
line-height: revert;
|
|
3
|
-
`,T={active:!0},c=n.default(j.NavLink).withConfig({shouldForwardProp:(e,i)=>!T[e]&&i(e)})`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("@strapi/icons"),v=require("react-router-dom"),y=require("styled-components"),d=require("./PaginationContext.cjs"),b=require("../themes/utils.cjs"),o=require("../VisuallyHidden/VisuallyHidden.cjs"),c=require("../Typography/Typography.cjs"),P=require("../Box/Box.cjs"),j=e=>e&&e.__esModule?e:{default:e},l=j(y),k={active:!0},h=l.default(v.NavLink).withConfig({shouldForwardProp:(e,i)=>!k[e]&&i(e)})`
|
|
4
2
|
padding: ${({theme:e})=>e.spaces[3]};
|
|
5
3
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
6
4
|
box-shadow: ${({active:e,theme:i})=>e?i.shadows.filterShadow:void 0};
|
|
7
5
|
text-decoration: none;
|
|
8
6
|
display: flex;
|
|
9
7
|
|
|
10
|
-
${
|
|
11
|
-
|
|
8
|
+
${b.buttonFocusStyle}
|
|
9
|
+
`,L=l.default(h)`
|
|
12
10
|
color: ${({theme:e,active:i})=>i?e.colors.primary700:e.colors.neutral800};
|
|
13
11
|
background: ${({theme:e,active:i})=>i?e.colors.neutral0:void 0};
|
|
14
12
|
|
|
15
13
|
&:hover {
|
|
16
14
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
17
15
|
}
|
|
18
|
-
`,
|
|
19
|
-
font-size:
|
|
16
|
+
`,g=l.default(h)`
|
|
17
|
+
font-size: ${11/16}rem;
|
|
18
|
+
|
|
20
19
|
svg path {
|
|
21
20
|
fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral600};
|
|
22
21
|
}
|
|
@@ -31,6 +30,4 @@
|
|
|
31
30
|
${e=>e["aria-disabled"]?`
|
|
32
31
|
pointer-events: none;
|
|
33
32
|
`:void 0}
|
|
34
|
-
`,
|
|
35
|
-
color: ${({theme:e})=>e.colors.neutral800};
|
|
36
|
-
`,p=({children:e,to:i,...o})=>{const{activePage:s}=u.usePagination(),t=s===1;return r.jsxs(x,{to:t?"#":i,"aria-disabled":t,tabIndex:t?-1:void 0,...o,children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(g.ChevronLeft,{"aria-hidden":!0})]})};p.displayName="PreviousLink";const h=({children:e,to:i,...o})=>{const{activePage:s,pageCount:t}=u.usePagination(),l=s===t;return r.jsxs(x,{to:l?"#":i,"aria-disabled":l,tabIndex:l?-1:void 0,...o,children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(g.ChevronRight,{"aria-hidden":!0})]})};h.displayName="NextLink";const v=({number:e,children:i,...o})=>{const{activePage:s}=u.usePagination(),t=s===e;return r.jsxs($,{...o,active:t,children:[r.jsx(d.VisuallyHidden,{children:i}),r.jsx(f,{"aria-hidden":!0,variant:"pi",fontWeight:t?"bold":null,children:e})]})};v.displayName="PageLink";const P=({children:e,...i})=>r.jsxs(R,{...i,as:"div",children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(f,{"aria-hidden":!0,variant:"pi",children:"…"})]});v.propTypes={children:a.default.node.isRequired,number:a.default.number.isRequired};const b={children:a.default.node.isRequired,to:a.default.string.isRequired};h.propTypes=b;p.propTypes=b;P.propTypes={children:a.default.node.isRequired};exports.Dots=P;exports.NextLink=h;exports.PageLink=v;exports.PreviousLink=p;
|
|
33
|
+
`,x=({children:e,to:i,...r})=>{const{activePage:a}=d.usePagination(),t=a===1;return n.jsxs(g,{to:t?"#":i,"aria-disabled":t,tabIndex:t?-1:void 0,...r,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(u.ChevronLeft,{"aria-hidden":!0})]})};x.displayName="PreviousLink";const f=({children:e,to:i,...r})=>{const{activePage:a,pageCount:t}=d.usePagination(),s=a===t;return n.jsxs(g,{to:s?"#":i,"aria-disabled":s,tabIndex:s?-1:void 0,...r,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(u.ChevronRight,{"aria-hidden":!0})]})};f.displayName="NextLink";const p=({number:e,children:i,...r})=>{const{activePage:a}=d.usePagination(),t=a===e;return n.jsxs(L,{...r,active:t,children:[n.jsx(o.VisuallyHidden,{children:i}),n.jsx(c.Typography,{"aria-hidden":!0,fontWeight:t?"bold":void 0,lineHeight:"revert",variant:"pi",children:e})]})};p.displayName="PageLink";const $=({children:e,...i})=>n.jsxs(P.Box,{...i,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(c.Typography,{"aria-hidden":!0,lineHeight:"revert",textColor:"neutral800",variant:"pi",children:"…"})]});exports.Dots=$;exports.NextLink=f;exports.PageLink=p;exports.PreviousLink=x;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const u = s(L)`
|
|
12
|
-
line-height: revert;
|
|
13
|
-
`, $ = {
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft as f, ChevronRight as m } from "@strapi/icons";
|
|
3
|
+
import { NavLink as v } from "react-router-dom";
|
|
4
|
+
import l from "styled-components";
|
|
5
|
+
import { usePagination as c } from "./PaginationContext.js";
|
|
6
|
+
import { buttonFocusStyle as g } from "../themes/utils.js";
|
|
7
|
+
import { VisuallyHidden as d } from "../VisuallyHidden/VisuallyHidden.js";
|
|
8
|
+
import { Typography as h } from "../Typography/Typography.js";
|
|
9
|
+
import { Box as b } from "../Box/Box.js";
|
|
10
|
+
const x = {
|
|
14
11
|
active: !0
|
|
15
|
-
},
|
|
16
|
-
shouldForwardProp: (e, r) =>
|
|
12
|
+
}, u = l(v).withConfig({
|
|
13
|
+
shouldForwardProp: (e, r) => !x[e] && r(e)
|
|
17
14
|
})`
|
|
18
15
|
padding: ${({ theme: e }) => e.spaces[3]};
|
|
19
16
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
@@ -21,16 +18,17 @@ const u = s(L)`
|
|
|
21
18
|
text-decoration: none;
|
|
22
19
|
display: flex;
|
|
23
20
|
|
|
24
|
-
${
|
|
25
|
-
`,
|
|
21
|
+
${g}
|
|
22
|
+
`, k = l(u)`
|
|
26
23
|
color: ${({ theme: e, active: r }) => r ? e.colors.primary700 : e.colors.neutral800};
|
|
27
24
|
background: ${({ theme: e, active: r }) => r ? e.colors.neutral0 : void 0};
|
|
28
25
|
|
|
29
26
|
&:hover {
|
|
30
27
|
box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
|
|
31
28
|
}
|
|
32
|
-
`,
|
|
33
|
-
font-size:
|
|
29
|
+
`, p = l(u)`
|
|
30
|
+
font-size: ${11 / 16}rem;
|
|
31
|
+
|
|
34
32
|
svg path {
|
|
35
33
|
fill: ${(e) => e["aria-disabled"] ? e.theme.colors.neutral300 : e.theme.colors.neutral600};
|
|
36
34
|
}
|
|
@@ -45,70 +43,25 @@ const u = s(L)`
|
|
|
45
43
|
${(e) => e["aria-disabled"] ? `
|
|
46
44
|
pointer-events: none;
|
|
47
45
|
` : void 0}
|
|
48
|
-
`,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const { activePage: a } = p(), o = a === 1;
|
|
52
|
-
return /* @__PURE__ */ d(
|
|
53
|
-
m,
|
|
54
|
-
{
|
|
55
|
-
to: o ? "#" : r,
|
|
56
|
-
"aria-disabled": o,
|
|
57
|
-
tabIndex: o ? -1 : void 0,
|
|
58
|
-
...t,
|
|
59
|
-
children: [
|
|
60
|
-
/* @__PURE__ */ i(l, { children: e }),
|
|
61
|
-
/* @__PURE__ */ i(y, { "aria-hidden": !0 })
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
v.displayName = "PreviousLink";
|
|
67
|
-
const f = ({ children: e, to: r, ...t }) => {
|
|
68
|
-
const { activePage: a, pageCount: o } = p(), c = a === o;
|
|
69
|
-
return /* @__PURE__ */ d(
|
|
70
|
-
m,
|
|
71
|
-
{
|
|
72
|
-
to: c ? "#" : r,
|
|
73
|
-
"aria-disabled": c,
|
|
74
|
-
tabIndex: c ? -1 : void 0,
|
|
75
|
-
...t,
|
|
76
|
-
children: [
|
|
77
|
-
/* @__PURE__ */ i(l, { children: e }),
|
|
78
|
-
/* @__PURE__ */ i(P, { "aria-hidden": !0 })
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
f.displayName = "NextLink";
|
|
84
|
-
const g = ({ number: e, children: r, ...t }) => {
|
|
85
|
-
const { activePage: a } = p(), o = a === e;
|
|
86
|
-
return /* @__PURE__ */ d(w, { ...t, active: o, children: [
|
|
87
|
-
/* @__PURE__ */ i(l, { children: r }),
|
|
88
|
-
/* @__PURE__ */ i(u, { "aria-hidden": !0, variant: "pi", fontWeight: o ? "bold" : null, children: e })
|
|
89
|
-
] });
|
|
90
|
-
};
|
|
91
|
-
g.displayName = "PageLink";
|
|
92
|
-
const R = ({ children: e, ...r }) => /* @__PURE__ */ d(T, { ...r, as: "div", children: [
|
|
93
|
-
/* @__PURE__ */ i(l, { children: e }),
|
|
94
|
-
/* @__PURE__ */ i(u, { "aria-hidden": !0, variant: "pi", children: "…" })
|
|
95
|
-
] });
|
|
96
|
-
g.propTypes = {
|
|
97
|
-
children: n.node.isRequired,
|
|
98
|
-
number: n.number.isRequired
|
|
46
|
+
`, L = ({ children: e, to: r, ...n }) => {
|
|
47
|
+
const { activePage: t } = c(), i = t === 1;
|
|
48
|
+
return a(p, { to: i ? "#" : r, "aria-disabled": i, tabIndex: i ? -1 : void 0, ...n, children: [o(d, { children: e }), o(f, { "aria-hidden": !0 })] });
|
|
99
49
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
50
|
+
L.displayName = "PreviousLink";
|
|
51
|
+
const P = ({ children: e, to: r, ...n }) => {
|
|
52
|
+
const { activePage: t, pageCount: i } = c(), s = t === i;
|
|
53
|
+
return a(p, { to: s ? "#" : r, "aria-disabled": s, tabIndex: s ? -1 : void 0, ...n, children: [o(d, { children: e }), o(m, { "aria-hidden": !0 })] });
|
|
103
54
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
children:
|
|
55
|
+
P.displayName = "NextLink";
|
|
56
|
+
const $ = ({ number: e, children: r, ...n }) => {
|
|
57
|
+
const { activePage: t } = c(), i = t === e;
|
|
58
|
+
return a(k, { ...n, active: i, children: [o(d, { children: r }), o(h, { "aria-hidden": !0, fontWeight: i ? "bold" : void 0, lineHeight: "revert", variant: "pi", children: e })] });
|
|
108
59
|
};
|
|
60
|
+
$.displayName = "PageLink";
|
|
61
|
+
const F = ({ children: e, ...r }) => a(b, { ...r, children: [o(d, { children: e }), o(h, { "aria-hidden": !0, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })] });
|
|
109
62
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
63
|
+
F as Dots,
|
|
64
|
+
P as NextLink,
|
|
65
|
+
$ as PageLink,
|
|
66
|
+
L as PreviousLink
|
|
114
67
|
};
|
package/dist/Popover/Popover.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),F=require("react"),u=require("@floating-ui/react-dom"),M=require("@radix-ui/react-focus-scope"),m=require("@strapi/ui-primitives"),z=require("aria-hidden"),T=require("react-remove-scroll"),W=require("styled-components"),A=require("../DismissibleLayer/index.cjs"),P=require("../helpers/strings.cjs"),B=require("../hooks/useComposeRefs.cjs"),H=require("../hooks/useId.cjs"),K=require("../hooks/useIntersection.cjs"),g=require("../Box/Box.cjs"),N=require("../Portal/Portal.cjs"),U=e=>e&&e.__esModule?e:{default:e};function V(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 i=V(F),E=U(W),Z=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],G=E.default(g.Box)`
|
|
2
2
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
3
3
|
z-index: ${({theme:e})=>e.zIndices[0]};
|
|
4
4
|
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
5
5
|
background: ${({theme:e})=>e.colors.neutral0};
|
|
6
|
-
`,
|
|
6
|
+
`,R=({source:e,children:r,spacing:t=0,fullWidth:n=!1,placement:c="bottom-start",centered:l=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,onFocusOutside:p,...O})=>{const[h,k]=i.useState(null),v=i.useRef(!1),[S,j]=i.useState(void 0),{x:q,y:C,reference:w,floating:D,strategy:_}=u.useFloating({strategy:"fixed",placement:l?"bottom":c,middleware:[u.offset({mainAxis:t}),u.shift(),u.flip()],whileElementsMounted:u.autoUpdate});i.useLayoutEffect(()=>{w(e.current)},[e,w]),i.useLayoutEffect(()=>{n&&j(e.current.offsetWidth)},[n,e]),i.useEffect(()=>{if(h)return z.hideOthers(h)},[h]);const x=m.useCallbackRef(a);i.useEffect(()=>{const o=()=>{x()};return window.addEventListener("blur",o),window.addEventListener("resize",o),()=>{window.removeEventListener("blur",o),window.removeEventListener("resize",o)}},[x]);const L=B.useComposedRefs(o=>k(o),D);return s.jsx(T.RemoveScroll,{allowPinchZoom:!0,children:s.jsx(M.FocusScope,{asChild:!0,loop:!0,trapped:!0,onUnmountAutoFocus:o=>{o.preventDefault(),v.current||e.current?.focus({preventScroll:!0})},children:s.jsx(A.DismissibleLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m.composeEventHandlers(f,o=>{const b=o.detail.originalEvent,$=b.button===0&&b.ctrlKey===!0,I=b.button===2||$;v.current=I},{checkForDefaultPrevented:!1}),onFocusOutside:m.composeEventHandlers(p,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:a,children:s.jsx(G,{ref:L,style:{left:q,top:C,position:_,width:S||void 0},hasRadius:!0,background:"neutral0",padding:1,...O,children:r})})})})},y=({children:e,intersectionId:r,onReachEnd:t,...n})=>{const c=i.useRef(null),l=H.useId();return K.useIntersection(c,t??(()=>{}),{selectorToWatch:`#${P.stripReactIdOfColon(l)}`,skipWhen:!r||!t}),s.jsxs(J,{ref:c,...n,children:[e,r&&t&&s.jsx(g.Box,{id:P.stripReactIdOfColon(l),width:"100%",height:"1px"})]})},J=E.default(g.Box)`
|
|
7
7
|
// 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
|
|
8
8
|
max-height: ${3*5}rem;
|
|
9
9
|
overflow-y: auto;
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
24
24
|
margin-right: 10px;
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,Q=({children:e,source:r,spacing:t,fullWidth:n,placement:c,centered:l,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,...p})=>s.jsx(N.Portal,{children:s.jsx(R,{source:r,spacing:t,fullWidth:n,placement:c,centered:l,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,children:s.jsx(y,{...p,children:e})})});exports.Content=R;exports.POPOVER_PLACEMENTS=Z;exports.Popover=Q;exports.Scrolling=y;
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import { FocusScope as
|
|
5
|
-
import { useCallbackRef as
|
|
6
|
-
import { hideOthers as
|
|
7
|
-
import { RemoveScroll as
|
|
8
|
-
import
|
|
9
|
-
import { DismissibleLayer as
|
|
10
|
-
import { stripReactIdOfColon as
|
|
11
|
-
import { useComposedRefs as
|
|
12
|
-
import { useId as
|
|
13
|
-
import { useIntersection as
|
|
14
|
-
import { Box as
|
|
15
|
-
import { Portal as
|
|
16
|
-
const
|
|
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 = [
|
|
17
17
|
"top",
|
|
18
18
|
"top-start",
|
|
19
19
|
"top-end",
|
|
@@ -26,80 +26,81 @@ const ie = [
|
|
|
26
26
|
"left",
|
|
27
27
|
"left-start",
|
|
28
28
|
"left-end"
|
|
29
|
-
],
|
|
29
|
+
], q = x(h)`
|
|
30
30
|
box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
|
|
31
31
|
z-index: ${({ theme: e }) => e.zIndices[0]};
|
|
32
32
|
border: 1px solid ${({ theme: e }) => e.colors.neutral150};
|
|
33
33
|
background: ${({ theme: e }) => e.colors.neutral0};
|
|
34
|
-
`,
|
|
35
|
-
const [m,
|
|
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({
|
|
36
36
|
strategy: "fixed",
|
|
37
37
|
placement: a ? "bottom" : l,
|
|
38
38
|
middleware: [
|
|
39
|
-
|
|
40
|
-
mainAxis:
|
|
39
|
+
W({
|
|
40
|
+
mainAxis: n
|
|
41
41
|
}),
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
A(),
|
|
43
|
+
K()
|
|
44
44
|
],
|
|
45
|
-
whileElementsMounted:
|
|
45
|
+
whileElementsMounted: j
|
|
46
46
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [e,
|
|
50
|
-
i &&
|
|
51
|
-
}, [i, e]),
|
|
47
|
+
o.useLayoutEffect(() => {
|
|
48
|
+
w(e.current);
|
|
49
|
+
}, [e, w]), o.useLayoutEffect(() => {
|
|
50
|
+
i && y(e.current.offsetWidth);
|
|
51
|
+
}, [i, e]), o.useEffect(() => {
|
|
52
52
|
if (m)
|
|
53
|
-
return
|
|
53
|
+
return U(m);
|
|
54
54
|
}, [m]);
|
|
55
|
-
const
|
|
56
|
-
|
|
55
|
+
const g = T(c);
|
|
56
|
+
o.useEffect(() => {
|
|
57
57
|
const t = () => {
|
|
58
|
-
|
|
58
|
+
g();
|
|
59
59
|
};
|
|
60
60
|
return window.addEventListener("blur", t), window.addEventListener("resize", t), () => {
|
|
61
61
|
window.removeEventListener("blur", t), window.removeEventListener("resize", t);
|
|
62
62
|
};
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
return
|
|
63
|
+
}, [g]);
|
|
64
|
+
const S = N((t) => P(t), L);
|
|
65
|
+
return r(B, { allowPinchZoom: !0, children: r(M, {
|
|
66
66
|
asChild: !0,
|
|
67
|
+
loop: !0,
|
|
67
68
|
// we make sure we're not trapping once it's been closed
|
|
68
69
|
// (closed !== unmounted when animating out)
|
|
69
70
|
trapped: !0,
|
|
70
|
-
onMountAutoFocus: (t) => {
|
|
71
|
-
t.preventDefault();
|
|
72
|
-
},
|
|
73
71
|
onUnmountAutoFocus: (t) => {
|
|
74
|
-
e.current?.focus({ preventScroll: !0 })
|
|
72
|
+
t.preventDefault(), b.current || e.current?.focus({ preventScroll: !0 });
|
|
75
73
|
},
|
|
76
|
-
children:
|
|
74
|
+
children: r(H, {
|
|
77
75
|
asChild: !0,
|
|
78
76
|
disableOutsidePointerEvents: !0,
|
|
79
|
-
onEscapeKeyDown:
|
|
80
|
-
onPointerDownOutside: u,
|
|
81
|
-
|
|
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.
|
|
82
83
|
// We make sure we don't trigger our `onDismiss` in such case.
|
|
83
|
-
onFocusOutside: (t) => {
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
onDismiss:
|
|
87
|
-
children:
|
|
88
|
-
left:
|
|
89
|
-
top:
|
|
90
|
-
position:
|
|
91
|
-
width:
|
|
92
|
-
}, hasRadius: !0, background: "neutral0", padding: 1, ...
|
|
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 })
|
|
93
94
|
})
|
|
94
95
|
}) });
|
|
95
|
-
},
|
|
96
|
-
const l =
|
|
97
|
-
return
|
|
96
|
+
}, J = ({ children: e, intersectionId: s, onReachEnd: n, ...i }) => {
|
|
97
|
+
const l = o.useRef(null), a = V();
|
|
98
|
+
return Z(l, n ?? (() => {
|
|
98
99
|
}), {
|
|
99
|
-
selectorToWatch: `#${
|
|
100
|
-
skipWhen: !s || !
|
|
101
|
-
}),
|
|
102
|
-
},
|
|
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)`
|
|
103
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
|
|
104
105
|
max-height: ${3 * 5}rem;
|
|
105
106
|
overflow-y: auto;
|
|
@@ -119,10 +120,10 @@ const ie = [
|
|
|
119
120
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
120
121
|
margin-right: 10px;
|
|
121
122
|
}
|
|
122
|
-
`,
|
|
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 }) }) });
|
|
123
124
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
G as Content,
|
|
126
|
+
fe as POPOVER_PLACEMENTS,
|
|
127
|
+
me as Popover,
|
|
128
|
+
J as Scrolling
|
|
128
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;
|