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,67 +1,60 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["large", "centered", "inverted", "primary", "theme", "ariaLabel"];
4
1
  import styled, { css, keyframes, ThemeProvider } from "styled-components";
5
2
  import PropTypes from "prop-types";
6
3
  import React from "react";
7
4
  import { space, layout, compose } from "styled-system";
8
- var LoadingStyles = compose(space, layout);
9
- var loadingSpin = keyframes(["to{transform:rotate(1turn);}"]);
10
- var LoadingWrapper = styled("div").withConfig({
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const LoadingStyles = compose(space, layout);
7
+ const loadingSpin = keyframes(["to{transform:rotate(1turn);}"]);
8
+ const LoadingWrapper = styled("div").withConfig({
11
9
  displayName: "Loading__LoadingWrapper",
12
10
  componentId: "sc-195w3kf-0"
13
- })(function (props) {
14
- return css({
15
- display: "flex",
16
- alignItems: "center",
17
- justifyContent: props.centered ? "center" : "flex-start"
18
- });
19
- }, LoadingStyles);
20
- var LoadingIcon = styled.svg.withConfig({
11
+ })(props => css({
12
+ display: "flex",
13
+ alignItems: "center",
14
+ justifyContent: props.centered ? "center" : "flex-start"
15
+ }), LoadingStyles);
16
+ const LoadingIcon = styled.svg.withConfig({
21
17
  displayName: "Loading__LoadingIcon",
22
18
  componentId: "sc-195w3kf-1"
23
- })(["position:relative;width:", ";height:", ";", ";", ";"], function (props) {
24
- return props.large ? "50px" : "16px";
25
- }, function (props) {
26
- return props.large ? "50px" : "16px";
27
- }, function (props) {
28
- return props.large ? css(["animation:", " 800ms infinite linear;"], loadingSpin) : css(["animation:", " 600ms infinite linear;"], loadingSpin);
29
- }, function (props) {
30
- return props.inverted ? css(["fill:white;"]) : props.primary ? css(["fill:#0091ea;"]) : css(["fill:black;"]);
31
- });
19
+ })(["position:relative;width:", ";height:", ";", ";", ";"], props => props.large ? "50px" : "16px", props => props.large ? "50px" : "16px", props => props.large ? css(["animation:", " 800ms infinite linear;"], loadingSpin) : css(["animation:", " 600ms infinite linear;"], loadingSpin), props => props.inverted ? css(["fill:white;"]) : props.primary ? css(["fill:#0091ea;"]) : css(["fill:black;"]));
32
20
 
33
21
  /**
34
22
  * As a general guide, use the large prop for when whole pages or sections are loading, and the default (small) loading for smaller elements.
35
23
  */
