@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
@@ -14,61 +14,58 @@ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_propert
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  var _plasmaReactIcons = require("@coveord/plasma-react-icons");
16
16
  var _core = require("@mantine/core");
17
- var Header = function(_param) /*#__PURE__*/ {
18
- var description = _param.description, actions = _param.actions, borderBottom = _param.borderBottom, docLink = _param.docLink, docLinkTooltipLabel = _param.docLinkTooltipLabel, children = _param.children, others = _objectWithoutProperties(_param, [
17
+ var _react = require("react");
18
+ var Header = function(_param) {
19
+ var description = _param.description, borderBottom = _param.borderBottom, children = _param.children, _param_variant = _param.variant, variant = _param_variant === void 0 ? "page" : _param_variant, others = _objectWithoutProperties(_param, [
19
20
  "description",
20
- "actions",
21
21
  "borderBottom",
22
- "docLink",
23
- "docLinkTooltipLabel",
24
- "children"
22
+ "children",
23
+ "variant"
25
24
  ]);
26
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
25
+ var convertedChildren = _react.Children.toArray(children);
26
+ var breadcrumbs = convertedChildren.find(function(child) {
27
+ return child.type === HeaderBreadcrumbs;
28
+ });
29
+ var actions = convertedChildren.find(function(child) {
30
+ return child.type === HeaderActions;
31
+ });
32
+ var docAnchor = convertedChildren.find(function(child) {
33
+ return child.type === HeaderDocAnchor;
34
+ });
35
+ var otherChildren = convertedChildren.filter(function(child) {
36
+ return child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor;
37
+ });
38
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
27
39
  children: [
28
40
  /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Group, _objectSpreadProps(_objectSpread({
29
41
  position: "apart",
30
- py: "md",
31
- px: "xl"
42
+ p: variant === "page" ? "xl" : undefined,
43
+ pb: variant === "page" ? "lg" : undefined
32
44
  }, others), {
33
45
  children: [
34
46
  /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Stack, {
35
- spacing: "xs",
47
+ spacing: 0,
36
48
  children: [
37
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Title, {
38
- order: 4,
39
- children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Group, {
40
- spacing: 0,
41
- children: [
42
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Breadcrumbs, {
43
- children: children
44
- }),
45
- docLink ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Tooltip, {
46
- label: docLinkTooltipLabel,
47
- disabled: !docLinkTooltipLabel,
48
- position: "bottom",
49
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Anchor, {
50
- inline: true,
51
- href: docLink,
52
- target: "_blank",
53
- ml: "xs",
54
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plasmaReactIcons.QuestionSize24Px, {
55
- height: 24
56
- })
57
- })
58
- }) : null
59
- ]
60
- })
49
+ breadcrumbs,
50
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Flex, {
51
+ align: "center",
52
+ children: [
53
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Title, {
54
+ order: variant === "page" ? 1 : 3,
55
+ color: variant === "page" ? "gray.5" : undefined,
56
+ children: otherChildren
57
+ }),
58
+ docAnchor
59
+ ]
61
60
  }),
62
61
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Text, {
63
- size: "sm",
62
+ size: variant === "page" ? "md" : "sm",
63
+ color: "gray.6",
64
64
  children: description
65
65
  })
66
66
  ]
67
67
  }),
68
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Group, {
69
- spacing: "xs",
70
- children: actions
71
- })
68
+ actions
72
69
  ]
73
70
  })),
74
71
  borderBottom ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Divider, {
@@ -77,5 +74,49 @@ var Header = function(_param) /*#__PURE__*/ {
77
74
  ]
78
75
  });
79
76
  };
77
+ var HeaderBreadcrumbs = function(param) {
78
+ var children = param.children;
79
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Breadcrumbs, {
80
+ styles: function(theme) {
81
+ return {
82
+ breadcrumb: {
83
+ fontSize: theme.fontSizes.sm,
84
+ fontWeight: 300
85
+ },
86
+ separator: {
87
+ color: theme.colors.gray[5]
88
+ }
89
+ };
90
+ },
91
+ children: children
92
+ });
93
+ };
94
+ var HeaderActions = function(param) {
95
+ var children = param.children;
96
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Group, {
97
+ spacing: "sm",
98
+ children: children
99
+ });
100
+ };
101
+ var HeaderDocAnchor = function(param) {
102
+ var docLink = param.href, docLinkTooltipLabel = param.label;
103
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Tooltip, {
104
+ label: docLinkTooltipLabel,
105
+ disabled: !docLinkTooltipLabel,
106
+ position: "right",
107
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Anchor, {
108
+ inline: true,
109
+ href: docLink,
110
+ target: "_blank",
111
+ ml: "xs",
112
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plasmaReactIcons.QuestionSize16Px, {
113
+ height: 16
114
+ })
115
+ })
116
+ });
117
+ };
118
+ Header.Breadcrumbs = HeaderBreadcrumbs;
119
+ Header.Actions = HeaderActions;
120
+ Header.DocAnchor = HeaderDocAnchor;
80
121
 
