@strapi/design-system 1.5.0 → 1.6.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
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as p, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d } from "react";
|
|
3
|
+
import o from "styled-components";
|
|
4
|
+
import { Typography as c } from "../Typography/Typography.js";
|
|
5
|
+
import { Flex as h } from "../Flex/Flex.js";
|
|
6
|
+
import { avatarSize as e, previewSize as s } from "./constants.js";
|
|
7
|
+
const m = o.img`
|
|
8
8
|
border-radius: 50%;
|
|
9
9
|
object-fit: cover;
|
|
10
10
|
display: block;
|
|
11
11
|
position: relative;
|
|
12
|
-
`,
|
|
12
|
+
`, u = o.div`
|
|
13
13
|
position: relative;
|
|
14
|
-
width: ${
|
|
15
|
-
height: ${
|
|
16
|
-
z-index: ${({
|
|
17
|
-
|
|
14
|
+
width: ${e / 16}rem;
|
|
15
|
+
height: ${e / 16}rem;
|
|
16
|
+
z-index: ${({
|
|
17
|
+
hovering: t
|
|
18
|
+
}) => t ? 1 : void 0};
|
|
19
|
+
`, f = o.img`
|
|
18
20
|
border-radius: 50%;
|
|
19
21
|
object-fit: cover;
|
|
20
22
|
position: absolute;
|
|
21
|
-
transform: translate(-${(
|
|
22
|
-
margin-top: -${({
|
|
23
|
-
|
|
23
|
+
transform: translate(-${(s - e) / 2}px, -100%);
|
|
24
|
+
margin-top: -${({
|
|
25
|
+
theme: t
|
|
26
|
+
}) => t.spaces[1]};
|
|
27
|
+
`, g = o.div`
|
|
24
28
|
z-index: 1;
|
|
25
29
|
border-radius: 30%;
|
|
26
30
|
position: absolute;
|
|
27
|
-
width: ${
|
|
28
|
-
height: ${
|
|
29
|
-
background: ${({
|
|
31
|
+
width: ${e / 16}rem;
|
|
32
|
+
height: ${e / 16}rem;
|
|
33
|
+
background: ${({
|
|
34
|
+
theme: t
|
|
35
|
+
}) => t.colors.neutral0};
|
|
30
36
|
opacity: 0.4;
|
|
31
|
-
`,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
`, z = ({
|
|
38
|
+
src: t,
|
|
39
|
+
alt: n,
|
|
40
|
+
preview: r
|
|
41
|
+
}) => {
|
|
42
|
+
const [a, l] = d(!1);
|
|
43
|
+
return p("span", {
|
|
44
|
+
children: [r && a ? i(f, {
|
|
45
|
+
"aria-hidden": !0,
|
|
46
|
+
alt: "",
|
|
47
|
+
width: `${s}px`,
|
|
48
|
+
height: `${s}px`,
|
|
49
|
+
src: r === !0 ? t : r
|
|
50
|
+
}) : null, p(u, {
|
|
51
|
+
hovering: Boolean(r && a),
|
|
52
|
+
onMouseEnter: () => l(!0),
|
|
53
|
+
onMouseLeave: () => l(!1),
|
|
54
|
+
children: [r && a ? i(g, {}) : null, i(m, {
|
|
55
|
+
src: t,
|
|
56
|
+
alt: n,
|
|
57
|
+
width: `${e}px`,
|
|
58
|
+
height: `${e}px`
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}, b = o(h)`
|
|
50
63
|
span {
|
|
51
64
|
line-height: 0;
|
|
52
65
|
}
|
|
53
|
-
`,
|
|
66
|
+
`, I = ({
|
|
67
|
+
children: t,
|
|
68
|
+
background: n = "primary600",
|
|
69
|
+
textColor: r = "buttonNeutral0"
|
|
70
|
+
}) => i(b, {
|
|
54
71
|
background: n,
|
|
55
72
|
borderRadius: "50%",
|
|
56
|
-
width: `${
|
|
57
|
-
height: `${
|
|
58
|
-
justifyContent: "center"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
textColor: "buttonNeutral0"
|
|
68
|
-
};
|
|
69
|
-
c.propTypes = {
|
|
70
|
-
background: r.string,
|
|
71
|
-
children: r.node.isRequired,
|
|
72
|
-
textColor: r.string
|
|
73
|
-
};
|
|
74
|
-
d.defaultProps = {
|
|
75
|
-
alt: void 0,
|
|
76
|
-
preview: void 0
|
|
77
|
-
};
|
|
78
|
-
d.propTypes = {
|
|
79
|
-
alt: r.string,
|
|
80
|
-
preview: r.oneOfType([r.string, r.bool]),
|
|
81
|
-
src: r.string.isRequired
|
|
82
|
-
};
|
|
73
|
+
width: `${e}px`,
|
|
74
|
+
height: `${e}px`,
|
|
75
|
+
justifyContent: "center",
|
|
76
|
+
children: i(c, {
|
|
77
|
+
fontSize: 0,
|
|
78
|
+
fontWeight: "bold",
|
|
79
|
+
textColor: r,
|
|
80
|
+
textTransform: "uppercase",
|
|
81
|
+
children: t
|
|
82
|
+
})
|
|
83
|
+
});
|
|
83
84
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
z as Avatar,
|
|
86
|
+
I as Initials
|
|
86
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=32,t=64;exports.avatarSize=e;exports.previewSize=t;
|
package/dist/Avatar/constants.js
CHANGED
package/dist/Badge/Badge.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
-
border-radius: ${({theme:e,size:
|
|
3
|
-
height: ${({size:e,theme:
|
|
4
|
-
`,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("styled-components"),u=require("../Flex/Flex.cjs"),c=require("../Typography/Typography.cjs"),g=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},p=g(l),y=p.default(u.Flex)`
|
|
2
|
+
border-radius: ${({theme:e,size:t})=>t==="S"?"2px":e.borderRadius};
|
|
3
|
+
height: ${({size:e,theme:t})=>t.sizes.badge[e]};
|
|
4
|
+
`,f=({active:e=!1,size:t="M",textColor:a="neutral600",backgroundColor:i="neutral150",children:s,minWidth:o=5,...d})=>{const r=t==="S"?1:2;return n.jsx(y,{inline:!0,alignItem:"center",justifyContent:"center",minWidth:o,paddingLeft:r,paddingRight:r,background:e?"primary200":i,size:t,...d,children:n.jsx(c.Typography,{variant:"sigma",textColor:e?"primary600":a,children:s})})};exports.Badge=f;
|
package/dist/Badge/Badge.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import i from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "styled-components";
|
|
3
|
+
import { Flex as s } from "../Flex/Flex.js";
|
|
4
|
+
import { Typography as g } from "../Typography/Typography.js";
|
|
5
|
+
const l = p(s)`
|
|
6
|
+
border-radius: ${({
|
|
7
|
+
theme: r,
|
|
8
|
+
size: e
|
|
9
|
+
}) => e === "S" ? "2px" : r.borderRadius};
|
|
10
|
+
height: ${({
|
|
11
|
+
size: r,
|
|
12
|
+
theme: e
|
|
13
|
+
}) => e.sizes.badge[r]};
|
|
14
|
+
`, y = ({
|
|
15
|
+
active: r = !1,
|
|
16
|
+
size: e = "M",
|
|
17
|
+
textColor: n = "neutral600",
|
|
18
|
+
backgroundColor: o = "neutral150",
|
|
19
|
+
children: a,
|
|
20
|
+
minWidth: d = 5,
|
|
21
|
+
...m
|
|
22
|
+
}) => {
|
|
23
|
+
const t = e === "S" ? 1 : 2;
|
|
24
|
+
return i(l, {
|
|
12
25
|
inline: !0,
|
|
13
26
|
alignItem: "center",
|
|
14
27
|
justifyContent: "center",
|
|
15
|
-
minWidth:
|
|
16
|
-
paddingLeft:
|
|
17
|
-
paddingRight:
|
|
18
|
-
background: r ? "primary200" :
|
|
19
|
-
size:
|
|
20
|
-
...
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
active: !1,
|
|
28
|
-
backgroundColor: "neutral150",
|
|
29
|
-
minWidth: 5,
|
|
30
|
-
size: "M",
|
|
31
|
-
textColor: "neutral600"
|
|
32
|
-
};
|
|
33
|
-
n.propTypes = {
|
|
34
|
-
active: e.bool,
|
|
35
|
-
backgroundColor: e.string,
|
|
36
|
-
children: e.oneOfType([e.number, e.string]).isRequired,
|
|
37
|
-
minWidth: e.number,
|
|
38
|
-
size: e.oneOf(["S", "M"]),
|
|
39
|
-
textColor: e.string
|
|
28
|
+
minWidth: d,
|
|
29
|
+
paddingLeft: t,
|
|
30
|
+
paddingRight: t,
|
|
31
|
+
background: r ? "primary200" : o,
|
|
32
|
+
size: e,
|
|
33
|
+
...m,
|
|
34
|
+
children: i(g, {
|
|
35
|
+
variant: "sigma",
|
|
36
|
+
textColor: r ? "primary600" : n,
|
|
37
|
+
children: a
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
40
|
};
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
y as Badge
|
|
43
43
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("react"),d=require("styled-components"),i=require("../themes/utils.cjs"),t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},c=t(l),p=t(d),s=p.default.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
padding: ${({theme:e})=>e.spaces[2]};
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
pointer-events: none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
${
|
|
23
|
-
`,
|
|
22
|
+
${i.buttonFocusStyle}
|
|
23
|
+
`,r=c.default.forwardRef(({disabled:e,children:o,...a},u)=>n.jsx(s,{ref:u,"aria-disabled":e,type:"button",disabled:e,...a,children:o}));r.displayName="BaseButton";exports.BaseButton=r;exports.BaseButtonWrapper=s;
|
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import d from "styled-components";
|
|
4
4
|
import { buttonFocusStyle as i } from "../themes/utils.js";
|
|
5
|
-
const
|
|
5
|
+
const n = d.button`
|
|
6
6
|
display: flex;
|
|
7
7
|
cursor: pointer;
|
|
8
|
-
padding: ${({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
border:
|
|
8
|
+
padding: ${({
|
|
9
|
+
theme: r
|
|
10
|
+
}) => r.spaces[2]};
|
|
11
|
+
border-radius: ${({
|
|
12
|
+
theme: r
|
|
13
|
+
}) => r.borderRadius};
|
|
14
|
+
background: ${({
|
|
15
|
+
theme: r
|
|
16
|
+
}) => r.colors.neutral0};
|
|
17
|
+
border: 1px solid ${({
|
|
18
|
+
theme: r
|
|
19
|
+
}) => r.colors.neutral200};
|
|
12
20
|
svg {
|
|
13
|
-
height: ${({
|
|
14
|
-
|
|
21
|
+
height: ${({
|
|
22
|
+
theme: r
|
|
23
|
+
}) => r.spaces[3]};
|
|
24
|
+
width: ${({
|
|
25
|
+
theme: r
|
|
26
|
+
}) => r.spaces[3]};
|
|
15
27
|
}
|
|
16
28
|
svg {
|
|
17
29
|
> g,
|
|
18
30
|
path {
|
|
19
|
-
fill: ${({
|
|
31
|
+
fill: ${({
|
|
32
|
+
theme: r
|
|
33
|
+
}) => r.colors.neutral0};
|
|
20
34
|
}
|
|
21
35
|
}
|
|
22
36
|
&[aria-disabled='true'] {
|
|
@@ -24,22 +38,20 @@ const l = p.button`
|
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
${i}
|
|
27
|
-
`,
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
`, l = a.forwardRef(({
|
|
42
|
+
disabled: r,
|
|
43
|
+
children: t,
|
|
44
|
+
...e
|
|
45
|
+
}, o) => s(n, {
|
|
46
|
+
ref: o,
|
|
47
|
+
"aria-disabled": r,
|
|
30
48
|
type: "button",
|
|
31
|
-
disabled:
|
|
32
|
-
...
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
disabled: !1
|
|
37
|
-
};
|
|
38
|
-
r.propTypes = {
|
|
39
|
-
children: t.node.isRequired,
|
|
40
|
-
disabled: t.bool
|
|
41
|
-
};
|
|
49
|
+
disabled: r,
|
|
50
|
+
...e,
|
|
51
|
+
children: t
|
|
52
|
+
}));
|
|
53
|
+
l.displayName = "BaseButton";
|
|
42
54
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
l as BaseButton,
|
|
56
|
+
n as BaseButtonWrapper
|
|
45
57
|
};
|
|
@@ -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("react/jsx-runtime"),a=require("react"),b=require("styled-components"),p=require("../Box/Box.cjs"),s=require("./utils.cjs"),k=require("./assets/checkmark.cjs"),h=require("./assets/checkmark-black.cjs"),f=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},x=f(b),g=x.default.input`
|
|
2
|
+
height: ${s.getCheckboxSize};
|
|
3
|
+
min-width: ${s.getCheckboxSize};
|
|
2
4
|
margin: 0;
|
|
3
|
-
height: ${n.getCheckboxSize};
|
|
4
|
-
min-width: ${n.getCheckboxSize};
|
|
5
5
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
6
6
|
border: 1px solid ${({theme:e})=>e.colors.neutral300};
|
|
7
7
|
-webkit-appearance: none;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
content: '';
|
|
17
17
|
display: block;
|
|
18
18
|
position: relative;
|
|
19
|
-
background: url(${
|
|
19
|
+
background: url(${k}) no-repeat no-repeat center center;
|
|
20
20
|
width: 10px;
|
|
21
21
|
height: 10px;
|
|
22
22
|
left: 50%;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&:disabled:after {
|
|
28
|
-
background: url(${
|
|
28
|
+
background: url(${h}) no-repeat no-repeat center center;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -59,4 +59,4 @@
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`,n=({indeterminate:e=!1,size:l="M",name:i,value:o=!1,onValueChange:t,...u})=>{const r=a.useRef(null);a.useEffect(()=>{r.current&&e?r.current.indeterminate=e:r.current.indeterminate=!1},[e]);const d=()=>{t&&t(!o)};return c.jsx(p.Box,{children:c.jsx(g,{size:l,checked:o,onChange:d,type:"checkbox",ref:r,name:i,...u})})};n.displayName="BaseCheckbox";exports.BaseCheckbox=n;
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Box as
|
|
5
|
-
import { getCheckboxSize as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useEffect as d } from "react";
|
|
3
|
+
import p from "styled-components";
|
|
4
|
+
import { Box as u } from "../Box/Box.js";
|
|
5
|
+
import { getCheckboxSize as c } from "./utils.js";
|
|
6
|
+
import b from "./assets/checkmark.js";
|
|
7
|
+
import m from "./assets/checkmark-black.js";
|
|
8
|
+
const f = p.input`
|
|
9
|
+
height: ${c};
|
|
10
|
+
min-width: ${c};
|
|
9
11
|
margin: 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
border: 1px solid ${({
|
|
12
|
+
border-radius: ${({
|
|
13
|
+
theme: r
|
|
14
|
+
}) => r.borderRadius};
|
|
15
|
+
border: 1px solid ${({
|
|
16
|
+
theme: r
|
|
17
|
+
}) => r.colors.neutral300};
|
|
14
18
|
-webkit-appearance: none;
|
|
15
|
-
background-color: ${({
|
|
19
|
+
background-color: ${({
|
|
20
|
+
theme: r
|
|
21
|
+
}) => r.colors.neutral0};
|
|
16
22
|
cursor: pointer;
|
|
17
23
|
|
|
18
24
|
&:checked {
|
|
19
|
-
background-color: ${({
|
|
20
|
-
|
|
25
|
+
background-color: ${({
|
|
26
|
+
theme: r
|
|
27
|
+
}) => r.colors.primary600};
|
|
28
|
+
border: 1px solid ${({
|
|
29
|
+
theme: r
|
|
30
|
+
}) => r.colors.primary600};
|
|
21
31
|
|
|
22
32
|
&:after {
|
|
23
33
|
content: '';
|
|
24
34
|
display: block;
|
|
25
35
|
position: relative;
|
|
26
|
-
background: url(${
|
|
36
|
+
background: url(${b}) no-repeat no-repeat center center;
|
|
27
37
|
width: 10px;
|
|
28
38
|
height: 10px;
|
|
29
39
|
left: 50%;
|
|
@@ -32,18 +42,26 @@ const g = b.input`
|
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
&:disabled:after {
|
|
35
|
-
background: url(${
|
|
45
|
+
background: url(${m}) no-repeat no-repeat center center;
|
|
36
46
|
}
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
&:disabled {
|
|
40
|
-
background-color: ${({
|
|
41
|
-
|
|
50
|
+
background-color: ${({
|
|
51
|
+
theme: r
|
|
52
|
+
}) => r.colors.neutral200};
|
|
53
|
+
border: 1px solid ${({
|
|
54
|
+
theme: r
|
|
55
|
+
}) => r.colors.neutral300};
|
|
42
56
|
}
|
|
43
57
|
|
|
44
58
|
&:indeterminate {
|
|
45
|
-
background-color: ${({
|
|
46
|
-
|
|
59
|
+
background-color: ${({
|
|
60
|
+
theme: r
|
|
61
|
+
}) => r.colors.primary600};
|
|
62
|
+
border: 1px solid ${({
|
|
63
|
+
theme: r
|
|
64
|
+
}) => r.colors.primary600};
|
|
47
65
|
|
|
48
66
|
&:after {
|
|
49
67
|
content: '';
|
|
@@ -52,54 +70,54 @@ const g = b.input`
|
|
|
52
70
|
color: white;
|
|
53
71
|
height: 2px;
|
|
54
72
|
width: 10px;
|
|
55
|
-
background-color: ${({
|
|
73
|
+
background-color: ${({
|
|
74
|
+
theme: r
|
|
75
|
+
}) => r.colors.neutral0};
|
|
56
76
|
left: 50%;
|
|
57
77
|
top: 50%;
|
|
58
78
|
transform: translateX(-50%) translateY(-50%);
|
|
59
79
|
}
|
|
60
80
|
|
|
61
81
|
&:disabled {
|
|
62
|
-
background-color: ${({
|
|
63
|
-
|
|
82
|
+
background-color: ${({
|
|
83
|
+
theme: r
|
|
84
|
+
}) => r.colors.neutral200};
|
|
85
|
+
border: 1px solid ${({
|
|
86
|
+
theme: r
|
|
87
|
+
}) => r.colors.neutral300};
|
|
64
88
|
&:after {
|
|
65
|
-
background-color: ${({
|
|
89
|
+
background-color: ${({
|
|
90
|
+
theme: r
|
|
91
|
+
}) => r.colors.neutral500};
|
|
66
92
|
}
|
|
67
93
|
}
|
|
68
94
|
}
|
|
69
|
-
`,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
size: "M",
|
|
94
|
-
value: !1
|
|
95
|
-
};
|
|
96
|
-
t.propTypes = {
|
|
97
|
-
indeterminate: r.bool,
|
|
98
|
-
name: r.string,
|
|
99
|
-
onValueChange: r.func,
|
|
100
|
-
size: r.oneOf(["M", "L"]),
|
|
101
|
-
value: r.bool
|
|
95
|
+
`, h = ({
|
|
96
|
+
indeterminate: r = !1,
|
|
97
|
+
size: n = "M",
|
|
98
|
+
name: l,
|
|
99
|
+
value: e = !1,
|
|
100
|
+
onValueChange: t,
|
|
101
|
+
...i
|
|
102
|
+
}) => {
|
|
103
|
+
const o = s(null);
|
|
104
|
+
return d(() => {
|
|
105
|
+
o.current && r ? o.current.indeterminate = r : o.current.indeterminate = !1;
|
|
106
|
+
}, [r]), a(u, {
|
|
107
|
+
children: a(f, {
|
|
108
|
+
size: n,
|
|
109
|
+
checked: e,
|
|
110
|
+
onChange: () => {
|
|
111
|
+
t && t(!e);
|
|
112
|
+
},
|
|
113
|
+
type: "checkbox",
|
|
114
|
+
ref: o,
|
|
115
|
+
name: l,
|
|
116
|
+
...i
|
|
117
|
+
})
|
|
118
|
+
});
|
|
102
119
|
};
|
|
120
|
+
h.displayName = "BaseCheckbox";
|
|
103
121
|
export {
|
|
104
|
-
|
|
122
|
+
h as BaseCheckbox
|
|
105
123
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
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("react/jsx-runtime"),f=require("react"),i=require("styled-components"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=a(f),_=a(i),p=_.default.a`
|
|
2
2
|
cursor: pointer;
|
|
3
|
-
`,
|
|
3
|
+
`,n=d.default.forwardRef(({href:e,rel:s="noreferrer noopener",target:o="_self",disabled:t=!1,isExternal:r=!1,...u},l)=>c.jsx(p,{ref:l,target:r?"_blank":o,rel:r?s:void 0,href:t?"#":e,"aria-disabled":t,...u}));n.displayName="BaseLink";exports.BaseLink=n;
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import l from "styled-components";
|
|
4
|
+
const m = l.a`
|
|
5
5
|
cursor: pointer;
|
|
6
|
-
`,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...
|
|
6
|
+
`, p = i.forwardRef(({
|
|
7
|
+
href: o,
|
|
8
|
+
rel: a = "noreferrer noopener",
|
|
9
|
+
target: f = "_self",
|
|
10
|
+
disabled: e = !1,
|
|
11
|
+
isExternal: r = !1,
|
|
12
|
+
...t
|
|
13
|
+
}, n) => s(m, {
|
|
14
|
+
ref: n,
|
|
15
|
+
target: r ? "_blank" : f,
|
|
16
|
+
rel: r ? a : void 0,
|
|
17
|
+
href: e ? "#" : o,
|
|
18
|
+
"aria-disabled": e,
|
|
19
|
+
...t
|
|
13
20
|
}));
|
|
14
|
-
|
|
15
|
-
r.defaultProps = {
|
|
16
|
-
disabled: !1,
|
|
17
|
-
href: void 0,
|
|
18
|
-
isExternal: !1,
|
|
19
|
-
rel: "noreferrer noopener",
|
|
20
|
-
target: "_self"
|
|
21
|
-
};
|
|
22
|
-
r.propTypes = {
|
|
23
|
-
disabled: e.bool,
|
|
24
|
-
href: e.string,
|
|
25
|
-
isExternal: e.bool,
|
|
26
|
-
rel: e.string,
|
|
27
|
-
target: e.string
|
|
28
|
-
};
|
|
21
|
+
p.displayName = "BaseLink";
|
|
29
22
|
export {
|
|
30
|
-
|
|
23
|
+
p as BaseLink
|
|
31
24
|
};
|