@coveord/plasma-mantine 48.18.0 → 48.21.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 (47) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +6 -6
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/collection/Collection.js +37 -7
  5. package/dist/cjs/components/collection/Collection.js.map +1 -1
  6. package/dist/cjs/components/collection/{Colllection.styles.js → Collection.styles.js} +1 -1
  7. package/dist/cjs/components/collection/Collection.styles.js.map +1 -0
  8. package/dist/cjs/components/collection/CollectionItem.js +4 -4
  9. package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
  10. package/dist/cjs/components/modal-wizard/ModalWizard.js +66 -37
  11. package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
  12. package/dist/cjs/components/modal-wizard/ModalWizardStep.js +1 -4
  13. package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -1
  14. package/dist/cjs/components/sticky-footer/StickyFooter.js +2 -1
  15. package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
  16. package/dist/definitions/components/collection/Collection.d.ts +3 -3
  17. package/dist/definitions/components/collection/Collection.d.ts.map +1 -1
  18. package/dist/definitions/components/collection/{Colllection.styles.d.ts → Collection.styles.d.ts} +1 -1
  19. package/dist/definitions/components/collection/Collection.styles.d.ts.map +1 -0
  20. package/dist/definitions/components/collection/CollectionItem.d.ts +1 -1
  21. package/dist/definitions/components/collection/CollectionItem.d.ts.map +1 -1
  22. package/dist/definitions/components/modal-wizard/ModalWizard.d.ts +8 -2
  23. package/dist/definitions/components/modal-wizard/ModalWizard.d.ts.map +1 -1
  24. package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts +1 -0
  25. package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts.map +1 -1
  26. package/dist/esm/components/collection/Collection.js +37 -7
  27. package/dist/esm/components/collection/Collection.js.map +1 -1
  28. package/dist/esm/components/collection/{Colllection.styles.js → Collection.styles.js} +1 -1
  29. package/dist/esm/components/collection/Collection.styles.js.map +1 -0
  30. package/dist/esm/components/collection/CollectionItem.js +1 -1
  31. package/dist/esm/components/collection/CollectionItem.js.map +1 -1
  32. package/dist/esm/components/modal-wizard/ModalWizard.js +67 -38
  33. package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
  34. package/dist/esm/components/modal-wizard/ModalWizardStep.js +1 -4
  35. package/dist/esm/components/modal-wizard/ModalWizardStep.js.map +1 -1
  36. package/dist/esm/components/sticky-footer/StickyFooter.js +2 -1
  37. package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/components/collection/{Colllection.styles.ts → Collection.styles.ts} +0 -0
  40. package/src/components/collection/Collection.tsx +38 -7
  41. package/src/components/collection/CollectionItem.tsx +1 -1
  42. package/src/components/modal-wizard/ModalWizard.tsx +68 -37
  43. package/src/components/modal-wizard/ModalWizardStep.tsx +2 -3
  44. package/src/components/sticky-footer/StickyFooter.tsx +1 -1
  45. package/dist/cjs/components/collection/Colllection.styles.js.map +0 -1
  46. package/dist/definitions/components/collection/Colllection.styles.d.ts.map +0 -1
  47. package/dist/esm/components/collection/Colllection.styles.js.map +0 -1
@@ -1,10 +1,26 @@
1
- import {Button, Modal, ModalProps, Progress} from '@mantine/core';
1
+ import {Box, Button, createStyles, DefaultProps, Modal, ModalProps, Progress, Selectors} from '@mantine/core';
2
2
  import {Children, ReactElement, useMemo, useState} from 'react';
3
3
  import {StickyFooter} from '../sticky-footer';
4
4
  import {ModalWizardStep} from './ModalWizardStep';
5
5
  import {Header} from '../header';
6
6
 
