@coveord/plasma-mantine 49.6.6 → 50.0.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 (68) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +29 -30
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/header/Header.js +80 -39
  5. package/dist/cjs/components/header/Header.js.map +1 -1
  6. package/dist/cjs/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +55 -0
  7. package/dist/cjs/components/index.js +0 -1
  8. package/dist/cjs/components/index.js.map +1 -1
  9. package/dist/cjs/components/modal-wizard/ModalWizard.js +60 -27
  10. package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
  11. package/dist/cjs/components/modal-wizard/ModalWizardStep.js +4 -1
  12. package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -1
  13. package/dist/cjs/components/sticky-footer/StickyFooter.js +2 -4
  14. package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
  15. package/dist/cjs/index.js +0 -3
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/cjs/theme/Theme.js +19 -19
  18. package/dist/cjs/theme/Theme.js.map +1 -1
  19. package/dist/definitions/components/header/Header.d.ts +30 -13
  20. package/dist/definitions/components/header/Header.d.ts.map +1 -1
  21. package/dist/definitions/components/index.d.ts +0 -1
  22. package/dist/definitions/components/index.d.ts.map +1 -1
  23. package/dist/definitions/components/modal-wizard/ModalWizard.d.ts.map +1 -1
  24. package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts +6 -6
  25. package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts.map +1 -1
  26. package/dist/definitions/index.d.ts +1 -1
  27. package/dist/definitions/index.d.ts.map +1 -1
  28. package/dist/definitions/theme/Theme.d.ts.map +1 -1
  29. package/dist/esm/components/header/Header.js +82 -41
  30. package/dist/esm/components/header/Header.js.map +1 -1
  31. package/dist/esm/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +55 -0
  32. package/dist/esm/components/index.js +0 -1
  33. package/dist/esm/components/index.js.map +1 -1
  34. package/dist/esm/components/modal-wizard/ModalWizard.js +62 -29
  35. package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
  36. package/dist/esm/components/modal-wizard/ModalWizardStep.js +4 -1
  37. package/dist/esm/components/modal-wizard/ModalWizardStep.js.map +1 -1
  38. package/dist/esm/components/sticky-footer/StickyFooter.js +2 -4
  39. package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
  40. package/dist/esm/index.js +1 -1
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/esm/theme/Theme.js +20 -20
  43. package/dist/esm/theme/Theme.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/components/header/Header.tsx +83 -44
  46. package/src/components/header/__tests__/Header.spec.tsx +42 -35
  47. package/src/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +55 -0
  48. package/src/components/index.ts +0 -1
  49. package/src/components/modal-wizard/ModalWizard.tsx +50 -34
  50. package/src/components/modal-wizard/ModalWizardStep.tsx +7 -7
  51. package/src/components/sticky-footer/StickyFooter.tsx +1 -1
  52. package/src/index.ts +1 -2
  53. package/src/theme/Theme.tsx +16 -15
  54. package/dist/cjs/components/modal/Modal.js +0 -41
  55. package/dist/cjs/components/modal/Modal.js.map +0 -1
  56. package/dist/cjs/components/modal/index.js +0 -8
  57. package/dist/cjs/components/modal/index.js.map +0 -1
  58. package/dist/definitions/components/modal/Modal.d.ts +0 -19
  59. package/dist/definitions/components/modal/Modal.d.ts.map +0 -1
  60. package/dist/definitions/components/modal/index.d.ts +0 -2
  61. package/dist/definitions/components/modal/index.d.ts.map +0 -1
  62. package/dist/esm/components/modal/Modal.js +0 -31
  63. package/dist/esm/components/modal/Modal.js.map +0 -1
  64. package/dist/esm/components/modal/index.js +0 -3
  65. package/dist/esm/components/modal/index.js.map +0 -1
  66. package/src/components/modal/Modal.tsx +0 -32
  67. package/src/components/modal/__tests__/Modal.spec.tsx +0 -53
  68. package/src/components/modal/index.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: 300},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: 500},\n h3: {fontSize: 24, lineHeight: '32px', fontWeight: 500},\n h4: {fontSize: 18, lineHeight: '28px', fontWeight: 300},\n h5: {fontSize: 14, lineHeight: '20px', fontWeight: 500},\n h6: {fontSize: 12, lineHeight: '16px', fontWeight: 500},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","undefined","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNb,YAAY;QACZc,YAAY;QACZC,OAAO;YACHC,IAAI;gBAACC,UAAU;gBAAIC,YAAY;gBAAQJ,YAAY;YAAG;YACtDK,IAAI;gBAACF,UAAU;gBAAIC,YAAY;gBAAQJ,YAAY;YAAG;YACtDM,IAAI;gBAACH,UAAU;gBAAIC,YAAY;gBAAQJ,YAAY;YAAG;YACtDO,IAAI;gBAACJ,UAAU;gBAAIC,YAAY;gBAAQJ,YAA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;gBACJmD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACL1D,cAAc;gBACV2D,QAAQ;gBACRtB,WAAW,IAAI;YACnB;QACJ;QACAuB,OAAO;YACHxD,QAAQ;gBACJI,MAAM;oBACFqD,eAAe;oBACfC,SAAS;oBACT7E,YAAY;gBAChB;YACJ;QACJ;QACA8E,aAAa;YACT/D,cAAc;gBACVgB,MAAM;gBACNgD,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNjE,cAAc;gBACVkE,IAAI;YACR;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n lineHeight: 1.5,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: undefined, fontWeight: 300},\n h2: {fontSize: 32, lineHeight: undefined, fontWeight: 500},\n h3: {fontSize: 24, lineHeight: undefined, fontWeight: 500},\n h4: {fontSize: 18, lineHeight: undefined, fontWeight: 300},\n h5: {fontSize: 14, lineHeight: undefined, fontWeight: 500},\n h6: {fontSize: 12, lineHeight: undefined, fontWeight: 500},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em'},\n },\n }),\n },\n Text: {\n defaultProps: {\n weight: 300,\n },\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n overflow: 'auto',\n },\n title: {width: '100%'},\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n },\n description: {\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","lineHeight","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","undefined","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","height","styles","title","Title","theme","root","letterSpacing","Text","weight","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overflow","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;;;+BAMaA;;;eAAAA;;;;;gCANc;4BACP;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,YAAY;IACZC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNd,YAAY;QACZe,YAAY;QACZC,OAAO;Y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E;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNlD,cAAc;gBACVqC,QAAQ;YACZ;QACJ;QACAc,MAAM;YACF/C,QAAQ;uBAAO;oBACXI,MAAM;wBACF4C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHjD,QAAQ;gBACJkD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLzD,cAAc;gBACV0D,QAAQ;gBACRnB,WAAW,IAAI;YACnB;QACJ;QACAoB,OAAO;YACHvD,QAAQ;gBACJI,MAAM;oBACFoD,eAAe;oBACfC,SAAS;oBACT5E,YAAY;gBAChB;YACJ;QACJ;QACA6E,aAAa;YACT9D,cAAc;gBACViB,MAAM;gBACN8C,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNhE,cAAc;gBACViE,IAAI;YACR;QACJ;IACJ;AACJ"}
