design-react-kit 5.0.0-3 → 5.0.0-5

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.
@@ -0,0 +1,17 @@
1
+ import React, { ReactChild } from 'react';
2
+ export interface GoBackProps {
3
+ /**
4
+ * Optional classnames to pass to the element
5
+ */
6
+ className?: string;
7
+ /**
8
+ * Render the link variant of the go back button
9
+ */
10
+ link?: boolean;
11
+ /**
12
+ * Render the up variant of the go back button
13
+ */
14
+ up?: boolean;
15
+ children: ReactChild;
16
+ }
17
+ export declare const GoBack: ({ className, link, up, children }: GoBackProps) => React.JSX.Element;
@@ -31,7 +31,6 @@ export { CardTagsHeader } from './Card/CardTagsHeader';
31
31
  export { CardSignature } from './Card/CardSignature';
32
32
  export { CardFooterCTA } from './Card/CardFooterCTA';
33
33
  export { CardReadMore } from './Card/CardReadMore';
34
- export { Collapse } from './Collapse/Collapse';
35
34
  export { GridItem, GridItemText, GridItemTextWrapper, GridList, GridRow } from './Grid/index';
36
35
  export { Header } from './Header/Header';
37
36
  export { Headers } from './Header/Headers';
@@ -47,6 +46,7 @@ export { Icon, iconsList as icons, preloadIcons, clearIconCache } from './Icon/I
47
46
  export { Input } from './Input/Input';
48
47
  export { InputContainer } from './Input/InputContainer';
49
48
  export { TextArea } from './Input/TextArea';
49
+ export { GoBack } from './GoBack/GoBack';
50
50
  export { LinkList } from './LinkList/LinkList';
51
51
  export { LinkListItem } from './LinkList/LinkListItem';
52
52
  export { Megamenu } from './Megamenu/Megamenu';
@@ -71,9 +71,6 @@ export { BottomNav } from './BottomNav/BottomNav';
71
71
  export { BottomNavItem } from './BottomNav/BottomNavItem';
72
72
  export { ThumbNav } from './ThumbNav/ThumbNav';
73
73
  export { ThumbNavItem } from './ThumbNav/ThumbNavItem';
74
- export { CookieBar } from './CookieBar/CookieBar';
75
- export { CookieBarButtons } from './CookieBar/CookieBarButtons';
76
- export { CookieBarButton } from './CookieBar/CookieBarButton';
77
74
  export { Chip } from './Chips/Chip';
78
75
  export { ChipLabel } from './Chips/ChipLabel';
79
76
  export { FontLoader, useFontLoader } from './FontLoader/FontLoader';
@@ -121,7 +118,6 @@ export type { CardTagsHeaderProps } from './Card/CardTagsHeader';
121
118
  export type { CardSignatureProps } from './Card/CardSignature';
122
119
  export type { CardFooterCTAProps } from './Card/CardFooterCTA';
123
120
  export type { CardReadMoreProps } from './Card/CardReadMore';
124
- export type { CollapseProps } from './Collapse/Collapse';
125
121
  export type { GridItemProps, GridItemTextProps, GridItemTextWrapperProps, GridListProps, GridRowProps } from './Grid/index';
126
122
  export type { HeaderProps } from './Header/Header';
127
123
  export type { HeadersProps } from './Header/Headers';
@@ -161,9 +157,6 @@ export type { BottomNavProps } from './BottomNav/BottomNav';
161
157
  export type { BottomNavItemProps } from './BottomNav/BottomNavItem';
162
158
  export type { ThumbNavProps } from './ThumbNav/ThumbNav';
163
159
  export type { ThumbNavItemProps } from './ThumbNav/ThumbNavItem';
164
- export type { CookieBarProps } from './CookieBar/CookieBar';
165
- export type { CookieBarButtonsProps } from './CookieBar/CookieBarButtons';
166
- export type { CookieBarButtonProps } from './CookieBar/CookieBarButton';
167
160
  export type { ChipProps } from './Chips/Chip';
168
161
  export type { ChipLabelProps } from './Chips/ChipLabel';
169
162
  export type { FontLoaderProps } from './FontLoader/FontLoader';
@@ -1766,64 +1766,6 @@ const CardReadMore = _ref => {
1766
1766
  }));
1767
1767
  };
1768
1768
 
