qpp-style 9.25.2-beta.0 → 9.25.2-beta.2

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 (136) hide show
  1. package/components/Footer/FooterUI.jsx +2 -3
  2. package/components/Header/ImpersonatorBanner.jsx +1 -2
  3. package/components/Infotip/Infotip.jsx +3 -7
  4. package/components/Infotip/InfotipContent.jsx +46 -0
  5. package/components/Search/index.js +2 -2
  6. package/components/SideNav/Links/NavLinkDrawer.jsx +8 -10
  7. package/components/Tabs/TabPanel.js +2 -38
  8. package/components/Tabs/Tabs.js +73 -0
  9. package/components/index.js +3 -5
  10. package/coverage/clover.xml +236 -213
  11. package/coverage/coverage-final.json +6 -6
  12. package/coverage/lcov-report/index.html +42 -42
  13. package/coverage/lcov-report/react/components/Accordion/index.html +1 -1
  14. package/coverage/lcov-report/react/components/Accordion/index.jsx.html +1 -1
  15. package/coverage/lcov-report/react/components/Button/index.html +1 -1
  16. package/coverage/lcov-report/react/components/Button/index.js.html +1 -1
  17. package/coverage/lcov-report/react/components/Dropdown/index.html +1 -1
  18. package/coverage/lcov-report/react/components/Dropdown/index.js.html +1 -1
  19. package/coverage/lcov-report/react/components/Error/Collapsible.jsx.html +1 -1
  20. package/coverage/lcov-report/react/components/Error/ErrorUI.jsx.html +1 -1
  21. package/coverage/lcov-report/react/components/Error/error.js.html +1 -1
  22. package/coverage/lcov-report/react/components/Error/index.html +1 -1
  23. package/coverage/lcov-report/react/components/Footer/FooterUI.jsx.html +1 -1
  24. package/coverage/lcov-report/react/components/Footer/SocialLinks.jsx.html +1 -1
  25. package/coverage/lcov-report/react/components/Footer/Subscribe.jsx.html +1 -1
  26. package/coverage/lcov-report/react/components/Footer/footer.js.html +1 -1
  27. package/coverage/lcov-report/react/components/Footer/index.html +1 -1
  28. package/coverage/lcov-report/react/components/GovBanner/index.html +1 -1
  29. package/coverage/lcov-report/react/components/GovBanner/index.js.html +1 -1
  30. package/coverage/lcov-report/react/components/Header/HeaderAccountMenu.jsx.html +1 -1
  31. package/coverage/lcov-report/react/components/Header/HeaderCancel.jsx.html +1 -1
  32. package/coverage/lcov-report/react/components/Header/HeaderContainer.jsx.html +59 -32
  33. package/coverage/lcov-report/react/components/Header/HeaderLogo.jsx.html +1 -1
  34. package/coverage/lcov-report/react/components/Header/HeaderMenuButton.js.html +1 -1
  35. package/coverage/lcov-report/react/components/Header/HeaderMenuItem.jsx.html +1 -1
  36. package/coverage/lcov-report/react/components/Header/HeaderMenuLink.js.html +1 -1
  37. package/coverage/lcov-report/react/components/Header/HeaderMenuSignOutButton.js.html +1 -1
  38. package/coverage/lcov-report/react/components/Header/HeaderMobileButton.js.html +1 -1
  39. package/coverage/lcov-report/react/components/Header/HeaderUI.jsx.html +40 -16
  40. package/coverage/lcov-report/react/components/Header/HelpIcon.jsx.html +1 -1
  41. package/coverage/lcov-report/react/components/Header/ImpersonatorBanner.jsx.html +1 -1
  42. package/coverage/lcov-report/react/components/Header/NavigationButtonIcon.jsx.html +1 -1
  43. package/coverage/lcov-report/react/components/Header/header.js.html +1 -1
  44. package/coverage/lcov-report/react/components/Header/hooks.js.html +4 -4
  45. package/coverage/lcov-report/react/components/Header/index.html +25 -25
  46. package/coverage/lcov-report/react/components/Header/utag-helpers.js.html +1 -1
  47. package/coverage/lcov-report/react/components/Infotip/Infotip.jsx.html +1 -1
  48. package/coverage/lcov-report/react/components/Infotip/InfotipIcon.jsx.html +1 -1
  49. package/coverage/lcov-report/react/components/Infotip/index.html +1 -1
  50. package/coverage/lcov-report/react/components/Infotip/index.js.html +1 -1
  51. package/coverage/lcov-report/react/components/Modal/LegacyModal.jsx.html +1 -1
  52. package/coverage/lcov-report/react/components/Modal/Modal.jsx.html +1 -1
  53. package/coverage/lcov-report/react/components/Modal/index.html +1 -1
  54. package/coverage/lcov-report/react/components/Modal/index.jsx.html +1 -1
  55. package/coverage/lcov-report/react/components/NotificationBanner/CollapsedView.js.html +1 -1
  56. package/coverage/lcov-report/react/components/NotificationBanner/ExpandedView.js.html +1 -1
  57. package/coverage/lcov-report/react/components/NotificationBanner/index.html +1 -1
  58. package/coverage/lcov-report/react/components/NotificationBanner/index.js.html +1 -1
  59. package/coverage/lcov-report/react/components/SanitizedContent/index.html +1 -1
  60. package/coverage/lcov-report/react/components/SanitizedContent/index.jsx.html +1 -1
  61. package/coverage/lcov-report/react/components/SessionDialog/index.html +1 -1
  62. package/coverage/lcov-report/react/components/SessionDialog/sessionDialog.js.html +1 -1
  63. package/coverage/lcov-report/react/components/SessionDialogUI.jsx.html +1 -1
  64. package/coverage/lcov-report/react/components/SideNav/AnimationGroup/AnimationGroup.jsx.html +1 -1
  65. package/coverage/lcov-report/react/components/SideNav/AnimationGroup/index.html +1 -1
  66. package/coverage/lcov-report/react/components/SideNav/Chart/ScoreChart.jsx.html +1 -1
  67. package/coverage/lcov-report/react/components/SideNav/Chart/index.html +1 -1
  68. package/coverage/lcov-report/react/components/SideNav/Chart/index.js.html +2 -2
  69. package/coverage/lcov-report/react/components/SideNav/Content/LevelOneContent.jsx.html +1 -1
  70. package/coverage/lcov-report/react/components/SideNav/Content/LevelTwoContent.jsx.html +1 -1
  71. package/coverage/lcov-report/react/components/SideNav/Content/SelectRole/index.html +1 -1
  72. package/coverage/lcov-report/react/components/SideNav/Content/SelectRole/index.js.html +1 -1
  73. package/coverage/lcov-report/react/components/SideNav/Content/SelectRole/utils.js.html +1 -1
  74. package/coverage/lcov-report/react/components/SideNav/Content/index.html +1 -1
  75. package/coverage/lcov-report/react/components/SideNav/Content/index.js.html +1 -1
  76. package/coverage/lcov-report/react/components/SideNav/Details/IndividualDetails.jsx.html +1 -1
  77. package/coverage/lcov-report/react/components/SideNav/Details/PracticeDetails.jsx.html +1 -1
  78. package/coverage/lcov-report/react/components/SideNav/Details/index.html +1 -1
  79. package/coverage/lcov-report/react/components/SideNav/Details/index.js.html +1 -1
  80. package/coverage/lcov-report/react/components/SideNav/Links/CmsSwitchLink.jsx.html +1 -1
  81. package/coverage/lcov-report/react/components/SideNav/Links/NavItemInline.jsx.html +1 -1
  82. package/coverage/lcov-report/react/components/SideNav/Links/NavLinkContainer.jsx.html +1 -1
  83. package/coverage/lcov-report/react/components/SideNav/Links/NavLinkDrawer.jsx.html +67 -10
  84. package/coverage/lcov-report/react/components/SideNav/Links/NavLinkInline.jsx.html +1 -1
  85. package/coverage/lcov-report/react/components/SideNav/Links/NavLinkToggle.jsx.html +1 -1
  86. package/coverage/lcov-report/react/components/SideNav/Links/index.html +17 -17
  87. package/coverage/lcov-report/react/components/SideNav/Links/index.js.html +1 -1
  88. package/coverage/lcov-report/react/components/SideNav/UI/SideNavUI.jsx.html +2 -2
  89. package/coverage/lcov-report/react/components/SideNav/UI/index.html +1 -1
  90. package/coverage/lcov-report/react/components/SideNav/UI/index.js.html +1 -1
  91. package/coverage/lcov-report/react/components/SideNav/helpers.js.html +23 -8
  92. package/coverage/lcov-report/react/components/SideNav/index.html +11 -11
  93. package/coverage/lcov-report/react/components/SideNav/index.js.html +1 -1
  94. package/coverage/lcov-report/react/components/Tooltip/Tooltip.jsx.html +2 -2
  95. package/coverage/lcov-report/react/components/Tooltip/index.html +1 -1
  96. package/coverage/lcov-report/react/components/Tooltip/index.js.html +1 -1
  97. package/coverage/lcov-report/react/components/Tooltip/position.js.html +1 -1
  98. package/coverage/lcov-report/react/components/hooks/index.html +1 -1
  99. package/coverage/lcov-report/react/components/hooks/useGetConfig.js.html +1 -1
  100. package/coverage/lcov-report/react/components/index.html +1 -1
  101. package/coverage/lcov-report/react/index.html +1 -1
  102. package/coverage/lcov-report/react/index.js.html +1 -1
  103. package/coverage/lcov-report/react/lib/Chevron.jsx.html +1 -1
  104. package/coverage/lcov-report/react/lib/SvgComponents.jsx.html +63 -18
  105. package/coverage/lcov-report/react/lib/index.html +15 -15
  106. package/coverage/lcov-report/react/session/index.html +1 -1
  107. package/coverage/lcov-report/react/session/index.js.html +1 -1
  108. package/coverage/lcov-report/react/session/logout.js.html +1 -1
  109. package/coverage/lcov-report/react/session/refresh.js.html +1 -1
  110. package/coverage/lcov-report/react/session/ttl.js.html +1 -1
  111. package/coverage/lcov.info +461 -422
  112. package/dist/browser.js +1 -1
  113. package/dist/browser.js.LICENSE.txt +0 -39
  114. package/dist/browser.js.map +1 -1
  115. package/dist/index.js +1 -1
  116. package/dist/index.js.LICENSE.txt +0 -39
  117. package/dist/index.js.map +1 -1
  118. package/dist/react/index.js +1 -1
  119. package/dist/react/index.js.LICENSE.txt +8 -50
  120. package/dist/react/index.js.map +1 -1
  121. package/lib/SvgComponents.jsx +120 -0
  122. package/package.json +5 -9
  123. package/styles/qppds/components/_footer.scss +2 -2
  124. package/test/components/HeaderUI.test.js +1 -1
  125. package/test/components/Infotip.test.js +17 -11
  126. package/components/Accordion/Accordion.stories.js +0 -20
  127. package/components/Alert/Alert.stories.js +0 -61
  128. package/components/Details/Details.stories.js +0 -63
  129. package/components/DropdownButton/DropdownButton.stories.js +0 -127
  130. package/components/Tabs/Tab.js +0 -26
  131. package/components/Tabs/index.js +0 -100
  132. package/components/Tooltip/Tooltip.jsx +0 -88
  133. package/components/Tooltip/Tooltip.stories.js +0 -80
  134. package/components/Tooltip/index.js +0 -3
  135. package/components/Tooltip/position.js +0 -68
  136. package/test/components/Tooltip.test.js +0 -147
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import OpenInNewIcon from '@material-ui/icons/OpenInNew';
3
-
4
2
  import InfoTip from '../Infotip/Infotip';