7
- interface ModalWizardProps extends Omit<ModalProps, 'centered' | 'title'> {
7
+ const useStyles = createStyles(() => ({
8
+ modal: {
9
+ display: 'flex',
10
+ flexDirection: 'column',
11
+ },
12
+ body: {
13
+ flex: 1,
14
+ display: 'flex',
15
+ flexDirection: 'column',
16
+ },
17
+ }));
18
+
19
+ type ModalWizardStylesNames = Selectors<typeof useStyles>;
20
+
21
+ interface ModalWizardProps
22
+ extends Omit<DefaultProps<ModalWizardStylesNames>, 'classNames' | 'styles'>,
23
+ Omit<ModalProps, 'centered' | 'title'> {
8
24
  /**
9
25
  * The label of the cancel button
10
26
  *
@@ -85,9 +101,22 @@ export const ModalWizard: ModalWizardType = ({
85
101
  isDirty,
86
102
  handleDirtyState,
87
103
  classNames,
104
+ className,
105
+ styles,
106
+ unstyled,
88
107
  children,
89
108
  ...modalProps
90
109
  }) => {
110
+ const {
111
+ classes: {modal, body},
112
+ cx,
113
+ } = useStyles(null, {
114
+ name: 'ModalWizard',
115
+ classNames,
116
+ styles,
117
+ unstyled,
118
+ });
119
+
91
120
  const [currentStepIndex, setCurrentStepIndex] = useState(0);
92
121
  const modalSteps = (Children.toArray(children) as ReactElement[]).filter((child) => child.type === ModalWizardStep);
93
122
 
@@ -116,11 +145,10 @@ export const ModalWizard: ModalWizardType = ({
116
145
  };
117
146
 
118
147
  const getProgressMemo = useMemo(() => getProgress(currentStepIndex), [currentStepIndex]);
119
-
120
148
  return (
121
149
  <Modal
122
150
  opened={opened}
123
- classNames={classNames}
151
+ classNames={{modal: cx(modal, classNames?.modal), body: cx(body, classNames?.body)}}
124
152
  centered
125
153
  title={
126
154
  <Header
@@ -143,39 +171,42 @@ export const ModalWizard: ModalWizardType = ({
143
171
  >
144
172
  {currentStep.props.showProgressBar && <Progress color="teal" size="lg" value={getProgressMemo} />}
145
173
  {currentStep}
146
- <StickyFooter py={0} px={0} pt="sm" borderTop>
147
- <Button
148
- name={isFirstStep ? cancelButtonLabel : previousButtonLabel}
149
- disabled={false}
150
- size="sm"
151
- variant="outline"
152
- onClick={() => {
153
- if (isFirstStep) {
154
- closeModalWizard();
155
- } else {
156
- onPrevious?.();
157
- setCurrentStepIndex(currentStepIndex - 1);
158
- }
159
- }}
160
- >
161
- {isFirstStep ? cancelButtonLabel : previousButtonLabel}
162
- </Button>
163
-
164
- <Button
165
- disabled={!isValid}
166
- size="sm"
167
- onClick={() => {
168
- if (isLastStep) {
169
- onFinish ? onFinish() : onClose();
170
- } else {
171
- onNext?.();
172
- setCurrentStepIndex(currentStepIndex + 1);
173
- }
174
- }}
175
- >
176
- {isLastStep ? finishButtonLabel : nextButtonLabel}
177
- </Button>
178
- </StickyFooter>
174
+ <Box
175
+ sx={(theme) => ({
176
+ marginTop: 'auto',
177
+ })}
178
+ >
179
+ <StickyFooter px={0} pt="sm" pb={0} borderTop>
180
+ <Button
181
+ name={isFirstStep ? cancelButtonLabel : previousButtonLabel}
182
+ variant="outline"
183
+ onClick={() => {
184
+ if (isFirstStep) {
185
+ closeModalWizard();
186
+ } else {
187
+ onPrevious?.();
188
+ setCurrentStepIndex(currentStepIndex - 1);
189
+ }
190
+ }}
191
+ >
192
+ {isFirstStep ? cancelButtonLabel : previousButtonLabel}
193
+ </Button>
194
+
195
+ <Button
196
+ disabled={!isValid}
197
+ onClick={() => {
198
+ if (isLastStep) {
199
+ onFinish ? onFinish() : onClose();
200
+ } else {
201
+ onNext?.();
202
+ setCurrentStepIndex(currentStepIndex + 1);
203
+ }
204
+ }}
205
+ >
206
+ {isLastStep ? finishButtonLabel : nextButtonLabel}
207
+ </Button>
208
+ </StickyFooter>
209
+ </Box>
179
210
  </Modal>
180
211
  );
181
212
  };
@@ -41,11 +41,10 @@ export interface ModalWizardStepProps {
41
41
  * @default true
42
42
  */
43
43
  countsAsProgress?: boolean;
44
+ children: ReactElement<any, any>;
44
45
  }
45
46
 
46
- const ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>> = ({children}) => (
47
- <div>{children}</div>
48
- );
47
+ const ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>> = ({children}) => children;
49
48
 
50
49
  ModalWizardStep.defaultProps = {
51
50
  showProgressBar: true,
@@ -28,7 +28,7 @@ export const StickyFooter: FunctionComponent<PropsWithChildren<StickyFooterProps
28
28
  <>
29
29
  {borderTop ? <Divider size="xs" /> : null}
30
30
  <Box className={classes.footer}>
31
- <Group position="right" spacing="xs" py="md" px="xl" {...others}>
31
+ <Group position="right" spacing="xs" pt="md" pb="md" px="xl" {...others}>
32
32
  {children}
33
33
  </Group>
34
34
  </Box>
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/collection/Colllection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {},\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","sm"],"mappings":"AAAA;;;;+BAIA;;;eAAA;;;oBAJ2B;IAI3B,WAAeA,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACpCC,MAAM,CAAC;QACPC,MAAM;YACFC,iBAAiBH,MAAMI,WAAW,KAAK,UAAUJ,MAAMK,KAAK,GAAGL,MAAMM,KAAK;YAC1EC,YAAY;QAChB;QACAC,cAAc;YACVC,WAAWT,MAAMU,OAAO,CAACC,EAAE;QAC/B;IACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Colllection.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Colllection.styles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;CAAG;;;;;;AAE1C,wBASI"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/collection/Colllection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {},\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","sm"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAI3C,eAAeA,aAAa,SAACC;WAAW;QACpCC,MAAM,CAAC;QACPC,MAAM;YACFC,iBAAiBH,MAAMI,WAAW,KAAK,UAAUJ,MAAMK,KAAK,GAAGL,MAAMM,KAAK;YAC1EC,YAAY;QAChB;QACAC,cAAc;YACVC,WAAWT,MAAMU,OAAO,CAACC,EAAE;QAC/B;IACJ;GAAI"}