@coveord/plasma-mantine 47.8.0 → 47.9.1

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 (44) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +9 -8
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/collection/Colllection.styles.js +2 -1
  5. package/dist/cjs/components/collection/Colllection.styles.js.map +1 -1
  6. package/dist/cjs/components/index.js +1 -0
  7. package/dist/cjs/components/index.js.map +1 -1
  8. package/dist/cjs/components/prompt/Prompt.js +100 -0
  9. package/dist/cjs/components/prompt/Prompt.js.map +1 -0
  10. package/dist/cjs/components/prompt/PromptFooter.js +25 -0
  11. package/dist/cjs/components/prompt/PromptFooter.js.map +1 -0
  12. package/dist/cjs/components/prompt/index.js +8 -0
  13. package/dist/cjs/components/prompt/index.js.map +1 -0
  14. package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
  15. package/dist/definitions/components/collection/Colllection.styles.d.ts.map +1 -1
  16. package/dist/definitions/components/index.d.ts +1 -0
  17. package/dist/definitions/components/index.d.ts.map +1 -1
  18. package/dist/definitions/components/prompt/Prompt.d.ts +14 -0
  19. package/dist/definitions/components/prompt/Prompt.d.ts.map +1 -0
  20. package/dist/definitions/components/prompt/PromptFooter.d.ts +6 -0
  21. package/dist/definitions/components/prompt/PromptFooter.d.ts.map +1 -0
  22. package/dist/definitions/components/prompt/index.d.ts +2 -0
  23. package/dist/definitions/components/prompt/index.d.ts.map +1 -0
  24. package/dist/definitions/components/sticky-footer/StickyFooter.d.ts +1 -2
  25. package/dist/definitions/components/sticky-footer/StickyFooter.d.ts.map +1 -1
  26. package/dist/esm/components/collection/Colllection.styles.js +2 -1
  27. package/dist/esm/components/collection/Colllection.styles.js.map +1 -1
  28. package/dist/esm/components/index.js +1 -0
  29. package/dist/esm/components/index.js.map +1 -1
  30. package/dist/esm/components/prompt/Prompt.js +90 -0
  31. package/dist/esm/components/prompt/Prompt.js.map +1 -0
  32. package/dist/esm/components/prompt/PromptFooter.js +15 -0
  33. package/dist/esm/components/prompt/PromptFooter.js.map +1 -0
  34. package/dist/esm/components/prompt/index.js +3 -0
  35. package/dist/esm/components/prompt/index.js.map +1 -0
  36. package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
  37. package/package.json +1 -1
  38. package/src/components/collection/Colllection.styles.ts +1 -0
  39. package/src/components/index.ts +1 -0
  40. package/src/components/prompt/Prompt.tsx +66 -0
  41. package/src/components/prompt/PromptFooter.tsx +8 -0
  42. package/src/components/prompt/__tests__/Prompt.spec.tsx +29 -0
  43. package/src/components/prompt/index.ts +1 -0
  44. package/src/components/sticky-footer/StickyFooter.tsx +1 -1
