@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,11 +1,11 @@
|
|
|
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 f=require("react/jsx-runtime"),a=require("react"),b=require("styled-components"),g=require("./context.cjs"),t=require("./utils.cjs"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},y=r(a),R=r(b),m=R.default.input`
|
|
2
2
|
margin: 0;
|
|
3
3
|
padding: 0;
|
|
4
4
|
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
5
5
|
border: 1px solid ${({theme:e})=>e.colors.primary600};
|
|
6
6
|
border-radius: 50%;
|
|
7
|
-
height: ${t.getRadioSize};
|
|
8
|
-
width: ${t.getRadioSize};
|
|
7
|
+
height: ${({size:e})=>typeof e=="number"?e:t.getRadioSize(e)};
|
|
8
|
+
width: ${({size:e})=>typeof e=="number"?e:t.getRadioSize(e)};
|
|
9
9
|
-webkit-appearance: none;
|
|
10
10
|
|
|
11
11
|
&:after {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
position: relative;
|
|
15
15
|
z-index: 1;
|
|
16
16
|
display: block;
|
|
17
|
-
height: ${t.getSelectedRadioSize};
|
|
18
|
-
width: ${t.getSelectedRadioSize};
|
|
17
|
+
height: ${({size:e})=>typeof e=="number"?e:t.getSelectedRadioSize(e)};
|
|
18
|
+
width: ${({size:e})=>typeof e=="number"?e:t.getSelectedRadioSize(e)};
|
|
19
19
|
left: ${t.getSelectedRadioPosition};
|
|
20
20
|
top: ${t.getSelectedRadioPosition};
|
|
21
21
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&:disabled {
|
|
28
|
-
border: 1px solid ${({theme:e})=>e.colors.
|
|
28
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral300};
|
|
29
29
|
background: ${({theme:e})=>e.colors.neutral200};
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,d=y.default.forwardRef(({value:e,disabled:n=!1,...i},c)=>{const{onChange:s,selected:l,name:u,size:p}=a.useContext(g.RadioContext),o=l===e;return f.jsx(m,{ref:c,type:"radio",name:u,value:e,tabIndex:o?0:-1,"aria-checked":o,checked:o,disabled:n,size:p,onChange:s,...i})});d.displayName="Radio";exports.BaseRadio=d;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { RadioContext as
|
|
5
|
-
import { getRadioSize as
|
|
6
|
-
const h =
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import f, { useContext as u } from "react";
|
|
3
|
+
import b from "styled-components";
|
|
4
|
+
import { RadioContext as g } from "./context.js";
|
|
5
|
+
import { getRadioSize as r, getSelectedRadioSize as t, getSelectedRadioPosition as a } from "./utils.js";
|
|
6
|
+
const h = b.input`
|
|
7
7
|
margin: 0;
|
|
8
8
|
padding: 0;
|
|
9
|
-
background-color: ${({
|
|
10
|
-
|
|
9
|
+
background-color: ${({
|
|
10
|
+
theme: e
|
|
11
|
+
}) => e.colors.neutral0};
|
|
12
|
+
border: 1px solid ${({
|
|
13
|
+
theme: e
|
|
14
|
+
}) => e.colors.primary600};
|
|
11
15
|
border-radius: 50%;
|
|
12
|
-
height: ${
|
|
13
|
-
|
|
16
|
+
height: ${({
|
|
17
|
+
size: e
|
|
18
|
+
}) => typeof e == "number" ? e : r(e)};
|
|
19
|
+
width: ${({
|
|
20
|
+
size: e
|
|
21
|
+
}) => typeof e == "number" ? e : r(e)};
|
|
14
22
|
-webkit-appearance: none;
|
|
15
23
|
|
|
16
24
|
&:after {
|
|
@@ -19,44 +27,56 @@ const h = g.input`
|
|
|
19
27
|
position: relative;
|
|
20
28
|
z-index: 1;
|
|
21
29
|
display: block;
|
|
22
|
-
height: ${
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
height: ${({
|
|
31
|
+
size: e
|
|
32
|
+
}) => typeof e == "number" ? e : t(e)};
|
|
33
|
+
width: ${({
|
|
34
|
+
size: e
|
|
35
|
+
}) => typeof e == "number" ? e : t(e)};
|
|
36
|
+
left: ${a};
|
|
37
|
+
top: ${a};
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
&:checked:after {
|
|
29
|
-
background: ${({
|
|
41
|
+
background: ${({
|
|
42
|
+
theme: e
|
|
43
|
+
}) => e.colors.primary600};
|
|
30
44
|
}
|
|
31
45
|
|
|
32
46
|
&:disabled {
|
|
33
|
-
border: 1px solid ${({
|
|
34
|
-
|
|
47
|
+
border: 1px solid ${({
|
|
48
|
+
theme: e
|
|
49
|
+
}) => e.colors.neutral300};
|
|
50
|
+
background: ${({
|
|
51
|
+
theme: e
|
|
52
|
+
}) => e.colors.neutral200};
|
|
35
53
|
}
|
|
36
|
-
`,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
`, $ = f.forwardRef(({
|
|
55
|
+
value: e,
|
|
56
|
+
disabled: d = !1,
|
|
57
|
+
...n
|
|
58
|
+
}, i) => {
|
|
59
|
+
const {
|
|
60
|
+
onChange: c,
|
|
61
|
+
selected: l,
|
|
62
|
+
name: p,
|
|
63
|
+
size: m
|
|
64
|
+
} = u(g), o = l === e;
|
|
65
|
+
return s(h, {
|
|
66
|
+
ref: i,
|
|
40
67
|
type: "radio",
|
|
41
|
-
name:
|
|
68
|
+
name: p,
|
|
42
69
|
value: e,
|
|
43
70
|
tabIndex: o ? 0 : -1,
|
|
44
71
|
"aria-checked": o,
|
|
45
72
|
checked: o,
|
|
46
|
-
disabled:
|
|
47
|
-
size:
|
|
48
|
-
onChange:
|
|
49
|
-
...
|
|
73
|
+
disabled: d,
|
|
74
|
+
size: m,
|
|
75
|
+
onChange: c,
|
|
76
|
+
...n
|
|
50
77
|
});
|
|
51
78
|
});
|
|
52
|
-
|
|
53
|
-
r.defaultProps = {
|
|
54
|
-
disabled: !1
|
|
55
|
-
};
|
|
56
|
-
r.propTypes = {
|
|
57
|
-
disabled: i.bool,
|
|
58
|
-
value: i.string.isRequired
|
|
59
|
-
};
|
|
79
|
+
$.displayName = "Radio";
|
|
60
80
|
export {
|
|
61
|
-
|
|
81
|
+
$ as BaseRadio
|
|
62
82
|
};
|
|
@@ -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 o=require("react/jsx-runtime"),s=require("react"),a=require("./context.cjs"),l=require("../helpers/setTabIndexOnFirstItem.cjs"),x=({children:i,labelledBy:n,onChange:u,value:e="",size:c="M",name:t,...d})=>{const r=s.useRef(null);return s.useLayoutEffect(()=>{e||l.setTabIndexOnFirstItem(r.current,`[name="${t}"]`)},[e,t]),o.jsx(a.RadioContext.Provider,{value:{onChange:u,selected:e,name:t,size:c},children:o.jsx("div",{ref:r,role:"radiogroup","aria-labelledby":n,...d,children:i})})};exports.RadioGroup=x;
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { RadioContext as
|
|
4
|
-
import { setTabIndexOnFirstItem as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useLayoutEffect as p } from "react";
|
|
3
|
+
import { RadioContext as s } from "./context.js";
|
|
4
|
+
import { setTabIndexOnFirstItem as u } from "../helpers/setTabIndexOnFirstItem.js";
|
|
5
|
+
const b = ({
|
|
6
|
+
children: i,
|
|
7
|
+
labelledBy: d,
|
|
8
|
+
onChange: f,
|
|
9
|
+
value: r = "",
|
|
10
|
+
size: n = "M",
|
|
11
|
+
name: o,
|
|
12
|
+
...l
|
|
13
|
+
}) => {
|
|
14
|
+
const e = m(null);
|
|
7
15
|
return p(() => {
|
|
8
|
-
r ||
|
|
9
|
-
}, [r, o]),
|
|
10
|
-
value: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
labelledBy: e.string.isRequired,
|
|
25
|
-
name: e.string.isRequired,
|
|
26
|
-
onChange: e.func.isRequired,
|
|
27
|
-
size: e.oneOf(["M", "L"]),
|
|
28
|
-
value: e.string
|
|
16
|
+
r || u(e.current, `[name="${o}"]`);
|
|
17
|
+
}, [r, o]), t(s.Provider, {
|
|
18
|
+
value: {
|
|
19
|
+
onChange: f,
|
|
20
|
+
selected: r,
|
|
21
|
+
name: o,
|
|
22
|
+
size: n
|
|
23
|
+
},
|
|
24
|
+
children: t("div", {
|
|
25
|
+
ref: e,
|
|
26
|
+
role: "radiogroup",
|
|
27
|
+
"aria-labelledby": d,
|
|
28
|
+
...l,
|
|
29
|
+
children: i
|
|
30
|
+
})
|
|
31
|
+
});
|
|
29
32
|
};
|
|
30
33
|
export {
|
|
31
|
-
|
|
34
|
+
b as RadioGroup
|
|
32
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react"),t=e.createContext({onChange:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react"),t=e.createContext({onChange:void 0,name:"",size:"M",selected:""});exports.RadioContext=t;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
const n = e({
|
|
3
|
+
onChange: void 0,
|
|
4
|
+
name: "",
|
|
5
|
+
size: "M",
|
|
6
|
+
selected: ""
|
|
7
|
+
});
|
|
4
8
|
export {
|
|
5
|
-
|
|
9
|
+
n as RadioContext
|
|
6
10
|
};
|
package/dist/BaseRadio/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=e=>e==="M"?"18px":"20px",i=e=>e==="M"?"10px":"12px",o=()=>"3px";exports.getRadioSize=t;exports.getSelectedRadioPosition=o;exports.getSelectedRadioSize=i;
|
package/dist/BaseRadio/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t = (
|
|
1
|
+
const t = (e) => e === "M" ? "18px" : "20px", r = (e) => e === "M" ? "10px" : "12px", i = () => "3px";
|
|
2
2
|
export {
|
|
3
3
|
t as getRadioSize,
|
|
4
4
|
i as getSelectedRadioPosition,
|
package/dist/Box/Box.cjs
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
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 a=require("styled-components"),o=require("../helpers/handleResponsiveValues.cjs"),r=require("../helpers/theme.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},d=i(a),l={color:!0},m=d.default.div.withConfig({shouldForwardProp:(e,t)=>!l[e]&&t(e)})`
|
|
2
2
|
// Font
|
|
3
|
-
font-size: ${({fontSize:e,theme:
|
|
3
|
+
font-size: ${({fontSize:e,theme:t})=>r.extractStyleFromTheme(t.fontSizes,e,e)};
|
|
4
4
|
|
|
5
5
|
// Colors
|
|
6
|
-
background: ${({theme:e,background:
|
|
7
|
-
color: ${({theme:e,color:
|
|
6
|
+
background: ${({theme:e,background:t})=>r.extractStyleFromTheme(e.colors,t,void 0)};
|
|
7
|
+
color: ${({theme:e,color:t})=>r.extractStyleFromTheme(e.colors,t,void 0)};
|
|
8
8
|
|
|
9
9
|
// Spaces
|
|
10
|
-
${({theme:e,padding:
|
|
11
|
-
${({theme:e,paddingTop:
|
|
12
|
-
${({theme:e,paddingRight:
|
|
13
|
-
${({theme:e,paddingBottom:
|
|
14
|
-
${({theme:e,paddingLeft:
|
|
15
|
-
${({theme:e,marginLeft:
|
|
16
|
-
${({theme:e,marginRight:
|
|
17
|
-
${({theme:e,marginTop:
|
|
18
|
-
${({theme:e,marginBottom:
|
|
10
|
+
${({theme:e,padding:t})=>o("padding",t,e)}
|
|
11
|
+
${({theme:e,paddingTop:t})=>o("padding-top",t,e)}
|
|
12
|
+
${({theme:e,paddingRight:t})=>o("padding-right",t,e)}
|
|
13
|
+
${({theme:e,paddingBottom:t})=>o("padding-bottom",t,e)}
|
|
14
|
+
${({theme:e,paddingLeft:t})=>o("padding-left",t,e)}
|
|
15
|
+
${({theme:e,marginLeft:t})=>o("margin-left",t,e)}
|
|
16
|
+
${({theme:e,marginRight:t})=>o("margin-right",t,e)}
|
|
17
|
+
${({theme:e,marginTop:t})=>o("margin-top",t,e)}
|
|
18
|
+
${({theme:e,marginBottom:t})=>o("margin-bottom",t,e)}
|
|
19
19
|
|
|
20
20
|
// Responsive hiding
|
|
21
|
-
${({theme:e,hiddenS:
|
|
22
|
-
${({theme:e,hiddenXS:
|
|
21
|
+
${({theme:e,hiddenS:t})=>t?`${e.mediaQueries.tablet} { display: none; }`:void 0}
|
|
22
|
+
${({theme:e,hiddenXS:t})=>t?`${e.mediaQueries.mobile} { display: none; }`:void 0}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
// Borders
|
|
26
|
-
border-radius: ${({theme:e,hasRadius:
|
|
26
|
+
border-radius: ${({theme:e,hasRadius:t,borderRadius:s})=>t?e.borderRadius:s};
|
|
27
27
|
border-style: ${({borderStyle:e})=>e};
|
|
28
28
|
border-width: ${({borderWidth:e})=>e};
|
|
29
|
-
border-color: ${({borderColor:e,theme:
|
|
30
|
-
border: ${({theme:e,borderColor:
|
|
29
|
+
border-color: ${({borderColor:e,theme:t})=>r.extractStyleFromTheme(t.colors,e,void 0)};
|
|
30
|
+
border: ${({theme:e,borderColor:t,borderStyle:s,borderWidth:n})=>{if(t&&!s&&!n)return`1px solid ${e.colors[t]}`}};
|
|
31
31
|
|
|
32
32
|
// Shadows
|
|
33
|
-
box-shadow: ${({theme:e,shadow:
|
|
33
|
+
box-shadow: ${({theme:e,shadow:t})=>r.extractStyleFromTheme(e.shadows,t,void 0)};
|
|
34
34
|
|
|
35
35
|
// Handlers
|
|
36
36
|
pointer-events: ${({pointerEvents:e})=>e};
|
|
37
37
|
&:hover {
|
|
38
|
-
${({_hover:e,theme:
|
|
38
|
+
${({_hover:e,theme:t})=>e?e(t):void 0}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
// Display
|
|
@@ -43,21 +43,20 @@
|
|
|
43
43
|
|
|
44
44
|
// Position
|
|
45
45
|
position: ${({position:e})=>e};
|
|
46
|
-
left: ${({left:e,theme:
|
|
47
|
-
right: ${({right:e,theme:
|
|
48
|
-
top: ${({top:e,theme:
|
|
49
|
-
bottom: ${({bottom:e,theme:
|
|
46
|
+
left: ${({left:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
47
|
+
right: ${({right:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
48
|
+
top: ${({top:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
49
|
+
bottom: ${({bottom:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
50
50
|
z-index: ${({zIndex:e})=>e};
|
|
51
51
|
overflow: ${({overflow:e})=>e};
|
|
52
|
-
cursor: ${({cursor:e})=>e};
|
|
53
52
|
|
|
54
53
|
// Size
|
|
55
|
-
width: ${({width:e,theme:
|
|
56
|
-
max-width: ${({maxWidth:e,theme:
|
|
57
|
-
min-width: ${({minWidth:e,theme:
|
|
58
|
-
height: ${({height:e,theme:
|
|
59
|
-
max-height: ${({maxHeight:e,theme:
|
|
60
|
-
min-height: ${({minHeight:e,theme:
|
|
54
|
+
width: ${({width:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
55
|
+
max-width: ${({maxWidth:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
56
|
+
min-width: ${({minWidth:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
57
|
+
height: ${({height:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
58
|
+
max-height: ${({maxHeight:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
59
|
+
min-height: ${({minHeight:e,theme:t})=>r.extractStyleFromTheme(t.spaces,e,e)};
|
|
61
60
|
|
|
62
61
|
// Animation
|
|
63
62
|
transition: ${({transition:e})=>e};
|
|
@@ -77,4 +76,4 @@
|
|
|
77
76
|
|
|
78
77
|
// Cursor
|
|
79
78
|
cursor: ${({cursor:e})=>e};
|
|
80
|
-
`;
|
|
79
|
+
`;exports.Box=m;
|
package/dist/Box/Box.js
CHANGED
|
@@ -1,95 +1,218 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import d from "styled-components";
|
|
2
|
+
import i from "../helpers/handleResponsiveValues.js";
|
|
3
|
+
import { extractStyleFromTheme as s } from "../helpers/theme.js";
|
|
4
|
+
const $ = {
|
|
5
5
|
color: !0
|
|
6
|
-
},
|
|
7
|
-
shouldForwardProp: (
|
|
6
|
+
}, l = d.div.withConfig({
|
|
7
|
+
shouldForwardProp: (e, o) => !$[e] && o(e)
|
|
8
8
|
})`
|
|
9
9
|
// Font
|
|
10
|
-
font-size: ${({
|
|
10
|
+
font-size: ${({
|
|
11
|
+
fontSize: e,
|
|
12
|
+
theme: o
|
|
13
|
+
}) => s(o.fontSizes, e, e)};
|
|
11
14
|
|
|
12
15
|
// Colors
|
|
13
|
-
background: ${({
|
|
14
|
-
|
|
16
|
+
background: ${({
|
|
17
|
+
theme: e,
|
|
18
|
+
background: o
|
|
19
|
+
}) => s(e.colors, o, void 0)};
|
|
20
|
+
color: ${({
|
|
21
|
+
theme: e,
|
|
22
|
+
color: o
|
|
23
|
+
}) => s(e.colors, o, void 0)};
|
|
15
24
|
|
|
16
25
|
// Spaces
|
|
17
|
-
${({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
${({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
${({
|
|
26
|
+
${({
|
|
27
|
+
theme: e,
|
|
28
|
+
padding: o
|
|
29
|
+
}) => i("padding", o, e)}
|
|
30
|
+
${({
|
|
31
|
+
theme: e,
|
|
32
|
+
paddingTop: o
|
|
33
|
+
}) => i("padding-top", o, e)}
|
|
34
|
+
${({
|
|
35
|
+
theme: e,
|
|
36
|
+
paddingRight: o
|
|
37
|
+
}) => i("padding-right", o, e)}
|
|
38
|
+
${({
|
|
39
|
+
theme: e,
|
|
40
|
+
paddingBottom: o
|
|
41
|
+
}) => i("padding-bottom", o, e)}
|
|
42
|
+
${({
|
|
43
|
+
theme: e,
|
|
44
|
+
paddingLeft: o
|
|
45
|
+
}) => i("padding-left", o, e)}
|
|
46
|
+
${({
|
|
47
|
+
theme: e,
|
|
48
|
+
marginLeft: o
|
|
49
|
+
}) => i("margin-left", o, e)}
|
|
50
|
+
${({
|
|
51
|
+
theme: e,
|
|
52
|
+
marginRight: o
|
|
53
|
+
}) => i("margin-right", o, e)}
|
|
54
|
+
${({
|
|
55
|
+
theme: e,
|
|
56
|
+
marginTop: o
|
|
57
|
+
}) => i("margin-top", o, e)}
|
|
58
|
+
${({
|
|
59
|
+
theme: e,
|
|
60
|
+
marginBottom: o
|
|
61
|
+
}) => i("margin-bottom", o, e)}
|
|
26
62
|
|
|
27
63
|
// Responsive hiding
|
|
28
|
-
${({
|
|
29
|
-
|
|
64
|
+
${({
|
|
65
|
+
theme: e,
|
|
66
|
+
hiddenS: o
|
|
67
|
+
}) => o ? `${e.mediaQueries.tablet} { display: none; }` : void 0}
|
|
68
|
+
${({
|
|
69
|
+
theme: e,
|
|
70
|
+
hiddenXS: o
|
|
71
|
+
}) => o ? `${e.mediaQueries.mobile} { display: none; }` : void 0}
|
|
30
72
|
|
|
31
73
|
|
|
32
74
|
// Borders
|
|
33
|
-
border-radius: ${({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
75
|
+
border-radius: ${({
|
|
76
|
+
theme: e,
|
|
77
|
+
hasRadius: o,
|
|
78
|
+
borderRadius: r
|
|
79
|
+
}) => o ? e.borderRadius : r};
|
|
80
|
+
border-style: ${({
|
|
81
|
+
borderStyle: e
|
|
82
|
+
}) => e};
|
|
83
|
+
border-width: ${({
|
|
84
|
+
borderWidth: e
|
|
85
|
+
}) => e};
|
|
86
|
+
border-color: ${({
|
|
87
|
+
borderColor: e,
|
|
88
|
+
theme: o
|
|
89
|
+
}) => s(o.colors, e, void 0)};
|
|
90
|
+
border: ${({
|
|
91
|
+
theme: e,
|
|
92
|
+
borderColor: o,
|
|
93
|
+
borderStyle: r,
|
|
94
|
+
borderWidth: n
|
|
95
|
+
}) => {
|
|
96
|
+
if (o && !r && !n)
|
|
97
|
+
return `1px solid ${e.colors[o]}`;
|
|
40
98
|
}};
|
|
41
99
|
|
|
42
100
|
// Shadows
|
|
43
|
-
box-shadow: ${({
|
|
101
|
+
box-shadow: ${({
|
|
102
|
+
theme: e,
|
|
103
|
+
shadow: o
|
|
104
|
+
}) => s(e.shadows, o, void 0)};
|
|
44
105
|
|
|
45
106
|
// Handlers
|
|
46
|
-
pointer-events: ${({
|
|
107
|
+
pointer-events: ${({
|
|
108
|
+
pointerEvents: e
|
|
109
|
+
}) => e};
|
|
47
110
|
&:hover {
|
|
48
|
-
${({
|
|
111
|
+
${({
|
|
112
|
+
_hover: e,
|
|
113
|
+
theme: o
|
|
114
|
+
}) => e ? e(o) : void 0}
|
|
49
115
|
}
|
|
50
116
|
|
|
51
117
|
// Display
|
|
52
|
-
display: ${({
|
|
118
|
+
display: ${({
|
|
119
|
+
display: e
|
|
120
|
+
}) => e};
|
|
53
121
|
|
|
54
122
|
// Position
|
|
55
|
-
position: ${({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
123
|
+
position: ${({
|
|
124
|
+
position: e
|
|
125
|
+
}) => e};
|
|
126
|
+
left: ${({
|
|
127
|
+
left: e,
|
|
128
|
+
theme: o
|
|
129
|
+
}) => s(o.spaces, e, e)};
|
|
130
|
+
right: ${({
|
|
131
|
+
right: e,
|
|
132
|
+
theme: o
|
|
133
|
+
}) => s(o.spaces, e, e)};
|
|
134
|
+
top: ${({
|
|
135
|
+
top: e,
|
|
136
|
+
theme: o
|
|
137
|
+
}) => s(o.spaces, e, e)};
|
|
138
|
+
bottom: ${({
|
|
139
|
+
bottom: e,
|
|
140
|
+
theme: o
|
|
141
|
+
}) => s(o.spaces, e, e)};
|
|
142
|
+
z-index: ${({
|
|
143
|
+
zIndex: e
|
|
144
|
+
}) => e};
|
|
145
|
+
overflow: ${({
|
|
146
|
+
overflow: e
|
|
147
|
+
}) => e};
|
|
63
148
|
|
|
64
149
|
// Size
|
|
65
|
-
width: ${({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
max-
|
|
70
|
-
|
|
150
|
+
width: ${({
|
|
151
|
+
width: e,
|
|
152
|
+
theme: o
|
|
153
|
+
}) => s(o.spaces, e, e)};
|
|
154
|
+
max-width: ${({
|
|
155
|
+
maxWidth: e,
|
|
156
|
+
theme: o
|
|
157
|
+
}) => s(o.spaces, e, e)};
|
|
158
|
+
min-width: ${({
|
|
159
|
+
minWidth: e,
|
|
160
|
+
theme: o
|
|
161
|
+
}) => s(o.spaces, e, e)};
|
|
162
|
+
height: ${({
|
|
163
|
+
height: e,
|
|
164
|
+
theme: o
|
|
165
|
+
}) => s(o.spaces, e, e)};
|
|
166
|
+
max-height: ${({
|
|
167
|
+
maxHeight: e,
|
|
168
|
+
theme: o
|
|
169
|
+
}) => s(o.spaces, e, e)};
|
|
170
|
+
min-height: ${({
|
|
171
|
+
minHeight: e,
|
|
172
|
+
theme: o
|
|
173
|
+
}) => s(o.spaces, e, e)};
|
|
71
174
|
|
|
72
175
|
// Animation
|
|
73
|
-
transition: ${({
|
|
74
|
-
|
|
75
|
-
|
|
176
|
+
transition: ${({
|
|
177
|
+
transition: e
|
|
178
|
+
}) => e};
|
|
179
|
+
transform: ${({
|
|
180
|
+
transform: e
|
|
181
|
+
}) => e};
|
|
182
|
+
animation: ${({
|
|
183
|
+
animation: e
|
|
184
|
+
}) => e};
|
|
76
185
|
|
|
77
186
|
//Flexbox children props
|
|
78
|
-
flex-shrink: ${({
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
flex: ${({
|
|
187
|
+
flex-shrink: ${({
|
|
188
|
+
shrink: e
|
|
189
|
+
}) => e};
|
|
190
|
+
flex-grow: ${({
|
|
191
|
+
grow: e
|
|
192
|
+
}) => e};
|
|
193
|
+
flex-basis: ${({
|
|
194
|
+
basis: e
|
|
195
|
+
}) => e};
|
|
196
|
+
flex: ${({
|
|
197
|
+
flex: e
|
|
198
|
+
}) => e};
|
|
82
199
|
|
|
83
200
|
// Text
|
|
84
|
-
text-align: ${({
|
|
85
|
-
|
|
86
|
-
|
|
201
|
+
text-align: ${({
|
|
202
|
+
textAlign: e
|
|
203
|
+
}) => e};
|
|
204
|
+
text-transform: ${({
|
|
205
|
+
textTransform: e
|
|
206
|
+
}) => e};
|
|
207
|
+
line-height: ${({
|
|
208
|
+
lineHeight: e
|
|
209
|
+
}) => e};
|
|
87
210
|
|
|
88
211
|
// Cursor
|
|
89
|
-
cursor: ${({
|
|
212
|
+
cursor: ${({
|
|
213
|
+
cursor: e
|
|
214
|
+
}) => e};
|
|
90
215
|
`;
|
|
91
|
-
i.defaultProps = t;
|
|
92
|
-
i.propTypes = n;
|
|
93
216
|
export {
|
|
94
|
-
|
|
217
|
+
l as Box
|
|
95
218
|
};
|