@openedx/paragon 23.14.9 → 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 (72) 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/DataTable/DataTableContext.d.ts +3 -0
  17. package/dist/DataTable/DataTableContext.js.map +1 -1
  18. package/dist/DataTable/TableCell.d.ts +14 -0
  19. package/dist/DataTable/TableCell.js +0 -12
  20. package/dist/DataTable/TableCell.js.map +1 -1
  21. package/dist/DataTable/TableHeaderCell.d.ts +26 -0
  22. package/dist/DataTable/TableHeaderCell.js +4 -32
  23. package/dist/DataTable/TableHeaderCell.js.map +1 -1
  24. package/dist/Menu/MenuItem.d.ts +17 -0
  25. package/dist/Menu/MenuItem.js +5 -27
  26. package/dist/Menu/MenuItem.js.map +1 -1
  27. package/dist/Menu/index.d.ts +16 -0
  28. package/dist/Menu/index.js +4 -24
  29. package/dist/Menu/index.js.map +1 -1
  30. package/dist/OverflowScroll/data/constants.d.ts +1 -0
  31. package/dist/OverflowScroll/data/constants.js +1 -0
  32. package/dist/OverflowScroll/data/constants.js.map +1 -0
  33. package/dist/PageBanner/index.d.ts +27 -0
  34. package/dist/PageBanner/index.js +5 -28
  35. package/dist/PageBanner/index.js.map +1 -1
  36. package/dist/Sheet/SheetContainer.js +30 -8
  37. package/dist/Sheet/SheetContainer.js.map +1 -1
  38. package/dist/Sheet/index.js +15 -5
  39. package/dist/Sheet/index.js.map +1 -1
  40. package/dist/Stack/index.d.ts +20 -0
  41. package/dist/Stack/index.js +3 -28
  42. package/dist/Stack/index.js.map +1 -1
  43. package/dist/Tabs/Tab.d.ts +19 -0
  44. package/dist/Tabs/Tab.js +0 -23
  45. package/dist/Tabs/Tab.js.map +1 -1
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +1 -2
  48. package/dist/index.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/Card/CardBody.tsx +19 -0
  51. package/src/Card/{CardContext.jsx → CardContext.tsx} +24 -25
  52. package/src/Card/CardDivider.tsx +13 -0
  53. package/src/Card/{CardGrid.jsx → CardGrid.tsx} +28 -35
  54. package/src/DataTable/{TableCell.jsx → TableCell.tsx} +13 -15
  55. package/src/DataTable/{TableHeaderCell.jsx → TableHeaderCell.tsx} +32 -33
  56. package/src/Menu/MenuItem.tsx +49 -0
  57. package/src/Menu/{index.jsx → index.tsx} +18 -27
  58. package/src/PageBanner/{index.jsx → index.tsx} +27 -29
  59. package/src/Sheet/Sheet.test.jsx +63 -3
  60. package/src/Sheet/SheetContainer.jsx +34 -7
  61. package/src/Sheet/SheetContainer.test.jsx +34 -1
  62. package/src/Sheet/__snapshots__/Sheet.test.jsx.snap +15 -6
  63. package/src/Sheet/index.jsx +12 -2
  64. package/src/Stack/{index.jsx → index.tsx} +22 -35
  65. package/src/Tabs/{Tab.jsx → Tab.tsx} +10 -18
  66. package/src/index.ts +1 -2
  67. package/src/Card/CardBody.jsx +0 -23
  68. package/src/Card/CardDivider.jsx +0 -18
  69. package/src/Menu/MenuItem.jsx +0 -57
  70. /package/src/Card/{CardFallbackDefaultImage.js → CardFallbackDefaultImage.ts} +0 -0
  71. /package/src/DataTable/{DataTableContext.jsx → DataTableContext.tsx} +0 -0
  72. /package/src/OverflowScroll/data/{constants.js → constants.ts} +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":[]}
