@madie/madie-design-system 1.0.41 → 1.0.44

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/components/Tabs/Tab.js +69 -12
  2. package/components/Tabs/Tabs.stories.js +84 -112
  3. package/components/Tabs/index.js +71 -72
  4. package/components/TextArea/TextArea.stories.js +141 -0
  5. package/components/TextArea/index.jsx +107 -0
  6. package/components/index.js +4 -0
  7. package/coverage/clover.xml +42 -430
  8. package/coverage/coverage-final.json +2 -29
  9. package/coverage/lcov-report/InputLabel/index.html +19 -19
  10. package/coverage/lcov-report/InputLabel/index.jsx.html +59 -74
  11. package/coverage/lcov-report/Tab.js.html +334 -0
  12. package/coverage/lcov-report/Tabs/Tab.js.html +343 -0
  13. package/coverage/lcov-report/Tabs/index.html +131 -0
  14. package/coverage/lcov-report/Tabs/index.js.html +388 -0
  15. package/coverage/lcov-report/TextFieldVariable/index.html +116 -0
  16. package/coverage/lcov-report/TextFieldVariable/index.jsx.html +406 -0
  17. package/coverage/lcov-report/Toast/index.html +116 -0
  18. package/coverage/lcov-report/Toast/index.jsx.html +430 -0
  19. package/coverage/lcov-report/index.html +19 -289
  20. package/coverage/lcov-report/index.js.html +109 -112
  21. package/coverage/lcov-report/react/components/Accordion/index.html +1 -1
  22. package/coverage/lcov-report/react/components/Accordion/index.jsx.html +1 -1
  23. package/coverage/lcov-report/react/components/Button/index.html +1 -1
  24. package/coverage/lcov-report/react/components/Button/index.js.html +1 -1
  25. package/coverage/lcov-report/react/components/Error/Collapsible.jsx.html +1 -1
  26. package/coverage/lcov-report/react/components/Error/ErrorUI.jsx.html +1 -1
  27. package/coverage/lcov-report/react/components/Error/error.js.html +1 -1
  28. package/coverage/lcov-report/react/components/Error/index.html +1 -1
  29. package/coverage/lcov-report/react/components/Footer/FooterUI.jsx.html +1 -1
  30. package/coverage/lcov-report/react/components/Footer/LegacyFooterUI.jsx.html +1 -1
  31. package/coverage/lcov-report/react/components/Footer/footer.js.html +1 -1
  32. package/coverage/lcov-report/react/components/Footer/index.html +1 -1
  33. package/coverage/lcov-report/react/components/Infotip/Infotip.jsx.html +1 -1
  34. package/coverage/lcov-report/react/components/Infotip/InfotipIcon.jsx.html +1 -1
  35. package/coverage/lcov-report/react/components/Infotip/index.html +1 -1
  36. package/coverage/lcov-report/react/components/Infotip/index.js.html +1 -1
  37. package/coverage/lcov-report/react/components/InputLabel/index.html +1 -1
  38. package/coverage/lcov-report/react/components/InputLabel/index.jsx.html +4 -4
  39. package/coverage/lcov-report/react/components/MadieAlert/index.html +1 -1
  40. package/coverage/lcov-report/react/components/MadieAlert/index.jsx.html +1 -1
  41. package/coverage/lcov-report/react/components/MadieDeleteDialog/index.html +1 -1
  42. package/coverage/lcov-report/react/components/MadieDeleteDialog/index.jsx.html +1 -1
  43. package/coverage/lcov-report/react/components/MadieDialog/Index.jsx.html +1 -1
  44. package/coverage/lcov-report/react/components/MadieDialog/index.html +1 -1
  45. package/coverage/lcov-report/react/components/MadieDiscardDialog/index.html +1 -1
  46. package/coverage/lcov-report/react/components/MadieDiscardDialog/index.jsx.html +1 -1
  47. package/coverage/lcov-report/react/components/MadieSpinner/index.html +1 -1
  48. package/coverage/lcov-report/react/components/MadieSpinner/index.jsx.html +1 -1
  49. package/coverage/lcov-report/react/components/Pagination/index.html +1 -1
  50. package/coverage/lcov-report/react/components/Pagination/index.jsx.html +1 -1
  51. package/coverage/lcov-report/react/components/Popover/index.html +1 -1
  52. package/coverage/lcov-report/react/components/Popover/index.js.html +1 -1
  53. package/coverage/lcov-report/react/components/ReadOnlyTextField/index.html +1 -1
  54. package/coverage/lcov-report/react/components/ReadOnlyTextField/index.jsx.html +1 -1
  55. package/coverage/lcov-report/react/components/Select/index.html +1 -1
  56. package/coverage/lcov-report/react/components/Select/index.jsx.html +1 -1
  57. package/coverage/lcov-report/react/components/Tabs/Tab.js.html +334 -0
  58. package/coverage/lcov-report/react/components/Tabs/index.html +131 -0
  59. package/coverage/lcov-report/react/components/Tabs/index.js.html +382 -0
  60. package/coverage/lcov-report/react/components/TextArea/index.html +116 -0
  61. package/coverage/lcov-report/react/components/TextArea/index.jsx.html +406 -0
  62. package/coverage/lcov-report/react/components/TextFieldVariable/index.html +116 -0
  63. package/coverage/lcov-report/react/components/TextFieldVariable/index.jsx.html +412 -0
  64. package/coverage/lcov-report/react/components/Textfield/index.html +1 -1
  65. package/coverage/lcov-report/react/components/Textfield/index.jsx.html +1 -1
  66. package/coverage/lcov-report/react/components/Toast/index.html +1 -1
  67. package/coverage/lcov-report/react/components/Toast/index.jsx.html +1 -1
  68. package/coverage/lcov-report/react/components/Tooltip/Tooltip.jsx.html +1 -1
  69. package/coverage/lcov-report/react/components/Tooltip/index.html +1 -1
  70. package/coverage/lcov-report/react/components/Tooltip/index.js.html +1 -1
  71. package/coverage/lcov-report/react/components/Tooltip/position.js.html +1 -1
  72. package/coverage/lcov-report/react/index.html +1 -1
  73. package/coverage/lcov-report/react/index.js.html +1 -1
  74. package/coverage/lcov-report/react/lib/Chevron.jsx.html +1 -1
  75. package/coverage/lcov-report/react/lib/SvgComponents.jsx.html +1 -1
  76. package/coverage/lcov-report/react/lib/index.html +1 -1
  77. package/coverage/lcov.info +67 -891
  78. package/dist/browser.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/react/index.js +14 -14
  81. package/dist/react/index.js.map +1 -1
  82. package/package.json +1 -1
  83. package/storybook-static/533.ce3f16be.iframe.bundle.js +103 -0
  84. package/storybook-static/{533.3f094b15.iframe.bundle.js.map → 533.ce3f16be.iframe.bundle.js.map} +1 -1
  85. package/storybook-static/iframe.html +1 -1
  86. package/storybook-static/main.24906d7d.iframe.bundle.js +1 -0
  87. package/storybook-static/project.json +1 -1
  88. package/styles/_qpp-style.scss +1 -0
  89. package/styles/components/_text-field-variable.scss +14 -0
  90. package/styles/qppds/components/_text-field-variable.scss +14 -0
  91. package/styles/qppds/components/index.scss +1 -0
  92. package/test/components/Tabs.test.js +252 -0
  93. package/test/components/TextArea.test.js +102 -0
  94. package/storybook-static/533.3f094b15.iframe.bundle.js +0 -103
  95. package/storybook-static/main.2cfd9609.iframe.bundle.js +0 -1
  96. /package/storybook-static/{533.3f094b15.iframe.bundle.js.LICENSE.txt → 533.ce3f16be.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -2,25 +2,82 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { Tab as MuiTab } from "@mui/material";
4
4
 
5
- const Tab = ({ href, ...rest }) => {
5
+ const typeA = {
6
+ color: "#fff",
7
+ "&:hover":{
8
+ background: "#001F3D"
9
+ },
10
+ "&:focus":{
11
+ background: "#125496",
12
+ boxShadow: "0px 0px 0px 4px #CBE4FF",
13
+ }
14
+ };
15
+ const typeB = {
16
+ color: "#515151",
17
+ "&:hover":{
18
+ background: "#F2F9FF",
19
+ color: "#242424"
20
+ },
21
+ "&:focus":{
22
+ boxShadow: "0px 0px 0px 4px #CBE4FF",
23
+ background: "#fff"
24
+ }
25
+ };
26
+ const typeC = {
27
+ color: "#333",
28
+ background: "#EDEDED",
29
+ "&:hover":{
30
+ backround: "#FAFAFA",
31
+ color: "#515151"
32
+ },
33
+ "&:focus":{
34
+ boxShadow: "0px 0px 0px 4px #CBE4FF",
35
+ background: "#fff"
36
+ }
37
+ };
38
+
39
+
40
+ const Tab = ({ type, size, ...rest }) => {
41
+ const baseStyle = {
42
+ height: size === 'standard' ? '48px' : '60px',
43
+ fontFamily: "Rubik, sans serif",
44
+ fontWeight: 400,
45
+ padding: size === 'standard' ? "14.5px 24.5px" : "20.5px 24px",
46
+ textTransform: "none",
47
+ fontSize: "16px",
48
+ '&.Mui-disabled': {
49
+ background: "#DDDDDD",
50
+ color: "#717171"
51
+ }
52
+ }
53
+ const style = ((type) => {
54
+ if (type === "A") {
55
+ return { ...baseStyle, ...typeA}
56
+ }
57
+ if (type === "B" || type === "D") {
58
+ return { ...baseStyle, ...typeB, }
59
+ }
60
+ if (type === "C") {
61
+ return { ...baseStyle, ...typeC}
62
+ }
63
+ })(type)
6
64
  return (
7
- <MuiTab
8
- component="a"
9
- disableRipple
10
- onClick={(e) => {
11
- e.preventDefault();
12
- if (window.history && href) {
13
- window.history.replaceState({}, document.title, href);
14
- }
15
- }}
16
- className="qpp-c-tabs__item"
65
+ <MuiTab
66
+ tabIndex={0}
67
+ sx={style}
17
68
  {...rest}
18
69
  />
19
70
  );
20
71
  };
21
72
 
22
73
  Tab.propTypes = {
23
- href: PropTypes.string,
74
+ type: PropTypes.oneOf(["A", "B", "C", "D"]),
75
+ size: PropTypes.oneOf(["standard", "large"]),
76
+ };
77
+ Tab.defaultProps = {
78
+ type: "A",
79
+ size: "standard",
80
+ onChange: null,
24
81
  };
25
82
 
26
83
  export default Tab;
@@ -2,8 +2,8 @@ import React, { useState } from "react";
2
2
  import { withKnobs } from "@storybook/addon-knobs";
3
3
 
4
4
  import Tabs from "./index";
5
- import TabPanel from "./TabPanel";
6
- import Button from "../Button";
5
+ import Tab from './Tab';
6
+
7
7
 
8
8
  export default {
9
9
  title: "Tabs",
@@ -11,120 +11,92 @@ export default {
11
11
  decorators: [withKnobs],
12
12
  };
13
13
 
14
- export const Default = () => {
15
- return (
16
- <div className="qpp-u-padding--12">
17
- <Tabs>
18
- <TabPanel
19
- id="summary"
20
- tab="Summary"
21
- className="my-summary-class"
22
- >
23
- The Bill of Rights is the first ten amendments to the United
24
- States Constitution.
25
- </TabPanel>
26
- <TabPanel id="preamble" tab="Preamble">
27
- We the People of the United States, in Order to form a more
28
- perfect Union, establish Justice, insure domestic
29
- Tranquility, provide for the common defence, promote the
30
- general Welfare, and secure the Blessings of Liberty to
31
- ourselves and our Posterity, do ordain and establish this
32
- Constitution for the United States of America.
33
- </TabPanel>
34
- <TabPanel id="amendments" tab="Amendments">
35
- <h2 className="ds-h4">Bill of Rights</h2>
36
- <ol className="ds-c-list">
37
- <li>Freedoms, Petitions, Assembly</li>
38
- <li>Right to bear arms</li>
39
- <li>Quartering of soldiers</li>
40
- <li>Search and arrest</li>
41
- <li>Rights in criminal cases</li>
42
- <li>Right to a fair trial</li>
43
- <li>Rights in civil cases</li>
44
- <li>Bail, fines, punishment</li>
45
- <li>Rights retained by the People</li>
46
- <li>States’ rights</li>
47
- </ol>
14
+ export const TypeA = () => {
15
+ // state, setState
16
+ const [selected, setSelected] = useState(1)
48
17
 
49
- <h2 className="ds-h4">Later Amendments</h2>
50
- <ol className="ds-c-list" start="11">
51
- <li>Lawsuits against states</li>
52
- <li>Presidential elections</li>
53
- <li>Abolition of slavery</li>
54
- <li>Civil rights</li>
55
- <li>Black suffrage</li>
56
- <li>Income taxes</li>
57
- <li>Senatorial elections</li>
58
- <li>Prohibition of liquor</li>
59
- <li>Women’s suffrage</li>
60
- <li>Terms of office</li>
61
- <li>Repeal of Prohibition</li>
62
- <li>Term Limits for the Presidency</li>
63
- <li>Washington, D.C., suffrage</li>
64
- <li>Abolition of poll taxes</li>
65
- <li>Presidential succession</li>
66
- <li>18-year-old suffrage</li>
67
- <li>Congressional pay raises</li>
68
- </ol>
69
18
 
70
- <h2 className="ds-h4">Even Later Amendments</h2>
71
- <ol className="ds-c-list">
72
- <li>Thou must count to three</li>
73
- <li>
74
- Three shall be the number of the counting and the
75
- number of the counting shall be three
76
- </li>
77
- <li>Four shalt thou not count</li>
78
- <li>
79
- Neither shalt thou count two, excepting that thou
80
- then proceedeth to three
81
- </li>
82
- <li>Five is right out</li>
83
- </ol>
84
- </TabPanel>
85
- <TabPanel id="disabled" tab="Disabled" disabled>
86
- You should not see this.
87
- </TabPanel>
88
- </Tabs>
89
- </div>
90
- );
91
- };
19
+ const handleChange = (e,v) => {
20
+ // 1,2,3
21
+ setSelected(v);
22
+ };
23
+
92
24
 
93
- export const ControlledTabs = () => {
94
- const [selectedId, setSelectedId] = useState("preamble");
95
25
  return (
96
- <div className="qpp-u-padding--12">
97
- <Tabs selected={selectedId} onChange={(id) => setSelectedId(id)}>
98
- <TabPanel
99
- id="summary"
100
- tab="Summary"
101
- className="my-summary-class"
102
- >
103
- The Bill of Rights is the first ten amendments to the United
104
- States Constitution.
105
- </TabPanel>
106
- <TabPanel id="preamble" tab="Preamble">
107
- We the People of the United States, in Order to form a more
108
- perfect Union, establish Justice, insure domestic
109
- Tranquility, provide for the common defence, promote the
110
- general Welfare, and secure the Blessings of Liberty to
111
- ourselves and our Posterity, do ordain and establish this
112
- Constitution for the United States of America.
113
- </TabPanel>
114
- <TabPanel id="amendments" tab="Amendments">
115
- All of the amendments
116
- <br />
117
- <Button
118
- className="qpp-u-margin-top--16"
119
- onClick={() => setSelectedId("summary")}
120
- >
121
- Go to Summary
122
- </Button>
123
- </TabPanel>
124
- <TabPanel id="disabled" tab="Disabled" disabled>
125
- You should not see this.
126
- </TabPanel>
127
- </Tabs>
26
+ <div style={{margin: "25px"}}>
27
+ <div style={{ width: "fit-content"}}>
28
+ Standard: A
29
+ <Tabs type="A" size="standard" value={selected} onChange={handleChange}>
30
+ <Tab type="A" size="standard" label="Item One" value={1}/>
31
+ <Tab type="A" size="standard" label="Item Two" value={2}/>
32
+ <Tab type="A" size="standard" label="Item Three" value={3}/>
33
+ <Tab type="A" size="standard" label="disabled" value={4} disabled/>
34
+ </Tabs>
35
+ </div>
36
+ <div style={{ width: "fit-content"}}>
37
+ Large: A
38
+ <Tabs type="A" size="large" value={selected} onChange={handleChange}>
39
+ <Tab type="A" size="large" label="Item One" value={1}/>
40
+ <Tab type="A" size="large" label="Item Two" value={2}/>
41
+ <Tab type="A" size="large" label="Item Three" value={3}/>
42
+ <Tab type="A" size="large" label="disabled" value={4} disabled/>
43
+ </Tabs>
44
+ </div>
45
+ <div style={{ width: "fit-content"}}>
46
+ Standard: B
47
+ <Tabs type="B" size="standard" value={selected} onChange={handleChange}>
48
+ <Tab type="B" size="standard" label="Item One" value={1} />
49
+ <Tab type="B" size="standard" label="Item Two" value={2} />
50
+ <Tab type="B" size="standard" label="Item Three" value={3} />
51
+ <Tab type="B" size="standard" label="disabled" value={4} disabled/>
52
+ </Tabs>
53
+ </div>
54
+
55
+ <div style={{ width: "fit-content"}}>
56
+ Large: B
57
+ <Tabs type="B" size="large" value={selected} onChange={handleChange}>
58
+ <Tab type="B" size="large" label="Item One" value={1} />
59
+ <Tab type="B" size="large" label="Item Two" value={2} />
60
+ <Tab type="B" size="large" label="Item Three" value={3} />
61
+ <Tab type="B" size="large" label="disabled" value={4} disabled/>
62
+ </Tabs>
63
+ </div>
64
+ <div style={{ width: "fit-content"}}>
65
+ Standard: C
66
+ <Tabs type="C" value={selected} onChange={handleChange}>
67
+ <Tab type="C" size="standard" label="Item One" value={1} />
68
+ <Tab type="C" size="standard" label="Item Two" value={2} />
69
+ <Tab type="C" size="standard" label="Item Three"value={3} />
70
+ <Tab type="C" size="standard" label="disabled" value={4} disabled/>
71
+ </Tabs>
72
+ </div>
73
+ <div style={{ width: "fit-content" }}>
74
+ Large: C
75
+ <Tabs type="C" value={selected} onChange={handleChange}>
76
+ <Tab type="C" size="large" label="Item One" value={1} />
77
+ <Tab type="C" size="large" label="Item Two" value={2} />
78
+ <Tab type="C" size="large" label="Item Three"value={3} />
79
+ <Tab type="C" size="large" label="disabled" value={4} disabled/>
80
+ </Tabs>
81
+ </div>
82
+ <div style={{ width: "fit-content"}}>
83
+ Standard: D
84
+ <Tabs type="D" value={selected} onChange={handleChange}>
85
+ <Tab type="D" size="standard" label="Item One" value={1} />
86
+ <Tab type="D" size="standard" label="Item Two" value={2} />
87
+ <Tab type="D" size="standard" label="Item Three"value={3} />
88
+ <Tab type="D" size="standard" label="disabled" value={4} disabled/>
89
+ </Tabs>
90
+ </div>
91
+ <div style={{ width: "fit-content" }}>
92
+ Large: D
93
+ <Tabs type="D" value={selected} onChange={handleChange}>
94
+ <Tab type="D" size="large" label="Item One" value={1} />
95
+ <Tab type="D" size="large" label="Item Two" value={2} />
96
+ <Tab type="D" size="large" label="Item Three"value={3} />
97
+ <Tab type="D" size="large" label="disabled" value={4} disabled/>
98
+ </Tabs>
99
+ </div>
128
100
  </div>
129
101
  );
130
102
  };
@@ -1,87 +1,85 @@
1
- import React, { useEffect, useState } from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { Tabs as MuiTabs } from "@mui/material";
4
- import TabPanel from "./TabPanel";
5
- import LinkTab from "./Tab";
3
+ import React from "react";
6
4
 
7
- const isTabPanel = (child) => child?.type === TabPanel;
5
+ const typeA = {
6
+ backgroundColor: "#003366",
7
+ borderRadius: "4px 4px 0px 0px !important",
8
+ "& .MuiTabs-indicator": {
9
+ display: "none !important"
10
+ },
11
+ };
12
+
13
+ const typeB = {
14
+ backgroundColor: "#FFF",
15
+ color: "#515151",
16
+ "& .MuiTabs-indicator": {
17
+ backgroundColor:"#209FA6",
18
+ height: "6px"
19
+ },
20
+ };
8
21
 
9
- const getPanelChildren = (children) => {
10
- return React.Children.toArray(children).filter(isTabPanel);
22
+ const typeC = {
23
+ color:"333",
24
+ "& .MuiTabs-indicator": {
25
+ backgroundColor:"#209FA6",
26
+ height: "100%",
27
+ width: "6px !important",
28
+ left: 0,
29
+ },
11
30
  };
12
31
 
32
+ const typeD = {
33
+ backgroundColor: "#FFF",
34
+ color: "#515151",
35
+ "& .MuiTabs-indicator": {
36
+ backgroundColor:"#209FA6",
37
+ height: "6px",
38
+ top: 0
39
+ },
40
+ }
41
+
13
42
  const Tabs = ({
14
- children,
15
- onChange,
16
- selected,
17
- defaultSelectedId,
18
- ariaLabel,
43
+ type,
44
+ size,
45
+ ...rest
19
46
  }) => {
20
- const [value, setValue] = useState(defaultSelectedId || selected);
21
-
22
- useEffect(() => {
23
- if (selected) {
24
- setValue(selected);
47
+ const baseStyle = {
48
+ outline: "none",
49
+ fontFamily: "Rubik, sans Sarif",
50
+ fontWeight: 400,
51
+ lineHeight: 19,
52
+ "& .Mui-selected": {
53
+ outline: "none",
54
+ fontWeight: 500,
55
+ color: "#333 !important",
56
+ backgroundColor: "#fff",
57
+ },
58
+ }
59
+ const style = ((type) => {
60
+ if (type === "A") {
61
+ return { ...baseStyle, ...typeA}
25
62
  }
26
- }, [selected]);
27
-
28
- if (!children) return null;
29
-
30
- const handleChange = (event, newValue) => {
31
- if (onChange) {
32
- onChange(tabList[newValue]?.id, event);
63
+ if (type === "B") {
64
+ return { ...baseStyle, ...typeB}
33
65
  }
34
- if (setValue) {
35
- setValue(tabList[newValue]?.id);
66
+ if (type === "C") {
67
+ return { ...baseStyle, ...typeC}
36
68
  }
37
- };
38
-
39
- const renderChildren = () => {
40
- return React.Children.map(children, (child, index) => {
41
- if (isTabPanel(child)) {
42
- return React.cloneElement(child, { index, value: tabIndex });
43
- }
44
- return child;
45
- });
46
- };
47
-
48
- const panels = getPanelChildren(children);
49
-
50
- const tabList = panels.map((panel) => {
51
- const { id, tab, tabHref, disabled } = panel?.props || {};
52
- return { tab, tabHref, disabled, id };
53
- });
54
-
55
- const foundIndex = tabList.findIndex(({ id }) => id === value);
56
-
57
- const tabIndex = foundIndex >= 0 ? foundIndex : 0;
58
-
59
- return (
60
- <>
61
- <div className="qpp-c-tabs qpp-c-tabs--mui">
62
- <MuiTabs
63
- value={tabIndex}
64
- onChange={handleChange}
65
- aria-label={ariaLabel}
66
- >
67
- {tabList.map(({ tab, tabHref, disabled, id }, index) => (
68
- <LinkTab
69
- index={index}
70
- key={`link-tab-${tab}`}
71
- label={tab}
72
- href={tabHref}
73
- disabled={disabled}
74
- id={`qpp-c-tabs__item--${id}`}
75
- />
76
- ))}
77
- </MuiTabs>
78
- </div>
79
- {renderChildren()}
80
- </>
81
- );
82
- };
69
+ if (type === "D") {
70
+ return { ...baseStyle, ...typeD}
71
+ }
72
+ })(type)
73
+ return (<MuiTabs
74
+ disableRipple
75
+ sx={style}
76
+ {...rest}
77
+ />)
78
+ }
83
79
 
84
80
  Tabs.propTypes = {
81
+ type: PropTypes.oneOf(["A", "B", "C", "D"]),
82
+ size: PropTypes.oneOf(["standard", "large"]),
85
83
  ariaLabel: PropTypes.string,
86
84
  selected: PropTypes.string,
87
85
  defaultSelectedId: PropTypes.string,
@@ -90,7 +88,8 @@ Tabs.propTypes = {
90
88
  };
91
89
 
92
90
  Tabs.defaultProps = {
93
- ariaLabel: "qpp tabs",
91
+ type: "A",
92
+ size: "standard",
94
93
  selected: null,
95
94
  defaultSelectedId: null,
96
95
  onChange: null,
@@ -0,0 +1,141 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { withKnobs } from "@storybook/addon-knobs";
4
+ import TextArea from "./index";
5
+ import { FormHelperText } from "@mui/material";
6
+ export default {
7
+ title: "TextArea",
8
+ component: TextArea,
9
+ decorators: [withKnobs],
10
+ };
11
+
12
+ const Wrapper = ({ children }) => (
13
+ <div className="qpp-u-padding--16" style={{ width: 300 }}>
14
+ {children}
15
+ </div>
16
+ );
17
+ Wrapper.propTypes = {
18
+ className: PropTypes.string,
19
+ children: PropTypes.node,
20
+ };
21
+ export const Textarea = () => (
22
+ <Wrapper>
23
+ <TextArea
24
+ placeholder="Placeholder"
25
+ label="Text Label"
26
+ id="measureName"
27
+ inputProps={{ "data-testid": "measure-name-input" }}
28
+ data-testid="measure-name-text-field"
29
+ size="small"
30
+ />
31
+ </Wrapper>
32
+ );
33
+
34
+ export const WithHelperText = () => (
35
+ <Wrapper>
36
+ <TextArea
37
+ placeholder="Placeholder"
38
+ label="Text Label"
39
+ id="measureName"
40
+ inputProps={{ "data-testid": "measure-name-input" }}
41
+ data-testid="measure-name-text-field"
42
+ size="small"
43
+ helperText={
44
+ <FormHelperText data-testid={`helper-text`} error={false}>
45
+ a descriptive message
46
+ </FormHelperText>
47
+ }
48
+ />
49
+ </Wrapper>
50
+ );
51
+
52
+ export const Disabled = () => (
53
+ <Wrapper>
54
+ <TextArea
55
+ placeholder="Placeholder"
56
+ label="Text Label"
57
+ id="measureName"
58
+ inputProps={{ "data-testid": "measure-name-input" }}
59
+ data-testid="measure-name-text-field"
60
+ size="small"
61
+ disabled
62
+ required
63
+ />
64
+ </Wrapper>
65
+ );
66
+
67
+ export const Required = () => (
68
+ <Wrapper>
69
+ <TextArea
70
+ placeholder="Placeholder"
71
+ required
72
+ label="Text Label"
73
+ id="measureName"
74
+ inputProps={{ "data-testid": "measure-name-input" }}
75
+ data-testid="measure-name-text-field"
76
+ size="small"
77
+ />
78
+ </Wrapper>
79
+ );
80
+
81
+ export const Error = () => (
82
+ <Wrapper>
83
+ <TextArea
84
+ placeholder="Placeholder"
85
+ error
86
+ required
87
+ label="Text Label"
88
+ id="measureName"
89
+ inputProps={{ "data-testid": "measure-name-input" }}
90
+ data-testid="measure-name-text-field"
91
+ size="small"
92
+ helperText="An error message"
93
+ />
94
+ </Wrapper>
95
+ );
96
+
97
+ export const VariedHeights = () => (
98
+ <div className="qpp-u-padding--16" style={{ width: 900, marginBottom: "16px" }} >
99
+ <div style={{display: "flex", flexDirection: "row"}}>
100
+ <TextArea
101
+ placeholder="Placeholder"
102
+ required
103
+ label="Text Label"
104
+ id="measureName"
105
+ inputProps={{ "data-testid": "measure-name-input" }}
106
+ data-testid="measure-name-text-field"
107
+ size="small"
108
+ helperText="An error message"
109
+ />
110
+ <TextArea
111
+ placeholder="Placeholder"
112
+ required
113
+ label="Text Label"
114
+ id="measureName"
115
+ inputProps={{ "data-testid": "measure-name-input" }}
116
+ data-testid="measure-name-text-field"
117
+ size="small"
118
+ helperText="An error message"
119
+ />
120
+ <TextArea
121
+ placeholder="Placeholder"
122
+ label="Text Label"
123
+ id="measureName"
124
+ inputProps={{ "data-testid": "measure-name-input" }}
125
+ data-testid="measure-name-text-field"
126
+ size="small"
127
+ helperText="An error message designed to take up a lot of space to see how we space multiple input elements within the same row in a responsive manner "
128
+ />
129
+ <TextArea
130
+ placeholder="Placeholder"
131
+ error
132
+ required
133
+ label="Text Label"
134
+ id="measureName"
135
+ inputProps={{ "data-testid": "measure-name-input" }}
136
+ data-testid="measure-name-text-field"
137
+ size="small"
138
+ helperText="An error message"
139
+ />
140
+ </div>
141
+ </div>)