@popsure/dirty-swan 0.48.1 → 0.49.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 (53) hide show
  1. package/dist/cjs/index.js +79 -64
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/comparisonTable/components/Row/index.d.ts +1 -0
  4. package/dist/cjs/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +1 -1
  5. package/dist/cjs/lib/components/comparisonTable/hooks/useComparisonTable.d.ts +3 -2
  6. package/dist/cjs/lib/components/comparisonTable/index.d.ts +14 -4
  7. package/dist/cjs/lib/components/dateSelector/index.d.ts +2 -0
  8. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js +2 -2
  9. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js.map +1 -1
  10. package/dist/esm/components/comparisonTable/components/Row/index.js +11 -4
  11. package/dist/esm/components/comparisonTable/components/Row/index.js.map +1 -1
  12. package/dist/esm/components/comparisonTable/components/TableArrows/index.js +4 -2
  13. package/dist/esm/components/comparisonTable/components/TableArrows/index.js.map +1 -1
  14. package/dist/esm/components/comparisonTable/components/TableButton/index.js +9 -4
  15. package/dist/esm/components/comparisonTable/components/TableButton/index.js.map +1 -1
  16. package/dist/esm/components/comparisonTable/components/TableButton/index.test.js +13 -7
  17. package/dist/esm/components/comparisonTable/components/TableButton/index.test.js.map +1 -1
  18. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +1 -1
  19. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js.map +1 -1
  20. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.js +9 -2
  21. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.js.map +1 -1
  22. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.test.js +20 -17
  23. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.test.js.map +1 -1
  24. package/dist/esm/components/comparisonTable/index.js +28 -33
  25. package/dist/esm/components/comparisonTable/index.js.map +1 -1
  26. package/dist/esm/components/dateSelector/index.js +23 -15
  27. package/dist/esm/components/dateSelector/index.js.map +1 -1
  28. package/dist/esm/components/dateSelector/index.test.js +36 -2
  29. package/dist/esm/components/dateSelector/index.test.js.map +1 -1
  30. package/dist/esm/lib/components/comparisonTable/components/Row/index.d.ts +1 -0
  31. package/dist/esm/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +1 -1
  32. package/dist/esm/lib/components/comparisonTable/hooks/useComparisonTable.d.ts +3 -2
  33. package/dist/esm/lib/components/comparisonTable/index.d.ts +14 -4
  34. package/dist/esm/lib/components/dateSelector/index.d.ts +2 -0
  35. package/package.json +3 -3
  36. package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.module.scss +3 -5
  37. package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.tsx +2 -2
  38. package/src/lib/components/comparisonTable/components/Row/index.tsx +16 -13
  39. package/src/lib/components/comparisonTable/components/Row/style.module.scss +13 -9
  40. package/src/lib/components/comparisonTable/components/TableArrows/index.tsx +2 -0
  41. package/src/lib/components/comparisonTable/components/TableArrows/style.module.scss +4 -0
  42. package/src/lib/components/comparisonTable/components/TableButton/index.test.tsx +7 -8
  43. package/src/lib/components/comparisonTable/components/TableButton/index.tsx +9 -9
  44. package/src/lib/components/comparisonTable/components/TableButton/style.module.scss +7 -24
  45. package/src/lib/components/comparisonTable/components/TableInfoButton/index.tsx +1 -0
  46. package/src/lib/components/comparisonTable/components/TableRowHeader/index.test.tsx +18 -22
  47. package/src/lib/components/comparisonTable/components/TableRowHeader/index.tsx +16 -9
  48. package/src/lib/components/comparisonTable/hooks/useComparisonTable.ts +8 -18
  49. package/src/lib/components/comparisonTable/index.stories.mdx +55 -25
  50. package/src/lib/components/comparisonTable/index.tsx +64 -25
  51. package/src/lib/components/comparisonTable/style.module.scss +23 -8
  52. package/src/lib/components/dateSelector/index.test.tsx +32 -2
  53. package/src/lib/components/dateSelector/index.tsx +40 -21
@@ -4,6 +4,7 @@ interface RowProps<T> {
4
4
  data: Array<T>;
5
5
  isRowHeader?: boolean;
6
6
  rowId: string;
7
+ cellClassName?: string;
7
8
  }
8
9
  declare const _default: <T extends {
9
10
  id: number;
@@ -4,6 +4,6 @@ interface TableRowHeaderProps {
4
4
  subtitle?: string;
5
5
  onClickInfo?: () => void;
6
6
  }
7
- declare const TableRowHeader: ({ icon, label, subtitle, onClickInfo }: TableRowHeaderProps) => JSX.Element;
7
+ declare const TableRowHeader: ({ icon, label, subtitle, onClickInfo, }: TableRowHeaderProps) => JSX.Element;
8
8
  export type { TableRowHeaderProps };
9
9
  export default TableRowHeader;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ArrowValues } from '../components/TableArrows';