@@ -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;MAACU,GAAG,EAAET,aAAc;MAAC,eAAY;IAAiB,CAAE,CAAC;EACnE;EAEA,oBAAOJ,KAAA,CAAAU,aAAA,CAACP,IAAI;IAACU,GAAG,EAAER,WAAY;IAAC,eAAY;EAAe,CAAE,CAAC;AAC/D;AAEAE,aAAa,CAACO,SAAS,GAAG;EACxBN,QAAQ,EAAEP,SAAS,CAACc,IAAI,CAACC,UAAU;EACnCP,YAAY,EAAER,SAAS,CAACc,IAAI,CAACC;AAC/B,CAAC;AAED,SAASC,eAAeA,CAAC;EACvBC,cAAc;EAAEC,MAAM;EAAEC,OAAO;EAAEC,oBAAoB;EAAEb,QAAQ;EAAEC,YAAY;EAAEa;AACjF,CAAC,EAAE;EACD,MAAMC,WAAW,GAAGH,OAAO,IAAIC,oBAAoB,GAAGA,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC;EAEjF,oBACErB,KAAA,CAAAU,aAAA;IAAA,GAAQQ,cAAc,CAACK,WAAW;EAAC,gBACjCvB,KAAA,CAAAU,aAAA;IAAMc,SAAS,EAAEtB,UAAU,CAAC,2BAA2B,EAAEoB,eAAe;EAAE,gBACxEtB,KAAA,CAAAU,aAAA,eAAOS,MAAM,CAAC,QAAQ,CAAQ,CAAC,EAC9BC,OAAO,iBAAIpB,KAAA,CAAAU,aAAA,CAACH,aAAa;IAACC,QAAQ,EAAEA,QAAS;IAACC,YAAY,EAAEA,YAAY,IAAI;EAAM,CAAE,CACjF,CACJ,CAAC;AAET;AAEAQ,eAAe,CAACQ,YAAY,GAAG;EAC7BH,eAAe,EAAE,IAAI;EACrBd,QAAQ,EAAE,KAAK;EACfC,YAAY,EAAE,KAAK;EACnBW,OAAO,EAAE,KAAK;EACdC,oBAAoB,EAAEA,CAAA,KAAM,CAAC;AAC/B,CAAC;AAEDJ,eAAe,CAACH,SAAS,GAAG;EAC1B;EACAI,cAAc,EAAEjB,SAAS,CAACyB,IAAI,CAACV,UAAU;EACzC;EACAR,QAAQ,EAAEP,SAAS,CAACc,IAAI;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":[]}
@@ -0,0 +1,17 @@
1
+ import React, { ReactElement, ReactNode, ElementType } from 'react';
2
+ interface MenuItemProps {
3
+ /** Specifies that this `MenuItem` is selected inside the `SelectMenu` */
4
+ defaultSelected?: boolean;
5
+ /** Specifies class name to append to the base element */
6
+ className?: string;
7
+ /** Specifies the content of the `MenuItem` */
8
+ children: ReactNode;
9
+ /** Specifies the base element */
10
+ as?: ElementType;
11
+ /** Specifies the jsx before the content of the `MenuItem` */
12
+ iconBefore?: ReactElement | ElementType;
13
+ /** Specifies the jsx after the content of the `MenuItem` */
14
+ iconAfter?: ReactElement | ElementType;
15
+ }
16
+ declare function MenuItem({ as, children, defaultSelected, iconAfter, iconBefore, ...props }: MenuItemProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
17
+ export default MenuItem;
@@ -1,17 +1,17 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { createElement } from 'react';
3
2
  import classNames from 'classnames';
4
3
  import Icon from '../Icon';
5
4
  function MenuItem({
6
- as,
5
+ as = 'button',
7
6
  children,
8
- defaultSelected,
7
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
+ defaultSelected = false,
9
9
  iconAfter,
10
10
  iconBefore,
11
11
  ...props
12
12
  }) {
13
13
  const className = classNames(props.className, 'pgn__menu-item');
14
- return /*#__PURE__*/React.createElement(as, {
14
+ return /*#__PURE__*/createElement(as, {
15
15
  ...props,
16
16
  className
17
17
  }, /*#__PURE__*/React.createElement(React.Fragment, null, iconBefore && /*#__PURE__*/React.createElement(Icon, {
@@ -26,27 +26,5 @@ function MenuItem({
26
26
  src: iconAfter
27
27
  })));
28
28
  }
29
- MenuItem.propTypes = {
30
- /** Specifies that this ``MenuItem`` is selected inside the ``SelectMenu`` */
31
- defaultSelected: PropTypes.bool,
32
- /** Specifies class name to append to the base element */
33
- className: PropTypes.string,
34
- /** Specifies the content of the ``MenuItem`` */
35
- children: PropTypes.node,
36
- /** Specifies the base element */
37
- as: PropTypes.elementType,
38
- /** Specifies the jsx before the content of the ``MenuItem`` */
39
- iconBefore: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
40
- /** Specifies the jsx after the content of the ``MenuItem`` */
41
- iconAfter: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType])
42
- };
43
- MenuItem.defaultProps = {
44
- defaultSelected: false,
45
- as: 'button',
46
- className: undefined,
47
- children: null,
48
- iconBefore: undefined,
49
- iconAfter: undefined
50
- };
51
29
  export default MenuItem;
52
30
  //# sourceMappingURL=MenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","names":["React","PropTypes","classNames","Icon","MenuItem","as","children","defaultSelected","iconAfter","iconBefore","props","className","createElement","Fragment","src","propTypes","bool","string","node","elementType","oneOfType","element","defaultProps","undefined"],"sources":["../../src/Menu/MenuItem.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from '../Icon';\n\nfunction MenuItem({\n as,\n children,\n defaultSelected,\n iconAfter,\n iconBefore,\n ...props\n}) {\n const className = classNames(props.className, 'pgn__menu-item');\n\n return React.createElement(\n as,\n {\n ...props,\n className,\n },\n (\n <>\n {iconBefore && <Icon className=\"btn-icon-before\" src={iconBefore} />}\n <span className=\"pgn__menu-item-text\">{children}</span>\n <span className=\"pgn__menu-item-content-spacer\" />\n {iconAfter && <Icon className=\"btn-icon-after\" src={iconAfter} />}\n </>\n ),\n );\n}\n\nMenuItem.propTypes = {\n /** Specifies that this ``MenuItem`` is selected inside the ``SelectMenu`` */\n defaultSelected: PropTypes.bool,\n /** Specifies class name to append to the base element */\n className: PropTypes.string,\n /** Specifies the content of the ``MenuItem`` */\n children: PropTypes.node,\n /** Specifies the base element */\n as: PropTypes.elementType,\n /** Specifies the jsx before the content of the ``MenuItem`` */\n iconBefore: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),\n /** Specifies the jsx after the content of the ``MenuItem`` */\n iconAfter: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),\n};\n\nMenuItem.defaultProps = {\n defaultSelected: false,\n as: 'button',\n className: undefined,\n children: null,\n iconBefore: undefined,\n iconAfter: undefined,\n};\n\nexport default MenuItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAE1B,SAASC,QAAQA,CAAC;EAChBC,EAAE;EACFC,QAAQ;EACRC,eAAe;EACfC,SAAS;EACTC,UAAU;EACV,GAAGC;AACL,CAAC,EAAE;EACD,MAAMC,SAAS,GAAGT,UAAU,CAACQ,KAAK,CAACC,SAAS,EAAE,gBAAgB,CAAC;EAE/D,oBAAOX,KAAK,CAACY,aAAa,CACxBP,EAAE,EACF;IACE,GAAGK,KAAK;IACRC;EACF,CAAC,eAECX,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAa,QAAA,QACGJ,UAAU,iBAAIT,KAAA,CAAAY,aAAA,CAACT,IAAI;IAACQ,SAAS,EAAC,iBAAiB;IAACG,GAAG,EAAEL;EAAW,CAAE,CAAC,eACpET,KAAA,CAAAY,aAAA;IAAMD,SAAS,EAAC;EAAqB,GAAEL,QAAe,CAAC,eACvDN,KAAA,CAAAY,aAAA;IAAMD,SAAS,EAAC;EAA+B,CAAE,CAAC,EACjDH,SAAS,iBAAIR,KAAA,CAAAY,aAAA,CAACT,IAAI;IAACQ,SAAS,EAAC,gBAAgB;IAACG,GAAG,EAAEN;EAAU,CAAE,CAChE,CAEN,CAAC;AACH;AAEAJ,QAAQ,CAACW,SAAS,GAAG;EACnB;EACAR,eAAe,EAAEN,SAAS,CAACe,IAAI;EAC/B;EACAL,SAAS,EAAEV,SAAS,CAACgB,MAAM;EAC3B;EACAX,QAAQ,EAAEL,SAAS,CAACiB,IAAI;EACxB;EACAb,EAAE,EAAEJ,SAAS,CAACkB,WAAW;EACzB;EACAV,UAAU,EAAER,SAAS,CAACmB,SAAS,CAAC,CAACnB,SAAS,CAACoB,OAAO,EAAEpB,SAAS,CAACkB,WAAW,CAAC,CAAC;EAC3E;EACAX,SAAS,EAAEP,SAAS,CAACmB,SAAS,CAAC,CAACnB,SAAS,CAACoB,OAAO,EAAEpB,SAAS,CAACkB,WAAW,CAAC;AAC3E,CAAC;AAEDf,QAAQ,CAACkB,YAAY,GAAG;EACtBf,eAAe,EAAE,KAAK;EACtBF,EAAE,EAAE,QAAQ;EACZM,SAAS,EAAEY,SAAS;EACpBjB,QAAQ,EAAE,IAAI;EACdG,UAAU,EAAEc,SAAS;EACrBf,SAAS,EAAEe;AACb,CAAC;AAED,eAAenB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"MenuItem.js","names":["React","createElement","classNames","Icon","MenuItem","as","children","defaultSelected","iconAfter","iconBefore","props","className","Fragment","src"],"sources":["../../src/Menu/MenuItem.tsx"],"sourcesContent":["import React, {\n ReactElement, ReactNode, ElementType, createElement, ComponentType,\n} from 'react';\nimport classNames from 'classnames';\nimport Icon from '../Icon';\n\ninterface MenuItemProps {\n /** Specifies that this `MenuItem` is selected inside the `SelectMenu` */\n defaultSelected?: boolean;\n /** Specifies class name to append to the base element */\n className?: string;\n /** Specifies the content of the `MenuItem` */\n children: ReactNode;\n /** Specifies the base element */\n as?: ElementType;\n /** Specifies the jsx before the content of the `MenuItem` */\n iconBefore?: ReactElement | ElementType;\n /** Specifies the jsx after the content of the `MenuItem` */\n iconAfter?: ReactElement | ElementType;\n}\nfunction MenuItem({\n as = 'button',\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n defaultSelected = false,\n iconAfter,\n iconBefore,\n ...props\n}: MenuItemProps) {\n const className = classNames(props.className, 'pgn__menu-item');\n\n return createElement(\n as,\n {\n ...props,\n className,\n },\n (\n <>\n {iconBefore && <Icon className=\"btn-icon-before\" src={iconBefore as ComponentType} />}\n <span className=\"pgn__menu-item-text\">{children}</span>\n <span className=\"pgn__menu-item-content-spacer\" />\n {iconAfter && <Icon className=\"btn-icon-after\" src={iconAfter as ComponentType} />}\n </>\n ),\n );\n}\n\nexport default MenuItem;\n"],"mappings":"AAAA,OAAOA,KAAK,IAC4BC,aAAa,QAC9C,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAgB1B,SAASC,QAAQA,CAAC;EAChBC,EAAE,GAAG,QAAQ;EACbC,QAAQ;EACR;EACAC,eAAe,GAAG,KAAK;EACvBC,SAAS;EACTC,UAAU;EACV,GAAGC;AACU,CAAC,EAAE;EAChB,MAAMC,SAAS,GAAGT,UAAU,CAACQ,KAAK,CAACC,SAAS,EAAE,gBAAgB,CAAC;EAE/D,oBAAOV,aAAa,CAClBI,EAAE,EACF;IACE,GAAGK,KAAK;IACRC;EACF,CAAC,eAECX,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAY,QAAA,QACGH,UAAU,iBAAIT,KAAA,CAAAC,aAAA,CAACE,IAAI;IAACQ,SAAS,EAAC,iBAAiB;IAACE,GAAG,EAAEJ;EAA4B,CAAE,CAAC,eACrFT,KAAA,CAAAC,aAAA;IAAMU,SAAS,EAAC;EAAqB,GAAEL,QAAe,CAAC,eACvDN,KAAA,CAAAC,aAAA;IAAMU,SAAS,EAAC;EAA+B,CAAE,CAAC,EACjDH,SAAS,iBAAIR,KAAA,CAAAC,aAAA,CAACE,IAAI;IAACQ,SAAS,EAAC,gBAAgB;IAACE,GAAG,EAAEL;EAA2B,CAAE,CACjF,CAEN,CAAC;AACH;AAEA,eAAeJ,QAAQ","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import React, { ElementType, ReactNode } from 'react';
2
+ interface MenuProps {
3
+ /** Specifies class name to append to the base element */
4
+ className?: string;
5
+ /**
6
+ * Specifies the CSS selector string that indicates to which elements
7
+ * the user can navigate using the arrow keys
8
+ */
9
+ arrowKeyNavigationSelector?: string;
10
+ /** Specifies the base element */
11
+ as?: ElementType;
12
+ /** Specifies the content of the menu */
13
+ children?: ReactNode;
14
+ }
15
+ declare function Menu({ as, arrowKeyNavigationSelector, children, ...props }: MenuProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
16
+ export default Menu;
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { createElement } from 'react';
3
2
  import classNames from 'classnames';
4
3
  import useArrowKeyNavigation from '../hooks/useArrowKeyNavigationHook';
5
4
  function Menu({
6
- as,
7
- arrowKeyNavigationSelector,
5
+ as = 'div',
6
+ arrowKeyNavigationSelector = 'a:not(:disabled),button:not(:disabled),input:not(:disabled)',
8
7
  children,
9
8
  ...props
10
9
  }) {
@@ -12,7 +11,7 @@ function Menu({
12
11
  selectors: arrowKeyNavigationSelector
13
12
  });
14
13
  const className = classNames(props.className, 'pgn__menu');
15
- return /*#__PURE__*/React.createElement(as, {
14
+ return /*#__PURE__*/createElement(as, {
16
15
  ...props,
17
16
  ref: parentRef,
18
17
  className
@@ -21,24 +20,5 @@ function Menu({
21
20
  // eslint-disable-next-line react/jsx-no-useless-fragment
22
21
  React.createElement(React.Fragment, null, children));
23
22
  }
24
- Menu.propTypes = {
25
- /** Specifies class name to append to the base element */
26
- className: PropTypes.string,
27
- /**
28
- * Specifies the CSS selector string that indicates to which elements
29
- * the user can navigate using the arrow keys
30
- */
31
- arrowKeyNavigationSelector: PropTypes.string,
32
- /** Specifies the base element */
33
- as: PropTypes.elementType,
34
- /** Specifies the content of the menu */
35
- children: PropTypes.node
36
- };
37
- Menu.defaultProps = {
38
- className: undefined,
39
- arrowKeyNavigationSelector: 'a:not(:disabled),button:not(:disabled),input:not(:disabled)',
40
- as: 'div',
41
- children: null
42
- };
43
23
  export default Menu;
44
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","classNames","useArrowKeyNavigation","Menu","as","arrowKeyNavigationSelector","children","props","parentRef","selectors","className","createElement","ref","Fragment","propTypes","string","elementType","node","defaultProps","undefined"],"sources":["../../src/Menu/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport useArrowKeyNavigation from '../hooks/useArrowKeyNavigationHook';\n\nfunction Menu({\n as,\n arrowKeyNavigationSelector,\n children,\n ...props\n}) {\n const parentRef = useArrowKeyNavigation({ selectors: arrowKeyNavigationSelector });\n const className = classNames(props.className, 'pgn__menu');\n\n return React.createElement(\n as,\n {\n ...props,\n ref: parentRef,\n className,\n },\n (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n {children}\n </>\n ),\n );\n}\n\nMenu.propTypes = {\n /** Specifies class name to append to the base element */\n className: PropTypes.string,\n /**\n * Specifies the CSS selector string that indicates to which elements\n * the user can navigate using the arrow keys\n */\n arrowKeyNavigationSelector: PropTypes.string,\n /** Specifies the base element */\n as: PropTypes.elementType,\n /** Specifies the content of the menu */\n children: PropTypes.node,\n};\n\nMenu.defaultProps = {\n className: undefined,\n arrowKeyNavigationSelector: 'a:not(:disabled),button:not(:disabled),input:not(:disabled)',\n as: 'div',\n children: null,\n};\n\nexport default Menu;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,qBAAqB,MAAM,oCAAoC;AAEtE,SAASC,IAAIA,CAAC;EACZC,EAAE;EACFC,0BAA0B;EAC1BC,QAAQ;EACR,GAAGC;AACL,CAAC,EAAE;EACD,MAAMC,SAAS,GAAGN,qBAAqB,CAAC;IAAEO,SAAS,EAAEJ;EAA2B,CAAC,CAAC;EAClF,MAAMK,SAAS,GAAGT,UAAU,CAACM,KAAK,CAACG,SAAS,EAAE,WAAW,CAAC;EAE1D,oBAAOX,KAAK,CAACY,aAAa,CACxBP,EAAE,EACF;IACE,GAAGG,KAAK;IACRK,GAAG,EAAEJ,SAAS;IACdE;EACF,CAAC;EAAA;EAEC;EACAX,KAAA,CAAAY,aAAA,CAAAZ,KAAA,CAAAc,QAAA,QACGP,QACD,CAEN,CAAC;AACH;AAEAH,IAAI,CAACW,SAAS,GAAG;EACf;EACAJ,SAAS,EAAEV,SAAS,CAACe,MAAM;EAC3B;AACF;AACA;AACA;EACEV,0BAA0B,EAAEL,SAAS,CAACe,MAAM;EAC5C;EACAX,EAAE,EAAEJ,SAAS,CAACgB,WAAW;EACzB;EACAV,QAAQ,EAAEN,SAAS,CAACiB;AACtB,CAAC;AAEDd,IAAI,CAACe,YAAY,GAAG;EAClBR,SAAS,EAAES,SAAS;EACpBd,0BAA0B,EAAE,6DAA6D;EACzFD,EAAE,EAAE,KAAK;EACTE,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeH,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","createElement","classNames","useArrowKeyNavigation","Menu","as","arrowKeyNavigationSelector","children","props","parentRef","selectors","className","ref","Fragment"],"sources":["../../src/Menu/index.tsx"],"sourcesContent":["import React, { ElementType, ReactNode, createElement } from 'react';\nimport classNames from 'classnames';\nimport useArrowKeyNavigation from '../hooks/useArrowKeyNavigationHook';\n\ninterface MenuProps {\n /** Specifies class name to append to the base element */\n className?: string;\n /**\n * Specifies the CSS selector string that indicates to which elements\n * the user can navigate using the arrow keys\n */\n arrowKeyNavigationSelector?: string;\n /** Specifies the base element */\n as?: ElementType;\n /** Specifies the content of the menu */\n children?: ReactNode;\n}\nfunction Menu({\n as = 'div',\n arrowKeyNavigationSelector = 'a:not(:disabled),button:not(:disabled),input:not(:disabled)',\n children,\n ...props\n}: MenuProps) {\n const parentRef = useArrowKeyNavigation({ selectors: arrowKeyNavigationSelector });\n const className = classNames(props.className, 'pgn__menu');\n\n return createElement(\n as,\n {\n ...props,\n ref: parentRef,\n className,\n },\n (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n {children}\n </>\n ),\n );\n}\n\nexport default Menu;\n"],"mappings":"AAAA,OAAOA,KAAK,IAA4BC,aAAa,QAAQ,OAAO;AACpE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,qBAAqB,MAAM,oCAAoC;AAetE,SAASC,IAAIA,CAAC;EACZC,EAAE,GAAG,KAAK;EACVC,0BAA0B,GAAG,6DAA6D;EAC1FC,QAAQ;EACR,GAAGC;AACM,CAAC,EAAE;EACZ,MAAMC,SAAS,GAAGN,qBAAqB,CAAC;IAAEO,SAAS,EAAEJ;EAA2B,CAAC,CAAC;EAClF,MAAMK,SAAS,GAAGT,UAAU,CAACM,KAAK,CAACG,SAAS,EAAE,WAAW,CAAC;EAE1D,oBAAOV,aAAa,CAClBI,EAAE,EACF;IACE,GAAGG,KAAK;IACRI,GAAG,EAAEH,SAAS;IACdE;EACF,CAAC;EAAA;EAEC;EACAX,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAa,QAAA,QACGN,QACD,CAEN,CAAC;AACH;AAEA,eAAeH,IAAI","ignoreList":[]}