@strapi/design-system 1.5.0-alpha.0 → 1.6.0-alpha.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/dist/Accordion/Accordion.cjs +8 -8
- package/dist/Accordion/Accordion.js +73 -67
- package/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +20 -17
- package/dist/Accordion/AccordionContext.cjs +1 -1
- package/dist/Accordion/AccordionContext.js +10 -4
- package/dist/Accordion/AccordionGroup.cjs +20 -20
- package/dist/Accordion/AccordionGroup.js +98 -59
- package/dist/Accordion/AccordionToggle.cjs +3 -3
- package/dist/Accordion/AccordionToggle.js +108 -89
- package/dist/Accordion/utils.cjs +1 -1
- package/dist/Accordion/utils.js +4 -4
- package/dist/Alert/Alert.cjs +7 -7
- package/dist/Alert/Alert.js +92 -85
- package/dist/Avatar/Avatar.cjs +6 -6
- package/dist/Avatar/Avatar.js +68 -67
- package/dist/Avatar/constants.cjs +1 -1
- package/dist/Avatar/constants.js +1 -1
- package/dist/Badge/Badge.cjs +4 -4
- package/dist/Badge/Badge.js +37 -37
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +39 -27
- package/dist/BaseCheckbox/BaseCheckbox.cjs +6 -6
- package/dist/BaseCheckbox/BaseCheckbox.js +77 -59
- package/dist/BaseLink/BaseLink.cjs +2 -2
- package/dist/BaseLink/BaseLink.js +20 -27
- package/dist/BaseRadio/BaseRadio.cjs +7 -7
- package/dist/BaseRadio/BaseRadio.js +55 -35
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +31 -28
- package/dist/BaseRadio/context.cjs +1 -1
- package/dist/BaseRadio/context.js +8 -4
- package/dist/BaseRadio/utils.cjs +1 -1
- package/dist/BaseRadio/utils.js +1 -1
- package/dist/Box/Box.cjs +31 -32
- package/dist/Box/Box.js +182 -59
- package/dist/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/Breadcrumbs/Breadcrumbs.js +50 -39
- package/dist/Button/Button.cjs +20 -20
- package/dist/Button/Button.js +83 -74
- package/dist/Button/utils.cjs +23 -23
- package/dist/Button/utils.js +15 -15
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +28 -29
- package/dist/Card/CardAction.cjs +4 -4
- package/dist/Card/CardAction.js +12 -6
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +32 -26
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +14 -10
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +11 -10
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +16 -13
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +11 -11
- package/dist/Card/CardContext.cjs +1 -1
- package/dist/Card/CardContext.js +3 -1
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +9 -7
- package/dist/Card/CardTimer.cjs +2 -2
- package/dist/Card/CardTimer.js +21 -16
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +11 -9
- package/dist/CarouselInput/Carousel.cjs +4 -4
- package/dist/CarouselInput/Carousel.js +8 -9
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +32 -33
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +26 -29
- package/dist/Flex/Flex.cjs +5 -5
- package/dist/Flex/Flex.js +29 -17
- package/dist/Icon/Icon.cjs +3 -3
- package/dist/Icon/Icon.js +23 -19
- package/dist/JSONInput/JSONInput.cjs +1 -0
- package/dist/JSONInput/JSONInput.js +97 -0
- package/dist/JSONInput/JSONInputContainer.cjs +30 -0
- package/dist/JSONInput/JSONInputContainer.js +36 -0
- package/dist/JSONInput/index.cjs +1 -0
- package/dist/JSONInput/index.js +4 -0
- package/dist/JSONInput/utils/decorationExtension.cjs +1 -0
- package/dist/JSONInput/utils/decorationExtension.js +24 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +44 -49
- package/dist/Link/Link.cjs +5 -5
- package/dist/Link/Link.js +1 -1
- package/dist/LiveRegions/LiveRegions.cjs +1 -1
- package/dist/LiveRegions/LiveRegions.js +22 -20
- package/dist/LiveRegions/index.cjs +1 -1
- package/dist/LiveRegions/index.js +4 -2
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +1 -2
- package/dist/MainNav/NavSections.cjs +3 -3
- package/dist/MainNav/NavSections.js +5 -5
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +1 -1
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +1 -1
- package/dist/Pagination/components.cjs +6 -6
- package/dist/Pagination/components.js +16 -17
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +7 -8
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +4 -5
- package/dist/Select/SelectTags.cjs +3 -3
- package/dist/Select/SelectTags.js +1 -1
- package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/Stack/Stack.cjs +5 -5
- package/dist/Stack/Stack.js +33 -33
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +1 -1
- package/dist/SubNav/SubNavLink.cjs +4 -4
- package/dist/SubNav/SubNavLink.js +4 -4
- package/dist/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/SubNav/SubNavLinkSection.js +1 -1
- package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/SubNav/SubNavSectionLabel.js +1 -1
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +51 -50
- package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/ThemeProvider/ThemeProvider.js +12 -11
- package/dist/TimePicker/TimePicker.cjs +2 -2
- package/dist/TimePicker/TimePicker.js +1 -1
- package/dist/Typography/Typography.cjs +7 -7
- package/dist/Typography/Typography.js +28 -17
- package/dist/Typography/utils.cjs +2 -2
- package/dist/Typography/utils.js +6 -6
- package/dist/helpers/arrays.cjs +1 -0
- package/dist/helpers/arrays.js +6 -0
- package/dist/helpers/handleResponsiveValues.cjs +1 -5
- package/dist/helpers/handleResponsiveValues.js +21 -15
- package/dist/helpers/objects.cjs +1 -0
- package/dist/helpers/objects.js +26 -0
- package/dist/helpers/setOpacity.cjs +1 -1
- package/dist/helpers/setOpacity.js +1 -1
- package/dist/helpers/theme.cjs +1 -0
- package/dist/helpers/theme.js +7 -0
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +8 -8
- package/dist/hooks/useControllableState.cjs +1 -1
- package/dist/hooks/useControllableState.js +13 -16
- package/dist/index.cjs +1 -1
- package/dist/index.js +205 -201
- package/dist/themes/extendTheme.cjs +4 -4
- package/dist/themes/extendTheme.js +13 -21
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +1 -1
- package/dist/v2/Link/Link.cjs +4 -4
- package/dist/v2/Link/Link.js +1 -1
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +1 -2
- package/dist/v2/MainNav/NavSections.cjs +3 -3
- package/dist/v2/MainNav/NavSections.js +5 -5
- package/dist/v2/Pagination/components.cjs +7 -7
- package/dist/v2/Pagination/components.js +18 -19
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/v2/SimpleMenu/SimpleMenu.js +96 -89
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +1 -1
- package/dist/v2/SubNav/SubNavLink.cjs +4 -4
- package/dist/v2/SubNav/SubNavLink.js +1 -1
- package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/v2/SubNav/SubNavLinkSection.js +1 -1
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/v2/SubNav/SubNavSectionLabel.js +1 -1
- package/package.json +18 -15
- package/dist/Box/BoxProps.cjs +0 -1
- package/dist/Box/BoxProps.js +0 -51
- package/dist/Flex/FlexProps.cjs +0 -1
- package/dist/Flex/FlexProps.js +0 -41
- package/dist/FocusTrap/ExampleComponent.cjs +0 -1
- package/dist/FocusTrap/ExampleComponent.js +0 -71
- package/dist/LiveRegions/StoryComponent.cjs +0 -1
- package/dist/LiveRegions/StoryComponent.js +0 -18
- package/dist/Typography/TypographyProps.cjs +0 -1
- package/dist/Typography/TypographyProps.js +0 -31
- package/dist/themes/ColorButton.cjs +0 -3
- package/dist/themes/ColorButton.js +0 -25
- package/dist/themes/colors.cjs +0 -1
- package/dist/themes/colors.js +0 -49
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),d=require("styled-components"),u=require("@strapi/icons"),t=require("../Typography/Typography.cjs"),s=require("../Box/Box.cjs"),i=require("../Flex/Flex.cjs"),c=require("../VisuallyHidden/VisuallyHidden.cjs"),p=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},y=p(d),h=y.default(i.Flex)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${10/16}rem;
|
|
4
4
|
width: ${10/16}rem;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
:last-of-type ${s.Box} {
|
|
10
10
|
display: none;
|
|
11
11
|
}
|
|
12
|
-
:last-of-type ${
|
|
12
|
+
:last-of-type ${t.Typography} {
|
|
13
13
|
color: ${({theme:e})=>e.colors.neutral800};
|
|
14
14
|
font-weight: ${({theme:e})=>e.fontWeights.bold};
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,l=({children:e})=>r.jsxs(h,{inline:!0,as:"li",children:[r.jsx(t.Typography,{variant:"pi",textColor:"neutral600",children:e}),r.jsx(s.Box,{"aria-hidden":!0,paddingLeft:3,paddingRight:3,children:r.jsx(u.ChevronRight,{})})]});l.displayName="Crumb";const o=({children:e,label:n,...a})=>r.jsxs(i.Flex,{...a,children:[r.jsx(c.VisuallyHidden,{children:n}),r.jsx("ol",{"aria-hidden":!0,children:e})]});o.displayName="Breadcrumbs";exports.Breadcrumbs=o;exports.Crumb=l;
|
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "prop-types";
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
2
|
import d from "styled-components";
|
|
4
|
-
import
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { Box as
|
|
7
|
-
import { Flex as
|
|
8
|
-
import { VisuallyHidden as
|
|
9
|
-
const
|
|
3
|
+
import { ChevronRight as m } from "@strapi/icons";
|
|
4
|
+
import { Typography as o } from "../Typography/Typography.js";
|
|
5
|
+
import { Box as t } from "../Box/Box.js";
|
|
6
|
+
import { Flex as l } from "../Flex/Flex.js";
|
|
7
|
+
import { VisuallyHidden as p } from "../VisuallyHidden/VisuallyHidden.js";
|
|
8
|
+
const s = d(l)`
|
|
10
9
|
svg {
|
|
11
10
|
height: ${10 / 16}rem;
|
|
12
11
|
width: ${10 / 16}rem;
|
|
13
12
|
path {
|
|
14
|
-
fill: ${({
|
|
13
|
+
fill: ${({
|
|
14
|
+
theme: r
|
|
15
|
+
}) => r.colors.neutral500};
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
:last-of-type ${
|
|
18
|
+
:last-of-type ${t} {
|
|
18
19
|
display: none;
|
|
19
20
|
}
|
|
20
|
-
:last-of-type ${
|
|
21
|
-
color: ${({
|
|
22
|
-
|
|
21
|
+
:last-of-type ${o} {
|
|
22
|
+
color: ${({
|
|
23
|
+
theme: r
|
|
24
|
+
}) => r.colors.neutral800};
|
|
25
|
+
font-weight: ${({
|
|
26
|
+
theme: r
|
|
27
|
+
}) => r.fontWeights.bold};
|
|
23
28
|
}
|
|
24
|
-
`,
|
|
29
|
+
`, h = ({
|
|
30
|
+
children: r
|
|
31
|
+
}) => i(s, {
|
|
25
32
|
inline: !0,
|
|
26
|
-
as: "li"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
p
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
as: "li",
|
|
34
|
+
children: [e(o, {
|
|
35
|
+
variant: "pi",
|
|
36
|
+
textColor: "neutral600",
|
|
37
|
+
children: r
|
|
38
|
+
}), e(t, {
|
|
39
|
+
"aria-hidden": !0,
|
|
40
|
+
paddingLeft: 3,
|
|
41
|
+
paddingRight: 3,
|
|
42
|
+
children: e(m, {})
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
h.displayName = "Crumb";
|
|
46
|
+
const c = ({
|
|
47
|
+
children: r,
|
|
48
|
+
label: n,
|
|
49
|
+
...a
|
|
50
|
+
}) => i(l, {
|
|
51
|
+
...a,
|
|
52
|
+
children: [e(p, {
|
|
53
|
+
children: n
|
|
54
|
+
}), e("ol", {
|
|
55
|
+
"aria-hidden": !0,
|
|
56
|
+
children: r
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
c.displayName = "Breadcrumbs";
|
|
49
60
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
c as Breadcrumbs,
|
|
62
|
+
h as Crumb
|
|
52
63
|
};
|
package/dist/Button/Button.cjs
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),f=require("styled-components"),q=require("@strapi/icons"),p=require("../Typography/Typography.cjs"),s=require("../Box/Box.cjs"),T=require("../BaseButton/BaseButton.cjs"),r=require("./utils.cjs"),u=require("./constants.cjs"),g=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},_=g(S),n=g(f),D=f.keyframes`
|
|
2
2
|
from {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
5
5
|
to {
|
|
6
6
|
transform: rotate(359deg);
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
9
|
-
animation: ${
|
|
8
|
+
`,L=n.default.div`
|
|
9
|
+
animation: ${D} 2s infinite linear;
|
|
10
10
|
will-change: transform;
|
|
11
|
-
`,
|
|
11
|
+
`,R=n.default(s.Box)`
|
|
12
12
|
height: 100%;
|
|
13
|
-
`,
|
|
13
|
+
`,y=n.default(T.BaseButton)`
|
|
14
14
|
align-items: center;
|
|
15
|
-
background-color: ${({theme:
|
|
16
|
-
border: 1px solid ${({theme:
|
|
17
|
-
height: ${({theme:
|
|
18
|
-
padding-left: ${({theme:
|
|
19
|
-
padding-right: ${({theme:
|
|
15
|
+
background-color: ${({theme:t})=>t.colors.buttonPrimary600};
|
|
16
|
+
border: 1px solid ${({theme:t})=>t.colors.buttonPrimary600};
|
|
17
|
+
height: ${({theme:t,size:i})=>t.sizes.button[i]};
|
|
18
|
+
padding-left: ${({theme:t})=>t.spaces[4]};
|
|
19
|
+
padding-right: ${({theme:t})=>t.spaces[4]};
|
|
20
20
|
|
|
21
|
-
${
|
|
21
|
+
${s.Box} {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
${
|
|
27
|
-
color: ${({theme:
|
|
26
|
+
${p.Typography} {
|
|
27
|
+
color: ${({theme:t})=>t.colors.buttonNeutral0};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&[aria-disabled='true'] {
|
|
31
|
-
${
|
|
31
|
+
${r.getDisabledStyle}
|
|
32
32
|
&:active {
|
|
33
|
-
${
|
|
33
|
+
${r.getDisabledStyle}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
&:hover {
|
|
37
|
-
${
|
|
37
|
+
${r.getHoverStyle}
|
|
38
38
|
}
|
|
39
39
|
&:active {
|
|
40
|
-
${
|
|
40
|
+
${r.getActiveStyle}
|
|
41
41
|
}
|
|
42
|
-
${
|
|
43
|
-
${({fullWidth:
|
|
42
|
+
${r.getVariantStyle}
|
|
43
|
+
${({fullWidth:t})=>t&&`
|
|
44
44
|
display: inline-flex;
|
|
45
45
|
justify-content: center;
|
|
46
46
|
width: 100%;
|
|
47
47
|
`}
|
|
48
|
-
`,
|
|
48
|
+
`,h=_.default.forwardRef(({variant:t=u.DEFAULT,startIcon:i,endIcon:l,disabled:B=!1,children:x,onClick:c,size:d=u.BUTTON_SIZES[0],loading:a=!1,fullWidth:b=!1,...j},m)=>{const o=B||a,$=v=>{!o&&c&&c(v)};return e.jsxs(y,{ref:m,"aria-disabled":o,disabled:o,size:d,variant:t,onClick:$,fullWidth:b,...j,children:[(i||a)&&e.jsx(R,{"aria-hidden":!0,paddingRight:2,children:a?e.jsx(L,{children:e.jsx(q.Loader,{})}):i}),e.jsx(p.Typography,{variant:d==="S"?"pi":void 0,fontWeight:"bold",lineHeight:0,children:x}),l&&e.jsx(s.Box,{"aria-hidden":!0,paddingLeft:2,children:l})]})});h.displayName="Button";exports.Button=h;exports.ButtonWrapper=y;
|
package/dist/Button/Button.js
CHANGED
|
@@ -1,39 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { Box as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import b from "react";
|
|
3
|
+
import a, { keyframes as v } from "styled-components";
|
|
4
|
+
import { Loader as x } from "@strapi/icons";
|
|
5
|
+
import { Typography as c } from "../Typography/Typography.js";
|
|
6
|
+
import { Box as n } from "../Box/Box.js";
|
|
7
|
+
import { BaseButton as B } from "../BaseButton/BaseButton.js";
|
|
8
|
+
import { getDisabledStyle as f, getHoverStyle as S, getActiveStyle as k, getVariantStyle as L } from "./utils.js";
|
|
9
|
+
import { DEFAULT as T, BUTTON_SIZES as W } from "./constants.js";
|
|
10
|
+
const j = v`
|
|
11
11
|
from {
|
|
12
12
|
transform: rotate(0deg);
|
|
13
13
|
}
|
|
14
14
|
to {
|
|
15
15
|
transform: rotate(359deg);
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
18
|
-
animation: ${
|
|
17
|
+
`, w = a.div`
|
|
18
|
+
animation: ${j} 2s infinite linear;
|
|
19
19
|
will-change: transform;
|
|
20
|
-
`,
|
|
20
|
+
`, D = a(n)`
|
|
21
21
|
height: 100%;
|
|
22
|
-
`,
|
|
22
|
+
`, H = a(B)`
|
|
23
23
|
align-items: center;
|
|
24
|
-
background-color: ${({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
background-color: ${({
|
|
25
|
+
theme: t
|
|
26
|
+
}) => t.colors.buttonPrimary600};
|
|
27
|
+
border: 1px solid ${({
|
|
28
|
+
theme: t
|
|
29
|
+
}) => t.colors.buttonPrimary600};
|
|
30
|
+
height: ${({
|
|
31
|
+
theme: t,
|
|
32
|
+
size: r
|
|
33
|
+
}) => t.sizes.button[r]};
|
|
34
|
+
padding-left: ${({
|
|
35
|
+
theme: t
|
|
36
|
+
}) => t.spaces[4]};
|
|
37
|
+
padding-right: ${({
|
|
38
|
+
theme: t
|
|
39
|
+
}) => t.spaces[4]};
|
|
29
40
|
|
|
30
|
-
${
|
|
41
|
+
${n} {
|
|
31
42
|
display: flex;
|
|
32
43
|
align-items: center;
|
|
33
44
|
}
|
|
34
45
|
|
|
35
|
-
${
|
|
36
|
-
color: ${({
|
|
46
|
+
${c} {
|
|
47
|
+
color: ${({
|
|
48
|
+
theme: t
|
|
49
|
+
}) => t.colors.buttonNeutral0};
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
&[aria-disabled='true'] {
|
|
@@ -43,67 +56,63 @@ const I = S`
|
|
|
43
56
|
}
|
|
44
57
|
}
|
|
45
58
|
&:hover {
|
|
46
|
-
${
|
|
59
|
+
${S}
|
|
47
60
|
}
|
|
48
61
|
&:active {
|
|
49
|
-
${
|
|
62
|
+
${k}
|
|
50
63
|
}
|
|
51
|
-
${
|
|
52
|
-
${({
|
|
64
|
+
${L}
|
|
65
|
+
${({
|
|
66
|
+
fullWidth: t
|
|
67
|
+
}) => t && `
|
|
53
68
|
display: inline-flex;
|
|
54
69
|
justify-content: center;
|
|
55
70
|
width: 100%;
|
|
56
71
|
`}
|
|
57
|
-
`,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
`, N = b.forwardRef(({
|
|
73
|
+
variant: t = T,
|
|
74
|
+
startIcon: r,
|
|
75
|
+
endIcon: l,
|
|
76
|
+
disabled: m = !1,
|
|
77
|
+
children: p,
|
|
78
|
+
onClick: d,
|
|
79
|
+
size: s = W[0],
|
|
80
|
+
loading: i = !1,
|
|
81
|
+
fullWidth: h = !1,
|
|
82
|
+
...g
|
|
83
|
+
}, u) => {
|
|
84
|
+
const o = m || i;
|
|
85
|
+
return y(H, {
|
|
86
|
+
ref: u,
|
|
87
|
+
"aria-disabled": o,
|
|
88
|
+
disabled: o,
|
|
89
|
+
size: s,
|
|
90
|
+
variant: t,
|
|
91
|
+
onClick: ($) => {
|
|
92
|
+
!o && d && d($);
|
|
93
|
+
},
|
|
94
|
+
fullWidth: h,
|
|
95
|
+
...g,
|
|
96
|
+
children: [(r || i) && e(D, {
|
|
72
97
|
"aria-hidden": !0,
|
|
73
|
-
paddingRight: 2
|
|
74
|
-
|
|
75
|
-
|
|
98
|
+
paddingRight: 2,
|
|
99
|
+
children: i ? e(w, {
|
|
100
|
+
children: e(x, {})
|
|
101
|
+
}) : r
|
|
102
|
+
}), e(c, {
|
|
103
|
+
variant: s === "S" ? "pi" : void 0,
|
|
76
104
|
fontWeight: "bold",
|
|
77
|
-
lineHeight: 0
|
|
78
|
-
|
|
105
|
+
lineHeight: 0,
|
|
106
|
+
children: p
|
|
107
|
+
}), l && e(n, {
|
|
79
108
|
"aria-hidden": !0,
|
|
80
|
-
paddingLeft: 2
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
disabled: !1,
|
|
87
|
-
endIcon: void 0,
|
|
88
|
-
fullWidth: !1,
|
|
89
|
-
loading: !1,
|
|
90
|
-
onClick: void 0,
|
|
91
|
-
size: "S",
|
|
92
|
-
startIcon: void 0,
|
|
93
|
-
variant: "default"
|
|
94
|
-
};
|
|
95
|
-
d.propTypes = {
|
|
96
|
-
children: t.node.isRequired,
|
|
97
|
-
disabled: t.bool,
|
|
98
|
-
endIcon: t.element,
|
|
99
|
-
fullWidth: t.bool,
|
|
100
|
-
loading: t.bool,
|
|
101
|
-
onClick: t.func,
|
|
102
|
-
size: t.oneOf(k),
|
|
103
|
-
startIcon: t.element,
|
|
104
|
-
variant: t.oneOf(R)
|
|
105
|
-
};
|
|
109
|
+
paddingLeft: 2,
|
|
110
|
+
children: l
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
N.displayName = "Button";
|
|
106
115
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
116
|
+
N as Button,
|
|
117
|
+
H as ButtonWrapper
|
|
109
118
|
};
|
package/dist/Button/utils.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../Typography/Typography.cjs"),l=require("./constants.cjs"),s=o=>o===l.SUCCESS_LIGHT||o===l.DANGER_LIGHT?`${o.substring(0,o.lastIndexOf("-"))}600`:o===l.TERTIARY?"neutral":o===l.DEFAULT||o===l.SECONDARY||l.VARIANTS.every(r=>r!==o)?"primary":`${o}`,u=({theme:o})=>`
|
|
2
2
|
border: 1px solid ${o.colors.neutral200};
|
|
3
3
|
background: ${o.colors.neutral150};
|
|
4
|
-
${
|
|
4
|
+
${c.Typography} {
|
|
5
5
|
color: ${o.colors.neutral600};
|
|
6
6
|
}
|
|
7
7
|
svg {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
fill: ${o.colors.neutral600};
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
`,$=({theme:o,variant:r})=>[...l.LIGHT_VARIANTS,l.SECONDARY].includes(r)?`
|
|
13
13
|
background-color: ${o.colors.neutral0};
|
|
14
14
|
`:r===l.TERTIARY?`
|
|
15
15
|
background-color: ${o.colors.neutral100};
|
|
@@ -19,39 +19,39 @@
|
|
|
19
19
|
border: 1px solid ${o.colors.buttonPrimary500};
|
|
20
20
|
background: ${o.colors.buttonPrimary500};
|
|
21
21
|
`:`
|
|
22
|
-
border: 1px solid ${o.colors[`${
|
|
23
|
-
background: ${o.colors[`${
|
|
24
|
-
|
|
22
|
+
border: 1px solid ${o.colors[`${s(r)}500`]};
|
|
23
|
+
background: ${o.colors[`${s(r)}500`]};
|
|
24
|
+
`,n=({theme:o,variant:r})=>[...l.LIGHT_VARIANTS,l.SECONDARY].includes(r)?`
|
|
25
25
|
background-color: ${o.colors.neutral0};
|
|
26
|
-
border: 1px solid ${o.colors[`${
|
|
27
|
-
${
|
|
28
|
-
color: ${o.colors[`${
|
|
26
|
+
border: 1px solid ${o.colors[`${s(r)}600`]};
|
|
27
|
+
${c.Typography} {
|
|
28
|
+
color: ${o.colors[`${s(r)}600`]};
|
|
29
29
|
}
|
|
30
30
|
svg {
|
|
31
31
|
> g, path {
|
|
32
|
-
fill: ${o.colors[`${
|
|
32
|
+
fill: ${o.colors[`${s(r)}600`]};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
`:r===l.TERTIARY?`
|
|
36
36
|
background-color: ${o.colors.neutral150};
|
|
37
37
|
`:`
|
|
38
|
-
border: 1px solid ${o.colors[`${
|
|
39
|
-
background: ${o.colors[`${
|
|
38
|
+
border: 1px solid ${o.colors[`${s(r)}600`]};
|
|
39
|
+
background: ${o.colors[`${s(r)}600`]};
|
|
40
40
|
`,e=({theme:o,variant:r})=>{switch(r){case l.DANGER_LIGHT:case l.SUCCESS_LIGHT:case l.SECONDARY:return`
|
|
41
|
-
border: 1px solid ${o.colors[`${
|
|
42
|
-
background: ${o.colors[`${
|
|
43
|
-
${
|
|
44
|
-
color: ${o.colors[`${
|
|
41
|
+
border: 1px solid ${o.colors[`${s(r)}200`]};
|
|
42
|
+
background: ${o.colors[`${s(r)}100`]};
|
|
43
|
+
${c.Typography} {
|
|
44
|
+
color: ${o.colors[`${s(r)}700`]};
|
|
45
45
|
}
|
|
46
46
|
svg {
|
|
47
47
|
> g, path {
|
|
48
|
-
fill: ${o.colors[`${
|
|
48
|
+
fill: ${o.colors[`${s(r)}700`]};
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
`;case l.TERTIARY:return`
|
|
52
52
|
border: 1px solid ${o.colors.neutral200};
|
|
53
53
|
background: ${o.colors.neutral0};
|
|
54
|
-
${
|
|
54
|
+
${c.Typography} {
|
|
55
55
|
color: ${o.colors.neutral800};
|
|
56
56
|
}
|
|
57
57
|
svg {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
border: 1px solid transparent;
|
|
64
64
|
background: transparent;
|
|
65
65
|
|
|
66
|
-
${
|
|
66
|
+
${c.Typography} {
|
|
67
67
|
color: ${o.colors.neutral800};
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
`;case l.SUCCESS:case l.DANGER:return`
|
|
76
|
-
border: 1px solid ${o.colors[`${
|
|
77
|
-
background: ${o.colors[`${
|
|
78
|
-
${
|
|
76
|
+
border: 1px solid ${o.colors[`${s(r)}600`]};
|
|
77
|
+
background: ${o.colors[`${s(r)}600`]};
|
|
78
|
+
${c.Typography} {
|
|
79
79
|
color: ${o.colors.neutral0};
|
|
80
80
|
}
|
|
81
81
|
`;default:return`
|
|
@@ -84,4 +84,4 @@
|
|
|
84
84
|
fill: ${o.colors.buttonNeutral0};
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
`}};exports.getActiveStyle
|
|
87
|
+
`}};exports.getActiveStyle=n;exports.getDisabledStyle=u;exports.getHoverStyle=$;exports.getVariantColorName=s;exports.getVariantStyle=e;
|
package/dist/Button/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Typography as c } from "../Typography/Typography.js";
|
|
2
|
-
import {
|
|
3
|
-
const l = (o) =>
|
|
2
|
+
import { SUCCESS_LIGHT as $, DANGER_LIGHT as n, TERTIARY as s, DEFAULT as d, SECONDARY as u, VARIANTS as p, LIGHT_VARIANTS as g, GHOST as b, DANGER as t, SUCCESS as e } from "./constants.js";
|
|
3
|
+
const l = (o) => o === $ || o === n ? `${o.substring(0, o.lastIndexOf("-"))}600` : o === s ? "neutral" : o === d || o === u || p.every((r) => r !== o) ? "primary" : `${o}`, k = ({ theme: o }) => `
|
|
4
4
|
border: 1px solid ${o.colors.neutral200};
|
|
5
5
|
background: ${o.colors.neutral150};
|
|
6
6
|
${c} {
|
|
@@ -11,19 +11,19 @@ const l = (o) => $.includes(o) ? o.substring(0, o.lastIndexOf("-")) : o === s ?
|
|
|
11
11
|
fill: ${o.colors.neutral600};
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`, i = ({ theme: o, variant: r }) => [...g, u].includes(r) ? `
|
|
15
15
|
background-color: ${o.colors.neutral0};
|
|
16
16
|
` : r === s ? `
|
|
17
17
|
background-color: ${o.colors.neutral100};
|
|
18
|
-
` : r ===
|
|
18
|
+
` : r === b ? `
|
|
19
19
|
background-color: ${o.colors.neutral100};
|
|
20
|
-
` : r ===
|
|
20
|
+
` : r === d ? `
|
|
21
21
|
border: 1px solid ${o.colors.buttonPrimary500};
|
|
22
22
|
background: ${o.colors.buttonPrimary500};
|
|
23
23
|
` : `
|
|
24
24
|
border: 1px solid ${o.colors[`${l(r)}500`]};
|
|
25
25
|
background: ${o.colors[`${l(r)}500`]};
|
|
26
|
-
`,
|
|
26
|
+
`, x = ({ theme: o, variant: r }) => [...g, u].includes(r) ? `
|
|
27
27
|
background-color: ${o.colors.neutral0};
|
|
28
28
|
border: 1px solid ${o.colors[`${l(r)}600`]};
|
|
29
29
|
${c} {
|
|
@@ -39,10 +39,10 @@ const l = (o) => $.includes(o) ? o.substring(0, o.lastIndexOf("-")) : o === s ?
|
|
|
39
39
|
` : `
|
|
40
40
|
border: 1px solid ${o.colors[`${l(r)}600`]};
|
|
41
41
|
background: ${o.colors[`${l(r)}600`]};
|
|
42
|
-
`,
|
|
42
|
+
`, a = ({ theme: o, variant: r }) => {
|
|
43
43
|
switch (r) {
|
|
44
|
-
case
|
|
45
|
-
case
|
|
44
|
+
case n:
|
|
45
|
+
case $:
|
|
46
46
|
case u:
|
|
47
47
|
return `
|
|
48
48
|
border: 1px solid ${o.colors[`${l(r)}200`]};
|
|
@@ -69,7 +69,7 @@ const l = (o) => $.includes(o) ? o.substring(0, o.lastIndexOf("-")) : o === s ?
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
`;
|
|
72
|
-
case
|
|
72
|
+
case b:
|
|
73
73
|
return `
|
|
74
74
|
border: 1px solid transparent;
|
|
75
75
|
background: transparent;
|
|
@@ -84,8 +84,8 @@ const l = (o) => $.includes(o) ? o.substring(0, o.lastIndexOf("-")) : o === s ?
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
`;
|
|
87
|
+
case e:
|
|
87
88
|
case t:
|
|
88
|
-
case b:
|
|
89
89
|
return `
|
|
90
90
|
border: 1px solid ${o.colors[`${l(r)}600`]};
|
|
91
91
|
background: ${o.colors[`${l(r)}600`]};
|
|
@@ -104,9 +104,9 @@ const l = (o) => $.includes(o) ? o.substring(0, o.lastIndexOf("-")) : o === s ?
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
x as getActiveStyle,
|
|
108
|
+
k as getDisabledStyle,
|
|
109
|
+
i as getHoverStyle,
|
|
110
110
|
l as getVariantColorName,
|
|
111
|
-
|
|
111
|
+
a as getVariantStyle
|
|
112
112
|
};
|
package/dist/Card/Card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("../Box/Box.cjs"),a=require("../helpers/useId.cjs"),s=require("./CardContext.cjs"),u=({id:e,...d})=>{const r=a.useId("card",e);return t.jsx(s.CardContext.Provider,{value:{id:r},children:t.jsx(o.Box,{id:e,tabIndex:0,hasRadius:!0,background:"neutral0",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",shadow:"tableShadow",as:"article","aria-labelledby":`${r}-title`,...d})})};exports.Card=u;
|
package/dist/Card/Card.js
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import d from "
|
|
3
|
-
import {
|
|
4
|
-
import { CardContext as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
id: d.string
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Box as d } from "../Box/Box.js";
|
|
3
|
+
import { useId as a } from "../helpers/useId.js";
|
|
4
|
+
import { CardContext as i } from "./CardContext.js";
|
|
5
|
+
const m = ({
|
|
6
|
+
id: r,
|
|
7
|
+
...t
|
|
8
|
+
}) => {
|
|
9
|
+
const e = a("card", r);
|
|
10
|
+
return o(i.Provider, {
|
|
11
|
+
value: {
|
|
12
|
+
id: e
|
|
13
|
+
},
|
|
14
|
+
children: o(d, {
|
|
15
|
+
id: r,
|
|
16
|
+
tabIndex: 0,
|
|
17
|
+
hasRadius: !0,
|
|
18
|
+
background: "neutral0",
|
|
19
|
+
borderStyle: "solid",
|
|
20
|
+
borderWidth: "1px",
|
|
21
|
+
borderColor: "neutral150",
|
|
22
|
+
shadow: "tableShadow",
|
|
23
|
+
as: "article",
|
|
24
|
+
"aria-labelledby": `${e}-title`,
|
|
25
|
+
...t
|
|
26
|
+
})
|
|
27
|
+
});
|
|
29
28
|
};
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
m as Card
|
|
32
31
|
};
|
package/dist/Card/CardAction.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("styled-components"),r=require("../Stack/Stack.cjs"),s=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},a=s(n),o=a.default(r.Stack).attrs({horizontal:!0,spacing:2})`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: ${({theme:t})=>t.spaces[3]};
|
|
4
|
-
right: ${({position:t,theme:e})=>t==="end"
|
|
5
|
-
left: ${({position:t,theme:e})=>t==="start"
|
|
6
|
-
`;exports.CardAction=
|
|
4
|
+
right: ${({position:t,theme:e})=>{if(t==="end")return e.spaces[3]}};
|
|
5
|
+
left: ${({position:t,theme:e})=>{if(t==="start")return e.spaces[3]}};
|
|
6
|
+
`;exports.CardAction=o;
|