@@ -13,7 +13,8 @@ var _default = (0, _core.createStyles)(function(theme) {
13
13
  return {
14
14
  root: {},
15
15
  item: {
16
- backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black
16
+ backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black,
17
+ alignItems: "baseline"
17
18
  },
18
19
  itemDragging: {
19
20
  boxShadow: theme.shadows.sm
@@ -1 +1 @@
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 },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","itemDragging","boxShadow","shadows","sm"],"mappings":"AAAA;;;;+BAIA,SAQI;;;eARJ,QAQI;;;oBAZuB,eAAe;IAI1C,QAQI,GARWA,IAAAA,KAAY,aAAA,EAAC,SAACC,KAAK;WAAM;QACpCC,IAAI,EAAE,EAAE;QACRC,IAAI,EAAE;YACFC,eAAe,EAAEH,KAAK,CAACI,WAAW,KAAK,OAAO,GAAGJ,KAAK,CAACK,KAAK,GAAGL,KAAK,CAACM,KAAK;SAC7E;QACDC,YAAY,EAAE;YACVC,SAAS,EAAER,KAAK,CAACS,OAAO,CAACC,EAAE;SAC9B;KACJ;CAAC,CAAC"}
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,SASI;;;eATJ,QASI;;;oBAbuB,eAAe;IAI1C,QASI,GATWA,IAAAA,KAAY,aAAA,EAAC,SAACC,KAAK;WAAM;QACpCC,IAAI,EAAE,EAAE;QACRC,IAAI,EAAE;YACFC,eAAe,EAAEH,KAAK,CAACI,WAAW,KAAK,OAAO,GAAGJ,KAAK,CAACK,KAAK,GAAGL,KAAK,CAACM,KAAK;YAC1EC,UAAU,EAAE,UAAU;SACzB;QACDC,YAAY,EAAE;YACVC,SAAS,EAAET,KAAK,CAACU,OAAO,CAACC,EAAE;SAC9B;KACJ;CAAC,CAAC"}
@@ -11,6 +11,7 @@ _exportStar(require("./sticky-footer"), exports);
11
11
  _exportStar(require("./header"), exports);
12
12
  _exportStar(require("./inline-confirm"), exports);
13
13
  _exportStar(require("./table"), exports);
14
+ _exportStar(require("./prompt"), exports);
14
15
  _exportStar(require("./modal-wizard"), exports);
15
16
 
16
17
  //# sourceMappingURL=index.js.map
@@ -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 './modal-wizard';\n"],"names":[],"mappings":"AAAA;;;;;oBAAc,eAAe;oBACf,eAAe;oBACf,cAAc;oBACd,qBAAqB;oBACrB,iBAAiB;oBACjB,UAAU;oBACV,kBAAkB;oBAClB,SAAS;oBACT,gBAAgB"}
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';\n"],"names":[],"mappings":"AAAA;;;;;oBAAc,eAAe;oBACf,eAAe;oBACf,cAAc;oBACd,qBAAqB;oBACrB,iBAAiB;oBACjB,UAAU;oBACV,kBAAkB;oBAClB,SAAS;oBACT,UAAU;oBACV,gBAAgB"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Prompt", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return Prompt;
9
+ }
10
+ });
11
+ var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
+ var _objectSpreadProps = require("@swc/helpers/lib/_object_spread_props.js").default;
13
+ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_properties.js").default;
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ var _core = require("@mantine/core");
16
+ var _react = require("react");
17
+ var _promptFooter = require("./PromptFooter");
18
+ var useStyles = (0, _core.createStyles)(function(theme) {
19
+ var white = "#fff";
20
+ return {
21
+ body: {
22
+ padding: 0
23
+ },
24
+ modalType: {
25
+ overflow: "hidden",
26
+ width: 550
27
+ },
28
+ innerBody: {
29
+ padding: "".concat(theme.spacing.md, "px ").concat(theme.spacing.xl, "px ").concat(theme.spacing.lg, "px")
30
+ },
31
+ header: {
32
+ padding: "".concat(theme.spacing.md, "px ").concat(theme.spacing.xl, "px"),
33
+ width: "100%",
34
+ borderBottom: "1px solid ".concat(theme.colors.gray[3]),
35
+ fontSize: theme.headings.sizes.h4.fontSize,
36
+ lineHeight: theme.headings.sizes.h4.fontSize
37
+ },
38
+ default: {},
39
+ success: {
40
+ backgroundColor: theme.colors.lime[6],
41
+ color: white
42
+ },
43
+ warning: {
44
+ backgroundColor: theme.colors.yellow[5],
45
+ color: white
46
+ },
47
+ critical: {
48
+ backgroundColor: theme.colors.red[6],
49
+ color: white
50
+ },
51
+ info: {
52
+ backgroundColor: theme.colors.navy[5],
53
+ color: white
54
+ },
55
+ whiteClose: {
56
+ color: white,
57
+ "&:hover": {
58
+ backgroundColor: "transparent"
59
+ }
60
+ }
61
+ };
62
+ });
63
+ var Prompt = function(_param) {
64
+ var children = _param.children, variant = _param.variant, size = _param.size, otherProps = _objectWithoutProperties(_param, [
65
+ "children",
66
+ "variant",
67
+ "size"
68
+ ]);
69
+ var ref = useStyles(), classes = ref.classes, cx = ref.cx;
70
+ var defaultVariant = variant === "default";
71
+ var convertedChildren = _react.Children.toArray(children);
72
+ var otherChildren = convertedChildren.filter(function(child) {
73
+ return child.type !== _promptFooter.PromptFooter;
74
+ });
75
+ var footer = convertedChildren.find(function(child) {
76
+ return child.type === _promptFooter.PromptFooter;
77
+ });
78
+ var classNames = {
79
+ header: cx(classes.header, classes[variant]),
80
+ close: !defaultVariant && classes.whiteClose,
81
+ body: classes.body,
82
+ modal: !defaultVariant && classes.modalType
83
+ };
84
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_core.Modal, _objectSpreadProps(_objectSpread({
85
+ padding: 0,
86
+ classNames: classNames,
87
+ size: defaultVariant ? size : "sm"
88
+ }, otherProps), {
89
+ children: [
90
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
91
+ className: classes.innerBody,
92
+ children: otherChildren
93
+ }),
94
+ footer
95
+ ]
96
+ }));
97
+ };
98
+ Prompt.Footer = _promptFooter.PromptFooter;
99
+
100
+ //# sourceMappingURL=Prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => {\n const white = '#fff';\n return {\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px ${theme.spacing.lg}px`,\n },\n header: {\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h4.fontSize,\n lineHeight: theme.headings.sizes.h4.fontSize,\n },\n default: {},\n success: {backgroundColor: theme.colors.lime[6], color: white},\n warning: {backgroundColor: theme.colors.yellow[5], color: white},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: white,\n },\n info: {backgroundColor: theme.colors.navy[5], color: white},\n whiteClose: {color: white, '&:hover': {backgroundColor: 'transparent'}},\n };\n});\n\nexport interface PromptProps extends ModalProps {\n variant: 'default' | 'success' | 'warning' | 'critical' | 'info';\n children: ReactNode;\n}\ninterface PromptType {\n (props: PromptProps): ReactElement;\n Footer: typeof PromptFooter;\n}\n\nexport const Prompt: PromptType = ({children, variant, size, ...otherProps}) => {\n const {classes, cx} = useStyles();\n const defaultVariant = variant === 'default';\n const convertedChildren = Children.toArray(children) as ReactElement[];\n\n const otherChildren = convertedChildren.filter((child) => child.type !== PromptFooter);\n const footer = convertedChildren.find((child) => child.type === PromptFooter);\n\n const classNames = {\n header: cx(classes.header, classes[variant]),\n close: !defaultVariant && classes.whiteClose,\n body: classes.body,\n modal: !defaultVariant && classes.modalType,\n };\n\n return (\n <Modal padding={0} classNames={classNames} size={defaultVariant ? size : 'sm'} {...otherProps}>\n <div className={classes.innerBody}>{otherChildren}</div>\n {footer}\n </Modal>\n );\n};\n\nPrompt.Footer = PromptFooter;\n"],"names":["Prompt","useStyles","createStyles","theme","white","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h4","lineHeight","default","success","backgroundColor","lime","color","warning","yellow","critical","red","info","navy","whiteClose","children","variant","size","otherProps","classes","cx","defaultVariant","convertedChildren","Children","toArray","otherChildren","filter","child","type","PromptFooter","footer","find","classNames","close","modal","Modal","div","className","Footer"],"mappings":"AAAA;;;;+BA0CaA,QAAM;;;eAANA,MAAM;;;;;;;oBA1C2B,eAAe;qBACb,OAAO;4BAC5B,gBAAgB;AAE3C,IAAMC,SAAS,GAAGC,IAAAA,KAAY,aAAA,EAAC,SAACC,KAAK,EAAK;IACtC,IAAMC,KAAK,GAAG,MAAM,AAAC;IACrB,OAAO;QACHC,IAAI,EAAE;YACFC,OAAO,EAAE,CAAC;SACb;QACDC,SAAS,EAAE;YAACC,QAAQ,EAAE,QAAQ;YAAEC,KAAK,EAAE,GAAG;SAAC;QAC3CC,SAAS,EAAE;YACPJ,OAAO,EAAE,AAAC,EAAA,CAAwBH,MAAgB,CAAtCA,KAAK,CAACQ,OAAO,CAACC,EAAE,EAAC,KAAG,CAAmB,CAAKT,MAAgB,CAAtCA,KAAK,CAACQ,OAAO,CAACE,EAAE,EAAC,KAAG,CAAmB,CAAA,MAAE,CAAnBV,KAAK,CAACQ,OAAO,CAACG,EAAE,EAAC,IAAE,CAAC;SAC/E;QACDC,MAAM,EAAE;YACJT,OAAO,EAAE,AAAC,EAAA,CAAwBH,MAAgB,CAAtCA,KAAK,CAACQ,OAAO,CAACC,EAAE,EAAC,KAAG,CAAmB,CAAA,MAAE,CAAnBT,KAAK,CAACQ,OAAO,CAACE,EAAE,EAAC,IAAE,CAAC;YACtDJ,KAAK,EAAE,MAAM;YACbO,YAAY,EAAE,AAAC,YAAU,CAAuB,MAAA,CAArBb,KAAK,CAACc,MAAM,CAACC,IAAI,CAAC,CAAC,CAAC,CAAE;YACjDC,QAAQ,EAAEhB,KAAK,CAACiB,QAAQ,CAAC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MU,aAAa,GAAGH,iBAAiB,CAACI,MAAM,CAAC,SAACC,KAAK;eAAKA,KAAK,CAACC,IAAI,KAAKC,aAAY,aAAA;KAAA,CAAC,AAAC;IACvF,IAAMC,MAAM,GAAGR,iBAAiB,CAACS,IAAI,CAAC,SAACJ,KAAK;eAAKA,KAAK,CAACC,IAAI,KAAKC,aAAY,aAAA;KAAA,CAAC,AAAC;IAE9E,IAAMG,UAAU,GAAG;QACftC,MAAM,EAAE0B,EAAE,CAACD,OAAO,CAACzB,MAAM,EAAEyB,OAAO,CAACH,OAAO,CAAC,CAAC;QAC5CiB,KAAK,EAAE,CAACZ,cAAc,IAAIF,OAAO,CAACL,UAAU;QAC5C9B,IAAI,EAAEmC,OAAO,CAACnC,IAAI;QAClBkD,KAAK,EAAE,CAACb,cAAc,IAAIF,OAAO,CAACjC,SAAS;KAC9C,AAAC;IAEF,qBACI,sBAACiD,KAAK,MAAA;QAAClD,OAAO,EAAE,CAAC;QAAE+C,UAAU,EAAEA,UAAU;QAAEf,IAAI,EAAEI,cAAc,GAAGJ,IAAI,GAAG,IAAI;OAAMC,UAAU;;0BACzF,qBAACkB,KAAG;gBAACC,SAAS,EAAElB,OAAO,CAAC9B,SAAS;0BAAGoC,aAAa;cAAO;YACvDK,MAAM;;OACH,CACV;AACN,CAAC,AAAC;AAEFnD,MAAM,CAAC2D,MAAM,GAAGT,aAAY,aAAA,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "PromptFooter", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return PromptFooter;
9
+ }
10
+ });
11
+ var _objectSpread = require("@swc/helpers/lib/_object_spread.js").default;
12
+ var _objectSpreadProps = require("@swc/helpers/lib/_object_spread_props.js").default;
13
+ var _objectWithoutProperties = require("@swc/helpers/lib/_object_without_properties.js").default;
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ var _stickyFooter = require("../sticky-footer");
16
+ var PromptFooter = function(_param) /*#__PURE__*/ {
17
+ var children = _param.children, otherProps = _objectWithoutProperties(_param, [
18
+ "children"
19
+ ]);
20
+ return (0, _jsxRuntime.jsx)(_stickyFooter.StickyFooter, _objectSpreadProps(_objectSpread({}, otherProps), {
21
+ children: children
22
+ }));
23
+ };
24
+
25
+ //# sourceMappingURL=PromptFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/PromptFooter.tsx"],"sourcesContent":["import {FunctionComponent} from 'react';\nimport {StickyFooter, StickyFooterProps} from '../sticky-footer';\n\nexport interface PromptFooterProps extends StickyFooterProps {}\n\nexport const PromptFooter: FunctionComponent<PromptFooterProps> = ({children, ...otherProps}) => (\n <StickyFooter {...otherProps}>{children}</StickyFooter>\n);\n"],"names":["PromptFooter","children","otherProps","StickyFooter"],"mappings":"AAAA;;;;+BAKaA,cAAY;;;eAAZA,YAAY;;;;;;;4BAJqB,kBAAkB;AAIzD,IAAMA,YAAY,GAAyC,+BAC9D;QADgEC,QAAQ,UAARA,QAAQ,EAAKC,UAAU;QAAvBD,UAAQ;;WACxE,qBAACE,aAAY,aAAA,uCAAKD,UAAU;kBAAGD,QAAQ;OAAgB;AAAD,CACzD,AAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Prompt"), exports);
7
+
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/index.ts"],"sourcesContent":["export * from './Prompt';\n"],"names":[],"mappings":"AAAA;;;;;oBAAc,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {createStyles, DefaultProps, Divider, Group, Paper} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\ninterface 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 maxHeight: '80px',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<StickyFooterProps> = ({borderTop, children, ...others}) => {\n const {classes} = useStyles();\n\n return (\n <Paper className={classes.footer}>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Group position=\"right\" spacing=\"xs\" py=\"md\" px=\"xl\" {...others}>\n {children}\n </Group>\n </Paper>\n );\n};\n"],"names":["StickyFooter","useStyles","createStyles","footer","position","bottom","zIndex","maxHeight","borderTop","children","others","classes","Paper","className","Divider","size","Group","spacing","py","px"],"mappings":"AAAA;;;;+BAmBaA,cAAY;;;eAAZA,YAAY;;;;;;;oBAnBuC,eAAe;AAU/E,IAAMC,SAAS,GAAGC,IAAAA,KAAY,aAAA,EAAC;WAAO;QAClCC,MAAM,EAAE;YACJC,QAAQ,EAAE,QAAQ;YAClBC,MAAM,EAAE,CAAC;YACTC,MAAM,EAAE,CAAC;YACTC,SAAS,EAAE,MAAM;SACpB;KACJ;CAAC,CAAC,AAAC;AAEG,IAAMP,YAAY,GAAyC,iBAAsC;QAApCQ,SAAS,UAATA,SAAS,EAAEC,QAAQ,UAARA,QAAQ,EAAKC,MAAM;QAA9BF,WAAS;QAAEC,UAAQ;;IACnF,IAAM,AAACE,OAAO,GAAIV,SAAS,EAAE,CAAtBU,OAAO,AAAe,AAAC;IAE9B,qBACI,sBAACC,KAAK,MAAA;QAACC,SAAS,EAAEF,OAAO,CAACR,MAAM;;YAC3BK,SAAS,iBAAG,qBAACM,KAAO,QAAA;gBAACC,IAAI,EAAC,IAAI;cAAG,GAAG,IAAI;0BACzC,qBAACC,KAAK,MAAA;gBAACZ,QAAQ,EAAC,OAAO;gBAACa,OAAO,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;eAAKT,MAAM;0BAC1DD,QAAQ;eACL;;MACJ,CACV;AACN,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {createStyles, DefaultProps, Divider, Group, Paper} from '@mantine/core';\nimport {FunctionComponent} 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 maxHeight: '80px',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<StickyFooterProps> = ({borderTop, children, ...others}) => {\n const {classes} = useStyles();\n\n return (\n <Paper className={classes.footer}>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Group position=\"right\" spacing=\"xs\" py=\"md\" px=\"xl\" {...others}>\n {children}\n </Group>\n </Paper>\n );\n};\n"],"names":["StickyFooter","useStyles","createStyles","footer","position","bottom","zIndex","maxHeight","borderTop","children","others","classes","Paper","className","Divider","size","Group","spacing","py","px"],"mappings":"AAAA;;;;+BAmBaA,cAAY;;;eAAZA,YAAY;;;;;;;oBAnBuC,eAAe;AAU/E,IAAMC,SAAS,GAAGC,IAAAA,KAAY,aAAA,EAAC;WAAO;QAClCC,MAAM,EAAE;YACJC,QAAQ,EAAE,QAAQ;YAClBC,MAAM,EAAE,CAAC;YACTC,MAAM,EAAE,CAAC;YACTC,SAAS,EAAE,MAAM;SACpB;KACJ;CAAC,CAAC,AAAC;AAEG,IAAMP,YAAY,GAAyC,iBAAsC;QAApCQ,SAAS,UAATA,SAAS,EAAEC,QAAQ,UAARA,QAAQ,EAAKC,MAAM;QAA9BF,WAAS;QAAEC,UAAQ;;IACnF,IAAM,AAACE,OAAO,GAAIV,SAAS,EAAE,CAAtBU,OAAO,AAAe,AAAC;IAE9B,qBACI,sBAACC,KAAK,MAAA;QAACC,SAAS,EAAEF,OAAO,CAACR,MAAM;;YAC3BK,SAAS,iBAAG,qBAACM,KAAO,QAAA;gBAACC,IAAI,EAAC,IAAI;cAAG,GAAG,IAAI;0BACzC,qBAACC,KAAK,MAAA;gBAACZ,QAAQ,EAAC,OAAO;gBAACa,OAAO,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;eAAKT,MAAM;0BAC1DD,QAAQ;eACL;;MACJ,CACV;AACN,CAAC,AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Colllection.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Colllection.styles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;CAAG;;;;;;AAE1C,wBAQI"}
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"}
@@ -6,5 +6,6 @@ export * from './sticky-footer';
6
6
  export * from './header';
