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
|
@@ -2,34 +2,42 @@ import React from "react";
|
|
|
2
2
|
import Box from "../Box";
|
|
3
3
|
import Popover from "../Popover";
|
|
4
4
|
import { TabsContainer, Tab } from ".";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
6
|
export default {
|
|
6
7
|
title: "Components/Tabs",
|
|
7
|
-
decorators: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}],
|
|
8
|
+
decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
|
|
9
|
+
bg: "greyLightest",
|
|
10
|
+
p: "xl",
|
|
11
|
+
children: storyFn()
|
|
12
|
+
})],
|
|
13
13
|
component: TabsContainer
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export const defaultTabs = () => /*#__PURE__*/_jsxs(TabsContainer, {
|
|
16
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
17
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
18
|
+
href: "#",
|
|
19
|
+
children: "Details"
|
|
20
|
+
})
|
|
21
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
19
22
|
direction: "top",
|
|
20
23
|
text: "Example with tooltip explaining tab",
|
|
21
|
-
width: "218px"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
width: "218px",
|
|
25
|
+
children: /*#__PURE__*/_jsx(Tab, {
|
|
26
|
+
active: true,
|
|
27
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
28
|
+
href: "#",
|
|
29
|
+
tabIndex: "-1",
|
|
30
|
+
children: "Additional information"
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
34
|
+
notification: "97",
|
|
35
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
36
|
+
href: "#",
|
|
37
|
+
children: "Planning"
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
33
41
|
defaultTabs.story = {
|
|
34
42
|
name: "Default Tabs"
|
|
35
43
|
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["theme", "children", "active", "notification"],
|
|
4
|
-
_excluded2 = ["theme", "children"];
|
|
5
1
|
import React from "react";
|
|
6
2
|
import PropTypes from "prop-types";
|
|
7
3
|
import styled, { ThemeProvider } from "styled-components";
|
|
8
4
|
import { themeGet } from "@styled-system/theme-get";
|
|
9
5
|
import { css } from "@styled-system/css";
|
|
10
6
|
import { space, color } from "styled-system";
|
|
11
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const TabsContainerItem = styled("div").withConfig({
|
|
12
9
|
displayName: "Tabs__TabsContainerItem",
|
|
13
10
|
componentId: "sc-15tpvnt-0"
|
|
14
11
|
})(css({
|
|
@@ -18,95 +15,96 @@ export var TabsContainerItem = styled("div").withConfig({
|
|
|
18
15
|
flexWrap: "wrap",
|
|
19
16
|
bg: "transparent"
|
|
20
17
|
}), space);
|
|
21
|
-
export
|
|
18
|
+
export const TabItem = styled("div").withConfig({
|
|
22
19
|
displayName: "Tabs__TabItem",
|
|
23
20
|
componentId: "sc-15tpvnt-1"
|
|
24
|
-
})(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
})(props => css({
|
|
22
|
+
marginRight: 3,
|
|
23
|
+
a: {
|
|
24
|
+
borderRadius: themeGet("radii.2")(props),
|
|
25
|
+
bg: themeGet("colors.greyLighter")(props),
|
|
26
|
+
transition: themeGet("transition.transitionDefault")(props),
|
|
27
|
+
px: 4,
|
|
28
|
+
py: 3,
|
|
29
|
+
fontSize: themeGet("fontSizes.1")(props),
|
|
30
|
+
fontWeight: themeGet("fontWeights.2")(props),
|
|
31
|
+
color: themeGet("colors.greyDarker")(props),
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
position: "relative",
|
|
35
|
+
whiteSpace: "nowrap",
|
|
36
|
+
textDecoration: "none",
|
|
37
|
+
textAlign: "center",
|
|
38
|
+
textTransform: "uppercase",
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
"&:hover": {
|
|
41
|
+
bg: themeGet("colors.greyLight")(props),
|
|
35
42
|
color: themeGet("colors.greyDarker")(props),
|
|
36
|
-
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
position: "relative",
|
|
39
|
-
whiteSpace: "nowrap",
|
|
40
|
-
textDecoration: "none",
|
|
41
|
-
textAlign: "center",
|
|
42
|
-
textTransform: "uppercase",
|
|
43
|
-
cursor: "pointer",
|
|
44
|
-
"&:hover": {
|
|
45
|
-
bg: themeGet("colors.greyLight")(props),
|
|
46
|
-
color: themeGet("colors.greyDarker")(props),
|
|
47
|
-
outline: "0"
|
|
48
|
-
},
|
|
49
|
-
"&:focus": {
|
|
50
|
-
color: themeGet("colors.greyDarker")(props),
|
|
51
|
-
outline: "0",
|
|
52
|
-
boxShadow: themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.grey")(props)
|
|
53
|
-
},
|
|
54
|
-
button: {
|
|
55
|
-
marginLeft: 2
|
|
56
|
-
}
|
|
43
|
+
outline: "0"
|
|
57
44
|
},
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"&:hover": {
|
|
63
|
-
cursor: "default"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
45
|
+
"&:focus": {
|
|
46
|
+
color: themeGet("colors.greyDarker")(props),
|
|
47
|
+
outline: "0",
|
|
48
|
+
boxShadow: themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.grey")(props)
|
|
66
49
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
height: "20px",
|
|
78
|
-
borderRadius: "50%",
|
|
79
|
-
fontSize: themeGet("fontSizes.0")(props),
|
|
80
|
-
fontWeight: themeGet("fontWeights.2")(props),
|
|
81
|
-
content: "\"".concat(props.notification, "\""),
|
|
82
|
-
bg: themeGet("colors.danger")(props),
|
|
83
|
-
color: themeGet("colors.white")(props),
|
|
84
|
-
zIndex: 4
|
|
85
|
-
}
|
|
50
|
+
button: {
|
|
51
|
+
marginLeft: 2
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"&.active": {
|
|
55
|
+
a: {
|
|
56
|
+
color: themeGet("colors.primary")(props),
|
|
57
|
+
bg: themeGet("colors.white")(props),
|
|
58
|
+
"&:hover": {
|
|
59
|
+
cursor: "default"
|
|
86
60
|
}
|
|
87
61
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
62
|
+
},
|
|
63
|
+
"&.notification": {
|
|
64
|
+
a: {
|
|
65
|
+
"&::after": {
|
|
66
|
+
position: "absolute",
|
|
67
|
+
top: "calc(8px * -1)",
|
|
68
|
+
right: "calc(4px * -2)",
|
|
69
|
+
display: "flex",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
width: "20px",
|
|
73
|
+
height: "20px",
|
|
74
|
+
borderRadius: "50%",
|
|
75
|
+
fontSize: themeGet("fontSizes.0")(props),
|
|
76
|
+
fontWeight: themeGet("fontWeights.2")(props),
|
|
77
|
+
content: "\"".concat(props.notification, "\""),
|
|
78
|
+
bg: themeGet("colors.danger")(props),
|
|
79
|
+
color: themeGet("colors.white")(props),
|
|
80
|
+
zIndex: 4
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}), space, color);
|
|
85
|
+
export const Tab = _ref => {
|
|
86
|
+
let {
|
|
87
|
+
theme,
|
|
88
|
+
children,
|
|
89
|
+
active,
|
|
90
|
+
notification,
|
|
91
|
+
...props
|
|
92
|
+
} = _ref;
|
|
93
|
+
const component = /*#__PURE__*/_jsx(TabItem, {
|
|
97
94
|
active: active,
|
|
98
95
|
notification: notification,
|
|
99
96
|
role: "presentation",
|
|
100
|
-
className: "".concat(active ? "active" : "", " ").concat(notification ? "notification notification-" + notification : "")
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
className: "".concat(active ? "active" : "", " ").concat(notification ? "notification notification-" + notification : ""),
|
|
98
|
+
...props,
|
|
99
|
+
children: React.Children.map(children, child => /*#__PURE__*/React.cloneElement(child, {
|
|
103
100
|
role: "tab",
|
|
104
101
|
"aria-selected": "".concat(active)
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
return theme ? /*#__PURE__*/
|
|
108
|
-
theme: theme
|
|
109
|
-
|
|
102
|
+
}))
|
|
103
|
+
});
|
|
104
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
105
|
+
theme: theme,
|
|
106
|
+
children: component
|
|
107
|
+
}) : component;
|
|
110
108
|
};
|
|
111
109
|
Tab.propTypes = {
|
|
112
110
|
/** Specifies whether the tab is the active tab */
|
|
@@ -118,16 +116,21 @@ Tab.propTypes = {
|
|
|
118
116
|
/** The content of the Tab is passed as a child. */
|
|
119
117
|
children: PropTypes.node
|
|
120
118
|
};
|
|
121
|
-
export
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
119
|
+
export const TabsContainer = _ref2 => {
|
|
120
|
+
let {
|
|
121
|
+
theme,
|
|
122
|
+
children,
|
|
123
|
+
...props
|
|
124
|
+
} = _ref2;
|
|
125
|
+
const component = /*#__PURE__*/_jsx(TabsContainerItem, {
|
|
126
|
+
role: "tablist",
|
|
127
|
+
...props,
|
|
128
|
+
children: children
|
|
129
|
+
});
|
|
130
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
131
|
+
theme: theme,
|
|
132
|
+
children: component
|
|
133
|
+
}) : component;
|
|
131
134
|
};
|
|
132
135
|
TabsContainer.propTypes = {
|
|
133
136
|
/** The contents of the TabsContainer are passed as a child. */
|