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
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
})(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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:", ";", ";", ";"],
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ariaLabel =
|
|
44
|
-
props
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
20
|
+
const handleOnConfirm = () => {
|
|
24
21
|
setVisible(false);
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setVisible(visible);
|
|
29
|
-
};
|
|
23
|
+
const onToggleModal = visible => () => {
|
|
24
|
+
setVisible(visible);
|
|
30
25
|
};
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
59
|
+
const handleOnConfirm = () => {
|
|
61
60
|
setVisible(false);
|
|
62
61
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
setVisible(visible);
|
|
66
|
-
};
|
|
62
|
+
const onToggleModal = visible => () => {
|
|
63
|
+
setVisible(visible);
|
|
67
64
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
112
|
+
const handleOnConfirm = () => {
|
|
107
113
|
setVisible(false);
|
|
108
114
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
setVisible(visible);
|
|
112
|
-
};
|
|
115
|
+
const onToggleModal = visible => () => {
|
|
116
|
+
setVisible(visible);
|
|
113
117
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
171
|
+
const handleOnConfirm = () => {
|
|
160
172
|
setVisible(false);
|
|
161
173
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
setVisible(visible);
|
|
165
|
-
};
|
|
174
|
+
const onToggleModal = visible => () => {
|
|
175
|
+
setVisible(visible);
|
|
166
176
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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: {
|