@strapi/design-system 1.7.10 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -17
- package/dist/Button/Button.cjs +2 -2
- package/dist/Button/Button.js +4 -4
- package/dist/Combobox/Combobox.cjs +14 -13
- package/dist/Combobox/Combobox.js +73 -68
- package/dist/DatePicker/DatePicker.cjs +82 -6
- package/dist/DatePicker/DatePicker.js +414 -55
- package/dist/DateTimePicker/DateTimePicker.cjs +7 -1
- package/dist/DateTimePicker/DateTimePicker.js +97 -53
- package/dist/DateTimePicker/index.cjs +1 -1
- package/dist/DateTimePicker/index.js +3 -2
- package/dist/DesignSystemProvider.cjs +1 -0
- package/dist/DesignSystemProvider.js +10 -0
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +6 -3
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +9 -31
- package/dist/MainNav/MainNavContext.cjs +1 -1
- package/dist/MainNav/MainNavContext.js +1 -1
- package/dist/MainNav/NavBrand.cjs +3 -3
- package/dist/MainNav/NavBrand.js +12 -38
- package/dist/MainNav/NavCondense.cjs +2 -2
- package/dist/MainNav/NavCondense.js +15 -23
- package/dist/MainNav/NavFooter.cjs +1 -1
- package/dist/MainNav/NavFooter.js +4 -10
- package/dist/MainNav/NavLink.cjs +9 -9
- package/dist/MainNav/NavLink.js +13 -35
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +9 -43
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +7 -21
- package/dist/MainNav/NavUser.cjs +2 -2
- package/dist/MainNav/NavUser.js +13 -27
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +40 -40
- package/dist/Popover/Popover.cjs +3 -4
- package/dist/Popover/Popover.js +46 -48
- package/dist/Popover/index.cjs +1 -1
- package/dist/Popover/index.js +5 -9
- package/dist/Popover/primitives.cjs +1 -0
- package/dist/Popover/primitives.js +5 -0
- package/dist/Searchbar/Searchbar.cjs +2 -2
- package/dist/Searchbar/Searchbar.js +5 -5
- package/dist/Select/SelectParts.cjs +1 -1
- package/dist/Select/SelectParts.js +1 -1
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +36 -32
- package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/SimpleMenu/SimpleMenu.js +62 -151
- package/dist/SubNav/SubNav.cjs +5 -5
- package/dist/SubNav/SubNav.js +8 -13
- package/dist/SubNav/SubNavHeader.cjs +3 -3
- package/dist/SubNav/SubNavHeader.js +29 -76
- package/dist/SubNav/SubNavLink.cjs +13 -13
- package/dist/SubNav/SubNavLink.js +20 -52
- package/dist/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/SubNav/SubNavLinkSection.js +19 -35
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +15 -55
- package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/SubNav/SubNavSectionLabel.js +10 -38
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +4 -18
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +5 -5
- package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/ThemeProvider/ThemeProvider.js +4 -3
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +79 -33
- package/dist/TimePicker/index.cjs +1 -1
- package/dist/TimePicker/index.js +3 -2
- package/dist/helpers/context.cjs +1 -0
- package/dist/helpers/context.js +21 -0
- package/dist/helpers/getDefaultLocale.cjs +4 -1
- package/dist/helpers/getDefaultLocale.js +7 -2
- package/dist/hooks/useDateFormatter.cjs +1 -0
- package/dist/hooks/useDateFormatter.js +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +309 -304
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +6 -25
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
- package/dist/v2/Breadcrumbs/Divider.js +3 -4
- package/dist/v2/SimpleMenu/Menu.cjs +10 -10
- package/dist/v2/SimpleMenu/Menu.js +11 -11
- package/package.json +11 -10
- package/dist/DatePicker/DatePickerCalendar.cjs +0 -1
- package/dist/DatePicker/DatePickerCalendar.js +0 -43
- package/dist/DatePicker/DatePickerTd.cjs +0 -19
- package/dist/DatePicker/DatePickerTd.js +0 -29
- package/dist/DatePicker/DatePickerTh.cjs +0 -9
- package/dist/DatePicker/DatePickerTh.js +0 -18
- package/dist/DatePicker/compareDates.cjs +0 -1
- package/dist/DatePicker/compareDates.js +0 -4
- package/dist/DatePicker/components.cjs +0 -39
- package/dist/DatePicker/components.js +0 -53
- package/dist/DatePicker/utils/formatDate.cjs +0 -1
- package/dist/DatePicker/utils/formatDate.js +0 -4
- package/dist/DatePicker/utils/generateWeeks.cjs +0 -1
- package/dist/DatePicker/utils/generateWeeks.js +0 -17
- package/dist/DatePicker/utils/getDayOfWeek.cjs +0 -1
- package/dist/DatePicker/utils/getDayOfWeek.js +0 -15
- package/dist/DatePicker/utils/getMonths.cjs +0 -1
- package/dist/DatePicker/utils/getMonths.js +0 -7
- package/dist/DatePicker/utils/getYears.cjs +0 -1
- package/dist/DatePicker/utils/getYears.js +0 -9
- package/dist/DatePicker/utils/index.cjs +0 -1
- package/dist/DatePicker/utils/index.js +0 -12
- package/dist/DateTimePicker/parseDate.cjs +0 -1
- package/dist/DateTimePicker/parseDate.js +0 -8
|
@@ -1,46 +1,12 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import p from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const x = ({ label: o, children: a, spacing: s = 2, horizontal: e = !1, ...c }) => u() ? /* @__PURE__ */ d(i, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
11
|
-
/* @__PURE__ */ d(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: !0, as: "span", children: [
|
|
12
|
-
/* @__PURE__ */ r(g, {}),
|
|
13
|
-
/* @__PURE__ */ r(h, { children: /* @__PURE__ */ r("span", { children: o }) })
|
|
14
|
-
] }),
|
|
15
|
-
/* @__PURE__ */ r(
|
|
16
|
-
i,
|
|
17
|
-
{
|
|
18
|
-
as: "ul",
|
|
19
|
-
gap: s,
|
|
20
|
-
direction: e ? "row" : "column",
|
|
21
|
-
alignItems: e ? "center" : "stretch",
|
|
22
|
-
...c,
|
|
23
|
-
children: m.map(a, (n, t) => /* @__PURE__ */ r("li", { children: n }, t))
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
] }) : /* @__PURE__ */ d(i, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
27
|
-
/* @__PURE__ */ r(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: !0, as: "span", children: /* @__PURE__ */ r(f, { variant: "sigma", textColor: "neutral600", children: o }) }),
|
|
28
|
-
/* @__PURE__ */ r(
|
|
29
|
-
i,
|
|
30
|
-
{
|
|
31
|
-
as: "ul",
|
|
32
|
-
gap: s,
|
|
33
|
-
direction: e ? "row" : "column",
|
|
34
|
-
alignItems: e ? "center" : "stretch",
|
|
35
|
-
...c,
|
|
36
|
-
children: m.map(a, (n, t) => /* @__PURE__ */ r("li", { children: n }, t))
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
] });
|
|
40
|
-
x.propTypes = {
|
|
41
|
-
children: p.node.isRequired,
|
|
42
|
-
label: p.string.isRequired
|
|
43
|
-
};
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { useMainNav as p } from "./MainNavContext.js";
|
|
4
|
+
import { Divider as u } from "../Divider/Divider.js";
|
|
5
|
+
import { Flex as n } from "../Flex/Flex.js";
|
|
6
|
+
import { Box as s } from "../Box/Box.js";
|
|
7
|
+
import { VisuallyHidden as g } from "../VisuallyHidden/VisuallyHidden.js";
|
|
8
|
+
import { Typography as h } from "../Typography/Typography.js";
|
|
9
|
+
const j = ({ label: a, children: o, spacing: c = 2, horizontal: e = !1, ...m }) => p() ? d(n, { direction: "column", alignItems: "stretch", gap: 2, children: [d(s, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: !0, as: "span", children: [r(u, {}), r(g, { children: r("span", { children: a }) })] }), r(n, { as: "ul", gap: c, direction: e ? "row" : "column", alignItems: e ? "center" : "stretch", ...m, children: l.Children.map(o, (i, t) => r("li", { children: i }, t)) })] }) : d(n, { direction: "column", alignItems: "stretch", gap: 2, children: [r(s, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: !0, as: "span", children: r(h, { variant: "sigma", textColor: "neutral600", children: a }) }), r(n, { as: "ul", gap: c, direction: e ? "row" : "column", alignItems: e ? "center" : "stretch", ...m, children: l.Children.map(o, (i, t) => r("li", { children: i }, t)) })] });
|
|
44
10
|
export {
|
|
45
|
-
|
|
11
|
+
j as NavSection
|
|
46
12
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),d=require("styled-components"),a=require("../Box/Box.cjs"),u=require("../Flex/Flex.cjs"),n=e=>e&&e.__esModule?e:{default:e},f=n(c),g=n(d),x=g.default(a.Box)`
|
|
2
2
|
flex-grow: 1;
|
|
3
3
|
overflow-y: auto;
|
|
4
|
-
`,
|
|
4
|
+
`,p=({children:e,spacing:r=4,horizontal:o=!1,...s})=>t.jsx(x,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8,children:t.jsx(u.Flex,{as:"ul",gap:r,direction:o?"row":"column",alignItems:o?"center":"stretch",...s,children:f.default.Children.map(e,(i,l)=>t.jsx("li",{children:i},l))})});exports.NavSections=p;
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import m from "prop-types";
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
4
3
|
import l from "styled-components";
|
|
5
|
-
import { Box as
|
|
6
|
-
import { Flex as
|
|
7
|
-
const
|
|
4
|
+
import { Box as p } from "../Box/Box.js";
|
|
5
|
+
import { Flex as a } from "../Flex/Flex.js";
|
|
6
|
+
const c = l(p)`
|
|
8
7
|
flex-grow: 1;
|
|
9
8
|
overflow-y: auto;
|
|
10
|
-
`,
|
|
11
|
-
c,
|
|
12
|
-
{
|
|
13
|
-
as: "ul",
|
|
14
|
-
gap: i,
|
|
15
|
-
direction: o ? "row" : "column",
|
|
16
|
-
alignItems: o ? "center" : "stretch",
|
|
17
|
-
...t,
|
|
18
|
-
children: d.map(e, (p, n) => /* @__PURE__ */ r("li", { children: p }, n))
|
|
19
|
-
}
|
|
20
|
-
) });
|
|
21
|
-
f.propTypes = {
|
|
22
|
-
children: m.node.isRequired
|
|
23
|
-
};
|
|
9
|
+
`, h = ({ children: t, spacing: e = 4, horizontal: r = !1, ...i }) => o(c, { paddingLeft: 3, paddingRight: 2, paddingTop: 3, paddingBottom: 8, children: o(a, { as: "ul", gap: e, direction: r ? "row" : "column", alignItems: r ? "center" : "stretch", ...i, children: m.Children.map(t, (n, d) => o("li", { children: n }, d)) }) });
|
|
24
10
|
export {
|
|
25
|
-
|
|
11
|
+
h as NavSections
|
|
26
12
|
};
|
package/dist/MainNav/NavUser.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),c=require("styled-components"),x=require("./MainNavContext.cjs"),s=require("../Avatar/Avatar.cjs"),i=require("../Box/Box.cjs"),p=require("../Flex/Flex.cjs"),f=require("../VisuallyHidden/VisuallyHidden.cjs"),h=require("../Typography/Typography.cjs"),o=e=>e&&e.__esModule?e:{default:e},j=o(u),y=o(c),g=y.default(i.Box)`
|
|
2
2
|
border-top: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
3
|
-
`,
|
|
3
|
+
`,q=j.default.forwardRef(({src:e,children:r,initials:a,...d},l)=>{const n=x.useMainNav();return t.jsx(g,{paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5,...d,children:t.jsxs(p.Flex,{as:"button",justifyContent:n?"center":void 0,ref:l,children:[e?t.jsx(s.Avatar,{src:e,alt:"","aria-hidden":!0}):t.jsx(s.Initials,{children:a}),n?t.jsx(f.VisuallyHidden,{children:t.jsx("span",{children:r})}):t.jsx(i.Box,{width:`${130/16}rem`,paddingLeft:2,as:"span",children:t.jsx(h.Typography,{ellipsis:!0,textColor:"neutral600",children:r})})]})})});exports.NavUser=q;
|
package/dist/MainNav/NavUser.js
CHANGED
|
@@ -1,32 +1,18 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { VisuallyHidden as v } from "../VisuallyHidden/VisuallyHidden.js";
|
|
1
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import l from "styled-components";
|
|
4
|
+
import { useMainNav as m } from "./MainNavContext.js";
|
|
5
|
+
import { Avatar as f, Initials as c } from "../Avatar/Avatar.js";
|
|
6
|
+
import { Box as i } from "../Box/Box.js";
|
|
7
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
8
|
+
import { VisuallyHidden as h } from "../VisuallyHidden/VisuallyHidden.js";
|
|
10
9
|
import { Typography as x } from "../Typography/Typography.js";
|
|
11
|
-
const
|
|
10
|
+
const g = l(i)`
|
|
12
11
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral150};
|
|
13
|
-
`,
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
o ? /* @__PURE__ */ r(u, { src: o, alt: "", "aria-hidden": !0 }) : /* @__PURE__ */ r(h, { children: a }),
|
|
17
|
-
d ? /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r("span", { children: e }) }) : /* @__PURE__ */ r(n, { width: `${130 / 16}rem`, paddingLeft: 2, as: "span", children: /* @__PURE__ */ r(x, { ellipsis: !0, textColor: "neutral600", children: e }) })
|
|
18
|
-
] }) });
|
|
12
|
+
`, L = s.forwardRef(({ src: o, children: t, initials: n, ...d }, a) => {
|
|
13
|
+
const e = m();
|
|
14
|
+
return r(g, { paddingTop: 3, paddingBottom: 3, paddingLeft: 5, paddingRight: 5, ...d, children: p(u, { as: "button", justifyContent: e ? "center" : void 0, ref: a, children: [o ? r(f, { src: o, alt: "", "aria-hidden": !0 }) : r(c, { children: n }), e ? r(h, { children: r("span", { children: t }) }) : r(i, { width: `${130 / 16}rem`, paddingLeft: 2, as: "span", children: r(x, { ellipsis: !0, textColor: "neutral600", children: t }) })] }) });
|
|
19
15
|
});
|
|
20
|
-
t.displayName = "NavUser";
|
|
21
|
-
t.defaultProps = {
|
|
22
|
-
src: void 0,
|
|
23
|
-
initials: void 0
|
|
24
|
-
};
|
|
25
|
-
t.propTypes = {
|
|
26
|
-
children: i.node.isRequired,
|
|
27
|
-
initials: i.node,
|
|
28
|
-
src: i.string
|
|
29
|
-
};
|
|
30
16
|
export {
|
|
31
|
-
|
|
17
|
+
L as NavUser
|
|
32
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),x=require("@internationalized/number"),g=require("@strapi/icons"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),x=require("@internationalized/number"),g=require("@strapi/icons"),M=require("styled-components"),B=require("../DesignSystemProvider.cjs"),h=require("../helpers/keyboardKeys.cjs"),E=require("../hooks/useControllableState.cjs"),U=require("../hooks/useId.cjs"),H=require("../Field/FieldInput.cjs"),O=require("../Field/Field.cjs"),T=require("../Flex/Flex.cjs"),z=require("../Field/FieldLabel.cjs"),y=require("../Icon/Icon.cjs"),W=require("../Field/FieldHint.cjs"),X=require("../Field/FieldError.cjs"),I=r=>r&&r.__esModule?r:{default:r},Y=I(l),G=I(M),N=G.default.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 1rem;
|
|
4
4
|
align-items: ${({reverse:r})=>r?"flex-end":"flex-start"};
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
height: ${4/16}rem;
|
|
10
10
|
transform: ${({reverse:r})=>r?"rotateX(180deg)":void 0};
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
12
|
+
`,J="",Q=Y.default.forwardRef(({size:r="M",startAction:q,name:F,hint:w,error:j,label:d,labelAction:D,locale:C,id:V,onValueChange:S,value:m,step:o=1,required:A=!1,disabled:u=!1,...R},_)=>{const k=U.useId(V),K=B.useDesignSystem("NumberInput"),f=C||K.locale,i=l.useRef(new x.NumberParser(f,{style:"decimal"})),c=l.useRef(new x.NumberFormatter(f,{maximumFractionDigits:20})),[s,P]=E.useControllableState({prop(e){const n=String(m);return isNaN(Number(n))||n!==e&&e!==""?e:c.current.format(Number(m))},defaultProp:J,onChange(e){const n=i.current.parse(e??"");S(isNaN(n)?void 0:n)}}),a=e=>{P(String(e))},v=({target:{value:e}})=>{i.current.isValidPartialNumber(e)&&a(e)},b=()=>{if(!s){a(o);return}const e=i.current.parse(s),n=isNaN(e)?o:e+o;a(c.current.format(n))},p=()=>{if(!s){a(-o);return}const e=i.current.parse(s),n=isNaN(e)?-o:e-o;a(c.current.format(n))},$=e=>{if(!u)switch(e.key){case h.KeyboardKeys.DOWN:{e.preventDefault(),p();break}case h.KeyboardKeys.UP:{e.preventDefault(),b();break}}},L=()=>{if(s){const e=i.current.parse(s),n=isNaN(e)?"":c.current.format(e);a(n)}};return t.jsx(O.Field,{name:F,hint:w,error:j,id:k,required:A,children:t.jsxs(T.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[d&&t.jsx(z.FieldLabel,{action:D,children:d}),t.jsx(H.FieldInput,{ref:_,startAction:q,disabled:u,type:"text",inputMode:"decimal",onChange:v,onKeyDown:$,onBlur:L,value:s,size:r,endAction:t.jsxs(t.Fragment,{children:[t.jsx(N,{disabled:u,"aria-hidden":!0,reverse:!0,onClick:b,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:t.jsx(y.Icon,{as:g.CarretDown,color:"neutral500"})}),t.jsx(N,{disabled:u,"aria-hidden":!0,onClick:p,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:t.jsx(y.Icon,{as:g.CarretDown,color:"neutral500"})})]}),...R}),t.jsx(W.FieldHint,{}),t.jsx(X.FieldError,{})]})})});exports.NumberInput=Q;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { NumberParser as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import j, { useRef as b } from "react";
|
|
3
|
+
import { NumberParser as E, NumberFormatter as M } from "@internationalized/number";
|
|
4
4
|
import { CarretDown as N } from "@strapi/icons";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import q from "styled-components";
|
|
6
|
+
import { useDesignSystem as z } from "../DesignSystemProvider.js";
|
|
7
7
|
import { KeyboardKeys as g } from "../helpers/keyboardKeys.js";
|
|
8
|
-
import { useControllableState as
|
|
9
|
-
import { useId as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { useControllableState as H } from "../hooks/useControllableState.js";
|
|
9
|
+
import { useId as O } from "../hooks/useId.js";
|
|
10
|
+
import { FieldInput as T } from "../Field/FieldInput.js";
|
|
11
|
+
import { Field as W } from "../Field/Field.js";
|
|
12
|
+
import { Flex as X } from "../Flex/Flex.js";
|
|
13
|
+
import { FieldLabel as Y } from "../Field/FieldLabel.js";
|
|
14
14
|
import { Icon as w } from "../Icon/Icon.js";
|
|
15
|
-
import { FieldHint as
|
|
16
|
-
import { FieldError as
|
|
17
|
-
const x =
|
|
15
|
+
import { FieldHint as G } from "../Field/FieldHint.js";
|
|
16
|
+
import { FieldError as J } from "../Field/FieldError.js";
|
|
17
|
+
const x = q.button`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 1rem;
|
|
20
20
|
align-items: ${({ reverse: t }) => t ? "flex-end" : "flex-start"};
|
|
@@ -25,55 +25,55 @@ const x = M.button`
|
|
|
25
25
|
height: ${4 / 16}rem;
|
|
26
26
|
transform: ${({ reverse: t }) => t ? "rotateX(180deg)" : void 0};
|
|
27
27
|
}
|
|
28
|
-
`,
|
|
29
|
-
const
|
|
30
|
-
prop(
|
|
31
|
-
const
|
|
32
|
-
return isNaN(Number(
|
|
28
|
+
`, Q = "", he = j.forwardRef(({ size: t = "M", startAction: y, name: I, hint: F, error: V, label: c, labelAction: D, locale: A, id: C, onValueChange: k, value: u, step: a = 1, required: P = !1, disabled: m = !1, ...R }, S) => {
|
|
29
|
+
const $ = O(C), K = z("NumberInput"), d = A || K.locale, s = b(new E(d, { style: "decimal" })), l = b(new M(d, { maximumFractionDigits: 20 })), [o, v] = H({
|
|
30
|
+
prop(e) {
|
|
31
|
+
const r = String(u);
|
|
32
|
+
return isNaN(Number(r)) || r !== e && e !== "" ? e : l.current.format(Number(u));
|
|
33
33
|
},
|
|
34
|
-
defaultProp:
|
|
35
|
-
onChange(
|
|
36
|
-
const
|
|
37
|
-
k(isNaN(
|
|
34
|
+
defaultProp: Q,
|
|
35
|
+
onChange(e) {
|
|
36
|
+
const r = s.current.parse(e ?? "");
|
|
37
|
+
k(isNaN(r) ? void 0 : r);
|
|
38
38
|
}
|
|
39
|
-
}), i = (
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
s.current.isValidPartialNumber(
|
|
39
|
+
}), i = (e) => {
|
|
40
|
+
v(String(e));
|
|
41
|
+
}, B = ({ target: { value: e } }) => {
|
|
42
|
+
s.current.isValidPartialNumber(e) && i(e);
|
|
43
43
|
}, f = () => {
|
|
44
44
|
if (!o) {
|
|
45
45
|
i(a);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
49
|
-
i(l.current.format(
|
|
48
|
+
const e = s.current.parse(o), r = isNaN(e) ? a : e + a;
|
|
49
|
+
i(l.current.format(r));
|
|
50
50
|
}, p = () => {
|
|
51
51
|
if (!o) {
|
|
52
52
|
i(-a);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
i(l.current.format(
|
|
57
|
-
},
|
|
55
|
+
const e = s.current.parse(o), r = isNaN(e) ? -a : e - a;
|
|
56
|
+
i(l.current.format(r));
|
|
57
|
+
}, L = (e) => {
|
|
58
58
|
if (!m)
|
|
59
|
-
switch (
|
|
59
|
+
switch (e.key) {
|
|
60
60
|
case g.DOWN: {
|
|
61
|
-
|
|
61
|
+
e.preventDefault(), p();
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
case g.UP: {
|
|
65
|
-
|
|
65
|
+
e.preventDefault(), f();
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, U = () => {
|
|
70
70
|
if (o) {
|
|
71
|
-
const
|
|
72
|
-
i(
|
|
71
|
+
const e = s.current.parse(o), r = isNaN(e) ? "" : l.current.format(e);
|
|
72
|
+
i(r);
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
return n(
|
|
75
|
+
return n(W, { name: I, hint: F, error: V, id: $, required: P, children: h(X, { direction: "column", alignItems: "stretch", gap: 1, children: [c && n(Y, { action: D, children: c }), n(T, { ref: S, startAction: y, disabled: m, type: "text", inputMode: "decimal", onChange: B, onKeyDown: L, onBlur: U, value: o, size: t, endAction: h(_, { children: [n(x, { disabled: m, "aria-hidden": !0, reverse: !0, onClick: f, tabIndex: -1, type: "button", "data-testid": "ArrowUp", children: n(w, { as: N, color: "neutral500" }) }), n(x, { disabled: m, "aria-hidden": !0, onClick: p, tabIndex: -1, type: "button", "data-testid": "ArrowDown", children: n(w, { as: N, color: "neutral500" }) })] }), ...R }), n(G, {}), n(J, {})] }) });
|
|
76
76
|
});
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
he as NumberInput
|
|
79
79
|
};
|
package/dist/Popover/Popover.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),M=require("react"),u=require("@floating-ui/react-dom"),z=require("@radix-ui/react-focus-scope"),m=require("@strapi/ui-primitives"),T=require("aria-hidden"),W=require("react-remove-scroll"),A=require("styled-components"),B=require("../DismissibleLayer/index.cjs"),P=require("../helpers/strings.cjs"),H=require("../hooks/useComposeRefs.cjs"),K=require("../hooks/useId.cjs"),N=require("../hooks/useIntersection.cjs"),g=require("../Box/Box.cjs"),U=require("../Portal/Portal.cjs"),V=e=>e&&e.__esModule?e:{default:e};function Z(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 s=Z(M),R=V(A),G=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],J=R.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
|
-
|
|
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)`
|
|
5
|
+
`,E=s.forwardRef(({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},S)=>{const[h,k]=s.useState(null),[j,q]=s.useState(void 0),w=s.useRef(!1),{x:C,y:D,reference:v,floating:_,strategy:L}=u.useFloating({strategy:"fixed",placement:l?"bottom":c,middleware:[u.offset({mainAxis:t}),u.shift(),u.flip()],whileElementsMounted:u.autoUpdate});s.useLayoutEffect(()=>{v(e.current)},[e,v]),s.useLayoutEffect(()=>{n&&q(e.current.offsetWidth)},[n,e]),s.useEffect(()=>{if(h)return T.hideOthers(h)},[h]);const x=m.useCallbackRef(a);s.useEffect(()=>{const o=()=>{x()};return window.addEventListener("blur",o),window.addEventListener("resize",o),()=>{window.removeEventListener("blur",o),window.removeEventListener("resize",o)}},[x]);const I=H.useComposedRefs(S,o=>k(o),_);return i.jsx(W.RemoveScroll,{allowPinchZoom:!0,children:i.jsx(z.FocusScope,{asChild:!0,loop:!0,trapped:!0,onUnmountAutoFocus:o=>{o.preventDefault(),w.current||e.current?.focus({preventScroll:!0})},children:i.jsx(B.DismissibleLayer,{asChild:!0,onEscapeKeyDown:d,onPointerDownOutside:m.composeEventHandlers(f,o=>{const b=o.detail.originalEvent,$=b.button===0&&b.ctrlKey===!0,F=b.button===2||$;w.current=F},{checkForDefaultPrevented:!1}),onFocusOutside:m.composeEventHandlers(p,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:a,children:i.jsx(J,{ref:I,style:{left:C,top:D,position:L,width:j||void 0},hasRadius:!0,background:"neutral0",padding:1,...O,children:r})})})})}),y=({children:e,intersectionId:r,onReachEnd:t,...n})=>{const c=s.useRef(null),l=K.useId();return N.useIntersection(c,t??(()=>{}),{selectorToWatch:`#${P.stripReactIdOfColon(l)}`,skipWhen:!r||!t}),i.jsxs(Q,{ref:c,...n,children:[e,r&&t&&i.jsx(g.Box,{id:P.stripReactIdOfColon(l),width:"100%",height:"1px"})]})},Q=R.default(g.Box)`
|
|
7
6
|
// 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
7
|
max-height: ${3*5}rem;
|
|
9
8
|
overflow-y: auto;
|
|
@@ -23,4 +22,4 @@
|
|
|
23
22
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
24
23
|
margin-right: 10px;
|
|
25
24
|
}
|
|
26
|
-
`,
|
|
25
|
+
`,X=({children:e,source:r,spacing:t,fullWidth:n,placement:c,centered:l,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,...p})=>i.jsx(U.Portal,{children:i.jsx(E,{source:r,spacing:t,fullWidth:n,placement:c,centered:l,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,children:i.jsx(y,{...p,children:e})})});exports.Content=E;exports.POPOVER_PLACEMENTS=G;exports.Popover=X;exports.Scrolling=y;
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
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
|
|
3
|
+
import { useFloating as W, offset as A, shift as K, flip as j, autoUpdate as M } from "@floating-ui/react-dom";
|
|
4
|
+
import { FocusScope as T } from "@radix-ui/react-focus-scope";
|
|
5
|
+
import { useCallbackRef as U, composeEventHandlers as v } from "@strapi/ui-primitives";
|
|
6
|
+
import { hideOthers as B } from "aria-hidden";
|
|
7
|
+
import { RemoveScroll as H } from "react-remove-scroll";
|
|
8
|
+
import k from "styled-components";
|
|
9
|
+
import { DismissibleLayer as N } from "../DismissibleLayer/index.js";
|
|
10
|
+
import { stripReactIdOfColon as x } from "../helpers/strings.js";
|
|
11
|
+
import { useComposedRefs as V } from "../hooks/useComposeRefs.js";
|
|
12
|
+
import { useId as Z } from "../hooks/useId.js";
|
|
13
|
+
import { useIntersection as _ } from "../hooks/useIntersection.js";
|
|
14
14
|
import { Box as h } from "../Box/Box.js";
|
|
15
|
-
import { Portal as
|
|
16
|
-
const
|
|
15
|
+
import { Portal as q } from "../Portal/Portal.js";
|
|
16
|
+
const me = [
|
|
17
17
|
"top",
|
|
18
18
|
"top-start",
|
|
19
19
|
"top-end",
|
|
@@ -26,33 +26,32 @@ const fe = [
|
|
|
26
26
|
"left",
|
|
27
27
|
"left-start",
|
|
28
28
|
"left-end"
|
|
29
|
-
],
|
|
29
|
+
], G = k(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
|
-
|
|
34
|
-
|
|
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({
|
|
33
|
+
`, J = o.forwardRef(({ source: e, children: s, spacing: n = 0, fullWidth: i = !1, placement: l = "bottom-start", centered: a = !1, onEscapeKeyDown: d, onPointerDownOutside: f, onDismiss: c, onFocusOutside: u, ...E }, R) => {
|
|
34
|
+
const [m, y] = o.useState(null), [P, C] = o.useState(void 0), b = o.useRef(!1), { x: D, y: L, reference: w, floating: S, strategy: O } = W({
|
|
36
35
|
strategy: "fixed",
|
|
37
36
|
placement: a ? "bottom" : l,
|
|
38
37
|
middleware: [
|
|
39
|
-
|
|
38
|
+
A({
|
|
40
39
|
mainAxis: n
|
|
41
40
|
}),
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
K(),
|
|
42
|
+
j()
|
|
44
43
|
],
|
|
45
|
-
whileElementsMounted:
|
|
44
|
+
whileElementsMounted: M
|
|
46
45
|
});
|
|
47
46
|
o.useLayoutEffect(() => {
|
|
48
47
|
w(e.current);
|
|
49
48
|
}, [e, w]), o.useLayoutEffect(() => {
|
|
50
|
-
i &&
|
|
49
|
+
i && C(e.current.offsetWidth);
|
|
51
50
|
}, [i, e]), o.useEffect(() => {
|
|
52
51
|
if (m)
|
|
53
|
-
return
|
|
52
|
+
return B(m);
|
|
54
53
|
}, [m]);
|
|
55
|
-
const g =
|
|
54
|
+
const g = U(c);
|
|
56
55
|
o.useEffect(() => {
|
|
57
56
|
const t = () => {
|
|
58
57
|
g();
|
|
@@ -61,8 +60,8 @@ const fe = [
|
|
|
61
60
|
window.removeEventListener("blur", t), window.removeEventListener("resize", t);
|
|
62
61
|
};
|
|
63
62
|
}, [g]);
|
|
64
|
-
const
|
|
65
|
-
return r(
|
|
63
|
+
const $ = V(R, (t) => y(t), S);
|
|
64
|
+
return r(H, { allowPinchZoom: !0, children: r(T, {
|
|
66
65
|
asChild: !0,
|
|
67
66
|
loop: !0,
|
|
68
67
|
// we make sure we're not trapping once it's been closed
|
|
@@ -71,36 +70,35 @@ const fe = [
|
|
|
71
70
|
onUnmountAutoFocus: (t) => {
|
|
72
71
|
t.preventDefault(), b.current || e.current?.focus({ preventScroll: !0 });
|
|
73
72
|
},
|
|
74
|
-
children: r(
|
|
73
|
+
children: r(N, {
|
|
75
74
|
asChild: !0,
|
|
76
|
-
disableOutsidePointerEvents: !0,
|
|
77
75
|
onEscapeKeyDown: d,
|
|
78
|
-
onPointerDownOutside: v(
|
|
79
|
-
const p = t.detail.originalEvent,
|
|
80
|
-
b.current =
|
|
76
|
+
onPointerDownOutside: v(f, (t) => {
|
|
77
|
+
const p = t.detail.originalEvent, F = p.button === 0 && p.ctrlKey === !0, z = p.button === 2 || F;
|
|
78
|
+
b.current = z;
|
|
81
79
|
}, { checkForDefaultPrevented: !1 }),
|
|
82
80
|
// When focus is trapped, a `focusout` event may still happen.
|
|
83
81
|
// We make sure we don't trigger our `onDismiss` in such case.
|
|
84
|
-
onFocusOutside: v(
|
|
82
|
+
onFocusOutside: v(u, (t) => t.preventDefault(), {
|
|
85
83
|
checkForDefaultPrevented: !1
|
|
86
84
|
}),
|
|
87
85
|
onDismiss: c,
|
|
88
|
-
children: r(
|
|
89
|
-
left:
|
|
90
|
-
top:
|
|
86
|
+
children: r(G, { ref: $, style: {
|
|
87
|
+
left: D,
|
|
88
|
+
top: L,
|
|
91
89
|
position: O,
|
|
92
|
-
width:
|
|
90
|
+
width: P || void 0
|
|
93
91
|
}, hasRadius: !0, background: "neutral0", padding: 1, ...E, children: s })
|
|
94
92
|
})
|
|
95
93
|
}) });
|
|
96
|
-
},
|
|
97
|
-
const l = o.useRef(null), a =
|
|
98
|
-
return
|
|
94
|
+
}), Q = ({ children: e, intersectionId: s, onReachEnd: n, ...i }) => {
|
|
95
|
+
const l = o.useRef(null), a = Z();
|
|
96
|
+
return _(l, n ?? (() => {
|
|
99
97
|
}), {
|
|
100
|
-
selectorToWatch: `#${
|
|
98
|
+
selectorToWatch: `#${x(a)}`,
|
|
101
99
|
skipWhen: !s || !n
|
|
102
|
-
}),
|
|
103
|
-
},
|
|
100
|
+
}), I(X, { ref: l, ...i, children: [e, s && n && r(h, { id: x(a), width: "100%", height: "1px" })] });
|
|
101
|
+
}, X = k(h)`
|
|
104
102
|
// 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
|
|
105
103
|
max-height: ${3 * 5}rem;
|
|
106
104
|
overflow-y: auto;
|
|
@@ -120,10 +118,10 @@ const fe = [
|
|
|
120
118
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
121
119
|
margin-right: 10px;
|
|
122
120
|
}
|
|
123
|
-
`,
|
|
121
|
+
`, pe = ({ children: e, source: s, spacing: n, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: d, onPointerDownOutside: f, onDismiss: c, ...u }) => r(q, { children: r(J, { source: s, spacing: n, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: d, onPointerDownOutside: f, onDismiss: c, children: r(Q, { ...u, children: e }) }) });
|
|
124
122
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
J as Content,
|
|
124
|
+
me as POPOVER_PLACEMENTS,
|
|
125
|
+
pe as Popover,
|
|
126
|
+
Q as Scrolling
|
|
129
127
|
};
|
package/dist/Popover/index.cjs
CHANGED
|
@@ -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("./Popover.cjs"),o=require("./primitives.cjs");exports.POPOVER_PLACEMENTS=e.POPOVER_PLACEMENTS;exports.Popover=e.Popover;exports.PopoverPrimitives=o;
|
package/dist/Popover/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
const e = {
|
|
4
|
-
Content: o,
|
|
5
|
-
Scrolling: r
|
|
6
|
-
};
|
|
1
|
+
import { POPOVER_PLACEMENTS as e, Popover as p } from "./Popover.js";
|
|
2
|
+
import * as o from "./primitives.js";
|
|
7
3
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
e as POPOVER_PLACEMENTS,
|
|
5
|
+
p as Popover,
|
|
6
|
+
o as PopoverPrimitives
|
|
11
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Popover.cjs");exports.Content=e.Content;exports.Scrolling=e.Scrolling;
|
|
@@ -1,4 +1,4 @@
|
|
|
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/
|
|
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/FieldAction.cjs"),y=require("../Field/Field.cjs"),$=require("../VisuallyHidden/VisuallyHidden.cjs"),C=require("../Field/FieldLabel.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};
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
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(
|
|
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(y.Field,{name:e,children:[r.jsx($.VisuallyHidden,{children:r.jsx(C.FieldLabel,{children:u})}),r.jsx(t.FieldInput,{ref:x,value:n,startAction:r.jsx(c,{"aria-hidden":!0}),size:a,endAction:b?r.jsx(S.FieldAction,{label:f,onClick:q,children:r.jsx(w,{})}):void 0,...p})]})})});exports.Searchbar=g;
|
|
@@ -5,10 +5,10 @@ import e from "styled-components";
|
|
|
5
5
|
import { composeRefs as C } from "../hooks/useComposeRefs.js";
|
|
6
6
|
import { inputFocusStyle as F } from "../themes/utils.js";
|
|
7
7
|
import { InputWrapper as n, FieldInput as y } from "../Field/FieldInput.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { FieldAction as I } from "../Field/FieldAction.js";
|
|
9
|
+
import { Field as z } from "../Field/Field.js";
|
|
10
|
+
import { VisuallyHidden as A } from "../VisuallyHidden/VisuallyHidden.js";
|
|
11
|
+
import { FieldLabel as g } from "../Field/FieldLabel.js";
|
|
12
12
|
const j = e(w)`
|
|
13
13
|
font-size: 0.5rem;
|
|
14
14
|
path {
|
|
@@ -40,7 +40,7 @@ const j = e(w)`
|
|
|
40
40
|
const i = S(null), f = t.length > 0, h = (b) => {
|
|
41
41
|
c(b), i.current.focus();
|
|
42
42
|
}, u = C(p, i);
|
|
43
|
-
return o(W, { children: $(
|
|
43
|
+
return o(W, { children: $(z, { name: r, children: [o(A, { children: o(g, { children: a }) }), o(y, { ref: u, value: t, startAction: o(l, { "aria-hidden": !0 }), size: s, endAction: f ? o(I, { label: d, onClick: h, children: o(j, {}) }) : void 0, ...m })] }) });
|
|
44
44
|
});
|
|
45
45
|
export {
|
|
46
46
|
J as Searchbar
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),R=require("react"),d=require("@strapi/icons"),o=require("@strapi/ui-primitives"),p=require("styled-components"),j=require("../hooks/useComposeRefs.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),R=require("react"),d=require("@strapi/icons"),o=require("@strapi/ui-primitives"),p=require("styled-components"),j=require("../hooks/useComposeRefs.cjs"),c=require("../Flex/Flex.cjs"),f=require("../Box/Box.cjs"),u=require("../themes/utils.cjs"),g=require("../Typography/Typography.cjs"),I=e=>e&&e.__esModule?e:{default:e};function T(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const a=T(R),l=I(p),v=a.forwardRef(({onClear:e,clearLabel:t="Clear",startIcon:s,disabled:n,hasError:h,size:m="M",children:x,...b},$)=>{const i=a.useRef(null),S=y=>{e&&!n&&(e(y),i.current.focus())},w=j.useComposedRefs(i,$);return r.jsx(o.Select.Trigger,{asChild:!0,children:r.jsxs(q,{"aria-disabled":n,$hasError:h,$size:m,ref:w,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:n?"neutral150":"neutral0",paddingLeft:3,paddingRight:3,gap:4,cursor:"default",width:"100%",...b,children:[r.jsxs(c.Flex,{flex:"1",as:"span",gap:3,children:[s&&r.jsx(f.Box,{as:"span","aria-hidden":!0,children:s}),x]}),r.jsxs(c.Flex,{as:"span",gap:3,children:[e?r.jsx(C,{as:"button",hasRadius:!0,background:"transparent",role:"button",tabIndex:0,onClick:S,"aria-disabled":n,"aria-label":t,title:t,cursor:"pointer",children:r.jsx(d.Cross,{})}):null,r.jsx(k,{children:r.jsx(d.CarretDown,{})})]})]})})}),C=l.default(f.Box)`
|
|
2
2
|
border: none;
|
|
3
3
|
|
|
4
4
|
svg {
|
|
@@ -4,9 +4,9 @@ import { Cross as y, CarretDown as R } from "@strapi/icons";
|
|
|
4
4
|
import { Select as o } from "@strapi/ui-primitives";
|
|
5
5
|
import s, { css as I } from "styled-components";
|
|
6
6
|
import { useComposedRefs as S } from "../hooks/useComposeRefs.js";
|
|
7
|
-
import { getThemeSize as C, inputFocusStyle as T } from "../themes/utils.js";
|
|
8
7
|
import { Flex as c } from "../Flex/Flex.js";
|
|
9
8
|
import { Box as p } from "../Box/Box.js";
|
|
9
|
+
import { getThemeSize as C, inputFocusStyle as T } from "../themes/utils.js";
|
|
10
10
|
import { Typography as u } from "../Typography/Typography.js";
|
|
11
11
|
const k = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, disabled: n, hasError: m, size: h = "M", children: f, ...g }, $) => {
|
|
12
12
|
const d = a.useRef(null), w = (x) => {
|