7
7
  export * from './inline-confirm';
8
8
  export * from './table';
9
+ export * from './prompt';
9
10
  export * from './modal-wizard';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { ModalProps } from '@mantine/core';
2
+ import { ReactElement, ReactNode } from 'react';
3
+ import { PromptFooter } from './PromptFooter';
4
+ export interface PromptProps extends ModalProps {
5
+ variant: 'default' | 'success' | 'warning' | 'critical' | 'info';
6
+ children: ReactNode;
7
+ }
8
+ interface PromptType {
9
+ (props: PromptProps): ReactElement;
10
+ Footer: typeof PromptFooter;
11
+ }
12
+ export declare const Prompt: PromptType;
13
+ export {};
14
+ //# sourceMappingURL=Prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAW,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AA+B5C,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC3C,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACjE,QAAQ,EAAE,SAAS,CAAC;CACvB;AACD,UAAU,UAAU;IAChB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAAC;IACnC,MAAM,EAAE,OAAO,YAAY,CAAC;CAC/B;AAED,eAAO,MAAM,MAAM,EAAE,UAqBpB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { StickyFooterProps } from '../sticky-footer';
3
+ export interface PromptFooterProps extends StickyFooterProps {
4
+ }
5
+ export declare const PromptFooter: FunctionComponent<PromptFooterProps>;
6
+ //# sourceMappingURL=PromptFooter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/PromptFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAe,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEjE,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;CAAG;AAE/D,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAE7D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './Prompt';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import { DefaultProps } from '@mantine/core';
2
2
  import { FunctionComponent } from 'react';
