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.
Files changed (96) hide show
  1. package/es/GlobalStyles.js +1 -31
  2. package/es/SystemThemeProvider.js +11 -5
  3. package/es/assets/Colour/Colour.stories.js +211 -0
  4. package/es/assets/Colour/index.js +3 -3
  5. package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
  6. package/es/components/ActionsMenu/index.js +144 -229
  7. package/es/components/Avatar/Avatar.stories.js +212 -196
  8. package/es/components/Avatar/index.js +280 -307
  9. package/es/components/Badge/Badge.stories.js +71 -46
  10. package/es/components/Badge/index.js +71 -74
  11. package/es/components/Box/Box.stories.js +51 -35
  12. package/es/components/Box/index.js +33 -34
  13. package/es/components/Button/Button.stories.js +161 -145
  14. package/es/components/Button/ButtonLink.stories.js +152 -139
  15. package/es/components/Button/index.js +79 -99
  16. package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
  17. package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
  18. package/es/components/ButtonGroup/index.js +103 -99
  19. package/es/components/Card/Card.stories.js +94 -62
  20. package/es/components/Card/index.js +50 -71
  21. package/es/components/Checkbox/Checkbox.stories.js +37 -43
  22. package/es/components/Checkbox/index.js +61 -76
  23. package/es/components/DatePicker/DatePicker.stories.js +86 -118
  24. package/es/components/DatePicker/index.js +71 -187
  25. package/es/components/Divider/Divider.stories.js +39 -42
  26. package/es/components/Divider/index.js +21 -27
  27. package/es/components/Expandable/Expandable.stories.js +46 -36
  28. package/es/components/Expandable/index.js +55 -82
  29. package/es/components/Flex/Flex.stories.js +19 -5
  30. package/es/components/Flex/FlexItem.stories.js +10 -9
  31. package/es/components/Flex/index.js +34 -27
  32. package/es/components/Grid/Grid.stories.js +129 -55
  33. package/es/components/Grid/index.js +25 -24
  34. package/es/components/Header/Header.stories.js +101 -92
  35. package/es/components/Header/index.js +433 -436
  36. package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
  37. package/es/components/HeaderSimple/index.js +73 -68
  38. package/es/components/Icon/Icon.stories.js +58 -57
  39. package/es/components/Icon/index.js +48 -46
  40. package/es/components/Loading/Loading.stories.js +32 -39
  41. package/es/components/Loading/index.js +44 -51
  42. package/es/components/Modal/Modal.stories.js +172 -153
  43. package/es/components/Modal/index.js +126 -134
  44. package/es/components/Notification/Notification.stories.js +59 -58
  45. package/es/components/Notification/index.js +123 -133
  46. package/es/components/Popover/Popover.stories.js +134 -102
  47. package/es/components/Popover/index.js +65 -111
  48. package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
  49. package/es/components/ProgressBar/index.js +29 -34
  50. package/es/components/RadioButton/RadioButton.stories.js +32 -37
  51. package/es/components/RadioButton/index.js +170 -184
  52. package/es/components/Range/Range.stories.js +19 -19
  53. package/es/components/Range/index.js +35 -45
  54. package/es/components/Select/Select.stories.js +107 -128
  55. package/es/components/Select/index.js +324 -336
  56. package/es/components/SideNav/NavItem.js +112 -122
  57. package/es/components/SideNav/SideNav.stories.js +84 -57
  58. package/es/components/SideNav/index.js +161 -185
  59. package/es/components/Sidebar/Sidebar.stories.js +50 -33
  60. package/es/components/Sidebar/index.js +152 -155
  61. package/es/components/Spacer/Spacer.stories.js +35 -32
  62. package/es/components/Spacer/index.js +20 -20
  63. package/es/components/StatusDot/StatusDot.stories.js +103 -90
  64. package/es/components/StatusDot/index.js +36 -38
  65. package/es/components/StyledLink/StyledLink.stories.js +68 -69
  66. package/es/components/StyledLink/index.js +47 -48
  67. package/es/components/Table/Table.stories.js +118 -112
  68. package/es/components/Table/getExpandColumnConfig.js +67 -62
  69. package/es/components/Table/index.js +24 -27
  70. package/es/components/Table/muiStyleOverrides.js +10 -8
  71. package/es/components/Tabs/Tab.stories.js +55 -38
  72. package/es/components/Tabs/TabsContainer.stories.js +30 -22
  73. package/es/components/Tabs/index.js +95 -92
  74. package/es/components/Tag/Tag.stories.js +250 -220
  75. package/es/components/Tag/index.js +118 -190
  76. package/es/components/TextArea/TextArea.stories.js +76 -89
  77. package/es/components/TextArea/index.js +117 -115
  78. package/es/components/TextInput/TextInput.stories.js +41 -61
  79. package/es/components/TextInput/index.js +127 -171
  80. package/es/components/Toggle/Toggle.stories.js +63 -62
  81. package/es/components/Toggle/index.js +43 -77
  82. package/es/components/TreeNav/TreeNav.stories.js +7 -8
  83. package/es/components/TreeNav/index.js +72 -69
  84. package/es/components/Typography/Typography.stories.js +174 -0
  85. package/es/components/Typography/index.js +252 -308
  86. package/es/components.test.js +1 -1
  87. package/es/hooks/isVisible.js +6 -10
  88. package/es/hooks/keepInView.js +27 -32
  89. package/es/hooks/keypress.js +14 -14
  90. package/es/hooks/useInputFocus.js +5 -5
  91. package/es/hooks/usePrevious.js +3 -3
  92. package/es/systemThemeCollapsed.js +53 -53
  93. package/es/systemtheme.js +53 -53
  94. package/es/utils/selectUtil.js +1 -1
  95. package/es/utils/selectUtil.test.js +6 -6
  96. 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: [function (storyFn) {
8
- return /*#__PURE__*/React.createElement(Box, {
9
- bg: "greyLightest",
10
- p: "xl"
11
- }, storyFn());
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 var defaultTabs = function defaultTabs() {
16
- return /*#__PURE__*/React.createElement(TabsContainer, null, /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement("a", {
17
- href: "#"
18
- }, "Details")), /*#__PURE__*/React.createElement(Popover, {
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
- }, /*#__PURE__*/React.createElement(Tab, {
23
- active: true
24
- }, /*#__PURE__*/React.createElement("a", {
25
- href: "#",
26
- tabIndex: "-1"
27
- }, "Additional information"))), /*#__PURE__*/React.createElement(Tab, {
28
- notification: "97"
29
- }, /*#__PURE__*/React.createElement("a", {
30
- href: "#"
31
- }, "Planning")));
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
- export var TabsContainerItem = styled("div").withConfig({
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 var TabItem = styled("div").withConfig({
18
+ export const TabItem = styled("div").withConfig({
22
19
  displayName: "Tabs__TabItem",
23
20
  componentId: "sc-15tpvnt-1"
24
- })(function (props) {
25
- return css({
26
- marginRight: 3,
27
- a: {
28
- borderRadius: themeGet("radii.2")(props),
29
- bg: themeGet("colors.greyLighter")(props),
30
- transition: themeGet("transition.transitionDefault")(props),
31
- px: 4,
32
- py: 3,
33
- fontSize: themeGet("fontSizes.1")(props),
34
- fontWeight: themeGet("fontWeights.2")(props),
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
- display: "flex",
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
- "&.active": {
59
- a: {
60
- color: themeGet("colors.primary")(props),
61
- bg: themeGet("colors.white")(props),
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
- "&.notification": {
68
- a: {
69
- "&::after": {
70
- position: "absolute",
71
- top: "calc(8px * -1)",
72
- right: "calc(4px * -2)",
73
- display: "flex",
74
- alignItems: "center",
75
- justifyContent: "center",
76
- width: "20px",
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
- }, space, color);
90
- export var Tab = function Tab(_ref) {
91
- var theme = _ref.theme,
92
- children = _ref.children,
93
- active = _ref.active,
94
- notification = _ref.notification,
95
- props = _objectWithoutProperties(_ref, _excluded);
96
- var component = /*#__PURE__*/React.createElement(TabItem, _extends({
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
- }, props), React.Children.map(children, function (child) {
102
- return /*#__PURE__*/React.cloneElement(child, {
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__*/React.createElement(ThemeProvider, {
108
- theme: theme
109
- }, component) : component;
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 var TabsContainer = function TabsContainer(_ref2) {
122
- var theme = _ref2.theme,
123
- children = _ref2.children,
124
- props = _objectWithoutProperties(_ref2, _excluded2);
125
- var component = /*#__PURE__*/React.createElement(TabsContainerItem, _extends({
126
- role: "tablist"
127
- }, props), children);
128
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
129
- theme: theme
130
- }, component) : component;
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. */