@strapi/design-system 1.7.9 → 1.8.0
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/Alert/Alert.cjs +23 -29
- package/dist/Alert/Alert.js +33 -39
- package/dist/Alert/utils.cjs +1 -1
- package/dist/Alert/utils.js +14 -3
- package/dist/Button/Button.cjs +9 -4
- package/dist/Button/Button.js +28 -23
- package/dist/CarouselInput/CarouselImage.cjs +1 -1
- package/dist/CarouselInput/CarouselImage.js +3 -3
- package/dist/CarouselInput/CarouselSlide.cjs +1 -1
- package/dist/CarouselInput/CarouselSlide.js +2 -2
- 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 +381 -55
- package/dist/DateTimePicker/DateTimePicker.cjs +7 -1
- package/dist/DateTimePicker/DateTimePicker.js +91 -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/Flex/Flex.cjs +1 -1
- package/dist/Flex/Flex.js +1 -1
- 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/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/package.json +6 -5
- 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
package/README.md
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://strapi.io">
|
|
3
|
-
<img src="./assets/logo.svg" width="318px" alt="Strapi logo" />
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
6
|
-
<p align="center">
|
|
7
|
-
<a style='margin-right:10px' href="https://design-system.strapi.io/">Documentation</a>|<a style='margin-left:10px' href="https://design-system-git-main-strapijs.vercel.app/">Try components</a></p>
|
|
8
|
-
<br />
|
|
1
|
+
# Strapi Design System
|
|
9
2
|
|
|
10
3
|
[](https://www.npmjs.com/package/@strapi/design-system)
|
|
11
4
|
[](https://www.npmjs.com/package/@strapi/design-system)
|
|
12
5
|
[](https://discord.gg/strapi)
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Strapi Design System provides guidelines and tools to help anyone make Strapi's contributions more cohesive and to build
|
|
17
|
-
plugins more efficiently.
|
|
7
|
+
<b>A UI component library for creating amazing Strapi extensions.</b>
|
|
18
8
|
|
|
19
9
|
## Installation
|
|
20
10
|
|
|
21
|
-
Install Strapi Design System and its peer dependencies:
|
|
22
|
-
|
|
23
11
|
```sh
|
|
24
12
|
$ yarn add react react-dom @strapi/design-system @strapi/icons styled-components react-router-dom
|
|
25
13
|
|
|
@@ -30,13 +18,17 @@ $ npm i react react-dom @strapi/design-system @strapi/icons styled-components re
|
|
|
30
18
|
|
|
31
19
|
## Getting Started
|
|
32
20
|
|
|
33
|
-
Wrap your application with the `
|
|
21
|
+
Wrap your application with the `DesignSystemProvider`. You can additionally pass a theme and/or locale, although you don't have to as we have default values for both.
|
|
34
22
|
|
|
35
23
|
```jsx
|
|
36
|
-
import {
|
|
24
|
+
import { DesignSystemProvider, lightTheme } from '@strapi/design-system';
|
|
37
25
|
|
|
38
26
|
function MyApp({ children }) {
|
|
39
|
-
return
|
|
27
|
+
return (
|
|
28
|
+
<DesignSystemProvider locale="en-GB" theme={lightTheme}>
|
|
29
|
+
{children}
|
|
30
|
+
</DesignSystemProvider>
|
|
31
|
+
);
|
|
40
32
|
}
|
|
41
33
|
|
|
42
34
|
export default App;
|
package/dist/Alert/Alert.cjs
CHANGED
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
10
|
-
`,y=d.default.button`
|
|
11
|
-
border: none;
|
|
12
|
-
background: transparent;
|
|
13
|
-
font-size: ${12/16}rem;
|
|
14
|
-
svg path {
|
|
15
|
-
fill: ${({theme:e})=>e.colors.neutral700};
|
|
16
|
-
}
|
|
17
|
-
margin-top: ${({theme:e})=>e.spaces[1]};
|
|
18
|
-
${g.buttonFocusStyle};
|
|
19
|
-
`,$=d.default(t.Box)`
|
|
20
|
-
font-size: ${20/16}rem;
|
|
21
|
-
svg path {
|
|
22
|
-
fill: ${l.handleIconColor};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("@strapi/icons"),p=require("styled-components"),l=require("./utils.cjs"),f=require("../themes/utils.cjs"),u=require("../Box/Box.cjs"),a=require("../Flex/Flex.cjs"),d=require("../Typography/Typography.cjs"),C=e=>e&&e.__esModule?e:{default:e},i=C(p),j=i.default(u.Box)`
|
|
2
|
+
svg {
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
6
|
+
path {
|
|
7
|
+
fill: ${({theme:e})=>e.colors.neutral700};
|
|
8
|
+
}
|
|
23
9
|
}
|
|
24
|
-
`,b=({variant:e,...o})=>e==="success"?r.jsx(s.CheckCircle,{...o}):e==="danger"||e==="warning"?r.jsx(s.ExclamationMarkCircle,{...o}):r.jsx(s.Information,{...o}),m=d.default(t.Box)`
|
|
25
|
-
// Checked with the designers, validated
|
|
26
|
-
padding-top: 1px;
|
|
27
10
|
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
${f.buttonFocusStyle};
|
|
12
|
+
`,b=i.default(a.Flex)`
|
|
13
|
+
svg {
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
30
16
|
|
|
31
|
-
|
|
17
|
+
path {
|
|
32
18
|
fill: ${l.handleIconColor};
|
|
33
19
|
}
|
|
34
20
|
}
|
|
35
|
-
`,
|
|
21
|
+
`,m=({variant:e,...o})=>e==="success"?r.jsx(n.CheckCircle,{...o}):e==="danger"||e==="warning"?r.jsx(n.ExclamationMarkCircle,{...o}):r.jsx(n.Information,{...o}),y=i.default(u.Box)`
|
|
22
|
+
& a > span {
|
|
23
|
+
color: ${l.handleIconColor};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
svg path {
|
|
27
|
+
fill: ${l.handleIconColor};
|
|
28
|
+
}
|
|
29
|
+
`,w=({title:e,children:o,variant:t="default",onClose:c,closeLabel:h,titleAs:g="p",action:s,...x})=>r.jsxs(a.Flex,{alignItems:"flex-start",background:l.handleBackgroundColor(t),borderColor:l.handleBorderColor(t),boxShadow:"filterShadow",gap:3,hasRadius:!0,padding:5,paddingRight:6,variant:t,...x,children:[r.jsx(b,{height:`${20/16}rem`,shrink:0,variant:t,width:`${20/16}rem`,children:r.jsx(m,{"aria-hidden":!0,variant:t})}),r.jsxs(a.Flex,{alignItems:"start",gap:s?2:1,wrap:"wrap",role:t==="danger"?"alert":"status",width:"100%",children:[r.jsx(d.Typography,{fontWeight:"bold",textColor:"neutral800",as:g,children:e}),r.jsx(d.Typography,{as:"p",textColor:"neutral800",children:o}),s&&r.jsx(y,{variant:t,children:s})]}),r.jsx(j,{as:"button",background:"transparent",borderColor:void 0,height:`${12/16}rem`,marginTop:1,onClick:c,width:`${12/16}rem`,"aria-label":h,children:r.jsx(n.Cross,{"aria-hidden":!0})})]});exports.Alert=w;
|
package/dist/Alert/Alert.js
CHANGED
|
@@ -1,46 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Cross as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { buttonFocusStyle as
|
|
6
|
-
import { Box as
|
|
7
|
-
import { Flex as
|
|
8
|
-
import { Typography as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
box-shadow: ${({ theme: o }) => o.shadows.filterShadow};
|
|
18
|
-
`, y = d.button`
|
|
19
|
-
border: none;
|
|
20
|
-
background: transparent;
|
|
21
|
-
font-size: ${12 / 16}rem;
|
|
22
|
-
svg path {
|
|
23
|
-
fill: ${({ theme: o }) => o.colors.neutral700};
|
|
24
|
-
}
|
|
25
|
-
margin-top: ${({ theme: o }) => o.spaces[1]};
|
|
26
|
-
${b};
|
|
27
|
-
`, A = d(t)`
|
|
28
|
-
font-size: ${20 / 16}rem;
|
|
29
|
-
svg path {
|
|
30
|
-
fill: ${l};
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Cross as u, CheckCircle as f, ExclamationMarkCircle as C, Information as x } from "@strapi/icons";
|
|
3
|
+
import a from "styled-components";
|
|
4
|
+
import { handleIconColor as n, handleBackgroundColor as w, handleBorderColor as b } from "./utils.js";
|
|
5
|
+
import { buttonFocusStyle as $ } from "../themes/utils.js";
|
|
6
|
+
import { Box as s } from "../Box/Box.js";
|
|
7
|
+
import { Flex as i } from "../Flex/Flex.js";
|
|
8
|
+
import { Typography as h } from "../Typography/Typography.js";
|
|
9
|
+
const k = a(s)`
|
|
10
|
+
svg {
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
path {
|
|
15
|
+
fill: ${({ theme: o }) => o.colors.neutral700};
|
|
16
|
+
}
|
|
31
17
|
}
|
|
32
|
-
`, I = ({ variant: o, ...e }) => o === "success" ? r(m, { ...e }) : o === "danger" || o === "warning" ? r(u, { ...e }) : r(x, { ...e }), R = d(t)`
|
|
33
|
-
// Checked with the designers, validated
|
|
34
|
-
padding-top: 1px;
|
|
35
18
|
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
${$};
|
|
20
|
+
`, I = a(i)`
|
|
21
|
+
svg {
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: 100%;
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
fill: ${
|
|
25
|
+
path {
|
|
26
|
+
fill: ${n};
|
|
41
27
|
}
|
|
42
28
|
}
|
|
43
|
-
`,
|
|
29
|
+
`, B = ({ variant: o, ...e }) => o === "success" ? r(f, { ...e }) : o === "danger" || o === "warning" ? r(C, { ...e }) : r(x, { ...e }), y = a(s)`
|
|
30
|
+
& a > span {
|
|
31
|
+
color: ${n};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
svg path {
|
|
35
|
+
fill: ${n};
|
|
36
|
+
}
|
|
37
|
+
`, M = ({ title: o, children: e, variant: t = "default", onClose: c, closeLabel: m, titleAs: g = "p", action: l, ...p }) => d(i, { alignItems: "flex-start", background: w(t), borderColor: b(t), boxShadow: "filterShadow", gap: 3, hasRadius: !0, padding: 5, paddingRight: 6, variant: t, ...p, children: [r(I, { height: `${20 / 16}rem`, shrink: 0, variant: t, width: `${20 / 16}rem`, children: r(B, { "aria-hidden": !0, variant: t }) }), d(i, { alignItems: "start", gap: l ? 2 : 1, wrap: "wrap", role: t === "danger" ? "alert" : "status", width: "100%", children: [r(h, { fontWeight: "bold", textColor: "neutral800", as: g, children: o }), r(h, { as: "p", textColor: "neutral800", children: e }), l && r(y, { variant: t, children: l })] }), r(k, { as: "button", background: "transparent", borderColor: void 0, height: `${12 / 16}rem`, marginTop: 1, onClick: c, width: `${12 / 16}rem`, "aria-label": m, children: r(u, { "aria-hidden": !0 }) })] });
|
|
44
38
|
export {
|
|
45
|
-
|
|
39
|
+
M as Alert
|
|
46
40
|
};
|
package/dist/Alert/utils.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 o=r=>{switch(r){case"danger":return"danger100";case"success":return"success100";case"warning":return"warning100";default:return"primary100"}},e=r=>o(r).replace("100","200"),c=({theme:r,variant:n})=>n==="danger"?r.colors.danger700:n==="success"?r.colors.success700:n==="warning"?r.colors.warning700:r.colors.primary700;exports.handleBackgroundColor=o;exports.handleBorderColor=e;exports.handleIconColor=c;
|
package/dist/Alert/utils.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
const s = (
|
|
1
|
+
const s = (r) => {
|
|
2
|
+
switch (r) {
|
|
3
|
+
case "danger":
|
|
4
|
+
return "danger100";
|
|
5
|
+
case "success":
|
|
6
|
+
return "success100";
|
|
7
|
+
case "warning":
|
|
8
|
+
return "warning100";
|
|
9
|
+
default:
|
|
10
|
+
return "primary100";
|
|
11
|
+
}
|
|
12
|
+
}, c = (r) => s(r).replace("100", "200"), e = ({ theme: r, variant: n }) => n === "danger" ? r.colors.danger700 : n === "success" ? r.colors.success700 : n === "warning" ? r.colors.warning700 : r.colors.primary700;
|
|
2
13
|
export {
|
|
3
14
|
s as handleBackgroundColor,
|
|
4
|
-
|
|
5
|
-
|
|
15
|
+
c as handleBorderColor,
|
|
16
|
+
e as handleIconColor
|
|
6
17
|
};
|
package/dist/Button/Button.cjs
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("react"),v=require("@strapi/icons"),c=require("styled-components"),l=require("./constants.cjs"),r=require("./utils.cjs"),j=require("../BaseButton/BaseButton.cjs"),_=require("../Box/Box.cjs"),$=require("../Typography/Typography.cjs"),T=require("../Flex/Flex.cjs"),f=e=>e&&e.__esModule?e:{default:e},D=f(S),g=f(c),R=c.keyframes`
|
|
2
2
|
from {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
5
5
|
to {
|
|
6
6
|
transform: rotate(359deg);
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,w=g.default(v.Loader)`
|
|
9
9
|
animation: ${R} 2s infinite linear;
|
|
10
10
|
will-change: transform;
|
|
11
|
-
`,
|
|
11
|
+
`,h=g.default(j.BaseButton)`
|
|
12
12
|
height: ${({theme:e,size:n})=>e.sizes.button[n]};
|
|
13
13
|
|
|
14
|
+
svg {
|
|
15
|
+
height: ${12/16}rem;
|
|
16
|
+
width: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
&[aria-disabled='true'] {
|
|
15
20
|
${r.getDisabledStyle}
|
|
16
21
|
|
|
@@ -28,4 +33,4 @@
|
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
${r.getVariantStyle}
|
|
31
|
-
`,
|
|
36
|
+
`,y=D.default.forwardRef(({variant:e=l.DEFAULT,startIcon:n,endIcon:s,disabled:b=!1,children:p,onClick:d,size:u=l.BUTTON_SIZES[0],loading:a=!1,fullWidth:i=!1,...m},B)=>{const o=b||a,x=q=>{!o&&d&&d(q)};return t.jsxs(h,{ref:B,"aria-disabled":o,disabled:o,size:u,variant:e,onClick:x,fullWidth:i,alignItems:"center",background:"buttonPrimary600",borderColor:"buttonPrimary600",gap:2,inline:i,justifyContent:i?"center":void 0,paddingLeft:4,paddingRight:4,width:i?"100%":void 0,...m,children:[(n||a)&&t.jsx(_.Box,{"aria-hidden":!0,children:a?t.jsx(w,{}):n}),t.jsx($.Typography,{variant:u==="S"?"pi":void 0,fontWeight:"bold",lineHeight:0,textColor:"buttonNeutral0",children:p}),s&&t.jsx(T.Flex,{"aria-hidden":!0,children:s})]})});y.displayName="Button";exports.Button=y;exports.ButtonWrapper=h;
|
package/dist/Button/Button.js
CHANGED
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as g, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import b from "react";
|
|
3
3
|
import { Loader as y } from "@strapi/icons";
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT as
|
|
6
|
-
import { getDisabledStyle as
|
|
4
|
+
import f, { keyframes as v } from "styled-components";
|
|
5
|
+
import { DEFAULT as $, BUTTON_SIZES as B } from "./constants.js";
|
|
6
|
+
import { getDisabledStyle as s, getHoverStyle as S, getActiveStyle as x, getVariantStyle as C } from "./utils.js";
|
|
7
7
|
import { BaseButton as k } from "../BaseButton/BaseButton.js";
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Typography as
|
|
10
|
-
import { Flex as
|
|
11
|
-
const
|
|
8
|
+
import { Box as w } from "../Box/Box.js";
|
|
9
|
+
import { Typography as L } from "../Typography/Typography.js";
|
|
10
|
+
import { Flex as T } from "../Flex/Flex.js";
|
|
11
|
+
const j = v`
|
|
12
12
|
from {
|
|
13
13
|
transform: rotate(0deg);
|
|
14
14
|
}
|
|
15
15
|
to {
|
|
16
16
|
transform: rotate(359deg);
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
19
|
-
animation: ${
|
|
18
|
+
`, A = f(y)`
|
|
19
|
+
animation: ${j} 2s infinite linear;
|
|
20
20
|
will-change: transform;
|
|
21
|
-
`,
|
|
22
|
-
height: ${({ theme: i, size:
|
|
21
|
+
`, D = f(k)`
|
|
22
|
+
height: ${({ theme: i, size: t }) => i.sizes.button[t]};
|
|
23
|
+
|
|
24
|
+
svg {
|
|
25
|
+
height: ${12 / 16}rem;
|
|
26
|
+
width: auto;
|
|
27
|
+
}
|
|
23
28
|
|
|
24
29
|
&[aria-disabled='true'] {
|
|
25
|
-
${
|
|
30
|
+
${s}
|
|
26
31
|
|
|
27
32
|
&:active {
|
|
28
|
-
${
|
|
33
|
+
${s}
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
&:hover {
|
|
33
|
-
${
|
|
38
|
+
${S}
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
&:active {
|
|
@@ -38,14 +43,14 @@ const w = v`
|
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
${C}
|
|
41
|
-
`,
|
|
42
|
-
const a =
|
|
43
|
-
return
|
|
44
|
-
!a && d && d(
|
|
45
|
-
}, fullWidth:
|
|
46
|
+
`, N = b.forwardRef(({ variant: i = $, startIcon: t, endIcon: n, disabled: l = !1, children: p, onClick: d, size: m = B[0], loading: o = !1, fullWidth: e = !1, ...c }, h) => {
|
|
47
|
+
const a = l || o;
|
|
48
|
+
return g(D, { ref: h, "aria-disabled": a, disabled: a, size: m, variant: i, onClick: (u) => {
|
|
49
|
+
!a && d && d(u);
|
|
50
|
+
}, fullWidth: e, alignItems: "center", background: "buttonPrimary600", borderColor: "buttonPrimary600", gap: 2, inline: e, justifyContent: e ? "center" : void 0, paddingLeft: 4, paddingRight: 4, width: e ? "100%" : void 0, ...c, children: [(t || o) && r(w, { "aria-hidden": !0, children: o ? r(A, {}) : t }), r(L, { variant: m === "S" ? "pi" : void 0, fontWeight: "bold", lineHeight: 0, textColor: "buttonNeutral0", children: p }), n && r(T, { "aria-hidden": !0, children: n })] });
|
|
46
51
|
});
|
|
47
|
-
|
|
52
|
+
N.displayName = "Button";
|
|
48
53
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
N as Button,
|
|
55
|
+
D as ButtonWrapper
|
|
51
56
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),u=require("styled-components"),n=require("../Typography/utils.cjs"),a=require("../Box/Box.cjs"),c=require("../Tooltip/Tooltip.cjs"),d=e=>e&&e.__esModule?e:{default:e},g=d(u),r=g.default(a.Box)`
|
|
2
2
|
${n.ellipsisStyle({ellipsis:!0})}
|
|
3
|
-
`,m=e=>{const[s,o]=l.useState(!1),i=()=>{o(!0)};return s?t.jsx(c.Tooltip,{description:e.alt??"",children:t.jsx(r,{as:"img",height:"100%",...e})}):t.jsx(r,{as:"img",height:"100%",...e,onError:i})};exports.CarouselImage=m;
|
|
3
|
+
`,m=e=>{const[s,o]=l.useState(!1),i=()=>{o(!0)};return s?t.jsx(c.Tooltip,{description:e.alt??"",children:t.jsx(r,{as:"img",height:"100%",maxWidth:"100%",...e})}):t.jsx(r,{as:"img",height:"100%",maxWidth:"100%",...e,onError:i})};exports.CarouselImage=m;
|
|
@@ -6,12 +6,12 @@ import { Box as n } from "../Box/Box.js";
|
|
|
6
6
|
import { Tooltip as f } from "../Tooltip/Tooltip.js";
|
|
7
7
|
const o = l(n)`
|
|
8
8
|
${a({ ellipsis: !0 })}
|
|
9
|
-
`,
|
|
9
|
+
`, x = (r) => {
|
|
10
10
|
const [e, i] = s(!1), m = () => {
|
|
11
11
|
i(!0);
|
|
12
12
|
};
|
|
13
|
-
return e ? t(f, { description: r.alt ?? "", children: t(o, { as: "img", height: "100%", ...r }) }) : t(o, { as: "img", height: "100%", ...r, onError: m });
|
|
13
|
+
return e ? t(f, { description: r.alt ?? "", children: t(o, { as: "img", height: "100%", maxWidth: "100%", ...r }) }) : t(o, { as: "img", height: "100%", maxWidth: "100%", ...r, onError: m });
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
x as CarouselImage
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
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"),n=require("../Flex/Flex.cjs"),o=({label:e,children:i,selected:l=!1,...r})=>t.jsx(n.Flex,{alignItems:"center",display:l?"flex":"none",role:"group","aria-roledescription":"slide","aria-label":e,justifyContent:"center",height:"124px",width:"100%",...r,children:i});exports.CarouselSlide=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Flex as t } from "../Flex/Flex.js";
|
|
3
|
-
const s = ({ label: e, children: r, selected:
|
|
3
|
+
const s = ({ label: e, children: r, selected: i = !1, ...l }) => o(t, { alignItems: "center", display: i ? "flex" : "none", role: "group", "aria-roledescription": "slide", "aria-label": e, justifyContent: "center", height: "124px", width: "100%", ...l, children: r });
|
|
4
4
|
export {
|
|
5
5
|
s as CarouselSlide
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),me=require("react"),M=require("@strapi/icons"),n=require("@strapi/ui-primitives"),Ce=require("styled-components"),$e=require("../helpers/strings.cjs"),j=require("../hooks/useControllableState.cjs"),I=require("../hooks/useId.cjs"),je=require("../hooks/useIntersection.cjs"),N=require("../themes/utils.cjs"),Ie=require("../Loader/Loader.cjs"),y=require("../Box/Box.cjs"),u=require("../Typography/Typography.cjs"),b=require("../Flex/Flex.cjs"),ye=require("../Field/Field.cjs"),we=require("../Field/FieldLabel.cjs"),qe=require("../Field/FieldHint.cjs"),Fe=require("../Field/FieldError.cjs"),Te=e=>e&&e.__esModule?e:{default:e};function ve(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const p=ve(me),a=Te(Ce),H=({allowCustomValue:e,autocomplete:r,children:s,className:i,clearLabel:d="clear",creatable:l=!1,createMessage:g=$=>`Create "${$}"`,defaultFilterValue:h,defaultTextValue:w,defaultOpen:W=!1,open:U,onOpenChange:A,disabled:f=!1,error:q,filterValue:G,hasMoreItems:J=!1,id:F,isPrintableCharacter:K,loading:m=!1,loadingMessage:Q="Loading content...",noOptionsMessage:X=()=>"No results found",onChange:T,onClear:C,onCreateOption:v,onFilterValueChange:Y,onInputChange:R,onTextValueChange:Z,onLoadMore:k,placeholder:ee="Select or enter a value",required:oe=!1,size:re="M",startIcon:O,textValue:te,value:V,...ne})=>{const[$,se]=j.useControllableState({prop:U,defaultProp:W,onChange:A}),[c,S]=j.useControllableState({prop:te,defaultProp:e&&!w?V:w,onChange:Z}),[le,B]=j.useControllableState({prop:G,defaultProp:h,onChange:Y}),P=p.useRef(null),_=p.useRef(null),ie=p.useRef(null),ae=t=>{C&&!f&&(S(""),B(""),C(t),_.current.focus())},de=t=>{se(t)},ce=t=>{S(t)},ue=t=>{B(t)},he=t=>{R&&R(t)},be=t=>{T&&T(t)},pe=t=>{k&&J&&!m&&k(t)},z=()=>{v&&c&&v(c)},E=I.useId(F),xe=I.useId(),D=`intersection-${$e.stripReactIdOfColon(xe)}`;je.useIntersection(P,pe,{selectorToWatch:`#${D}`,skipWhen:!$});const ge=`${E}-hint`,fe=`${E}-error`;return o.jsxs(n.Combobox.Root,{autocomplete:r||(l?"list":"both"),onOpenChange:de,onTextValueChange:ce,textValue:c,allowCustomValue:l||e,disabled:f,required:oe,value:V,onValueChange:be,filterValue:le,onFilterValueChange:ue,isPrintableCharacter:K,children:[o.jsxs(Oe,{$hasError:!!q,$size:re,className:i,children:[o.jsxs(b.Flex,{flex:"1",as:"span",gap:3,children:[O?o.jsx(y.Box,{as:"span","aria-hidden":!0,children:O}):null,o.jsx(Ve,{placeholder:ee,id:F,"aria-invalid":!!q,"aria-describedby":`${ge} ${fe}`,onChange:he,ref:_,...ne})]}),o.jsxs(b.Flex,{as:"span",gap:3,children:[c&&C?o.jsx(ke,{as:"button",hasRadius:!0,background:"transparent",type:"button",onClick:ae,"aria-disabled":f,"aria-label":d,title:d,ref:ie,children:o.jsx(M.Cross,{})}):null,o.jsx(Se,{children:o.jsx(M.CarretDown,{})})]})]}),o.jsx(n.Combobox.Portal,{children:o.jsx(Be,{sideOffset:4,children:o.jsxs(Pe,{ref:P,children:[s,l?o.jsx(n.Combobox.CreateItem,{onPointerUp:z,onClick:z,asChild:!0,children:o.jsx(x,{children:o.jsx(u.Typography,{children:g(c??"")})})}):null,!l&&!m?o.jsx(n.Combobox.NoValueFound,{asChild:!0,children:o.jsx(x,{$hasHover:!1,children:o.jsx(u.Typography,{children:X(c??"")})})}):null,m?o.jsx(b.Flex,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:o.jsx(Ie.Loader,{small:!0,children:Q})}):null,o.jsx(y.Box,{id:D,width:"100%",height:"1px"})]})})})]})},L=({error:e,hint:r,id:s,label:i,labelAction:d,required:l=!1,...g})=>{const h=I.useId(s);return o.jsx(ye.Field,{hint:r,error:e,id:h,required:l,children:o.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[o.jsx(we.FieldLabel,{action:d,children:i}),o.jsx(H,{id:h,error:e,required:l,...g}),o.jsx(qe.FieldHint,{}),o.jsx(Fe.FieldError,{})]})})},Re=e=>o.jsx(L,{...e,creatable:!0}),ke=a.default(y.Box)`
|
|
2
2
|
border: none;
|
|
3
3
|
|
|
4
4
|
svg {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
svg path {
|
|
10
10
|
fill: ${({theme:e})=>e.colors.neutral600};
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
12
|
+
`,Oe=a.default(n.Combobox.Trigger)`
|
|
13
13
|
position: relative;
|
|
14
14
|
border: 1px solid ${({theme:e,$hasError:r})=>r?e.colors.danger600:e.colors.neutral200};
|
|
15
15
|
padding-right: ${({theme:e})=>e.spaces[3]};
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: space-between;
|
|
23
23
|
gap: ${({theme:e})=>e.spaces[4]};
|
|
24
|
+
min-height: ${({theme:e,$size:r})=>N.getThemeSize("input")({theme:e,size:r})};
|
|
24
25
|
|
|
25
26
|
&[data-disabled] {
|
|
26
27
|
color: ${({theme:e})=>e.colors.neutral600};
|
|
@@ -33,12 +34,12 @@
|
|
|
33
34
|
outline: none;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
${({theme:e,$hasError:r})=>
|
|
37
|
-
`,
|
|
37
|
+
${({theme:e,$hasError:r})=>N.inputFocusStyle()({theme:e,hasError:r})};
|
|
38
|
+
`,Ve=a.default(n.Combobox.TextInput)`
|
|
38
39
|
width: 100%;
|
|
39
40
|
font-size: ${14/16}rem;
|
|
40
41
|
color: ${({theme:e})=>e.colors.neutral800};
|
|
41
|
-
|
|
42
|
+
padding: 0;
|
|
42
43
|
border: none;
|
|
43
44
|
background-color: transparent;
|
|
44
45
|
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
&[aria-disabled='true'] {
|
|
50
51
|
cursor: inherit;
|
|
51
52
|
}
|
|
52
|
-
`,
|
|
53
|
+
`,Se=a.default(n.Combobox.Icon)`
|
|
53
54
|
& > svg {
|
|
54
55
|
width: ${6/16}rem;
|
|
55
56
|
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
&[aria-disabled='true'] {
|
|
62
63
|
cursor: inherit;
|
|
63
64
|
}
|
|
64
|
-
`,
|
|
65
|
+
`,Be=a.default(n.Combobox.Content)`
|
|
65
66
|
background: ${({theme:e})=>e.colors.neutral0};
|
|
66
67
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
67
68
|
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
@@ -70,9 +71,9 @@
|
|
|
70
71
|
/* This is from the design-system figma file. */
|
|
71
72
|
max-height: 15rem;
|
|
72
73
|
z-index: ${({theme:e})=>e.zIndices[1]};
|
|
73
|
-
`,
|
|
74
|
+
`,Pe=a.default(n.Combobox.Viewport)`
|
|
74
75
|
padding: ${({theme:e})=>e.spaces[1]};
|
|
75
|
-
`,
|
|
76
|
+
`,_e=p.forwardRef(({children:e,value:r,disabled:s,textValue:i,...d},l)=>o.jsx(n.Combobox.ComboboxItem,{asChild:!0,value:r,disabled:s,textValue:i,children:o.jsx(x,{ref:l,...d,children:o.jsx(n.Combobox.ItemText,{asChild:!0,children:o.jsx(u.Typography,{children:e})})})})),x=a.default.div`
|
|
76
77
|
width: 100%;
|
|
77
78
|
border: none;
|
|
78
79
|
text-align: left;
|
|
@@ -82,10 +83,10 @@
|
|
|
82
83
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
83
84
|
user-select: none;
|
|
84
85
|
|
|
85
|
-
&[data-
|
|
86
|
+
&[data-state='checked'] {
|
|
86
87
|
background-color: ${({theme:e})=>e.colors.primary100};
|
|
87
88
|
|
|
88
|
-
${
|
|
89
|
+
${u.Typography} {
|
|
89
90
|
color: ${({theme:e})=>e.colors.primary600};
|
|
90
91
|
font-weight: bold;
|
|
91
92
|
}
|
|
@@ -98,9 +99,9 @@
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
&[data-highlighted] {
|
|
101
|
-
${
|
|
102
|
+
${u.Typography} {
|
|
102
103
|
color: ${({theme:e})=>e.colors.primary600};
|
|
103
104
|
font-weight: bold;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
`;exports.Combobox=
|
|
107
|
+
`;exports.Combobox=L;exports.ComboboxInput=H;exports.CreatableCombobox=Re;exports.Option=_e;exports.OptionBox=x;
|