36
24
  export default function Loading(_ref) {
37
- var large = _ref.large,
38
- centered = _ref.centered,
39
- inverted = _ref.inverted,
40
- primary = _ref.primary,
41
- theme = _ref.theme,
42
- _ref$ariaLabel = _ref.ariaLabel,
43
- ariaLabel = _ref$ariaLabel === void 0 ? "Loading" : _ref$ariaLabel,
44
- props = _objectWithoutProperties(_ref, _excluded);
45
- var component = /*#__PURE__*/React.createElement(LoadingWrapper, _extends({}, props, {
46
- centered: centered
47
- }), /*#__PURE__*/React.createElement(LoadingIcon, {
48
- role: "img",
49
- "aria-label": ariaLabel,
50
- large: large,
51
- inverted: inverted,
52
- primary: primary,
53
- xmlns: "http://www.w3.org/2000/svg",
54
- viewBox: "0 0 512 512"
55
- }, /*#__PURE__*/React.createElement("path", {
56
- opacity: "0.8",
57
- d: "M283.2 65.92C267.6 63.69 256 50.32 256 34.52c0-19.38 17.19-34.69 36.38-31.95C416.4 20.29 512 127.2 512 256c0 33.38-6.544 65.26-18.27 94.49c-7.162 17.86-28.85 24.87-45.56 15.32c-13.74-7.854-19.62-24.53-13.75-39.23C443.2 304.7 448 280.9 448 256C448 159.4 376.3 79.18 283.2 65.92z"
58
- }), /*#__PURE__*/React.createElement("path", {
59
- opacity: "0.2",
60
- d: "M493.7 350.5C456 444.9 363.7 512 256 512c-141.2 0-256-114.8-256-256s114.8-256 256-256c11.91 0 23.54 1.104 35.03 2.686C272.4 .8672 256 15.62 256 34.52c0 15.8 11.58 29.17 27.23 31.4c.9648 .1367 1.844 .5116 2.805 .6639C276.2 65.04 266.2 64 256 64C150.1 64 64 150.1 64 256s86.13 192 192 192c81.67 0 151.4-51.34 179.1-123.4c-.248 .6406-.4215 1.317-.6754 1.954c-5.869 14.7 .0045 31.38 13.75 39.23C464.8 375.3 486.5 368.2 493.7 350.5z"
61
- })));
62
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
63
- theme: theme
64
- }, component) : component;
25
+ let {
26
+ large,
27
+ centered,
28
+ inverted,
29
+ primary,
30
+ theme,
31
+ ariaLabel = "Loading",
32
+ ...props
33
+ } = _ref;
34
+ const component = /*#__PURE__*/_jsx(LoadingWrapper, {
35
+ ...props,
36
+ centered: centered,
37
+ children: /*#__PURE__*/_jsxs(LoadingIcon, {
38
+ role: "img",
39
+ "aria-label": ariaLabel,
40
+ large: large,
41
+ inverted: inverted,
42
+ primary: primary,
43
+ xmlns: "http://www.w3.org/2000/svg",
44
+ viewBox: "0 0 512 512",
45
+ children: [/*#__PURE__*/_jsx("path", {
46
+ opacity: "0.8",
47
+ d: "M283.2 65.92C267.6 63.69 256 50.32 256 34.52c0-19.38 17.19-34.69 36.38-31.95C416.4 20.29 512 127.2 512 256c0 33.38-6.544 65.26-18.27 94.49c-7.162 17.86-28.85 24.87-45.56 15.32c-13.74-7.854-19.62-24.53-13.75-39.23C443.2 304.7 448 280.9 448 256C448 159.4 376.3 79.18 283.2 65.92z"
48
+ }), /*#__PURE__*/_jsx("path", {
49
+ opacity: "0.2",
50
+ d: "M493.7 350.5C456 444.9 363.7 512 256 512c-141.2 0-256-114.8-256-256s114.8-256 256-256c11.91 0 23.54 1.104 35.03 2.686C272.4 .8672 256 15.62 256 34.52c0 15.8 11.58 29.17 27.23 31.4c.9648 .1367 1.844 .5116 2.805 .6639C276.2 65.04 266.2 64 256 64C150.1 64 64 150.1 64 256s86.13 192 192 192c81.67 0 151.4-51.34 179.1-123.4c-.248 .6406-.4215 1.317-.6754 1.954c-5.869 14.7 .0045 31.38 13.75 39.23C464.8 375.3 486.5 368.2 493.7 350.5z"
51
+ })]
52
+ })
53
+ });
54
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
55
+ theme: theme,
56
+ children: component
57
+ }) : component;
65
58
  }