1769
- const Collapse = _ref => {
1770
- let {
1771
- header = false,
1772
- className,
1773
- navbar,
1774
- megamenu,
1775
- children,
1776
- isOpen = false,
1777
- onOverlayClick,
1778
- cssModule,
1779
- testId,
1780
- ...attributes
1781
- } = _ref;
1782
- const newCssModule = {
1783
- 'navbar-collapse': 'navbar-collapsable',
1784
- ...cssModule
1785
- };
1786
- if (megamenu || navbar || header) {
1787
- const classes = classNames(className, 'navbar-collapse', {
1788
- expanded: isOpen
1789
- });
1790
- const style = {
1791
- display: isOpen ? 'block' : 'none'
1792
- };
1793
- return React__default.createElement(reactstrap.Collapse, Object.assign({
1794
- className: classes,
1795
- cssModule: newCssModule,
1796
- navbar: navbar,
1797
- style: style,
1798
- "data-testid": testId
1799
- }, attributes), React__default.createElement("div", {
1800
- className: 'overlay',
1801
- style: style,
1802
- onClick: onOverlayClick
1803
- }), React__default.createElement("div", {
1804
- className: 'close-div visually-hidden'
1805
- }, React__default.createElement("button", {
1806
- className: 'btn close-menu',
1807
- type: 'button'
1808
- }, React__default.createElement("span", {
1809
- className: 'it-close'
1810
- }), "close")), megamenu ? React__default.createElement("div", {
1811
- className: 'menu-wrapper'
1812
- }, children) : React__default.createElement(React__default.Fragment, null, children));
1813
- }
1814
- const classes = classNames(className, {
1815
- 'link-list-wrapper': header
1816
- });
1817
- return React__default.createElement(reactstrap.Collapse, Object.assign({
1818
- className: classes,
1819
- cssModule: newCssModule
1820
- }, attributes, {
1821
- navbar: navbar,
1822
- isOpen: isOpen,
1823
- "data-testid": testId
1824
- }), children);
1825
- };
1826
-
1827
1769
  const GridItem = _ref => {
1828
1770
  let {
1829
1771
  tag: Tag = 'div',
@@ -2679,6 +2621,28 @@ const TextArea = _ref => {
2679
2621
  }));
2680
2622
  };
2681
2623
 
2624
+ const goBack = () => {
2625
+ window.history.back();
2626
+ };
2627
+ const GoBack = _ref => {
2628
+ let {
2629
+ className,
2630
+ link = false,
2631
+ up = false,
2632
+ children
2633
+ } = _ref;
2634
+ const Tag = link ? 'a' : Button;
2635
+ return React__default.createElement(Tag, {
2636
+ className: classNames(className, 'go-back'),
2637
+ color: 'primary',
2638
+ onClick: goBack
2639
+ }, React__default.createElement(Icon, {
2640
+ className: children ? 'me-2' : '',
2641
+ color: link ? 'primary' : 'white',
2642
+ icon: up ? 'it-arrow-up' : 'it-arrow-left'
2643
+ }), children);
2644
+ };
2645
+
2682
2646
  const LinkList = _ref => {
2683
2647
  let {
2684
2648
  className,
@@ -2775,6 +2739,64 @@ const LinkListItem = _ref => {
2775
2739
  }, handlers), children));
2776
2740
  };
2777
2741
 
