@madie/madie-design-system 1.0.8 → 1.0.11

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 (35) hide show
  1. package/components/Button/Button.stories.js +6 -0
  2. package/components/Button/index.js +8 -1
  3. package/components/Footer/FooterUI.jsx +25 -192
  4. package/components/Footer/LegacyFooterUI.jsx +5 -5
  5. package/components/FormControlLabel/index.jsx +16 -16
  6. package/components/InputLabel/index.jsx +38 -50
  7. package/components/MadieSpinner/MadieSpinner.stories.js +1 -1
  8. package/components/MadieSpinner/index.jsx +25 -27
  9. package/components/Pagination/index.jsx +85 -99
  10. package/components/Select/index.jsx +36 -27
  11. package/components/TextField/index.jsx +27 -33
  12. package/components/Toast/Toast.stories.js +75 -0
  13. package/components/Toast/index.jsx +116 -0
  14. package/components/index.js +3 -1
  15. package/coverage/clover.xml +15 -35
  16. package/coverage/coverage-final.json +1 -3
  17. package/coverage/lcov-report/index.html +15 -45
  18. package/coverage/lcov-report/index.jsx.html +130 -370
  19. package/coverage/lcov.info +19 -48
  20. package/dist/browser.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/react/index.js +19 -19
  23. package/dist/react/index.js.LICENSE.txt +0 -8
  24. package/dist/react/index.js.map +1 -1
  25. package/package.json +6 -4
  26. package/storybook-static/795.32ffebb1.iframe.bundle.js +103 -0
  27. package/storybook-static/{646.c1b4ee40.iframe.bundle.js.LICENSE.txt → 795.32ffebb1.iframe.bundle.js.LICENSE.txt} +0 -0
  28. package/storybook-static/{646.c1b4ee40.iframe.bundle.js.map → 795.32ffebb1.iframe.bundle.js.map} +1 -1
  29. package/storybook-static/iframe.html +1 -1
  30. package/storybook-static/main.45299231.iframe.bundle.js +1 -0
  31. package/styles/qppds/components/_button.scss +39 -0
  32. package/styles/qppds/components/_footer.scss +38 -11
  33. package/test/components/Toast.test.js +70 -0
  34. package/storybook-static/646.c1b4ee40.iframe.bundle.js +0 -103
  35. package/storybook-static/main.3812688a.iframe.bundle.js +0 -1
@@ -43,6 +43,12 @@ export const Danger = () => (
43
43
  </Container>
44
44
  );
45
45
 