66
59
  Loading.propTypes = {
67
60
  /** Large loading spinner */
@@ -1,4 +1,3 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
1
  import React, { useState } from "react";
3
2
  import Button from "../Button";
4
3
  import Modal from ".";
@@ -8,40 +7,43 @@ import TextArea from "../TextArea";
8
7
  import Flex from "../Flex";
9
8
  import Spacer from "../Spacer";
10
9
  import Icon from "../Icon";
10
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
11
  export default {
12
12
  title: "Components/Modal",
13
13
  component: Modal
14
14
  };
15
- var Basic = function Basic() {
16
- var _useState = useState(false),
17
- _useState2 = _slicedToArray(_useState, 2),
18
- visible = _useState2[0],
19
- setVisible = _useState2[1];
20
- var handleOnButtonClick = function handleOnButtonClick() {
15
+ const Basic = () => {
16
+ const [visible, setVisible] = useState(false);
17
+ const handleOnButtonClick = () => {
21
18
  setVisible(true);
22
19
  };
23
- var handleOnConfirm = function handleOnConfirm() {
20
+ const handleOnConfirm = () => {
24
21
  setVisible(false);
25
22
  };
26
- var onToggleModal = function onToggleModal(visible) {
27
- return function () {
28
- setVisible(visible);
29
- };
23
+ const onToggleModal = visible => () => {
24
+ setVisible(visible);
30
25
  };
31
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
32
- onClick: handleOnButtonClick
33
- }, "Open basic modal"), /*#__PURE__*/React.createElement(Modal, {
34
- ariaLabel: "Modal Name",
35
- visible: visible,
36
- handleOnConfirm: handleOnConfirm,
37
- onClose: onToggleModal(false)
38
- }, /*#__PURE__*/React.createElement(Spacer, {
39
- mb: "r"
40
- }, /*#__PURE__*/React.createElement(H3, null, "Modal Title"), /*#__PURE__*/React.createElement(P, null, "Content of the modal. Modal accepts any child components or content."))));
41
- };
42
- export var basicModal = function basicModal() {
43
- return /*#__PURE__*/React.createElement(Basic, null);
26
+ return /*#__PURE__*/_jsxs(_Fragment, {
27
+ children: [/*#__PURE__*/_jsx(Button, {
28
+ onClick: handleOnButtonClick,
29
+ children: "Open basic modal"
30
+ }), /*#__PURE__*/_jsx(Modal, {
31
+ ariaLabel: "Modal Name",
32
+ visible: visible,
33
+ handleOnConfirm: handleOnConfirm,
34
+ onClose: onToggleModal(false),
35
+ children: /*#__PURE__*/_jsxs(Spacer, {
36
+ mb: "r",
37
+ children: [/*#__PURE__*/_jsx(H3, {
38
+ children: "Modal Title"
39
+ }), /*#__PURE__*/_jsx(P, {
40
+ children: "Content of the modal. Modal accepts any child components or content."
41
+ })]
42
+ })
43
+ })]
44
+ });
44
45
  };
46
+ export const basicModal = () => /*#__PURE__*/_jsx(Basic, {});
45
47
  basicModal.parameters = {
46
48
  docs: {
47
49
  source: {
@@ -49,45 +51,52 @@ basicModal.parameters = {
49
51
  }
50
52
  }
51
53
  };
52
- var Advanced = function Advanced() {
53
- var _useState3 = useState(false),
54
- _useState4 = _slicedToArray(_useState3, 2),
55
- visible = _useState4[0],
56
- setVisible = _useState4[1];
57
- var handleOnButtonClick = function handleOnButtonClick() {
54
+ const Advanced = () => {
55
+ const [visible, setVisible] = useState(false);
56
+ const handleOnButtonClick = () => {
58
57
  setVisible(true);
59
58
  };
60
- var handleOnConfirm = function handleOnConfirm() {
59
+ const handleOnConfirm = () => {
61
60
  setVisible(false);
62
61
  };
63
- var onToggleModal = function onToggleModal(visible) {
64
- return function () {
65
- setVisible(visible);
66
- };
62
+ const onToggleModal = visible => () => {
63
+ setVisible(visible);
67
64
  };
68
- var modalHeader = /*#__PURE__*/React.createElement(H3, null, "Modal Title");
69
- var modalFooter = /*#__PURE__*/React.createElement(Button, {
70
- onClick: handleOnConfirm
71
- }, "Go to full article");
72
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
73
- onClick: handleOnButtonClick
74
- }, "Open advanced modal"), /*#__PURE__*/React.createElement(Modal, {
75
- maxWidth: "500px",
76
- maxHeight: "400px",
77
- height: "90vh",
78
- width: "90vw",
79
- visible: visible,
80
- handleOnConfirm: handleOnConfirm,
81
- onClose: onToggleModal(false),
82
- headerContent: modalHeader,
83
- footerContent: modalFooter
84
- }, /*#__PURE__*/React.createElement(Spacer, {
85
- my: "r"
86
- }, /*#__PURE__*/React.createElement(P, null, "Content of the modal. Modal accepts any child components or content. This content will be scrollable if it exeeds the height of the modal."), /*#__PURE__*/React.createElement(P, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."), /*#__PURE__*/React.createElement(P, null, "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"))));
87
- };
88
- export var advancedModal = function advancedModal() {
89
- return /*#__PURE__*/React.createElement(Advanced, null);
65
+ const modalHeader = /*#__PURE__*/_jsx(H3, {
66
+ children: "Modal Title"
67
+ });
68
+ const modalFooter = /*#__PURE__*/_jsx(Button, {
69
+ onClick: handleOnConfirm,
70
+ children: "Go to full article"
71
+ });
72
+ return /*#__PURE__*/_jsxs(_Fragment, {
73
+ children: [/*#__PURE__*/_jsx(Button, {
74
+ onClick: handleOnButtonClick,
75
+ children: "Open advanced modal"
76
+ }), /*#__PURE__*/_jsx(Modal, {
77
+ maxWidth: "500px",
78
+ maxHeight: "400px",
79
+ height: "90vh",
80
+ width: "90vw",
81
+ visible: visible,
82
+ handleOnConfirm: handleOnConfirm,
83
+ onClose: onToggleModal(false),
84
+ headerContent: modalHeader,
85
+ footerContent: modalFooter,
86
+ children: /*#__PURE__*/_jsxs(Spacer, {
87
+ my: "r",
88
+ children: [/*#__PURE__*/_jsx(P, {
89
+ children: "Content of the modal. Modal accepts any child components or content. This content will be scrollable if it exeeds the height of the modal."
90
+ }), /*#__PURE__*/_jsx(P, {
91
+ children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
92
+ }), /*#__PURE__*/_jsx(P, {
93
+ children: "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
94
+ })]
95
+ })
96
+ })]
97
+ });
90
98
  };
99
+ export const advancedModal = () => /*#__PURE__*/_jsx(Advanced, {});
91
100
  advancedModal.parameters = {
92
101
  docs: {
93
102
  source: {
@@ -95,52 +104,58 @@ advancedModal.parameters = {
95
104
  }
96
105
  }
97
106
  };
98
- var BasicDialogue = function BasicDialogue() {
99
- var _useState5 = useState(false),
100
- _useState6 = _slicedToArray(_useState5, 2),
101
- visible = _useState6[0],
102
- setVisible = _useState6[1];
103
- var handleOnButtonClick = function handleOnButtonClick() {
107
+ const BasicDialogue = () => {
108
+ const [visible, setVisible] = useState(false);
109
+ const handleOnButtonClick = () => {
104
110
  setVisible(true);
105
111
  };
106
- var handleOnConfirm = function handleOnConfirm() {
112
+ const handleOnConfirm = () => {
107
113
  setVisible(false);
108
114
  };
109
- var onToggleModal = function onToggleModal(visible) {
110
- return function () {
111
- setVisible(visible);
112
- };
115
+ const onToggleModal = visible => () => {
116
+ setVisible(visible);
113
117
  };
114
- var modalFooter = /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Spacer, {
115
- mr: "s"
116
- }, /*#__PURE__*/React.createElement(Button, {
117
- onClick: handleOnConfirm,
118
- px: "l"
119
- }, "OK"), /*#__PURE__*/React.createElement(Button, {
120
- variant: "ghost",
121
- onClick: onToggleModal(false)
122
- }, "Cancel")));
123
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
124
- onClick: handleOnButtonClick,
125
- variant: "danger",
126
- iconLeft: true
127
- }, /*#__PURE__*/React.createElement(Icon, {
128
- icon: ["fas", "trash"]
129
- }), "Delete data"), /*#__PURE__*/React.createElement(Modal, {
130
- visible: visible,
131
- handleOnConfirm: handleOnConfirm,
132
- onClose: onToggleModal(false),
133
- footerContent: modalFooter
134
- }, /*#__PURE__*/React.createElement(Spacer, {
135
- mb: "r"
136
- }, /*#__PURE__*/React.createElement(P, {
137
- weight: "bold",
138
- marginBottom: "sm"
139
- }, "This will remove all data from the application."), /*#__PURE__*/React.createElement(P, null, "Do you wish to continue?"))));
140
- };
141
- export var basicDialogueModal = function basicDialogueModal() {
142
- return /*#__PURE__*/React.createElement(BasicDialogue, null);
118
+ const modalFooter = /*#__PURE__*/_jsx(Flex, {
119
+ children: /*#__PURE__*/_jsxs(Spacer, {
120
+ mr: "s",
121
+ children: [/*#__PURE__*/_jsx(Button, {
122
+ onClick: handleOnConfirm,
123
+ px: "l",
124
+ children: "OK"
125
+ }), /*#__PURE__*/_jsx(Button, {
126
+ variant: "ghost",
127
+ onClick: onToggleModal(false),
128
+ children: "Cancel"
129
+ })]
130
+ })
131
+ });
132
+ return /*#__PURE__*/_jsxs(_Fragment, {
133
+ children: [/*#__PURE__*/_jsxs(Button, {
134
+ onClick: handleOnButtonClick,
135
+ variant: "danger",
136
+ iconLeft: true,
137
+ children: [/*#__PURE__*/_jsx(Icon, {
138
+ icon: ["fas", "trash"]
139
+ }), "Delete data"]
140
+ }), /*#__PURE__*/_jsx(Modal, {
141
+ visible: visible,
142
+ handleOnConfirm: handleOnConfirm,
143
+ onClose: onToggleModal(false),
144
+ footerContent: modalFooter,
145
+ children: /*#__PURE__*/_jsxs(Spacer, {
146
+ mb: "r",
147
+ children: [/*#__PURE__*/_jsx(P, {
148
+ weight: "bold",
149
+ marginBottom: "sm",
150
+ children: "This will remove all data from the application."
151
+ }), /*#__PURE__*/_jsx(P, {
152
+ children: "Do you wish to continue?"
153
+ })]
154
+ })
155
+ })]
156
+ });
143
157
  };
158
+ export const basicDialogueModal = () => /*#__PURE__*/_jsx(BasicDialogue, {});
144
159
  basicDialogueModal.parameters = {
145
160
  docs: {
146
161
  source: {
@@ -148,67 +163,71 @@ basicDialogueModal.parameters = {
148
163
  }
149
164
  }
150
165
  };
151
- var EditDialogue = function EditDialogue() {
152
- var _useState7 = useState(false),
153
- _useState8 = _slicedToArray(_useState7, 2),
154
- visible = _useState8[0],
155
- setVisible = _useState8[1];
156
- var handleOnButtonClick = function handleOnButtonClick() {
166
+ const EditDialogue = () => {
167
+ const [visible, setVisible] = useState(false);
168
+ const handleOnButtonClick = () => {
157
169
  setVisible(true);
158
170
  };
159
- var handleOnConfirm = function handleOnConfirm() {
171
+ const handleOnConfirm = () => {
160
172
  setVisible(false);
161
173
  };
162
- var onToggleModal = function onToggleModal(visible) {
163
- return function () {
164
- setVisible(visible);
165
- };
174
+ const onToggleModal = visible => () => {
175
+ setVisible(visible);
166
176
  };
167
- var modalHeader = /*#__PURE__*/React.createElement(H3, null, "Modify Details");
168
- var modalFooter = /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Spacer, {
169
- mr: "s"
170
- }, /*#__PURE__*/React.createElement(Button, {
171
- onClick: handleOnConfirm,
172
- variant: "success",
173
- iconLeft: true
174
- }, /*#__PURE__*/React.createElement(Icon, {
175
- icon: ["fas", "save"]
176
- }), "Save"), /*#__PURE__*/React.createElement(Button, {
177
- variant: "ghost",
178
- onClick: onToggleModal(false),
179
- iconLeft: true
180
- }, /*#__PURE__*/React.createElement(Icon, {
181
- icon: ["fas", "times"]
182
- }), "Cancel")));
183
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
184
- onClick: handleOnButtonClick,
185
- iconLeft: true
186
- }, /*#__PURE__*/React.createElement(Icon, {
187
- icon: ["fas", "edit"]
188
- }), "Modify Details"), /*#__PURE__*/React.createElement(Modal, {
189
- visible: visible,
190
- handleOnConfirm: handleOnConfirm,
191
- onClose: onToggleModal(false),
192
- headerContent: modalHeader,
193
- footerContent: modalFooter
194
- }, /*#__PURE__*/React.createElement(Spacer, {
195
- my: "r"
196
- }, /*#__PURE__*/React.createElement(TextInput, {
197
- id: "textInput1",
198
- key: "textInput1",
199
- type: "text",
200
- fullWidth: true,
201
- label: "Name",
202
- placeholder: "E.g. Awesome Project"
203
- }), /*#__PURE__*/React.createElement(TextArea, {
204
- id: "TextArea01",
205
- label: "Description",
206
- fullWidth: true
207
- }))));
208
- };
209
- export var editDialogueModal = function editDialogueModal() {
210
- return /*#__PURE__*/React.createElement(EditDialogue, null);
177
+ const modalHeader = /*#__PURE__*/_jsx(H3, {
178
+ children: "Modify Details"
179
+ });
180
+ const modalFooter = /*#__PURE__*/_jsx(Flex, {
181
+ children: /*#__PURE__*/_jsxs(Spacer, {
182
+ mr: "s",
183
+ children: [/*#__PURE__*/_jsxs(Button, {
184
+ onClick: handleOnConfirm,
185
+ variant: "success",
186
+ iconLeft: true,
187
+ children: [/*#__PURE__*/_jsx(Icon, {
188
+ icon: ["fas", "save"]
189
+ }), "Save"]
190
+ }), /*#__PURE__*/_jsxs(Button, {
191
+ variant: "ghost",
192
+ onClick: onToggleModal(false),
193
+ iconLeft: true,
194
+ children: [/*#__PURE__*/_jsx(Icon, {
195
+ icon: ["fas", "times"]
196
+ }), "Cancel"]
197
+ })]
198
+ })
199
+ });
200
+ return /*#__PURE__*/_jsxs(_Fragment, {
201
+ children: [/*#__PURE__*/_jsxs(Button, {
202
+ onClick: handleOnButtonClick,
203
+ iconLeft: true,
204
+ children: [/*#__PURE__*/_jsx(Icon, {
205
+ icon: ["fas", "edit"]
206
+ }), "Modify Details"]
207
+ }), /*#__PURE__*/_jsx(Modal, {
208
+ visible: visible,
209
+ handleOnConfirm: handleOnConfirm,
210
+ onClose: onToggleModal(false),
211
+ headerContent: modalHeader,
212
+ footerContent: modalFooter,
213
+ children: /*#__PURE__*/_jsxs(Spacer, {
214
+ my: "r",
215
+ children: [/*#__PURE__*/_jsx(TextInput, {
216
+ id: "textInput1",
217
+ type: "text",
218
+ fullWidth: true,
219
+ label: "Name",
220
+ placeholder: "E.g. Awesome Project"
221
+ }, "textInput1"), /*#__PURE__*/_jsx(TextArea, {
222
+ id: "TextArea01",
223
+ label: "Description",
224
+ fullWidth: true
225
+ })]
226
+ })
227
+ })]
228
+ });
211
229
  };
230
+ export const editDialogueModal = () => /*#__PURE__*/_jsx(EditDialogue, {});
212
231
  editDialogueModal.parameters = {
213
232
  docs: {
214
233
  source: {