3
- interface StickyFooterProps extends DefaultProps {
3
+ export interface StickyFooterProps extends DefaultProps {
4
4
  /**
5
5
  * Whether a border is render on top of the footer
6
6
  */
7
7
  borderTop?: boolean;
8
8
  }
9
9
  export declare const StickyFooter: FunctionComponent<StickyFooterProps>;
10
- export {};
11
10
  //# sourceMappingURL=StickyFooter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StickyFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAwB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAExC,UAAU,iBAAkB,SAAQ,YAAY;IAC5C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAWD,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAW7D,CAAC"}
1
+ {"version":3,"file":"StickyFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAwB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACnD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAWD,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAW7D,CAAC"}
@@ -3,7 +3,8 @@ export default createStyles(function(theme) {
3
3
  return {
4
4
  root: {},
5
5
  item: {
6
- backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black
6
+ backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black,
7
+ alignItems: "baseline"
7
8
  },
8
9
  itemDragging: {
9
10
  boxShadow: theme.shadows.sm
@@ -1 +1 @@
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 },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","itemDragging","boxShadow","shadows","sm"],"mappings":"AAAA,SAAQA,YAAY,QAAO,eAAe,CAAC;AAI3C,eAAeA,YAAY,CAAC,SAACC,KAAK;WAAM;QACpCC,IAAI,EAAE,EAAE;QACRC,IAAI,EAAE;YACFC,eAAe,EAAEH,KAAK,CAACI,WAAW,KAAK,OAAO,GAAGJ,KAAK,CAACK,KAAK,GAAGL,KAAK,CAACM,KAAK;SAC7E;QACDC,YAAY,EAAE;YACVC,SAAS,EAAER,KAAK,CAACS,OAAO,CAACC,EAAE;SAC9B;KACJ;CAAC,CAAC,CAAC"}
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,eAAe,CAAC;AAI3C,eAAeA,YAAY,CAAC,SAACC,KAAK;WAAM;QACpCC,IAAI,EAAE,EAAE;QACRC,IAAI,EAAE;YACFC,eAAe,EAAEH,KAAK,CAACI,WAAW,KAAK,OAAO,GAAGJ,KAAK,CAACK,KAAK,GAAGL,KAAK,CAACM,KAAK;YAC1EC,UAAU,EAAE,UAAU;SACzB;QACDC,YAAY,EAAE;YACVC,SAAS,EAAET,KAAK,CAACU,OAAO,CAACC,EAAE;SAC9B;KACJ;CAAC,CAAC,CAAC"}
@@ -6,6 +6,7 @@ export * from "./sticky-footer";
6
6
  export * from "./header";
7
7
  export * from "./inline-confirm";
8
8
  export * from "./table";
9
+ export * from "./prompt";
9
10
  export * from "./modal-wizard";
10
11
 
11
12
  //# sourceMappingURL=index.js.map
@@ -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 './modal-wizard';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
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';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,90 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { createStyles, Modal } from "@mantine/core";
6
+ import { Children } from "react";
7
+ import { PromptFooter } from "./PromptFooter";
8
+ var useStyles = createStyles(function(theme) {
9
+ var white = "#fff";
10
+ return {
11
+ body: {
12
+ padding: 0
13
+ },
14
+ modalType: {
15
+ overflow: "hidden",
16
+ width: 550
17
+ },
18
+ innerBody: {
19
+ padding: "".concat(theme.spacing.md, "px ").concat(theme.spacing.xl, "px ").concat(theme.spacing.lg, "px")
20
+ },
21
+ header: {
22
+ padding: "".concat(theme.spacing.md, "px ").concat(theme.spacing.xl, "px"),
23
+ width: "100%",
24
+ borderBottom: "1px solid ".concat(theme.colors.gray[3]),
25
+ fontSize: theme.headings.sizes.h4.fontSize,
26
+ lineHeight: theme.headings.sizes.h4.fontSize
27
+ },
28
+ default: {},
29
+ success: {
30
+ backgroundColor: theme.colors.lime[6],
31
+ color: white
32
+ },
33
+ warning: {
34
+ backgroundColor: theme.colors.yellow[5],
35
+ color: white
36
+ },
37
+ critical: {
38
+ backgroundColor: theme.colors.red[6],
39
+ color: white
40
+ },
41
+ info: {
42
+ backgroundColor: theme.colors.navy[5],
43
+ color: white
44
+ },
45
+ whiteClose: {
46
+ color: white,
47
+ "&:hover": {
48
+ backgroundColor: "transparent"
49
+ }
50
+ }
51
+ };
52
+ });
53
+ export var Prompt = function(_param) {
54
+ var children = _param.children, variant = _param.variant, size = _param.size, otherProps = _object_without_properties(_param, [
55
+ "children",
56
+ "variant",
57
+ "size"
58
+ ]);
59
+ var ref = useStyles(), classes = ref.classes, cx = ref.cx;
60
+ var defaultVariant = variant === "default";
61
+ var convertedChildren = Children.toArray(children);
62
+ var otherChildren = convertedChildren.filter(function(child) {
63
+ return child.type !== PromptFooter;
64
+ });
65
+ var footer = convertedChildren.find(function(child) {
66
+ return child.type === PromptFooter;
67
+ });
68
+ var classNames = {
69
+ header: cx(classes.header, classes[variant]),
70
+ close: !defaultVariant && classes.whiteClose,
71
+ body: classes.body,
72
+ modal: !defaultVariant && classes.modalType
73
+ };
74
+ return /*#__PURE__*/ _jsxs(Modal, _object_spread_props(_object_spread({
75
+ padding: 0,
76
+ classNames: classNames,
77
+ size: defaultVariant ? size : "sm"
78
+ }, otherProps), {
79
+ children: [
80
+ /*#__PURE__*/ _jsx("div", {
81
+ className: classes.innerBody,
82
+ children: otherChildren
83
+ }),
84
+ footer
85
+ ]
86
+ }));
87
+ };
88
+ Prompt.Footer = PromptFooter;
89
+
90
+ //# sourceMappingURL=Prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => {\n const white = '#fff';\n return {\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px ${theme.spacing.lg}px`,\n },\n header: {\n padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h4.fontSize,\n lineHeight: theme.headings.sizes.h4.fontSize,\n },\n default: {},\n success: {backgroundColor: theme.colors.lime[6], color: white},\n warning: {backgroundColor: theme.colors.yellow[5], color: white},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: white,\n },\n info: {backgroundColor: theme.colors.navy[5], color: white},\n whiteClose: {color: white, '&:hover': {backgroundColor: 'transparent'}},\n };\n});\n\nexport interface PromptProps extends ModalProps {\n variant: 'default' | 'success' | 'warning' | 'critical' | 'info';\n children: ReactNode;\n}\ninterface PromptType {\n (props: PromptProps): ReactElement;\n Footer: typeof PromptFooter;\n}\n\nexport const Prompt: PromptType = ({children, variant, size, ...otherProps}) => {\n const {classes, cx} = useStyles();\n const defaultVariant = variant === 'default';\n const convertedChildren = Children.toArray(children) as ReactElement[];\n\n const otherChildren = convertedChildren.filter((child) => child.type !== PromptFooter);\n const footer = convertedChildren.find((child) => child.type === PromptFooter);\n\n const classNames = {\n header: cx(classes.header, classes[variant]),\n close: !defaultVariant && classes.whiteClose,\n body: classes.body,\n modal: !defaultVariant && classes.modalType,\n };\n\n return (\n <Modal padding={0} classNames={classNames} size={defaultVariant ? size : 'sm'} {...otherProps}>\n <div className={classes.innerBody}>{otherChildren}</div>\n {footer}\n </Modal>\n );\n};\n\nPrompt.Footer = PromptFooter;\n"],"names":["createStyles","Modal","Children","PromptFooter","useStyles","theme","white","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h4","lineHeight","default","success","backgroundColor","lime","color","warning","yellow","critical","red","info","navy","whiteClose","Prompt","children","variant","size","otherProps","classes","cx","defaultVariant","convertedChildren","toArray","otherChildren","filter","child","type","footer","find","classNames","close","modal","div","className","Footer"],"mappings":"AAAA;;;;AAAA,SAAQA,YAAY,EAAEC,KAAK,QAAmB,eAAe,CAAC;AAC9D,SAAQC,QAAQ,QAA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,OAAO,CAAC1B,MAAM,EAAE0B,OAAO,CAACH,OAAO,CAAC,CAAC;QAC5Ce,KAAK,EAAE,CAACV,cAAc,IAAIF,OAAO,CAACN,UAAU;QAC5C9B,IAAI,EAAEoC,OAAO,CAACpC,IAAI;QAClBiD,KAAK,EAAE,CAACX,cAAc,IAAIF,OAAO,CAAClC,SAAS;KAC9C,AAAC;IAEF,qBACI,MAACR,KAAK;QAACO,OAAO,EAAE,CAAC;QAAE8C,UAAU,EAAEA,UAAU;QAAEb,IAAI,EAAEI,cAAc,GAAGJ,IAAI,GAAG,IAAI;OAAMC,UAAU;;0BACzF,KAACe,KAAG;gBAACC,SAAS,EAAEf,OAAO,CAAC/B,SAAS;0BAAGoC,aAAa;cAAO;YACvDI,MAAM;;OACH,CACV;AACN,CAAC,CAAC;AAEFd,MAAM,CAACqB,MAAM,GAAGxD,YAAY,CAAC"}
@@ -0,0 +1,15 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { StickyFooter } from "../sticky-footer";
6
+ export var PromptFooter = function(_param) /*#__PURE__*/ {
7
+ var children = _param.children, otherProps = _object_without_properties(_param, [
8
+ "children"
9
+ ]);
10
+ return _jsx(StickyFooter, _object_spread_props(_object_spread({}, otherProps), {
11
+ children: children
12
+ }));
13
+ };
14
+
15
+ //# sourceMappingURL=PromptFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/PromptFooter.tsx"],"sourcesContent":["import {FunctionComponent} from 'react';\nimport {StickyFooter, StickyFooterProps} from '../sticky-footer';\n\nexport interface PromptFooterProps extends StickyFooterProps {}\n\nexport const PromptFooter: FunctionComponent<PromptFooterProps> = ({children, ...otherProps}) => (\n <StickyFooter {...otherProps}>{children}</StickyFooter>\n);\n"],"names":["StickyFooter","PromptFooter","children","otherProps"],"mappings":"AAAA;;;;AACA,SAAQA,YAAY,QAA0B,kBAAkB,CAAC;AAIjE,OAAO,IAAMC,YAAY,GAAyC,+BAC9D;QADgEC,QAAQ,UAARA,QAAQ,EAAKC,UAAU;QAAvBD,UAAQ;;WACxE,KAACF,YAAY,0CAAKG,UAAU;kBAAGD,QAAQ;OAAgB;AAAD,CACzD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./Prompt";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/prompt/index.ts"],"sourcesContent":["export * from './Prompt';\n"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {createStyles, DefaultProps, Divider, Group, Paper} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\ninterface 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 maxHeight: '80px',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<StickyFooterProps> = ({borderTop, children, ...others}) => {\n const {classes} = useStyles();\n\n return (\n <Paper className={classes.footer}>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Group position=\"right\" spacing=\"xs\" py=\"md\" px=\"xl\" {...others}>\n {children}\n </Group>\n </Paper>\n );\n};\n"],"names":["createStyles","Divider","Group","Paper","useStyles","footer","position","bottom","zIndex","maxHeight","StickyFooter","borderTop","children","others","classes","className","size","spacing","py","px"],"mappings":"AAAA;;;;AAAA,SAAQA,YAAY,EAAgBC,OAAO,EAAEC,KAAK,EAAEC,KAAK,QAAO,eAAe,CAAC;AAUhF,IAAMC,SAAS,GAAGJ,YAAY,CAAC;WAAO;QAClCK,MAAM,EAAE;YACJC,QAAQ,EAAE,QAAQ;YAClBC,MAAM,EAAE,CAAC;YACTC,MAAM,EAAE,CAAC;YACTC,SAAS,EAAE,MAAM;SACpB;KACJ;CAAC,CAAC,AAAC;AAEJ,OAAO,IAAMC,YAAY,GAAyC,iBAAsC;QAApCC,SAAS,UAATA,SAAS,EAAEC,QAAQ,UAARA,QAAQ,EAAKC,MAAM;QAA9BF,WAAS;QAAEC,UAAQ;;IACnF,IAAM,AAACE,OAAO,GAAIV,SAAS,EAAE,CAAtBU,OAAO,AAAe,AAAC;IAE9B,qBACI,MAACX,KAAK;QAACY,SAAS,EAAED,OAAO,CAACT,MAAM;;YAC3BM,SAAS,iBAAG,KAACV,OAAO;gBAACe,IAAI,EAAC,IAAI;cAAG,GAAG,IAAI;0BACzC,KAACd,KAAK;gBAACI,QAAQ,EAAC,OAAO;gBAACW,OAAO,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;eAAKN,MAAM;0BAC1DD,QAAQ;eACL;;MACJ,CACV;AACN,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../../src/components/sticky-footer/StickyFooter.tsx"],"sourcesContent":["import {createStyles, DefaultProps, Divider, Group, Paper} from '@mantine/core';\nimport {FunctionComponent} 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 maxHeight: '80px',\n },\n}));\n\nexport const StickyFooter: FunctionComponent<StickyFooterProps> = ({borderTop, children, ...others}) => {\n const {classes} = useStyles();\n\n return (\n <Paper className={classes.footer}>\n {borderTop ? <Divider size=\"xs\" /> : null}\n <Group position=\"right\" spacing=\"xs\" py=\"md\" px=\"xl\" {...others}>\n {children}\n </Group>\n </Paper>\n );\n};\n"],"names":["createStyles","Divider","Group","Paper","useStyles","footer","position","bottom","zIndex","maxHeight","StickyFooter","borderTop","children","others","classes","className","size","spacing","py","px"],"mappings":"AAAA;;;;AAAA,SAAQA,YAAY,EAAgBC,OAAO,EAAEC,KAAK,EAAEC,KAAK,QAAO,eAAe,CAAC;AAUhF,IAAMC,SAAS,GAAGJ,YAAY,CAAC;WAAO;QAClCK,MAAM,EAAE;YACJC,QAAQ,EAAE,QAAQ;YAClBC,MAAM,EAAE,CAAC;YACTC,MAAM,EAAE,CAAC;YACTC,SAAS,EAAE,MAAM;SACpB;KACJ;CAAC,CAAC,AAAC;AAEJ,OAAO,IAAMC,YAAY,GAAyC,iBAAsC;QAApCC,SAAS,UAATA,SAAS,EAAEC,QAAQ,UAARA,QAAQ,EAAKC,MAAM;QAA9BF,WAAS;QAAEC,UAAQ;;IACnF,IAAM,AAACE,OAAO,GAAIV,SAAS,EAAE,CAAtBU,OAAO,AAAe,AAAC;IAE9B,qBACI,MAACX,KAAK;QAACY,SAAS,EAAED,OAAO,CAACT,MAAM;;YAC3BM,SAAS,iBAAG,KAACV,OAAO;gBAACe,IAAI,EAAC,IAAI;cAAG,GAAG,IAAI;0BACzC,KAACd,KAAK;gBAACI,QAAQ,EAAC,OAAO;gBAACW,OAAO,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;gBAACC,EAAE,EAAC,IAAI;eAAKN,MAAM;0BAC1DD,QAAQ;eACL;;MACJ,CACV;AACN,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "47.8.0",
3
+ "version": "47.9.1",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -6,6 +6,7 @@ export default createStyles((theme) => ({
6
6
  root: {},
7
7
  item: {
8
8
  backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,
9
+ alignItems: 'baseline',
9
10
  },
10
11
  itemDragging: {
11
12
  boxShadow: theme.shadows.sm,
@@ -6,4 +6,5 @@ export * from './sticky-footer';
6
6
  export * from './header';
7
7
  export * from './inline-confirm';
8
8
  export * from './table';
9
+ export * from './prompt';
9
10
  export * from './modal-wizard';
@@ -0,0 +1,66 @@
1
+ import {createStyles, Modal, ModalProps} from '@mantine/core';
2
+ import {Children, ReactElement, ReactNode} from 'react';
3
+ import {PromptFooter} from './PromptFooter';
4
+
5
+ const useStyles = createStyles((theme) => {
6
+ const white = '#fff';
7
+ return {
8
+ body: {
9
+ padding: 0,
10
+ },
11
+ modalType: {overflow: 'hidden', width: 550},
12
+ innerBody: {
13
+ padding: `${theme.spacing.md}px ${theme.spacing.xl}px ${theme.spacing.lg}px`,
14
+ },
15
+ header: {
16
+ padding: `${theme.spacing.md}px ${theme.spacing.xl}px`,
17
+ width: '100%',
18
+ borderBottom: `1px solid ${theme.colors.gray[3]}`,
19
+ fontSize: theme.headings.sizes.h4.fontSize,
20
+ lineHeight: theme.headings.sizes.h4.fontSize,
21
+ },
22
+ default: {},
23
+ success: {backgroundColor: theme.colors.lime[6], color: white},
24
+ warning: {backgroundColor: theme.colors.yellow[5], color: white},
25
+ critical: {
26
+ backgroundColor: theme.colors.red[6],
27
+ color: white,
28
+ },
29
+ info: {backgroundColor: theme.colors.navy[5], color: white},
30
+ whiteClose: {color: white, '&:hover': {backgroundColor: 'transparent'}},
31
+ };
32
+ });
33
+
34
+ export interface PromptProps extends ModalProps {
35
+ variant: 'default' | 'success' | 'warning' | 'critical' | 'info';
36
+ children: ReactNode;
37
+ }
38
+ interface PromptType {
39
+ (props: PromptProps): ReactElement;
40
+ Footer: typeof PromptFooter;
41
+ }
42
+
43
+ export const Prompt: PromptType = ({children, variant, size, ...otherProps}) => {
44
+ const {classes, cx} = useStyles();
45
+ const defaultVariant = variant === 'default';
46
+ const convertedChildren = Children.toArray(children) as ReactElement[];
47
+
48
+ const otherChildren = convertedChildren.filter((child) => child.type !== PromptFooter);
49
+ const footer = convertedChildren.find((child) => child.type === PromptFooter);
50
+
51
+ const classNames = {
52
+ header: cx(classes.header, classes[variant]),
53
+ close: !defaultVariant && classes.whiteClose,
54
+ body: classes.body,
55
+ modal: !defaultVariant && classes.modalType,
56
+ };
57
+
58
+ return (
59
+ <Modal padding={0} classNames={classNames} size={defaultVariant ? size : 'sm'} {...otherProps}>
60
+ <div className={classes.innerBody}>{otherChildren}</div>
61
+ {footer}
62
+ </Modal>
63
+ );
64
+ };
65
+
66
+ Prompt.Footer = PromptFooter;
@@ -0,0 +1,8 @@
1
+ import {FunctionComponent} from 'react';
2
+ import {StickyFooter, StickyFooterProps} from '../sticky-footer';
3
+
4
+ export interface PromptFooterProps extends StickyFooterProps {}
5
+
6
+ export const PromptFooter: FunctionComponent<PromptFooterProps> = ({children, ...otherProps}) => (
7
+ <StickyFooter {...otherProps}>{children}</StickyFooter>
8
+ );
@@ -0,0 +1,29 @@
1
+ import {render, screen} from '@test-utils';
2
+ import {Prompt} from '../Prompt';
3
+
4
+ describe('Prompt', () => {
5
+ it('displays the title, body and close button', () => {
6
+ render(
7
+ <Prompt variant="default" opened onClose={jest.fn()} title="title modal">
8
+ content modal
9
+ <Prompt.Footer>footer content</Prompt.Footer>
10
+ </Prompt>
11
+ );
12
+ expect(screen.getByText(/content modal/i)).toBeInTheDocument();
13
+ expect(screen.getByText(/footer content/i)).toBeInTheDocument();
14
+ expect(screen.getByText(/title modal/i)).toBeInTheDocument();
15
+ expect(screen.getByRole('button')).toBeInTheDocument();
16
+ });
17
+
18
+ it('calls onClose when clicking on the close button', () => {
19
+ const onClose = jest.fn();
20
+ render(
21
+ <Prompt variant="default" opened onClose={onClose} title="title modal">
22
+ content modal
23
+ </Prompt>
24
+ );
25
+
26
+ screen.getByRole('button').click();
27
+ expect(onClose).toHaveBeenCalledTimes(1);
28
+ });
29
+ });
@@ -0,0 +1 @@
1
+ export * from './Prompt';
@@ -1,7 +1,7 @@
1
1
  import {createStyles, DefaultProps, Divider, Group, Paper} from '@mantine/core';
2
2
  import {FunctionComponent} from 'react';
3
3
 
4
- interface StickyFooterProps extends DefaultProps {
4
+ export interface StickyFooterProps extends DefaultProps {
5
5
  /**
6
6
  * Whether a border is render on top of the footer
7
7
  */