46
+ export const DangerPrimary = () => (
47
+ <Container>
48
+ <Button variant="danger-primary">Button</Button>
49
+ </Container>
50
+ );
51
+
46
52
  export const Outline = () => (
47
53
  <Container className="qpp-u-fill--blue-80">
48
54
  <Button variant="outline">Button</Button>
@@ -1,7 +1,14 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
 
4
- const VARIANTS = ["secondary", "outline", "danger", "white"];
4
+ const VARIANTS = [
5
+ "secondary",
6
+ "outline",
7
+ "cyan",
8
+ "danger",
9
+ "danger-primary",
10
+ "white",
11
+ ];
5
12
  const SIZES = ["big"];
6
13
 
7
14
  const Button = ({
@@ -1,22 +1,14 @@
1
- import React, { useState, useEffect } from "react";
1
+ import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import axios from "axios";
4
3
 
5
- import InfoTip from "../Infotip/Infotip";
6
4
  import LegacyFooterUI from "./LegacyFooterUI";
7
- import Subscribe from "./Subscribe";
8
- import SocialLinks from "./SocialLinks";
9
-
10
- const infoTipLabel =
11
- "When dialing 711, you will automatically be connected to a TRS Communications Assistant who will relay your conversation to the help desk agent with strict confidentiality.";
12
5
 
13
6
  const FooterUI = (props) => {
14
7
  const isNewFooter = props.isNewFooter;
15
8
  const isIESupportPage = props.isIESupportPage;
16
9
  const signUpNowLink = props.showHcdResearch
17
10
  ? "/about/hcd-research"
18
- : "mailto:QPPUserResearch@cms.hhs.gov?subject=Sign up for feedback sessions&body=Please let us know your role and how many Tax Identification Numbers (TINs) you represent. Don’t send us your actual TINs, that is confidential information that should not be shared with this email address. If you do not represent a practice, let us know what work you do in connection to QPP.";
19
- const [listServ, setListServ] = useState(false);
11
+ : "mailto:madie@cms.hhs.gov?subject=Sign up for feedback sessions";
20
12
 
21
13
  // Default footer assets
22
14
  const assets = {
@@ -28,11 +20,11 @@ const FooterUI = (props) => {
28
20
  src="/images/hhs-logo-black.svg"
29
21
  />
30
22
  ),
31
- qppLogo: (
23
+ madieLogo: (
32
24
  <img
33
25
  className="qpp-logo"
34
26
  src="/images/qpp_logo_rgb_color.png"
35
- alt="qpp logo"
27
+ alt="madie logo"
36
28
  />
37
29
  ),
38
30
  },
@@ -43,60 +35,11 @@ const FooterUI = (props) => {
43
35
  return isIESupportPage ? "/" : link;
44
36
  };
45
37
 
46
- // The footer content is populated with the following priority order:
47
- // 1. Use the footer content in localStorage if it's there
48
- // 2. If not, make a call to get it from the QPPFE endpoint. Hydrate the localStorage item with the response.
49
- // 3. If the call fails, use the default value
50
- useEffect(() => {
51
- const storageContent = JSON.parse(
52
- localStorage.getItem("qpp_footer_listServ")
53
- );
54
- if (
55
- storageContent?.content &&
56
- new Date().valueOf() < storageContent.expiration
57
- ) {
58
- setListServ(storageContent.listServ);
59
- } else {
60
- const origin = window.location.origin;
61
- axios
62
- .get(
63
- !origin.includes("localhost")
64
- ? `${origin}/config/footer`
65
- : "https://qpp.cms.gov/config/footer"
66
- )
67
- .then(({ data: { data = {} } }) => {
68
- localStorage.setItem(
69
- "qpp_footer_listServ",
70
- JSON.stringify({
71
- listServ: data.listServ,
72
- })
73
- );
74
- setListServ(data.listServ);
75
- })
76
- .catch((e) => {
77
- setListServ(false);
78
- });
79
- }
80
- }, []);
81
38
  if (isNewFooter) {
82
39
  return (
83
40
  <>
84
41
  {!isIESupportPage && (
85
- <div className="feedback-session-sign-up">
86
- <div className="responsive-container">
87
- <hr />
88
- <p>
89
- <strong>Help shape the future of QPP.</strong>{" "}
90
- Participate in a user feedback session.{" "}
91
- <a
92
- className="email-note-link"
93
- href={signUpNowLink}
94
- >
95
- Sign up now
96
- </a>
97
- </p>
98
- </div>
99
- </div>
42
+ <div className="feedback-session-sign-up" />
100
43
  )}
101
44
  <footer className="global-footer">
102
45
  <div className="build-version" id="build-version">
@@ -104,156 +47,46 @@ const FooterUI = (props) => {
104
47
  </div>
105
48
 
106
49
  <div className="responsive-container">
107
- <>
108
- {!isIESupportPage && (
109
- <div className="global-footer-container">
110
- <div className="footer-resources">
111
- <p className="sub-title">Resources</p>
112
- <ul>
113
- <li>
114
- <a
115
- href="/about/resource-library"
116
- aria-label="Resource Library"
117
- data-track-category="FooterNav"
118
- data-track-action="OpenEducationAndTools"
119
- data-track-label="Education and Tools"
120
- >
121
- Resource Library
122
- </a>
123
- </li>
124
- <li>
125
- <a
126
- href="/resources/help-and-support"
127
- aria-label="Help and Support"
128
- data-track-category="FooterNav"
129
- data-track-action="OpenHelpAndSupport"
130
- data-track-label="Help and Support"
131
- >
132
- Help and Support
133
- </a>
134
- </li>
135
- <li>
136
- <a
137
- href="/about/small-underserved-rural-practices"
138
- aria-label="Support for Small Practices"
139
- data-track-category="FooterNav"
140
- data-track-action="OpenSupportSmallPractices"
141
- data-track-label="Support for Small Practices"
142
- >
143
- Support for Small Practices
144
- </a>
145
- </li>
146
- <li>
147
- <a
148
- href="/developers"
149
- aria-label="Developer Tools"
150
- data-track-category="FooterNav"
151
- data-track-action="OpenDeveloperTools"
152
- data-track-label="Quality Payment Program"
153
- >
154
- Developer Tools
155
- </a>
156
- </li>
157
- <li>
158
- <a
159
- href="/glossary"
160
- aria-label="Glossary"
161
- data-track-category="FooterNav"
162
- data-track-action="OpenGlossary"
163
- data-track-label="Glossary"
164
- >
165
- Glossary
166
- </a>
167
- </li>
168
- </ul>
169
- </div>
170
- <div className="footer-contact-cms">
171
- <p className="sub-title">Contact CMS</p>
172
- <p className="contact-title">
173
- By Phone:
174
- </p>
175
- <p>Monday - Friday 8 a.m - 8 p.m ET</p>
176
- <p>
177
- 1-866-288-8292 (TRS: 711)
178
- <span className="footer-trs-infotip">
179
- <InfoTip label={infoTipLabel} />
180
- </span>
181
- </p>
182
-
183
- <p className="contact-title">
184
- By Email:
185
- </p>
186
- <p>
187
- <a
188
- aria-label="QPP@cms.hhs.gov"
189
- href="mailto:QPP@cms.hhs.gov"
190
- className="email-link"
191
- >
192
- QPP@cms.hhs.gov
193
- </a>
194
- </p>
195
- </div>
196
- <div className="footer-social-newsletter">
197
- <p className="sub-title">
198
- Stay Connected
199
- </p>
200
- <SocialLinks />
201
- <p className="sub-title">
202
- {listServ
203
- ? "Sign Up for the QPP Listserv"
204
- : "Sign Up for the QPP Newsletter"}
205
- </p>
206
- <Subscribe />
207
- </div>
208
- </div>
209
- )}
210
- <hr />
211
- </>
212
-
213
50
  <div className="other-links">
51
+ <hr className="divider-top" />
214
52
  <ul className="small">
215
- <li>
53
+ <li>
216
54
  <a
217
- href={setLink("/privacy")}
218
- aria-label="Notice of Privacy and Disclaimer"
55
+ href={setLink("https://harp.cms.gov/login/terms-of-use")}
56
+ aria-label="Terms of Use"
219
57
  data-track-category="FooterNav"
220
- data-track-action="OpenPrivacyDisclaimer"
221
- data-track-label="Notice of Privacy and Disclaimer"
58
+ data-track-action="OpenTermsOfService"
59
+ data-track-label="Terms of Use"
222
60
  >
223
- CMS Privacy Notice
61
+ Terms of Use
224
62
  </a>
225
63
  </li>
226
64
  <li className="divider"></li>{" "}
227
65
  <li>
228
66
  <a
229
- href={setLink("/accessibility")}
230
- aria-label="Accessibility"
67
+ href={setLink("https://www.cms.gov/privacy")}
68
+ aria-label="Privacy Policy"
231
69
  data-track-category="FooterNav"
232
- data-track-action="OpenAccessibility"
233
- data-track-label="Accessibility"
70
+ data-track-action="OpenPrivacyPolicy"
71
+ data-track-label="Privacy Policy"
234
72
  >
235
- Accessibility
73
+ Privacy Policy
236
74
  </a>
237
75
  </li>
238
76
  <li className="divider"></li>{" "}
239
77
  <li>
240
78
  <a
241
- aria-label="Download Adobe Reader"
242
- className="adobe-link"
243
- rel="noopener noreferrer"
244
- target="_blank"
245
- href={setLink(
246
- "https://get.adobe.com/reader"
247
- )}
79
+ href={setLink("https://www.hhs.gov/web/governance/digital-strategy/it-policy-archive/hhs-rules-of-behavior-for-the-use-of-hhs-information-and-it-resources-policy.html")}
80
+ aria-label="Rules of Behavior"
248
81
  data-track-category="FooterNav"
249
- data-track-action="DownloadAdobeReader"
250
- data-track-label="AdobeReader"
82
+ data-track-action="OpenRulesofBehavior"
83
+ data-track-label="Rules of Behavior"
251
84
  >
252
- Download Adobe Reader
85
+ Rules of Behavior
253
86
  </a>
254
87
  </li>
255
88
  </ul>
256
- <hr />
89
+ <hr className="divider-bottom" />
257
90
  </div>
258
91
  <div className="qpp-hhs-logo-container">
259
92
  <div className="qpp-logo-container">
@@ -290,8 +123,8 @@ FooterUI.propTypes = {
290
123
  isIESupportPage: PropTypes.bool,
291
124
  showHcdResearch: PropTypes.bool,
292
125
  assets: PropTypes.shape({
293
- hhsLogo: PropTypes.element,
294
- qppLogo: PropTypes.element,
126
+ cmsLogo: PropTypes.element,
127
+ madieLogo: PropTypes.element,
295
128
  }),
296
129
  };
297
130
 
@@ -21,7 +21,7 @@ const LegacyFooterUI = ({ buildVersion, isFullWidth, signUpNowLink }) => {
21
21
  >
22
22
  <div className="row">
23
23
  <div className="col-sm-12 col-md-12 col-lg-12">
24
- <span>Help shape the future of QPP</span> by
24
+ <span>Help shape the future of MADiE</span> by
25
25
  participating in user feedback sessions.{" "}
26
26
  <a className="email-note-link" href={signUpNowLink}>
27
27
  Send us an email to sign up
@@ -118,7 +118,7 @@ const LegacyFooterUI = ({ buildVersion, isFullWidth, signUpNowLink }) => {
118
118
  <ul className="small">
119
119
  <li>
120
120
  <a
121
- href="/privacy"
121
+ href="https://www.cms.gov/privacy"
122
122
  data-track-category="FooterNav"
123
123
  data-track-action="OpenPrivacyDisclaimer"
124
124
  data-track-label="Notice of Privacy and Disclaimer"
@@ -129,7 +129,7 @@ const LegacyFooterUI = ({ buildVersion, isFullWidth, signUpNowLink }) => {
129
129
  <span className="divider"></span>
130
130
  <li>
131
131
  <a
132
- href="/accessibility"
132
+ href="https://www.cms.gov/About-CMS/Agency-Information/Aboutwebsite/Policiesforaccessibility"
133
133
  data-track-category="FooterNav"
134
134
  data-track-action="OpenAccessibility"
135
135
  data-track-label="Accessibility"
@@ -157,10 +157,10 @@ const LegacyFooterUI = ({ buildVersion, isFullWidth, signUpNowLink }) => {
157
157
  <span className="divider"></span>
158
158
  <li>
159
159
  <a
160
- href="mailto:QPP@cms.hhs.gov"
160
+ href="mailto:sb-mat-help@semanticbits.com"
161
161
  className="email-link"
162
162
  >
163
- QPP@cms.hhs.gov
163
+ sb-mat-help@semanticbits.com
164
164
  </a>
165
165
  </li>
166
166
  <li>
@@ -1,23 +1,23 @@
1
1
  import React from "react";
2
2
  import { FormControlLabel as MUIFormControlLabel } from "@mui/material";
3
- import { makeStyles } from "@mui/styles";
4
3
 
5
- const useStyles = makeStyles({
6
- root: {
7
- flexGrow: 1,
8
- textTransform: "none",
9
- margin: 0,
10
- "& .MuiTypography-root": {
11
- color: "#333",
12
- fontSize: 14,
13
- fontFamily: "Rubik",
14
- fontWeight: 500,
15
- },
16
- },
17
- });
18
4
  const Label = (props) => {
19
- const classes = useStyles();
20
- return <MUIFormControlLabel classes={classes} {...props} />;
5
+ return (
6
+ <MUIFormControlLabel
7
+ sx={{
8
+ flexGrow: 1,
9
+ textTransform: "none",
10
+ margin: 0,
11
+ "& .MuiTypography-root": {
12
+ color: "#333",
13
+ fontSize: 14,
14
+ fontFamily: "Rubik",
15
+ fontWeight: 500,
16
+ },
17
+ }}
18
+ {...props}
19
+ />
20
+ );
21
21
  };
22
22
 
23
23
  export default Label;
@@ -1,57 +1,45 @@
1
1
  import React from "react";
2
2
  import { InputLabel as MUIInputLabel } from "@mui/material";
3
- import { makeStyles } from "@mui/styles";
4
- const useStyles = makeStyles({
5
- asterisk: {
6
- color: "#D92F2F",
7
- },
8
- root: {
9
- "&&": {
10
- backgroundColor: "transparent",
11
- display: "flex",
12
- flexDirection: "row-reverse",
13
- alignSelf: "baseline",
14
- textTransform: "none",
15
- // force it outside the select box
16
- position: "initial",
17
- transform: "translateX(0px) translateY(0px)",
18
- fontFamily: "Rubik",
19
- fontWeight: 500,
20
- fontSize: 14,
21
- color: "#333",
22
- },
23
- },
24
- required: {
25
- "&&": {
26
- transform: "translateX(-12px) translateY(0px)",
27
- "& .MuiInputLabel-asterisk": {
28
- color: "#D92F2F",
29
- marginRight: "3px !important", //this was hitting an mui bug.
30
- },
31
- },
32
- },
33
- error: {
34
- "&&": {
35
- color: "#D92F2F",
36
- },
37
- },
38
- disabled: {
39
- "&&": {
40
- color: "rgba(0,0,0,0.6)",
41
- },
42
- },
43
- });
44
- const Label = (props) => {
45
- const classes = useStyles();
3
+ const Label = ({ required, disabled, error, ...rest }) => {
46
4
  return (
47
5
  <MUIInputLabel
48
- classes={{
49
- root: classes.root,
50
- required: classes.required,
51
- error: classes.error,
52
- disabled: classes.disabled,
53
- }}
54
- {...props}
6
+ required={required}
7
+ disabled={disabled}
8
+ error={error}
9
+ sx={[
10
+ {
11
+ backgroundColor: "transparent",
12
+ display: "flex",
13
+ flexDirection: "row-reverse",
14
+ alignSelf: "baseline",
15
+ textTransform: "none",
16
+ // force it outside the select box
17
+ position: "initial",
18
+ transform: "translateX(0px) translateY(0px)",
19
+ fontFamily: "Rubik",
20
+ fontWeight: 500,
21
+ fontSize: 14,
22
+ color: "#333",
23
+ "& .MuiInputLabel-asterisk": {
24
+ color: "#D92F2F",
25
+ marginRight: "3px !important", //this was
26
+ },
27
+ },
28
+ required && {
29
+ transform: "translateX(-12px) translateY(0px)",
30
+ "& .MuiInputLabel-asterisk": {
31
+ color: "#D92F2",
32
+ marginRight: "3px !important", //this was
33
+ },
34
+ },
35
+ disabled && {
36
+ color: "rgba(0,0,0,0.6)",
37
+ },
38
+ error && {
39
+ color: "#D92F2F",
40
+ },
41
+ ]}
42
+ {...rest}
55
43
  />
56
44
  );
57
45
  };
@@ -24,6 +24,6 @@ export const ExampleSpinner = () => (
24
24
  <Wrapper>
25
25
  <MadieSpinner />
26
26
  </Wrapper>
27
- )
27
+ );
28
28
 
29
29
  ExampleSpinner.storyName = "example Madie Spinner";
@@ -1,37 +1,35 @@
1
- import React from 'react';
2
- import { CircularProgress } from '@mui/material';
3
- import { makeStyles } from "@mui/styles";
1
+ import React from "react";
2
+ import { CircularProgress } from "@mui/material";
4
3
  import PropTypes from "prop-types";
5
4
 
6
5
  // To change the spinner size you have to pass style props for height and width.
7
6
  const MadieSpinner = (props) => {
8
- const useStyles = makeStyles({
9
- svg: {
10
- backgroundColor: 'transparent',
11
- borderRadius: '100%',
12
- // box shadow is our track. It needs to match the thickness of the svg element to look like it
13
- // if we get a thickness value, we update our box shadow
14
- boxShadow: `inset 0 0 0px ${props.thickness ? props.thickness : '7'}px #DDDDDD`,
15
- },
16
- circle: {
17
- color: '#209FA6',
18
- strokeLinecap: 'round',
19
- }
20
- });
21
- const classes = useStyles();
22
7
  return (
23
- <CircularProgress
24
- aria-label="loading-spinner"
25
- classes={classes}
26
- thickness={7}
27
- style={{ height: 50, width: 50 }}
28
- // Props overwrite whatever they want.
29
- {...props}
30
- />)
31
- }
8
+ <CircularProgress
9
+ aria-label="loading-spinner"
10
+ sx={{
11
+ "& .MuiCircularProgress-svg": {
12
+ backgroundColor: "transparent",
13
+ borderRadius: "100%",
14
+ boxShadow: `inset 0 0 0px ${
15
+ props.thickness ? props.thickness : "7"
16
+ }px #DDDDDD`,
17
+ },
18
+ "& .MuiCircularProgress-circle": {
19
+ color: "#209FA6",
20
+ strokeLinecap: "round",
21
+ },
22
+ }}
23
+ thickness={7}
24
+ style={{ height: 50, width: 50 }}
25
+ // Props overwrite whatever they want.
26
+ {...props}
27
+ />
28
+ );
29
+ };
32
30
 
33
31
  MadieSpinner.propTypes = {
34
- thickness: PropTypes.number
32
+ thickness: PropTypes.number,
35
33
  };
36
34
 
37
35
  export default MadieSpinner;