@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.
Files changed (118) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.storybook/.babelrc +2 -1
  3. package/.storybook/main.js +3 -11
  4. package/components/AutoComplete/AutoComplete.jsx +1 -1
  5. package/components/Button/Button.stories.js +0 -2
  6. package/components/DateField/DateField.jsx +2 -2
  7. package/components/DateField/DateField.stories.jsx +23 -10
  8. package/components/DateTimeField/DateTimeField.jsx +6 -2
  9. package/components/DateTimeField/DateTimeField.stories.jsx +29 -19
  10. package/components/Instant/Instant.stories.js +14 -6
  11. package/components/MadieAlert/MadieAlert.stories.js +35 -29
  12. package/components/MadieAlert/index.jsx +5 -5
  13. package/components/MadieConfirmDialog/MadieConfirmDialog.stories.js +17 -27
  14. package/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +9 -18
  15. package/components/MadieDialog/MadieDialog.stories.js +45 -116
  16. package/components/MadieDialog/index.jsx +4 -2
  17. package/components/MadieDiscardDialog/MadieDiscardDialog.stories.js +5 -7
  18. package/components/MadieSpinner/MadieSpinner.stories.js +1 -3
  19. package/components/MadieTooltip/MadieTooltip.stories.js +7 -2
  20. package/components/Modal/Modal.stories.js +18 -89
  21. package/components/NotificationBanner/NotificationBanner.stories.js +17 -11
  22. package/components/NotificationBanner/index.js +3 -3
  23. package/components/NumberInput/NumberInput.stories.js +51 -63
  24. package/components/Popover/Popover.stories.js +6 -14
  25. package/components/Popover/index.js +2 -2
  26. package/components/RadioButton/RadioButton.jsx +4 -2
  27. package/components/RadioButton/RadioButton.stories.jsx +6 -2
  28. package/components/ReadOnlyTextField/ReadOnlyTextField.stories.js +4 -3
  29. package/components/ReadOnlyTextField/index.jsx +1 -1
  30. package/components/RichTextEditor/RichTextEditor.stories.js +10 -8
  31. package/components/RichTextEditor/index.jsx +14 -15
  32. package/components/Search/Search.stories.js +2 -4
  33. package/components/Select/Select.stories.js +59 -160
  34. package/components/Select/index.jsx +1 -1
  35. package/components/Tabs/Tabs.stories.js +78 -210
  36. package/components/TextArea/TextArea.stories.js +88 -108
  37. package/components/TextArea/index.jsx +1 -1
  38. package/components/TextField/TextField.stories.js +101 -124
  39. package/components/TextField/index.jsx +1 -1
  40. package/components/TimeField/TimeField.stories.js +18 -8
  41. package/components/Toast/Toast.stories.js +42 -102
  42. package/components/TruncateText/TruncateText.stories.js +22 -17
  43. package/components/hooks/useGetConfig.js +2 -2
  44. package/components/index.js +0 -24
  45. package/dist/browser.js +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/react/index.js +182 -51
  48. package/dist/react/index.js.LICENSE.txt +27 -24
  49. package/dist/react/index.js.map +1 -1
  50. package/eslint.config.js +56 -0
  51. package/index.js +7 -9
  52. package/package.json +43 -75
  53. package/test/components/Accordion.test.js +1 -1
  54. package/test/components/AutoComplete.test.js +11 -6
  55. package/test/components/Button.test.js +7 -3
  56. package/test/components/DateField.test.js +26 -30
  57. package/test/components/DateTimeField.test.js +22 -26
  58. package/test/components/Instant.test.js +1 -1
  59. package/test/components/MadieAlert.test.js +22 -22
  60. package/test/components/MadieConfirmDialog.test.js +42 -64
  61. package/test/components/MadieDeleteDialog.test.js +51 -69
  62. package/test/components/MadieDialog.test.js +13 -13
  63. package/test/components/MadieDiscardDialog.test.js +28 -45
  64. package/test/components/MadieSpinner.test.js +12 -17
  65. package/test/components/Modal.test.js +115 -0
  66. package/test/components/Pagination.test.js +2 -2
  67. package/test/components/RadioButton.test.js +7 -7
  68. package/test/components/ReadOnlyTextField.test.js +4 -2
  69. package/test/components/RichTextEditor.test.js +90 -6
  70. package/test/components/Search.test.js +75 -0
  71. package/test/components/Select.test.js +97 -107
  72. package/test/components/Tabs.test.js +22 -24
  73. package/test/components/TextArea.test.js +78 -92
  74. package/test/components/TextField.test.js +128 -147
  75. package/test/components/Toast.test.js +67 -78
  76. package/test/components/TruncateText.test.js +75 -0
  77. package/test/components/index.test.js +23 -0
  78. package/webpack.config.js +0 -1
  79. package/.eslintignore +0 -5
  80. package/components/Alert/Alert.stories.js +0 -70
  81. package/components/Alert/index.js +0 -55
  82. package/components/Breadcrumb/Breadcrumb.md +0 -28
  83. package/components/Breadcrumb/Breadcrumb.stories.js +0 -76
  84. package/components/Breadcrumb/index.js +0 -92
  85. package/components/CalloutBox/CalloutBox.stories.js +0 -94
  86. package/components/CalloutBox/index.js +0 -109
  87. package/components/Card/Card.stories.js +0 -163
  88. package/components/Card/index.js +0 -144
  89. package/components/Dropdown/Dropdown.stories.js +0 -94
  90. package/components/Dropdown/index.js +0 -85
  91. package/components/Error/Collapsible.jsx +0 -93
  92. package/components/Error/ErrorUI.jsx +0 -31
  93. package/components/Error/error.js +0 -26
  94. package/components/FlashNotification/FlashNotificationUI.jsx +0 -91
  95. package/components/FlashNotification/index.js +0 -30
  96. package/components/Footer/Footer.stories.js +0 -20
  97. package/components/Footer/FooterUI.jsx +0 -137
  98. package/components/Footer/LegacyFooterUI.jsx +0 -204
  99. package/components/Footer/SocialLinks.jsx +0 -63
  100. package/components/Footer/Subscribe.jsx +0 -34
  101. package/components/Footer/footer.js +0 -30
  102. package/components/Infotip/Infotip.jsx +0 -75
  103. package/components/Infotip/Infotip.stories.js +0 -52
  104. package/components/Infotip/InfotipIcon.jsx +0 -41
  105. package/components/Infotip/index.js +0 -3
  106. package/components/Link/Link.stories.js +0 -82
  107. package/components/Link/index.js +0 -61
  108. package/components/Spinner/index.js +0 -9
  109. package/components/TextInput/TextInput.stories.js +0 -118
  110. package/components/TextInput/index.js +0 -137
  111. package/components/Tooltip/Tooltip.jsx +0 -88
  112. package/components/Tooltip/Tooltip.stories.js +0 -80
  113. package/components/Tooltip/index.js +0 -3
  114. package/components/Tooltip/position.js +0 -76
  115. package/test/components/ErrorUI.test.js +0 -32
  116. package/test/components/FooterUI.test.js +0 -122
  117. package/test/components/Infotip.test.js +0 -76
  118. package/test/components/Tooltip.test.js +0 -147
