@openedx/paragon 23.14.8 → 23.15.0

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 (132) hide show
  1. package/dist/Card/CardBody.d.ts +9 -0
  2. package/dist/Card/CardBody.js +0 -11
  3. package/dist/Card/CardBody.js.map +1 -1
  4. package/dist/Card/CardContext.d.ts +17 -0
  5. package/dist/Card/CardContext.js +8 -21
  6. package/dist/Card/CardContext.js.map +1 -1
  7. package/dist/Card/CardDivider.d.ts +7 -0
  8. package/dist/Card/CardDivider.js +2 -10
  9. package/dist/Card/CardDivider.js.map +1 -1
  10. package/dist/Card/CardFallbackDefaultImage.d.ts +1 -0
  11. package/dist/Card/CardFallbackDefaultImage.js +1 -0
  12. package/dist/Card/CardFallbackDefaultImage.js.map +1 -0
  13. package/dist/Card/CardGrid.d.ts +22 -0
  14. package/dist/Card/CardGrid.js +6 -31
  15. package/dist/Card/CardGrid.js.map +1 -1
  16. package/dist/Chip/constants.js +0 -1
  17. package/dist/Chip/constants.js.map +1 -1
  18. package/dist/Container/index.js +0 -1
  19. package/dist/Container/index.js.map +1 -1
  20. package/dist/DataTable/CollapsibleButtonGroup.js +0 -1
  21. package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
  22. package/dist/DataTable/DataTableContext.d.ts +3 -0
  23. package/dist/DataTable/DataTableContext.js.map +1 -1
  24. package/dist/DataTable/TableCell.d.ts +14 -0
  25. package/dist/DataTable/TableCell.js +0 -12
  26. package/dist/DataTable/TableCell.js.map +1 -1
  27. package/dist/DataTable/TableHeaderCell.d.ts +26 -0
  28. package/dist/DataTable/TableHeaderCell.js +4 -32
  29. package/dist/DataTable/TableHeaderCell.js.map +1 -1
  30. package/dist/DataTable/filters/CheckboxFilter.js +1 -1
  31. package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
  32. package/dist/DataTable/index.js +7 -2
  33. package/dist/DataTable/index.js.map +1 -1
  34. package/dist/Dropdown/index.js +10 -18
  35. package/dist/Dropdown/index.js.map +1 -1
  36. package/dist/Menu/MenuItem.d.ts +17 -0
  37. package/dist/Menu/MenuItem.js +5 -27
  38. package/dist/Menu/MenuItem.js.map +1 -1
  39. package/dist/Menu/index.d.ts +16 -0
  40. package/dist/Menu/index.js +4 -24
  41. package/dist/Menu/index.js.map +1 -1
  42. package/dist/Modal/ModalDialogHeader.js +4 -1
  43. package/dist/Modal/ModalDialogHeader.js.map +1 -1
  44. package/dist/Modal/ModalLayer.js +7 -12
  45. package/dist/Modal/ModalLayer.js.map +1 -1
  46. package/dist/OverflowScroll/data/constants.d.ts +1 -0
  47. package/dist/OverflowScroll/data/constants.js +1 -2
  48. package/dist/OverflowScroll/data/constants.js.map +1 -0
  49. package/dist/PageBanner/index.d.ts +27 -0
  50. package/dist/PageBanner/index.js +5 -28
  51. package/dist/PageBanner/index.js.map +1 -1
  52. package/dist/ProductTour/index.js +5 -7
  53. package/dist/ProductTour/index.js.map +1 -1
  54. package/dist/ProgressBar/utils.js +0 -1
  55. package/dist/SelectableBox/utils.js +1 -1
  56. package/dist/Sheet/SheetContainer.js +30 -8
  57. package/dist/Sheet/SheetContainer.js.map +1 -1
  58. package/dist/Sheet/index.js +15 -5
  59. package/dist/Sheet/index.js.map +1 -1
  60. package/dist/Stack/index.d.ts +20 -0
  61. package/dist/Stack/index.js +3 -28
  62. package/dist/Stack/index.js.map +1 -1
  63. package/dist/Sticky/index.js +1 -2
  64. package/dist/Sticky/index.js.map +1 -1
  65. package/dist/Tabs/Tab.d.ts +19 -0
  66. package/dist/Tabs/Tab.js +0 -23
  67. package/dist/Tabs/Tab.js.map +1 -1
  68. package/dist/asInput/index.js +7 -14
  69. package/dist/asInput/index.js.map +1 -1
  70. package/dist/index.d.ts +1 -1
  71. package/dist/index.js +1 -2
  72. package/dist/index.js.map +1 -1
  73. package/dist/setupTest.js.map +1 -1
  74. package/dist/utils/index.js +0 -1
  75. package/dist/utils/index.js.map +1 -1
  76. package/lib/version.js +1 -2
  77. package/package.json +3 -3
  78. package/src/Card/CardBody.tsx +19 -0
  79. package/src/Card/CardCarousel/tests/CardCarousel.test.jsx +0 -1
  80. package/src/Card/{CardContext.jsx → CardContext.tsx} +24 -25
  81. package/src/Card/CardDivider.tsx +13 -0
  82. package/src/Card/{CardGrid.jsx → CardGrid.tsx} +28 -35
  83. package/src/Chip/constants.ts +0 -1
  84. package/src/ChipCarousel/ChipCarousel.test.jsx +9 -11
  85. package/src/Container/index.tsx +0 -1
  86. package/src/DataTable/CollapsibleButtonGroup.jsx +0 -1
  87. package/src/DataTable/README.md +12 -12
  88. package/src/DataTable/{TableCell.jsx → TableCell.tsx} +13 -15
  89. package/src/DataTable/{TableHeaderCell.jsx → TableHeaderCell.tsx} +32 -33
  90. package/src/DataTable/filters/CheckboxFilter.jsx +1 -1
  91. package/src/DataTable/filters/tests/CheckboxFilter.test.jsx +31 -0
  92. package/src/DataTable/index.jsx +6 -2
  93. package/src/DataTable/selection/tests/utils.js +0 -1
  94. package/src/DataTable/tablecontrolbar.mdx +4 -4
  95. package/src/DataTable/tablefilters.mdx +8 -8
  96. package/src/DataTable/tests/DataTable.test.jsx +6 -4
  97. package/src/DataTable/tests/TableHeaderCell.test.jsx +0 -1
  98. package/src/DataTable/utils/tests/getTableArgs.test.js +3 -2
  99. package/src/DataTable/utils/tests/getVisibleColumns.test.js +0 -2
  100. package/src/Dropdown/index.jsx +11 -16
  101. package/src/Form/tests/useCheckboxSetValues.test.jsx +17 -9
  102. package/src/Menu/MenuItem.tsx +49 -0
  103. package/src/Menu/{index.jsx → index.tsx} +18 -27
  104. package/src/Modal/ModalDialogHeader.tsx +5 -1
  105. package/src/Modal/ModalLayer.tsx +1 -2
  106. package/src/Modal/tests/ModalLayer.test.tsx +1 -2
  107. package/src/OverflowScroll/data/{constants.js → constants.ts} +0 -2
  108. package/src/PageBanner/{index.jsx → index.tsx} +27 -29
  109. package/src/ProductTour/index.jsx +5 -7
  110. package/src/ProgressBar/utils.js +0 -1
  111. package/src/SelectableBox/tests/SelectableBox.test.jsx +0 -1
  112. package/src/SelectableBox/utils.js +1 -1
  113. package/src/Sheet/Sheet.test.jsx +63 -3
  114. package/src/Sheet/SheetContainer.jsx +34 -7
  115. package/src/Sheet/SheetContainer.test.jsx +34 -1
  116. package/src/Sheet/__snapshots__/Sheet.test.jsx.snap +15 -6
  117. package/src/Sheet/index.jsx +12 -2
  118. package/src/Stack/{index.jsx → index.tsx} +22 -35
  119. package/src/Sticky/index.jsx +1 -1
  120. package/src/Tabs/{Tab.jsx → Tab.tsx} +10 -18
  121. package/src/TransitionReplace/README.md +2 -2
  122. package/src/TransitionReplace/TransitionReplace.test.jsx +1 -1
  123. package/src/asInput/index.jsx +0 -3
  124. package/src/hooks/tests/useToggle.test.tsx +4 -5
  125. package/src/index.ts +1 -2
  126. package/src/setupTest.ts +0 -1
  127. package/src/utils/index.ts +0 -1
  128. package/src/Card/CardBody.jsx +0 -23
  129. package/src/Card/CardDivider.jsx +0 -18
  130. package/src/Menu/MenuItem.jsx +0 -57
  131. /package/src/Card/{CardFallbackDefaultImage.js → CardFallbackDefaultImage.ts} +0 -0
  132. /package/src/DataTable/{DataTableContext.jsx → DataTableContext.tsx} +0 -0
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface CardBodyProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** Specifies the content of the component. */
4
+ children?: React.ReactNode;
5
+ /** The class to append to the base element. */
6
+ className?: string;
7
+ }
8
+ declare const CardBody: React.ForwardRefExoticComponent<CardBodyProps & React.RefAttributes<HTMLDivElement>>;
9
+ export default CardBody;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  const CardBody = /*#__PURE__*/React.forwardRef(({
5
4
  className,
@@ -10,15 +9,5 @@ const CardBody = /*#__PURE__*/React.forwardRef(({
10
9
  ref: ref,
11
10
  ...rest
12
11
  }, children));
13
- CardBody.propTypes = {
14
- /** Specifies the content of the component. */
15
- children: PropTypes.node,
16
- /** The class to append to the base element. */
17
- className: PropTypes.string
18
- };
19
- CardBody.defaultProps = {
20
- children: undefined,
21
- className: undefined
22
- };
23
12
  export default CardBody;
24
13
  //# sourceMappingURL=CardBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardBody.js","names":["React","PropTypes","classNames","CardBody","forwardRef","className","children","rest","ref","createElement","propTypes","node","string","defaultProps","undefined"],"sources":["../../src/Card/CardBody.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst CardBody = React.forwardRef(({ className, children, ...rest }, ref) => (\n <div className={classNames('pgn__card-body', className)} ref={ref} {...rest}>\n {children}\n </div>\n));\n\nCardBody.propTypes = {\n /** Specifies the content of the component. */\n children: PropTypes.node,\n /** The class to append to the base element. */\n className: PropTypes.string,\n};\n\nCardBody.defaultProps = {\n children: undefined,\n className: undefined,\n};\n\nexport default CardBody;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,QAAQ,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,EAAEC,GAAG,kBACtER,KAAA,CAAAS,aAAA;EAAKJ,SAAS,EAAEH,UAAU,CAAC,gBAAgB,EAAEG,SAAS,CAAE;EAACG,GAAG,EAAEA,GAAI;EAAA,GAAKD;AAAI,GACxED,QACE,CACN,CAAC;AAEFH,QAAQ,CAACO,SAAS,GAAG;EACnB;EACAJ,QAAQ,EAAEL,SAAS,CAACU,IAAI;EACxB;EACAN,SAAS,EAAEJ,SAAS,CAACW;AACvB,CAAC;AAEDT,QAAQ,CAACU,YAAY,GAAG;EACtBP,QAAQ,EAAEQ,SAAS;EACnBT,SAAS,EAAES;AACb,CAAC;AAED,eAAeX,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"CardBody.js","names":["React","classNames","CardBody","forwardRef","className","children","rest","ref","createElement"],"sources":["../../src/Card/CardBody.tsx"],"sourcesContent":["import React, { ForwardedRef } from 'react';\nimport classNames from 'classnames';\n\ninterface CardBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Specifies the content of the component. */\n children?: React.ReactNode;\n /** The class to append to the base element. */\n className?: string;\n}\n\nconst CardBody = React.forwardRef(({\n className, children, ...rest\n}: CardBodyProps, ref: ForwardedRef<HTMLDivElement>) => (\n <div className={classNames('pgn__card-body', className)} ref={ref} {...rest}>\n {children}\n </div>\n));\n\nexport default CardBody;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAwB,OAAO;AAC3C,OAAOC,UAAU,MAAM,YAAY;AASnC,MAAMC,QAAQ,gBAAGF,KAAK,CAACG,UAAU,CAAC,CAAC;EACjCC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AACX,CAAC,EAAEC,GAAiC,kBACjDP,KAAA,CAAAQ,aAAA;EAAKJ,SAAS,EAAEH,UAAU,CAAC,gBAAgB,EAAEG,SAAS,CAAE;EAACG,GAAG,EAAEA,GAAI;EAAA,GAAKD;AAAI,GACxED,QACE,CACN,CAAC;AAEF,eAAeH,QAAQ","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface CardContextData {
3
+ /** Specifies which orientation to use. */
4
+ orientation: 'horizontal' | 'vertical';
5
+ /** Specifies loading state. */
6
+ isLoading: boolean;
7
+ /** Specifies `Card` style variant */
8
+ variant: 'light' | 'dark' | 'muted';
9
+ }
10
+ declare const CardContext: React.Context<CardContextData>;
11
+ interface CardContextProviderProps extends Partial<CardContextData> {
12
+ /** Specifies content of the component. */
13
+ children?: ReactNode;
14
+ }
15
+ declare function CardContextProvider({ orientation, children, isLoading, variant, }: CardContextProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ export { CardContextProvider };
17
+ export default CardContext;
@@ -1,11 +1,14 @@
1
1
  import React, { createContext } from 'react';
2
- import PropTypes from 'prop-types';
3
- const CardContext = /*#__PURE__*/createContext({});
2
+ const CardContext = /*#__PURE__*/createContext({
3
+ orientation: 'vertical',
4
+ isLoading: false,
5
+ variant: 'light'
6
+ });
4
7
  function CardContextProvider({
5
- orientation,
8
+ orientation = 'vertical',
6
9
  children,
7
- isLoading,
8
- variant
10
+ isLoading = false,
11
+ variant = 'light'
9
12
  }) {
10
13
  return /*#__PURE__*/React.createElement(CardContext.Provider, {
11
14
  value: {
@@ -15,22 +18,6 @@ function CardContextProvider({
15
18
  }
16
19
  }, children);
17
20
  }
18
- CardContextProvider.propTypes = {
19
- /** Specifies which orientation to use. */
20
- orientation: PropTypes.oneOf(['horizontal', 'vertical']),
21
- /** Specifies loading state. */
22
- isLoading: PropTypes.bool,
23
- /** Specifies content of the component. */
24
- children: PropTypes.node,
25
- /** Specifies `Card` style variant */
26
- variant: PropTypes.oneOf(['light', 'dark', 'muted'])
27
- };
28
- CardContextProvider.defaultProps = {
29
- orientation: 'vertical',
30
- isLoading: false,
31
- children: null,
32
- variant: 'light'
33
- };
34
21
  export { CardContextProvider };
35
22
  export default CardContext;
36
23
  //# sourceMappingURL=CardContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardContext.js","names":["React","createContext","PropTypes","CardContext","CardContextProvider","orientation","children","isLoading","variant","createElement","Provider","value","propTypes","oneOf","bool","node","defaultProps"],"sources":["../../src/Card/CardContext.jsx"],"sourcesContent":["import React, { createContext } from 'react';\nimport PropTypes from 'prop-types';\n\nconst CardContext = createContext({});\n\nfunction CardContextProvider({\n orientation,\n children,\n isLoading,\n variant,\n}) {\n return (\n <CardContext.Provider value={{ orientation, isLoading, variant }}>\n {children}\n </CardContext.Provider>\n );\n}\n\nCardContextProvider.propTypes = {\n /** Specifies which orientation to use. */\n orientation: PropTypes.oneOf(['horizontal', 'vertical']),\n /** Specifies loading state. */\n isLoading: PropTypes.bool,\n /** Specifies content of the component. */\n children: PropTypes.node,\n /** Specifies `Card` style variant */\n variant: PropTypes.oneOf(['light', 'dark', 'muted']),\n};\n\nCardContextProvider.defaultProps = {\n orientation: 'vertical',\n isLoading: false,\n children: null,\n variant: 'light',\n};\n\nexport { CardContextProvider };\nexport default CardContext;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,WAAW,gBAAGF,aAAa,CAAC,CAAC,CAAC,CAAC;AAErC,SAASG,mBAAmBA,CAAC;EAC3BC,WAAW;EACXC,QAAQ;EACRC,SAAS;EACTC;AACF,CAAC,EAAE;EACD,oBACER,KAAA,CAAAS,aAAA,CAACN,WAAW,CAACO,QAAQ;IAACC,KAAK,EAAE;MAAEN,WAAW;MAAEE,SAAS;MAAEC;IAAQ;EAAE,GAC9DF,QACmB,CAAC;AAE3B;AAEAF,mBAAmB,CAACQ,SAAS,GAAG;EAC9B;EACAP,WAAW,EAAEH,SAAS,CAACW,KAAK,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;EACxD;EACAN,SAAS,EAAEL,SAAS,CAACY,IAAI;EACzB;EACAR,QAAQ,EAAEJ,SAAS,CAACa,IAAI;EACxB;EACAP,OAAO,EAAEN,SAAS,CAACW,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;AACrD,CAAC;AAEDT,mBAAmB,CAACY,YAAY,GAAG;EACjCX,WAAW,EAAE,UAAU;EACvBE,SAAS,EAAE,KAAK;EAChBD,QAAQ,EAAE,IAAI;EACdE,OAAO,EAAE;AACX,CAAC;AAED,SAASJ,mBAAmB;AAC5B,eAAeD,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"CardContext.js","names":["React","createContext","CardContext","orientation","isLoading","variant","CardContextProvider","children","createElement","Provider","value"],"sources":["../../src/Card/CardContext.tsx"],"sourcesContent":["import React, { createContext, ReactNode } from 'react';\n\ninterface CardContextData {\n /** Specifies which orientation to use. */\n orientation: 'horizontal' | 'vertical';\n /** Specifies loading state. */\n isLoading: boolean;\n /** Specifies `Card` style variant */\n variant: 'light' | 'dark' | 'muted';\n}\n\nconst CardContext = createContext<CardContextData>({\n orientation: 'vertical',\n isLoading: false,\n variant: 'light',\n});\n\ninterface CardContextProviderProps extends Partial<CardContextData> {\n /** Specifies content of the component. */\n children?: ReactNode;\n}\n\nfunction CardContextProvider({\n orientation = 'vertical',\n children,\n isLoading = false,\n variant = 'light',\n}: CardContextProviderProps) {\n return (\n <CardContext.Provider value={{ orientation, isLoading, variant }}>\n {children}\n </CardContext.Provider>\n );\n}\n\nexport { CardContextProvider };\nexport default CardContext;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAmB,OAAO;AAWvD,MAAMC,WAAW,gBAAGD,aAAa,CAAkB;EACjDE,WAAW,EAAE,UAAU;EACvBC,SAAS,EAAE,KAAK;EAChBC,OAAO,EAAE;AACX,CAAC,CAAC;AAOF,SAASC,mBAAmBA,CAAC;EAC3BH,WAAW,GAAG,UAAU;EACxBI,QAAQ;EACRH,SAAS,GAAG,KAAK;EACjBC,OAAO,GAAG;AACc,CAAC,EAAE;EAC3B,oBACEL,KAAA,CAAAQ,aAAA,CAACN,WAAW,CAACO,QAAQ;IAACC,KAAK,EAAE;MAAEP,WAAW;MAAEC,SAAS;MAAEC;IAAQ;EAAE,GAC9DE,QACmB,CAAC;AAE3B;AAEA,SAASD,mBAAmB;AAC5B,eAAeJ,WAAW","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface CardDividerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** Specifies class name to append to the base element. */
4
+ className?: string;
5
+ }
6
+ declare const CardDivider: React.ForwardRefExoticComponent<CardDividerProps & React.RefAttributes<HTMLDivElement>>;
7
+ export default CardDivider;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { forwardRef } from 'react';
3
2
  import classNames from 'classnames';
4
- const CardDivider = /*#__PURE__*/React.forwardRef(({
3
+ const CardDivider = /*#__PURE__*/forwardRef(({
5
4
  className,
6
5
  ...props
7
6
  }, ref) => /*#__PURE__*/React.createElement("div", {
@@ -9,12 +8,5 @@ const CardDivider = /*#__PURE__*/React.forwardRef(({
9
8
  ref: ref,
10
9
  ...props
11
10
  }));
12
- CardDivider.propTypes = {
13
- /** Specifies class name to append to the base element. */
14
- className: PropTypes.string
15
- };
16
- CardDivider.defaultProps = {
17
- className: undefined
18
- };
19
11
  export default CardDivider;
20
12
  //# sourceMappingURL=CardDivider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardDivider.js","names":["React","PropTypes","classNames","CardDivider","forwardRef","className","props","ref","createElement","propTypes","string","defaultProps","undefined"],"sources":["../../src/Card/CardDivider.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nconst CardDivider = React.forwardRef(({ className, ...props }, ref) => (\n <div className={classNames('pgn__card-divider', className)} ref={ref} {...props} />\n));\n\nCardDivider.propTypes = {\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n};\n\nCardDivider.defaultProps = {\n className: undefined,\n};\n\nexport default CardDivider;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,MAAMC,WAAW,gBAAGH,KAAK,CAACI,UAAU,CAAC,CAAC;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBAChEP,KAAA,CAAAQ,aAAA;EAAKH,SAAS,EAAEH,UAAU,CAAC,mBAAmB,EAAEG,SAAS,CAAE;EAACE,GAAG,EAAEA,GAAI;EAAA,GAAKD;AAAK,CAAG,CACnF,CAAC;AAEFH,WAAW,CAACM,SAAS,GAAG;EACtB;EACAJ,SAAS,EAAEJ,SAAS,CAACS;AACvB,CAAC;AAEDP,WAAW,CAACQ,YAAY,GAAG;EACzBN,SAAS,EAAEO;AACb,CAAC;AAED,eAAeT,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"CardDivider.js","names":["React","forwardRef","classNames","CardDivider","className","props","ref","createElement"],"sources":["../../src/Card/CardDivider.tsx"],"sourcesContent":["import React, { forwardRef, ForwardedRef } from 'react';\nimport classNames from 'classnames';\n\ninterface CardDividerProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Specifies class name to append to the base element. */\n className?: string;\n}\n\nconst CardDivider = forwardRef(({ className, ...props }: CardDividerProps, ref: ForwardedRef<HTMLDivElement>) => (\n <div className={classNames('pgn__card-divider', className)} ref={ref} {...props} />\n));\n\nexport default CardDivider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAsB,OAAO;AACvD,OAAOC,UAAU,MAAM,YAAY;AAOnC,MAAMC,WAAW,gBAAGF,UAAU,CAAC,CAAC;EAAEG,SAAS;EAAE,GAAGC;AAAwB,CAAC,EAAEC,GAAiC,kBAC1GN,KAAA,CAAAO,aAAA;EAAKH,SAAS,EAAEF,UAAU,CAAC,mBAAmB,EAAEE,SAAS,CAAE;EAACE,GAAG,EAAEA,GAAI;EAAA,GAAKD;AAAK,CAAG,CACnF,CAAC;AAEF,eAAeF,WAAW","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const cardSrcFallbackImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAACMCAYAAAB/AhJnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH6SURBVHgB7dRBEYBADACxwuDf5j0QUXywiYhc7zk7APzd3gNAgvABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIp4BaNpp2Q/3/wfPkGyXOQAAAABJRU5ErkJggg==";
@@ -1 +1,2 @@
1
1
  export const cardSrcFallbackImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAACMCAYAAAB/AhJnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH6SURBVHgB7dRBEYBADACxwuDf5j0QUXywiYhc7zk7APzd3gNAgvABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIp4BaNpp2Q/3/wfPkGyXOQAAAABJRU5ErkJggg==';
2
+ //# sourceMappingURL=CardFallbackDefaultImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardFallbackDefaultImage.js","names":["cardSrcFallbackImg"],"sources":["../../src/Card/CardFallbackDefaultImage.ts"],"sourcesContent":["export const cardSrcFallbackImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAACMCAYAAAB/AhJnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH6SURBVHgB7dRBEYBADACxwuDf5j0QUXywiYhc7zk7APzd3gNAgvABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIp4BaNpp2Q/3/wfPkGyXOQAAAABJRU5ErkJggg==';\n"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,40BAA40B","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ interface CardGridProps {
3
+ /** The class name for the CardGrid component */
4
+ className?: string;
5
+ /** The Card components to organize into a responsive grid */
6
+ children: ReactNode;
7
+ /**
8
+ * An object containing the desired column size at each breakpoint, following a similar
9
+ * props API as ``react-bootstrap/Col``
10
+ */
11
+ columnSizes?: {
12
+ xs?: number;
13
+ sm?: number;
14
+ md?: number;
15
+ lg?: number;
16
+ xl?: number;
17
+ };
18
+ /** Whether to disable the default equal height cards across rows in the card grid */
19
+ hasEqualColumnHeights?: boolean;
20
+ }
21
+ declare function CardGrid({ className, children, columnSizes, hasEqualColumnHeights, }: CardGridProps): import("react/jsx-runtime").JSX.Element;
22
+ export default CardGrid;
@@ -1,13 +1,16 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
- import PropTypes from 'prop-types';
4
3
  import Row from 'react-bootstrap/Row';
5
4
  import Col from 'react-bootstrap/Col';
6
5
  function CardGrid({
7
6
  className,
8
7
  children,
9
- columnSizes,
10
- hasEqualColumnHeights
8
+ columnSizes = {
9
+ sm: 12,
10
+ lg: 6,
11
+ xl: 4
12
+ },
13
+ hasEqualColumnHeights = true
11
14
  }) {
12
15
  const cards = useMemo(() => React.Children.map(children, card => /*#__PURE__*/React.createElement(Col, {
13
16
  ...columnSizes,
@@ -19,33 +22,5 @@ function CardGrid({
19
22
  className: classNames('pgn__card-grid', className)
20
23
  }, /*#__PURE__*/React.createElement(Row, null, cards));
21
24
  }
22
- CardGrid.propTypes = {
23
- /** The class name for the CardGrid component */
24
- className: PropTypes.string,
25
- /** The Card components to organize into a responsive grid */
26
- children: PropTypes.node.isRequired,
27
- /**
28
- * An object containing the desired column size at each breakpoint, following a similar
29
- * props API as ``react-bootstrap/Col``
30
- */
31
- columnSizes: PropTypes.shape({
32
- xs: PropTypes.number,
33
- sm: PropTypes.number,
34
- md: PropTypes.number,
35
- lg: PropTypes.number,
36
- xl: PropTypes.number
37
- }),
38
- /** Whether to disable the default equal height cards across rows in the card grid */
39
- hasEqualColumnHeights: PropTypes.bool
40
- };
41
- CardGrid.defaultProps = {
42
- className: undefined,
43
- columnSizes: {
44
- sm: 12,
45
- lg: 6,
46
- xl: 4
47
- },
48
- hasEqualColumnHeights: true
49
- };
50
25
  export default CardGrid;
51
26
  //# sourceMappingURL=CardGrid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardGrid.js","names":["React","useMemo","classNames","PropTypes","Row","Col","CardGrid","className","children","columnSizes","hasEqualColumnHeights","cards","Children","map","card","createElement","propTypes","string","node","isRequired","shape","xs","number","sm","md","lg","xl","bool","defaultProps","undefined"],"sources":["../../src/Card/CardGrid.jsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport Row from 'react-bootstrap/Row';\nimport Col from 'react-bootstrap/Col';\n\nfunction CardGrid({\n className,\n children,\n columnSizes,\n hasEqualColumnHeights,\n}) {\n const cards = useMemo(\n () => React.Children.map(children, (card) => (\n <Col\n {...columnSizes}\n className={classNames(\n 'pgn__card-grid__card-item',\n {\n 'pgn__card__disable-equal-column-heights': !hasEqualColumnHeights,\n },\n )}\n >\n {card}\n </Col>\n )),\n [children, columnSizes, hasEqualColumnHeights],\n );\n\n return (\n <div className={classNames('pgn__card-grid', className)}>\n <Row>\n {cards}\n </Row>\n </div>\n );\n}\n\nCardGrid.propTypes = {\n /** The class name for the CardGrid component */\n className: PropTypes.string,\n /** The Card components to organize into a responsive grid */\n children: PropTypes.node.isRequired,\n /**\n * An object containing the desired column size at each breakpoint, following a similar\n * props API as ``react-bootstrap/Col``\n */\n columnSizes: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /** Whether to disable the default equal height cards across rows in the card grid */\n hasEqualColumnHeights: PropTypes.bool,\n};\n\nCardGrid.defaultProps = {\n className: undefined,\n columnSizes: {\n sm: 12,\n lg: 6,\n xl: 4,\n },\n hasEqualColumnHeights: true,\n};\n\nexport default CardGrid;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,GAAG,MAAM,qBAAqB;AACrC,OAAOC,GAAG,MAAM,qBAAqB;AAErC,SAASC,QAAQA,CAAC;EAChBC,SAAS;EACTC,QAAQ;EACRC,WAAW;EACXC;AACF,CAAC,EAAE;EACD,MAAMC,KAAK,GAAGV,OAAO,CACnB,MAAMD,KAAK,CAACY,QAAQ,CAACC,GAAG,CAACL,QAAQ,EAAGM,IAAI,iBACtCd,KAAA,CAAAe,aAAA,CAACV,GAAG;IAAA,GACEI,WAAW;IACfF,SAAS,EAAEL,UAAU,CACnB,2BAA2B,EAC3B;MACE,yCAAyC,EAAE,CAACQ;IAC9C,CACF;EAAE,GAEDI,IACE,CACN,CAAC,EACF,CAACN,QAAQ,EAAEC,WAAW,EAAEC,qBAAqB,CAC/C,CAAC;EAED,oBACEV,KAAA,CAAAe,aAAA;IAAKR,SAAS,EAAEL,UAAU,CAAC,gBAAgB,EAAEK,SAAS;EAAE,gBACtDP,KAAA,CAAAe,aAAA,CAACX,GAAG,QACDO,KACE,CACF,CAAC;AAEV;AAEAL,QAAQ,CAACU,SAAS,GAAG;EACnB;EACAT,SAAS,EAAEJ,SAAS,CAACc,MAAM;EAC3B;EACAT,QAAQ,EAAEL,SAAS,CAACe,IAAI,CAACC,UAAU;EACnC;AACF;AACA;AACA;EACEV,WAAW,EAAEN,SAAS,CAACiB,KAAK,CAAC;IAC3BC,EAAE,EAAElB,SAAS,CAACmB,MAAM;IACpBC,EAAE,EAAEpB,SAAS,CAACmB,MAAM;IACpBE,EAAE,EAAErB,SAAS,CAACmB,MAAM;IACpBG,EAAE,EAAEtB,SAAS,CAACmB,MAAM;IACpBI,EAAE,EAAEvB,SAAS,CAACmB;EAChB,CAAC,CAAC;EACF;EACAZ,qBAAqB,EAAEP,SAAS,CAACwB;AACnC,CAAC;AAEDrB,QAAQ,CAACsB,YAAY,GAAG;EACtBrB,SAAS,EAAEsB,SAAS;EACpBpB,WAAW,EAAE;IACXc,EAAE,EAAE,EAAE;IACNE,EAAE,EAAE,CAAC;IACLC,EAAE,EAAE;EACN,CAAC;EACDhB,qBAAqB,EAAE;AACzB,CAAC;AAED,eAAeJ,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"CardGrid.js","names":["React","useMemo","classNames","Row","Col","CardGrid","className","children","columnSizes","sm","lg","xl","hasEqualColumnHeights","cards","Children","map","card","createElement"],"sources":["../../src/Card/CardGrid.tsx"],"sourcesContent":["import React, { useMemo, ReactNode } from 'react';\nimport classNames from 'classnames';\nimport Row from 'react-bootstrap/Row';\nimport Col from 'react-bootstrap/Col';\n\ninterface CardGridProps {\n /** The class name for the CardGrid component */\n className?: string;\n /** The Card components to organize into a responsive grid */\n children: ReactNode;\n /**\n * An object containing the desired column size at each breakpoint, following a similar\n * props API as ``react-bootstrap/Col``\n */\n columnSizes?: {\n xs?: number;\n sm?: number;\n md?: number;\n lg?: number;\n xl?: number;\n };\n /** Whether to disable the default equal height cards across rows in the card grid */\n hasEqualColumnHeights?: boolean;\n}\n\nfunction CardGrid({\n className,\n children,\n columnSizes = {\n sm: 12,\n lg: 6,\n xl: 4,\n },\n hasEqualColumnHeights = true,\n}: CardGridProps) {\n const cards = useMemo(\n () => React.Children.map(children, (card) => (\n <Col\n {...columnSizes}\n className={classNames(\n 'pgn__card-grid__card-item',\n {\n 'pgn__card__disable-equal-column-heights': !hasEqualColumnHeights,\n },\n )}\n >\n {card}\n </Col>\n )),\n [children, columnSizes, hasEqualColumnHeights],\n );\n\n return (\n <div className={classNames('pgn__card-grid', className)}>\n <Row>\n {cards}\n </Row>\n </div>\n );\n}\n\nexport default CardGrid;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAmB,OAAO;AACjD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,GAAG,MAAM,qBAAqB;AACrC,OAAOC,GAAG,MAAM,qBAAqB;AAsBrC,SAASC,QAAQA,CAAC;EAChBC,SAAS;EACTC,QAAQ;EACRC,WAAW,GAAG;IACZC,EAAE,EAAE,EAAE;IACNC,EAAE,EAAE,CAAC;IACLC,EAAE,EAAE;EACN,CAAC;EACDC,qBAAqB,GAAG;AACX,CAAC,EAAE;EAChB,MAAMC,KAAK,GAAGZ,OAAO,CACnB,MAAMD,KAAK,CAACc,QAAQ,CAACC,GAAG,CAACR,QAAQ,EAAGS,IAAI,iBACtChB,KAAA,CAAAiB,aAAA,CAACb,GAAG;IAAA,GACEI,WAAW;IACfF,SAAS,EAAEJ,UAAU,CACnB,2BAA2B,EAC3B;MACE,yCAAyC,EAAE,CAACU;IAC9C,CACF;EAAE,GAEDI,IACE,CACN,CAAC,EACF,CAACT,QAAQ,EAAEC,WAAW,EAAEI,qBAAqB,CAC/C,CAAC;EAED,oBACEZ,KAAA,CAAAiB,aAAA;IAAKX,SAAS,EAAEJ,UAAU,CAAC,gBAAgB,EAAEI,SAAS;EAAE,gBACtDN,KAAA,CAAAiB,aAAA,CAACd,GAAG,QACDU,KACE,CACF,CAAC;AAEV;AAEA,eAAeR,QAAQ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
1
  export const STYLE_VARIANTS = {
3
2
  DARK: 'dark',
4
3
  LIGHT: 'light'
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["STYLE_VARIANTS","DARK","LIGHT"],"sources":["../../src/Chip/constants.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const STYLE_VARIANTS = {\n DARK: 'dark',\n LIGHT: 'light',\n} as const;\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,cAAc,GAAG;EAC5BC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAU","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["STYLE_VARIANTS","DARK","LIGHT"],"sources":["../../src/Chip/constants.ts"],"sourcesContent":["export const STYLE_VARIANTS = {\n DARK: 'dark',\n LIGHT: 'light',\n} as const;\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG;EAC5BC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAU","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* eslint-disable react/require-default-props */
2
1
  import React, { forwardRef } from 'react';
3
2
  import classNames from 'classnames';
4
3
  import RBContainer from 'react-bootstrap/Container';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","forwardRef","classNames","RBContainer","ContainerSizeClass","Container","size","children","as","bsPrefix","fluid","props","ref","createElement","className"],"sources":["../../src/Container/index.tsx"],"sourcesContent":["/* eslint-disable react/require-default-props */\nimport React, {\n ForwardedRef, ReactNode, ElementType, forwardRef,\n} from 'react';\nimport classNames from 'classnames';\nimport RBContainer, { type ContainerProps as RBContainerProps } from 'react-bootstrap/Container';\n\nimport type { ComponentWithAsProp } from '../utils/types/bootstrap';\n\nenum ContainerSizeClass {\n xs = 'container-mw-xs',\n sm = 'container-mw-sm',\n md = 'container-mw-md',\n lg = 'container-mw-lg',\n xl = 'container-mw-xl',\n}\n\nexport type ContainerSize = keyof typeof ContainerSizeClass;\n\ninterface ContainerProps extends RBContainerProps {\n /** Override the base element */\n as?: ElementType,\n /** Specifies the contents of the container */\n children: ReactNode,\n /** Fill all available space at any breakpoint */\n fluid?: boolean,\n /** Overrides underlying component base CSS class name */\n bsPrefix?: string,\n /** Set the maximum width for the container. Omiting the prop will remove the max-width */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n}\n\ntype ContainerType = ComponentWithAsProp<'div', ContainerProps>;\n\nconst Container: ContainerType = forwardRef(({\n size,\n children,\n as = 'div',\n bsPrefix = 'container',\n fluid = true,\n ...props\n}: ContainerProps, ref: ForwardedRef<Element>) => (\n <RBContainer\n {...props}\n as={as}\n bsPrefix={bsPrefix}\n fluid={fluid}\n ref={ref}\n className={classNames(\n props.className,\n size && ContainerSizeClass[size],\n )}\n >\n {children}\n </RBContainer>\n));\n\nexport default Container;\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAC4BC,UAAU,QAC3C,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAmD,2BAA2B;AAAC,IAI5FC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,EAAlBA,kBAAkB;AAyBvB,MAAMC,SAAwB,gBAAGJ,UAAU,CAAC,CAAC;EAC3CK,IAAI;EACJC,QAAQ;EACRC,EAAE,GAAG,KAAK;EACVC,QAAQ,GAAG,WAAW;EACtBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACW,CAAC,EAAEC,GAA0B,kBAC3CZ,KAAA,CAAAa,aAAA,CAACV,WAAW;EAAA,GACNQ,KAAK;EACTH,EAAE,EAAEA,EAAG;EACPC,QAAQ,EAAEA,QAAS;EACnBC,KAAK,EAAEA,KAAM;EACbE,GAAG,EAAEA,GAAI;EACTE,SAAS,EAAEZ,UAAU,CACnBS,KAAK,CAACG,SAAS,EACfR,IAAI,IAAIF,kBAAkB,CAACE,IAAI,CACjC;AAAE,GAEDC,QACU,CACd,CAAC;AAEF,eAAeF,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","forwardRef","classNames","RBContainer","ContainerSizeClass","Container","size","children","as","bsPrefix","fluid","props","ref","createElement","className"],"sources":["../../src/Container/index.tsx"],"sourcesContent":["import React, {\n ForwardedRef, ReactNode, ElementType, forwardRef,\n} from 'react';\nimport classNames from 'classnames';\nimport RBContainer, { type ContainerProps as RBContainerProps } from 'react-bootstrap/Container';\n\nimport type { ComponentWithAsProp } from '../utils/types/bootstrap';\n\nenum ContainerSizeClass {\n xs = 'container-mw-xs',\n sm = 'container-mw-sm',\n md = 'container-mw-md',\n lg = 'container-mw-lg',\n xl = 'container-mw-xl',\n}\n\nexport type ContainerSize = keyof typeof ContainerSizeClass;\n\ninterface ContainerProps extends RBContainerProps {\n /** Override the base element */\n as?: ElementType,\n /** Specifies the contents of the container */\n children: ReactNode,\n /** Fill all available space at any breakpoint */\n fluid?: boolean,\n /** Overrides underlying component base CSS class name */\n bsPrefix?: string,\n /** Set the maximum width for the container. Omiting the prop will remove the max-width */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n}\n\ntype ContainerType = ComponentWithAsProp<'div', ContainerProps>;\n\nconst Container: ContainerType = forwardRef(({\n size,\n children,\n as = 'div',\n bsPrefix = 'container',\n fluid = true,\n ...props\n}: ContainerProps, ref: ForwardedRef<Element>) => (\n <RBContainer\n {...props}\n as={as}\n bsPrefix={bsPrefix}\n fluid={fluid}\n ref={ref}\n className={classNames(\n props.className,\n size && ContainerSizeClass[size],\n )}\n >\n {children}\n </RBContainer>\n));\n\nexport default Container;\n"],"mappings":"AAAA,OAAOA,KAAK,IAC4BC,UAAU,QAC3C,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAmD,2BAA2B;AAAC,IAI5FC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,EAAlBA,kBAAkB;AAyBvB,MAAMC,SAAwB,gBAAGJ,UAAU,CAAC,CAAC;EAC3CK,IAAI;EACJC,QAAQ;EACRC,EAAE,GAAG,KAAK;EACVC,QAAQ,GAAG,WAAW;EACtBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACW,CAAC,EAAEC,GAA0B,kBAC3CZ,KAAA,CAAAa,aAAA,CAACV,WAAW;EAAA,GACNQ,KAAK;EACTH,EAAE,EAAEA,EAAG;EACPC,QAAQ,EAAEA,QAAS;EACnBC,KAAK,EAAEA,KAAM;EACbE,GAAG,EAAEA,GAAI;EACTE,SAAS,EAAEZ,UAAU,CACnBS,KAAK,CAACG,SAAS,EACfR,IAAI,IAAIF,kBAAkB,CAACE,IAAI,CACjC;AAAE,GAEDC,QACU,CACd,CAAC;AAEF,eAAeF,SAAS","ignoreList":[]}
@@ -47,7 +47,6 @@ function CollapsibleButtonGroup({
47
47
  return null;
48
48
  }
49
49
  const cloneAction = (action, index) => /*#__PURE__*/React.cloneElement(action.component, {
50
- // eslint-disable-next-line react/no-array-index-key
51
50
  key: `${action}${index}`,
52
51
  as: Button,
53
52
  // for backwards compatibility this is needed
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleButtonGroup.js","names":["React","useContext","useMemo","useState","PropTypes","MoreVert","useToggle","useWindowSize","DataTableContext","Icon","IconButton","breakpoints","ModalPopup","Stack","Button","ACTION_OVERFLOW_BUTTON_TEXT","SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT","CollapsibleButtonGroup","className","actions","rest","isOverflowMenuOpen","openOverflowMenu","closeOverflowMenu","overflowMenuTarget","setOverflowMenuTarget","controlledTableSelections","isEntireTableSelected","selectedFlatRows","rows","width","selectedRows","visibleActions","dropdownActions","small","minWidth","firstTwoActions","splice","extraActions","slice","reverse","cloneAction","action","index","cloneElement","component","key","as","args","createElement","length","Fragment","variant","iconAs","src","alt","id","ref","onClick","positionRef","onClose","placement","isOpen","gap","map","defaultProps","propTypes","string","arrayOf","shape","oneOfType","element","elementType","isRequired"],"sources":["../../src/DataTable/CollapsibleButtonGroup.jsx"],"sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MoreVert } from '../../icons';\nimport useToggle from '../hooks/useToggleHook';\nimport useWindowSize from '../hooks/useWindowSizeHook';\nimport DataTableContext from './DataTableContext';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\nimport breakpoints from '../utils/breakpoints';\nimport ModalPopup from '../Modal/ModalPopup';\nimport Stack from '../Stack';\nimport Button from '../Button';\n\nexport const ACTION_OVERFLOW_BUTTON_TEXT = 'More actions';\nexport const SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT = 'Actions';\n\nfunction CollapsibleButtonGroup({\n className,\n actions,\n ...rest\n}) {\n const [isOverflowMenuOpen, openOverflowMenu, closeOverflowMenu] = useToggle(false);\n const [overflowMenuTarget, setOverflowMenuTarget] = useState(null);\n const {\n controlledTableSelections: [{ isEntireTableSelected }],\n selectedFlatRows,\n rows,\n } = useContext(DataTableContext);\n const { width } = useWindowSize();\n const selectedRows = selectedFlatRows || rows;\n\n const [visibleActions, dropdownActions] = useMemo(() => {\n if (width < breakpoints.small.minWidth) {\n // On a small screen, all actions will be in the overflow menu\n return [[], [...actions]];\n }\n // The first two actions will be displayed as buttons, the rest will go in an overflow menu\n const firstTwoActions = [...actions].splice(0, 2);\n const extraActions = [...actions].slice(2);\n\n /* Reversing the array because to the user it makes sense to put the primary button first,\n but we want it on the right */\n return [firstTwoActions.reverse(), extraActions];\n }, [actions, width]);\n\n if (!isEntireTableSelected && !selectedRows) {\n return null;\n }\n\n const cloneAction = (action, index) => React.cloneElement(\n action.component,\n {\n // eslint-disable-next-line react/no-array-index-key\n key: `${action}${index}`,\n as: Button, // for backwards compatibility this is needed\n ...action.args,\n },\n );\n\n return (\n <div className={className} {...rest}>\n {dropdownActions.length > 0 && (\n <>\n <IconButton\n variant=\"secondary\"\n iconAs={Icon}\n src={MoreVert}\n alt={width > breakpoints.small.minWidth\n ? ACTION_OVERFLOW_BUTTON_TEXT : SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT}\n id=\"actions-dropdown\"\n ref={setOverflowMenuTarget}\n onClick={openOverflowMenu}\n />\n <ModalPopup\n positionRef={overflowMenuTarget}\n onClose={closeOverflowMenu}\n placement=\"bottom-end\"\n isOpen={isOverflowMenuOpen}\n >\n <div className=\"pgn__data-table__overflow-actions-menu\">\n <Stack gap={2}>\n {dropdownActions.map(cloneAction)}\n </Stack>\n </div>\n </ModalPopup>\n </>\n )}\n <div className=\"pgn__data-table__visible-actions\">\n {visibleActions.map(cloneAction)}\n </div>\n </div>\n );\n}\n\nCollapsibleButtonGroup.defaultProps = {\n className: null,\n};\n\nCollapsibleButtonGroup.propTypes = {\n /** Class names for the div wrapping the button components */\n className: PropTypes.string,\n /** Array of action objects, containing a component and their callback args */\n actions: PropTypes.arrayOf(PropTypes.shape({\n component: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]).isRequired,\n args: PropTypes.shape({}),\n })).isRequired,\n};\n\nexport default CollapsibleButtonGroup;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,2BAA2B,GAAG,cAAc;AACzD,OAAO,MAAMC,wCAAwC,GAAG,SAAS;AAEjE,SAASC,sBAAsBA,CAAC;EAC9BC,SAAS;EACTC,OAAO;EACP,GAAGC;AACL,CAAC,EAAE;EACD,MAAM,CAACC,kBAAkB,EAAEC,gBAAgB,EAAEC,iBAAiB,CAAC,GAAGjB,SAAS,CA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SAAS,CAACmE,OAAO,EAAEnE,SAAS,CAACoE,WAAW,CAAC,CAAC,CAACC,UAAU;IACrFzB,IAAI,EAAE5C,SAAS,CAACiE,KAAK,CAAC,CAAC,CAAC;EAC1B,CAAC,CAAC,CAAC,CAACI;AACN,CAAC;AAED,eAAexD,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"CollapsibleButtonGroup.js","names":["React","useContext","useMemo","useState","PropTypes","MoreVert","useToggle","useWindowSize","DataTableContext","Icon","IconButton","breakpoints","ModalPopup","Stack","Button","ACTION_OVERFLOW_BUTTON_TEXT","SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT","CollapsibleButtonGroup","className","actions","rest","isOverflowMenuOpen","openOverflowMenu","closeOverflowMenu","overflowMenuTarget","setOverflowMenuTarget","controlledTableSelections","isEntireTableSelected","selectedFlatRows","rows","width","selectedRows","visibleActions","dropdownActions","small","minWidth","firstTwoActions","splice","extraActions","slice","reverse","cloneAction","action","index","cloneElement","component","key","as","args","createElement","length","Fragment","variant","iconAs","src","alt","id","ref","onClick","positionRef","onClose","placement","isOpen","gap","map","defaultProps","propTypes","string","arrayOf","shape","oneOfType","element","elementType","isRequired"],"sources":["../../src/DataTable/CollapsibleButtonGroup.jsx"],"sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MoreVert } from '../../icons';\nimport useToggle from '../hooks/useToggleHook';\nimport useWindowSize from '../hooks/useWindowSizeHook';\nimport DataTableContext from './DataTableContext';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\nimport breakpoints from '../utils/breakpoints';\nimport ModalPopup from '../Modal/ModalPopup';\nimport Stack from '../Stack';\nimport Button from '../Button';\n\nexport const ACTION_OVERFLOW_BUTTON_TEXT = 'More actions';\nexport const SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT = 'Actions';\n\nfunction CollapsibleButtonGroup({\n className,\n actions,\n ...rest\n}) {\n const [isOverflowMenuOpen, openOverflowMenu, closeOverflowMenu] = useToggle(false);\n const [overflowMenuTarget, setOverflowMenuTarget] = useState(null);\n const {\n controlledTableSelections: [{ isEntireTableSelected }],\n selectedFlatRows,\n rows,\n } = useContext(DataTableContext);\n const { width } = useWindowSize();\n const selectedRows = selectedFlatRows || rows;\n\n const [visibleActions, dropdownActions] = useMemo(() => {\n if (width < breakpoints.small.minWidth) {\n // On a small screen, all actions will be in the overflow menu\n return [[], [...actions]];\n }\n // The first two actions will be displayed as buttons, the rest will go in an overflow menu\n const firstTwoActions = [...actions].splice(0, 2);\n const extraActions = [...actions].slice(2);\n\n /* Reversing the array because to the user it makes sense to put the primary button first,\n but we want it on the right */\n return [firstTwoActions.reverse(), extraActions];\n }, [actions, width]);\n\n if (!isEntireTableSelected && !selectedRows) {\n return null;\n }\n\n const cloneAction = (action, index) => React.cloneElement(\n action.component,\n {\n key: `${action}${index}`,\n as: Button, // for backwards compatibility this is needed\n ...action.args,\n },\n );\n\n return (\n <div className={className} {...rest}>\n {dropdownActions.length > 0 && (\n <>\n <IconButton\n variant=\"secondary\"\n iconAs={Icon}\n src={MoreVert}\n alt={width > breakpoints.small.minWidth\n ? ACTION_OVERFLOW_BUTTON_TEXT : SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT}\n id=\"actions-dropdown\"\n ref={setOverflowMenuTarget}\n onClick={openOverflowMenu}\n />\n <ModalPopup\n positionRef={overflowMenuTarget}\n onClose={closeOverflowMenu}\n placement=\"bottom-end\"\n isOpen={isOverflowMenuOpen}\n >\n <div className=\"pgn__data-table__overflow-actions-menu\">\n <Stack gap={2}>\n {dropdownActions.map(cloneAction)}\n </Stack>\n </div>\n </ModalPopup>\n </>\n )}\n <div className=\"pgn__data-table__visible-actions\">\n {visibleActions.map(cloneAction)}\n </div>\n </div>\n );\n}\n\nCollapsibleButtonGroup.defaultProps = {\n className: null,\n};\n\nCollapsibleButtonGroup.propTypes = {\n /** Class names for the div wrapping the button components */\n className: PropTypes.string,\n /** Array of action objects, containing a component and their callback args */\n actions: PropTypes.arrayOf(PropTypes.shape({\n component: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]).isRequired,\n args: PropTypes.shape({}),\n })).isRequired,\n};\n\nexport default CollapsibleButtonGroup;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,2BAA2B,GAAG,cAAc;AACzD,OAAO,MAAMC,wCAAwC,GAAG,SAAS;AAEjE,SAASC,sBAAsBA,CAAC;EAC9BC,SAAS;EACTC,OAAO;EACP,GAAGC;AACL,CAAC,EAAE;EACD,MAAM,CAACC,kBAAkB,EAAEC,gBAAgB,EAAEC,iBAAiB,CAAC,GAAGjB,SAAS,CAAC,KAAK,CAAC;EAClF,MAAM,CAACkB,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGtB,QAAQ,CAAC,IAAI,CAAC;EAClE,MAAM;IACJuB,yBAAyB,EAAE,CAAC;MAAEC;IAAsB,CAAC,CAAC;IACtDC,gBAAgB;IAChBC;EACF,CAAC,GAAG5B,UAAU,CAACO,gBAAgB,CAAC;EAChC,MAAM;IAAEsB;EAAM,CAAC,GAAGvB,aAAa,CAAC,CAAC;EACjC,MAAMwB,YAAY,GAAGH,gBAAgB,IAAIC,IAAI;EAE7C,MAAM,CAACG,cAAc,EAAEC,eAAe,CAAC,GA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kB;IACrBC,GAAG,EAAEhC,qBAAsB;IAC3BiC,OAAO,EAAEpC;EAAiB,CAC3B,CAAC,eACFtB,KAAA,CAAAiD,aAAA,CAACrC,UAAU;IACT+C,WAAW,EAAEnC,kBAAmB;IAChCoC,OAAO,EAAErC,iBAAkB;IAC3BsC,SAAS,EAAC,YAAY;IACtBC,MAAM,EAAEzC;EAAmB,gBAE3BrB,KAAA,CAAAiD,aAAA;IAAK/B,SAAS,EAAC;EAAwC,gBACrDlB,KAAA,CAAAiD,aAAA,CAACpC,KAAK;IAACkD,GAAG,EAAE;EAAE,GACX9B,eAAe,CAAC+B,GAAG,CAACvB,WAAW,CAC3B,CACJ,CACK,CACZ,CACH,eACDzC,KAAA,CAAAiD,aAAA;IAAK/B,SAAS,EAAC;EAAkC,GAC9Cc,cAAc,CAACgC,GAAG,CAACvB,WAAW,CAC5B,CACF,CAAC;AAEV;AAEAxB,sBAAsB,CAACgD,YAAY,GAAG;EACpC/C,SAAS,EAAE;AACb,CAAC;AAEDD,sBAAsB,CAACiD,SAAS,GAAG;EACjC;EACAhD,SAAS,EAAEd,SAAS,CAAC+D,MAAM;EAC3B;EACAhD,OAAO,EAAEf,SAAS,CAACgE,OAAO,CAAChE,SAAS,CAACiE,KAAK,CAAC;IACzCxB,SAAS,EAAEzC,SAAS,CAACkE,SAAS,CAAC,CAAClE,SAAS,CAACmE,OAAO,EAAEnE,SAAS,CAACoE,WAAW,CAAC,CAAC,CAACC,UAAU;IACrFzB,IAAI,EAAE5C,SAAS,CAACiE,KAAK,CAAC,CAAC,CAAC;EAC1B,CAAC,CAAC,CAAC,CAACI;AACN,CAAC;AAED,eAAexD,sBAAsB","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const DataTableContext: import("react").Context<{}>;
3
+ export default DataTableContext;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableContext.js","names":["createContext","DataTableContext"],"sources":["../../src/DataTable/DataTableContext.jsx"],"sourcesContent":["import { createContext } from 'react';\n\nconst DataTableContext = createContext({});\n\nexport default DataTableContext;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,MAAMC,gBAAgB,gBAAGD,aAAa,CAAC,CAAC,CAAC,CAAC;AAE1C,eAAeC,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"DataTableContext.js","names":["createContext","DataTableContext"],"sources":["../../src/DataTable/DataTableContext.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nconst DataTableContext = createContext({});\n\nexport default DataTableContext;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,MAAMC,gBAAgB,gBAAGD,aAAa,CAAC,CAAC,CAAC,CAAC;AAE1C,eAAeC,gBAAgB","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ import { ReactNode, TdHTMLAttributes } from 'react';
2
+ interface TableCellProps {
3
+ /** Props for the td element */
4
+ getCellProps: () => TdHTMLAttributes<HTMLTableCellElement>;
5
+ /** Function that renders the cell contents. Will be called with the string 'Cell' */
6
+ render: (type: 'Cell') => ReactNode;
7
+ /** Table column */
8
+ column: {
9
+ /** Class(es) to be applied to the cells in the given column */
10
+ cellClassName?: string;
11
+ };
12
+ }
13
+ declare function TableCell({ getCellProps, render, column }: TableCellProps): import("react/jsx-runtime").JSX.Element;
14
+ export default TableCell;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  function TableCell({
5
4
  getCellProps,
@@ -15,16 +14,5 @@ function TableCell({
15
14
  className: classNames('pgn__data-table-cell-wrap', className, column.cellClassName)
16
15
  }, render('Cell'));
17
16
  }
18
- TableCell.propTypes = {
19
- /** Props for the td element */
20
- getCellProps: PropTypes.func.isRequired,
21
- /** Function that renders the cell contents. Will be called with the string 'Cell' */
22
- render: PropTypes.func.isRequired,
23
- /** Table column */
24
- column: PropTypes.shape({
25
- /** Class(es) to be applied to the cells in the given column */
26
- cellClassName: PropTypes.string
27
- }).isRequired
28
- };
29
17
  export default TableCell;
30
18
  //# sourceMappingURL=TableCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","names":["React","PropTypes","classNames","TableCell","getCellProps","render","column","className","rest","createElement","cellClassName","propTypes","func","isRequired","shape","string"],"sources":["../../src/DataTable/TableCell.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nfunction TableCell({ getCellProps, render, column }) {\n const { className, ...rest } = getCellProps();\n return (\n <td {...rest} className={classNames('pgn__data-table-cell-wrap', className, column.cellClassName)}>\n {render('Cell')}\n </td>\n );\n}\n\nTableCell.propTypes = {\n /** Props for the td element */\n getCellProps: PropTypes.func.isRequired,\n /** Function that renders the cell contents. Will be called with the string 'Cell' */\n render: PropTypes.func.isRequired,\n /** Table column */\n column: PropTypes.shape({\n /** Class(es) to be applied to the cells in the given column */\n cellClassName: PropTypes.string,\n }).isRequired,\n};\n\nexport default TableCell;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,SAASA,CAAC;EAAEC,YAAY;EAAEC,MAAM;EAAEC;AAAO,CAAC,EAAE;EACnD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAK,CAAC,GAAGJ,YAAY,CAAC,CAAC;EAC7C,oBACEJ,KAAA,CAAAS,aAAA;IAAA,GAAQD,IAAI;IAAED,SAAS,EAAEL,UAAU,CAAC,2BAA2B,EAAEK,SAAS,EAAED,MAAM,CAACI,aAAa;EAAE,GAC/FL,MAAM,CAAC,MAAM,CACZ,CAAC;AAET;AAEAF,SAAS,CAACQ,SAAS,GAAG;EACpB;EACAP,YAAY,EAAEH,SAAS,CAACW,IAAI,CAACC,UAAU;EACvC;EACAR,MAAM,EAAEJ,SAAS,CAACW,IAAI,CAACC,UAAU;EACjC;EACAP,MAAM,EAAEL,SAAS,CAACa,KAAK,CAAC;IACtB;IACAJ,aAAa,EAAET,SAAS,CAACc;EAC3B,CAAC,CAAC,CAACF;AACL,CAAC;AAED,eAAeV,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"TableCell.js","names":["React","classNames","TableCell","getCellProps","render","column","className","rest","createElement","cellClassName"],"sources":["../../src/DataTable/TableCell.tsx"],"sourcesContent":["import React, { ReactNode, TdHTMLAttributes } from 'react';\nimport classNames from 'classnames';\n\ninterface TableCellProps {\n /** Props for the td element */\n getCellProps: () => TdHTMLAttributes<HTMLTableCellElement>;\n /** Function that renders the cell contents. Will be called with the string 'Cell' */\n render: (type: 'Cell') => ReactNode;\n /** Table column */\n column: {\n /** Class(es) to be applied to the cells in the given column */\n cellClassName?: string;\n };\n}\nfunction TableCell({ getCellProps, render, column }: TableCellProps) {\n const { className, ...rest } = getCellProps();\n return (\n <td {...rest} className={classNames('pgn__data-table-cell-wrap', className, column.cellClassName)}>\n {render('Cell')}\n </td>\n );\n}\n\nexport default TableCell;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAuC,OAAO;AAC1D,OAAOC,UAAU,MAAM,YAAY;AAanC,SAASC,SAASA,CAAC;EAAEC,YAAY;EAAEC,MAAM;EAAEC;AAAuB,CAAC,EAAE;EACnE,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAK,CAAC,GAAGJ,YAAY,CAAC,CAAC;EAC7C,oBACEH,KAAA,CAAAQ,aAAA;IAAA,GAAQD,IAAI;IAAED,SAAS,EAAEL,UAAU,CAAC,2BAA2B,EAAEK,SAAS,EAAED,MAAM,CAACI,aAAa;EAAE,GAC/FL,MAAM,CAAC,MAAM,CACZ,CAAC;AAET;AAEA,eAAeF,SAAS","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ interface SortIndicatorProps {
3
+ /** Indicates whether or not a column is sorted */
4
+ isSorted: boolean;
5
+ /** Indicates whether the column is sorted in descending order */
6
+ isSortedDesc: boolean;
7
+ }
8
+ export declare function SortIndicator({ isSorted, isSortedDesc }: SortIndicatorProps): import("react/jsx-runtime").JSX.Element;
9
+ interface TableHeaderCellProps {
10
+ /** Returns props for the th element */
11
+ getHeaderProps: (...args: any[]) => Record<string, any>;
12
+ /** Indicates whether or not a column is sorted */
13
+ isSorted?: boolean;
14
+ /** Renders the header content. Passed the string 'Header' */
15
+ render: (type: 'Header') => React.ReactNode;
16
+ /** Indicates whether the column is sorted in descending order */
17
+ isSortedDesc?: boolean;
18
+ /** Gets props related to sorting that will be passed to th */
19
+ getSortByToggleProps?: (...args: any[]) => Record<string, any>;
20
+ /** Indicates whether a column is sortable */
21
+ canSort?: boolean;
22
+ /** Class(es) to be applied to header cells */
23
+ headerClassName?: string;
24
+ }
25
+ declare function TableHeaderCell({ getHeaderProps, render, canSort, getSortByToggleProps, isSorted, isSortedDesc, headerClassName, }: TableHeaderCellProps): import("react/jsx-runtime").JSX.Element;
26
+ export default TableHeaderCell;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classNames from 'classnames';
4
3
  import Icon from '../Icon';
5
4
  import { ArrowDropDown, ArrowDropUp, ArrowDropUpDown } from '../../icons';
@@ -27,17 +26,13 @@ export function SortIndicator({
27
26
  "data-testid": "arrow-drop-up"
28
27
  });
29
28
  }
30
- SortIndicator.propTypes = {
31
- isSorted: PropTypes.bool.isRequired,
32
- isSortedDesc: PropTypes.bool.isRequired
33
- };
34
29
  function TableHeaderCell({
35
30
  getHeaderProps,
36
31
  render,
37
- canSort,
38
- getSortByToggleProps,
39
- isSorted,
40
- isSortedDesc,
32
+ canSort = false,
33
+ getSortByToggleProps = () => ({}),
34
+ isSorted = false,
35
+ isSortedDesc = false,
41
36
  headerClassName
42
37
  }) {
43
38
  const toggleProps = canSort && getSortByToggleProps ? getSortByToggleProps() : {};
@@ -50,28 +45,5 @@ function TableHeaderCell({
50
45
  isSortedDesc: isSortedDesc || false
51
46
  })));
52
47
  }
53
- TableHeaderCell.defaultProps = {
54
- headerClassName: null,
55
- isSorted: false,
56
- isSortedDesc: false,
57
- canSort: false,
58
- getSortByToggleProps: () => {}
59
- };
60
- TableHeaderCell.propTypes = {
61
- /** Returns props for the th element */
62
- getHeaderProps: PropTypes.func.isRequired,
63
- /** Indicates whether or not a column is sorted */
64
- isSorted: PropTypes.bool,
65
- /** Renders the header content. Passed the string 'Header' */
66
- render: PropTypes.func.isRequired,
67
- /** Indicates whether the column is sorted in descending order */
68
- isSortedDesc: PropTypes.bool,
69
- /** Gets props related to sorting that will be passed to th */
70
- getSortByToggleProps: PropTypes.func,
71
- /** Indicates whether a column is sortable */
72
- canSort: PropTypes.bool,
73
- /** Class(es) to be applied to header cells */
74
- headerClassName: PropTypes.string
75
- };
76
48
  export default TableHeaderCell;
77
49
  //# sourceMappingURL=TableHeaderCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderCell.js","names":["React","PropTypes","classNames","Icon","ArrowDropDown","ArrowDropUp","ArrowDropUpDown","SortIndicator","isSorted","isSortedDesc","createElement","style","opacity","src","propTypes","bool","isRequired","TableHeaderCell","getHeaderProps","render","canSort","getSortByToggleProps","headerClassName","toggleProps","className","defaultProps","func","string"],"sources":["../../src/DataTable/TableHeaderCell.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from '../Icon';\nimport { ArrowDropDown, ArrowDropUp, ArrowDropUpDown } from '../../icons';\n\nexport function SortIndicator({ isSorted, isSortedDesc }) {\n if (!isSorted) {\n return <Icon style={{ opacity: 0.5 }} src={ArrowDropUpDown} data-testid=\"arrow-drop-up-down\" />;\n }\n\n if (isSortedDesc) {\n return <Icon src={ArrowDropDown} data-testid=\"arrow-drop-down\" />;\n }\n\n return <Icon src={ArrowDropUp} data-testid=\"arrow-drop-up\" />;\n}\n\nSortIndicator.propTypes = {\n isSorted: PropTypes.bool.isRequired,\n isSortedDesc: PropTypes.bool.isRequired,\n};\n\nfunction TableHeaderCell({\n getHeaderProps, render, canSort, getSortByToggleProps, isSorted, isSortedDesc, headerClassName,\n}) {\n const toggleProps = canSort && getSortByToggleProps ? getSortByToggleProps() : {};\n\n return (\n <th {...getHeaderProps(toggleProps)}>\n <span className={classNames('d-flex align-items-center', headerClassName)}>\n <span>{render('Header')}</span>\n {canSort && <SortIndicator isSorted={isSorted} isSortedDesc={isSortedDesc || false} />}\n </span>\n </th>\n );\n}\n\nTableHeaderCell.defaultProps = {\n headerClassName: null,\n isSorted: false,\n isSortedDesc: false,\n canSort: false,\n getSortByToggleProps: () => {},\n};\n\nTableHeaderCell.propTypes = {\n /** Returns props for the th element */\n getHeaderProps: PropTypes.func.isRequired,\n /** Indicates whether or not a column is sorted */\n isSorted: PropTypes.bool,\n /** Renders the header content. Passed the string 'Header' */\n render: PropTypes.func.isRequired,\n /** Indicates whether the column is sorted in descending order */\n isSortedDesc: PropTypes.bool,\n /** Gets props related to sorting that will be passed to th */\n getSortByToggleProps: PropTypes.func,\n /** Indicates whether a column is sortable */\n canSort: PropTypes.bool,\n /** Class(es) to be applied to header cells */\n headerClassName: PropTypes.string,\n};\n\nexport default TableHeaderCell;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,aAAa,EAAEC,WAAW,EAAEC,eAAe,QAAQ,aAAa;AAEzE,OAAO,SAASC,aAAaA,CAAC;EAAEC,QAAQ;EAAEC;AAAa,CAAC,EAAE;EACxD,IAAI,CAACD,QAAQ,EAAE;IACb,oBAAOR,KAAA,CAAAU,aAAA,CAACP,IAAI;MAACQ,KAAK,EAAE;QAAEC,OAAO,EAAE;MAAI,CAAE;MAACC,GAAG,EAAEP,eAAgB;MAAC,eAAY;IAAoB,CAAE,CAAC;EACjG;EAEA,IAAIG,YAAY,EAAE;IAChB,oBAAOT,KAAA,CAAAU,aAAA,CAACP,IAAI;MA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AAI;EACxB;EACAI,MAAM,EAAElB,SAAS,CAACyB,IAAI,CAACV,UAAU;EACjC;EACAP,YAAY,EAAER,SAAS,CAACc,IAAI;EAC5B;EACAM,oBAAoB,EAAEpB,SAAS,CAACyB,IAAI;EACpC;EACAN,OAAO,EAAEnB,SAAS,CAACc,IAAI;EACvB;EACAO,eAAe,EAAErB,SAAS,CAAC0B;AAC7B,CAAC;AAED,eAAeV,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"TableHeaderCell.js","names":["React","classNames","Icon","ArrowDropDown","ArrowDropUp","ArrowDropUpDown","SortIndicator","isSorted","isSortedDesc","createElement","style","opacity","src","TableHeaderCell","getHeaderProps","render","canSort","getSortByToggleProps","headerClassName","toggleProps","className"],"sources":["../../src/DataTable/TableHeaderCell.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport Icon from '../Icon';\nimport { ArrowDropDown, ArrowDropUp, ArrowDropUpDown } from '../../icons';\n\ninterface SortIndicatorProps {\n /** Indicates whether or not a column is sorted */\n isSorted: boolean;\n /** Indicates whether the column is sorted in descending order */\n isSortedDesc: boolean;\n}\n\nexport function SortIndicator({ isSorted, isSortedDesc }: SortIndicatorProps) {\n if (!isSorted) {\n return <Icon style={{ opacity: 0.5 }} src={ArrowDropUpDown} data-testid=\"arrow-drop-up-down\" />;\n }\n\n if (isSortedDesc) {\n return <Icon src={ArrowDropDown} data-testid=\"arrow-drop-down\" />;\n }\n\n return <Icon src={ArrowDropUp} data-testid=\"arrow-drop-up\" />;\n}\n\ninterface TableHeaderCellProps {\n /** Returns props for the th element */\n getHeaderProps: (...args: any[]) => Record<string, any>;\n /** Indicates whether or not a column is sorted */\n isSorted?: boolean;\n /** Renders the header content. Passed the string 'Header' */\n render: (type: 'Header') => React.ReactNode;\n /** Indicates whether the column is sorted in descending order */\n isSortedDesc?: boolean;\n /** Gets props related to sorting that will be passed to th */\n getSortByToggleProps?: (...args: any[]) => Record<string, any>;\n /** Indicates whether a column is sortable */\n canSort?: boolean;\n /** Class(es) to be applied to header cells */\n headerClassName?: string;\n}\n\nfunction TableHeaderCell({\n getHeaderProps,\n render,\n canSort = false,\n getSortByToggleProps = () => ({}),\n isSorted = false,\n isSortedDesc = false,\n headerClassName,\n}: TableHeaderCellProps) {\n const toggleProps = canSort && getSortByToggleProps ? getSortByToggleProps() : {};\n\n return (\n <th {...getHeaderProps(toggleProps)}>\n <span className={classNames('d-flex align-items-center', headerClassName)}>\n <span>{render('Header')}</span>\n {canSort && <SortIndicator isSorted={isSorted} isSortedDesc={isSortedDesc || false} />}\n </span>\n </th>\n );\n}\n\nexport default TableHeaderCell;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,aAAa,EAAEC,WAAW,EAAEC,eAAe,QAAQ,aAAa;AASzE,OAAO,SAASC,aAAaA,CAAC;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,EAAE;EAC5E,IAAI,CAACD,QAAQ,EAAE;IACb,oBAAOP,KAAA,CAAAS,aAAA,CAACP,IAAI;MAACQ,KAAK,EAAE;QAAEC,OAAO,EAAE;MAAI,CAAE;MAACC,GAAG,EAAEP,eAAgB;MAAC,eAAY;IAAoB,CAAE,CAAC;EACjG;EAEA,IAAIG,YAAY,EAAE;IAChB,oBAAOR,KAAA,CAAAS,aAAA,CAACP,IAAI;MAACU,GAAG,EAAET,aAAc;MAAC,eAAY;IAAiB,CAAE,CAAC;EACnE;EAEA,oBAAOH,KAAA,CAAAS,aAAA,CAACP,IAAI;IAACU,GAAG,EAAER,WAAY;IAAC,eAAY;EAAe,CAAE,CAAC;AAC/D;AAmBA,SAASS,eAAeA,CAAC;EACvBC,cAAc;EACdC,MAAM;EACNC,OAAO,GAAG,KAAK;EACfC,oBAAoB,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;EACjCV,QAAQ,GAAG,KAAK;EAChBC,YAAY,GAAG,KAAK;EACpBU;AACoB,CAAC,EAAE;EACvB,MAAMC,WAAW,GAAGH,OAAO,IAAIC,oBAAoB,GAAGA,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC;EAEjF,oBACEjB,KAAA,CAAAS,aAAA;IAAA,GAAQK,cAAc,CAACK,WAAW;EAAC,gBACjCnB,KAAA,CAAAS,aAAA;IAAMW,SAAS,EAAEnB,UAAU,CAAC,2BAA2B,EAAEiB,eAAe;EAAE,gBACxElB,KAAA,CAAAS,aAAA,eAAOM,MAAM,CAAC,QAAQ,CAAQ,CAAC,EAC9BC,OAAO,iBAAIhB,KAAA,CAAAS,aAAA,CAACH,aAAa;IAACC,QAAQ,EAAEA,QAAS;IAACC,YAAY,EAAEA,YAAY,IAAI;EAAM,CAAE,CACjF,CACJ,CAAC;AAET;AAEA,eAAeK,eAAe","ignoreList":[]}
@@ -40,7 +40,7 @@ function CheckboxFilter({
40
40
  value
41
41
  }) => /*#__PURE__*/React.createElement(Form.Checkbox, {
42
42
  key: `${headerBasedId}${name}`,
43
- value: name,
43
+ value: value,
44
44
  checked: checkedBoxes.includes(value),
45
45
  onChange: () => changeCheckbox(value),
46
46
  "aria-label": name
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header} value={checkedBoxes}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(Prop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ACjC3B,KAAK,EAAEjB,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAACiD,MAAM,EAAEjD,SAAS,CAACiC,MAAM,CAAC,CAAC;MAChEA,MAAM,EAAEjC,SAAS,CAACiC;IACpB,CAAC,CAAC,CAAC,CAACW,UAAU;IACdhC,cAAc,EAAEZ,SAAS,CAAC2C,IAAI,CAACC,UAAU;IACzCpC,WAAW,EAAER,SAAS,CAACgD,OAAO,CAAChD,SAAS,CAACiD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAetC,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header} value={checkedBoxes}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={value}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,SAASC,cAAcA,CAAC;EACtBC,MAAM,EAAE;IACNC,WAAW;IAAEC,SAAS;IAAEC,MAAM;IAA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