3
- export declare const useComparisonTable: () => {
3
+ export declare const useComparisonTable: ({ onSelectionChanged, }: {
4
+ onSelectionChanged?: ((selectedIndex: number) => void) | undefined;
5
+ }) => {
4
6
  headerWidth: number;
5
- headerId: string;
6
7
  contentContainerRef: import("react").MutableRefObject<HTMLDivElement | null>;
7
8
  selectedSection: string;
8
9
  setSelectedSection: import("react").Dispatch<import("react").SetStateAction<string>>;
@@ -35,16 +35,26 @@ export interface ComparisonTableProps<T> {
35
35
  headers: Array<TableHeader<T>>;
36
36
  data: Array<T>;
37
37
  hideDetails?: boolean;
38
+ hideDetailsCaption?: string;
39
+ showDetailsCaption?: string;
38
40
  hideScrollBars?: boolean;
41
+ hideScrollBarsMobile?: boolean;
39
42
  collapsibleSections?: boolean;
40
43
  cellWidth?: number;
41
44
  firstColumnWidth?: number;
42
45
  stickyHeaderTopOffset?: number;
43
46
  growContent?: boolean;
44
- styles?: {
45
- header?: string;
46
- container?: string;
47
- };
47
+ classNameOverrides?: ClassNameOverrides;
48
+ onSelectionChanged?: (selectedIndex: number) => void;
49
+ }
50
+ export interface ClassNameOverrides {
51
+ header?: string;
52
+ container?: string;
53
+ cell?: string;
54
+ headerCell?: string;
55
+ collapsibleSection?: string;
56
+ section?: string;
57
+ hideDetailsButton?: string;
48
58
  }
49
59
  declare const ComparisonTable: <T extends {
50
60
  id: number;
@@ -22,6 +22,8 @@ export interface DateSelectorProps {
22
22
  year?: string;
23
23
  yearFormat?: string;
24
24
  error?: string;
25
+ errorBeforeMinYear?: string;
26
+ errorAfterMaxYear?: string;
25
27
  };
26
28
  firstDayOfWeek?: number;
27
29
  inputProps?: (key: keyof CalendarDate) => Partial<DateSelectorInputProps>;
@@ -5,7 +5,7 @@ import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
5
5
  import 'react';
6
6
  import '../../../../index-6ea95111.js';
7
7
 
8
- var css_248z = ".AccordionItem-module_container__29xle {\n width: min-content;\n width: var(--growContent, min-content);\n margin: 0 auto;\n}\n\n.AccordionItem-module_container__29xle + .AccordionItem-module_container__29xle {\n margin-top: 8px;\n}\n\n.AccordionItem-module_chevron__1Pdoe {\n transition: filter 0.3s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.AccordionItem-module_chevronClosed__1Sq5g {\n transform: rotate(180deg);\n}\n\n.AccordionItem-module_iconAndTextContainer__1K9NF {\n column-gap: 12px;\n}\n\n.AccordionItem-module_headerButton__1C03u {\n border: none;\n background: #fafaff;\n column-gap: 16px;\n cursor: pointer;\n font-family: inherit;\n outline: none;\n position: relative;\n text-align: inherit;\n transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;\n}\n.AccordionItem-module_headerButton__1C03u:hover {\n background: #ebebff;\n}\n\n.AccordionItem-module_headerButton__1C03u:hover .AccordionItem-module_chevron__1Pdoe {\n filter: brightness(0.425);\n}";
8
+ var css_248z = ".AccordionItem-module_container__29xle {\n width: min-content;\n width: var(--growContent, min-content);\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.AccordionItem-module_chevron__1Pdoe {\n transition: filter 0.3s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.AccordionItem-module_chevronClosed__1Sq5g {\n transform: rotate(180deg);\n}\n\n.AccordionItem-module_iconAndTextContainer__1K9NF {\n column-gap: 12px;\n}\n\n.AccordionItem-module_headerButton__1C03u {\n border: none;\n background: #fafaff;\n column-gap: 16px;\n cursor: pointer;\n font-family: inherit;\n outline: none;\n position: relative;\n text-align: inherit;\n transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;\n}\n.AccordionItem-module_headerButton__1C03u:hover {\n background: #ebebff;\n}\n\n.AccordionItem-module_headerButton__1C03u:hover .AccordionItem-module_chevron__1Pdoe {\n filter: brightness(0.425);\n}";
9
9
  var styles = {"container":"AccordionItem-module_container__29xle","chevron":"AccordionItem-module_chevron__1Pdoe","chevronClosed":"AccordionItem-module_chevronClosed__1Sq5g","iconAndTextContainer":"AccordionItem-module_iconAndTextContainer__1K9NF","headerButton":"AccordionItem-module_headerButton__1C03u"};
10
10
  styleInject(css_248z);
11
11
 
@@ -23,7 +23,7 @@ var AccordionItem = function (_a) {
23
23
  onClose();
24
24
  }
25
25
  };
26
- return (jsxs("div", __assign({ className: "d-flex fd-column " + className + " " + styles.container }, { children: [jsxs("button", __assign({ className: "d-flex ai-center jc-between " + styles.headerButton + " " + headerClassName, onClick: handleClick, type: "button" }, { children: [jsx("div", __assign({ className: "d-flex ai-center " + styles.iconAndTextContainer }, { children: typeof label === 'string' ? (jsx("h4", __assign({ className: "p-h4" }, { children: label }), void 0)) : (jsx(Fragment, { children: label }, void 0)) }), void 0),
26
+ return (jsxs("section", __assign({ className: "d-flex fd-column " + styles.container + " " + className }, { children: [jsxs("button", __assign({ className: "d-flex ai-center jc-between " + styles.headerButton + " " + headerClassName, onClick: handleClick, type: "button" }, { children: [jsx("div", __assign({ className: "d-flex ai-center " + styles.iconAndTextContainer }, { children: typeof label === 'string' ? (jsx("h4", __assign({ className: "p-h4" }, { children: label }), void 0)) : (jsx(Fragment, { children: label }, void 0)) }), void 0),
27
27
  jsx(ChevronSVG, { className: styles.chevron + " " + (!isOpen && styles.chevronClosed) }, void 0)] }), void 0),
28
28
  jsx(AnimateHeight, __assign({ duration: 300, height: isOpen ? 'auto' : 0.1 }, { children: children }), void 0)] }), void 0));
29
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import AnimateHeight from 'react-animate-height';\n\nimport styles from './AccordionItem.module.scss';\n\nconst ChevronSVG = ({ className }: { className?: string }) => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M18 15L12 9L6 15\"\n stroke=\"#b4b4ba\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport const AccordionItem = ({\n children,\n className = '',\n headerClassName = '',\n isOpen,\n onOpen,\n onClose,\n label,\n}: {\n children: React.ReactNode | string;\n className?: string;\n headerClassName?: string;\n isOpen: boolean;\n onOpen: () => void;\n onClose: () => void;\n label: React.ReactNode;\n}) => {\n const handleClick = () => {\n if (!isOpen) {\n onOpen();\n } else {\n onClose();\n }\n };\n\n return (\n <div className={`d-flex fd-column ${className} ${styles.container}`}>\n <button\n className={`d-flex ai-center jc-between ${styles.headerButton} ${headerClassName}`}\n onClick={handleClick}\n type=\"button\"\n >\n <div className={`d-flex ai-center ${styles.iconAndTextContainer}`}>\n {typeof label === 'string' ? (\n <h4 className=\"p-h4\">{label}</h4>\n ) : (\n <>{label}</>\n )}\n </div>\n <ChevronSVG\n className={`${styles.chevron} ${!isOpen && styles.chevronClosed}`}\n />\n </button>\n {/* Min height is 0.1 so that the scroll position is correctly synced across accordion items but is not actually shown.\n If set to 0, react-animate-height will set display to \"none\" which means scrolling is not synced. */}\n <AnimateHeight duration={300} height={isOpen ? 'auto' : 0.1}>\n {children}\n </AnimateHeight>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAIA,IAAM,UAAU,GAAG,UAA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GAAG,MAAM,GAAG,GAAG,gBACxD,QAAQ,YACK,aACZ,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"AccordionItem.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import AnimateHeight from 'react-animate-height';\n\nimport styles from './AccordionItem.module.scss';\n\nconst ChevronSVG = ({ className }: { className?: string }) => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M18 15L12 9L6 15\"\n stroke=\"#b4b4ba\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport const AccordionItem = ({\n children,\n className = '',\n headerClassName = '',\n isOpen,\n onOpen,\n onClose,\n label,\n}: {\n children: React.ReactNode | string;\n className?: string;\n headerClassName?: string;\n isOpen: boolean;\n onOpen: () => void;\n onClose: () => void;\n label: React.ReactNode;\n}) => {\n const handleClick = () => {\n if (!isOpen) {\n onOpen();\n } else {\n onClose();\n }\n };\n\n return (\n <section className={`d-flex fd-column ${styles.container} ${className}`}>\n <button\n className={`d-flex ai-center jc-between ${styles.headerButton} ${headerClassName}`}\n onClick={handleClick}\n type=\"button\"\n >\n <div className={`d-flex ai-center ${styles.iconAndTextContainer}`}>\n {typeof label === 'string' ? (\n <h4 className=\"p-h4\">{label}</h4>\n ) : (\n <>{label}</>\n )}\n </div>\n <ChevronSVG\n className={`${styles.chevron} ${!isOpen && styles.chevronClosed}`}\n />\n </button>\n {/* Min height is 0.1 so that the scroll position is correctly synced across accordion items but is not actually shown.\n If set to 0, react-animate-height will set display to \"none\" which means scrolling is not synced. */}\n <AnimateHeight duration={300} height={isOpen ? 'auto' : 0.1}>\n {children}\n </AnimateHeight>\n </section>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAIA,IAAM,UAAU,GAAG,UAAC,E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G,MAAM,GAAG,GAAG,gBACxD,QAAQ,YACK,aACR,EACV;AACJ;;;;"}
@@ -2,14 +2,21 @@ import { _ as __assign } from '../../../../tslib.es6-5bc94358.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import require$$0__default from 'react';
4
4
  import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
5
+ import { c as classNames } from '../../../../index-6ea95111.js';
5
6
 
6
- var css_248z = ".style-module_header__32rw- {\n position: relative;\n}\n.style-module_header__32rw- > div {\n width: var(--tableWidth);\n max-width: 100vw;\n}\n.style-module_header__32rw- > div:nth-child(n+3) {\n margin: 0;\n}\n@media (min-width: 34rem) {\n .style-module_header__32rw- > div {\n width: 256px;\n width: var(--cellWidth, 256px);\n max-width: var(--tableWidth);\n scroll-snap-align: unset;\n }\n}\n\n.style-module_cell__1NoZ6 {\n display: flex;\n justify-content: center;\n align-items: center;\n scroll-snap-align: end;\n line-height: 24px;\n padding: 16px;\n color: #4c4c53;\n width: 50vw;\n max-width: calc(var(--tableWidth) / 2);\n}\n.style-module_cell__1NoZ6:first-child {\n background-color: white;\n /** Add scroll snap to every column except the first one */\n scroll-snap-align: unset;\n}\n.style-module_cell__1NoZ6:nth-child(n+3) {\n margin-left: 50vw;\n}\n@media (min-width: 34rem) {\n .style-module_cell__1NoZ6:nth-child(n+3) {\n margin-left: unset;\n }\n}\n@media (min-width: 34rem) {\n .style-module_cell__1NoZ6 {\n flex: 1 0 256px;\n flex: 1 0 var(--cellWidth, 256px);\n width: 256px;\n width: var(--cellWidth, 256px);\n padding: 24px;\n }\n .style-module_cell__1NoZ6:last-child {\n padding: 24px 8px 24px 24px;\n }\n}\n\nh4.style-module_cell__1NoZ6 {\n max-width: min(288px, calc(var(--tableWidth) / 2));\n max-width: min(var(--firstColumnWidth, 288px), calc(var(--tableWidth) / 2));\n}\n\n.style-module_title__1xYvu {\n position: relative;\n color: #26262e;\n display: none;\n}\n.style-module_title__1xYvu:after {\n content: \"\";\n display: block;\n position: absolute;\n top: calc( 50% + 16px );\n height: 4px;\n width: 100%;\n max-width: 140px;\n background-color: #8e8cee;\n}\n@media (min-width: 34rem) {\n .style-module_title__1xYvu {\n display: flex;\n }\n}\n\n.style-module_sticky__2T5jm {\n position: sticky;\n justify-content: flex-start;\n z-index: 1;\n top: 0;\n left: 0;\n width: 50vw;\n}\n@media (min-width: 34rem) {\n .style-module_sticky__2T5jm {\n border-right: 1px solid #fafaff;\n flex: 1 0 288px;\n }\n}\n\nh4.style-module_addon__CPf60 {\n border-right: none;\n max-width: calc(100vw - 64px);\n width: 100vw;\n}\n@media (min-width: 64rem) {\n h4.style-module_addon__CPf60 {\n max-width: 976px;\n }\n}";
7
+ var css_248z = ".style-module_header__32rw- {\n position: relative;\n}\n.style-module_header__32rw- > div {\n width: var(--tableWidth);\n max-width: 100vw;\n}\n.style-module_header__32rw- > div:nth-child(n+3) {\n margin: 0;\n}\n@media (min-width: 34rem) {\n .style-module_header__32rw- > div {\n width: 211px;\n width: var(--cellWidth, 211px);\n max-width: var(--tableWidth);\n scroll-snap-align: unset;\n }\n}\n\n.style-module_cell__1NoZ6 {\n display: flex;\n justify-content: center;\n align-items: center;\n scroll-snap-align: end;\n line-height: 24px;\n padding: 16px 8px;\n color: #26262e;\n width: 50vw;\n max-width: calc(var(--tableWidth) / 2);\n}\n.style-module_cell__1NoZ6:first-child {\n padding: 16px 8px 16px 16px;\n}\n.style-module_cell__1NoZ6:first-child {\n background-color: white;\n /** Add scroll snap to every column except the first one */\n scroll-snap-align: unset;\n}\n.style-module_cell__1NoZ6:nth-child(n+3) {\n margin-left: 50vw;\n}\n@media (min-width: 34rem) {\n .style-module_cell__1NoZ6:nth-child(n+3) {\n margin-left: unset;\n }\n}\n@media (min-width: 34rem) {\n .style-module_cell__1NoZ6 {\n flex: 1 0 211px;\n flex: 1 0 var(--cellWidth, 211px);\n width: 211px;\n width: var(--cellWidth, 211px);\n padding: 24px 8px;\n }\n .style-module_cell__1NoZ6:first-child {\n padding: 24px 8px 24px 24px;\n }\n}\n\nh4.style-module_cell__1NoZ6 {\n max-width: min(212px, calc(var(--tableWidth) / 2));\n max-width: min(var(--firstColumnWidth, 212px), calc(var(--tableWidth) / 2));\n}\n\n.style-module_title__1xYvu {\n position: relative;\n color: #26262e;\n display: none;\n}\n.style-module_title__1xYvu:after {\n content: \"\";\n display: block;\n position: absolute;\n top: calc( 50% + 16px );\n height: 4px;\n width: 100%;\n max-width: 140px;\n background-color: #8e8cee;\n}\n@media (min-width: 34rem) {\n .style-module_title__1xYvu {\n display: flex;\n }\n}\n\n.style-module_sticky__2T5jm {\n position: sticky;\n justify-content: flex-start;\n z-index: 1;\n top: 0;\n left: 0;\n width: 50vw;\n}\n@media (min-width: 34rem) {\n .style-module_sticky__2T5jm {\n border-right: 1px solid #fafaff;\n flex: 1 0 288px;\n }\n}\n\nh4.style-module_addon__CPf60 {\n border-right: none;\n max-width: calc(100vw - 64px);\n width: 100%;\n}\n@media (min-width: 64rem) {\n h4.style-module_addon__CPf60 {\n max-width: 976px;\n }\n}";
7
8
  var styles = {"header":"style-module_header__32rw-","cell":"style-module_cell__1NoZ6","title":"style-module_title__1xYvu","sticky":"style-module_sticky__2T5jm","addon":"style-module_addon__CPf60"};
8
9
  styleInject(css_248z);
9
10
 
10
11
  var Row = function (props) {
11
- var cell = props.cell, data = props.data, isRowHeader = props.isRowHeader, rowId = props.rowId;
12
- return (jsxs("div", __assign({ className: "\n d-flex\n w-100\n " + (isRowHeader ? styles.header : '') + "\n " }, { children: [jsx("h4", __assign({ className: "\n " + styles.cell + "\n " + styles.sticky + "\n " + (isRowHeader ? "p-h2 p--serif " + styles.title : '') + "\n " + (typeof cell.key === 'undefined' ? styles.addon : '') + "\n " }, { children: cell.label }), void 0),
12
+ var _a, _b;
13
+ var cell = props.cell, data = props.data, isRowHeader = props.isRowHeader, rowId = props.rowId, cellClassName = props.cellClassName;
14
+ return (jsxs("div", __assign({ className: classNames('d-flex w-100', (_a = {},
15
+ _a[styles.header] = isRowHeader,
16
+ _a)) }, { children: [jsx("h4", __assign({ className: classNames(styles.cell, styles.sticky, (_b = {},
17
+ _b["p-h2 p--serif " + styles.title] = isRowHeader,
18
+ _b[styles.addon] = typeof cell.key === 'undefined',
19
+ _b), cellClassName) }, { children: cell.label }), void 0),
13
20
  Array.isArray(data) &&
14
21
  data.map(function (item) {
15
22
  /**
@@ -20,7 +27,7 @@ var Row = function (props) {
20
27
  return null;
21
28
  if (typeof item[cell.key] === 'undefined')
22
29
  return null;
23
- return (jsx("div", __assign({ className: "ta-center " + styles.cell }, { children:
30
+ return (jsx("div", __assign({ className: classNames('ta-center', styles.cell, cellClassName) }, { children:
24
31
  /**
25
32
  * Return a function if `render` option is present
26
33
  * else print the current data source value
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/Row/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { Cell } from '../../index';\nimport styles from './style.module.scss';\n\ninterface RowProps<T> {\n cell: Cell<T>;\n data: Array<T>;\n isRowHeader?: boolean;\n rowId: string;\n}\n\nconst Row = <T extends { id: number }>(props: RowProps<T>) => {\n const { cell, data, isRowHeader, rowId } = props;\n\n return (\n <div\n key={rowId}\n className={`\n d-flex\n w-100\n ${isRowHeader ? styles.header : ''}\n `}\n >\n <h4\n className={`\n ${styles.cell}\n ${styles.sticky}\n ${isRowHeader ? `p-h2 p--serif ${styles.title}` : ''}\n ${typeof cell.key === 'undefined' ? styles.addon : ''}\n `}\n >\n {cell.label}\n </h4>\n\n {Array.isArray(data) &&\n data.map((item) => {\n /**\n * Do not render a cell if\n * the data source object doesn't have the current key\n */\n if (typeof cell.key === 'undefined') return null;\n if (typeof item[cell.key] === 'undefined') return null;\n\n return (\n <div\n className={`ta-center ${styles.cell}`}\n key={`${rowId}-${item.id}`}\n >\n {\n /**\n * Return a function if `render` option is present\n * else print the current data source value\n */\n typeof cell.render === 'function'\n ? cell.render(item[cell.key], item)\n : `${item[cell.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AeC,mBAAK,CAAC,IAAI,CAAC,GAAG,CAAe;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/Row/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { Cell } from '../../index';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\ninterface RowProps<T> {\n cell: Cell<T>;\n data: Array<T>;\n isRowHeader?: boolean;\n rowId: string;\n cellClassName?: string;\n}\n\nconst Row = <T extends { id: number }>(props: RowProps<T>) => {\n const { cell, data, isRowHeader, rowId, cellClassName } = props;\n\n return (\n <div\n key={rowId}\n className={classNames('d-flex w-100', {\n [styles.header]: isRowHeader,\n })}\n >\n <h4\n className={classNames(\n styles.cell,\n styles.sticky,\n {\n [`p-h2 p--serif ${styles.title}`]: isRowHeader,\n [styles.addon]: typeof cell.key === 'undefined',\n },\n cellClassName\n )}\n >\n {cell.label}\n </h4>\n\n {Array.isArray(data) &&\n data.map((item) => {\n /**\n * Do not render a cell if\n * the data source object doesn't have the current key\n */\n if (typeof cell.key === 'undefined') return null;\n if (typeof item[cell.key] === 'undefined') return null;\n\n return (\n <div\n className={classNames('ta-center', styles.cell, cellClassName)}\n key={`${rowId}-${item.id}`}\n >\n {\n /**\n * Return a function if `render` option is present\n * else print the current data source value\n */\n typeof cell.render === 'function'\n ? cell.render(item[cell.key], item)\n : `${item[cell.key]}`\n }\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default React.memo(Row) as typeof Row;\n"],"names":["_jsxs","_jsx","React"],"mappings":";;;;;;;;;;AAcA,IAAM,GAAG,GAAG,UAA2B,KAAkB;;IAC/C,IAAA,IAAI,GAA8C,KAAK,KAAnD,EAAE,IAAI,GAAwC,KAAK,KAA7C,EAAE,WAAW,GAA2B,KAAK,YAAhC,EAAE,KAAK,GAAoB,KAAK,MAAzB,EAAE,aAAa,GAAK,KAAK,cAAV,CAAW;IAEhE,QACEA,uBAEE,SAAS,EAAE,UAAU,CAAC,cAAc;YAClC,GAAC,MAAM,CAAC,MAAM,IAAG,WAAW;gBAC5B,iBAEFC,qBACE,SAAS,EAAE,UAAU,CACnB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,MAAM;oBAEX,GAAC,mBAAiB,MAAM,CAAC,KAAO,IAAG,WAAW;oBAC9C,GAAC,MAAM,CAAC,KAAK,IAAG,OAAO,IAAI,CAAC,GAAG,KAAK,WAAW;yBAEjD,aAAa,CACd,gBAEA,IAAI,CAAC,KAAK,YACR;YAEJ,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;gBAClB,IAAI,CAAC,GAAG,CAAC,UAAC,IAAI;;;;;oBAKZ,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,WAAW;wBAAE,OAAO,IAAI,CAAC;oBACjD,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,WAAW;wBAAE,OAAO,IAAI,CAAC;oBAEvD,QACEA,sBACE,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC;;;;;wBAQ5D,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU;8BAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;8BACjC,KAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAG,KATjB,KAAK,SAAI,IAAI,CAAC,EAAI,CAWtB,EACN;iBACH,CAAC,MA5CC,KAAK,CA6CN,EACN;AACJ,CAAC,CAAC;AAEF,YAAeC,mBAAK,CAAC,IAAI,CAAC,GAAG,CAAe;;;;"}
@@ -4,8 +4,8 @@ import { c as classNames } from '../../../../index-6ea95111.js';
4
4
  import ArrowIcon from './Arrow.js';
5
5
  import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
6
6
 
7
- var css_248z = ".style-module_container__3BxOi {\n position: absolute;\n width: 100%;\n height: 100%;\n padding: 0 16px;\n justify-content: space-between;\n align-items: center;\n display: flex;\n}\n@media (min-width: 34rem) {\n .style-module_container__3BxOi {\n display: none;\n }\n}\n\n.style-module_next__3yJsi {\n transform: rotate(-90deg);\n}\n\n.style-module_prev__3rIR_ {\n transform: rotate(90deg);\n}\n\n.style-module_arrow__1tlbD {\n width: 32px;\n height: 32px;\n z-index: 3;\n padding: 0;\n border-radius: 50%;\n background-color: #f5f6fb;\n justify-content: center;\n align-items: center;\n stroke: #ebebff;\n}\n.style-module_arrow__1tlbD:hover, .style-module_arrow__1tlbD:focus {\n background-color: #f5f6fb;\n cursor: not-allowed;\n}\n\n.style-module_active__2kklB {\n stroke: #8e8cee;\n}\n.style-module_active__2kklB:hover, .style-module_active__2kklB:focus {\n background-color: #f5f6fb;\n cursor: pointer;\n}";
8
- var styles = {"container":"style-module_container__3BxOi","next":"style-module_next__3yJsi","prev":"style-module_prev__3rIR_","arrow":"style-module_arrow__1tlbD","active":"style-module_active__2kklB"};
7
+ var css_248z = ".style-module_container__3BxOi {\n position: absolute;\n width: 100%;\n height: 100%;\n padding: 0 16px;\n justify-content: space-between;\n align-items: center;\n display: flex;\n}\n@media (min-width: 34rem) {\n .style-module_container__3BxOi {\n display: none;\n }\n}\n\n.style-module_next__3yJsi {\n transform: rotate(-90deg);\n}\n\n.style-module_prev__3rIR_ {\n transform: rotate(90deg);\n}\n\n.style-module_arrow__1tlbD {\n width: 32px;\n height: 32px;\n z-index: 3;\n padding: 0;\n border-radius: 50%;\n background-color: #f5f6fb;\n justify-content: center;\n align-items: center;\n stroke: #ebebff;\n}\n.style-module_arrow__1tlbD:hover, .style-module_arrow__1tlbD:focus {\n background-color: #f5f6fb;\n cursor: not-allowed;\n}\n\n.style-module_active__2kklB {\n stroke: #8e8cee;\n}\n.style-module_active__2kklB:hover, .style-module_active__2kklB:focus {\n background-color: #f5f6fb;\n cursor: pointer;\n}\n\n.style-module_noPointerEvents__21KuB {\n pointer-events: none;\n}";
8
+ var styles = {"container":"style-module_container__3BxOi","next":"style-module_next__3yJsi","prev":"style-module_prev__3rIR_","arrow":"style-module_arrow__1tlbD","active":"style-module_active__2kklB","noPointerEvents":"style-module_noPointerEvents__21KuB"};
9
9
  styleInject(css_248z);
10
10
 
11
11
  var TableArrows = function (props) {
@@ -14,9 +14,11 @@ var TableArrows = function (props) {
14
14
  var handleButtonClick = function (value) { return function () { return onClick(value); }; };
15
15
  return (jsxs("div", __assign({ className: styles.container }, { children: [jsx("button", __assign({ onClick: handleButtonClick('prev'), className: classNames("p-btn--secondary d-flex", styles.prev, styles.arrow, (_a = {},
16
16
  _a[styles.active] = active.left,
17
+ _a[styles.noPointerEvents] = !active.left,
17
18
  _a)) }, { children: jsx(ArrowIcon, {}, void 0) }), void 0),
18
19
  jsx("button", __assign({ onClick: handleButtonClick('next'), className: classNames("p-btn--secondary d-flex", styles.next, styles.arrow, (_b = {},
19
20
  _b[styles.active] = active.right,
21
+ _b[styles.noPointerEvents] = !active.right,
20
22
  _b)) }, { children: jsx(ArrowIcon, {}, void 0) }), void 0)] }), void 0));
21
23
  };
22
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableArrows/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\n\nimport ArrowIcon from './Arrow';\nimport styles from './style.module.scss';\n\nexport type ArrowValues = 'prev' | 'next';\n\ninterface TableArrowsProps {\n onClick: (value: ArrowValues) => void;\n active: { left: boolean; right: boolean };\n}\n\nconst TableArrows = (props: TableArrowsProps) => {\n const { active, onClick } = props;\n const handleButtonClick = (value: ArrowValues) => () => onClick(value);\n\n return (\n <div className={styles.container}>\n <button\n onClick={handleButtonClick('prev')}\n className={classNames(\n `p-btn--secondary d-flex`,\n styles.prev,\n styles.arrow,\n {\n [styles.active]: active.left,\n }\n )}\n >\n <ArrowIcon />\n </button>\n <button\n onClick={handleButtonClick('next')}\n className={classNames(\n `p-btn--secondary d-flex`,\n styles.next,\n styles.arrow,\n {\n [styles.active]: active.right,\n }\n )}\n >\n <ArrowIcon />\n </button>\n </div>\n );\n};\n\nexport default TableArrows;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;IAaM,WAAW,GAAG,UAAC,KAAuB;;IAClC,IAAA,MAAM,GAAc,KAAK,OAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;IAClC,IAAM,iBAAiB,GAAG,UAAC,KAAkB,IAAK,OAAA,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,GAAA,GAAA,CAAC;IAEvE,QACEA,uBAAK,SAAS,EAAE,MAAM,CAAC,SAAS,iBAC9BC,yBACE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAClC,SAAS,EAAE,UAAU,CACnB,yBAAyB,EACzB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,KAAK;oBAEV,GAAC,MAAM,CAAC,MAAM,IAAG,MAAM,CAAC,IAAI;wBAE/B,gBAEDA,IAAC,SAAS,aAAG,YACN;YACTA,yBACE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAClC,SAAS,EAAE,UAAU,CACnB,yBAAyB,EACzB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,KAAK;oBAEV,GAAC,MAAM,CAAC,MAAM,IAAG,MAAM,CAAC,KAAK;wBAEhC,gBAEDA,IAAC,SAAS,aAAG,YACN,aACL,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableArrows/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\n\nimport ArrowIcon from './Arrow';\nimport styles from './style.module.scss';\n\nexport type ArrowValues = 'prev' | 'next';\n\ninterface TableArrowsProps {\n onClick: (value: ArrowValues) => void;\n active: { left: boolean; right: boolean };\n}\n\nconst TableArrows = (props: TableArrowsProps) => {\n const { active, onClick } = props;\n const handleButtonClick = (value: ArrowValues) => () => onClick(value);\n\n return (\n <div className={styles.container}>\n <button\n onClick={handleButtonClick('prev')}\n className={classNames(\n `p-btn--secondary d-flex`,\n styles.prev,\n styles.arrow,\n {\n [styles.active]: active.left,\n [styles.noPointerEvents]: !active.left,\n }\n )}\n >\n <ArrowIcon />\n </button>\n <button\n onClick={handleButtonClick('next')}\n className={classNames(\n `p-btn--secondary d-flex`,\n styles.next,\n styles.arrow,\n {\n [styles.active]: active.right,\n [styles.noPointerEvents]: !active.right,\n }\n )}\n >\n <ArrowIcon />\n </button>\n </div>\n );\n};\n\nexport default TableArrows;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;IAaM,WAAW,GAAG,UAAC,KAAuB;;IAClC,IAAA,MAAM,GAAc,KAAK,OAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;IAClC,IAAM,iBAAiB,GAAG,UAAC,KAAkB,IAAK,OAAA,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,GAAA,GAAA,CAAC;IAEvE,QACEA,uBAAK,SAAS,EAAE,MAAM,CAAC,SAAS,iBAC9BC,yBACE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAClC,SAAS,EAAE,UAAU,CACnB,yBAAyB,EACzB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,KAAK;oBAEV,GAAC,MAAM,CAAC,MAAM,IAAG,MAAM,CAAC,IAAI;oBAC5B,GAAC,MAAM,CAAC,eAAe,IAAG,CAAC,MAAM,CAAC,IAAI;wBAEzC,gBAEDA,IAAC,SAAS,aAAG,YACN;YACTA,yBACE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAClC,SAAS,EAAE,UAAU,CACnB,yBAAyB,EACzB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,KAAK;oBAEV,GAAC,MAAM,CAAC,MAAM,IAAG,MAAM,CAAC,KAAK;oBAC7B,GAAC,MAAM,CAAC,eAAe,IAAG,CAAC,MAAM,CAAC,KAAK;wBAE1C,gBAEDA,IAAC,SAAS,aAAG,YACN,aACL,EACN;AACJ;;;;"}
@@ -1,14 +1,19 @@
1
1
  import { _ as __assign } from '../../../../tslib.es6-5bc94358.js';
2
- import { jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
4
+ import TableInfoButton from '../TableInfoButton/index.js';
5
+ import '../../../icon/icons/Info.js';
6
+ import 'react';
7
+ import '../../../icon/IconWrapper/IconWrapper.js';
8
+ import '../../../../index-6ea95111.js';
4
9
 
5
- var css_248z = ".style-module_button__2W-YC {\n background-color: transparent;\n color: #4c4c53;\n cursor: pointer;\n margin: 2px 0;\n padding: 2px;\n transition: color 0.3s ease;\n}\n.style-module_button__2W-YC span {\n border-bottom: 2px dashed #696970;\n display: inline;\n transition: border-color 0.3s ease;\n}\n.style-module_button__2W-YC:hover, .style-module_button__2W-YC:focus {\n color: #8e8cee;\n outline-color: #8e8cee;\n}\n.style-module_button__2W-YC:hover span, .style-module_button__2W-YC:focus span {\n border-color: #8e8cee;\n}";
6
- var styles = {"button":"style-module_button__2W-YC"};
10
+ var css_248z = ".style-module_wrapper__1s115 {\n position: relative;\n}\n\n.style-module_infoButton__1nIU2 {\n position: absolute;\n right: -32px;\n top: 0;\n}";
11
+ var styles = {"wrapper":"style-module_wrapper__1s115","infoButton":"style-module_infoButton__1nIU2"};
7
12
  styleInject(css_248z);
8
13
 
9
14
  var TableButton = function (_a) {
10
15
  var children = _a.children, onClick = _a.onClick, _b = _a.className, className = _b === void 0 ? '' : _b;
11
- return (jsx("button", __assign({ className: styles.button + " " + className, "data-testid": "ds-table-button", onClick: onClick }, { children: jsx("span", { children: children }, void 0) }), void 0));
16
+ return (jsxs("div", __assign({ className: styles.wrapper }, { children: [children, jsx(TableInfoButton, { className: styles.infoButton + " " + className, "data-testid": "ds-table-button", onClick: onClick }, void 0)] }), void 0));
12
17
  };
13
18
 
14
19
  export default TableButton;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableButton/index.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport styles from './style.module.scss';\n\ninterface Props {\n children: ReactNode;\n onClick: () => void;\n className?: string;\n}\n\nconst TableButton: React.FC<Props> = ({\n children,\n onClick,\n className = '',\n}) => (\n <button\n className={`${styles.button} ${className}`}\n data-testid=\"ds-table-button\"\n onClick={onClick}\n >\n <span>\n {children}\n </span>\n </button>\n);\n\nexport default TableButton;\n"],"names":["_jsx"],"mappings":";;;;;;;;IASM,WAAW,GAAoB,UAAC,EAIrC;QAHC,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA;IACV,QACJA,yBACE,SAAS,EAAK,MAAM,CAAC,MAAM,SAAI,SAAW,iBAC9B,iBAAiB,EAC7B,OAAO,EAAE,OAAO,gBAEhBA,wBACG,QAAQ,WACJ,YACA;AATL;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableButton/index.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport styles from './style.module.scss';\nimport TableInfoButton from '../TableInfoButton';\n\ninterface Props {\n children: ReactNode;\n onClick: () => void;\n className?: string;\n}\n\nconst TableButton: React.FC<Props> = ({\n children,\n onClick,\n className = '',\n}) => (\n <div className={styles.wrapper}>\n {children}\n <TableInfoButton\n className={`${styles.infoButton} ${className}`}\n data-testid=\"ds-table-button\"\n onClick={onClick}\n />\n </div>\n);\n\nexport default TableButton;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;IAUM,WAAW,GAAoB,UAAC,EAIrC;QAHC,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA;IACV,QACJA,uBAAK,SAAS,EAAE,MAAM,CAAC,OAAO,iBAC3B,QAAQ,EACTC,IAAC,eAAe,IACd,SAAS,EAAK,MAAM,CAAC,UAAU,SAAI,SAAW,iBAClC,iBAAiB,EAC7B,OAAO,EAAE,OAAO,WAChB,aACE;AARF;;;;"}
@@ -10,22 +10,28 @@ import 'react-dom/test-utils';
10
10
  import 'os';
11
11
  import 'tty';
12
12
  import '../../../../style-inject.es-1f59c1d0.js';
13
+ import '../TableInfoButton/index.js';
14
+ import '../../../icon/icons/Info.js';
15
+ import '../../../icon/IconWrapper/IconWrapper.js';
16
+ import '../../../../index-6ea95111.js';
13
17
 
14
18
  var mockOnClick = jest.fn();
15
- var buttonContent = "Table Button label";
16
- var setup = function () { return customRender(jsx(TableButton, __assign({ onClick: mockOnClick }, { children: buttonContent }), void 0)); };
19
+ var buttonContent = 'Table Button label';
20
+ var setup = function () {
21
+ return customRender(jsx(TableButton, __assign({ onClick: mockOnClick }, { children: buttonContent }), void 0));
22
+ };
17
23
  describe('TableButton component', function () {
18
- it("should render button content", function () {
24
+ it('should render button content', function () {
19
25
  var getByText = setup().getByText;
20
26
  expect(getByText(buttonContent)).toBeInTheDocument();
21
27
  });
22
- it("should call onClick", function () { return __awaiter(void 0, void 0, void 0, function () {
23
- var _a, getByText, user;
28
+ it('should call onClick', function () { return __awaiter(void 0, void 0, void 0, function () {
29
+ var _a, getByTestId, user;
24
30
  return __generator(this, function (_b) {
25
31
  switch (_b.label) {
26
32
  case 0:
27
- _a = setup(), getByText = _a.getByText, user = _a.user;
28
- return [4 /*yield*/, user.click(getByText(buttonContent))];
33
+ _a = setup(), getByTestId = _a.getByTestId, user = _a.user;
34
+ return [4 /*yield*/, user.click(getByTestId('ds-table-info-button'))];
29
35
  case 1:
30
36
  _b.sent();
31
37
  expect(mockOnClick).toHaveBeenCalled();
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableButton/index.test.tsx"],"sourcesContent":["import { render } from '../../../../util/testUtils';\nimport '@testing-library/jest-dom';\n\nimport TableButton from '.';\n\nconst mockOnClick = jest.fn();\n\nconst buttonContent = \"Table Button label\";\n\nconst setup = () => render(\n <TableButton onClick={mockOnClick}>{buttonContent}</TableButton>\n);\n\ndescribe('TableButton component', () => {\n it(\"should render button content\", () => {\n const { getByText } = setup();\n\n expect(getByText(buttonContent)).toBeInTheDocument();\n });\n\n it(\"should call onClick\", async () => {\n const { getByText, user } = setup();\n\n await user.click(getByText(buttonContent));\n\n expect(mockOnClick).toHaveBeenCalled();\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;AAKA,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE9B,IAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,IAAM,KAAK,GAAG,cAAM,OAAAA,YAAM,CACxBC,IAAC,WAAW,aAAC,OAAO,EAAE,WAAW,gBAAG,aAAa,YAAe,CACjE,GAAA,CAAC;AAEF,QAAQ,CAAC,uBAAuB,EAAE;IAChC,EAAE,CAAC,8BAA8B,EAAE;QACzB,IAAA,SAAS,GAAK,KAAK,EAAE,UAAZ,CAAa;QAE9B,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;KACtD,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE;;;;;oBAClB,KAAsB,KAAK,EAAE,EAA3B,SAAS,eAAA,EAAE,IAAI,UAAA,CAAa;oBAEpC,qBAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAA;;oBAA1C,SAA0C,CAAC;oBAE3C,MAAM,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;;;;SACxC,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"index.test.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableButton/index.test.tsx"],"sourcesContent":["import { render } from '../../../../util/testUtils';\nimport '@testing-library/jest-dom';\n\nimport TableButton from '.';\n\nconst mockOnClick = jest.fn();\n\nconst buttonContent = 'Table Button label';\n\nconst setup = () =>\n render(<TableButton onClick={mockOnClick}>{buttonContent}</TableButton>);\n\ndescribe('TableButton component', () => {\n it('should render button content', () => {\n const { getByText } = setup();\n\n expect(getByText(buttonContent)).toBeInTheDocument();\n });\n\n it('should call onClick', async () => {\n const { getByTestId, user } = setup();\n\n await user.click(getByTestId('ds-table-info-button'));\n\n expect(mockOnClick).toHaveBeenCalled();\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;;;;;AAKA,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE9B,IAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,IAAM,KAAK,GAAG;IACZ,OAAAA,YAAM,CAACC,IAAC,WAAW,aAAC,OAAO,EAAE,WAAW,gBAAG,aAAa,YAAe,CAAC;AAAxE,CAAwE,CAAC;AAE3E,QAAQ,CAAC,uBAAuB,EAAE;IAChC,EAAE,CAAC,8BAA8B,EAAE;QACzB,IAAA,SAAS,GAAK,KAAK,EAAE,UAAZ,CAAa;QAE9B,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;KACtD,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE;;;;;oBAClB,KAAwB,KAAK,EAAE,EAA7B,WAAW,iBAAA,EAAE,IAAI,UAAA,CAAa;oBAEtC,qBAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,EAAA;;oBAArD,SAAqD,CAAC;oBAEtD,MAAM,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;;;;SACxC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -12,7 +12,7 @@ styleInject(css_248z);
12
12
 
13
13
  var TableInfoButton = function (_a) {
14
14
  var onClick = _a.onClick, _b = _a.className, className = _b === void 0 ? '' : _b;
15
- return (jsx("button", __assign({ className: "p-btn--secondary " + styles.button + " " + className, type: "button", onClick: onClick }, { children: jsx(Info, { size: 20 }, void 0) }), void 0));
15
+ return (jsx("button", __assign({ className: "p-btn--secondary " + styles.button + " " + className, type: "button", "data-testid": "ds-table-info-button", onClick: onClick }, { children: jsx(Info, { size: 20 }, void 0) }), void 0));
16
16
  };
17
17
 
18
18
  export default TableInfoButton;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableInfoButton/index.tsx"],"sourcesContent":["import Info from '../../../icon/icons/Info';\nimport styles from './style.module.scss';\n\nconst TableInfoButton = ({\n onClick,\n className = '',\n}: {\n onClick: () => void;\n className?: string;\n}) => (\n <button\n className={`p-btn--secondary ${styles.button} ${className}`}\n type=\"button\"\n onClick={onClick}\n >\n <Info size={20} />\n </button>\n);\n\nexport default TableInfoButton;\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;IAGM,eAAe,GAAG,UAAC,EAMxB;QALC,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA;IAIV,QACJA,yBACE,SAAS,EAAE,sBAAoB,MAAM,CAAC,MAAM,SAAI,SAAW,EAC3D,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBAEhBA,IAAC,IAAI,IAAC,IAAI,EAAE,EAAE,WAAI,YACX;AAPL;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableInfoButton/index.tsx"],"sourcesContent":["import Info from '../../../icon/icons/Info';\nimport styles from './style.module.scss';\n\nconst TableInfoButton = ({\n onClick,\n className = '',\n}: {\n onClick: () => void;\n className?: string;\n}) => (\n <button\n className={`p-btn--secondary ${styles.button} ${className}`}\n type=\"button\"\n data-testid=\"ds-table-info-button\"\n onClick={onClick}\n >\n <Info size={20} />\n </button>\n);\n\nexport default TableInfoButton;\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;IAGM,eAAe,GAAG,UAAC,EAMxB;QALC,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA;IAIV,QACJA,yBACE,SAAS,EAAE,sBAAoB,MAAM,CAAC,MAAM,SAAI,SAAW,EAC3D,IAAI,EAAC,QAAQ,iBACD,sBAAsB,EAClC,OAAO,EAAE,OAAO,gBAEhBA,IAAC,IAAI,IAAC,IAAI,EAAE,EAAE,WAAI,YACX;AARL;;;;"}
@@ -1,7 +1,11 @@
1
1
  import { _ as __assign } from '../../../../tslib.es6-5bc94358.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import TableButton from '../TableButton/index.js';
3
+ import { c as classNames } from '../../../../index-6ea95111.js';
4
4
  import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
5
+ import TableInfoButton from '../TableInfoButton/index.js';
6
+ import '../../../icon/icons/Info.js';
7
+ import 'react';
8
+ import '../../../icon/IconWrapper/IconWrapper.js';
5
9
 
6
10
  var css_248z = ".style-module_icon__30Nor {\n min-width: 20px;\n}";
7
11
  var styles = {"icon":"style-module_icon__30Nor"};
@@ -10,7 +14,10 @@ styleInject(css_248z);
10
14
  var TableRowHeader = function (_a) {
11
15
  var icon = _a.icon, label = _a.label, subtitle = _a.subtitle, onClickInfo = _a.onClickInfo;
12
16
  return (jsxs("div", __assign({ className: "d-flex" }, { children: [icon && jsx("span", __assign({ className: "mr8 " + styles.icon }, { children: icon }), void 0),
13
- jsxs("div", { children: [jsx("p", __assign({ className: "p-p d-inline" }, { children: !onClickInfo ? (jsx("span", { children: label }, void 0)) : (jsx(TableButton, __assign({ className: "mr8 ta-left", onClick: onClickInfo }, { children: label }), void 0)) }), void 0),
17
+ jsxs("div", { children: [jsxs("p", __assign({ className: "p-p d-inline" }, { children: [jsx("span", __assign({ className: classNames({
18
+ mr8: onClickInfo,
19
+ }) }, { children: label }), void 0),
20
+ onClickInfo && jsx(TableInfoButton, { onClick: onClickInfo }, void 0)] }), void 0),
14
21
  subtitle && jsx("p", __assign({ className: "p-p--small tc-grey-500" }, { children: subtitle }), void 0)] }, void 0)] }), void 0));
15
22
  };
16
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.tsx"],"sourcesContent":["import TableButton from '../TableButton';\nimport styles from './style.module.scss';\n\ninterface TableRowHeaderProps {\n label: string;\n icon?: string;\n subtitle?: string;\n onClickInfo?: () => void;\n}\n\nconst TableRowHeader = ({ icon, label, subtitle, onClickInfo }: TableRowHeaderProps) => (\n <div className=\"d-flex\">\n {icon && <span className={`mr8 ${styles.icon}`}>{icon}</span>}\n <div>\n <p className=\"p-p d-inline\">\n {!onClickInfo ? (\n <span>{label}</span>\n ) : (\n <TableButton className=\"mr8 ta-left\" onClick={onClickInfo}>\n {label}\n </TableButton>\n )}\n </p>\n {subtitle && <p className=\"p-p--small tc-grey-500\">{subtitle}</p>}\n </div>\n </div>\n);\n\nexport type { TableRowHeaderProps };\nexport default TableRowHeader;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;IAUM,cAAc,GAAG,UAAC,EAA2D;QAAzD,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,WAAW,iBAAA;IAA4B,QACtFA,uBAAK,SAAS,EAAC,QAAQ,iBACpB,IAAI,IAAIC,uBAAM,SAAS,EAAE,SAAO,MAAM,CAAC,IAAM,gBAAG,IAAI,YAAQ;YAC7DD,yBACEC,oBAAG,SAAS,EAAC,cAAc,gBACxB,CAAC,WAAW,IACXA,wBAAO,KAAK,WAAQ,KAEpBA,IAAC,WAAW,aAAC,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,gBACtD,KAAK,YACM,CACf,YACC;oBACH,QAAQ,IAAIA,oBAAG,SAAS,EAAC,wBAAwB,gBAAE,QAAQ,YAAK,YAC7D,aACF;AAfgF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport styles from './style.module.scss';\nimport TableInfoButton from '../TableInfoButton';\n\ninterface TableRowHeaderProps {\n label: string;\n icon?: string;\n subtitle?: string;\n onClickInfo?: () => void;\n}\n\nconst TableRowHeader = ({\n icon,\n label,\n subtitle,\n onClickInfo,\n}: TableRowHeaderProps) => (\n <div className=\"d-flex\">\n {icon && <span className={`mr8 ${styles.icon}`}>{icon}</span>}\n <div>\n <p className=\"p-p d-inline\">\n <span\n className={classNames({\n mr8: onClickInfo,\n })}\n >\n {label}\n </span>\n {onClickInfo && <TableInfoButton onClick={onClickInfo} />}\n </p>\n {subtitle && <p className=\"p-p--small tc-grey-500\">{subtitle}</p>}\n </div>\n </div>\n);\n\nexport type { TableRowHeaderProps };\nexport default TableRowHeader;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;IAWM,cAAc,GAAG,UAAC,EAKF;QAJpB,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,WAAW,iBAAA;IACc,QACzBA,uBAAK,SAAS,EAAC,QAAQ,iBACpB,IAAI,IAAIC,uBAAM,SAAS,EAAE,SAAO,MAAM,CAAC,IAAM,gBAAG,IAAI,YAAQ;YAC7DD,yBACEA,qBAAG,SAAS,EAAC,cAAc,iBACzBC,uBACE,SAAS,EAAE,UAAU,CAAC;oCACpB,GAAG,EAAE,WAAW;iCACjB,CAAC,gBAED,KAAK,YACD;4BACN,WAAW,IAAIA,IAAC,eAAe,IAAC,OAAO,EAAE,WAAW,WAAI,aACvD;oBACH,QAAQ,IAAIA,oBAAG,SAAS,EAAC,wBAAwB,gBAAE,QAAQ,YAAK,YAC7D,aACF;AAhBmB;;;;"}
@@ -9,48 +9,51 @@ import '../../../../_commonjsHelpers-e7f67fd8.js';
9
9
  import 'react-dom/test-utils';
10
10
  import 'os';
11
11
  import 'tty';
12
- import '../TableButton/index.js';
12
+ import '../../../../index-6ea95111.js';
13
13
  import '../../../../style-inject.es-1f59c1d0.js';
14
+ import '../TableInfoButton/index.js';
15
+ import '../../../icon/icons/Info.js';
16
+ import '../../../icon/IconWrapper/IconWrapper.js';
14
17
 
15
18
  var mockOnClick = jest.fn();
16
- var label = "Table label";
17
- var subtitle = "Subtitle label";
18
- var icon = "🎉";
19
- var buttonTestId = "ds-table-button";
19
+ var label = 'Table label';
20
+ var subtitle = 'Subtitle label';
21
+ var icon = '🎉';
22
+ var buttonTestId = 'ds-table-info-button';
20
23
  var setup = function (props) {
21
24
  if (props === void 0) { props = {}; }
22
25
  return customRender(jsx(TableRowHeader, __assign({ label: label }, props), void 0));
23
26
  };
24
27
  describe('TableRowHeader component', function () {
25
- it("should render label", function () {
28
+ it('should render label', function () {
26
29
  var getByText = setup().getByText;
27
30
  expect(getByText(label)).toBeInTheDocument();
28
31
  });
29
- it("should not render subtitle", function () {
32
+ it('should not render subtitle', function () {
30
33
  var queryByText = setup().queryByText;
31
34
  expect(queryByText(subtitle)).not.toBeInTheDocument();
32
35
  });
33
- it("should render subtitle", function () {
36
+ it('should render subtitle', function () {
34
37
  var getByText = setup({ subtitle: subtitle }).getByText;
35
38
  expect(getByText(subtitle)).toBeInTheDocument();
36
39
  });
37
- it("should not render icon", function () {
40
+ it('should not render icon', function () {
38
41
  var queryByText = setup().queryByText;
39
42
  expect(queryByText(icon)).not.toBeInTheDocument();
40
43
  });
41
- it("should render icon", function () {
44
+ it('should render icon', function () {
42
45
  var getByText = setup({ icon: icon }).getByText;
43
46
  expect(getByText(icon)).toBeInTheDocument();
44
47
  });
45
- it("should not render button if onClickInfo is not defined", function () {
48
+ it('should not render button if onClickInfo is not defined', function () {
46
49
  var queryByTestId = setup().queryByTestId;
47
50
  expect(queryByTestId(buttonTestId)).not.toBeInTheDocument();
48
51
  });
49
- it("should render button if onClickInfo is defined", function () {
52
+ it('should render button if onClickInfo is defined', function () {
50
53
  var getByTestId = setup({ onClickInfo: mockOnClick }).getByTestId;
51
54
  expect(getByTestId(buttonTestId)).toBeInTheDocument();
52
55
  });
53
- it("should not call onClickInfo if not defined", function () { return __awaiter(void 0, void 0, void 0, function () {
56
+ it('should not call onClickInfo if not defined', function () { return __awaiter(void 0, void 0, void 0, function () {
54
57
  var _a, getByText, user;
55
58
  return __generator(this, function (_b) {
56
59
  switch (_b.label) {
@@ -64,13 +67,13 @@ describe('TableRowHeader component', function () {
64
67
  }
65
68
  });
66
69
  }); });
67
- it("should call onClickInfo if defined", function () { return __awaiter(void 0, void 0, void 0, function () {
68
- var _a, getByText, user;
70
+ it('should call onClickInfo if defined', function () { return __awaiter(void 0, void 0, void 0, function () {
71
+ var _a, getByTestId, user;
69
72
  return __generator(this, function (_b) {
70
73
  switch (_b.label) {
71
74
  case 0:
72
- _a = setup({ onClickInfo: mockOnClick }), getByText = _a.getByText, user = _a.user;
73
- return [4 /*yield*/, user.click(getByText(label))];
75
+ _a = setup({ onClickInfo: mockOnClick }), getByTestId = _a.getByTestId, user = _a.user;
76
+ return [4 /*yield*/, user.click(getByTestId('ds-table-info-button'))];
74
77
  case 1:
75
78
  _b.sent();
76
79
  expect(mockOnClick).toHaveBeenCalled();
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.test.tsx"],"sourcesContent":["import { render } from '../../../../util/testUtils';\nimport '@testing-library/jest-dom';\n\nimport TableRowHeader, { TableRowHeaderProps } from '.';\n\nconst mockOnClick = jest.fn();\n\nconst label = \"Table label\";\nconst subtitle = \"Subtitle label\";\nconst icon = \"🎉\";\nconst buttonTestId = \"ds-table-button\";\n\nconst setup = (props: Partial<TableRowHeaderProps> = {}) => render(\n <TableRowHeader \n label={label} \n {...props}\n />\n);\n\ndescribe('TableRowHeader component', () => {\n it(\"should render label\", () => {\n const { getByText } = setup();\n\n expect(getByText(label)).toBeInTheDocument();\n });\n\n it(\"should not render subtitle\", () => {\n const { queryByText } = setup();\n\n expect(queryByText(subtitle)).not.toBeInTheDocument();\n });\n\n it(\"should render subtitle\", () => {\n const { getByText } = setup({ subtitle });\n\n expect(getByText(subtitle)).toBeInTheDocument();\n });\n\n it(\"should not render icon\", () => {\n const { queryByText } = setup();\n\n expect(queryByText(icon)).not.toBeInTheDocument();\n });\n\n it(\"should render icon\", () => {\n const { getByText } = setup({ icon });\n\n expect(getByText(icon)).toBeInTheDocument();\n });\n\n it(\"should not render button if onClickInfo is not defined\", () => {\n const { queryByTestId } = setup();\n\n expect(queryByTestId(buttonTestId)).not.toBeInTheDocument();\n });\n\n it(\"should render button if onClickInfo is defined\", () => {\n const { getByTestId } = setup({ onClickInfo: mockOnClick });\n\n expect(getByTestId(buttonTestId)).toBeInTheDocument();\n });\n\n it(\"should not call onClickInfo if not defined\", async () => {\n const { getByText, user } = setup();\n\n await user.click(getByText(label));\n\n expect(mockOnClick).not.toHaveBeenCalled();\n });\n\n it(\"should call onClickInfo if defined\", async () => {\n const { getByText, user } = setup({ onClickInfo: mockOnClick });\n\n await user.click(getByText(label));\n\n expect(mockOnClick).toHaveBeenCalled();\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;;AAKA,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE9B,IAAM,KAAK,GAAG,aAAa,CAAC;AAC5B,IAAM,QAAQ,GAAG,gBAAgB,CAAC;AAClC,IAAM,IAAI,GAAG,IAAI,CAAC;AAClB,IAAM,YAAY,GAAG,iBAAiB,CAAC;AAEvC,IAAM,KAAK,GAAG,UAAC,KAAwC;IAAxC,sBAAA,EAAA,UAAwC;IAAK,OAAAA,YAAM,CAChEC,IAAC,cAAc,aACb,KAAK,EAAE,KAAK,IACR,KAAK,UACT,CACH;AAL2D,CAK3D,CAAC;AAEF,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,qBAAqB,EAAE;QAChB,IAAA,SAAS,GAAK,KAAK,EAAE,UAAZ,CAAa;QAE9B,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;KAC9C,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE;QACvB,IAAA,WAAW,GAAK,KAAK,EAAE,YAAZ,CAAa;QAEhC,MAAM,CAAC,W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CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAA;;oBAAlC,SAAkC,CAAC;oBAEnC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;;;;SAC5C,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;;;;;oBACjC,KAAsB,KAAK,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAvD,SAAS,eAAA,EAAE,IAAI,UAAA,CAAyC;oBAEhE,qBAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAA;;oBAAlC,SAAkC,CAAC;oBAEnC,MAAM,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;;;;SACxC,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"index.test.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.test.tsx"],"sourcesContent":["import { render } from '../../../../util/testUtils';\nimport '@testing-library/jest-dom';\n\nimport TableRowHeader, { TableRowHeaderProps } from '.';\n\nconst mockOnClick = jest.fn();\n\nconst label = 'Table label';\nconst subtitle = 'Subtitle label';\nconst icon = '🎉';\nconst buttonTestId = 'ds-table-info-button';\n\nconst setup = (props: Partial<TableRowHeaderProps> = {}) =>\n render(<TableRowHeader label={label} {...props} />);\n\ndescribe('TableRowHeader component', () => {\n it('should render label', () => {\n const { getByText } = setup();\n\n expect(getByText(label)).toBeInTheDocument();\n });\n\n it('should not render subtitle', () => {\n const { queryByText } = setup();\n\n expect(queryByText(subtitle)).not.toBeInTheDocument();\n });\n\n it('should render subtitle', () => {\n const { getByText } = setup({ subtitle });\n\n expect(getByText(subtitle)).toBeInTheDocument();\n });\n\n it('should not render icon', () => {\n const { queryByText } = setup();\n\n expect(queryByText(icon)).not.toBeInTheDocument();\n });\n\n it('should render icon', () => {\n const { getByText } = setup({ icon });\n\n expect(getByText(icon)).toBeInTheDocument();\n });\n\n it('should not render button if onClickInfo is not defined', () => {\n const { queryByTestId } = setup();\n\n expect(queryByTestId(buttonTestId)).not.toBeInTheDocument();\n });\n\n it('should render button if onClickInfo is defined', () => {\n const { getByTestId } = setup({ onClickInfo: mockOnClick });\n\n expect(getByTestId(buttonTestId)).toBeInTheDocument();\n });\n\n it('should not call onClickInfo if not defined', async () => {\n const { getByText, user } = setup();\n\n await user.click(getByText(label));\n\n expect(mockOnClick).not.toHaveBeenCalled();\n });\n\n it('should call onClickInfo if defined', async () => {\n const { getByTestId, user } = setup({ onClickInfo: mockOnClick });\n\n await user.click(getByTestId('ds-table-info-button'));\n\n expect(mockOnClick).toHaveBeenCalled();\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;;;;;AAKA,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE9B,IAAM,KAAK,GAAG,aAAa,CAAC;AAC5B,IAAM,QAAQ,GAAG,gBAAgB,CAAC;AAClC,IAAM,IAAI,GAAG,IAAI,CAAC;AAClB,IAAM,YAAY,GAAG,sBAAsB,CAAC;AAE5C,IAAM,KAAK,GAAG,UAAC,KAAwC;IAAxC,sBAAA,EAAA,UAAwC;IACrD,OAAAA,YAAM,CAACC,IAAC,cAAc,aAAC,KAAK,EAAE,KAAK,IAAM,KAAK,UAAI,CAAC;AAAnD,CAAmD,CAAC;AAEtD,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,qBAAqB,EAAE;QAChB,IAAA,SAAS,GAAK,KAAK,EAAE,UAAZ,CAAa;QAE9B,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;KAC9C,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE;QACvB,IAAA,WAAW,GAAK,KAAK,EAAE,YAAZ,CAAa;QAEhC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;KACvD,CAAC,CAA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