package/.eslintrc.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  extends: ["eslint:recommended", "plugin:react/recommended"],
3
- parser: "babel-eslint",
3
+ parser: "@babel/eslint-parser",
4
4
  parserOptions: {
5
5
  sourceType: "module",
6
6
  ecmaFeatures: {
@@ -1,4 +1,5 @@
1
1
  {
2
- "presets": ["@babel/preset-react", "@babel/preset-env"],
2
+ "presets": ["@babel/preset-react"],
3
+ // "presets": ["@babel/preset-react", "@babel/preset-env"],
3
4
  "plugins": ["@babel/plugin-transform-class-properties"]
4
5
  }
@@ -5,17 +5,9 @@ module.exports = {
5
5
  ],
6
6
 
7
7
  addons: [
8
- "@storybook/addon-actions",
9
- "@storybook/addon-links",
10
- "@storybook/addon-storysource",
11
- "@storybook/addon-knobs",
12
- "@storybook/addon-a11y",
13
- "@storybook/addon-docs",
14
- "@storybook/addon-backgrounds",
15
- "@storybook/addon-viewport",
16
- "@storybook/addon-postcss",
17
- "@storybook/addon-webpack5-compiler-babel"
18
- ],
8
+ "@storybook/addon-links",
9
+ "@storybook/addon-webpack5-compiler-babel",
10
+ "@storybook/addon-docs"],
19
11
 
20
12
  webpackFinal: async (config) => {
21
13
  // do mutation to the config
@@ -95,7 +95,7 @@ const AutoComplete = ({
95
95
  {...rest}
96
96
  value={_.isEmpty(rest.value) ? "-" : rest.value}
97
97
  />
98
- )
98
+ );
99
99
  }
100
100
 
101
101
  return (
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
  import FeatherIcon from "feather-icons-react";
5
4
 
6
5
  import Button, { TextButton } from "./index";
@@ -8,7 +7,6 @@ import Button, { TextButton } from "./index";
8
7
  export default {
9
8
  title: "Button",
10
9
  component: Button,
11
- decorators: [withKnobs],
12
10
  };
13
11
 
14
12
  const Container = ({ className = "", children }) => (
@@ -64,9 +64,9 @@ const DateField = ({
64
64
  id={id}
65
65
  size="small"
66
66
  {...rest}
67
- value={value ? dayjs.utc(value).format("YYYY/MM/DD") : "-"}
67
+ value={value ? dayjs.utc(value).format("MM/DD/YYYY") : "-"}
68
68
  />
69
- )
69
+ );
70
70
  }
71
71
 
72
72
  if (containerSx === undefined || containerSx === null) {
@@ -1,41 +1,54 @@
1
1
  import React, { useState } from "react";
2
2
  import DateField from "./DateField";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
 
5
4
  export default {
6
5
  title: "DateField",
7
6
  component: DateField,
8
- decorators: [withKnobs],
7
+ argTypes: {
8
+ label: { control: "text" },
9
+ disabled: { control: "boolean" },
10
+ value: { control: "text" },
11
+ },
9
12
  };
13
+
10
14
  export const DateFieldComponent = (args) => {
11
15
  const [value, setValue] = useState("");
16
+
12
17
  const handleDateChange = (e) => {
13
18
  console.log("Handle change triggered", e.target.value);
14
19
  setValue(e.target.value);
15
20
  };
21
+
16
22
  return (
17
23
  <div className="qpp-u-padding--16">
18
24
  <DateField
19
- label="Status Date"
20
- handleDateChange={handleDateChange}
25
+ {...args}
21
26
  value={value}
27
+ handleDateChange={handleDateChange}
22
28
  />
23
29
  </div>
24
30
  );
25
31
  };
26
32
 
33
+ DateFieldComponent.args = {
34
+ label: "Status Date",
35
+ disabled: false,
36
+ };
37
+
27
38
  export const DateFieldComponentDisabled = (args) => {
28
39
  const handleDateChange = (e) => {
29
40
  console.log("Handle change triggered", e.target.value);
30
41
  };
42
+
31
43
  return (
32
44
  <div className="qpp-u-padding--16">
33
- <DateField
34
- disabled
35
- label="Status Date"
36
- handleDateChange={handleDateChange}
37
- value="2023-10-01"
38
- />
45
+ <DateField {...args} handleDateChange={handleDateChange} />
39
46
  </div>
40
47
  );
41
48
  };
49
+
50
+ DateFieldComponentDisabled.args = {
51
+ label: "Status Date",
52
+ disabled: true,
53
+ value: "2023-10-01",
54
+ };
@@ -58,11 +58,15 @@ const DateTimeField = ({
58
58
  return (
59
59
  <ReadOnlyTextField
60
60
  label={label}
61
- value={dateTimeValue ? dayjs.utc(dateTimeValue).format("YYYY/MM/DD HH:mm A") : "-"}
61
+ value={
62
+ dateTimeValue
63
+ ? dayjs.utc(dateTimeValue).format("MM/DD/YYYY hh:mm A")
64
+ : "-"
65
+ }
62
66
  id={id}
63
67
  size="small"
64
68
  />
65
- )
69
+ );
66
70
  }
67
71
  return (
68
72
  <FormControl>
@@ -1,41 +1,51 @@
1
1
  import React, { useState } from "react";
2
2
  import DateTimeField from "./DateTimeField";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
 
5
4
  export default {
6
5
  title: "DateTimeField",
7
6
  component: DateTimeField,
8
- decorators: [withKnobs],
7
+ argTypes: {
8
+ label: { control: "text" },
9
+ disabled: { control: "boolean" },
10
+ dateTimeValue: { control: "text" },
11
+ id: { control: "text" },
12
+ },
9
13
  };
10
14
 
11
15
  export const TimeDateFieldComponent = (args) => {
12
- const [value, setValue] = useState("");
16
+ const [value, setValue] = useState(args.dateTimeValue || "");
17
+
13
18
  const handleDateTimeChange = (e) => {
14
19
  setValue(e.target.value);
15
20
  };
21
+
16
22
  return (
17
23
  <div className="qpp-u-padding--16">
18
24
  <DateTimeField
19
- // disabled={true}
20
- id="status_date_time"
21
- label="Status Date/Time"
22
- handleDateTimeChange={handleDateTimeChange}
25
+ {...args}
23
26
  dateTimeValue={value}
27
+ handleDateTimeChange={handleDateTimeChange}
24
28
  />
25
29
  </div>
26
30
  );
27
31
  };
28
32
 
29
- export const TimeDateFieldComponentDisabled = (args) => {
30
- return (
31
- <div className="qpp-u-padding--16">
32
- <DateTimeField
33
- disabled={true}
34
- id="status_date_time"
35
- label="Status Date/Time"
36
- handleDateTimeChange={(e) => {}}
37
- dateTimeValue="2023-10-01T12:00:00Z"
38
- />
39
- </div>
40
- );
33
+ TimeDateFieldComponent.args = {
34
+ label: "Status Date/Time",
35
+ disabled: false,
36
+ id: "status_date_time",
37
+ dateTimeValue: "",
38
+ };
39
+
40
+ export const TimeDateFieldComponentDisabled = (args) => (
41
+ <div className="qpp-u-padding--16">
42
+ <DateTimeField {...args} handleDateTimeChange={() => {}} />
43
+ </div>
44
+ );
45
+
46
+ TimeDateFieldComponentDisabled.args = {
47
+ label: "Status Date/Time",
48
+ disabled: true,
49
+ id: "status_date_time",
50
+ dateTimeValue: "2023-10-01T12:00:00Z",
41
51
  };
@@ -1,11 +1,14 @@
1
1
  import React, { useState } from "react";
2
2
  import Instant from "./index";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
 
5
4
  export default {
6
5
  title: "Instant",
7
6
  component: Instant,
8
- decorators: [withKnobs],
7
+ argTypes: {
8
+ disabled: { control: "boolean" },
9
+ id: { control: "text" },
10
+ label: { control: "text" },
11
+ },
9
12
  };
10
13
 
11
14
  export const InstantComponent = (args) => {
@@ -13,16 +16,21 @@ export const InstantComponent = (args) => {
13
16
  const handleDateTimeChange = (v) => {
14
17
  setValue(v);
15
18
  };
19
+
16
20
  return (
17
21
  <div className="qpp-u-padding--16">
18
- <div> Date string: {value} </div>
22
+ <div>Date string: {value}</div>
19
23
  <Instant
20
- disabled={false}
21
- id="status_date_time"
22
- label="Status Date/Time"
24
+ {...args}
23
25
  handleDateTimeChange={handleDateTimeChange}
24
26
  dateTimeValue={value}
25
27
  />
26
28
  </div>
27
29
  );
28
30
  };
31
+
32
+ InstantComponent.args = {
33
+ disabled: false,
34
+ id: "status_date_time",
35
+ label: "Status Date/Time",
36
+ };
@@ -1,34 +1,42 @@
1
1
  import React from "react";
2
2
  import MadieAlert from "./index";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
 
5
4
  export default {
6
5
  title: "Madie Alert",
7
6
  component: MadieAlert,
8
7
  decorators: [
9
- withKnobs,
10
- (storyFn) => (
8
+ (Story) => (
11
9
  <div style={{ padding: "120px", backgroundColor: "gray" }}>
12
- {storyFn()}
10
+ <Story />
13
11
  </div>
14
12
  ),
15
13
  ],
14
+ argTypes: {
15
+ type: {
16
+ control: { type: "select" },
17
+ options: ["info", "warning", "error", "success"],
18
+ },
19
+ content: { control: "text" },
20
+ active: { control: "boolean" },
21
+ },
16
22
  };
17
23
 
18
- export const MadieAlertWarning = () => (
19
- <MadieAlert
20
- type="warning"
21
- content="Your measure needs a CMS ID, you must first create and import your measure from MAT."
22
- />
23
- );
24
+ const Template = (args) => <MadieAlert {...args} />;
25
+
26
+ export const MadieAlertWarning = Template.bind({});
27
+ MadieAlertWarning.args = {
28
+ type: "warning",
29
+ content:
30
+ "Your measure needs a CMS ID, you must first create and import your measure from MAT.",
31
+ };
24
32
  MadieAlertWarning.storyName = "MadieAlertWarning";
25
33
 
26
- export const MadieAlertInfo = () => (
27
- <MadieAlert
28
- type="info"
29
- content="Your measure needs a CMS ID, you must first create and import your measure from MAT."
30
- />
31
- );
34
+ export const MadieAlertInfo = Template.bind({});
35
+ MadieAlertInfo.args = {
36
+ type: "info",
37
+ content:
38
+ "Your measure needs a CMS ID, you must first create and import your measure from MAT.",
39
+ };
32
40
  MadieAlertInfo.storyName = "MadieAlertInfo";
33
41
 
34
42
  export const MadieAlertInfoList = () => (
@@ -62,19 +70,17 @@ export const MadieAlertWithTitle = () => (
62
70
  );
63
71
  MadieAlertWithTitle.storyName = "withTitle";
64
72
 
65
- export const MadieAlertError = () => (
66
- <MadieAlert
67
- type="error"
68
- active={false}
69
- content="Please complete the CQL Editor process before continuing."
70
- />
71
- );
73
+ export const MadieAlertError = Template.bind({});
74
+ MadieAlertError.args = {
75
+ type: "error",
76
+ content: "Please complete the CQL Editor process before continuing.",
77
+ active: false,
78
+ };
72
79
  MadieAlertError.storyName = "MadieAlertError";
73
80
 
74
- export const MadieAlertSuccess = () => (
75
- <MadieAlert
76
- type="success"
77
- content="Your measure has been succesfully updated."
78
- />
79
- );
81
+ export const MadieAlertSuccess = Template.bind({});
82
+ MadieAlertSuccess.args = {
83
+ type: "success",
84
+ content: "Your measure has been succesfully updated.",
85
+ };
80
86
  MadieAlertSuccess.storyName = "MadieAlertSuccess";
@@ -54,8 +54,8 @@ const processContent = (content) => {
54
54
  const childCount = Array.isArray(children)
55
55
  ? children.length
56
56
  : children
57
- ? 1
58
- : 0;
57
+ ? 1
58
+ : 0;
59
59
  counts[el.type] += childCount;
60
60
  }
61
61
 
@@ -246,7 +246,7 @@ const MadieAlert = ({
246
246
 
247
247
  const totalMinimizedErrors = minimizedIndices.reduce(
248
248
  (sum, index) => sum + (individualErrors[index] || 0),
249
- 0
249
+ 0,
250
250
  );
251
251
 
252
252
  // Render alert content
@@ -298,7 +298,7 @@ const MadieAlert = ({
298
298
  navigator.clipboard.writeText(
299
299
  copyButton
300
300
  ? processContent(content).copyText
301
- : copyText
301
+ : copyText,
302
302
  );
303
303
  updateState({ toastOpen: true });
304
304
  }}
@@ -389,7 +389,7 @@ MadieAlert.propTypes = {
389
389
  alertProps: PropTypes.object,
390
390
  closeButtonProps: PropTypes.object,
391
391
  copyButton: PropTypes.bool,
392
- })
392
+ }),
393
393
  ),
394
394
  };
395
395
 
@@ -1,12 +1,11 @@
1
1
  import React, { useState } from "react";
2
2
  import PropTypes from "prop-types";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
  import MadieConfirmDialog from "./index";
5
4
  import Button from "../Button";
5
+
6
6
  export default {
7
7
  title: "MadieConfirmDialog",
8
8
  component: MadieConfirmDialog,
9
- decorators: [withKnobs],
10
9
  };
11
10
 
12
11
  const Wrapper = ({ children }) => (
@@ -21,31 +20,20 @@ Wrapper.propTypes = {
21
20
 
22
21
  export const ConfirmDialog = () => {
23
22
  const [open, setOpen] = useState(false);
24
- const onClose = () => {
25
- setOpen(false);
26
- };
27
- const onContinue = () => {
28
- setOpen(false);
29
- };
30
-
31
23
  const [openDiscardDialog, setOpenDiscardDialog] = useState(false);
32
- const onDiscardDialogClose = () => {
33
- setOpenDiscardDialog(false);
34
- };
35
- const onDiscardDialogContinue = () => {
36
- setOpenDiscardDialog(false);
37
- };
38
-
39
24
  const [openDeleteDialog, setOpenDeleteDialog] = useState(false);
40
- const onDeleteDialogClose = () => {
41
- setOpenDeleteDialog(false);
42
- };
43
- const onDeleteDialogContinue = () => {
44
- setOpenDeleteDialog(false);
45
- };
25
+
26
+ const onClose = () => setOpen(false);
27
+ const onContinue = () => setOpen(false);
28
+
29
+ const onDiscardDialogClose = () => setOpenDiscardDialog(false);
30
+ const onDiscardDialogContinue = () => setOpenDiscardDialog(false);
31
+
32
+ const onDeleteDialogClose = () => setOpenDeleteDialog(false);
33
+ const onDeleteDialogContinue = () => setOpenDeleteDialog(false);
46
34
 
47
35
  return (
48
- <div className="qpp-u-padding--16" style={{ width: 300 }}>
36
+ <Wrapper>
49
37
  <p>
50
38
  <Button variant="cyan" onClick={() => setOpen(true)}>
51
39
  open Confirm Dialog
@@ -62,13 +50,12 @@ export const ConfirmDialog = () => {
62
50
  <p>
63
51
  <Button
64
52
  variant="cyan"
65
- onClick={() => {
66
- setOpenDeleteDialog(true);
67
- }}
53
+ onClick={() => setOpenDeleteDialog(true)}
68
54
  >
69
55
  open Delete Dialog
70
56
  </Button>
71
57
  </p>
58
+
72
59
  <MadieConfirmDialog
73
60
  open={open}
74
61
  onContinue={onContinue}
@@ -78,6 +65,7 @@ export const ConfirmDialog = () => {
78
65
  name="log out of UMLS"
79
66
  action="confirm"
80
67
  />
68
+
81
69
  <MadieConfirmDialog
82
70
  open={openDiscardDialog}
83
71
  onContinue={onDiscardDialogContinue}
@@ -89,6 +77,7 @@ export const ConfirmDialog = () => {
89
77
  continueText="Yes, Discard All Changes"
90
78
  cancelText="No, Keep Working"
91
79
  />
80
+
92
81
  <MadieConfirmDialog
93
82
  open={openDeleteDialog}
94
83
  onContinue={onDeleteDialogContinue}
@@ -99,6 +88,7 @@ export const ConfirmDialog = () => {
99
88
  action="delete"
100
89
  continueText="Yes, Delete"
101
90
  />
102
- </div>
91
+ </Wrapper>
103
92
  );
104
93
  };
94
+ ConfirmDialog.storyName = "ConfirmDialog";
@@ -1,12 +1,11 @@
1
1
  import React, { useState } from "react";
2
2
  import PropTypes from "prop-types";
3
- import { withKnobs } from "@storybook/addon-knobs";
4
3
  import MadieDeleteDialog from "./index";
5
4
  import Button from "../Button";
5
+
6
6
  export default {
7
7
  title: "MadieDeleteDialog",
8
8
  component: MadieDeleteDialog,
9
- decorators: [withKnobs],
10
9
  };
11
10
 
12
11
  const Wrapper = ({ children }) => (
@@ -21,15 +20,11 @@ Wrapper.propTypes = {
21
20
 
22
21
  export const DeleteDialog = () => {
23
22
  const [open, setOpen] = useState(false);
24
- const onClose = () => {
25
- setOpen(false);
26
- };
27
- const onContinue = () => {
28
- setOpen(false);
29
- };
23
+ const onClose = () => setOpen(false);
24
+ const onContinue = () => setOpen(false);
30
25
 
31
26
  return (
32
- <div className="qpp-u-padding--16" style={{ width: 300 }}>
27
+ <Wrapper>
33
28
  <Button variant="cyan" onClick={() => setOpen(true)}>
34
29
  open Dialog
35
30
  </Button>
@@ -38,21 +33,17 @@ export const DeleteDialog = () => {
38
33
  onContinue={onContinue}
39
34
  onClose={onClose}
40
35
  />
41
- </div>
36
+ </Wrapper>
42
37
  );
43
38
  };
44
39
 
45
40
  export const DeleteDialogNoWarning = () => {
46
41
  const [open, setOpen] = useState(false);
47
- const onClose = () => {
48
- setOpen(false);
49
- };
50
- const onContinue = () => {
51
- setOpen(false);
52
- };
42
+ const onClose = () => setOpen(false);
43
+ const onContinue = () => setOpen(false);
53
44
 
54
45
  return (
55
- <div className="qpp-u-padding--16" style={{ width: 300 }}>
46
+ <Wrapper>
56
47
  <Button variant="cyan" onClick={() => setOpen(true)}>
57
48
  open Dialog
58
49
  </Button>
@@ -62,6 +53,6 @@ export const DeleteDialogNoWarning = () => {
62
53
  onClose={onClose}
63
54
  hideWarning={true}
64
55
  />
65
- </div>
56
+ </Wrapper>
66
57
  );
67
58
  };