5
3
  import Subscribe from './Subscribe';
6
4
  import SocialLinks from './SocialLinks';
7
5
  import pjson from '../../package.json';
6
+ import { OpenInNewIcon } from '../../lib/SvgComponents';
8
7
 
9
8
  const infoTipLabel =
10
9
  '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.';
@@ -126,7 +125,7 @@ const FooterUI = () => (
126
125
  rel="noopener noreferrer"
127
126
  >
128
127
  <strong>Create or Track a QPP Service Center Ticket</strong>
129
- <OpenInNewIcon classes={{ root: 'ccsq-link-icon' }} />
128
+ <OpenInNewIcon className="ccsq-link-icon" />
130
129
  </a>
131
130
  </h3>
132
131
  </div>
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import cookie from 'cookie';
3
3
  import axios from 'axios';
4
- import CloseIcon from '@material-ui/icons/Close';
5
-
4
+ import { CloseIcon } from '../../lib/SvgComponents';
6
5
  import { TextButton } from '../Button';
7
6
  import {
8
7
  deleteImpersonatedUser,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import Tooltip from '../Tooltip';
3
+ import InfotipContent from './InfotipContent';
4
4
  import InfotipIcon from './InfotipIcon';
5
5
 
6
6
  const BUTTON_SIZE = '16px';
@@ -16,10 +16,6 @@ const buttonStyle = {
16
16
  userSelect: 'none',
17
17
  };
18
18
 
19
- // Use basic touch handlers for mobile "tap-to-open" ui. Mobile touch
20
- // is currently not supported by @reach/tooltip; this may change in future.
21
- // Leverages @reach/tooltip "focus" behavior to open tooltip on tap,
22
- // and close tooltip on second tap or loss of focus.
23
19
  // TODO: We may want to improve this by tracking touch positions to ensure
24
20
  // that a 'touchend' event must be reasonably close to the tooltip target.
25
21
  const touchHandlers = {
@@ -41,7 +37,7 @@ const touchHandlers = {
41
37
  * Tooltip with styled information icon
42
38
  */
43
39
  const Infotip = ({ ariaLabel, label, lightIcon, ...props }) => (
44
- <Tooltip label={label} {...props}>
40
+ <InfotipContent label={label} {...props}>
45
41
  <button
46
42
  type="button"
47
43
  aria-label={ariaLabel}
@@ -56,7 +52,7 @@ const Infotip = ({ ariaLabel, label, lightIcon, ...props }) => (
56
52
  style={{ float: 'left' }}
57
53
  />
58
54
  </button>
59
- </Tooltip>
55
+ </InfotipContent>
60
56
  );
61
57
 
62
58
  Infotip.propTypes = {
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import {
4
+ Tooltip as TooltipAriaKit,
5
+ TooltipAnchor,
6
+ TooltipArrow,
7
+ useTooltipState,
8
+ } from 'ariakit/tooltip';
9
+
10
+ const TEXT_COLOR = '#FFF';
11
+ const BACKGROUND_COLOR = '#333';
12
+
13
+ const InfotipContent = ({ children, label }) => {
14
+ const tooltip = useTooltipState();
15
+
16
+ const cssStyles = {
17
+ maxWidth: '300px',
18
+ padding: '8px',
19
+ borderRadius: '4px',
20
+ fontSize: '0.9rem',
21
+ backgroundColor: BACKGROUND_COLOR,
22
+ color: TEXT_COLOR,
23
+ };
24
+ return (
25
+ <>
26
+ <TooltipAnchor as={'span'} state={tooltip} className="tooltip-anchor">
27
+ {children}
28
+ </TooltipAnchor>
29
+ <TooltipAriaKit
30
+ state={tooltip}
31
+ className="tooltip-content"
32
+ style={cssStyles}
33
+ >
34
+ {label}
35
+ <TooltipArrow />
36
+ </TooltipAriaKit>
37
+ </>
38
+ );
39
+ };
40
+
41
+ InfotipContent.propTypes = {
42
+ children: PropTypes.node.isRequired,
43
+ label: PropTypes.node.isRequired,
44
+ };
45
+
46
+ export default InfotipContent;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import SearchIcon from '@material-ui/icons/Search';
3
+ import { SearchIcon } from '../../lib/SvgComponents';
4
4
 
5
5
  const Search = ({
6
6
  id,
@@ -55,7 +55,7 @@ const Search = ({
55
55
  className="qpp-c-search__submit qpp-c-button qpp-c-button--text"
56
56
  >
57
57
  <span className="qpp-u-visually-hidden">Search</span>
58
- <SearchIcon classes={{ root: 'qpp-icon-mat' }} />
58
+ <SearchIcon viewBox="0 0 45 50" />
59
59
  </button>
60
60
  </div>
61
61
  </form>
@@ -52,17 +52,15 @@ const NavLinkDrawer = ({
52
52
  }
53
53
  };
54
54
 
55
+ const parentRerouteUrls = [
56
+ MANAGE_ACCESS,
57
+ ELIGIBILITY_REPORTING,
58
+ REGISTRATION,
59
+ SUBMISSION_FEEDBACK,
60
+ ];
61
+
55
62
  const parentReroute = (url) => {
56
- if (url === MANAGE_ACCESS) {
57
- return false;
58
- }
59
- if (url === ELIGIBILITY_REPORTING) {
60
- return false;
61
- }
62
- if (url === REGISTRATION) {
63
- return false;
64
- }
65
- if (url === SUBMISSION_FEEDBACK) {
63
+ if (parentRerouteUrls.includes(url)) {
66
64
  return false;
67
65
  }
68
66
  return true;
@@ -1,41 +1,5 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- export const TabPanel = ({
5
- children,
6
- value,
7
- id,
8
- index,
9
- className,
10
- disabled,
11
- }) => {
12
- const classes = ['qpp-c-tabs__panel', className].filter(Boolean).join(' ');
13
- return (
14
- <div
15
- role="tabpanel"
16
- id={id}
17
- aria-hidden={value !== index}
18
- aria-labelledby={`qpp-c-tabs__item--${id}`}
19
- aria-disabled={disabled}
20
- className={classes}
21
- >
22
- {value === index && children}
23
- </div>
24
- );
25
- };
26
-
27
- TabPanel.propTypes = {
28
- children: PropTypes.node,
29
- className: PropTypes.string,
30
- index: PropTypes.number.isRequired,
31
- id: PropTypes.string,
32
- value: PropTypes.number.isRequired,
33
- disabled: PropTypes.bool,
34
- };
35
-
36
- TabPanel.defaultProps = {
37
- index: 0,
38
- value: 0,
1
+ const TabPanel = ({ children }) => {
2
+ return children;
39
3
  };
40
4
 
41
5
  export default TabPanel;
@@ -0,0 +1,73 @@
1
+ import React, { Children } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { TabList, Tab, TabPanel, useTabState } from 'ariakit/tab';
4
+
5
+ function Tabs({ defaultSelectedId, children, onChange, selected }) {
6
+ const tab = useTabState({
7
+ defaultSelectedId: selected ?? defaultSelectedId,
8
+ selectOnMove: false,
9
+ });
10
+
11
+ const onTabClick = (tabHref, id) => {
12
+ if (tabHref) {
13
+ const currentUrl = new URL(window.location.href);
14
+ const newParams = new URLSearchParams(tabHref);
15
+ newParams.forEach((value, key) => {
16
+ currentUrl.searchParams.set(key, value);
17
+ });
18
+ window.history.replaceState(null, '', currentUrl);
19
+ }
20
+
21
+ if (onChange) {
22
+ onChange(id);
23
+ }
24
+ };
25
+
26
+ return (
27
+ <>
28
+ <div className="qpp-c-tabs qpp-c-tabs--mui">
29
+ <TabList state={tab} aria-label="qpp tabs">
30
+ {Children.map(children, (child) => (
31
+ <Tab
32
+ key={child.props.id}
33
+ id={child.props.id}
34
+ className="qpp-c-tabs__item"
35
+ disabled={child.props.disabled}
36
+ onClick={() => onTabClick(child.props.tabHref, child.props.id)}
37
+ >
38
+ {child.props.tab}
39
+ </Tab>
40
+ ))}
41
+ </TabList>
42
+ </div>
43
+ <div className="qpp-c-tabs__panel">
44
+ {Children.map(children, (child) => (
45
+ <TabPanel
46
+ key={child.props.id}
47
+ state={tab}
48
+ tabId={child.props.id}
49
+ className={child.props.className}
50
+ disabled={child.props.disabled}
51
+ >
52
+ {child.props.children}
53
+ </TabPanel>
54
+ ))}
55
+ </div>
56
+ </>
57
+ );
58
+ }
59
+
60
+ Tabs.propTypes = {
61
+ defaultSelectedId: PropTypes.string,
62
+ children: PropTypes.node.isRequired,
63
+ onChange: PropTypes.func,
64
+ selected: PropTypes.string,
65
+ };
66
+
67
+ Tabs.defaultProps = {
68
+ defaultSelectedId: undefined,
69
+ onChange: undefined,
70
+ selected: undefined,
71
+ };
72
+
73
+ export default Tabs;
@@ -9,14 +9,13 @@ import Footer from './Footer/FooterUI';
9
9
  import Header from './Header/HeaderUI';
10
10
  import Modal from './Modal';
11
11
  import SideNav from './SideNav/UI/SideNavUI';
12
+ import Tabs from './Tabs/Tabs';
12
13
  import TabPanel from './Tabs/TabPanel';
13
- import Tabs from './Tabs/index';
14
- import Tooltip from './Tooltip';
15
14
  import Infotip from './Infotip';
16
15
  import Search from './Search';
17
16
  import TextInput from './TextInput';
18
17
  import Dropdown from './Dropdown';
19
- import Details from './Details';
18
+ import Details from './Details/index';
20
19
  import DSLink from './Link';
21
20
  import {
22
21
  MyApplicationsIcon,
@@ -117,12 +116,11 @@ export {
117
116
  Modal,
118
117
  Search,
119
118
  SideNav,
120
- TabPanel,
121
119
  Tabs,
120
+ TabPanel,
122
121
  TextButton,
123
122
  TextInput,
124
123
  Dropdown,
125
124
  Details,
126
- Tooltip,
127
125
  DSLink,
128
126
  };