@strapi/design-system 1.4.2 → 1.5.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/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +17 -37
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +75 -96
- package/dist/Alert/Alert.cjs +12 -12
- package/dist/Alert/Alert.js +83 -102
- package/dist/Badge/Badge.cjs +4 -4
- package/dist/Badge/Badge.js +29 -49
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +20 -42
- package/dist/BaseCheckbox/BaseCheckbox.cjs +6 -6
- package/dist/BaseCheckbox/BaseCheckbox.js +35 -55
- package/dist/BaseLink/BaseLink.cjs +2 -2
- package/dist/BaseLink/BaseLink.js +21 -43
- package/dist/BaseRadio/BaseRadio.cjs +8 -8
- package/dist/BaseRadio/BaseRadio.js +31 -51
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +24 -44
- package/dist/Box/BoxProps.cjs +1 -1
- package/dist/Box/BoxProps.js +10 -19
- package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.js +29 -50
- package/dist/Button/Button.cjs +14 -14
- package/dist/Button/Button.js +53 -73
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +17 -37
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +19 -42
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +9 -18
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +8 -19
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +12 -22
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +11 -32
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +9 -19
- package/dist/Card/CardTimer.cjs +2 -2
- package/dist/Card/CardTimer.js +20 -42
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +16 -27
- package/dist/CarouselInput/Carousel.cjs +6 -6
- package/dist/CarouselInput/Carousel.js +77 -107
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +7 -17
- package/dist/CarouselInput/CarouselImage.cjs +3 -3
- package/dist/CarouselInput/CarouselImage.js +26 -38
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +49 -83
- package/dist/CarouselInput/CarouselSlide.cjs +2 -2
- package/dist/CarouselInput/CarouselSlide.js +20 -42
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +44 -63
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +196 -246
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +25 -47
- package/dist/Combobox/utils.cjs +1 -1
- package/dist/Combobox/utils.js +21 -21
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +85 -117
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +1 -1
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +23 -42
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +23 -44
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +6 -7
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +92 -126
- package/dist/DateTimePicker/DateTimePickerProps.cjs +1 -1
- package/dist/DateTimePicker/DateTimePickerProps.js +10 -19
- package/dist/Dialog/Dialog.cjs +5 -5
- package/dist/Dialog/Dialog.js +39 -58
- package/dist/Divider/Divider.cjs +4 -2
- package/dist/Divider/Divider.js +17 -38
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +20 -39
- package/dist/Field/FieldAction.cjs +2 -2
- package/dist/Field/FieldAction.js +13 -35
- package/dist/Field/FieldInput.cjs +6 -6
- package/dist/Field/FieldInput.js +47 -67
- package/dist/Field/FieldLabel.cjs +3 -3
- package/dist/Field/FieldLabel.js +26 -46
- package/dist/Flex/FlexProps.cjs +1 -1
- package/dist/Flex/FlexProps.js +10 -19
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +32 -52
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +20 -42
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +22 -41
- package/dist/Icon/Icon.cjs +2 -2
- package/dist/Icon/Icon.js +17 -27
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +44 -64
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +38 -58
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +78 -96
- package/dist/Link/Link.cjs +6 -6
- package/dist/Link/Link.js +34 -54
- package/dist/LinkButton/LinkButton.cjs +10 -10
- package/dist/LinkButton/LinkButton.js +47 -69
- package/dist/Loader/Loader.cjs +4 -4
- package/dist/Loader/Loader.js +25 -47
- package/dist/Main/Main.cjs +2 -2
- package/dist/Main/Main.js +15 -35
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +19 -40
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +20 -40
- package/dist/MainNav/NavFooter.cjs +3 -0
- package/dist/MainNav/NavFooter.js +14 -0
- package/dist/MainNav/NavLink.cjs +13 -13
- package/dist/MainNav/NavLink.js +57 -76
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +46 -67
- package/dist/MainNav/NavSections.cjs +4 -1
- package/dist/MainNav/NavSections.js +23 -40
- package/dist/MainNav/NavUser.cjs +2 -6
- package/dist/MainNav/NavUser.js +31 -55
- package/dist/MainNav/index.cjs +1 -1
- package/dist/MainNav/index.js +14 -12
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +9 -19
- package/dist/ModalLayout/ModalLayout.cjs +3 -3
- package/dist/ModalLayout/ModalLayout.js +30 -52
- package/dist/NumberInput/NumberInput.cjs +6 -6
- package/dist/NumberInput/NumberInput.js +123 -157
- package/dist/Pagination/components.cjs +7 -7
- package/dist/Pagination/components.js +65 -88
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +65 -91
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +11 -12
- package/dist/ProgressBar/ProgressBar.cjs +2 -2
- package/dist/ProgressBar/ProgressBar.js +27 -49
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +19 -40
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +69 -89
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +46 -66
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +11 -30
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +10 -29
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +14 -34
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +5 -16
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +45 -65
- package/dist/Select/MultiSelectNested.cjs +1 -1
- package/dist/Select/MultiSelectNested.js +23 -45
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +15 -35
- package/dist/Select/Option.cjs +7 -7
- package/dist/Select/Option.js +37 -57
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +145 -186
- package/dist/Select/SelectButton.cjs +2 -2
- package/dist/Select/SelectButton.js +33 -53
- package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/SimpleMenu/SimpleMenu.js +137 -163
- package/dist/Stack/Stack.cjs +3 -3
- package/dist/Stack/Stack.js +29 -50
- package/dist/Status/Status.cjs +4 -4
- package/dist/Status/Status.js +30 -50
- package/dist/SubNav/SubNav.cjs +3 -3
- package/dist/SubNav/SubNav.js +15 -37
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +38 -39
- package/dist/SubNav/SubNavLink.cjs +6 -6
- package/dist/SubNav/SubNavLink.js +39 -61
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +17 -39
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +35 -57
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +20 -40
- package/dist/Table/TFooter.cjs +3 -3
- package/dist/Table/TFooter.js +28 -50
- package/dist/Table/Table.cjs +5 -5
- package/dist/Table/Table.js +35 -55
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +8 -17
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +8 -17
- package/dist/Table/Tr.cjs +2 -2
- package/dist/Table/Tr.js +8 -17
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +26 -45
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +24 -43
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +94 -112
- package/dist/Tag/Tag.cjs +4 -4
- package/dist/Tag/Tag.js +27 -50
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +39 -59
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +49 -69
- package/dist/Textarea/Textarea.cjs +3 -3
- package/dist/Textarea/Textarea.js +43 -63
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +30 -50
- package/dist/TimePicker/TimePicker.cjs +3 -3
- package/dist/TimePicker/TimePicker.js +62 -95
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +56 -78
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +65 -97
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +38 -57
- package/dist/Typography/TypographyProps.cjs +1 -1
- package/dist/Typography/TypographyProps.js +13 -22
- package/dist/helpers/getDefaultLocale.cjs +1 -1
- package/dist/helpers/getDefaultLocale.js +1 -1
- package/dist/helpers/handleResponsiveValues.cjs +5 -5
- package/dist/helpers/handleResponsiveValues.js +14 -14
- package/dist/index.cjs +1 -1
- package/dist/index.js +150 -148
- package/dist/themes/darkTheme/index.cjs +1 -1
- package/dist/themes/darkTheme/index.js +8 -18
- package/dist/themes/extendTheme.cjs +4 -4
- package/dist/themes/extendTheme.js +18 -29
- package/dist/themes/lightTheme/index.cjs +1 -1
- package/dist/themes/lightTheme/index.js +8 -18
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +23 -43
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +22 -44
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +14 -35
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +19 -41
- package/dist/v2/Link/Link.cjs +5 -5
- package/dist/v2/Link/Link.js +42 -64
- package/dist/v2/LinkButton/LinkButton.cjs +10 -10
- package/dist/v2/LinkButton/LinkButton.js +51 -75
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +19 -40
- package/dist/v2/MainNav/NavBrand.cjs +3 -3
- package/dist/v2/MainNav/NavBrand.js +57 -78
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +20 -40
- package/dist/v2/MainNav/NavFooter.cjs +3 -0
- package/dist/v2/MainNav/NavFooter.js +14 -0
- package/dist/v2/MainNav/NavLink.cjs +13 -13
- package/dist/v2/MainNav/NavLink.js +60 -81
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +46 -67
- package/dist/v2/MainNav/NavSections.cjs +4 -1
- package/dist/v2/MainNav/NavSections.js +23 -40
- package/dist/v2/MainNav/NavUser.cjs +2 -6
- package/dist/v2/MainNav/NavUser.js +31 -55
- package/dist/v2/MainNav/index.cjs +1 -1
- package/dist/v2/MainNav/index.js +14 -12
- package/dist/v2/Pagination/components.cjs +7 -7
- package/dist/v2/Pagination/components.js +65 -89
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/v2/SimpleMenu/SimpleMenu.js +131 -156
- package/dist/v2/SubNav/SubNav.cjs +3 -3
- package/dist/v2/SubNav/SubNav.js +15 -37
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +38 -39
- package/dist/v2/SubNav/SubNavLink.cjs +6 -6
- package/dist/v2/SubNav/SubNavLink.js +42 -64
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +17 -39
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.js +37 -35
- package/package.json +3 -3
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
for (var t in r || (r = {}))
|
|
6
|
-
d.call(r, t) && a(e, t, r[t]);
|
|
7
|
-
if (i)
|
|
8
|
-
for (var t of i(r))
|
|
9
|
-
p.call(r, t) && a(e, t, r[t]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
var l = (e, r) => {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var o in e)
|
|
15
|
-
d.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
16
|
-
if (e != null && i)
|
|
17
|
-
for (var o of i(e))
|
|
18
|
-
r.indexOf(o) < 0 && p.call(e, o) && (t[o] = e[o]);
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
import u from "react";
|
|
22
|
-
import b from "styled-components";
|
|
23
|
-
import m from "prop-types";
|
|
24
|
-
const f = b.button`
|
|
1
|
+
import i from "react";
|
|
2
|
+
import n from "styled-components";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
const a = n.button`
|
|
25
5
|
border: none;
|
|
26
6
|
background: transparent;
|
|
27
7
|
// TODO: Make sure to use the theme when it's ready
|
|
@@ -30,17 +10,15 @@ const f = b.button`
|
|
|
30
10
|
padding: 0;
|
|
31
11
|
display: flex;
|
|
32
12
|
align-items: center;
|
|
33
|
-
`,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children: m.node.isRequired,
|
|
42
|
-
label: m.string.isRequired
|
|
13
|
+
`, d = ({ label: t, children: r, ...o }) => /* @__PURE__ */ i.createElement(a, {
|
|
14
|
+
"aria-label": t,
|
|
15
|
+
type: "button",
|
|
16
|
+
...o
|
|
17
|
+
}, r);
|
|
18
|
+
d.propTypes = {
|
|
19
|
+
children: e.node.isRequired,
|
|
20
|
+
label: e.string.isRequired
|
|
43
21
|
};
|
|
44
22
|
export {
|
|
45
|
-
|
|
23
|
+
d as FieldAction
|
|
46
24
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react"),B=require("styled-components"),I=require("prop-types"),R=require("../themes/sizes.cjs"),v=require("../themes/utils.cjs"),w=require("./FieldContext.cjs"),C=require("../Flex/Flex.cjs"),p=require("../Box/Box.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=d(g),b=d(B),o=d(I),f={S:6.5,M:10.5},k=b.default.input`
|
|
2
2
|
border: none;
|
|
3
3
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
4
|
-
padding-bottom: ${({size:e})=>`${
|
|
4
|
+
padding-bottom: ${({size:e})=>`${f[e]/16}rem`};
|
|
5
5
|
padding-left: ${({theme:e,hasLeftAction:t})=>t?0:e.spaces[4]};
|
|
6
6
|
padding-right: ${({theme:e,hasRightAction:t})=>t?0:e.spaces[4]};
|
|
7
|
-
padding-top: ${({size:e})=>`${
|
|
7
|
+
padding-top: ${({size:e})=>`${f[e]/16}rem`};
|
|
8
8
|
cursor: ${e=>e["aria-disabled"]?"not-allowed":void 0};
|
|
9
9
|
|
|
10
10
|
color: ${({theme:e})=>e.colors.neutral800};
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
outline: none;
|
|
30
30
|
box-shadow: none;
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,h=b.default(C.Flex)`
|
|
33
33
|
border: 1px solid ${({theme:e,hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
34
34
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
35
35
|
background: ${({theme:e})=>e.colors.neutral0};
|
|
36
|
-
${
|
|
36
|
+
${v.inputFocusStyle()}
|
|
37
37
|
|
|
38
38
|
${({theme:e,disabled:t})=>t?`
|
|
39
39
|
color: ${e.colors.neutral600};
|
|
40
40
|
background: ${e.colors.neutral150};
|
|
41
41
|
|
|
42
42
|
`:void 0}
|
|
43
|
-
`,
|
|
43
|
+
`,a=g.forwardRef(({endAction:e,startAction:t,disabled:n,onChange:$,size:l,...y},m)=>{const{id:s,error:u,hint:x,name:F,required:q}=w.useField();let i;u?i=`${s}-error`:x&&(i=`${s}-hint`);const c=Boolean(u),_=j=>{n||$(j)};return r.default.createElement(h,{size:l,justifyContent:"space-between",hasError:c,disabled:n},t&&r.default.createElement(p.Box,{paddingLeft:3,paddingRight:2},t),r.default.createElement(k,{id:s,name:F,ref:m,"aria-describedby":i,"aria-invalid":c,"aria-disabled":n,hasLeftAction:Boolean(t),hasRightAction:Boolean(e),onChange:_,"aria-required":q,size:l,...y}),e&&r.default.createElement(p.Box,{paddingLeft:2,paddingRight:3},e))});a.displayName="FieldInput";a.defaultProps={disabled:!1,endAction:void 0,size:"M",startAction:void 0,onChange(){}};a.propTypes={disabled:o.default.bool,endAction:o.default.element,onChange:o.default.func,size:o.default.oneOf(Object.keys(R.sizes.input)),startAction:o.default.element};exports.FieldInput=a;exports.InputWrapper=h;
|
package/dist/Field/FieldInput.js
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
var $ = (e, o) => {
|
|
13
|
-
var r = {};
|
|
14
|
-
for (var t in e)
|
|
15
|
-
g.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
|
|
16
|
-
if (e != null && n)
|
|
17
|
-
for (var t of n(e))
|
|
18
|
-
o.indexOf(t) < 0 && b.call(e, t) && (r[t] = e[t]);
|
|
19
|
-
return r;
|
|
20
|
-
};
|
|
21
|
-
import i, { forwardRef as D } from "react";
|
|
22
|
-
import R from "styled-components";
|
|
23
|
-
import a from "prop-types";
|
|
24
|
-
import { sizes as O } from "../themes/sizes.js";
|
|
25
|
-
import { inputFocusStyle as z } from "../themes/utils.js";
|
|
26
|
-
import { useField as A } from "./FieldContext.js";
|
|
27
|
-
import { Flex as L } from "../Flex/Flex.js";
|
|
28
|
-
import { Box as y } from "../Box/Box.js";
|
|
29
|
-
const w = {
|
|
1
|
+
import t, { forwardRef as k } from "react";
|
|
2
|
+
import m from "styled-components";
|
|
3
|
+
import r from "prop-types";
|
|
4
|
+
import { sizes as I } from "../themes/sizes.js";
|
|
5
|
+
import { inputFocusStyle as v } from "../themes/utils.js";
|
|
6
|
+
import { useField as x } from "./FieldContext.js";
|
|
7
|
+
import { Flex as C } from "../Flex/Flex.js";
|
|
8
|
+
import { Box as c } from "../Box/Box.js";
|
|
9
|
+
const u = {
|
|
30
10
|
S: 6.5,
|
|
31
11
|
M: 10.5
|
|
32
|
-
},
|
|
12
|
+
}, E = m.input`
|
|
33
13
|
border: none;
|
|
34
14
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
35
|
-
padding-bottom: ${({ size: e }) => `${
|
|
15
|
+
padding-bottom: ${({ size: e }) => `${u[e] / 16}rem`};
|
|
36
16
|
padding-left: ${({ theme: e, hasLeftAction: o }) => o ? 0 : e.spaces[4]};
|
|
37
17
|
padding-right: ${({ theme: e, hasRightAction: o }) => o ? 0 : e.spaces[4]};
|
|
38
|
-
padding-top: ${({ size: e }) => `${
|
|
18
|
+
padding-top: ${({ size: e }) => `${u[e] / 16}rem`};
|
|
39
19
|
cursor: ${(e) => e["aria-disabled"] ? "not-allowed" : void 0};
|
|
40
20
|
|
|
41
21
|
color: ${({ theme: e }) => e.colors.neutral800};
|
|
@@ -60,52 +40,52 @@ const w = {
|
|
|
60
40
|
outline: none;
|
|
61
41
|
box-shadow: none;
|
|
62
42
|
}
|
|
63
|
-
`,
|
|
43
|
+
`, F = m(C)`
|
|
64
44
|
border: 1px solid ${({ theme: e, hasError: o }) => o ? e.colors.danger600 : e.colors.neutral200};
|
|
65
45
|
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
66
46
|
background: ${({ theme: e }) => e.colors.neutral0};
|
|
67
|
-
${
|
|
47
|
+
${v()}
|
|
68
48
|
|
|
69
49
|
${({ theme: e, disabled: o }) => o ? `
|
|
70
50
|
color: ${e.colors.neutral600};
|
|
71
51
|
background: ${e.colors.neutral150};
|
|
72
52
|
|
|
73
53
|
` : void 0}
|
|
74
|
-
`,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
r || t(F);
|
|
54
|
+
`, d = k(({ endAction: e, startAction: o, disabled: a, onChange: f, size: s, ...g }, b) => {
|
|
55
|
+
const { id: n, error: l, hint: h, name: $, required: y } = x();
|
|
56
|
+
let i;
|
|
57
|
+
l ? i = `${n}-error` : h && (i = `${n}-hint`);
|
|
58
|
+
const p = Boolean(l), w = (R) => {
|
|
59
|
+
a || f(R);
|
|
81
60
|
};
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
size:
|
|
61
|
+
return /* @__PURE__ */ t.createElement(F, {
|
|
62
|
+
size: s,
|
|
84
63
|
justifyContent: "space-between",
|
|
85
|
-
hasError:
|
|
86
|
-
disabled:
|
|
87
|
-
}, o && /* @__PURE__ */
|
|
64
|
+
hasError: p,
|
|
65
|
+
disabled: a
|
|
66
|
+
}, o && /* @__PURE__ */ t.createElement(c, {
|
|
88
67
|
paddingLeft: 3,
|
|
89
68
|
paddingRight: 2
|
|
90
|
-
}, o), /* @__PURE__ */
|
|
91
|
-
id:
|
|
92
|
-
name:
|
|
93
|
-
ref:
|
|
94
|
-
"aria-describedby":
|
|
95
|
-
"aria-invalid":
|
|
96
|
-
"aria-disabled":
|
|
69
|
+
}, o), /* @__PURE__ */ t.createElement(E, {
|
|
70
|
+
id: n,
|
|
71
|
+
name: $,
|
|
72
|
+
ref: b,
|
|
73
|
+
"aria-describedby": i,
|
|
74
|
+
"aria-invalid": p,
|
|
75
|
+
"aria-disabled": a,
|
|
97
76
|
hasLeftAction: Boolean(o),
|
|
98
77
|
hasRightAction: Boolean(e),
|
|
99
|
-
onChange:
|
|
100
|
-
"aria-required":
|
|
101
|
-
size:
|
|
102
|
-
|
|
78
|
+
onChange: w,
|
|
79
|
+
"aria-required": y,
|
|
80
|
+
size: s,
|
|
81
|
+
...g
|
|
82
|
+
}), e && /* @__PURE__ */ t.createElement(c, {
|
|
103
83
|
paddingLeft: 2,
|
|
104
84
|
paddingRight: 3
|
|
105
85
|
}, e));
|
|
106
86
|
});
|
|
107
|
-
|
|
108
|
-
|
|
87
|
+
d.displayName = "FieldInput";
|
|
88
|
+
d.defaultProps = {
|
|
109
89
|
disabled: !1,
|
|
110
90
|
endAction: void 0,
|
|
111
91
|
size: "M",
|
|
@@ -113,14 +93,14 @@ l.defaultProps = {
|
|
|
113
93
|
onChange() {
|
|
114
94
|
}
|
|
115
95
|
};
|
|
116
|
-
|
|
117
|
-
disabled:
|
|
118
|
-
endAction:
|
|
119
|
-
onChange:
|
|
120
|
-
size:
|
|
121
|
-
startAction:
|
|
96
|
+
d.propTypes = {
|
|
97
|
+
disabled: r.bool,
|
|
98
|
+
endAction: r.element,
|
|
99
|
+
onChange: r.func,
|
|
100
|
+
size: r.oneOf(Object.keys(I.input)),
|
|
101
|
+
startAction: r.element
|
|
122
102
|
};
|
|
123
103
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
104
|
+
d as FieldInput,
|
|
105
|
+
F as InputWrapper
|
|
126
106
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react"),g=require("styled-components"),h=require("prop-types"),n=require("../Flex/Flex.cjs"),m=require("./FieldContext.cjs"),d=require("../Typography/Typography.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=o(y),s=o(g),r=o(h),q=s.default(d.Typography)`
|
|
2
2
|
line-height: 0;
|
|
3
|
-
`,
|
|
3
|
+
`,F=s.default(n.Flex)`
|
|
4
4
|
line-height: 0;
|
|
5
5
|
|
|
6
6
|
svg path {
|
|
7
7
|
fill: ${({theme:e})=>e.colors.neutral500};
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,l=({children:e,action:a,required:i,...u})=>{const{id:c,required:p}=m.useField(),f=p||i;return i!==void 0&&console.warn('Deprecation warning: Usage of "required" prop in FieldLabel component is deprecated. This is discouraged and will be removed in the next major release. Please use the Field component to share the required prop.'),t.default.createElement(d.Typography,{variant:"pi",textColor:"neutral800",htmlFor:c,fontWeight:"bold",as:"label",...u},t.default.createElement(n.Flex,{alignItems:"center"},e,f&&t.default.createElement(q,{textColor:"danger600"},"*"),a&&t.default.createElement(F,{marginLeft:1},a)))};l.defaultProps={action:void 0,required:void 0};l.propTypes={action:r.default.element,children:r.default.node.isRequired,required:r.default.bool};exports.FieldLabel=l;
|
package/dist/Field/FieldLabel.js
CHANGED
|
@@ -1,65 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var r of i(o))
|
|
9
|
-
p.call(o, r) && d(e, r, o[r]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
var c = (e, o) => {
|
|
13
|
-
var r = {};
|
|
14
|
-
for (var t in e)
|
|
15
|
-
s.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
|
|
16
|
-
if (e != null && i)
|
|
17
|
-
for (var t of i(e))
|
|
18
|
-
o.indexOf(t) < 0 && p.call(e, t) && (r[t] = e[t]);
|
|
19
|
-
return r;
|
|
20
|
-
};
|
|
21
|
-
import n from "react";
|
|
22
|
-
import u from "styled-components";
|
|
23
|
-
import l from "prop-types";
|
|
24
|
-
import { Flex as h } from "../Flex/Flex.js";
|
|
25
|
-
import { useField as v } from "./FieldContext.js";
|
|
26
|
-
import { Typography as f } from "../Typography/Typography.js";
|
|
27
|
-
const x = u(f)`
|
|
1
|
+
import e from "react";
|
|
2
|
+
import n from "styled-components";
|
|
3
|
+
import o from "prop-types";
|
|
4
|
+
import { Flex as l } from "../Flex/Flex.js";
|
|
5
|
+
import { useField as u } from "./FieldContext.js";
|
|
6
|
+
import { Typography as a } from "../Typography/Typography.js";
|
|
7
|
+
const h = n(a)`
|
|
28
8
|
line-height: 0;
|
|
29
|
-
`,
|
|
9
|
+
`, f = n(l)`
|
|
30
10
|
line-height: 0;
|
|
31
11
|
|
|
32
12
|
svg path {
|
|
33
|
-
fill: ${({ theme:
|
|
13
|
+
fill: ${({ theme: r }) => r.colors.neutral500};
|
|
34
14
|
}
|
|
35
|
-
`,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return r !== void 0 && console.warn(
|
|
15
|
+
`, d = ({ children: r, action: t, required: i, ...s }) => {
|
|
16
|
+
const { id: p, required: m } = u(), c = m || i;
|
|
17
|
+
return i !== void 0 && console.warn(
|
|
39
18
|
'Deprecation warning: Usage of "required" prop in FieldLabel component is deprecated. This is discouraged and will be removed in the next major release. Please use the Field component to share the required prop.'
|
|
40
|
-
), /* @__PURE__ */
|
|
19
|
+
), /* @__PURE__ */ e.createElement(a, {
|
|
41
20
|
variant: "pi",
|
|
42
21
|
textColor: "neutral800",
|
|
43
|
-
htmlFor:
|
|
22
|
+
htmlFor: p,
|
|
44
23
|
fontWeight: "bold",
|
|
45
|
-
as: "label"
|
|
46
|
-
|
|
24
|
+
as: "label",
|
|
25
|
+
...s
|
|
26
|
+
}, /* @__PURE__ */ e.createElement(l, {
|
|
47
27
|
alignItems: "center"
|
|
48
|
-
},
|
|
28
|
+
}, r, c && /* @__PURE__ */ e.createElement(h, {
|
|
49
29
|
textColor: "danger600"
|
|
50
|
-
}, "*"),
|
|
30
|
+
}, "*"), t && /* @__PURE__ */ e.createElement(f, {
|
|
51
31
|
marginLeft: 1
|
|
52
|
-
},
|
|
32
|
+
}, t)));
|
|
53
33
|
};
|
|
54
|
-
|
|
34
|
+
d.defaultProps = {
|
|
55
35
|
action: void 0,
|
|
56
36
|
required: void 0
|
|
57
37
|
};
|
|
58
|
-
|
|
59
|
-
action:
|
|
60
|
-
children:
|
|
61
|
-
required:
|
|
38
|
+
d.propTypes = {
|
|
39
|
+
action: o.element,
|
|
40
|
+
children: o.node.isRequired,
|
|
41
|
+
required: o.bool
|
|
62
42
|
};
|
|
63
43
|
export {
|
|
64
|
-
|
|
44
|
+
d as FieldLabel
|
|
65
45
|
};
|
package/dist/Flex/FlexProps.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),u=require("prop-types"),l=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},n=l(s),e=l(u),a=t=>n.default.createElement("div",{...t}),r={alignItems:"center",basis:void 0,direction:"row",gap:void 0,inline:!1,justifyContent:void 0,reverse:!1,shrink:void 0,wrap:void 0},o={alignItems:e.default.string,basis:e.default.oneOfType([e.default.string,e.default.number]),direction:e.default.string,gap:e.default.oneOfType([e.default.shape({desktop:e.default.number,mobile:e.default.number,tablet:e.default.number}),e.default.number,e.default.arrayOf(e.default.number),e.default.string]),inline:e.default.bool,justifyContent:e.default.string,reverse:e.default.bool,shrink:e.default.number,wrap:e.default.string};a.defaultProps=r;a.propTypes=o;exports.FlexProps=a;exports.flexDefaultProps=r;exports.flexPropTypes=o;
|
package/dist/Flex/FlexProps.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
var t = Object.getOwnPropertySymbols;
|
|
3
|
-
var l = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var i = (o, r, n) => r in o ? a(o, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[r] = n, s = (o, r) => {
|
|
5
|
-
for (var n in r || (r = {}))
|
|
6
|
-
l.call(r, n) && i(o, n, r[n]);
|
|
7
|
-
if (t)
|
|
8
|
-
for (var n of t(r))
|
|
9
|
-
m.call(r, n) && i(o, n, r[n]);
|
|
10
|
-
return o;
|
|
11
|
-
};
|
|
12
|
-
import f from "react";
|
|
1
|
+
import o from "react";
|
|
13
2
|
import e from "prop-types";
|
|
14
|
-
const
|
|
3
|
+
const r = (n) => /* @__PURE__ */ o.createElement("div", {
|
|
4
|
+
...n
|
|
5
|
+
}), t = {
|
|
15
6
|
alignItems: "center",
|
|
16
7
|
basis: void 0,
|
|
17
8
|
direction: "row",
|
|
@@ -21,7 +12,7 @@ const p = (o) => /* @__PURE__ */ f.createElement("div", s({}, o)), b = {
|
|
|
21
12
|
reverse: !1,
|
|
22
13
|
shrink: void 0,
|
|
23
14
|
wrap: void 0
|
|
24
|
-
},
|
|
15
|
+
}, i = {
|
|
25
16
|
alignItems: e.string,
|
|
26
17
|
basis: e.oneOfType([e.string, e.number]),
|
|
27
18
|
direction: e.string,
|
|
@@ -41,10 +32,10 @@ const p = (o) => /* @__PURE__ */ f.createElement("div", s({}, o)), b = {
|
|
|
41
32
|
shrink: e.number,
|
|
42
33
|
wrap: e.string
|
|
43
34
|
};
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
r.defaultProps = t;
|
|
36
|
+
r.propTypes = i;
|
|
46
37
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
r as FlexProps,
|
|
39
|
+
t as flexDefaultProps,
|
|
40
|
+
i as flexPropTypes
|
|
50
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),b=require("prop-types"),a=require("../helpers/getFocusableNodes.cjs"),f=require("../helpers/keyboardKeys.cjs"),d=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},m=d(r),i=d(b),n=({onEscape:t,restoreFocus:u,...p})=>{const o=r.useRef(null);r.useEffect(()=>{let e=null;return u&&(e=document.activeElement),()=>{e&&e.focus()}},[u]),r.useEffect(()=>{if(!o.current)return;const e=a.getFocusableNodes(o.current);e.length>0?e[0].focus():console.warn("[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one.")},[]);const y=e=>{if(e.key===f.KeyboardKeys.ESCAPE&&t){t();return}if(e.key!==f.KeyboardKeys.TAB)return;const s=a.getFocusableNodes(o.current);if(s.length>0){const c=s[0],l=s[s.length-1];e.shiftKey?c===document.activeElement&&(e.preventDefault(),l.focus()):l===document.activeElement&&(e.preventDefault(),c.focus())}};return m.default.createElement("div",{ref:o,onKeyDown:y,...p})};n.defaultProps={onEscape:void 0,restoreFocus:!0};n.propTypes={onEscape:i.default.func,restoreFocus:i.default.bool};exports.FocusTrap=n;
|
|
@@ -1,69 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var E = (e, t) => {
|
|
13
|
-
var r = {};
|
|
14
|
-
for (var n in e)
|
|
15
|
-
m.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
16
|
-
if (e != null && f)
|
|
17
|
-
for (var n of f(e))
|
|
18
|
-
t.indexOf(n) < 0 && p.call(e, n) && (r[n] = e[n]);
|
|
19
|
-
return r;
|
|
20
|
-
};
|
|
21
|
-
import g, { useRef as D, useEffect as h } from "react";
|
|
22
|
-
import y from "prop-types";
|
|
23
|
-
import { getFocusableNodes as v } from "../helpers/getFocusableNodes.js";
|
|
24
|
-
import { KeyboardKeys as b } from "../helpers/keyboardKeys.js";
|
|
25
|
-
const F = (n) => {
|
|
26
|
-
var u = n, { onEscape: e, restoreFocus: t } = u, r = E(u, ["onEscape", "restoreFocus"]);
|
|
27
|
-
const c = D(null);
|
|
28
|
-
h(() => {
|
|
29
|
-
let o = null;
|
|
30
|
-
return t && (o = document.activeElement), () => {
|
|
31
|
-
o && o.focus();
|
|
1
|
+
import d, { useRef as E, useEffect as f } from "react";
|
|
2
|
+
import u from "prop-types";
|
|
3
|
+
import { getFocusableNodes as l } from "../helpers/getFocusableNodes.js";
|
|
4
|
+
import { KeyboardKeys as i } from "../helpers/keyboardKeys.js";
|
|
5
|
+
const a = ({ onEscape: o, restoreFocus: n, ...m }) => {
|
|
6
|
+
const r = E(null);
|
|
7
|
+
f(() => {
|
|
8
|
+
let e = null;
|
|
9
|
+
return n && (e = document.activeElement), () => {
|
|
10
|
+
e && e.focus();
|
|
32
11
|
};
|
|
33
|
-
}, [
|
|
34
|
-
if (!
|
|
12
|
+
}, [n]), f(() => {
|
|
13
|
+
if (!r.current)
|
|
35
14
|
return;
|
|
36
|
-
const
|
|
37
|
-
|
|
15
|
+
const e = l(r.current);
|
|
16
|
+
e.length > 0 ? e[0].focus() : console.warn(
|
|
38
17
|
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
39
18
|
);
|
|
40
19
|
}, []);
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
20
|
+
const p = (e) => {
|
|
21
|
+
if (e.key === i.ESCAPE && o) {
|
|
22
|
+
o();
|
|
44
23
|
return;
|
|
45
24
|
}
|
|
46
|
-
if (
|
|
25
|
+
if (e.key !== i.TAB)
|
|
47
26
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
|
|
27
|
+
const t = l(r.current);
|
|
28
|
+
if (t.length > 0) {
|
|
29
|
+
const s = t[0], c = t[t.length - 1];
|
|
30
|
+
e.shiftKey ? s === document.activeElement && (e.preventDefault(), c.focus()) : c === document.activeElement && (e.preventDefault(), s.focus());
|
|
52
31
|
}
|
|
53
32
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
ref:
|
|
56
|
-
onKeyDown:
|
|
57
|
-
|
|
33
|
+
return /* @__PURE__ */ d.createElement("div", {
|
|
34
|
+
ref: r,
|
|
35
|
+
onKeyDown: p,
|
|
36
|
+
...m
|
|
37
|
+
});
|
|
58
38
|
};
|
|
59
|
-
|
|
39
|
+
a.defaultProps = {
|
|
60
40
|
onEscape: void 0,
|
|
61
41
|
restoreFocus: !0
|
|
62
42
|
};
|
|
63
|
-
|
|
64
|
-
onEscape:
|
|
65
|
-
restoreFocus:
|
|
43
|
+
a.propTypes = {
|
|
44
|
+
onEscape: u.func,
|
|
45
|
+
restoreFocus: u.bool
|
|
66
46
|
};
|
|
67
47
|
export {
|
|
68
|
-
|
|
48
|
+
a as FocusTrap
|
|
69
49
|
};
|
package/dist/Grid/Grid.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),d=require("styled-components"),n=require("prop-types"),c=require("./GridContext.cjs"),p=require("../Box/Box.cjs"),i=require("../helpers/handleResponsiveValues.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=o(u),f=o(d),t=o(n),y=f.default(p.Box)`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: repeat(${({gridCols:e})=>e}, 1fr);
|
|
4
|
-
${({theme:e,gap:
|
|
5
|
-
`,
|
|
4
|
+
${({theme:e,gap:r})=>i("gap",r,e)}
|
|
5
|
+
`,s=({gap:e,gridCols:r,...l})=>a.default.createElement(c.GridContext.Provider,{value:{gap:e,gridCols:r}},a.default.createElement(y,{gap:e,gridCols:r,...l}));s.defaultProps={gap:0,gridCols:12};s.propTypes={gap:t.default.oneOfType([t.default.number,t.default.arrayOf(t.default.number)]),gridCols:t.default.number};exports.Grid=s;
|
package/dist/Grid/Grid.js
CHANGED
|
@@ -1,50 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var o of m(e))
|
|
9
|
-
d.call(e, o) && i(r, o, e[o]);
|
|
10
|
-
return r;
|
|
11
|
-
};
|
|
12
|
-
var s = (r, e) => {
|
|
13
|
-
var o = {};
|
|
14
|
-
for (var t in r)
|
|
15
|
-
n.call(r, t) && e.indexOf(t) < 0 && (o[t] = r[t]);
|
|
16
|
-
if (r != null && m)
|
|
17
|
-
for (var t of m(r))
|
|
18
|
-
e.indexOf(t) < 0 && d.call(r, t) && (o[t] = r[t]);
|
|
19
|
-
return o;
|
|
20
|
-
};
|
|
21
|
-
import f from "react";
|
|
22
|
-
import y from "styled-components";
|
|
23
|
-
import p from "prop-types";
|
|
24
|
-
import { GridContext as g } from "./GridContext.js";
|
|
25
|
-
import { Box as b } from "../Box/Box.js";
|
|
26
|
-
import v from "../helpers/handleResponsiveValues.js";
|
|
27
|
-
const x = y(b)`
|
|
1
|
+
import t from "react";
|
|
2
|
+
import a from "styled-components";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import { GridContext as i } from "./GridContext.js";
|
|
5
|
+
import { Box as n } from "../Box/Box.js";
|
|
6
|
+
import d from "../helpers/handleResponsiveValues.js";
|
|
7
|
+
const l = a(n)`
|
|
28
8
|
display: grid;
|
|
29
9
|
grid-template-columns: repeat(${({ gridCols: r }) => r}, 1fr);
|
|
30
|
-
${({ theme: r, gap:
|
|
31
|
-
`,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
u.defaultProps = {
|
|
10
|
+
${({ theme: r, gap: o }) => d("gap", o, r)}
|
|
11
|
+
`, p = ({ gap: r, gridCols: o, ...m }) => /* @__PURE__ */ t.createElement(i.Provider, {
|
|
12
|
+
value: { gap: r, gridCols: o }
|
|
13
|
+
}, /* @__PURE__ */ t.createElement(l, {
|
|
14
|
+
gap: r,
|
|
15
|
+
gridCols: o,
|
|
16
|
+
...m
|
|
17
|
+
}));
|
|
18
|
+
p.defaultProps = {
|
|
41
19
|
gap: 0,
|
|
42
20
|
gridCols: 12
|
|
43
21
|
};
|
|
44
|
-
|
|
45
|
-
gap:
|
|
46
|
-
gridCols:
|
|
22
|
+
p.propTypes = {
|
|
23
|
+
gap: e.oneOfType([e.number, e.arrayOf(e.number)]),
|
|
24
|
+
gridCols: e.number
|
|
47
25
|
};
|
|
48
26
|
export {
|
|
49
|
-
|
|
27
|
+
p as Grid
|
|
50
28
|
};
|