81
122
  //# 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":["Header","description","actions","borderBottom","docLink","docLinkTooltipLabel","children","others","Group","position","py","px","Stack","spacing","Title","order","Breadcrumbs","Tooltip","label","disabled","Anchor","inline","href","target","ml","QuestionSize24Px","height","Text","size","Divider"],"mappings":";;;;+BAiCaA;;;eAAAA;;;;;;;gCAjCkB;oBAC8D;AAgCtF,IAAMA,SAAyC,+BASlD;QARAC,qBAAAA,aACAC,iBAAAA,SACAC,sBAAAA,cACAC,iBAAAA,SACAC,6BAAAA,qBACAC,kBAAAA,UACGC;QANHN;QACAC;QACAC;QACAC;QACAC;QACAC;;WAGA;;0BACI,sBAACE,WAAK;gBAACC,UAAS;gBAAQC,IAAG;gBAAKC,IAAG;eAASJ;;kCACxC,sBAACK,WAAK;wBAACC,SAAQ;;0CACX,qBAACC,WAAK;gCAACC,OAAO;0CACV,cAAA,sBAACP,WAAK;oCAACK,SAAS;;sDACZ,qBAACG,iBAAW;sDAAEV;;wCACbF,wBACG,qBAACa,aAAO;4CAACC,OAAOb;4CAAqBc,UAAU,CAACd;4CAAqBI,UAAS;sDAC1E,cAAA,qBAACW,YAAM;gDAACC,MAAM;gDAACC,MAAMlB;gDAASmB,QAAO;gDAASC,IAAG;0DAC7C,cAAA,qBAACC,kCAAgB;oDAACC,QAAQ;;;6CAGlC,IAAI;;;;0CAGhB,qBAACC,UAAI;gCAACC,MAAK;0CAAM3B;;;;kCAErB,qBAACO,WAAK;wBAACK,SAAQ;kCAAMX;;;;YAExBC,6BAAe,qBAAC0B,aAAO;gBAACD,MAAK;iBAAU,IAAI;;;AAC9C"}
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":["Header","description","borderBottom","children","variant","others","convertedChildren","Children","toArray","breadcrumbs","find","child","type","HeaderBreadcrumbs","actions","HeaderActions","docAnchor","HeaderDocAnchor","otherChildren","filter","Group","position","p","undefined","pb","Stack","spacing","Flex","align","Title","order","color","Text","size","Divider","Breadcrumbs","styles","theme","breadcrumb","fontSize","fontSizes","sm","fontWeight","separator","colors","gray","href","docLink","label","docLinkTooltipLabel","Tooltip","disabled","Anchor","inline","target","ml","QuestionSize16Px","height","Actions","DocAnchor"],"mappings":";;;;+BAgCaA;;;eAAAA;;;;;;;gCAhCkB;oBACoE;qBAChC;AA8B5D,IAAMA,SAAqB,iBAAwE;QAAtEC,qBAAAA,aAAaC,sBAAAA,cAAcC,kBAAAA,kCAAUC,SAAAA,sCAAU,yBAAWC;QAA1DJ;QAAaC;QAAcC;QAAUC;;IACrE,IAAME,oBAAoBC,eAAQ,CAACC,OAAO,CAACL;IAC3C,IAAMM,cAAcH,kBAAkBI,IAAI,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAKC;;IACrE,IAAMC,UAAUR,kBAAkBI,IAAI,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAKG;;IACjE,IAAMC,YAAYV,kBAAkBI,IAAI,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAKK;;IACnE,IAAMC,gBAAgBZ,kBAAkBa,MAAM,CAC1C,SAACR;eAAUA,MAAMC,IAAI,KAAKC,qBAAqBF,MAAMC,IAAI,KAAKG,iBAAiBJ,MAAMC,IAAI,KAAKK;;IAElG,qBACI;;0BACI,sBAACG,WAAK;gBACFC,UAAS;gBACTC,GAAGlB,YAAY,SAAS,OAAOmB,SAAS;gBACxCC,IAAIpB,YAAY,SAAS,OAAOmB,SAAS;eACrClB;;kCAEJ,sBAACoB,WAAK;wBAACC,SAAS;;4BACXjB;0CACD,sBAACkB,UAAI;gCAACC,OAAM;;kDACR,qBAACC,WAAK;wCAACC,OAAO1B,YAAY,SAAS,IAAI,CAAC;wCAAE2B,OAAO3B,YAAY,SAAS,WAAWmB,SAAS;kDACrFL;;oCAEJF;;;0CAEL,qBAACgB,UAAI;gCAACC,MAAM7B,YAAY,SAAS,OAAO,IAAI;gCAAE2B,OAAM;0CAC/C9B;;;;oBAGRa;;;YAEJZ,6BAAe,qBAACgC,aAAO;gBAACD,MAAK;iBAAU,IAAI;;;AAGxD;AAEA,IAAMpB,oBAA8D;QAAEV,iBAAAA;yBAClE,qBAACgC,iBAAW;QACRC,QAAQ,SAACC;mBAAW;gBAChBC,YAAY;oBAACC,UAAUF,MAAMG,SAAS,CAACC,EAAE;oBAAEC,YAAY;gBAAG;gBAC1DC,WAAW;oBAACZ,OAAOM,MAAMO,MAAM,CAACC,IAAI,CAAC,EAAE;gBAAA;YAC3C;;kBAEC1C;;;AAIT,IAAMY,gBAA0D;QAAEZ,iBAAAA;yBAAc,qBAACiB,WAAK;QAACM,SAAQ;kBAAMvB;;;AAcrG,IAAMc,kBAA2D;QAAE6B,AAAMC,gBAAND,MAAeE,AAAOC,4BAAPD;yBAC9E,qBAACE,aAAO;QAACF,OAAOC;QAAqBE,UAAU,CAACF;QAAqB5B,UAAS;kBAC1E,cAAA,qBAAC+B,YAAM;YAACC,MAAM;YAACP,MAAMC;YAASO,QAAO;YAASC,IAAG;sBAC7C,cAAA,qBAACC,kCAAgB;gBAACC,QAAQ;;;;;AAKtCzD,OAAOmC,WAAW,GAAGtB;AACrBb,OAAO0D,OAAO,GAAG3C;AACjBf,OAAO2D,SAAS,GAAG1C"}
@@ -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
+ `;
@@ -12,7 +12,6 @@ _exportStar(require("./header"), exports);
12
12
  _exportStar(require("./inline-confirm"), exports);
13
13
  _exportStar(require("./table"), exports);
14
14
  _exportStar(require("./prompt"), exports);
15
- _exportStar(require("./modal"), exports);
16
15
  _exportStar(require("./modal-wizard"), exports);
17
16
  _exportStar(require("./button"), exports);
18
17
  _exportStar(require("./menu"), exports);
@@ -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":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA"}
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":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA"}
@@ -75,13 +75,26 @@ var ModalWizard = function(_param) {
75
75
  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 : {
76
76
  isValid: true
77
77
  }).isValid;
78
- var isModalDirty = isDirty && isDirty();
79
- var closeModalWizard = function() {
80
- if (isModalDirty && handleDirtyState) {
81
- handleDirtyState() && (onClose === null || onClose === void 0 ? void 0 : onClose());
82
- } else {
83
- onClose === null || onClose === void 0 ? void 0 : onClose();
78
+ (0, _react.useEffect)(function() {
79
+ if (opened) {
80
+ setCurrentStepIndex(0);
84
81
  }
82
+ }, [
83
+ opened
84
+ ]);
85
+ var handleClose = function(confirmDirty) {
86
+ if (confirmDirty) {
87
+ var _isDirty;
88
+ var isModalDirty = (_isDirty = isDirty === null || isDirty === void 0 ? void 0 : isDirty()) !== null && _isDirty !== void 0 ? _isDirty : false;
89
+ if (isModalDirty) {
90
+ var _handleDirtyState;
91
+ var discardChanges = (_handleDirtyState = handleDirtyState === null || handleDirtyState === void 0 ? void 0 : handleDirtyState()) !== null && _handleDirtyState !== void 0 ? _handleDirtyState : true;
92
+ if (!discardChanges) {
93
+ return;
94
+ }
95
+ }
96
+ }
97
+ onClose === null || onClose === void 0 ? void 0 : onClose();
85
98
  };
86
99
  var getProgress = function(currStepIndex) {
87
100
  var validSteps = modalSteps.filter(function(step, index) {
@@ -89,6 +102,9 @@ var ModalWizard = function(_param) {
89
102
  }).length;
90
103
  return validSteps / numberOfStepsCountAsProgress * 100;
91
104
  };
105
+ var resolveStepDependentProp = function(prop) {
106
+ return typeof currentStep.props[prop] === "function" ? currentStep.props[prop](currentStepIndex + 1, numberOfSteps) : currentStep.props[prop];
107
+ };
92
108
  var getProgressMemo = (0, _react.useMemo)(function() {
93
109
  return getProgress(currentStepIndex);
94
110
  }, [
@@ -101,33 +117,49 @@ var ModalWizard = function(_param) {
101
117
  body: cx(body, classNames === null || classNames === void 0 ? void 0 : classNames.body)
102
118
  },
103
119
  centered: true,
104
- title: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_header.Header, {
105
- docLink: currentStep.props.docLink,
106
- docLinkTooltipLabel: currentStep.props.docLinkTooltipLabel,
107
- description: typeof currentStep.props.description === "function" ? currentStep.props.description(currentStepIndex + 1, numberOfSteps) : currentStep.props.description,
108
- py: 0,
109
- px: 0,
110
- children: typeof currentStep.props.title === "function" ? currentStep.props.title(currentStepIndex + 1, numberOfSteps) : currentStep.props.title
111
- }),
112
- onClose: closeModalWizard
120
+ onClose: function() {
121
+ return handleClose(true);
122
+ },
123
+ withCloseButton: false,
124
+ padding: 0
113
125
  }, modalProps), {
114
126
  children: [
127
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_header.Header, {
128
+ p: "lg",
129
+ pr: "md",
130
+ variant: "modal",
131
+ description: resolveStepDependentProp("description"),
132
+ children: [
133
+ resolveStepDependentProp("title"),
134
+ resolveStepDependentProp("docLink") ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_header.Header.DocAnchor, {
135
+ href: resolveStepDependentProp("docLink"),
136
+ label: resolveStepDependentProp("docLinkTooltipLabel")
137
+ }) : null,
138
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_header.Header.Actions, {
139
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.CloseButton, {
140
+ "aria-label": modalProps.closeButtonLabel,
141
+ onClick: function() {
142
+ return handleClose(true);
143
+ }
144
+ })
145
+ })
146
+ ]
147
+ }),
115
148
  currentStep.props.showProgressBar && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Progress, {
116
- color: "teal",
117
- size: "lg",
149
+ color: "navy.5",
150
+ size: "sm",
151
+ radius: 0,
118
152
  value: getProgressMemo
119
153
  }),
120
- currentStep,
121
154
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Box, {
122
- sx: function(theme) {
123
- return {
124
- marginTop: "auto"
125
- };
155
+ p: "lg",
156
+ children: currentStep
157
+ }),
158
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Box, {
159
+ sx: {
160
+ marginTop: "auto"
126
161
  },
127
162
  children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_stickyFooter.StickyFooter, {
128
- px: 0,
129
- pt: "sm",
130
- pb: 0,
131
163
  borderTop: true,
132
164
  children: [
133
165
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_button.Button, {
@@ -135,7 +167,7 @@ var ModalWizard = function(_param) {
135
167
  variant: "outline",
136
168
  onClick: function() {
137
169
  if (isFirstStep) {
138
- closeModalWizard();
170
+ handleClose(true);
139
171
  } else {
140
172
  onPrevious === null || onPrevious === void 0 ? void 0 : onPrevious();
141
173
  setCurrentStepIndex(currentStepIndex - 1);
@@ -147,7 +179,8 @@ var ModalWizard = function(_param) {
147
179
  disabled: !isValid,
148
180
  onClick: function() {
149
181
  if (isLastStep) {
150
- onFinish ? onFinish() : onClose();
182
+ var _onFinish;
183
+ (_onFinish = onFinish === null || onFinish === void 0 ? void 0 : onFinish()) !== null && _onFinish !== void 0 ? _onFinish : handleClose(false);
151
184
  } else {
152
185
  onNext === null || onNext === void 0 ? void 0 : onNext();
153
186
  setCurrentStepIndex(currentStepIndex + 1);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Box, createStyles, DefaultProps, Modal, ModalProps, Progress, Selectors} from '@mantine/core';\nimport {Children, ReactElement, useMemo, useState} from 'react';\n\nimport {Button} from '../button';\nimport {Header} from '../header';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep} from './ModalWizardStep';\n\nconst useStyles = createStyles(() => ({\n modal: {\n display: 'flex',\n flexDirection: 'column',\n },\n body: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n}));\n\ntype ModalWizardStylesNames = Selectors<typeof useStyles>;\n\nexport interface ModalWizardProps\n extends Omit<DefaultProps<ModalWizardStylesNames>, 'classNames' | 'styles'>,\n Omit<ModalProps, 'centered' | 'title'> {\n /**\n * The label of the cancel button\n *\n * @default \"Cancel\"\n */\n cancelButtonLabel?: string;\n\n /**\n * The label of the next button\n *\n * @default \"Next\"\n */\n nextButtonLabel?: string;\n\n /**\n * The label of the previous button\n *\n * @default \"Previous\"\n */\n previousButtonLabel?: string;\n\n /**\n * The label of the finish button\n *\n * @default \"Finish\"\n */\n finishButtonLabel?: string;\n\n /**\n * A callback function that is executed when the user clicks on the next button\n */\n onNext?: () => unknown;\n\n /**\n * A callback function that is executed when the user clicks on the previous button\n */\n onPrevious?: () => unknown;\n\n /**\n * A function that is executed when user completes all the steps.\n *\n * @param close A function that closes the modal when called.\n */\n onFinish?: () => unknown;\n\n /**\n * Determine if user interacted with any steps in the modal wizard\n */\n isDirty?: () => boolean;\n\n /**\n * A function to confirm close if the state is dirty before closing\n */\n handleDirtyState?: () => boolean;\n\n /**\n * Children to display in modal wizard\n * */\n children?: Array<ReturnType<typeof ModalWizardStep>>;\n}\n\ninterface ModalWizardType {\n (props: ModalWizardProps): ReactElement;\n\n Step: typeof ModalWizardStep;\n}\n\nexport const ModalWizard: ModalWizardType = ({\n cancelButtonLabel = 'Cancel',\n nextButtonLabel = 'Next',\n previousButtonLabel = 'Previous',\n finishButtonLabel = 'Finish',\n opened,\n onNext,\n onPrevious,\n onClose,\n onFinish,\n isDirty,\n handleDirtyState,\n classNames,\n className,\n styles,\n unstyled,\n children,\n ...modalProps\n}) => {\n const {\n classes: {modal, body},\n cx,\n } = useStyles(null, {\n name: 'ModalWizard',\n classNames,\n styles,\n unstyled,\n });\n\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n const modalSteps = (Children.toArray(children) as ReactElement[]).filter((child) => child.type === ModalWizardStep);\n\n const numberOfSteps = modalSteps.length;\n const numberOfStepsCountAsProgress = modalSteps.filter((step) => step.props.countsAsProgress).length;\n const isFirstStep = currentStepIndex === 0;\n const isLastStep = currentStepIndex === numberOfSteps - 1;\n const currentStep = modalSteps.filter((step: ReactElement, index: number) => index === currentStepIndex)[0];\n\n const {isValid} = currentStep?.props?.validateStep?.(currentStepIndex, numberOfSteps) ?? {isValid: true};\n const isModalDirty = isDirty && isDirty();\n\n const closeModalWizard = () => {\n if (isModalDirty && handleDirtyState) {\n handleDirtyState() && onClose?.();\n } else {\n onClose?.();\n }\n };\n\n const getProgress = (currStepIndex: number) => {\n const validSteps = modalSteps.filter(\n (step, index) => step.props.countsAsProgress && index <= currStepIndex\n ).length;\n return (validSteps / numberOfStepsCountAsProgress) * 100;\n };\n\n const getProgressMemo = useMemo(() => getProgress(currentStepIndex), [currentStepIndex]);\n return (\n <Modal\n opened={opened}\n classNames={{modal: cx(modal, classNames?.modal), body: cx(body, classNames?.body)}}\n centered\n title={\n <Header\n docLink={currentStep.props.docLink}\n docLinkTooltipLabel={currentStep.props.docLinkTooltipLabel}\n description={\n typeof currentStep.props.description === 'function'\n ? currentStep.props.description(currentStepIndex + 1, numberOfSteps)\n : currentStep.props.description\n }\n py={0}\n px={0}\n >\n {typeof currentStep.props.title === 'function'\n ? currentStep.props.title(currentStepIndex + 1, numberOfSteps)\n : currentStep.props.title}\n </Header>\n }\n onClose={closeModalWizard}\n {...modalProps}\n >\n {currentStep.props.showProgressBar && <Progress color=\"teal\" size=\"lg\" value={getProgressMemo} />}\n {currentStep}\n <Box\n sx={(theme) => ({\n marginTop: 'auto',\n })}\n >\n <StickyFooter px={0} pt=\"sm\" pb={0} borderTop>\n <Button\n name={isFirstStep ? cancelButtonLabel : previousButtonLabel}\n variant=\"outline\"\n onClick={() => {\n if (isFirstStep) {\n closeModalWizard();\n } else {\n onPrevious?.();\n setCurrentStepIndex(currentStepIndex - 1);\n }\n }}\n >\n {isFirstStep ? cancelButtonLabel : previousButtonLabel}\n </Button>\n\n <Button\n disabled={!isValid}\n onClick={() => {\n if (isLastStep) {\n onFinish ? onFinish() : onClose();\n } else {\n onNext?.();\n setCurrentStepIndex(currentStepIndex + 1);\n }\n }}\n >\n {isLastStep ? finishButtonLabel : nextButtonLabel}\n </Button>\n </StickyFooter>\n </Box>\n </Modal>\n );\n};\n\nModalWizard.Step = ModalWizardStep;\n"],"names":["ModalWizard","useStyles","createStyles","modal","display","flexDirection","body","flex","cancelButtonLabel","nextButtonLabel","previousButtonLabel","finishButtonLabel","opened","onNext","onPrevious","onClose","onFinish","isDirty","handleDirtyState","classNames","className","styles","unstyled","children","modalProps","currentStep","name","classes","cx","useState","currentStepIndex","setCurrentStepIndex","modalSteps","Children","toArray","filter","child","type","ModalWizardStep","numberOfSteps","length","numberOfStepsCountAsProgress","step","props","countsAsProgress","isFirstStep","isLastStep","index","isValid","validateStep","isModalDirty","closeModalWizard","getProgress","currStepIndex","validSteps","getProgressMemo","useMemo","Modal","centered","title","Header","docLink","docLinkTooltipLabel","description","py","px","showProgressBar","Progress","color","size","value","Box","sx","theme","marginTop","StickyFooter","pt","pb","borderTop","Button","variant","onClick","disabled","Step"],"mappings":";;;;+BA4FaA;;;eAAAA;;;;;;;;oBA5FyE;qBAC9B;sBAEnC;sBACA;4BACM;+BACG;AAE9B,IAAMC,YAAYC,IAAAA,kBAAY,EAAC;WAAO;QAClCC,OAAO;YACHC,SAAS;YACTC,eAAe;QACnB;QACAC,MAAM;YACFC,MAAM;YACNH,SAAS;YACTC,eAAe;QACnB;IACJ;;AA0EO,IAAML,cAA+B,iBAkBtC;0CAjBFQ,mBAAAA,0DAAoB,qEACpBC,iBAAA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C5C,SAASoC;OACL3B;;YAEHC,YAAYkB,KAAK,CAACuB,eAAe,kBAAI,qBAACC,cAAQ;gBAACC,OAAM;gBAAOC,MAAK;gBAAKC,OAAOf;;YAC7E9B;0BACD,qBAAC8C,SAAG;gBACAC,IAAI,SAACC;2BAAW;wBACZC,WAAW;oBACf;;0BAEA,cAAA,sBAACC,0BAAY;oBAACV,IAAI;oBAAGW,IAAG;oBAAKC,IAAI;oBAAGC,SAAS;;sCACzC,qBAACC,cAAM;4BACHrD,MAAMmB,cAAcrC,oBAAoBE,mBAAmB;4BAC3DsE,SAAQ;4BACRC,SAAS,WAAM;gCACX,IAAIpC,aAAa;oCACbM;gCACJ,OAAO;oCACHrC,uBAAAA,wBAAAA,KAAAA,IAAAA;oCACAiB,oBAAoBD,mBAAmB;gCAC3C,CAAC;4BACL;sCAECe,cAAcrC,oBAAoBE,mBAAmB;;sCAG1D,qBAACqE,cAAM;4BACHG,UAAU,CAAClC;4BACXiC,SAAS,WAAM;gCACX,IAAInC,YAAY;oCACZ9B,WAAWA,aAAaD,SAAS;gCACrC,OAAO;oCACHF,mBAAAA,oBAAAA,KAAAA,IAAAA;oCACAkB,oBAAoBD,mBAAmB;gCAC3C,CAAC;4BACL;sCAECgB,aAAanC,oBAAoBF,eAAe;;;;;;;AAMzE;AAEAT,YAAYmF,IAAI,GAAG7C,gCAAe"}
1
+ {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Box, CloseButton, createStyles, DefaultProps, Modal, ModalProps, Progress, Selectors} from '@mantine/core';\nimport {Children, ReactElement, useEffect, useMemo, useState} from 'react';\n\nimport {Button} from '../button';\nimport {Header} from '../header';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep, ModalWizardStepProps, ResolveStep} from './ModalWizardStep';\n\nconst useStyles = createStyles(() => ({\n modal: {\n display: 'flex',\n flexDirection: 'column',\n },\n body: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n}));\n\ntype ModalWizardStylesNames = Selectors<typeof useStyles>;\n\nexport interface ModalWizardProps\n extends Omit<DefaultProps<ModalWizardStylesNames>, 'classNames' | 'styles'>,\n Omit<ModalProps, 'centered' | 'title'> {\n /**\n * The label of the cancel button\n *\n * @default \"Cancel\"\n */\n cancelButtonLabel?: string;\n\n /**\n * The label of the next button\n *\n * @default \"Next\"\n */\n nextButtonLabel?: string;\n\n /**\n * The label of the previous button\n *\n * @default \"Previous\"\n */\n previousButtonLabel?: string;\n\n /**\n * The label of the finish button\n *\n * @default \"Finish\"\n */\n finishButtonLabel?: string;\n\n /**\n * A callback function that is executed when the user clicks on the next button\n */\n onNext?: () => unknown;\n\n /**\n * A callback function that is executed when the user clicks on the previous button\n */\n onPrevious?: () => unknown;\n\n /**\n * A function that is executed when user completes all the steps.\n *\n * @param close A function that closes the modal when called.\n */\n onFinish?: () => unknown;\n\n /**\n * Determine if user interacted with any steps in the modal wizard\n */\n isDirty?: () => boolean;\n\n /**\n * A function to confirm close if the state is dirty before closing\n */\n handleDirtyState?: () => boolean;\n\n /**\n * Children to display in modal wizard\n * */\n children?: Array<ReturnType<typeof ModalWizardStep>>;\n}\n\ninterface ModalWizardType {\n (props: ModalWizardProps): ReactElement;\n\n Step: typeof ModalWizardStep;\n}\n\nexport const ModalWizard: ModalWizardType = ({\n cancelButtonLabel = 'Cancel',\n nextButtonLabel = 'Next',\n previousButtonLabel = 'Previous',\n finishButtonLabel = 'Finish',\n opened,\n onNext,\n onPrevious,\n onClose,\n onFinish,\n isDirty,\n handleDirtyState,\n classNames,\n className,\n styles,\n unstyled,\n children,\n ...modalProps\n}) => {\n const {\n classes: {modal, body},\n cx,\n } = useStyles(null, {\n name: 'ModalWizard',\n classNames,\n styles,\n unstyled,\n });\n\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n const modalSteps = (Children.toArray(children) as ReactElement[]).filter((child) => child.type === ModalWizardStep);\n\n const numberOfSteps = modalSteps.length;\n const numberOfStepsCountAsProgress = modalSteps.filter((step) => step.props.countsAsProgress).length;\n const isFirstStep = currentStepIndex === 0;\n const isLastStep = currentStepIndex === numberOfSteps - 1;\n const currentStep = modalSteps.filter((step: ReactElement, index: number) => index === currentStepIndex)[0];\n\n const {isValid} = currentStep?.props?.validateStep?.(currentStepIndex, numberOfSteps) ?? {isValid: true};\n\n useEffect(() => {\n if (opened) {\n setCurrentStepIndex(0);\n }\n }, [opened]);\n\n const handleClose = (confirmDirty: boolean) => {\n if (confirmDirty) {\n const isModalDirty = isDirty?.() ?? false;\n if (isModalDirty) {\n const discardChanges = handleDirtyState?.() ?? true;\n if (!discardChanges) {\n return;\n }\n }\n }\n onClose?.();\n };\n\n const getProgress = (currStepIndex: number) => {\n const validSteps = modalSteps.filter(\n (step, index) => step.props.countsAsProgress && index <= currStepIndex\n ).length;\n return (validSteps / numberOfStepsCountAsProgress) * 100;\n };\n\n const resolveStepDependentProp = <P extends keyof ModalWizardStepProps>(\n prop: P\n ): ResolveStep<ModalWizardStepProps[P]> =>\n typeof currentStep.props[prop] === 'function'\n ? currentStep.props[prop](currentStepIndex + 1, numberOfSteps)\n : currentStep.props[prop];\n\n const getProgressMemo = useMemo(() => getProgress(currentStepIndex), [currentStepIndex]);\n return (\n <Modal\n opened={opened}\n classNames={{modal: cx(modal, classNames?.modal), body: cx(body, classNames?.body)}}\n centered\n onClose={() => handleClose(true)}\n withCloseButton={false}\n padding={0}\n {...modalProps}\n >\n <Header p=\"lg\" pr=\"md\" variant=\"modal\" description={resolveStepDependentProp('description')}>\n {resolveStepDependentProp('title')}\n {resolveStepDependentProp('docLink') ? (\n <Header.DocAnchor\n href={resolveStepDependentProp('docLink')}\n label={resolveStepDependentProp('docLinkTooltipLabel')}\n />\n ) : null}\n <Header.Actions>\n <CloseButton aria-label={modalProps.closeButtonLabel} onClick={() => handleClose(true)} />\n </Header.Actions>\n </Header>\n {currentStep.props.showProgressBar && (\n <Progress color=\"navy.5\" size=\"sm\" radius={0} value={getProgressMemo} />\n )}\n <Box p=\"lg\">{currentStep}</Box>\n <Box\n sx={{\n marginTop: 'auto',\n }}\n >\n <StickyFooter borderTop>\n <Button\n name={isFirstStep ? cancelButtonLabel : previousButtonLabel}\n variant=\"outline\"\n onClick={() => {\n if (isFirstStep) {\n handleClose(true);\n } else {\n onPrevious?.();\n setCurrentStepIndex(currentStepIndex - 1);\n }\n }}\n >\n {isFirstStep ? cancelButtonLabel : previousButtonLabel}\n </Button>\n\n <Button\n disabled={!isValid}\n onClick={() => {\n if (isLastStep) {\n onFinish?.() ?? handleClose(false);\n } else {\n onNext?.();\n setCurrentStepIndex(currentStepIndex + 1);\n }\n }}\n >\n {isLastStep ? finishButtonLabel : nextButtonLabel}\n </Button>\n </StickyFooter>\n </Box>\n </Modal>\n );\n};\n\nModalWizard.Step = ModalWizardStep;\n"],"names":["ModalWizard","useStyles","createStyles","modal","display","flexDirection","body","flex","cancelButtonLabel","nextButtonLabel","previousButtonLabel","finishButtonLabel","opened","onNext","onPrevious","onClose","onFinish","isDirty","handleDirtyState","classNames","className","styles","unstyled","children","modalProps","currentStep","name","classes","cx","useState","currentStepIndex","setCurrentStepIndex","modalSteps","Children","toArray","filter","child","type","ModalWizardStep","numberOfSteps","length","numberOfStepsCountAsProgress","step","props","countsAsProgress","isFirstStep","isLastStep","index","isValid","validateStep","useEffect","handleClose","confirmDirty","isModalDirty","discardChanges","getProgress","currStepIndex","validSteps","resolveStepDependentProp","prop","getProgressMemo","useMemo","Modal","centered","withCloseButton","padding","Header","p","pr","variant","description","DocAnchor","href","label","Actions","CloseButton","aria-label","closeButtonLabel","onClick","showProgressBar","Progress","color","size","radius","value","Box","sx","marginTop","StickyFooter","borderTop","Button","disabled","Step"],"mappings":";;;;+BA4FaA;;;eAAAA;;;;;;;;oBA5FsF;qBAChC;sBAE9C;sBACA;4BACM;+BACsC;AAEjE,IAAMC,YAAYC,IAAAA,kBAAY,EAAC;WAAO;QAClCC,OAAO;YACHC,SAAS;YACTC,eAAe;QACnB;QACAC,MAAM;Y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Y;wCACZ9B;oCAAAA,CAAAA,YAAAA,qBAAAA,sBAAAA,KAAAA,IAAAA,wBAAAA,uBAAAA,YAAgBmC,YAAY,KAAK,CAAC;gCACtC,OAAO;oCACHtC,mBAAAA,oBAAAA,KAAAA,IAAAA;oCACAkB,oBAAoBD,mBAAmB;gCAC3C,CAAC;4BACL;sCAECgB,aAAanC,oBAAoBF,eAAe;;;;;;;AAMzE;AAEAT,YAAY4F,IAAI,GAAGtD,gCAAe"}
@@ -8,9 +8,12 @@ Object.defineProperty(exports, "ModalWizardStep", {
8
8
  return ModalWizardStep;
9
9
  }
10
10
  });
11
+ var _jsxRuntime = require("react/jsx-runtime");
11
12
  var ModalWizardStep = function(param) {
12
13
  var children = param.children;
13
- return children;
14
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
15
+ children: children
16
+ });
14
17
  };
15
18
  ModalWizardStep.defaultProps = {
16
19
  showProgressBar: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizardStep.tsx"],"sourcesContent":["import {FunctionComponent, PropsWithChildren, ReactElement} from 'react';\n\ntype DependsOnStep<T> = (currentStep: number, numberOfSteps: number) => T;\n\nexport interface ModalWizardStepProps {\n /**\n * The title of the current step. The title can be dependent on the current step if needed\n */\n title?: string | ReactElement | DependsOnStep<string | ReactElement>;\n\n /**\n * The description of the current step. The description can be dependent on the current step if needed\n */\n description?: string | ReactElement | DependsOnStep<string | ReactElement>;\n\n /**\n * A link to the documentation for the current step\n */\n docLink?: string;\n\n /**\n * A tooltip label for the docLink\n */\n docLinkTooltipLabel?: string | ReactElement | DependsOnStep<string | ReactElement>;\n\n /**\n * A function to validate the current step, it determines if the next step should be enabled or not.\n */\n validateStep: (currentStep: any, numberOfSteps: any) => {isValid: boolean; messsage?: unknown};\n\n /**\n * Show progress bar at this step\n *\n * @default true\n */\n showProgressBar?: boolean;\n\n /**\n * Does completion of current step count moves the progress bar\n *\n * @default true\n */\n countsAsProgress?: boolean;\n children: ReactElement<any, any>;\n}\n\nconst ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>> = ({children}) => children;\n\nModalWizardStep.defaultProps = {\n showProgressBar: true,\n countsAsProgress: true,\n};\n\nexport {ModalWizardStep};\n"],"names":["ModalWizardStep","children","defaultProps","showProgressBar","countsAsProgress"],"mappings":";;;;+BAqDQA;;;eAAAA;;;AAPR,IAAMA,kBAA8E;QAAEC,iBAAAA;WAAcA;;AAEpGD,gBAAgBE,YAAY,GAAG;IAC3BC,iBAAiB,IAAI;IACrBC,kBAAkB,IAAI;AAC1B"}
1
+ {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizardStep.tsx"],"sourcesContent":["import {FunctionComponent, PropsWithChildren, ReactNode} from 'react';\n\ntype DependsOnStep<T> = (currentStep: number, numberOfSteps: number) => T;\nexport type ResolveStep<P> = P extends infer T | DependsOnStep<infer T> ? T : never;\n\nexport interface ModalWizardStepProps {\n /**\n * The title of the current step. The title can be dependent on the current step if needed\n */\n title?: ReactNode | DependsOnStep<ReactNode>;\n\n /**\n * The description of the current step. The description can be dependent on the current step if needed\n */\n description?: string | DependsOnStep<string>;\n\n /**\n * A link to the documentation for the current step\n */\n docLink?: string | DependsOnStep<string>;\n\n /**\n * A tooltip label for the docLink\n */\n docLinkTooltipLabel?: string | DependsOnStep<string>;\n\n /**\n * A function to validate the current step, it determines if the next step should be enabled or not.\n */\n validateStep: (currentStep: any, numberOfSteps: any) => {isValid: boolean; messsage?: unknown};\n\n /**\n * Show progress bar at this step\n *\n * @default true\n */\n showProgressBar?: boolean;\n\n /**\n * Does completion of current step count moves the progress bar\n *\n * @default true\n */\n countsAsProgress?: boolean;\n}\n\nconst ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>> = ({children}) => <>{children}</>;\n\nModalWizardStep.defaultProps = {\n showProgressBar: true,\n countsAsProgress: true,\n};\n\nexport {ModalWizardStep};\n"],"names":["ModalWizardStep","children","defaultProps","showProgressBar","countsAsProgress"],"mappings":";;;;+BAqDQA;;;eAAAA;;;;AAPR,IAAMA,kBAA8E;QAAEC,iBAAAA;yBAAc;kBAAGA;;;AAEvGD,gBAAgBE,YAAY,GAAG;IAC3BC,iBAAiB,IAAI;IACrBC,kBAAkB,IAAI;AAC1B"}
@@ -38,10 +38,8 @@ var StickyFooter = function(_param) {
38
38
  className: classes.footer,
39
39
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Group, _objectSpreadProps(_objectSpread({
40
40
  position: "right",
41
- spacing: "xs",
42
- pt: "md",
43
- pb: "md",
44
- px: "xl"
41
+ spacing: "sm",
42
+ p: "lg"
45
43
  }, others), {
46
44
  children: children
47
45
  }))
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {Box, createStyles, DefaultProps, Divider, Group} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nexport interface StickyFooterProps extends DefaultProps {\n /**\n * Whether a border is render on top of the footer\n */\n borderTop?: boolean;\n}\n\nconst useStyles = createStyles(() => ({\n footer: {\n position: 'sticky',\n bottom: 0,\n zIndex: 1,\n backgroundColor: 'white',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<PropsWithChildren<StickyFooterProps>> = ({\n borderTop,\n children,\n ...others\n}) => {\n const {classes} = useStyles();\n\n return (\n <>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Box className={classes.footer}>\n <Group position=\"right\" spacing=\"xs\" pt=\"md\" pb=\"md\" px=\"xl\" {...others}>\n {children}\n </Group>\n </Box>\n </>\n );\n};\n"],"names":["StickyFooter","useStyles","createStyles","footer","position","bottom","zIndex","backgroundColor","borderTop","children","others","classes","Divider","size","Box","className","Group","spacing","pt","pb","px"],"mappings":";;;;+BAmBaA;;;eAAAA;;;;;;;oBAnBiD;AAU9D,IAAMC,YAAYC,IAAAA,kBAAY,EAAC;WAAO;QAClCC,QAAQ;YACJC,UAAU;YACVC,QAAQ;YACRC,QAAQ;YACRC,iBAAiB;QACrB;IACJ;;AAEO,IAAMP,eAAwE,iBAI/E;QAHFQ,mBAAAA,WACAC,kBAAAA,UACGC;QAFHF;QACAC;;IAGA,IAAM,AAACE,UAAWV,YAAXU;IAEP,qBACI;;YACKH,0BAAY,qBAACI,aAAO;gBAACC,MAAK;iBAAU,IAAI;0BACzC,qBAACC,SAAG;gBAACC,WAAWJ,QAAQR,MAAM;0BAC1B,cAAA,qBAACa,WAAK;oBAACZ,UAAS;oBAAQa,SAAQ;oBAAKC,IAAG;oBAAKC,IAAG;oBAAKC,IAAG;mBAASV;8BAC5DD;;;;;AAKrB"}
1
+ {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {Box, createStyles, DefaultProps, Divider, Group} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nexport interface StickyFooterProps extends DefaultProps {\n /**\n * Whether a border is render on top of the footer\n */\n borderTop?: boolean;\n}\n\nconst useStyles = createStyles(() => ({\n footer: {\n position: 'sticky',\n bottom: 0,\n zIndex: 1,\n backgroundColor: 'white',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<PropsWithChildren<StickyFooterProps>> = ({\n borderTop,\n children,\n ...others\n}) => {\n const {classes} = useStyles();\n\n return (\n <>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Box className={classes.footer}>\n <Group position=\"right\" spacing=\"sm\" p=\"lg\" {...others}>\n {children}\n </Group>\n </Box>\n </>\n );\n};\n"],"names":["StickyFooter","useStyles","createStyles","footer","position","bottom","zIndex","backgroundColor","borderTop","children","others","classes","Divider","size","Box","className","Group","spacing","p"],"mappings":";;;;+BAmBaA;;;eAAAA;;;;;;;oBAnBiD;AAU9D,IAAMC,YAAYC,IAAAA,kBAAY,EAAC;WAAO;QAClCC,QAAQ;YACJC,UAAU;YACVC,QAAQ;YACRC,QAAQ;YACRC,iBAAiB;QACrB;IACJ;;AAEO,IAAMP,eAAwE,iBAI/E;QAHFQ,mBAAAA,WACAC,kBAAAA,UACGC;QAFHF;QACAC;;IAGA,IAAM,AAACE,UAAWV,YAAXU;IAEP,qBACI;;YACKH,0BAAY,qBAACI,aAAO;gBAACC,MAAK;iBAAU,IAAI;0BACzC,qBAACC,SAAG;gBAACC,WAAWJ,QAAQR,MAAM;0BAC1B,cAAA,qBAACa,WAAK;oBAACZ,UAAS;oBAAQa,SAAQ;oBAAKC,GAAE;mBAASR;8BAC3CD;;;;;AAKrB"}
package/dist/cjs/index.js CHANGED
@@ -18,9 +18,6 @@ _export(exports, {
18
18
  Table: function() {
19
19
  return _components.Table;
20
20
  },
21
- Modal: function() {
22
- return _components.Modal;
23
- },
24
21
  Button: function() {
25
22
  return _components.Button;
26
23
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import {Tuple} from '@mantine/core';\n\nimport {PlasmaColors} from './theme/PlasmaColors';\n\nexport * from '@mantine/notifications';\nexport * from '@mantine/carousel';\nexport * from '@mantine/core';\nexport type {FormValidateInput} from '@mantine/form/lib/types';\nexport * from '@mantine/hooks';\nexport * from '@tanstack/table-core';\nexport * from './components';\nexport * from '@mantine/form';\nexport {type NotificationProps} from '@mantine/notifications';\nexport {Pagination} from '@mantine/core';\n// explicitly overriding mantine components\nexport {\n Header,\n Table,\n type TableProps,\n type TableState,\n type InitialTableState,\n type HeaderProps,\n Modal,\n Button,\n type ButtonProps,\n Menu,\n type MenuItemProps,\n} from './components';\nexport {useForm, createFormContext} from './form';\n\nexport * from './theme';\n\ndeclare module '@mantine/core' {\n export interface MantineThemeColorsOverride {\n // eslint-disable-next-line @typescript-eslint/ban-types\n colors: Record<keyof typeof PlasmaColors | (string & {}), Tuple<string, 10>>;\n }\n}\n"],"names":["Pagination","Header","Table","Modal","Button","Menu","useForm","createFormContext"],"mappings":";;;;;;;;;;;IAaQA,UAAU;eAAVA,gBAAU;;IAGdC,MAAM;eAANA,kBAAM;;IACNC,KAAK;eAALA,iBAAK;;IAKLC,KAAK;eAALA,iBAAK;;IACLC,MAAM;eAANA,kBAAM;;IAENC,IAAI;eAAJA,gBAAI;;IAGAC,OAAO;eAAPA,aAAO;;IAAEC,iBAAiB;eAAjBA,uBAAiB;;;;oBAxBpB;oBACA;gCACA;oBAEA;oBACA;sCACA;oBACA;oBAiB2B;oBAE3B"}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import {Tuple} from '@mantine/core';\n\nimport {PlasmaColors} from './theme/PlasmaColors';\n\nexport * from '@mantine/notifications';\nexport * from '@mantine/carousel';\nexport * from '@mantine/core';\nexport type {FormValidateInput} from '@mantine/form/lib/types';\nexport * from '@mantine/hooks';\nexport * from '@tanstack/table-core';\nexport * from './components';\nexport * from '@mantine/form';\nexport {type NotificationProps} from '@mantine/notifications';\nexport {Pagination} from '@mantine/core';\n// explicitly overriding mantine components\nexport {\n Header,\n type HeaderProps,\n Table,\n type TableProps,\n type TableState,\n type InitialTableState,\n Button,\n type ButtonProps,\n Menu,\n type MenuItemProps,\n} from './components';\nexport {useForm, createFormContext} from './form';\n\nexport * from './theme';\n\ndeclare module '@mantine/core' {\n export interface MantineThemeColorsOverride {\n // eslint-disable-next-line @typescript-eslint/ban-types\n colors: Record<keyof typeof PlasmaColors | (string & {}), Tuple<string, 10>>;\n }\n}\n"],"names":["Pagination","Header","Table","Button","Menu","useForm","createFormContext"],"mappings":";;;;;;;;;;;IAaQA,UAAU;eAAVA,gBAAU;;IAGdC,MAAM;eAANA,kBAAM;;IAENC,KAAK;eAALA,iBAAK;;IAILC,MAAM;eAANA,kBAAM;;IAENC,IAAI;eAAJA,gBAAI;;IAGAC,OAAO;eAAPA,aAAO;;IAAEC,iBAAiB;eAAjBA,uBAAiB;;;;oBAvBpB;oBACA;gCACA;oBAEA;oBACA;sCACA;oBACA;oBAgB2B;oBAE3B"}
@@ -19,6 +19,7 @@ var plasmaTheme = {
19
19
  fontFamily: "canada-type-gibson, sans-serif",
20
20
  black: _plasmaTokens.color.primary.gray[9],
21
21
  defaultRadius: 8,
22
+ lineHeight: 1.5,
22
23
  spacing: {
23
24
  xs: 8,
24
25
  sm: 16,
@@ -33,32 +34,32 @@ var plasmaTheme = {
33
34
  sizes: {
34
35
  h1: {
35
36
  fontSize: 48,
36
- lineHeight: "56px",
37
+ lineHeight: undefined,
37
38
  fontWeight: 300
38
39
  },
39
40
  h2: {
40
41
  fontSize: 32,
41
- lineHeight: "40px",
42
+ lineHeight: undefined,
42
43
  fontWeight: 500
43
44
  },
44
45
  h3: {
45
46
  fontSize: 24,
46
- lineHeight: "32px",
47
+ lineHeight: undefined,
47
48
  fontWeight: 500
48
49
  },
49
50
  h4: {
50
51
  fontSize: 18,
51
- lineHeight: "28px",
52
+ lineHeight: undefined,
52
53
  fontWeight: 300
53
54
  },
54
55
  h5: {
55
56
  fontSize: 14,
56
- lineHeight: "20px",
57
+ lineHeight: undefined,
57
58
  fontWeight: 500
58
59
  },
59
60
  h6: {
60
61
  fontSize: 12,
61
- lineHeight: "16px",
62
+ lineHeight: undefined,
62
63
  fontWeight: 500
63
64
  }
64
65
  }
@@ -90,13 +91,17 @@ var plasmaTheme = {
90
91
  return {
91
92
  root: {
92
93
  "&:is(h1,h2,h3,h4,h5,h6)": {
93
- letterSpacing: "0.011em",
94
- color: theme.colors.gray[9]
94
+ letterSpacing: "0.011em"
95
95
  }
96
96
  }
97
97
  };
98
98
  }
99
99
  },
100
+ Text: {
101
+ defaultProps: {
102
+ weight: 300
103
+ }
104
+ },
100
105
  Button: {
101
106
  styles: function(theme, params) {
102
107
  return {
@@ -121,7 +126,11 @@ var plasmaTheme = {
121
126
  lg: 1334,
122
127
  xl: "85%"
123
128
  }
124
- })
129
+ }),
130
+ overflow: "auto"
131
+ },
132
+ title: {
133
+ width: "100%"
125
134
  }
126
135
  };
127
136
  },
@@ -137,11 +146,9 @@ var plasmaTheme = {
137
146
  styles: function(theme) {
138
147
  return {
139
148
  label: {
140
- marginBottom: theme.spacing.xs,
141
- lineHeight: "20px"
149
+ marginBottom: theme.spacing.xs
142
150
  },
143
151
  description: {
144
- lineHeight: "20px",
145
152
  fontSize: theme.fontSizes.sm,
146
153
  color: theme.colors.gray[7],
147
154
  marginBottom: theme.spacing.xs
@@ -169,13 +176,6 @@ var plasmaTheme = {
169
176
  multiline: true
170
177
  }
171
178
  },
172
- Breadcrumbs: {
173
- defaultProps: {
174
- separator: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plasmaReactIcons.ArrowHeadRightSize24Px, {
175
- height: 24
176
- })
177
- }
178
- },
179
179
  Loader: {
180
180
  defaultProps: {
181
181
  variant: "dots",