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
@@ -1,7 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "width", "height", "maxWidth", "maxHeight", "minWidth", "minHeight", "overflow", "onClose", "theme", "visible", "overlayID", "modalID", "headerContent", "footerContent"];
5
1
  import React, { useCallback, useEffect, useMemo, useState } from "react";
6
2
  import ReactDOM from "react-dom";
7
3
  import PropTypes from "prop-types";
@@ -13,98 +9,80 @@ import Icon from "../Icon";
13
9
  import Button from "../Button";
14
10
  import Flex from "../Flex";
15
11
  import Box from "../Box";
16
- var scaleIn = keyframes(["0%{transform:scale(0);}100%{transform:scale(1);}"]);
17
- var fadeIn = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
18
- var Overlay = styled(Flex).withConfig({
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ const scaleIn = keyframes(["0%{transform:scale(0);}100%{transform:scale(1);}"]);
14
+ const fadeIn = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
15
+ const Overlay = styled(Flex).withConfig({
19
16
  displayName: "Modal__Overlay",
20
17
  componentId: "sc-1v5puuo-0"
21
18
  })(["position:fixed;background:rgba(0,0,0,0.7);top:0;right:0;bottom:0;left:0;margin:0;opacity:0;transition:all 300ms ease-in-out;opacity:1;z-index:900;visibility:visible;animation:300ms ", " ease-in-out;justify-content:center;align-items:center;"], fadeIn);
22
- var Container = styled(Box).withConfig({
19
+ const Container = styled(Box).withConfig({
23
20
  displayName: "Modal__Container",
24
21
  componentId: "sc-1v5puuo-1"
25
- })(["position:relative;z-index:9001;animation:300ms ", " ease-in-out,300ms ", " ease-in-out;display:flex;flex-direction:column;resize:both;overflow:", ";"], fadeIn, scaleIn, function (props) {
26
- return props.overflow === "visible" ? "visible" : "hidden";
27
- });
28
- var CloseButton = styled(Button).withConfig({
22
+ })(["position:relative;z-index:9001;animation:300ms ", " ease-in-out,300ms ", " ease-in-out;display:flex;flex-direction:column;resize:both;overflow:", ";"], fadeIn, scaleIn, props => props.overflow === "visible" ? "visible" : "hidden");
23
+ const CloseButton = styled(Button).withConfig({
29
24
  displayName: "Modal__CloseButton",
30
25
  componentId: "sc-1v5puuo-2"
31
- })(function (props) {
32
- return css({
33
- position: "absolute",
34
- top: "s",
35
- right: "s",
36
- bg: "transparent",
37
- color: themeGet("colors.greyDark")(props),
38
- borderColor: "transparent",
39
- "&:hover": {
40
- bg: themeGet("colors.greyLighter")(props),
41
- borderColor: themeGet("colors.greyLighter")(props)
42
- },
43
- "&:focus": {
44
- outline: "0",
45
- boxShadow: themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.black20")(props)
46
- }
47
- });
48
- });
49
- var HeaderContent = styled.div.withConfig({
26
+ })(props => css({
27
+ position: "absolute",
28
+ top: "s",
29
+ right: "s",
30
+ bg: "transparent",
31
+ color: themeGet("colors.greyDark")(props),
32
+ borderColor: "transparent",
33
+ "&:hover": {
34
+ bg: themeGet("colors.greyLighter")(props),
35
+ borderColor: themeGet("colors.greyLighter")(props)
36
+ },
37
+ "&:focus": {
38
+ outline: "0",
39
+ boxShadow: themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.black20")(props)
40
+ }
41
+ }));
42
+ const HeaderContent = styled.div.withConfig({
50
43
  displayName: "Modal__HeaderContent",
51
44
  componentId: "sc-1v5puuo-3"
52
- })(["display:flex;align-items:flex-start;justify-content:space-between;width:100%;padding-bottom:", ";border-bottom:solid 1px ", ";flex:0 0 auto;"], function (props) {
53
- return themeGet("space.r")(props);
54
- }, function (props) {
55
- return themeGet("colors.greyLighter")(props);
56
- });
57
- var FooterContent = styled.div.withConfig({
45
+ })(["display:flex;align-items:flex-start;justify-content:space-between;width:100%;padding-bottom:", ";border-bottom:solid 1px ", ";flex:0 0 auto;"], props => themeGet("space.r")(props), props => themeGet("colors.greyLighter")(props));
46
+ const FooterContent = styled.div.withConfig({
58
47
  displayName: "Modal__FooterContent",
59
48
  componentId: "sc-1v5puuo-4"
60
- })(["display:flex;align-items:flex-start;justify-content:space-between;width:100%;padding-top:", ";border-top:solid 1px ", ";flex:0 0 auto;"], function (props) {
61
- return themeGet("space.r")(props);
62
- }, function (props) {
63
- return themeGet("colors.greyLighter")(props);
64
- });
65
- var ScrollableContent = styled.div.withConfig({
49
+ })(["display:flex;align-items:flex-start;justify-content:space-between;width:100%;padding-top:", ";border-top:solid 1px ", ";flex:0 0 auto;"], props => themeGet("space.r")(props), props => themeGet("colors.greyLighter")(props));
50
+ const ScrollableContent = styled.div.withConfig({
66
51
  displayName: "Modal__ScrollableContent",
67
52
  componentId: "sc-1v5puuo-5"
68
- })(["--scrollbar-size:8px;--scrollbar-minlength:30px;--scrollbar-ff-width:thin;--scrollbar-track-color:rgba(0,0,0,0.05);--scrollbar-color:rgba(0,0,0,0.2);--scrollbar-color-hover:rgba(0,0,0,0.35);--scrollbar-color-active:rgba(0,0,0,0.5);height:100%;flex:1 1 auto;overflow-y:", ";margin-top:", ";-webkit-overflow-scrolling:touch;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:var(--scrollbar-ff-width);scrollbar-color:var(--scrollbar-color) var(--scrollbar-track-color);&::-webkit-scrollbar{height:var(--scrollbar-size);width:var(--scrollbar-size);}&::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color);}&::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color);border-radius:4px;}&::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-color-hover);}&::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-color-active);}&::-webkit-scrollbar-thumb:vertical{min-height:var(--scrollbar-minlength);}&::-webkit-scrollbar-thumb:horizontal{min-width:var(--scrollbar-minlength);}"], function (props) {
69
- return props.overflow === "visible" ? "visible" : "auto";
70
- }, function (props) {
71
- return props.headerContent ? "0" : "20px";
72
- });
73
- var isHidden = function isHidden(el) {
74
- return window.getComputedStyle(el).display === "none";
75
- };
76
- var Modal = function Modal(_ref) {
77
- var children = _ref.children,
78
- width = _ref.width,
79
- height = _ref.height,
80
- maxWidth = _ref.maxWidth,
81
- maxHeight = _ref.maxHeight,
82
- minWidth = _ref.minWidth,
83
- minHeight = _ref.minHeight,
84
- overflow = _ref.overflow,
85
- onClose = _ref.onClose,
86
- theme = _ref.theme,
87
- visible = _ref.visible,
88
- overlayID = _ref.overlayID,
89
- modalID = _ref.modalID,
90
- headerContent = _ref.headerContent,
91
- footerContent = _ref.footerContent,
92
- restProps = _objectWithoutProperties(_ref, _excluded);
93
- var _useState = useState(null),
94
- _useState2 = _slicedToArray(_useState, 2),
95
- lastActiveElement = _useState2[0],
96
- setLastActiveElement = _useState2[1];
97
- var ariaLabel = useMemo(function () {
53
+ })(["--scrollbar-size:8px;--scrollbar-minlength:30px;--scrollbar-ff-width:thin;--scrollbar-track-color:rgba(0,0,0,0.05);--scrollbar-color:rgba(0,0,0,0.2);--scrollbar-color-hover:rgba(0,0,0,0.35);--scrollbar-color-active:rgba(0,0,0,0.5);height:100%;flex:1 1 auto;overflow-y:", ";margin-top:", ";-webkit-overflow-scrolling:touch;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:var(--scrollbar-ff-width);scrollbar-color:var(--scrollbar-color) var(--scrollbar-track-color);&::-webkit-scrollbar{height:var(--scrollbar-size);width:var(--scrollbar-size);}&::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color);}&::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color);border-radius:4px;}&::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-color-hover);}&::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-color-active);}&::-webkit-scrollbar-thumb:vertical{min-height:var(--scrollbar-minlength);}&::-webkit-scrollbar-thumb:horizontal{min-width:var(--scrollbar-minlength);}"], props => props.overflow === "visible" ? "visible" : "auto", props => props.headerContent ? "0" : "20px");
54
+ const isHidden = el => window.getComputedStyle(el).display === "none";
55
+ const Modal = _ref => {
56
+ let {
57
+ children,
58
+ width,
59
+ height,
60
+ maxWidth,
61
+ maxHeight,
62
+ minWidth,
63
+ minHeight,
64
+ overflow,
65
+ onClose,
66
+ theme,
67
+ visible,
68
+ overlayID,
69
+ modalID,
70
+ headerContent,
71
+ footerContent,
72
+ ...restProps
73
+ } = _ref;
74
+ const [lastActiveElement, setLastActiveElement] = useState(null);
75
+ const ariaLabel = useMemo(() => {
98
76
  if (restProps.ariaLabel) {
99
77
  return restProps.ariaLabel;
100
78
  } else if (typeof headerContent === "string") {
101
79
  return headerContent;
102
80
  }
103
81
  }, [restProps.ariaLabel, headerContent]);
104
- var focusLastActiveElement = useCallback(function () {
82
+ const focusLastActiveElement = useCallback(() => {
105
83
  if (!lastActiveElement) return;
106
84
  if (lastActiveElement !== null && lastActiveElement !== void 0 && lastActiveElement.dataset.actionMenuId && isHidden(lastActiveElement === null || lastActiveElement === void 0 ? void 0 : lastActiveElement.parentNode)) {
107
- var actionMenu = document.getElementById(lastActiveElement.dataset.actionMenuId);
85
+ const actionMenu = document.getElementById(lastActiveElement.dataset.actionMenuId);
108
86
  actionMenu.focus();
109
87
  } else {
110
88
  lastActiveElement.focus();
@@ -112,7 +90,7 @@ var Modal = function Modal(_ref) {
112
90
  }, [lastActiveElement]);
113
91
 
114
92
  // On becoming visible focus the top
115
- useEffect(function () {
93
+ useEffect(() => {
116
94
  if (visible && !lastActiveElement) {
117
95
  // Keep track of last clicked element to refocus to after dialog closes
118
96
  setLastActiveElement(document.activeElement);
@@ -123,83 +101,97 @@ var Modal = function Modal(_ref) {
123
101
  focusLastActiveElement();
124
102
  }
125
103
  }, [visible, focusLastActiveElement, lastActiveElement]);
126
- useEffect(function () {
104
+ useEffect(() => {
127
105
  if (!visible) return;
128
106
 
129
107
  /* Adding onClick handler on the Overlay does not work.
130
108
  * So we add a global listener and check if the element clicked is the
131
109
  * overlay vida overlayID.
132
110
  */
133
- var handler = function handler(e) {
111
+ const handler = e => {
134
112
  if (e.target.id === overlayID) {
135
113
  onClose();
136
114
  }
137
115
  };
138
- var eventTypes = ["touchstart", "click"];
139
- eventTypes.map(function (type) {
116
+ const eventTypes = ["touchstart", "click"];
117
+ eventTypes.map(type => {
140
118
  window.addEventListener(type, handler, true);
141
119
  });
142
- return function () {
143
- eventTypes.map(function (type) {
120
+ return () => {
121
+ eventTypes.map(type => {
144
122
  window.removeEventListener(type, handler, true);
145
123
  });
146
124
  };
147
125
  }, [visible, onClose, overlayID]);
148
126
  if (!visible) return null;
149
- var component = /*#__PURE__*/React.createElement(Overlay, _extends({
127
+ const component = /*#__PURE__*/_jsx(Overlay, {
150
128
  alignItems: "center",
151
129
  justifyContent: "center",
152
- id: overlayID
153
- }, restProps), visible && /*#__PURE__*/React.createElement(FocusTrap, {
154
- focusTrapOptions: {
155
- onDeactivate: onClose
156
- }
157
- }, /*#__PURE__*/React.createElement("div", {
158
- role: "dialog",
159
- "aria-modal": "true",
160
- "aria-label": ariaLabel
161
- }, /*#__PURE__*/React.createElement(Container, {
162
- width: width,
163
- height: height,
164
- maxWidth: maxWidth,
165
- maxHeight: maxHeight,
166
- minWidth: minWidth,
167
- minHeight: minHeight,
168
- overflow: overflow,
169
- borderRadius: "2",
170
- bg: "white",
171
- p: "r",
172
- id: modalID
173
- }, headerContent ? /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(Box, {
174
- mr: "xl",
175
- width: "100%"
176
- }, headerContent), /*#__PURE__*/React.createElement(CloseButton, {
177
- onClick: onClose,
178
- className: "modal-close",
179
- small: true,
180
- px: "6px",
181
- "aria-label": "Close dialog"
182
- }, /*#__PURE__*/React.createElement(Icon, {
183
- icon: ["fas", "times"],
184
- color: "greyDark",
185
- size: "lg"
186
- }))) : /*#__PURE__*/React.createElement(CloseButton, {
187
- onClick: onClose,
188
- className: "modal-close",
189
- small: true,
190
- px: "6px",
191
- "aria-label": "Close dialog"
192
- }, /*#__PURE__*/React.createElement(Icon, {
193
- icon: ["fas", "times"],
194
- color: "greyDark",
195
- size: "lg"
196
- })), /*#__PURE__*/React.createElement(ScrollableContent, {
197
- headerContent: headerContent,
198
- overflow: overflow
199
- }, children), footerContent && /*#__PURE__*/React.createElement(FooterContent, null, footerContent)))));
200
- return /*#__PURE__*/ReactDOM.createPortal(theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
201
- theme: theme
202
- }, component) : component, document.body);
130
+ id: overlayID,
131
+ ...restProps,
132
+ children: visible && /*#__PURE__*/_jsx(FocusTrap, {
133
+ focusTrapOptions: {
134
+ onDeactivate: onClose
135
+ },
136
+ children: /*#__PURE__*/_jsx("div", {
137
+ role: "dialog",
138
+ "aria-modal": "true",
139
+ "aria-label": ariaLabel,
140
+ children: /*#__PURE__*/_jsxs(Container, {
141
+ width: width,
142
+ height: height,
143
+ maxWidth: maxWidth,
144
+ maxHeight: maxHeight,
145
+ minWidth: minWidth,
146
+ minHeight: minHeight,
147
+ overflow: overflow,
148
+ borderRadius: "2",
149
+ bg: "white",
150
+ p: "r",
151
+ id: modalID,
152
+ children: [headerContent ? /*#__PURE__*/_jsxs(HeaderContent, {
153
+ children: [/*#__PURE__*/_jsx(Box, {
154
+ mr: "xl",
155
+ width: "100%",
156
+ children: headerContent
157
+ }), /*#__PURE__*/_jsx(CloseButton, {
158
+ onClick: onClose,
159
+ className: "modal-close",
160
+ small: true,
161
+ px: "6px",
162
+ "aria-label": "Close dialog",
163
+ children: /*#__PURE__*/_jsx(Icon, {
164
+ icon: ["fas", "times"],
165
+ color: "greyDark",
166
+ size: "lg"
167
+ })
168
+ })]
169
+ }) : /*#__PURE__*/_jsx(CloseButton, {
170
+ onClick: onClose,
171
+ className: "modal-close",
172
+ small: true,
173
+ px: "6px",
174
+ "aria-label": "Close dialog",
175
+ children: /*#__PURE__*/_jsx(Icon, {
176
+ icon: ["fas", "times"],
177
+ color: "greyDark",
178
+ size: "lg"
179
+ })
180
+ }), /*#__PURE__*/_jsx(ScrollableContent, {
181
+ headerContent: headerContent,
182
+ overflow: overflow,
183
+ children: children
184
+ }), footerContent && /*#__PURE__*/_jsx(FooterContent, {
185
+ children: footerContent
186
+ })]
187
+ })
188
+ })
189
+ })
190
+ });
191
+ return /*#__PURE__*/ReactDOM.createPortal(theme ? /*#__PURE__*/_jsx(ThemeProvider, {
192
+ theme: theme,
193
+ children: component
194
+ }) : component, document.body);
203
195
  };
204
196
  Modal.propTypes = {
205
197
  /** Specifies the children of the Modal */
@@ -2,80 +2,81 @@ import React from "react";
2
2
  import Notification from ".";
3
3
  import Spacer from "../Spacer";
4
4
  import Box from "../Box";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  export default {
6
7
  title: "Components/Notification",
7
8
  component: Notification,
8
- decorators: [function (storyFn) {
9
- return /*#__PURE__*/React.createElement(Box, {
10
- p: "r",
11
- height: "250px"
12
- }, storyFn());
13
- }]
14
- };
15
- export var basicNotification = function basicNotification() {
16
- return /*#__PURE__*/React.createElement(Notification, {
17
- icon: ["fas", "share-square"]
18
- }, "Default notification message for messages that are not super important, e.g. Link shared.");
9
+ decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
10
+ p: "r",
11
+ height: "250px",
12
+ children: storyFn()
13
+ })]
19
14
  };
15
+ export const basicNotification = () => /*#__PURE__*/_jsx(Notification, {
16
+ icon: ["fas", "share-square"],
17
+ children: "Default notification message for messages that are not super important, e.g. Link shared."
18
+ });
20
19
  basicNotification.storyName = "Basic";
21
- export var colourNotification = function colourNotification() {
22
- return /*#__PURE__*/React.createElement(Spacer, {
23
- m: "r"
24
- }, /*#__PURE__*/React.createElement(Notification, {
20
+ export const colourNotification = () => /*#__PURE__*/_jsxs(Spacer, {
21
+ m: "r",
22
+ children: [/*#__PURE__*/_jsx(Notification, {
25
23
  colour: "success",
26
- icon: ["fas", "check-circle"]
27
- }, "Green notification for good/successful notifications, e.g. Details updated successfully!"), /*#__PURE__*/React.createElement(Notification, {
24
+ icon: ["fas", "check-circle"],
25
+ children: "Green notification for good/successful notifications, e.g. Details updated successfully!"
26
+ }), /*#__PURE__*/_jsx(Notification, {
28
27
  colour: "warning",
29
- icon: ["fas", "exclamation-triangle"]
30
- }, "Yellow warning notification e.g. This may take a few minutes to update."), /*#__PURE__*/React.createElement(Notification, {
28
+ icon: ["fas", "exclamation-triangle"],
29
+ children: "Yellow warning notification e.g. This may take a few minutes to update."
30
+ }), /*#__PURE__*/_jsx(Notification, {
31
31
  colour: "danger",
32
- icon: ["fas", "exclamation-circle"]
33
- }, "Red error notification e.g. Update failed! Please try again."));
34
- };
32
+ icon: ["fas", "exclamation-circle"],
33
+ children: "Red error notification e.g. Update failed! Please try again."
34
+ })]
35
+ });
35
36
  colourNotification.storyName = "Alternate Colours";
36
- export var textOnlyNotification = function textOnlyNotification() {
37
- return /*#__PURE__*/React.createElement(Notification, null, "Text-only notification");
38
- };
37
+ export const textOnlyNotification = () => /*#__PURE__*/_jsx(Notification, {
38
+ children: "Text-only notification"
39
+ });
39
40
  textOnlyNotification.storyName = "Text-only";
40
- export var closeDisabledNotification = function closeDisabledNotification() {
41
- return /*#__PURE__*/React.createElement(Notification, {
42
- closable: false
43
- }, "Closing this notification is disabled, this should be used for persistent notifications e.g. Stage 1 is now locked and is read-only.");
44
- };
41
+ export const closeDisabledNotification = () => /*#__PURE__*/_jsx(Notification, {
42
+ closable: false,
43
+ children: "Closing this notification is disabled, this should be used for persistent notifications e.g. Stage 1 is now locked and is read-only."
44
+ });
45
45
  closeDisabledNotification.storyName = "Close Disabled";
46
- export var loadingNotification = function loadingNotification() {
47
- return /*#__PURE__*/React.createElement(Spacer, {
48
- m: "r"
49
- }, /*#__PURE__*/React.createElement(Notification, {
50
- loading: true
51
- }, "In progress notification E.g. Importing data..."), /*#__PURE__*/React.createElement(Notification, {
46
+ export const loadingNotification = () => /*#__PURE__*/_jsxs(Spacer, {
47
+ m: "r",
48
+ children: [/*#__PURE__*/_jsx(Notification, {
52
49
  loading: true,
53
- colour: "success"
54
- }, "In progress notification E.g. Importing data..."), /*#__PURE__*/React.createElement(Notification, {
50
+ children: "In progress notification E.g. Importing data..."
51
+ }), /*#__PURE__*/_jsx(Notification, {
55
52
  loading: true,
56
- colour: "warning"
57
- }, "In progress notification E.g. Importing data..."), /*#__PURE__*/React.createElement(Notification, {
53
+ colour: "success",
54
+ children: "In progress notification E.g. Importing data..."
55
+ }), /*#__PURE__*/_jsx(Notification, {
58
56
  loading: true,
59
- colour: "danger"
60
- }, "In progress notification E.g. Importing data..."));
61
- };
57
+ colour: "warning",
58
+ children: "In progress notification E.g. Importing data..."
59
+ }), /*#__PURE__*/_jsx(Notification, {
60
+ loading: true,
61
+ colour: "danger",
62
+ children: "In progress notification E.g. Importing data..."
63
+ })]
64
+ });
62
65
  loadingNotification.storyName = "Loading";
63
- export var floatingNotification = function floatingNotification() {
64
- return /*#__PURE__*/React.createElement(Notification, {
65
- floating: true,
66
- bottom: "20px",
67
- right: "20px",
68
- icon: ["fas", "bell"]
69
- }, "Floating notification.");
70
- };
66
+ export const floatingNotification = () => /*#__PURE__*/_jsx(Notification, {
67
+ floating: true,
68
+ bottom: "20px",
69
+ right: "20px",
70
+ icon: ["fas", "bell"],
71
+ children: "Floating notification."
72
+ });
71
73
  floatingNotification.storyName = "Floating";
72
- export var centeredNotification = function centeredNotification() {
73
- return /*#__PURE__*/React.createElement(Notification, {
74
- centered: true,
75
- floating: true,
76
- bottom: "20px"
77
- }, "Centered notification");
78
- };
74
+ export const centeredNotification = () => /*#__PURE__*/_jsx(Notification, {
75
+ centered: true,
76
+ floating: true,
77
+ bottom: "20px",
78
+ children: "Centered notification"
79
+ });
79
80
  centeredNotification.storyName = "Floating and Centered";
80
81
  basicNotification.__docgenInfo = {
81
82
  "description": "",