@madie/madie-design-system 1.2.61 → 2.0.0
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/.eslintrc.js +1 -1
- package/.storybook/.babelrc +2 -1
- package/.storybook/main.js +3 -11
- package/components/AutoComplete/AutoComplete.jsx +1 -1
- package/components/Button/Button.stories.js +0 -2
- package/components/DateField/DateField.jsx +2 -2
- package/components/DateField/DateField.stories.jsx +23 -10
- package/components/DateTimeField/DateTimeField.jsx +6 -2
- package/components/DateTimeField/DateTimeField.stories.jsx +29 -19
- package/components/Instant/Instant.stories.js +14 -6
- package/components/MadieAlert/MadieAlert.stories.js +35 -29
- package/components/MadieAlert/index.jsx +5 -5
- package/components/MadieConfirmDialog/MadieConfirmDialog.stories.js +17 -27
- package/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +9 -18
- package/components/MadieDialog/MadieDialog.stories.js +45 -116
- package/components/MadieDialog/index.jsx +4 -2
- package/components/MadieDiscardDialog/MadieDiscardDialog.stories.js +5 -7
- package/components/MadieSpinner/MadieSpinner.stories.js +1 -3
- package/components/MadieTooltip/MadieTooltip.stories.js +7 -2
- package/components/Modal/Modal.stories.js +18 -89
- package/components/NotificationBanner/NotificationBanner.stories.js +17 -11
- package/components/NotificationBanner/index.js +3 -3
- package/components/NumberInput/NumberInput.stories.js +51 -63
- package/components/Popover/Popover.stories.js +6 -14
- package/components/Popover/index.js +2 -2
- package/components/RadioButton/RadioButton.jsx +4 -2
- package/components/RadioButton/RadioButton.stories.jsx +6 -2
- package/components/ReadOnlyTextField/ReadOnlyTextField.stories.js +4 -3
- package/components/ReadOnlyTextField/index.jsx +1 -1
- package/components/RichTextEditor/RichTextEditor.stories.js +10 -8
- package/components/RichTextEditor/index.jsx +14 -15
- package/components/Search/Search.stories.js +2 -4
- package/components/Select/Select.stories.js +59 -160
- package/components/Select/index.jsx +1 -1
- package/components/Tabs/Tabs.stories.js +78 -210
- package/components/TextArea/TextArea.stories.js +88 -108
- package/components/TextArea/index.jsx +1 -1
- package/components/TextField/TextField.stories.js +101 -124
- package/components/TextField/index.jsx +1 -1
- package/components/TimeField/TimeField.stories.js +18 -8
- package/components/Toast/Toast.stories.js +42 -102
- package/components/TruncateText/TruncateText.stories.js +22 -17
- package/components/hooks/useGetConfig.js +2 -2
- package/components/index.js +0 -24
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +182 -51
- package/dist/react/index.js.LICENSE.txt +27 -24
- package/dist/react/index.js.map +1 -1
- package/eslint.config.js +56 -0
- package/index.js +7 -9
- package/package.json +43 -75
- package/test/components/Accordion.test.js +1 -1
- package/test/components/AutoComplete.test.js +11 -6
- package/test/components/Button.test.js +7 -3
- package/test/components/DateField.test.js +26 -30
- package/test/components/DateTimeField.test.js +22 -26
- package/test/components/Instant.test.js +1 -1
- package/test/components/MadieAlert.test.js +22 -22
- package/test/components/MadieConfirmDialog.test.js +42 -64
- package/test/components/MadieDeleteDialog.test.js +51 -69
- package/test/components/MadieDialog.test.js +13 -13
- package/test/components/MadieDiscardDialog.test.js +28 -45
- package/test/components/MadieSpinner.test.js +12 -17
- package/test/components/Modal.test.js +115 -0
- package/test/components/Pagination.test.js +2 -2
- package/test/components/RadioButton.test.js +7 -7
- package/test/components/ReadOnlyTextField.test.js +4 -2
- package/test/components/RichTextEditor.test.js +90 -6
- package/test/components/Search.test.js +75 -0
- package/test/components/Select.test.js +97 -107
- package/test/components/Tabs.test.js +22 -24
- package/test/components/TextArea.test.js +78 -92
- package/test/components/TextField.test.js +128 -147
- package/test/components/Toast.test.js +67 -78
- package/test/components/TruncateText.test.js +75 -0
- package/test/components/index.test.js +23 -0
- package/webpack.config.js +0 -1
- package/.eslintignore +0 -5
- package/components/Alert/Alert.stories.js +0 -70
- package/components/Alert/index.js +0 -55
- package/components/Breadcrumb/Breadcrumb.md +0 -28
- package/components/Breadcrumb/Breadcrumb.stories.js +0 -76
- package/components/Breadcrumb/index.js +0 -92
- package/components/CalloutBox/CalloutBox.stories.js +0 -94
- package/components/CalloutBox/index.js +0 -109
- package/components/Card/Card.stories.js +0 -163
- package/components/Card/index.js +0 -144
- package/components/Dropdown/Dropdown.stories.js +0 -94
- package/components/Dropdown/index.js +0 -85
- package/components/Error/Collapsible.jsx +0 -93
- package/components/Error/ErrorUI.jsx +0 -31
- package/components/Error/error.js +0 -26
- package/components/FlashNotification/FlashNotificationUI.jsx +0 -91
- package/components/FlashNotification/index.js +0 -30
- package/components/Footer/Footer.stories.js +0 -20
- package/components/Footer/FooterUI.jsx +0 -137
- package/components/Footer/LegacyFooterUI.jsx +0 -204
- package/components/Footer/SocialLinks.jsx +0 -63
- package/components/Footer/Subscribe.jsx +0 -34
- package/components/Footer/footer.js +0 -30
- package/components/Infotip/Infotip.jsx +0 -75
- package/components/Infotip/Infotip.stories.js +0 -52
- package/components/Infotip/InfotipIcon.jsx +0 -41
- package/components/Infotip/index.js +0 -3
- package/components/Link/Link.stories.js +0 -82
- package/components/Link/index.js +0 -61
- package/components/Spinner/index.js +0 -9
- package/components/TextInput/TextInput.stories.js +0 -118
- package/components/TextInput/index.js +0 -137
- package/components/Tooltip/Tooltip.jsx +0 -88
- package/components/Tooltip/Tooltip.stories.js +0 -80
- package/components/Tooltip/index.js +0 -3
- package/components/Tooltip/position.js +0 -76
- package/test/components/ErrorUI.test.js +0 -32
- package/test/components/FooterUI.test.js +0 -122
- package/test/components/Infotip.test.js +0 -76
- package/test/components/Tooltip.test.js +0 -147
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { withKnobs } from "@storybook/addon-knobs";
|
|
3
2
|
import Toast from "./index";
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
title: "Toast",
|
|
7
6
|
component: Toast,
|
|
8
|
-
|
|
7
|
+
argTypes: {
|
|
8
|
+
toastType: {
|
|
9
|
+
control: {
|
|
10
|
+
type: "select",
|
|
11
|
+
options: ["success", "warning", "info", "danger"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
message: { control: "text" },
|
|
15
|
+
autoHideDuration: { control: "number" },
|
|
16
|
+
},
|
|
9
17
|
};
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
const Template = (args) => {
|
|
12
20
|
const [toastOpen, setToastOpen] = useState(false);
|
|
21
|
+
|
|
13
22
|
return (
|
|
14
23
|
<div
|
|
15
24
|
style={{
|
|
16
25
|
height: "100vh",
|
|
17
26
|
width: "100vw",
|
|
18
27
|
backgroundColor: "#242424",
|
|
28
|
+
position: "relative",
|
|
19
29
|
}}
|
|
20
30
|
>
|
|
21
31
|
<button
|
|
@@ -23,119 +33,49 @@ export const SuccessToast = () => {
|
|
|
23
33
|
style={{
|
|
24
34
|
position: "absolute",
|
|
25
35
|
top: "50%",
|
|
26
|
-
left: "
|
|
36
|
+
left: "50%",
|
|
37
|
+
transform: "translate(-50%, -50%)",
|
|
38
|
+
padding: "8px 16px",
|
|
39
|
+
cursor: "pointer",
|
|
27
40
|
}}
|
|
28
41
|
>
|
|
29
|
-
|
|
42
|
+
Show Toast
|
|
30
43
|
</button>
|
|
31
44
|
<Toast
|
|
45
|
+
{...args}
|
|
32
46
|
toastKey="toast-key"
|
|
33
|
-
testId=
|
|
34
|
-
toastType="success"
|
|
47
|
+
testId={`${args.toastType}-toast`}
|
|
35
48
|
open={toastOpen}
|
|
36
|
-
message="An action has successfully been completed"
|
|
37
49
|
onClose={() => setToastOpen(false)}
|
|
38
|
-
autoHideDuration={3000}
|
|
39
50
|
/>
|
|
40
51
|
</div>
|
|
41
52
|
);
|
|
42
53
|
};
|
|
43
54
|
|
|
44
|
-
export const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
height: "100vh",
|
|
50
|
-
width: "100vw",
|
|
51
|
-
backgroundColor: "#242424",
|
|
52
|
-
}}
|
|
53
|
-
>
|
|
54
|
-
<button
|
|
55
|
-
onClick={() => setToastOpen(true)}
|
|
56
|
-
style={{
|
|
57
|
-
position: "absolute",
|
|
58
|
-
top: "50%",
|
|
59
|
-
left: "calc(50% - 80px)",
|
|
60
|
-
}}
|
|
61
|
-
>
|
|
62
|
-
Simulate Warning
|
|
63
|
-
</button>
|
|
64
|
-
<Toast
|
|
65
|
-
toastKey="toast-key"
|
|
66
|
-
toastType="warning"
|
|
67
|
-
testId="warning-toast"
|
|
68
|
-
open={toastOpen}
|
|
69
|
-
message="Something has gone wrong. consider fixing before continuing"
|
|
70
|
-
onClose={() => setToastOpen(false)}
|
|
71
|
-
autoHideDuration={3000}
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
55
|
+
export const SuccessToast = Template.bind({});
|
|
56
|
+
SuccessToast.args = {
|
|
57
|
+
toastType: "success",
|
|
58
|
+
message: "An action has successfully been completed",
|
|
59
|
+
autoHideDuration: 3000,
|
|
75
60
|
};
|
|
76
61
|
|
|
77
|
-
export const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
height: "100vh",
|
|
83
|
-
width: "100vw",
|
|
84
|
-
backgroundColor: "#242424",
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
<button
|
|
88
|
-
onClick={() => setToastOpen(true)}
|
|
89
|
-
style={{
|
|
90
|
-
position: "absolute",
|
|
91
|
-
top: "50%",
|
|
92
|
-
left: "calc(50% - 80px)",
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
Simulate Info
|
|
96
|
-
</button>
|
|
97
|
-
<Toast
|
|
98
|
-
toastKey="toast-key"
|
|
99
|
-
toastType="info"
|
|
100
|
-
testId="info-toast"
|
|
101
|
-
open={toastOpen}
|
|
102
|
-
message="Some useful information"
|
|
103
|
-
onClose={() => setToastOpen(false)}
|
|
104
|
-
autoHideDuration={3000}
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
62
|
+
export const WarningToast = Template.bind({});
|
|
63
|
+
WarningToast.args = {
|
|
64
|
+
toastType: "warning",
|
|
65
|
+
message: "Something has gone wrong. Consider fixing before continuing",
|
|
66
|
+
autoHideDuration: 3000,
|
|
108
67
|
};
|
|
109
68
|
|
|
110
|
-
export const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
style={{
|
|
123
|
-
position: "absolute",
|
|
124
|
-
top: "50%",
|
|
125
|
-
left: "calc(50% - 80px)",
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
Simulate Danger
|
|
129
|
-
</button>
|
|
130
|
-
<Toast
|
|
131
|
-
toastKey="toast-key"
|
|
132
|
-
toastType="danger"
|
|
133
|
-
testId="danger-toast"
|
|
134
|
-
open={toastOpen}
|
|
135
|
-
message="Something has gone wrong. Please try again"
|
|
136
|
-
onClose={() => setToastOpen(false)}
|
|
137
|
-
autoHideDuration={3000}
|
|
138
|
-
/>
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
69
|
+
export const InfoToast = Template.bind({});
|
|
70
|
+
InfoToast.args = {
|
|
71
|
+
toastType: "info",
|
|
72
|
+
message: "Some useful information",
|
|
73
|
+
autoHideDuration: 3000,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const DangerToast = Template.bind({});
|
|
77
|
+
DangerToast.args = {
|
|
78
|
+
toastType: "danger",
|
|
79
|
+
message: "Something has gone wrong. Please try again",
|
|
80
|
+
autoHideDuration: 3000,
|
|
141
81
|
};
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { withKnobs } from "@storybook/addon-knobs";
|
|
3
2
|
import TruncateText from "./index";
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
title: "Truncate Text",
|
|
7
6
|
component: TruncateText,
|
|
8
|
-
|
|
7
|
+
argTypes: {
|
|
8
|
+
text: { control: "text" },
|
|
9
|
+
maxLength: { control: { type: "number", min: 0 } },
|
|
10
|
+
dataTestId: { control: "text" },
|
|
11
|
+
fontSize: { control: "text" },
|
|
12
|
+
},
|
|
9
13
|
};
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
const Template = (args) => <TruncateText {...args} />;
|
|
16
|
+
|
|
17
|
+
export const FullText = Template.bind({});
|
|
18
|
+
FullText.args = {
|
|
19
|
+
text: "Addressing Social Needs in the Inpatient Setting Part 4 of 4 Housing",
|
|
20
|
+
maxLength: 120,
|
|
21
|
+
dataTestId: "measure-comments",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const TruncatedText = Template.bind({});
|
|
25
|
+
TruncatedText.args = {
|
|
26
|
+
text: "Addressing Social Needs in the Inpatient Setting Part 4 of 4 Housing Domain Addressing Social Needs in the Inpatient Setting Part 4 of 4 Housing Domain",
|
|
27
|
+
maxLength: 60,
|
|
28
|
+
dataTestId: "measure-comments",
|
|
29
|
+
fontSize: "1rem",
|
|
30
|
+
};
|
|
@@ -22,7 +22,7 @@ const useGetConfig = ({
|
|
|
22
22
|
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
const storageContent = JSON.parse(
|
|
25
|
-
localStorage.getItem(localStorageName)
|
|
25
|
+
localStorage.getItem(localStorageName),
|
|
26
26
|
);
|
|
27
27
|
if (
|
|
28
28
|
storageContent?.content &&
|
|
@@ -59,7 +59,7 @@ const useGetConfig = ({
|
|
|
59
59
|
|
|
60
60
|
localStorage.setItem(
|
|
61
61
|
localStorageName,
|
|
62
|
-
JSON.stringify(storageItem)
|
|
62
|
+
JSON.stringify(storageItem),
|
|
63
63
|
);
|
|
64
64
|
setResult(storageItem);
|
|
65
65
|
})
|
package/components/index.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import Accordion from "./Accordion";
|
|
2
|
-
import Alert from "./Alert";
|
|
3
2
|
import AutoComplete from "./AutoComplete/AutoComplete";
|
|
4
|
-
import Breadcrumb from "./Breadcrumb";
|
|
5
3
|
import Button, { TextButton } from "./Button";
|
|
6
|
-
import CalloutBox from "./CalloutBox";
|
|
7
|
-
import Card from "./Card";
|
|
8
4
|
import DateField from "./DateField/DateField";
|
|
9
5
|
import DateTimeField from "./DateTimeField/DateTimeField";
|
|
10
|
-
import FlashNotification from "./FlashNotification/FlashNotificationUI";
|
|
11
|
-
import Footer from "./Footer/FooterUI";
|
|
12
6
|
import Instant from "./Instant";
|
|
13
7
|
import InputLabel from "./InputLabel";
|
|
14
8
|
import FormControlLabel from "./FormControlLabel";
|
|
@@ -27,20 +21,14 @@ import RadioButton from "./RadioButton/RadioButton";
|
|
|
27
21
|
import ReadOnlyTextField from "./ReadOnlyTextField";
|
|
28
22
|
import RichTextEditor from "./RichTextEditor";
|
|
29
23
|
import Select from "./Select";
|
|
30
|
-
import Spinner from "./UnwrappedSpinner";
|
|
31
24
|
import TabPanel from "./Tabs/TabPanel";
|
|
32
25
|
import Tabs from "./Tabs/index";
|
|
33
26
|
import Tab from "./Tabs/Tab";
|
|
34
27
|
import TextField from "./TextField";
|
|
35
28
|
import TimeField from "./TimeField/TimeField";
|
|
36
29
|
import TextArea from "./TextArea";
|
|
37
|
-
import Tooltip from "./Tooltip";
|
|
38
30
|
import Toast from "./Toast";
|
|
39
|
-
import Infotip from "./Infotip";
|
|
40
31
|
import Search from "./Search";
|
|
41
|
-
import TextInput from "./TextInput";
|
|
42
|
-
import Dropdown from "./Dropdown";
|
|
43
|
-
import DSLink from "./Link";
|
|
44
32
|
import NumberInput from "./NumberInput";
|
|
45
33
|
import TruncateText from "./TruncateText/index";
|
|
46
34
|
import theme from "../themes/actionCenterTheme.js";
|
|
@@ -128,20 +116,13 @@ const Icons = {
|
|
|
128
116
|
|
|
129
117
|
export {
|
|
130
118
|
Accordion,
|
|
131
|
-
Alert,
|
|
132
119
|
AutoComplete,
|
|
133
|
-
Breadcrumb,
|
|
134
120
|
Button,
|
|
135
|
-
CalloutBox,
|
|
136
|
-
Card,
|
|
137
121
|
DateField,
|
|
138
122
|
DateTimeField,
|
|
139
|
-
FlashNotification,
|
|
140
|
-
Footer,
|
|
141
123
|
FormControlLabel,
|
|
142
124
|
InputLabel,
|
|
143
125
|
Icons,
|
|
144
|
-
Infotip,
|
|
145
126
|
Instant,
|
|
146
127
|
Modal,
|
|
147
128
|
MadieAlert,
|
|
@@ -160,19 +141,14 @@ export {
|
|
|
160
141
|
RichTextEditor,
|
|
161
142
|
Search,
|
|
162
143
|
Select,
|
|
163
|
-
Spinner,
|
|
164
144
|
TabPanel,
|
|
165
145
|
Tabs,
|
|
166
146
|
Tab,
|
|
167
147
|
TextButton,
|
|
168
|
-
TextInput,
|
|
169
148
|
TimeField,
|
|
170
149
|
TextField,
|
|
171
150
|
TextArea,
|
|
172
151
|
Toast,
|
|
173
|
-
Dropdown,
|
|
174
|
-
Tooltip,
|
|
175
|
-
DSLink,
|
|
176
152
|
TruncateText,
|
|
177
153
|
theme,
|
|
178
154
|
};
|