@@ -1,32 +1,49 @@
1
1
  import { DefaultProps } from '@mantine/core';
2
- import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionComponent, ReactElement, ReactNode } from 'react';
3
3
  export interface HeaderProps extends DefaultProps {
4
4
  /**
5
5
  * The description text displayed inside the header underneath the title
6
6
  */
7
7
  description?: ReactNode;
8
- /**
9
- * Action buttons that can be displayed on the right of the header
10
- */
11
- actions?: ReactNode;
12
8
  /**
13
9
  * Whether the header should have a border on the bottom
14
10
  */
15
11
  borderBottom?: boolean;
12
+ /**
13
+ * Use the modal variant when displaying the header inside a modal
14
+ *
15
+ * @default 'page'
16
+ */
17
+ variant?: 'page' | 'modal';
18
+ /**
19
+ * The title of the header.
20
+ */
21
+ children: ReactNode;
22
+ }
23
+ interface HeaderType {
24
+ (props: HeaderProps): ReactElement;
25
+ Breadcrumbs: typeof HeaderBreadcrumbs;
26
+ Actions: typeof HeaderActions;
27
+ DocAnchor: typeof HeaderDocAnchor;
28
+ }
29
+ export declare const Header: HeaderType;
30
+ declare const HeaderBreadcrumbs: FunctionComponent<{
31
+ children: ReactNode;
32
+ }>;
33
+ declare const HeaderActions: FunctionComponent<{
34
+ children: ReactNode;
35
+ }>;
36
+ export interface HeaderDocAnchorProps {
16
37
  /**
17
38
  * A href pointing to documentation related to the current panel.
18
39
  * When provided, an info icon is rendered next to the title as link to this documentation
19
40
  */
20
- docLink?: string;
41
+ href: string;
21
42
  /**
22
43
  * The tooltip text shown when hovering over the doc link icon
23
44
  */
24
- docLinkTooltipLabel?: string;
25
- /**
26
- * The title of the header.
27
- * If more than one children are provided, each of them act as parts of a breadcrumb
28
- */
29
- children: ReactNode;
45
+ label?: string;
30
46
  }
31
- export declare const Header: FunctionComponent<HeaderProps>;
47
+ declare const HeaderDocAnchor: FunctionComponent<HeaderDocAnchorProps>;
48
+ export {};
32
49
  //# sourceMappingURL=Header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,YAAY,EAA8C,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,CA8BjD,CAAC"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,YAAY,EAAoD,MAAM,eAAe,CAAC;AACnH,OAAO,EAAW,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAE3E,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,UAAU,UAAU;IAChB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAAC;IACnC,WAAW,EAAE,OAAO,iBAAiB,CAAC;IACtC,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,SAAS,EAAE,OAAO,eAAe,CAAC;CACrC;AAED,eAAO,MAAM,MAAM,EAAE,UAiCpB,CAAC;AAEF,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,CAS/D,CAAC;AAEF,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,CAA0D,CAAC;AAEvH,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CAM5D,CAAC"}
