orcs-design-system 3.2.3 → 3.2.5
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 +30 -38
package/es/GlobalStyles.js
CHANGED
|
@@ -3,35 +3,5 @@ import { themeGet } from "@styled-system/theme-get";
|
|
|
3
3
|
// GLOBAL STYLES
|
|
4
4
|
// For browser reset, setting global box sizing and font sizing etc.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
return themeGet("space.0")(props);
|
|
8
|
-
}, function (props) {
|
|
9
|
-
return themeGet("fonts.main")(props);
|
|
10
|
-
}, function (props) {
|
|
11
|
-
return themeGet("colors.greyDarkest")(props);
|
|
12
|
-
}, function (props) {
|
|
13
|
-
return themeGet("fontSizes.2")(props);
|
|
14
|
-
}, function (props) {
|
|
15
|
-
return themeGet("appScale.navBarSize")(props);
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return themeGet("space.0")(props);
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return themeGet("fontWeights.1")(props);
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return themeGet("fonts.main")(props);
|
|
22
|
-
}, function (props) {
|
|
23
|
-
return themeGet("space.0")(props);
|
|
24
|
-
}, function (props) {
|
|
25
|
-
return themeGet("fontSizes.6")(props);
|
|
26
|
-
}, function (props) {
|
|
27
|
-
return themeGet("fontSizes.5")(props);
|
|
28
|
-
}, function (props) {
|
|
29
|
-
return themeGet("fontSizes.4")(props);
|
|
30
|
-
}, function (props) {
|
|
31
|
-
return themeGet("fontSizes.3")(props);
|
|
32
|
-
}, function (props) {
|
|
33
|
-
return themeGet("fontSizes.2")(props);
|
|
34
|
-
}, function (props) {
|
|
35
|
-
return themeGet("fontSizes.1")(props);
|
|
36
|
-
});
|
|
6
|
+
const GlobalStyles = createGlobalStyle(["html{box-sizing:border-box;line-height:1.15;line-height:calc(2px + 2ex + 2px);}html *{line-height:calc(2px + 2ex + 2px);}*,*:before,*:after{box-sizing:inherit;}html,body{height:100%;width:100%;margin:", ";}body{font-family:", ";color:", ";}html{font-size:62.5%;}body{font-size:", ";}main{display:flex;align-items:stretch;align-content:stretch;width:100%;}section{height:", ";width:100%;overflow-y:scroll;}img{border-style:none;}small{font-size:80%;}p{margin:", ";}h1,h2,h3,h4,h5,h6{font-weight:", ";font-family:", ";margin:", ";}h1{font-size:", "}h2{font-size:", "}h3{font-size:", "}h4{font-size:", "}h5{font-size:", "}h6{font-size:", "}a,p,small,li,h1,h2,h3,h4,h5,h6{word-break:break-word;}"], props => themeGet("space.0")(props), props => themeGet("fonts.main")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("fontSizes.2")(props), props => themeGet("appScale.navBarSize")(props), props => themeGet("space.0")(props), props => themeGet("fontWeights.1")(props), props => themeGet("fonts.main")(props), props => themeGet("space.0")(props), props => themeGet("fontSizes.6")(props), props => themeGet("fontSizes.5")(props), props => themeGet("fontSizes.4")(props), props => themeGet("fontSizes.3")(props), props => themeGet("fontSizes.2")(props), props => themeGet("fontSizes.1")(props));
|
|
37
7
|
export default GlobalStyles;
|
|
@@ -3,11 +3,17 @@ import PropTypes from "prop-types";
|
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
4
|
import { default as GlobalStyles } from "./GlobalStyles";
|
|
5
5
|
import systemtheme from "./systemtheme";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const SystemThemeProvider = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children
|
|
10
|
+
} = _ref;
|
|
11
|
+
return /*#__PURE__*/_jsx(ThemeProvider, {
|
|
12
|
+
theme: systemtheme,
|
|
13
|
+
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
+
children: [/*#__PURE__*/_jsx(GlobalStyles, {}), children]
|
|
15
|
+
})
|
|
16
|
+
});
|
|
11
17
|
};
|
|
12
18
|
SystemThemeProvider.propTypes = {
|
|
13
19
|
children: PropTypes.node
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Colour } from ".";
|
|
3
|
+
import Flex from "../../components/Flex";
|
|
4
|
+
import Box from "../../components/Box";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export default {
|
|
7
|
+
title: "System/Colour" // Title of your story section
|
|
8
|
+
};
|
|
9
|
+
export const BlackOpacityScale = () => /*#__PURE__*/_jsxs(Flex, {
|
|
10
|
+
justifyContent: "center",
|
|
11
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
12
|
+
bg: "black"
|
|
13
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
14
|
+
bg: "black90"
|
|
15
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
16
|
+
bg: "black80"
|
|
17
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
18
|
+
bg: "black70"
|
|
19
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
20
|
+
bg: "black60"
|
|
21
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
22
|
+
bg: "black50"
|
|
23
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
24
|
+
bg: "black40"
|
|
25
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
26
|
+
bg: "black30"
|
|
27
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
28
|
+
bg: "black20"
|
|
29
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
30
|
+
bg: "black10"
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
export const WhiteOpacityScale = () => /*#__PURE__*/_jsx(Box, {
|
|
34
|
+
bg: "greyDarkest",
|
|
35
|
+
padding: "6",
|
|
36
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
39
|
+
bg: "white"
|
|
40
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
41
|
+
bg: "white90"
|
|
42
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
43
|
+
bg: "white80"
|
|
44
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
45
|
+
bg: "white70"
|
|
46
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
47
|
+
bg: "white60"
|
|
48
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
49
|
+
bg: "white50"
|
|
50
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
51
|
+
bg: "white40"
|
|
52
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
53
|
+
bg: "white30"
|
|
54
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
55
|
+
bg: "white20"
|
|
56
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
57
|
+
bg: "white10"
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
export const PrimaryOpacityScale = {
|
|
62
|
+
render: () => /*#__PURE__*/_jsxs(Flex, {
|
|
63
|
+
justifyContent: "center",
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
65
|
+
bg: "primary"
|
|
66
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
67
|
+
bg: "primary90"
|
|
68
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
69
|
+
bg: "primary80"
|
|
70
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
71
|
+
bg: "primary70"
|
|
72
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
73
|
+
bg: "primary60"
|
|
74
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
75
|
+
bg: "primary50"
|
|
76
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
77
|
+
bg: "primary40"
|
|
78
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
79
|
+
bg: "primary30"
|
|
80
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
81
|
+
bg: "primary20"
|
|
82
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
83
|
+
bg: "primary10"
|
|
84
|
+
})]
|
|
85
|
+
}),
|
|
86
|
+
name: "Primary Opacity Scale"
|
|
87
|
+
};
|
|
88
|
+
export const SecondaryOpacityScale = {
|
|
89
|
+
render: () => /*#__PURE__*/_jsxs(Flex, {
|
|
90
|
+
justifyContent: "center",
|
|
91
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
92
|
+
bg: "secondary"
|
|
93
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
94
|
+
bg: "secondary90"
|
|
95
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
96
|
+
bg: "secondary80"
|
|
97
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
98
|
+
bg: "secondary70"
|
|
99
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
100
|
+
bg: "secondary60"
|
|
101
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
102
|
+
bg: "secondary50"
|
|
103
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
104
|
+
bg: "secondary40"
|
|
105
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
106
|
+
bg: "secondary30"
|
|
107
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
108
|
+
bg: "secondary20"
|
|
109
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
110
|
+
bg: "secondary10"
|
|
111
|
+
})]
|
|
112
|
+
}),
|
|
113
|
+
name: "Secondary Opacity Scale"
|
|
114
|
+
};
|
|
115
|
+
export const SuccessOpacityScale = () => /*#__PURE__*/_jsxs(Flex, {
|
|
116
|
+
justifyContent: "center",
|
|
117
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
118
|
+
bg: "success"
|
|
119
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
120
|
+
bg: "success90"
|
|
121
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
122
|
+
bg: "success80"
|
|
123
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
124
|
+
bg: "success70"
|
|
125
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
126
|
+
bg: "success60"
|
|
127
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
128
|
+
bg: "success50"
|
|
129
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
130
|
+
bg: "success40"
|
|
131
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
132
|
+
bg: "success30"
|
|
133
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
134
|
+
bg: "success20"
|
|
135
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
136
|
+
bg: "success10"
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
139
|
+
export const WarningOpacityScale = () => /*#__PURE__*/_jsxs(Flex, {
|
|
140
|
+
justifyContent: "center",
|
|
141
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
142
|
+
bg: "warning"
|
|
143
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
144
|
+
bg: "warning90"
|
|
145
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
146
|
+
bg: "warning80"
|
|
147
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
148
|
+
bg: "warning70"
|
|
149
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
150
|
+
bg: "warning60"
|
|
151
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
152
|
+
bg: "warning50"
|
|
153
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
154
|
+
bg: "warning40"
|
|
155
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
156
|
+
bg: "warning30"
|
|
157
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
158
|
+
bg: "warning20"
|
|
159
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
160
|
+
bg: "warning10"
|
|
161
|
+
})]
|
|
162
|
+
});
|
|
163
|
+
export const DangerOpacityScale = () => /*#__PURE__*/_jsxs(Flex, {
|
|
164
|
+
justifyContent: "center",
|
|
165
|
+
children: [/*#__PURE__*/_jsx(Colour, {
|
|
166
|
+
bg: "danger"
|
|
167
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
168
|
+
bg: "danger90"
|
|
169
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
170
|
+
bg: "danger80"
|
|
171
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
172
|
+
bg: "danger70"
|
|
173
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
174
|
+
bg: "danger60"
|
|
175
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
176
|
+
bg: "danger50"
|
|
177
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
178
|
+
bg: "danger40"
|
|
179
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
180
|
+
bg: "danger30"
|
|
181
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
182
|
+
bg: "danger20"
|
|
183
|
+
}), /*#__PURE__*/_jsx(Colour, {
|
|
184
|
+
bg: "danger10"
|
|
185
|
+
})]
|
|
186
|
+
});
|
|
187
|
+
BlackOpacityScale.__docgenInfo = {
|
|
188
|
+
"description": "",
|
|
189
|
+
"methods": [],
|
|
190
|
+
"displayName": "BlackOpacityScale"
|
|
191
|
+
};
|
|
192
|
+
WhiteOpacityScale.__docgenInfo = {
|
|
193
|
+
"description": "",
|
|
194
|
+
"methods": [],
|
|
195
|
+
"displayName": "WhiteOpacityScale"
|
|
196
|
+
};
|
|
197
|
+
SuccessOpacityScale.__docgenInfo = {
|
|
198
|
+
"description": "",
|
|
199
|
+
"methods": [],
|
|
200
|
+
"displayName": "SuccessOpacityScale"
|
|
201
|
+
};
|
|
202
|
+
WarningOpacityScale.__docgenInfo = {
|
|
203
|
+
"description": "",
|
|
204
|
+
"methods": [],
|
|
205
|
+
"displayName": "WarningOpacityScale"
|
|
206
|
+
};
|
|
207
|
+
DangerOpacityScale.__docgenInfo = {
|
|
208
|
+
"description": "",
|
|
209
|
+
"methods": [],
|
|
210
|
+
"displayName": "DangerOpacityScale"
|
|
211
|
+
};
|
|
@@ -2,11 +2,11 @@ import styled from "styled-components";
|
|
|
2
2
|
import { themeGet } from "@styled-system/theme-get";
|
|
3
3
|
import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
4
4
|
import { css } from "styled-components";
|
|
5
|
-
export
|
|
6
|
-
shouldForwardProp
|
|
5
|
+
export const Colour = styled("div").withConfig({
|
|
6
|
+
shouldForwardProp,
|
|
7
7
|
displayName: "Colour",
|
|
8
8
|
componentId: "sc-uyvdow-0"
|
|
9
|
-
})(
|
|
9
|
+
})(props => {
|
|
10
10
|
return css({
|
|
11
11
|
backgroundColor: themeGet("colors.".concat(props.bg))(props),
|
|
12
12
|
width: "75px",
|