@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
@@ -20,7 +20,7 @@ var _hooks = require("@mantine/hooks");
20
20
  var _reactBeautifulDnd = require("react-beautiful-dnd");
21
21
  var _hooks1 = require("../../hooks");
22
22
  var _collectionItem = require("./CollectionItem");
23
- var _colllectionStyles = /*#__PURE__*/ _interopRequireDefault(require("./Colllection.styles"));
23
+ var _collectionStyles = /*#__PURE__*/ _interopRequireDefault(require("./Collection.styles"));
24
24
  var defaultProps = {
25
25
  draggable: false,
26
26
  addLabel: "Add item",
@@ -30,7 +30,7 @@ var defaultProps = {
30
30
  required: false
31
31
  };
32
32
  var Collection = function(props) {
33
- var _useComponentDefaultProps = (0, _core.useComponentDefaultProps)("Collection", defaultProps, props), value = _useComponentDefaultProps.value, defaultValue = _useComponentDefaultProps.defaultValue, onChange = _useComponentDefaultProps.onChange, onRemoveItem = _useComponentDefaultProps.onRemoveItem, disabled = _useComponentDefaultProps.disabled, draggable = _useComponentDefaultProps.draggable, children = _useComponentDefaultProps.children, spacing = _useComponentDefaultProps.spacing, required = _useComponentDefaultProps.required, newItem = _useComponentDefaultProps.newItem, addLabel = _useComponentDefaultProps.addLabel, addDisabledTooltip = _useComponentDefaultProps.addDisabledTooltip, allowAdd = _useComponentDefaultProps.allowAdd, // Style props
33
+ var _useComponentDefaultProps = (0, _core.useComponentDefaultProps)("Collection", defaultProps, props), value = _useComponentDefaultProps.value, defaultValue = _useComponentDefaultProps.defaultValue, onChange = _useComponentDefaultProps.onChange, onRemoveItem = _useComponentDefaultProps.onRemoveItem, disabled = _useComponentDefaultProps.disabled, draggable = _useComponentDefaultProps.draggable, children = _useComponentDefaultProps.children, spacing = _useComponentDefaultProps.spacing, required = _useComponentDefaultProps.required, newItem = _useComponentDefaultProps.newItem, addLabel = _useComponentDefaultProps.addLabel, addDisabledTooltip = _useComponentDefaultProps.addDisabledTooltip, allowAdd = _useComponentDefaultProps.allowAdd, label = _useComponentDefaultProps.label, labelProps = _useComponentDefaultProps.labelProps, description = _useComponentDefaultProps.description, descriptionProps = _useComponentDefaultProps.descriptionProps, error = _useComponentDefaultProps.error, errorProps = _useComponentDefaultProps.errorProps, // Style props
34
34
  classNames = _useComponentDefaultProps.classNames, className = _useComponentDefaultProps.className, styles = _useComponentDefaultProps.styles, unstyled = _useComponentDefaultProps.unstyled, others = _objectWithoutProperties(_useComponentDefaultProps, [
35
35
  "value",
36
36
  "defaultValue",
@@ -45,12 +45,18 @@ var Collection = function(props) {
45
45
  "addLabel",
46
46
  "addDisabledTooltip",
47
47
  "allowAdd",
48
+ "label",
49
+ "labelProps",
50
+ "description",
51
+ "descriptionProps",
52
+ "error",
53
+ "errorProps",
48
54
  "classNames",
49
55
  "className",
50
56
  "styles",
51
57
  "unstyled"
52
58
  ]);
53
- var _useStyles = (0, _colllectionStyles.default)(null, {
59
+ var _useStyles = (0, _collectionStyles.default)(null, {
54
60
  classNames: classNames,
55
61
  name: "Collection",
56
62
  styles: styles,
@@ -69,6 +75,24 @@ var Collection = function(props) {
69
75
  onRemoveItem === null || onRemoveItem === void 0 ? void 0 : onRemoveItem(index);
70
76
  };
71
77
  };
78
+ var _label = label ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Input.Label, _objectSpreadProps(_objectSpread({
79
+ required: required
80
+ }, labelProps), {
81
+ children: label
82
+ })) : null;
83
+ var _description = description ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Input.Description, _objectSpreadProps(_objectSpread({}, descriptionProps), {
84
+ children: description
85
+ })) : null;
86
+ var _error = error ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Input.Error, _objectSpreadProps(_objectSpread({}, errorProps), {
87
+ children: error
88
+ })) : null;
89
+ var _header = _label || _description ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Stack, {
90
+ spacing: "xs",
91
+ children: [
92
+ _label,
93
+ _description
94
+ ]
95
+ }) : null;
72
96
  var items = values.map(function(item, index) {
73
97
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_collectionItem.CollectionItem, {
74
98
  disabled: disabled,
@@ -118,11 +142,17 @@ var Collection = function(props) {
118
142
  className: cx(classes.root, className)
119
143
  }), others), {
120
144
  children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Stack, {
121
- spacing: spacing,
122
145
  children: [
123
- items,
124
- provided.placeholder,
125
- _addButton
146
+ _header,
147
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Stack, {
148
+ spacing: spacing,
149
+ children: [
150
+ items,
151
+ provided.placeholder,
152
+ _addButton,
153
+ _error
154
+ ]
155
+ })
126
156
  ]
127
157
  })
128
158
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n Button,\n DefaultProps,\n Group,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {useId} from '@mantine/hooks';\nimport {ReactNode} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport {useControlledList} from '../../hooks';\nimport {CollectionItem} from './CollectionItem';\nimport useStyles from './Colllection.styles';\n\ninterface CollectionProps<T> extends DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * The initial items of the collection (for uncontrolled usage only)\n */\n defaultValue?: T[];\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n defaultValue,\n onChange,\n onRemoveItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId('dnd-droppable');\n\n const [values, {append, remove, reorder}] = useControlledList({value, onChange, defaultValue});\n const hasOnlyOneItem = values.length === 1;\n const removeItem = (index: number) => () => {\n remove(index);\n onRemoveItem?.(index);\n };\n\n const items = values.map((item, index) => (\n <CollectionItem\n key={index}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={removeItem(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(values) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => append(newItem)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => reorder({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["Collection","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","props","useComponentDefaultProps","value","defaultValue","onChange","onRemoveItem","children","newItem","allowAdd","classNames","className","styles","unstyled","others","useStyles","name","classes","cx","collectionID","useId","useControlledList","values","append","remove","reorder","hasOnlyOneItem","length","removeItem","index","items","map","item","CollectionItem","onRemove","removable","addAllowed","_addButton","Group","Tooltip","label","Box","Button","variant","leftIcon","AddSize16Px","height","onClick","DragDropContext","onDragEnd","destination","source","from","to","Droppable","direction","droppableId","provided","droppableProps","ref","innerRef","root","Stack","placeholder"],"mappings":"AAAA;;;;+BAgHaA;;;eAAAA;;;;;;;;;gCAhHa;oBAWnB;qBACa;iCAEqB;sBAET;8BACH;sEACP;AAqFtB,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;AACnB;AAEO,IAAMP,aAAa,SAAKQ,OAA8B;IACzD,IAsBIC,4BAAAA,IAAAA,8BAAwB,EAAC,cAAcR,cAAoCO,QArB3EE,QAqBAD,0BArBAC,OACAC,eAoBAF,0BApBAE,cACAC,WAmBAH,0BAnBAG,UACAC,eAkBAJ,0BAlBAI,cACAR,WAiBAI,0BAjBAJ,UACAH,YAgBAO,0BAhBAP,WACAY,WAeAL,0BAfAK,UACAR,UAcAG,0BAdAH,SACAC,WAaAE,0BAbAF,UACAQ,UAYAN,0BAZAM,SACAZ,WAWAM,0BAXAN,UACAC,qBAUAK,0BAVAL,oBACAY,WASAP,0BATAO,UAEA,cAAc;IACdC,aAMAR,0BANAQ,YACAC,YAKAT,0BALAS,WACAC,SAIAV,0BAJAU,QACAC,WAGAX,0BAHAW,UAEGC,kCACHZ;QArBAC;QACAC;QACAC;QACAC;QACAR;QACAH;QACAY;QACAR;QACAC;QACAQ;QACAZ;QACAC;QACAY;QAGAC;QACAC;QACAC;QACAC;;IAIJ,IAAsBE,aAAAA,IAAAA,0BAAS,EAAC,IAAI,EAAE;QAACL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KAAK;gBAAEwB,IAAIH,CAAAA,wBAAAA,yBAAAA,KAAAA,IAAAA,YAAarB,KAAK,AAAD,KAAK;YAAC;;kBAE9F,cAAA,qBAACyB,4BAAS;YAACC,WAAU;YAAWC,aAAarC;sBACxC,SAACsC;qCACE,qBAAChB,SAAG,wEACIgB,SAASC,cAAc;oBAC3BC,KAAKF,SAASG,QAAQ;oBACtBjD,WAAWO,GAAGD,QAAQ4C,IAAI,EAAElD;oBACxBG;8BAEJ,cAAA,sBAACgD,WAAK;wBAAC/D,SAASA;;4BACX+B;4BACA2B,SAASM,WAAW;4BACpB1B;;;;;;;AAO7B"}
1
+ {"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n Button,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {useId} from '@mantine/hooks';\nimport {ReactNode} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\nimport {useControlledList} from '../../hooks';\nimport {CollectionItem} from './CollectionItem';\nimport useStyles from './Collection.styles';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * The initial items of the collection (for uncontrolled usage only)\n */\n defaultValue?: T[];\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n defaultValue,\n onChange,\n onRemoveItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n description,\n descriptionProps,\n error,\n errorProps,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId('dnd-droppable');\n\n const [values, {append, remove, reorder}] = useControlledList({value, onChange, defaultValue});\n const hasOnlyOneItem = values.length === 1;\n const removeItem = (index: number) => () => {\n remove(index);\n onRemoveItem?.(index);\n };\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <Stack spacing=\"xs\">\n {_label}\n {_description}\n </Stack>\n ) : null;\n\n const items = values.map((item, index) => (\n <CollectionItem\n key={index}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={removeItem(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(values) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => append(newItem)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => reorder({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n <Stack>\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["Collection","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","props","useComponentDefaultProps","value","defaultValue","onChange","onRemoveItem","children","newItem","allowAdd","label","labelProps","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","useStyles","name","classes","cx","collectionID","useId","useControlledList","values","append","remove","reorder","hasOnlyOneItem","length","removeItem","index","_label","Input","Label","_description","Description","_error","Error","_header","Stack","items","map","item","CollectionItem","onRemove","removable","addAllowed","_addButton","Group","Tooltip","Box","Button","variant","leftIcon","AddSize16Px","height","onClick","DragDropContext","onDragEnd","destination","source","from","to","Droppable","direction","droppableId","provided","droppableProps","ref","innerRef","root","placeholder"],"mappings":"AAAA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BAAW;wBAACC,QAAQ;;oBAC/BC,SAAS;+BAAMhC,OAAOrB;;oBACtBV,UAAU,CAACqD;8BAEVvD;;;;MAKpB;IAED,qBACI,qBAACkE,kCAAe;QACZC,WAAW;gBAAEC,oBAAAA,aAAaC,eAAAA;YAAYlC,OAAAA,QAAQ;gBAACmC,MAAMD,OAAO9B,KAAK;gBAAEgC,IAAIH,CAAAA,wBAAAA,yBAAAA,KAAAA,IAAAA,YAAa7B,KAAK,AAAD,KAAK;YAAC;;kBAE9F,cAAA,qBAACiC,4BAAS;YAACC,WAAU;YAAWC,aAAa7C;sBACxC,SAAC8C;qCACE,qBAAChB,SAAG,wEACIgB,SAASC,cAAc;oBAC3BC,KAAKF,SAASG,QAAQ;oBACtBzD,WAAWO,GAAGD,QAAQoD,IAAI,EAAE1D;oBACxBG;8BAEJ,cAAA,sBAACwB,WAAK;;4BACDD;0CACD,sBAACC,WAAK;gCAAC7C,SAASA;;oCACX8C;oCACA0B,SAASK,WAAW;oCACpBxB;oCACAX;;;;;;;;;AAQjC"}
@@ -22,4 +22,4 @@ var _default = (0, _core.createStyles)(function(theme) {
22
22
  };
23
23
  });
24
24
 
25
- //# sourceMappingURL=Colllection.styles.js.map
25
+ //# sourceMappingURL=Collection.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/collection/Collection.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"}
@@ -17,7 +17,7 @@ var _jsxRuntime = require("react/jsx-runtime");
17
17
  var _plasmaReactIcons = require("@coveord/plasma-react-icons");
18
18
  var _core = require("@mantine/core");
19
19
  var _reactBeautifulDnd = require("react-beautiful-dnd");
20
- var _colllectionStyles = /*#__PURE__*/ _interopRequireDefault(require("./Colllection.styles"));
20
+ var _collectionStyles = /*#__PURE__*/ _interopRequireDefault(require("./Collection.styles"));
21
21
  var RemoveButton = function(param) {
22
22
  var onClick = param.onClick;
23
23
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.ActionIcon, {
@@ -38,7 +38,7 @@ var RemoveButtonPlaceholder = function() {
38
38
  };
39
39
  var StaticCollectionItem = function(param) {
40
40
  var onRemove = param.onRemove, _param_removable = param.removable, removable = _param_removable === void 0 ? true : _param_removable, styles = param.styles, children = param.children;
41
- var _useStyles = (0, _colllectionStyles.default)(null, {
41
+ var _useStyles = (0, _collectionStyles.default)(null, {
42
42
  name: "Collection",
43
43
  styles: styles
44
44
  }), classes = _useStyles.classes, cx = _useStyles.cx;
@@ -55,7 +55,7 @@ var StaticCollectionItem = function(param) {
55
55
  };
56
56
  var DisabledCollectionItem = function(param) {
57
57
  var children = param.children;
58
- var _useStyles = (0, _colllectionStyles.default)(), classes = _useStyles.classes, cx = _useStyles.cx;
58
+ var _useStyles = (0, _collectionStyles.default)(), classes = _useStyles.classes, cx = _useStyles.cx;
59
59
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Group, {
60
60
  className: cx(classes.item),
61
61
  children: children
@@ -63,7 +63,7 @@ var DisabledCollectionItem = function(param) {
63
63
  };
64
64
  var DraggableCollectionItem = function(param) {
65
65
  var index = param.index, onRemove = param.onRemove, _param_removable = param.removable, removable = _param_removable === void 0 ? true : _param_removable, styles = param.styles, children = param.children;
66
- var _useStyles = (0, _colllectionStyles.default)(null, {
66
+ var _useStyles = (0, _collectionStyles.default)(null, {
67
67
  name: "Collection",
68
68
  styles: styles
69
69
  }), classes = _useStyles.classes, cx = _useStyles.cx;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize16Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\nimport {Draggable} from 'react-beautiful-dnd';\n\nimport useStyles from './Colllection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n index: number;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({children}) => {\n const {classes, cx} = useStyles();\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n index,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n\n return (\n <Draggable index={index} draggableId={index.toString()}>\n {(provided, {isDragging}) => (\n <Group\n ref={provided.innerRef}\n {...provided.draggableProps}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n >\n <div {...provided.dragHandleProps}>\n <DragAndDropSize16Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n )}\n </Draggable>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["CollectionItem","RemoveButton","onClick","ActionIcon","variant","color","RemoveSize16Px","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","useStyles","name","classes","cx","removeButton","Group","className","item","DisabledCollectionItem","DraggableCollectionItem","index","Draggable","draggableId","toString","provided","isDragging","ref","innerRef","draggableProps","itemDragging","dragHandleProps","DragAndDropSize16Px","draggable","disabled","otherProps"],"mappings":"AAAA;;;;+BA+EaA;;;eAAAA;;;;;;;;;gCA/EqC;oBACO;iCAEjC;sEAEF;AAatB,IAAMC,eAED;QAAEC,gBAAAA;yBACH,qBAACC,gBAAU;QAACC,SAAQ;QAASF,SAASA;QAASG,OAAM;kBACjD,cAAA,qBAACC,gCAAc;YAACC,QAAQ;;;;AAIhC,IAAMC,0BAA0B;yBAAM,qBAACC;QAAIC,OAAO;YAACC,OAAO;QAAE;;;AAE5D,IAAMC,uBAAwF,gBAKxF;QAJFC,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBC,aAAAA,IAAAA,0BAAS,EAAC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AAO,qBAACf,0CAA2BgB;IACvC,CAAC;IACD,IAAIF,WAAW;QACX,qBAAO,qBAACb,2CAA4Be;IACxC,CAAC;IACD,qBAAO,qBAAC7B,wCAAyB6B;AACrC"}
1
+ {"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize16Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\nimport {Draggable} from 'react-beautiful-dnd';\n\nimport useStyles from './Collection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n index: number;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({children}) => {\n const {classes, cx} = useStyles();\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n index,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n\n return (\n <Draggable index={index} draggableId={index.toString()}>\n {(provided, {isDragging}) => (\n <Group\n ref={provided.innerRef}\n {...provided.draggableProps}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n >\n <div {...provided.dragHandleProps}>\n <DragAndDropSize16Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n )}\n </Draggable>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["CollectionItem","RemoveButton","onClick","ActionIcon","variant","color","RemoveSize16Px","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","useStyles","name","classes","cx","removeButton","Group","className","item","DisabledCollectionItem","DraggableCollectionItem","index","Draggable","draggableId","toString","provided","isDragging","ref","innerRef","draggableProps","itemDragging","dragHandleProps","DragAndDropSize16Px","draggable","disabled","otherProps"],"mappings":"AAAA;;;;+BA+EaA;;;eAAAA;;;;;;;;;gCA/EqC;oBACO;iCAEjC;qEAEF;AAatB,IAAMC,eAED;QAAEC,gBAAAA;yBACH,qBAACC,gBAAU;QAACC,SAAQ;QAASF,SAASA;QAASG,OAAM;kBACjD,cAAA,qBAACC,gCAAc;YAACC,QAAQ;;;;AAIhC,IAAMC,0BAA0B;yBAAM,qBAACC;QAAIC,OAAO;YAACC,OAAO;QAAE;;;AAE5D,IAAMC,uBAAwF,gBAKxF;QAJFC,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBC,aAAAA,IAAAA,yBAAS,EAAC,IAAI,EAAE;QAACC,MAAM;QAAcH,QAAAA;IAAM,IAA1DI,UAAeF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AAO,qBAACb,2CAA4Be;IACxC,CAAC;IACD,qBAAO,qBAAC7B,wCAAyB6B;AACrC"}
@@ -18,8 +18,21 @@ var _react = require("react");
18
18
  var _stickyFooter = require("../sticky-footer");
19
19
  var _modalWizardStep = require("./ModalWizardStep");
20
20
  var _header = require("../header");
21
+ var useStyles = (0, _core.createStyles)(function() {
22
+ return {
23
+ modal: {
24
+ display: "flex",
25
+ flexDirection: "column"
26
+ },
27
+ body: {
28
+ flex: 1,
29
+ display: "flex",
30
+ flexDirection: "column"
31
+ }
32
+ };
33
+ });
21
34
  var ModalWizard = function(_param) {
22
- var _param_cancelButtonLabel = _param.cancelButtonLabel, cancelButtonLabel = _param_cancelButtonLabel === void 0 ? "Cancel" : _param_cancelButtonLabel, _param_nextButtonLabel = _param.nextButtonLabel, nextButtonLabel = _param_nextButtonLabel === void 0 ? "Next" : _param_nextButtonLabel, _param_previousButtonLabel = _param.previousButtonLabel, previousButtonLabel = _param_previousButtonLabel === void 0 ? "Previous" : _param_previousButtonLabel, _param_finishButtonLabel = _param.finishButtonLabel, finishButtonLabel = _param_finishButtonLabel === void 0 ? "Finish" : _param_finishButtonLabel, opened = _param.opened, onNext = _param.onNext, onPrevious = _param.onPrevious, onClose = _param.onClose, onFinish = _param.onFinish, isDirty = _param.isDirty, handleDirtyState = _param.handleDirtyState, classNames = _param.classNames, children = _param.children, modalProps = _objectWithoutProperties(_param, [
35
+ var _param_cancelButtonLabel = _param.cancelButtonLabel, cancelButtonLabel = _param_cancelButtonLabel === void 0 ? "Cancel" : _param_cancelButtonLabel, _param_nextButtonLabel = _param.nextButtonLabel, nextButtonLabel = _param_nextButtonLabel === void 0 ? "Next" : _param_nextButtonLabel, _param_previousButtonLabel = _param.previousButtonLabel, previousButtonLabel = _param_previousButtonLabel === void 0 ? "Previous" : _param_previousButtonLabel, _param_finishButtonLabel = _param.finishButtonLabel, finishButtonLabel = _param_finishButtonLabel === void 0 ? "Finish" : _param_finishButtonLabel, opened = _param.opened, onNext = _param.onNext, onPrevious = _param.onPrevious, onClose = _param.onClose, onFinish = _param.onFinish, isDirty = _param.isDirty, handleDirtyState = _param.handleDirtyState, classNames = _param.classNames, className = _param.className, styles = _param.styles, unstyled = _param.unstyled, children = _param.children, modalProps = _objectWithoutProperties(_param, [
23
36
  "cancelButtonLabel",
24
37
  "nextButtonLabel",
25
38
  "previousButtonLabel",
@@ -32,9 +45,18 @@ var ModalWizard = function(_param) {
32
45
  "isDirty",
33
46
  "handleDirtyState",
34
47
  "classNames",
48
+ "className",
49
+ "styles",
50
+ "unstyled",
35
51
  "children"
36
52
  ]);
37
53
  var _currentStep_props, _currentStep_props_validateStep;
54
+ var _useStyles = useStyles(null, {
55
+ name: "ModalWizard",
56
+ classNames: classNames,
57
+ styles: styles,
58
+ unstyled: unstyled
59
+ }), _useStyles_classes = _useStyles.classes, modal = _useStyles_classes.modal, body = _useStyles_classes.body, cx = _useStyles.cx;
38
60
  var _useState = _slicedToArray((0, _react.useState)(0), 2), currentStepIndex = _useState[0], setCurrentStepIndex = _useState[1];
39
61
  var modalSteps = _react.Children.toArray(children).filter(function(child) {
40
62
  return child.type === _modalWizardStep.ModalWizardStep;
@@ -73,7 +95,10 @@ var ModalWizard = function(_param) {
73
95
  ]);
74
96
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Modal, _objectSpreadProps(_objectSpread({
75
97
  opened: opened,
76
- classNames: classNames,
98
+ classNames: {
99
+ modal: cx(modal, classNames === null || classNames === void 0 ? void 0 : classNames.modal),
100
+ body: cx(body, classNames === null || classNames === void 0 ? void 0 : classNames.body)
101
+ },
77
102
  centered: true,
78
103
  title: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_header.Header, {
79
104
  docLink: currentStep.props.docLink,
@@ -91,41 +116,45 @@ var ModalWizard = function(_param) {
91
116
  value: getProgressMemo
92
117
  }),
93
118
  currentStep,
94
- /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_stickyFooter.StickyFooter, {
95
- py: 0,
96
- px: 0,
97
- pt: "sm",
98
- borderTop: true,
99
- children: [
100
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Button, {
101
- name: isFirstStep ? cancelButtonLabel : previousButtonLabel,
102
- disabled: false,
103
- size: "sm",
104
- variant: "outline",
105
- onClick: function() {
106
- if (isFirstStep) {
107
- closeModalWizard();
108
- } else {
109
- onPrevious === null || onPrevious === void 0 ? void 0 : onPrevious();
110
- setCurrentStepIndex(currentStepIndex - 1);
111
- }
112
- },
113
- children: isFirstStep ? cancelButtonLabel : previousButtonLabel
114
- }),
115
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Button, {
116
- disabled: !isValid,
117
- size: "sm",
118
- onClick: function() {
119
- if (isLastStep) {
120
- onFinish ? onFinish() : onClose();
121
- } else {
122
- onNext === null || onNext === void 0 ? void 0 : onNext();
123
- setCurrentStepIndex(currentStepIndex + 1);
124
- }
125
- },
126
- children: isLastStep ? finishButtonLabel : nextButtonLabel
127
- })
128
- ]
119
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Box, {
120
+ sx: function(theme) {
121
+ return {
122
+ marginTop: "auto"
123
+ };
124
+ },
125
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_stickyFooter.StickyFooter, {
126
+ px: 0,
127
+ pt: "sm",
128
+ pb: 0,
129
+ borderTop: true,
130
+ children: [
131
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Button, {
132
+ name: isFirstStep ? cancelButtonLabel : previousButtonLabel,
133
+ variant: "outline",
134
+ onClick: function() {
135
+ if (isFirstStep) {
136
+ closeModalWizard();
137
+ } else {
138
+ onPrevious === null || onPrevious === void 0 ? void 0 : onPrevious();
139
+ setCurrentStepIndex(currentStepIndex - 1);
140
+ }
141
+ },
142
+ children: isFirstStep ? cancelButtonLabel : previousButtonLabel
143
+ }),
144
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Button, {
145
+ disabled: !isValid,
146
+ onClick: function() {
147
+ if (isLastStep) {
148
+ onFinish ? onFinish() : onClose();
149
+ } else {
150
+ onNext === null || onNext === void 0 ? void 0 : onNext();
151
+ setCurrentStepIndex(currentStepIndex + 1);
152
+ }
153
+ },
154
+ children: isLastStep ? finishButtonLabel : nextButtonLabel
155
+ })
156
+ ]
157
+ })
129
158
  })
130
159
  ]
131
160
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Button, Modal, ModalProps, Progress} from '@mantine/core';\nimport {Children, ReactElement, useMemo, useState} from 'react';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep} from './ModalWizardStep';\nimport {Header} from '../header';\n\ninterface ModalWizardProps extends 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 children,\n ...modalProps\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\n return (\n <Modal\n opened={opened}\n classNames={classNames}\n centered\n title={\n <Header\n docLink={currentStep.props.docLink}\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 <StickyFooter py={0} px={0} pt=\"sm\" borderTop>\n <Button\n name={isFirstStep ? cancelButtonLabel : previousButtonLabel}\n disabled={false}\n size=\"sm\"\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 size=\"sm\"\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 </Modal>\n );\n};\n\nModalWizard.Step = ModalWizardStep;\n"],"names":["ModalWizard","cancelButtonLabel","nextButtonLabel","previousButtonLabel","finishButtonLabel","opened","onNext","onPrevious","onClose","onFinish","isDirty","handleDirtyState","classNames","children","modalProps","currentStep","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","description","py","px","showProgressBar","Progress","color","size","value","StickyFooter","pt","borderTop","Button","name","disabled","variant","onClick","Step"],"mappings":"AAAA;;;;+BA0EaA;;;eAAAA;;;;;;;;oBA1EqC;qBACM;4BAC7B;+BACG;sBACT;AAsEd,IAAMA,cAA+B,iBAetC;0CAdFC,mBAAAA,0DAAoB,qEACpBC,iBAAAA,sDAAkB,qEAClBC,qBAAAA,8DAAsB,2EACtBC,mBAAAA,0DAAoB,qCACpBC,gBAAAA,QACAC,gBAAAA,QACAC,oBAAAA,YACAC,iBAAAA,SACAC,kBAAAA,UACAC,iBAAAA,SACAC,0BAAAA,kBACAC,oBAAAA,YACAC,kBAAAA,UACGC;QAbHb;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;;QAYkBE;IATlB,IAAgDC,2BAAAA,IAAAA,eAAQ,EAAC,QAAlDC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GxC,gCAAe"}
1
+ {"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Box, Button, createStyles, DefaultProps, Modal, ModalProps, Progress, Selectors} from '@mantine/core';\nimport {Children, ReactElement, useMemo, useState} from 'react';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep} from './ModalWizardStep';\nimport {Header} from '../header';\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\ninterface 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 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","description","py","px","showProgressBar","Progress","color","size","value","Box","sx","theme","marginTop","StickyFooter","pt","pb","borderTop","Button","variant","onClick","disabled","Step"],"mappings":"AAAA;;;;+BA0FaA;;;eAAAA;;;;;;;;oBA1FiF;qBACtC;4BAC7B;+BACG;sBACT;AAErB,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,iB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C,SAASoC;OACL3B;;YAEHC,YAAYkB,KAAK,CAACsB,eAAe,kBAAI,qBAACC,cAAQ;gBAACC,OAAM;gBAAOC,MAAK;gBAAKC,OAAOd;;YAC7E9B;0BACD,qBAAC6C,SAAG;gBACAC,IAAI,SAACC;2BAAW;wBACZC,WAAW;oBACf;;0BAEA,cAAA,sBAACC,0BAAY;oBAACV,IAAI;oBAAGW,IAAG;oBAAKC,IAAI;oBAAGC,SAAS;;sCACzC,qBAACC,YAAM;4BACHpD,MAAMmB,cAAcrC,oBAAoBE,mBAAmB;4BAC3DqE,SAAQ;4BACRC,SAAS,WAAM;gCACX,IAAInC,aAAa;oCACbM;gCACJ,OAAO;oCACHrC,uBAAAA,wBAAAA,KAAAA,IAAAA;oCACAiB,oBAAoBD,mBAAmB;gCAC3C,CAAC;4BACL;sCAECe,cAAcrC,oBAAoBE,mBAAmB;;sCAG1D,qBAACoE,YAAM;4BACHG,UAAU,CAACjC;4BACXgC,SAAS,WAAM;gCACX,IAAIlC,YAAY;oCACZ9B,WAAWA,aAAaD,SAAS;gCACrC,OAAO;oCACHF,mBAAAA,oBAAAA,KAAAA,IAAAA;oCACAkB,oBAAoBD,mBAAmB;gCAC3C,CAAC;4BACL;sCAECgB,aAAanC,oBAAoBF,eAAe;;;;;;;AAMzE;AAEAT,YAAYkF,IAAI,GAAG5C,gCAAe"}
@@ -8,12 +8,9 @@ Object.defineProperty(exports, "ModalWizardStep", {
8
8
  return ModalWizardStep;
9
9
  }
10
10
  });
11
- var _jsxRuntime = require("react/jsx-runtime");
12
11
  var ModalWizardStep = function(param) {
13
12
  var children = param.children;
14
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
15
- children: children
16
- });
13
+ return children;
17
14
  };
18
15
  ModalWizardStep.defaultProps = {
19
16
  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}\n\nconst ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>> = ({children}) => (\n <div>{children}</div>\n);\n\nModalWizardStep.defaultProps = {\n showProgressBar: true,\n countsAsProgress: true,\n};\n\nexport {ModalWizardStep};\n"],"names":["ModalWizardStep","children","div","defaultProps","showProgressBar","countsAsProgress"],"mappings":"AAAA;;;;+BAsDQA;;;eAAAA;;;;AATR,IAAMA,kBAA8E;QAAEC,iBAAAA;yBAClF,qBAACC;kBAAKD;;;AAGVD,gBAAgBG,YAAY,GAAG;IAC3BC,iBAAiB,IAAI;IACrBC,kBAAkB,IAAI;AAC1B"}
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":"AAAA;;;;+BAqDQA;;;eAAAA;;;AAPR,IAAMA,kBAA8E;QAAEC,iBAAAA;WAAcA;;AAEpGD,gBAAgBE,YAAY,GAAG;IAC3BC,iBAAiB,IAAI;IACrBC,kBAAkB,IAAI;AAC1B"}
@@ -39,7 +39,8 @@ var StickyFooter = function(_param) {
39
39
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_core.Group, _objectSpreadProps(_objectSpread({
40
40
  position: "right",
41
41
  spacing: "xs",
42
- py: "md",
42
+ pt: "md",
43
+ pb: "md",
43
44
  px: "xl"
44
45
  }, others), {
45
46
  children: children
@@ -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\" py=\"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","py","px"],"mappings":"AAAA;;;;+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;mBAAST;8BACpDD;;;;;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=\"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":"AAAA;;;;+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,7 +1,7 @@
1
- import { DefaultProps, MantineNumberSize, Selectors } from '@mantine/core';
1
+ import { DefaultProps, InputWrapperBaseProps, MantineNumberSize, Selectors } from '@mantine/core';
2
2
  import { ReactNode } from 'react';
3
- import useStyles from './Colllection.styles';
4
- interface CollectionProps<T> extends DefaultProps<Selectors<typeof useStyles>> {
3
+ import useStyles from './Collection.styles';
4
+ interface CollectionProps<T> extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>, DefaultProps<Selectors<typeof useStyles>> {
5
5
  /**
6
6
  * The default value each new item should have
7
7
  */
@@ -1 +1 @@
1
- {"version":3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,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,eAAO,MAAM,UAAU,+CAqHtB,CAAC"}
@@ -6,4 +6,4 @@ declare const _default: (params: void, options?: import("@mantine/core").UseStyl
6
6
  theme: import("@mantine/core").MantineTheme;
7
7
  };
8
8
  export default _default;
9
- //# sourceMappingURL=Colllection.styles.d.ts.map
9
+ //# sourceMappingURL=Collection.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.styles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;CAAG;;;;;;AAE1C,wBASI"}
@@ -1,6 +1,6 @@
1
1
  import { DefaultProps, Selectors } from '@mantine/core';
2
2
  import { FunctionComponent, PropsWithChildren } from 'react';
3
- import useStyles from './Colllection.styles';
3
+ import useStyles from './Collection.styles';
4
4
  interface CollectionItemProps extends CollectionItemSharedProps {
5
5
  draggable?: boolean;
6
6
  disabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAS,SAAS,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAG3D,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAE7C,UAAU,mBAAoB,SAAQ,yBAAyB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,yBAA0B,SAAQ,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AA+DD,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYpF,CAAC"}
1
+ {"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAS,SAAS,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAG3D,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,UAAU,mBAAoB,SAAQ,yBAAyB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,yBAA0B,SAAQ,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AA+DD,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYpF,CAAC"}
@@ -1,7 +1,13 @@
1
- import { ModalProps } from '@mantine/core';
1
+ import { DefaultProps, ModalProps, Selectors } from '@mantine/core';
2
2
  import { ReactElement } from 'react';
3
3
  import { ModalWizardStep } from './ModalWizardStep';
4
- interface ModalWizardProps extends Omit<ModalProps, 'centered' | 'title'> {
4
+ declare const useStyles: (params: void, options?: import("@mantine/core").UseStylesOptions<"body" | "modal">) => {
5
+ classes: Record<"body" | "modal", string>;
6
+ cx: (...args: any) => string;
7
+ theme: import("@mantine/core").MantineTheme;
8
+ };
9
+ type ModalWizardStylesNames = Selectors<typeof useStyles>;
10
+ interface ModalWizardProps extends Omit<DefaultProps<ModalWizardStylesNames>, 'classNames' | 'styles'>, Omit<ModalProps, 'centered' | 'title'> {
5
11
  /**
6
12
  * The label of the cancel button
7
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ModalWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAW,MAAM,eAAe,CAAC;AAClE,OAAO,EAAW,YAAY,EAAoB,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAGlD,UAAU,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IACrE;;;;OAIG;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,eA0GzB,CAAC"}
1
+ {"version":3,"file":"ModalWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"names":[],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* @default true
37
37
  */
38
38
  countsAsProgress?: boolean;
39
+ children: ReactElement<any, any>;
39
40
  }
40
41
  declare const ModalWizardStep: FunctionComponent<PropsWithChildren<ModalWizardStepProps>>;
41
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,EAAE,MAAM,CAAC;IAEhB;;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,EAAE,OAAO,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,CAE/E,CAAC;AAOF,OAAO,EAAC,eAAe,EAAC,CAAC"}
1
+ {"version":3,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