@@ -7,7 +7,6 @@ export * from './header';
7
7
  export * from './inline-confirm';
8
8
  export * from './table';
9
9
  export * from './prompt';
10
- export * from './modal';
11
10
  export * from './modal-wizard';
12
11
  export * from './button';
13
12
  export * from './menu';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,UAAU,EAAY,SAAS,EAAC,MAAM,eAAe,CAAC;AACtG,OAAO,EAAW,YAAY,EAAoB,MAAM,OAAO,CAAC;AAKhE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,QAAA,MAAM,SAAS;;;;CAUZ,CAAC;AAEJ,KAAK,sBAAsB,GAAG,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;AAE1D,MAAM,WAAW,gBACb,SAAQ,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC,EACvE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAC1C;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;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;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC;IAEjC;;SAEK;IACL,QAAQ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC;CACxD;AAED,UAAU,eAAe;IACrB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAAC;IAExC,IAAI,EAAE,OAAO,eAAe,CAAC;CAChC;AAED,eAAO,MAAM,WAAW,EAAE,eA0IzB,CAAC"}
@@ -1,22 +1,23 @@
1
- import { FunctionComponent, PropsWithChildren, ReactElement } from 'react';
1
+ import { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
2
2
  type DependsOnStep<T> = (currentStep: number, numberOfSteps: number) => T;
3
+ export type ResolveStep<P> = P extends infer T | DependsOnStep<infer T> ? T : never;
3
4
  export interface ModalWizardStepProps {
4
5
  /**
5
6
  * The title of the current step. The title can be dependent on the current step if needed
6
7
  */
7
- title?: string | ReactElement | DependsOnStep<string | ReactElement>;
8
+ title?: ReactNode | DependsOnStep<ReactNode>;
8
9
  /**
9
10
  * The description of the current step. The description can be dependent on the current step if needed
10
11
  */
11
- description?: string | ReactElement | DependsOnStep<string | ReactElement>;
12
+ description?: string | DependsOnStep<string>;
12
13
  /**
13
14
  * A link to the documentation for the current step
14
15
  */
15
- docLink?: string;
16
+ docLink?: string | DependsOnStep<string>;
16
17
  /**
17
18
  * A tooltip label for the docLink
18
19
  */
19
- docLinkTooltipLabel?: string | ReactElement | DependsOnStep<string | ReactElement>;
20
+ docLinkTooltipLabel?: string | DependsOnStep<string>;
20
21
  /**
21
22
  * A function to validate the current step, it determines if the next step should be enabled or not.
22
23
  */
@@ -36,7 +37,6 @@ export interface ModalWizardStepProps {
36
37
  * @default true
37
38
  */
38
39
  countsAsProgress?: boolean;
39
- children: ReactElement<any, any>;
40
40
  }
41
41
  declare const ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>>;
42
42
  export { ModalWizardStep };
@@ -1 +1 @@
1
- {"version":3,"file":"ModalWizardStep.d.ts","sourceRoot":"","sources":["../../../../src/components/modal-wizard/ModalWizardStep.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAEzE,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC,CAAC;AAE1E,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;IAErE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;IAE3E;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;IAEnF;;OAEG;IACH,YAAY,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,KAAK;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,E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CAAA;KAAC,CAAC;IAE/F;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAmC,CAAC;AAOpH,OAAO,EAAC,eAAe,EAAC,CAAC"}
@@ -10,7 +10,7 @@ export * from './components';
10
10
  export * from '@mantine/form';
11
11
  export { type NotificationProps } from '@mantine/notifications';
12
12
  export { Pagination } from '@mantine/core';
13
- export { Header, Table, type TableProps, type TableState, type InitialTableState, type HeaderProps, Modal, Button, type ButtonProps, Menu, type MenuItemProps, } from './components';
13
+ export { Header, type HeaderProps, Table, type TableProps, type TableState, type InitialTableState, Button, type ButtonProps, Menu, type MenuItemProps, } from './components';
14
14
  export { useForm, createFormContext } from './form';
15
15
  export * from './theme';
16
16
  declare module '@mantine/core' {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EACH,MAAM,EACN,KAAK,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB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C,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;KAChF;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAI1F,eAAO,MAAM,WAAW,EAAE,oBA6LzB,CAAC"}
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAI1F,eAAO,MAAM,WAAW,EAAE,oBA8LzB,CAAC"}
@@ -2,63 +2,60 @@ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
2
  import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
3
  import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
4
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
5
- import { QuestionSize24Px } from "@coveord/plasma-react-icons";
6
- import { Anchor, Breadcrumbs, Divider, Group, Stack, Text, Title, Tooltip } from "@mantine/core";
7
- export var Header = function(_param) /*#__PURE__*/ {
8
- var description = _param.description, actions = _param.actions, borderBottom = _param.borderBottom, docLink = _param.docLink, docLinkTooltipLabel = _param.docLinkTooltipLabel, children = _param.children, others = _object_without_properties(_param, [
5
+ import { QuestionSize16Px } from "@coveord/plasma-react-icons";
6
+ import { Anchor, Breadcrumbs, Divider, Flex, Group, Stack, Text, Title, Tooltip } from "@mantine/core";
7
+ import { Children } from "react";
8
+ export var Header = function(_param) {
9
+ var description = _param.description, borderBottom = _param.borderBottom, children = _param.children, _param_variant = _param.variant, variant = _param_variant === void 0 ? "page" : _param_variant, others = _object_without_properties(_param, [
9
10
  "description",
10
- "actions",
11
11
  "borderBottom",
12
- "docLink",
13
- "docLinkTooltipLabel",
14
- "children"
12
+ "children",
13
+ "variant"
15
14
  ]);
16
- return _jsxs(_Fragment, {
15
+ var convertedChildren = Children.toArray(children);
16
+ var breadcrumbs = convertedChildren.find(function(child) {
17
+ return child.type === HeaderBreadcrumbs;
18
+ });
19
+ var actions = convertedChildren.find(function(child) {
20
+ return child.type === HeaderActions;
21
+ });
22
+ var docAnchor = convertedChildren.find(function(child) {
23
+ return child.type === HeaderDocAnchor;
24
+ });
25
+ var otherChildren = convertedChildren.filter(function(child) {
26
+ return child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor;
27
+ });
28
+ return /*#__PURE__*/ _jsxs(_Fragment, {
17
29
  children: [
18
30
  /*#__PURE__*/ _jsxs(Group, _object_spread_props(_object_spread({
19
31
  position: "apart",
20
- py: "md",
21
- px: "xl"
32
+ p: variant === "page" ? "xl" : undefined,
33
+ pb: variant === "page" ? "lg" : undefined
22
34
  }, others), {
23
35
  children: [
24
36
  /*#__PURE__*/ _jsxs(Stack, {
25
- spacing: "xs",
37
+ spacing: 0,
26
38
  children: [
27
- /*#__PURE__*/ _jsx(Title, {
28
- order: 4,
29
- children: /*#__PURE__*/ _jsxs(Group, {
30
- spacing: 0,
31
- children: [
32
- /*#__PURE__*/ _jsx(Breadcrumbs, {
33
- children: children
34
- }),
35
- docLink ? /*#__PURE__*/ _jsx(Tooltip, {
36
- label: docLinkTooltipLabel,
37
- disabled: !docLinkTooltipLabel,
38
- position: "bottom",
39
- children: /*#__PURE__*/ _jsx(Anchor, {
40
- inline: true,
41
- href: docLink,
42
- target: "_blank",
43
- ml: "xs",
44
- children: /*#__PURE__*/ _jsx(QuestionSize24Px, {
45
- height: 24
46
- })
47
- })
48
- }) : null
49
- ]
50
- })
39
+ breadcrumbs,
40
+ /*#__PURE__*/ _jsxs(Flex, {
41
+ align: "center",
42
+ children: [
43
+ /*#__PURE__*/ _jsx(Title, {
44
+ order: variant === "page" ? 1 : 3,
45
+ color: variant === "page" ? "gray.5" : undefined,
46
+ children: otherChildren
47
+ }),
48
+ docAnchor
49
+ ]
51
50
  }),
52
51
  /*#__PURE__*/ _jsx(Text, {
53
- size: "sm",
52
+ size: variant === "page" ? "md" : "sm",
53
+ color: "gray.6",
54
54
  children: description
55
55
  })
56
56
  ]
57
57
  }),
58
- /*#__PURE__*/ _jsx(Group, {
59
- spacing: "xs",
60
- children: actions
61
- })
58
+ actions
62
59
  ]
63
60
  })),
64
61
  borderBottom ? /*#__PURE__*/ _jsx(Divider, {
@@ -67,5 +64,49 @@ export var Header = function(_param) /*#__PURE__*/ {
67
64
  ]
68
65
  });
69
66
  };
67
+ var HeaderBreadcrumbs = function(param) {
68
+ var children = param.children;
69
+ return /*#__PURE__*/ _jsx(Breadcrumbs, {
70
+ styles: function(theme) {
71
+ return {
72
+ breadcrumb: {
73
+ fontSize: theme.fontSizes.sm,
74
+ fontWeight: 300
75
+ },
76
+ separator: {
77
+ color: theme.colors.gray[5]
78
+ }
79
+ };
80
+ },
81
+ children: children
82
+ });
83
+ };
84
+ var HeaderActions = function(param) {
85
+ var children = param.children;
86
+ return /*#__PURE__*/ _jsx(Group, {
87
+ spacing: "sm",
88
+ children: children
89
+ });
90
+ };
91
+ var HeaderDocAnchor = function(param) {
92
+ var docLink = param.href, docLinkTooltipLabel = param.label;
93
+ return /*#__PURE__*/ _jsx(Tooltip, {
94
+ label: docLinkTooltipLabel,
95
+ disabled: !docLinkTooltipLabel,
96
+ position: "right",
97
+ children: /*#__PURE__*/ _jsx(Anchor, {
98
+ inline: true,
99
+ href: docLink,
100
+ target: "_blank",
101
+ ml: "xs",
102
+ children: /*#__PURE__*/ _jsx(QuestionSize16Px, {
103
+ height: 16
104
+ })
105
+ })
106
+ });
107
+ };
108
+ Header.Breadcrumbs = HeaderBreadcrumbs;
109
+ Header.Actions = HeaderActions;
110
+ Header.DocAnchor = HeaderDocAnchor;
70
111
 
71
112
  //# sourceMappingURL=Header.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {QuestionSize24Px} from '@coveord/plasma-react-icons';\nimport {Anchor, Breadcrumbs, DefaultProps, Divider, Group, Stack, Text, Title, Tooltip} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\n\nexport interface HeaderProps extends DefaultProps {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Action buttons that can be displayed on the right of the header\n */\n actions?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n docLink?: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n docLinkTooltipLabel?: string;\n /**\n * The title of the header.\n * If more than one children are provided, each of them act as parts of a breadcrumb\n */\n children: ReactNode;\n}\n\nexport const Header: FunctionComponent<HeaderProps> = ({\n description,\n actions,\n borderBottom,\n docLink,\n docLinkTooltipLabel,\n children,\n ...others\n}) => (\n <>\n <Group position=\"apart\" py=\"md\" px=\"xl\" {...others}>\n <Stack spacing=\"xs\">\n <Title order={4}>\n <Group spacing={0}>\n <Breadcrumbs>{children}</Breadcrumbs>\n {docLink ? (\n <Tooltip label={docLinkTooltipLabel} disabled={!docLinkTooltipLabel} position=\"bottom\">\n <Anchor inline href={docLink} target=\"_blank\" ml=\"xs\">\n <QuestionSize24Px height={24} />\n </Anchor>\n </Tooltip>\n ) : null}\n </Group>\n </Title>\n <Text size=\"sm\">{description}</Text>\n </Stack>\n <Group spacing=\"xs\">{actions}</Group>\n </Group>\n {borderBottom ? <Divider size=\"xs\" /> : null}\n </>\n);\n"],"names":["QuestionSize24Px","Anchor","Breadcrumbs","Divider","Group","Stack","Text","Title","Tooltip","Header","description","actions","borderBottom","docLink","docLinkTooltipLabel","children","others","position","py","px","spacing","order","label","disabled","inline","href","target","ml","height","size"],"mappings":";;;;AAAA,SAAQA,gBAAgB,QAAO,8BAA8B;AAC7D,SAAQC,MAAM,EAAEC,WAAW,EAAgBC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,QAAO,gBAAgB;AAgC7G,OAAO,IAAMC,SAAyC,+BASlD;QARAC,qBAAAA,aACAC,iBAAAA,SACAC,sBAAAA,cACAC,iBAAAA,SACAC,6BAAAA,qBACAC,kBAAAA,UACGC;QANHN;QACAC;QACAC;QACAC;QACAC;QACAC;;WAGA;;0BACI,MAACX;gBAAMa,UAAS;gBAAQC,IAAG;gBAAKC,IAAG;eAASH;;kCACxC,MAACX;wBAAMe,SAAQ;;0CACX,KAACb;gCAAMc,OAAO;0CACV,cAAA,MAACjB;oCAAMgB,SAAS;;sDACZ,KAAClB;sDAAaa;;wCACbF,wBACG,KAACL;4CAAQc,OAAOR;4CAAqBS,UAAU,CAACT;4CAAqBG,UAAS;sDAC1E,cAAA,KAAChB;gDAAOuB,MAAM;gDAACC,MAAMZ;gDAASa,QAAO;gDAASC,IAAG;0DAC7C,cAAA,KAAC3B;oDAAiB4B,QAAQ;;;6CAGlC,IAAI;;;;0CAGhB,KAACtB;gCAAKuB,MAAK;0CAAMnB;;;;kCAErB,KAACN;wBAAMgB,SAAQ;kCAAMT;;;;YAExBC,6BAAe,KAACT;gBAAQ0B,MAAK;iBAAU,IAAI;;;AAC9C,EACJ"}
1
+ {"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {QuestionSize16Px} from '@coveord/plasma-react-icons';\nimport {Anchor, Breadcrumbs, DefaultProps, Divider, Flex, Group, Stack, Text, Title, Tooltip} from '@mantine/core';\nimport {Children, FunctionComponent, ReactElement, ReactNode} from 'react';\n\nexport interface HeaderProps extends DefaultProps {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * Use the modal variant when displaying the header inside a modal\n *\n * @default 'page'\n */\n variant?: 'page' | 'modal';\n /**\n * The title of the header.\n */\n children: ReactNode;\n}\n\ninterface HeaderType {\n (props: HeaderProps): ReactElement;\n Breadcrumbs: typeof HeaderBreadcrumbs;\n Actions: typeof HeaderActions;\n DocAnchor: typeof HeaderDocAnchor;\n}\n\nexport const Header: HeaderType = ({description, borderBottom, children, variant = 'page', ...others}) => {\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const breadcrumbs = convertedChildren.find((child) => child.type === HeaderBreadcrumbs);\n const actions = convertedChildren.find((child) => child.type === HeaderActions);\n const docAnchor = convertedChildren.find((child) => child.type === HeaderDocAnchor);\n const otherChildren = convertedChildren.filter(\n (child) => child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor\n );\n return (\n <>\n <Group\n position=\"apart\"\n p={variant === 'page' ? 'xl' : undefined}\n pb={variant === 'page' ? 'lg' : undefined}\n {...others}\n >\n <Stack spacing={0}>\n {breadcrumbs}\n <Flex align=\"center\">\n <Title order={variant === 'page' ? 1 : 3} color={variant === 'page' ? 'gray.5' : undefined}>\n {otherChildren}\n </Title>\n {docAnchor}\n </Flex>\n <Text size={variant === 'page' ? 'md' : 'sm'} color=\"gray.6\">\n {description}\n </Text>\n </Stack>\n {actions}\n </Group>\n {borderBottom ? <Divider size=\"xs\" /> : null}\n </>\n );\n};\n\nconst HeaderBreadcrumbs: FunctionComponent<{children: ReactNode}> = ({children}) => (\n <Breadcrumbs\n styles={(theme) => ({\n breadcrumb: {fontSize: theme.fontSizes.sm, fontWeight: 300},\n separator: {color: theme.colors.gray[5]},\n })}\n >\n {children}\n </Breadcrumbs>\n);\n\nconst HeaderActions: FunctionComponent<{children: ReactNode}> = ({children}) => <Group spacing=\"sm\">{children}</Group>;\n\nexport interface HeaderDocAnchorProps {\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n href: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n label?: string;\n}\n\nconst HeaderDocAnchor: FunctionComponent<HeaderDocAnchorProps> = ({href: docLink, label: docLinkTooltipLabel}) => (\n <Tooltip label={docLinkTooltipLabel} disabled={!docLinkTooltipLabel} position=\"right\">\n <Anchor inline href={docLink} target=\"_blank\" ml=\"xs\">\n <QuestionSize16Px height={16} />\n </Anchor>\n </Tooltip>\n);\n\nHeader.Breadcrumbs = HeaderBreadcrumbs;\nHeader.Actions = HeaderActions;\nHeader.DocAnchor = HeaderDocAnchor;\n"],"names":["QuestionSize16Px","Anchor","Breadcrumbs","Divider","Flex","Group","Stack","Text","Title","Tooltip","Children","Header","description","borderBottom","children","variant","others","convertedChildren","toArray","breadcrumbs","find","child","type","HeaderBreadcrumbs","actions","HeaderActions","docAnchor","HeaderDocAnchor","otherChildren","filter","position","p","undefined","pb","spacing","align","order","color","size","styles","theme","breadcrumb","fontSize","fontSizes","sm","fontWeight","separator","colors","gray","href","docLink","label","docLinkTooltipLabel","disabled","inline","target","ml","height","Actions","DocAnchor"],"mappings":";;;;AAAA,SAAQA,gBAAgB,QAAO,8BAA8B;AAC7D,SAAQC,MAAM,EAAEC,WAAW,EAAgBC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,QAAO,gBAAgB;AACnH,SAAQC,QAAQ,QAAmD,QAAQ;AA8B3E,OAAO,IAAMC,SAAqB,iBAAwE;QAAtEC,qBAAAA,aAAaC,sBAAAA,cAAcC,kBAAAA,kCAAUC,SAAAA,sCAAU,yBAAWC;QAA1DJ;QAAaC;QAAcC;QAAUC;;IACrE,IAAME,oBAAoBP,SAASQ,OAAO,CAACJ;IAC3C,IAAMK,cAAcF,kBAAkBG,IAAI,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAKC;;IACrE,IAAMC,UAAUP,kBAAkBG,IAAI,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAKG;;IACjE,IAAMC,YAAYT,kBAAkBG,IAAI,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BAAiByD,QAAQ;;;;;AAKtC9C,OAAOT,WAAW,GAAGqB;AACrBZ,OAAO+C,OAAO,GAAGjC;AACjBd,OAAOgD,SAAS,GAAGhC"}
@@ -0,0 +1,55 @@
1
+ // Vitest Snapshot v1
2
+
3
+ exports[`Header > renders the specified breadcrumbs above the title 1`] = `
4
+ <div>
5
+ <div
6
+ class="mantine-Group-root mantine-1g2mfqe"
7
+ >
8
+ <div
9
+ class="mantine-Stack-root mantine-1fod3h5"
10
+ >
11
+ <div
12
+ class="mantine-Breadcrumbs-root mantine-16ttirm"
13
+ >
14
+ <a
15
+ class="mantine-Text-root mantine-Anchor-root mantine-Breadcrumbs-breadcrumb mantine-1cehd6q"
16
+ >
17
+ One
18
+ </a>
19
+ <div
20
+ class="mantine-Text-root mantine-Breadcrumbs-separator mantine-1mpiak2"
21
+ >
22
+ /
23
+ </div>
24
+ <a
25
+ class="mantine-Text-root mantine-Anchor-root mantine-Breadcrumbs-breadcrumb mantine-1cehd6q"
26
+ >
27
+ Two
28
+ </a>
29
+ <div
30
+ class="mantine-Text-root mantine-Breadcrumbs-separator mantine-1mpiak2"
31
+ >
32
+ /
33
+ </div>
34
+ <a
35
+ class="mantine-Text-root mantine-Anchor-root mantine-Breadcrumbs-breadcrumb mantine-1cehd6q"
36
+ >
37
+ Three
38
+ </a>
39
+ </div>
40
+ <div
41
+ class="mantine-xg7kom"
42
+ >
43
+ <h1
44
+ class="mantine-Text-root mantine-Title-root mantine-jqzr1h"
45
+ >
46
+ Title
47
+ </h1>
48
+ </div>
49
+ <div
50
+ class="mantine-Text-root mantine-1qppuo4"
51
+ />
52
+ </div>
53
+ </div>
54
+ </div>
55
+ `;
@@ -7,7 +7,6 @@ export * from "./header";
7
7
  export * from "./inline-confirm";
8
8
  export * from "./table";
9
9
  export * from "./prompt";
10
- export * from "./modal";
11
10
  export * from "./modal-wizard";
12
11
  export * from "./button";
13
12
  export * from "./menu";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './blank-slate';\nexport * from './code-editor';\nexport * from './collection';\nexport * from './date-range-picker';\nexport * from './sticky-footer';\nexport * from './header';\nexport * from './inline-confirm';\nexport * from './table';\nexport * from './prompt';\nexport * from './modal';\nexport * from './modal-wizard';\nexport * from './button';\nexport * from './menu';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,WAAW;AACzB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,WAAW;AACzB,cAAc,SAAS"}
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './blank-slate';\nexport * from './code-editor';\nexport * from './collection';\nexport * from './date-range-picker';\nexport * from './sticky-footer';\nexport * from './header';\nexport * from './inline-confirm';\nexport * from './table';\nexport * from './prompt';\nexport * from './modal-wizard';\nexport * from './button';\nexport * from './menu';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,WAAW;AACzB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,iBAAiB;AAC/B,cAAc,WAAW;AACzB,cAAc,SAAS"}
@@ -3,8 +3,8 @@ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
3
  import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
4
  import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
5
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- import { Box, createStyles, Modal, Progress } from "@mantine/core";
7
- import { Children, useMemo, useState } from "react";
6
+ import { Box, CloseButton, createStyles, Modal, Progress } from "@mantine/core";
7
+ import { Children, useEffect, useMemo, useState } from "react";
8
8
  import { Button } from "../button";
9
9
  import { Header } from "../header";
10
10
  import { StickyFooter } from "../sticky-footer";
@@ -65,13 +65,26 @@ export var ModalWizard = function(_param) {
65
65
  var isValid = ((_currentStep_props_validateStep1 = currentStep === null || currentStep === void 0 ? void 0 : (_currentStep_props = currentStep.props) === null || _currentStep_props === void 0 ? void 0 : (_currentStep_props_validateStep = _currentStep_props.validateStep) === null || _currentStep_props_validateStep === void 0 ? void 0 : _currentStep_props_validateStep.call(_currentStep_props, currentStepIndex, numberOfSteps)) !== null && _currentStep_props_validateStep1 !== void 0 ? _currentStep_props_validateStep1 : {
66
66
  isValid: true
67
67
  }).isValid;
68
- var isModalDirty = isDirty && isDirty();
69
- var closeModalWizard = function() {
70
- if (isModalDirty && handleDirtyState) {
71
- handleDirtyState() && (onClose === null || onClose === void 0 ? void 0 : onClose());
72
- } else {
73
- onClose === null || onClose === void 0 ? void 0 : onClose();
68
+ useEffect(function() {
69
+ if (opened) {
70
+ setCurrentStepIndex(0);
74
71
  }
72
+ }, [
73
+ opened
74
+ ]);
75
+ var handleClose = function(confirmDirty) {
76
+ if (confirmDirty) {
77
+ var _isDirty;
78
+ var isModalDirty = (_isDirty = isDirty === null || isDirty === void 0 ? void 0 : isDirty()) !== null && _isDirty !== void 0 ? _isDirty : false;
79
+ if (isModalDirty) {
80
+ var _handleDirtyState;
81
+ var discardChanges = (_handleDirtyState = handleDirtyState === null || handleDirtyState === void 0 ? void 0 : handleDirtyState()) !== null && _handleDirtyState !== void 0 ? _handleDirtyState : true;
82
+ if (!discardChanges) {
83
+ return;
84
+ }
85
+ }
86
+ }
87
+ onClose === null || onClose === void 0 ? void 0 : onClose();
75
88
  };
76
89
  var getProgress = function(currStepIndex) {
77
90
  var validSteps = modalSteps.filter(function(step, index) {
@@ -79,6 +92,9 @@ export var ModalWizard = function(_param) {
79
92
  }).length;
80
93
  return validSteps / numberOfStepsCountAsProgress * 100;
81
94
  };
95
+ var resolveStepDependentProp = function(prop) {
96
+ return typeof currentStep.props[prop] === "function" ? currentStep.props[prop](currentStepIndex + 1, numberOfSteps) : currentStep.props[prop];
97
+ };
82
98
  var getProgressMemo = useMemo(function() {
83
99
  return getProgress(currentStepIndex);
84
100
  }, [
@@ -91,33 +107,49 @@ export var ModalWizard = function(_param) {
91
107
  body: cx(body, classNames === null || classNames === void 0 ? void 0 : classNames.body)
92
108
  },
93
109
  centered: true,
94
- title: /*#__PURE__*/ _jsx(Header, {
95
- docLink: currentStep.props.docLink,
96
- docLinkTooltipLabel: currentStep.props.docLinkTooltipLabel,
97
- description: typeof currentStep.props.description === "function" ? currentStep.props.description(currentStepIndex + 1, numberOfSteps) : currentStep.props.description,
98
- py: 0,
99
- px: 0,
100
- children: typeof currentStep.props.title === "function" ? currentStep.props.title(currentStepIndex + 1, numberOfSteps) : currentStep.props.title
101
- }),
102
- onClose: closeModalWizard
110
+ onClose: function() {
111
+ return handleClose(true);
112
+ },
113
+ withCloseButton: false,
114
+ padding: 0
103
115
  }, modalProps), {
104
116
  children: [
117
+ /*#__PURE__*/ _jsxs(Header, {
118
+ p: "lg",
119
+ pr: "md",
120
+ variant: "modal",
121
+ description: resolveStepDependentProp("description"),
122
+ children: [
123
+ resolveStepDependentProp("title"),
124
+ resolveStepDependentProp("docLink") ? /*#__PURE__*/ _jsx(Header.DocAnchor, {
125
+ href: resolveStepDependentProp("docLink"),
126
+ label: resolveStepDependentProp("docLinkTooltipLabel")
127
+ }) : null,
128
+ /*#__PURE__*/ _jsx(Header.Actions, {
129
+ children: /*#__PURE__*/ _jsx(CloseButton, {
130
+ "aria-label": modalProps.closeButtonLabel,
131
+ onClick: function() {
132
+ return handleClose(true);
133
+ }
134
+ })
135
+ })
136
+ ]
137
+ }),
105
138
  currentStep.props.showProgressBar && /*#__PURE__*/ _jsx(Progress, {
106
- color: "teal",
107
- size: "lg",
139
+ color: "navy.5",
140
+ size: "sm",
141
+ radius: 0,
108
142
  value: getProgressMemo
109
143
  }),
110
- currentStep,
111
144
  /*#__PURE__*/ _jsx(Box, {
112
- sx: function(theme) {
113
- return {
114
- marginTop: "auto"
115
- };
145
+ p: "lg",
146
+ children: currentStep
147
+ }),
148
+ /*#__PURE__*/ _jsx(Box, {
149
+ sx: {
150
+ marginTop: "auto"
116
151
  },
117
152
  children: /*#__PURE__*/ _jsxs(StickyFooter, {
118
- px: 0,
119
- pt: "sm",
120
- pb: 0,
121
153
  borderTop: true,
122
154
  children: [
123
155
  /*#__PURE__*/ _jsx(Button, {
@@ -125,7 +157,7 @@ export var ModalWizard = function(_param) {
125
157
  variant: "outline",
126
158
  onClick: function() {
127
159
  if (isFirstStep) {
128
- closeModalWizard();
160
+ handleClose(true);
129
161
  } else {
130
162
  onPrevious === null || onPrevious === void 0 ? void 0 : onPrevious();
131
163
  setCurrentStepIndex(currentStepIndex - 1);
@@ -137,7 +169,8 @@ export var ModalWizard = function(_param) {
137
169
  disabled: !isValid,
138
170
  onClick: function() {
139
171
  if (isLastStep) {
140
- onFinish ? onFinish() : onClose();
172
+ var _onFinish;
173
+ (_onFinish = onFinish === null || onFinish === void 0 ? void 0 : onFinish()) !== null && _onFinish !== void 0 ? _onFinish : handleClose(false);
141
174
  } else {
142
175
  onNext === null || onNext === void 0 ? void 0 : onNext();
143
176
  setCurrentStepIndex(currentStepIndex + 1);