2742
+ const Collapse = _ref => {
2743
+ let {
2744
+ header = false,
2745
+ className,
2746
+ navbar,
2747
+ megamenu,
2748
+ children,
2749
+ isOpen = false,
2750
+ onOverlayClick,
2751
+ cssModule,
2752
+ testId,
2753
+ ...attributes
2754
+ } = _ref;
2755
+ const newCssModule = {
2756
+ 'navbar-collapse': 'navbar-collapsable',
2757
+ ...cssModule
2758
+ };
2759
+ if (megamenu || navbar || header) {
2760
+ const classes = classNames(className, 'navbar-collapse', {
2761
+ expanded: isOpen
2762
+ });
2763
+ const style = {
2764
+ display: isOpen ? 'block' : 'none'
2765
+ };
2766
+ return React__default.createElement(reactstrap.Collapse, Object.assign({
2767
+ className: classes,
2768
+ cssModule: newCssModule,
2769
+ navbar: navbar,
2770
+ style: style,
2771
+ "data-testid": testId
2772
+ }, attributes), React__default.createElement("div", {
2773
+ className: 'overlay',
2774
+ style: style,
2775
+ onClick: onOverlayClick
2776
+ }), React__default.createElement("div", {
2777
+ className: 'close-div visually-hidden'
2778
+ }, React__default.createElement("button", {
2779
+ className: 'btn close-menu',
2780
+ type: 'button'
2781
+ }, React__default.createElement("span", {
2782
+ className: 'it-close'
2783
+ }), "close")), megamenu ? React__default.createElement("div", {
2784
+ className: 'menu-wrapper'
2785
+ }, children) : React__default.createElement(React__default.Fragment, null, children));
2786
+ }
2787
+ const classes = classNames(className, {
2788
+ 'link-list-wrapper': header
2789
+ });
2790
+ return React__default.createElement(reactstrap.Collapse, Object.assign({
2791
+ className: classes,
2792
+ cssModule: newCssModule
2793
+ }, attributes, {
2794
+ navbar: navbar,
2795
+ isOpen: isOpen,
2796
+ "data-testid": testId
2797
+ }), children);
2798
+ };
2799
+
2778
2800
  const Nav = _ref => {
2779
2801
  let {
2780
2802
  className,
@@ -3093,7 +3115,7 @@ const SkiplinkItem = _ref => {
3093
3115
  ...attributes
3094
3116
  } = _ref;
3095
3117
  const Tag = tag;
3096
- const classes = classNames(className, 'visually-hidden', {
3118
+ const classes = classNames(className, {
3097
3119
  'visually-hidden-focusable': focusable
3098
3120
  });
3099
3121
  // Add an extra href for focusable if the user passes an onClick rather than href prop
@@ -3377,53 +3399,6 @@ const ThumbNavItem = _ref => {
3377
3399
  })));
3378
3400
  };
3379
3401
 
3380
- const CookieBar = _ref => {
3381
- let {
3382
- tag = 'div',
3383
- className,
3384
- testId,
3385
- ...attributes
3386
- } = _ref;
3387
- const Tag = tag;
3388
- const wrapperClasses = classNames('cookiebar show', className);
3389
- return React__default.createElement(Tag, Object.assign({}, attributes, {
3390
- className: wrapperClasses,
3391
- "data-testid": testId
3392
- }));
3393
- };
3394
-
3395
- const CookieBarButtons = _ref => {
3396
- let {
3397
- className,
3398
- tag = 'div',
3399
- testId,
3400
- ...attributes
3401
- } = _ref;
3402
- const Tag = tag;
3403
- const buttonClasses = classNames(className, 'cookiebar-buttons');
3404
- return React__default.createElement(Tag, Object.assign({
3405
- className: buttonClasses
3406
- }, attributes, {
3407
- "data-testid": testId
3408
- }));
3409
- };
3410
-
3411
- const CookieBarButton = _ref => {
3412
- let {
3413
- tag = 'button',
3414
- className,
3415
- testId,
3416
- ...attributes
3417
- } = _ref;
3418
- const Tag = tag;
3419
- const activeClass = classNames(className, 'cookiebar-btn');
3420
- return React__default.createElement(Tag, Object.assign({
3421
- className: activeClass
3422
- }, attributes, {
3423
- "data-testid": testId
3424
- }));
3425
- };
3426
-
3427
3402
  const Chip = _ref => {
3428
3403
  let {
3429
3404
  className,
@@ -4521,14 +4496,11 @@ exports.CardText = CardText;
4521
4496
  exports.CardTitle = CardTitle;
4522
4497
  exports.Chip = Chip;
4523
4498
  exports.ChipLabel = ChipLabel;
4524
- exports.Collapse = Collapse;
4525
- exports.CookieBar = CookieBar;
4526
- exports.CookieBarButton = CookieBarButton;
4527
- exports.CookieBarButtons = CookieBarButtons;
4528
4499
  exports.Dimmer = Dimmer;
4529
4500
  exports.DimmerButtons = DimmerButtons;
4530
4501
  exports.FontLoader = FontLoader;
4531
4502
  exports.Forward = Forward;
4503
+ exports.GoBack = GoBack;
4532
4504
  exports.GridItem = GridItem;
4533
4505
  exports.GridItemText = GridItemText;
4534
4506
  exports.GridItemTextWrapper = GridItemTextWrapper;