orcs-design-system 3.2.4 → 3.2.6
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/es/GlobalStyles.js +1 -31
- package/es/SystemThemeProvider.js +11 -5
- package/es/assets/Colour/Colour.stories.js +211 -0
- package/es/assets/Colour/index.js +3 -3
- package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
- package/es/components/ActionsMenu/index.js +144 -229
- package/es/components/Avatar/Avatar.stories.js +212 -196
- package/es/components/Avatar/index.js +280 -307
- package/es/components/Badge/Badge.stories.js +71 -46
- package/es/components/Badge/index.js +71 -74
- package/es/components/Box/Box.stories.js +51 -35
- package/es/components/Box/index.js +33 -34
- package/es/components/Button/Button.stories.js +161 -145
- package/es/components/Button/ButtonLink.stories.js +152 -139
- package/es/components/Button/index.js +79 -99
- package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
- package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
- package/es/components/ButtonGroup/index.js +103 -99
- package/es/components/Card/Card.stories.js +94 -62
- package/es/components/Card/index.js +50 -71
- package/es/components/Checkbox/Checkbox.stories.js +37 -43
- package/es/components/Checkbox/index.js +61 -76
- package/es/components/DatePicker/DatePicker.stories.js +86 -118
- package/es/components/DatePicker/index.js +71 -187
- package/es/components/Divider/Divider.stories.js +39 -42
- package/es/components/Divider/index.js +21 -27
- package/es/components/Expandable/Expandable.stories.js +46 -36
- package/es/components/Expandable/index.js +55 -82
- package/es/components/Flex/Flex.stories.js +19 -5
- package/es/components/Flex/FlexItem.stories.js +10 -9
- package/es/components/Flex/index.js +34 -27
- package/es/components/Grid/Grid.stories.js +129 -55
- package/es/components/Grid/index.js +25 -24
- package/es/components/Header/Header.stories.js +101 -92
- package/es/components/Header/index.js +433 -436
- package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
- package/es/components/HeaderSimple/index.js +73 -68
- package/es/components/Icon/Icon.stories.js +58 -57
- package/es/components/Icon/index.js +48 -46
- package/es/components/Loading/Loading.stories.js +32 -39
- package/es/components/Loading/index.js +44 -51
- package/es/components/Modal/Modal.stories.js +172 -153
- package/es/components/Modal/index.js +126 -134
- package/es/components/Notification/Notification.stories.js +59 -58
- package/es/components/Notification/index.js +123 -133
- package/es/components/Popover/Popover.stories.js +134 -102
- package/es/components/Popover/index.js +65 -111
- package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
- package/es/components/ProgressBar/index.js +29 -34
- package/es/components/RadioButton/RadioButton.stories.js +32 -37
- package/es/components/RadioButton/index.js +170 -184
- package/es/components/Range/Range.stories.js +19 -19
- package/es/components/Range/index.js +35 -45
- package/es/components/Select/Select.stories.js +107 -128
- package/es/components/Select/index.js +324 -336
- package/es/components/SideNav/NavItem.js +112 -122
- package/es/components/SideNav/SideNav.stories.js +84 -57
- package/es/components/SideNav/index.js +161 -185
- package/es/components/Sidebar/Sidebar.stories.js +50 -33
- package/es/components/Sidebar/index.js +152 -155
- package/es/components/Spacer/Spacer.stories.js +35 -32
- package/es/components/Spacer/index.js +20 -20
- package/es/components/StatusDot/StatusDot.stories.js +103 -90
- package/es/components/StatusDot/index.js +36 -38
- package/es/components/StyledLink/StyledLink.stories.js +68 -69
- package/es/components/StyledLink/index.js +47 -48
- package/es/components/Table/Table.stories.js +118 -112
- package/es/components/Table/getExpandColumnConfig.js +67 -62
- package/es/components/Table/index.js +24 -27
- package/es/components/Table/muiStyleOverrides.js +10 -8
- package/es/components/Tabs/Tab.stories.js +55 -38
- package/es/components/Tabs/TabsContainer.stories.js +30 -22
- package/es/components/Tabs/index.js +95 -92
- package/es/components/Tag/Tag.stories.js +250 -220
- package/es/components/Tag/index.js +118 -190
- package/es/components/TextArea/TextArea.stories.js +76 -89
- package/es/components/TextArea/index.js +117 -115
- package/es/components/TextInput/TextInput.stories.js +41 -61
- package/es/components/TextInput/index.js +127 -171
- package/es/components/Toggle/Toggle.stories.js +63 -62
- package/es/components/Toggle/index.js +43 -77
- package/es/components/TreeNav/TreeNav.stories.js +7 -8
- package/es/components/TreeNav/index.js +72 -69
- package/es/components/Typography/Typography.stories.js +174 -0
- package/es/components/Typography/index.js +252 -308
- package/es/components.test.js +1 -1
- package/es/hooks/isVisible.js +6 -10
- package/es/hooks/keepInView.js +27 -32
- package/es/hooks/keypress.js +14 -14
- package/es/hooks/useInputFocus.js +5 -5
- package/es/hooks/usePrevious.js +3 -3
- package/es/systemThemeCollapsed.js +53 -53
- package/es/systemtheme.js +53 -53
- package/es/utils/selectUtil.js +1 -1
- package/es/utils/selectUtil.test.js +6 -6
- package/package.json +29 -38
|
@@ -3,58 +3,83 @@ import Box from "../Box";
|
|
|
3
3
|
import Spacer from "../Spacer";
|
|
4
4
|
import Flex from "../Flex";
|
|
5
5
|
import Badge from ".";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
7
|
export default {
|
|
7
8
|
title: "Components/Badge",
|
|
8
9
|
component: Badge
|
|
9
10
|
};
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
};
|
|
11
|
+
export const defaultBadge = () => /*#__PURE__*/_jsx(Badge, {
|
|
12
|
+
children: "Default"
|
|
13
|
+
});
|
|
13
14
|
defaultBadge.storyName = "Default";
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
p: "r"
|
|
17
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
18
|
-
flexWrap: "wrap"
|
|
19
|
-
}, /*#__PURE__*/React.createElement(Spacer, {
|
|
20
|
-
m: "1"
|
|
21
|
-
}, /*#__PURE__*/React.createElement(Badge, null, "Default"), /*#__PURE__*/React.createElement(Badge, {
|
|
22
|
-
variant: "success"
|
|
23
|
-
}, "Success"), /*#__PURE__*/React.createElement(Badge, {
|
|
24
|
-
variant: "warning"
|
|
25
|
-
}, "Warning"), /*#__PURE__*/React.createElement(Badge, {
|
|
26
|
-
variant: "danger"
|
|
27
|
-
}, "Danger"), /*#__PURE__*/React.createElement(Badge, {
|
|
28
|
-
variant: "primaryLight"
|
|
29
|
-
}, "Low priority"), /*#__PURE__*/React.createElement(Badge, {
|
|
30
|
-
variant: "primary"
|
|
31
|
-
}, "Medium priority"), /*#__PURE__*/React.createElement(Badge, {
|
|
32
|
-
variant: "primaryDark"
|
|
33
|
-
}, "High priority"), /*#__PURE__*/React.createElement(Badge, {
|
|
34
|
-
variant: "secondary"
|
|
35
|
-
}, "Secondary")))), /*#__PURE__*/React.createElement(Box, {
|
|
15
|
+
export const colourVariants = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
16
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
36
17
|
p: "r",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
18
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
19
|
+
flexWrap: "wrap",
|
|
20
|
+
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
21
|
+
m: "1",
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
23
|
+
children: "Default"
|
|
24
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
25
|
+
variant: "success",
|
|
26
|
+
children: "Success"
|
|
27
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
28
|
+
variant: "warning",
|
|
29
|
+
children: "Warning"
|
|
30
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
31
|
+
variant: "danger",
|
|
32
|
+
children: "Danger"
|
|
33
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
34
|
+
variant: "primaryLight",
|
|
35
|
+
children: "Low priority"
|
|
36
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
37
|
+
variant: "primary",
|
|
38
|
+
children: "Medium priority"
|
|
39
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
40
|
+
variant: "primaryDark",
|
|
41
|
+
children: "High priority"
|
|
42
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
43
|
+
variant: "secondary",
|
|
44
|
+
children: "Secondary"
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
49
|
+
p: "r",
|
|
50
|
+
bg: "greyDarkest",
|
|
51
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
52
|
+
flexWrap: "wrap",
|
|
53
|
+
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
54
|
+
m: "1",
|
|
55
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
56
|
+
children: "Default"
|
|
57
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
58
|
+
variant: "success",
|
|
59
|
+
children: "Success"
|
|
60
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
61
|
+
variant: "warning",
|
|
62
|
+
children: "Warning"
|
|
63
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
64
|
+
variant: "danger",
|
|
65
|
+
children: "Danger"
|
|
66
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
67
|
+
variant: "primaryLight",
|
|
68
|
+
children: "Low priority"
|
|
69
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
70
|
+
variant: "primary",
|
|
71
|
+
children: "Medium priority"
|
|
72
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
73
|
+
variant: "primaryDark",
|
|
74
|
+
children: "High priority"
|
|
75
|
+
}), /*#__PURE__*/_jsx(Badge, {
|
|
76
|
+
variant: "secondary",
|
|
77
|
+
children: "Secondary"
|
|
78
|
+
})]
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
58
83
|
colourVariants.storyName = "Colour variants";
|
|
59
84
|
defaultBadge.__docgenInfo = {
|
|
60
85
|
"description": "",
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["noWrap", "children", "theme"];
|
|
4
1
|
import React from "react";
|
|
5
2
|
import styled, { ThemeProvider } from "styled-components";
|
|
6
3
|
import PropTypes from "prop-types";
|
|
@@ -8,81 +5,81 @@ import { space, layout, color, compose, variant } from "styled-system";
|
|
|
8
5
|
import { css } from "@styled-system/css";
|
|
9
6
|
import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
10
7
|
import { themeGet } from "@styled-system/theme-get";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const BadgeStyles = compose(space, layout, color);
|
|
10
|
+
const Item = styled("span").withConfig({
|
|
11
|
+
shouldForwardProp,
|
|
14
12
|
displayName: "Badge__Item",
|
|
15
13
|
componentId: "sc-9r75kj-0"
|
|
16
|
-
}).attrs(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
bg: themeGet("colors.primaryLight")(props)
|
|
67
|
-
},
|
|
68
|
-
secondary: {
|
|
69
|
-
color: themeGet("colors.secondaryDarkest")(props),
|
|
70
|
-
bg: themeGet("colors.secondaryEvenLighter")(props)
|
|
71
|
-
}
|
|
14
|
+
}).attrs(props => ({
|
|
15
|
+
"data-testid": props["data-testid"] ? props["data-testid"] : null
|
|
16
|
+
}))(props => css({
|
|
17
|
+
fontSize: themeGet("fontSizes.0")(props),
|
|
18
|
+
lineHeight: themeGet("fontSizes.1")(props),
|
|
19
|
+
fontWeight: themeGet("fontWeights.2")(props),
|
|
20
|
+
display: "inline-block",
|
|
21
|
+
position: "relative",
|
|
22
|
+
pt: themeGet("space.2")(props),
|
|
23
|
+
pb: "calc(".concat(themeGet("space.2")(props), " + 1px)"),
|
|
24
|
+
px: themeGet("space.3")(props),
|
|
25
|
+
cursor: "default",
|
|
26
|
+
borderRadius: 1,
|
|
27
|
+
color: themeGet("colors.greyDarkest")(props),
|
|
28
|
+
bg: themeGet("colors.greyLighter")(props),
|
|
29
|
+
whiteSpace: props.noWrap ? "nowrap" : "normal"
|
|
30
|
+
}), props => variant({
|
|
31
|
+
variants: {
|
|
32
|
+
default: {},
|
|
33
|
+
success: {
|
|
34
|
+
color: themeGet("colors.successDarkest")(props),
|
|
35
|
+
bg: themeGet("colors.successLightest")(props)
|
|
36
|
+
},
|
|
37
|
+
successPending: {
|
|
38
|
+
color: themeGet("colors.successDark")(props),
|
|
39
|
+
bg: themeGet("colors.successEvenLighter")(props)
|
|
40
|
+
},
|
|
41
|
+
warning: {
|
|
42
|
+
color: themeGet("colors.warningDarkest")(props),
|
|
43
|
+
bg: themeGet("colors.warningLighter")(props)
|
|
44
|
+
},
|
|
45
|
+
danger: {
|
|
46
|
+
color: themeGet("colors.dangerDarkest")(props),
|
|
47
|
+
bg: themeGet("colors.dangerLightest")(props)
|
|
48
|
+
},
|
|
49
|
+
primaryLight: {
|
|
50
|
+
color: themeGet("colors.primaryDarker")(props),
|
|
51
|
+
bg: themeGet("colors.primaryLightest")(props)
|
|
52
|
+
},
|
|
53
|
+
primary: {
|
|
54
|
+
color: themeGet("colors.primaryDarkest")(props),
|
|
55
|
+
bg: themeGet("colors.primaryLighter")(props)
|
|
56
|
+
},
|
|
57
|
+
primaryDark: {
|
|
58
|
+
color: themeGet("colors.primaryDarkest")(props),
|
|
59
|
+
bg: themeGet("colors.primaryLight")(props)
|
|
60
|
+
},
|
|
61
|
+
secondary: {
|
|
62
|
+
color: themeGet("colors.secondaryDarkest")(props),
|
|
63
|
+
bg: themeGet("colors.secondaryEvenLighter")(props)
|
|
72
64
|
}
|
|
73
|
-
}
|
|
74
|
-
}, BadgeStyles);
|
|
65
|
+
}
|
|
66
|
+
}), BadgeStyles);
|
|
75
67
|
export default function Badge(_ref) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
68
|
+
let {
|
|
69
|
+
noWrap,
|
|
70
|
+
children,
|
|
71
|
+
theme,
|
|
72
|
+
...props
|
|
73
|
+
} = _ref;
|
|
74
|
+
const component = /*#__PURE__*/_jsx(Item, {
|
|
75
|
+
noWrap: noWrap,
|
|
76
|
+
...props,
|
|
77
|
+
children: children
|
|
78
|
+
});
|
|
79
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
80
|
+
theme: theme,
|
|
81
|
+
children: component
|
|
82
|
+
}) : component;
|
|
86
83
|
}
|
|
87
84
|
Badge.propTypes = {
|
|
88
85
|
/** Specifies badge colour. Colours are taken from the standard design system colours. */
|
|
@@ -1,58 +1,74 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Box from "../Box";
|
|
3
3
|
import { P } from "../Typography";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
export default {
|
|
5
6
|
title: "Components/Box",
|
|
6
7
|
component: Box
|
|
7
8
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export const basicBox = () => /*#__PURE__*/_jsx(Box, {
|
|
10
|
+
children: /*#__PURE__*/_jsx(P, {
|
|
11
|
+
children: "This is an example of the basic Box with no properties applied to it."
|
|
12
|
+
})
|
|
13
|
+
});
|
|
11
14
|
basicBox.storyName = "Default Box";
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
15
|
+
export const borderBox = () => /*#__PURE__*/_jsx(Box, {
|
|
16
|
+
boxBorder: "default",
|
|
17
|
+
p: "r",
|
|
18
|
+
children: /*#__PURE__*/_jsx(P, {
|
|
19
|
+
children: "This is a variant of a Box with a border."
|
|
20
|
+
})
|
|
21
|
+
});
|
|
18
22
|
borderBox.story = {
|
|
19
23
|
name: "Border Box"
|
|
20
24
|
};
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
25
|
+
export const shadow = () => /*#__PURE__*/_jsx(Box, {
|
|
26
|
+
shadow: "default",
|
|
27
|
+
p: "r",
|
|
28
|
+
children: /*#__PURE__*/_jsx(P, {
|
|
29
|
+
children: "This is a variant of a Box with a slight drop shadow."
|
|
30
|
+
})
|
|
31
|
+
});
|
|
27
32
|
shadow.story = {
|
|
28
33
|
name: "Drop shadow"
|
|
29
34
|
};
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
export const backgroundColour = () => /*#__PURE__*/_jsx(Box, {
|
|
36
|
+
bg: "greyLightest",
|
|
37
|
+
p: "r",
|
|
38
|
+
children: /*#__PURE__*/_jsxs(P, {
|
|
39
|
+
children: ["This is a Box that has background colour set to ", /*#__PURE__*/_jsx("code", {
|
|
40
|
+
children: "greyLightest"
|
|
41
|
+
}), "."]
|
|
42
|
+
})
|
|
43
|
+
});
|
|
36
44
|
backgroundColour.story = {
|
|
37
45
|
name: "Background colour"
|
|
38
46
|
};
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
47
|
+
export const padding = () => /*#__PURE__*/_jsx(Box, {
|
|
48
|
+
boxBorder: "default",
|
|
49
|
+
p: 6,
|
|
50
|
+
children: /*#__PURE__*/_jsx(P, {
|
|
51
|
+
children: "This is a bordered Box variant with specified padding that overrides the default padding value."
|
|
52
|
+
})
|
|
53
|
+
});
|
|
45
54
|
padding.story = {
|
|
46
55
|
name: "Padding"
|
|
47
56
|
};
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
export const borderRadius = () => /*#__PURE__*/_jsx(Box, {
|
|
58
|
+
borderRadius: 2,
|
|
59
|
+
boxBorder: "default",
|
|
60
|
+
shadow: "default",
|
|
61
|
+
p: "r",
|
|
62
|
+
children: /*#__PURE__*/_jsxs(P, {
|
|
63
|
+
children: ["This is a bordered Box variant with rounded corners.", /*#__PURE__*/_jsx("code", {
|
|
64
|
+
children: "borderRadius"
|
|
65
|
+
}), " is taken from the ", /*#__PURE__*/_jsx("code", {
|
|
66
|
+
children: "radii"
|
|
67
|
+
}), " array in", /*#__PURE__*/_jsx("code", {
|
|
68
|
+
children: "systemtheme.js"
|
|
69
|
+
}), "."]
|
|
70
|
+
})
|
|
71
|
+
});
|
|
56
72
|
borderRadius.story = {
|
|
57
73
|
name: "Rounded corners"
|
|
58
74
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "theme", "dataTestId"];
|
|
4
1
|
import React, { forwardRef } from "react";
|
|
5
2
|
import styled, { ThemeProvider } from "styled-components";
|
|
6
3
|
import { space, layout, color, border, variant, compose } from "styled-system";
|
|
@@ -8,50 +5,52 @@ import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
|
8
5
|
import { css } from "@styled-system/css";
|
|
9
6
|
import PropTypes from "prop-types";
|
|
10
7
|
import { themeGet } from "@styled-system/theme-get";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const boxStyles = compose(space, layout, color, border);
|
|
10
|
+
const BoxWrapper = styled("div").withConfig({
|
|
11
|
+
shouldForwardProp,
|
|
14
12
|
displayName: "Box__BoxWrapper",
|
|
15
13
|
componentId: "sc-jr1api-0"
|
|
16
|
-
}).attrs(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
})(css({
|
|
14
|
+
}).attrs(props => ({
|
|
15
|
+
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
16
|
+
}))(css({
|
|
21
17
|
width: "auto",
|
|
22
18
|
display: "block",
|
|
23
19
|
overflow: "visible"
|
|
24
20
|
}), variant({
|
|
25
21
|
prop: "shadow",
|
|
26
22
|
variants: {
|
|
27
|
-
|
|
23
|
+
default: {
|
|
28
24
|
boxShadow: "boxDefault"
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
borderColor: themeGet("colors.greyLighter")(props)
|
|
39
|
-
}
|
|
27
|
+
}), props => variant({
|
|
28
|
+
prop: "boxBorder",
|
|
29
|
+
variants: {
|
|
30
|
+
default: {
|
|
31
|
+
borderStyle: "solid",
|
|
32
|
+
borderWidth: themeGet("borderWidths.1")(props),
|
|
33
|
+
borderColor: themeGet("colors.greyLighter")(props)
|
|
40
34
|
}
|
|
41
|
-
}
|
|
42
|
-
}, boxStyles);
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
}
|
|
36
|
+
}), boxStyles);
|
|
37
|
+
export const Box = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
38
|
+
let {
|
|
39
|
+
children,
|
|
40
|
+
theme,
|
|
41
|
+
dataTestId,
|
|
42
|
+
...props
|
|
43
|
+
} = _ref;
|
|
44
|
+
const component = /*#__PURE__*/_jsx(BoxWrapper, {
|
|
49
45
|
ref: ref,
|
|
50
|
-
dataTestId: dataTestId
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
dataTestId: dataTestId,
|
|
47
|
+
...props,
|
|
48
|
+
children: children
|
|
49
|
+
});
|
|
50
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
51
|
+
theme: theme,
|
|
52
|
+
children: component
|
|
53
|
+
}) : component;
|
|
55
54
|
});
|
|
56
55
|
Box.__docgenInfo = {
|
|
57
56
|
"description": "",
|