@coveord/plasma-mantine 52.14.1 → 52.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/Prompt.tsx"],"names":[],"mappings":"AACA,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;AA8B5C,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC3C;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtD,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"}
1
+ {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/Prompt.tsx"],"names":[],"mappings":"AACA,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;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtD,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"}
@@ -33,7 +33,8 @@ var useStyles = (0, _core.createStyles)(function(theme) {
33
33
  width: "100%",
34
34
  borderBottom: "1px solid ".concat(theme.colors.gray[3]),
35
35
  fontSize: theme.headings.sizes.h3.fontSize,
36
- lineHeight: theme.headings.sizes.h3.lineHeight
36
+ lineHeight: theme.headings.sizes.h3.lineHeight,
37
+ overflowWrap: "anywhere"
37
38
  },
38
39
  success: {
39
40
  backgroundColor: theme.colors.lime[6],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {color} from '@coveord/plasma-tokens';\nimport {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => ({\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md} ${theme.spacing.xl} ${theme.spacing.lg}`,\n },\n header: {\n padding: `${theme.spacing.md} ${theme.spacing.xl}`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h3.fontSize,\n lineHeight: theme.headings.sizes.h3.lineHeight,\n },\n success: {backgroundColor: theme.colors.lime[6], color: color.primary.pureWhite},\n warning: {backgroundColor: theme.colors.yellow[5], color: color.primary.pureWhite},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: color.primary.pureWhite,\n },\n info: {backgroundColor: theme.colors.navy[5], color: color.primary.pureWhite},\n whiteClose: {color: color.primary.pureWhite, '&:hover': {backgroundColor: 'transparent'}},\n title: {\n color: color.primary.pureWhite,\n },\n}));\n\nexport interface PromptProps extends ModalProps {\n /**\n * Controls prompt appearance\n *\n * @default \"info\"\n */\n variant?: '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 = 'info', ...otherProps}) => {\n const {classes, cx} = useStyles();\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: classes.whiteClose,\n body: classes.body,\n modal: classes.modalType,\n title: classes.title,\n };\n\n return (\n <Modal variant=\"prompt\" padding={0} classNames={classNames} 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","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h3","lineHeight","success","backgroundColor","lime","color","primary","pureWhite","warning","yellow","critical","red","info","navy","whiteClose","title","children","variant","otherProps","classes","cx","convertedChildren","Children","toArray","otherChildren","filter","child","type","PromptFooter","footer","find","classNames","close","modal","Modal","size","div","className","Footer"],"mappings":";;;;+BA+CaA;;;eAAAA;;;;;;;4BA/CO;oBAC0B;qBACE;4BACrB;AAE3B,IAAMC,YAAYC,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACvCC,MAAM;YACFC,SAAS;QACb;QACAC,WAAW;YAACC,UAAU;YAAUC,OAAO;QAAG;QAC1CC,WAAW;YACPJ,SAAS,AAAC,GAAsBF,OAApBA,MAAMO,OAAO,CAACC,EAAE,EAAC,KAAuBR,OAApBA,MAAMO,OAAO,CAACE,EAAE,EAAC,KAAoB,OAAjBT,MAAMO,OAAO,CAACG,EAAE;QACxE;QACAC,QAAQ;YACJT,SAAS,AAAC,GAAsBF,OAApBA,MAAMO,OAAO,CAACC,EAAE,EAAC,KAAoB,OAAjBR,MAAMO,OAAO,CAACE,EAAE;YAChDJ,OAAO;YACPO,cAAc,AAAC,aAAiC,OAArBZ,MAAMa,MAAM,CAACC,IAAI,CAAC,EAAE;YAC/CC,UAAU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AACF,QAAQ;QAC3Ce,OAAOb,QAAQL,UAAU;QACzB/B,MAAMoC,QAAQpC,IAAI;QAClBkD,OAAOd,QAAQlC,SAAS;QACxB8B,OAAOI,QAAQJ,KAAK;IACxB;IAEA,qBACI,sBAACmB,WAAK;QAACjB,SAAQ;QAASjC,SAAS;QAAG+C,YAAYA;QAAYI,MAAM;OAAUjB;;0BACxE,qBAACkB;gBAAIC,WAAWlB,QAAQ/B,SAAS;0BAAGoC;;YACnCK;;;AAGb;AAEAlD,OAAO2D,MAAM,GAAGV,0BAAY"}
1
+ {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {color} from '@coveord/plasma-tokens';\nimport {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => ({\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md} ${theme.spacing.xl} ${theme.spacing.lg}`,\n },\n header: {\n padding: `${theme.spacing.md} ${theme.spacing.xl}`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h3.fontSize,\n lineHeight: theme.headings.sizes.h3.lineHeight,\n overflowWrap: 'anywhere',\n },\n success: {backgroundColor: theme.colors.lime[6], color: color.primary.pureWhite},\n warning: {backgroundColor: theme.colors.yellow[5], color: color.primary.pureWhite},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: color.primary.pureWhite,\n },\n info: {backgroundColor: theme.colors.navy[5], color: color.primary.pureWhite},\n whiteClose: {color: color.primary.pureWhite, '&:hover': {backgroundColor: 'transparent'}},\n title: {\n color: color.primary.pureWhite,\n },\n}));\n\nexport interface PromptProps extends ModalProps {\n /**\n * Controls prompt appearance\n *\n * @default \"info\"\n */\n variant?: '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 = 'info', ...otherProps}) => {\n const {classes, cx} = useStyles();\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: classes.whiteClose,\n body: classes.body,\n modal: classes.modalType,\n title: classes.title,\n };\n\n return (\n <Modal variant=\"prompt\" padding={0} classNames={classNames} 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","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h3","lineHeight","overflowWrap","success","backgroundColor","lime","color","primary","pureWhite","warning","yellow","critical","red","info","navy","whiteClose","title","children","variant","otherProps","classes","cx","convertedChildren","Children","toArray","otherChildren","filter","child","type","PromptFooter","footer","find","classNames","close","modal","Modal","size","div","className","Footer"],"mappings":";;;;+BAgDaA;;;eAAAA;;;;;;;4BAhDO;oBAC0B;qBACE;4BACrB;AAE3B,IAAMC,YAAYC,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACvCC,MAAM;YACFC,SAAS;QACb;QACAC,WAAW;YAACC,UAAU;YAAUC,OAAO;QAAG;QAC1CC,WAAW;YACPJ,SAAS,AAAC,GAAsBF,OAApBA,MAAMO,OAAO,CAACC,EAAE,EAAC,KAAuBR,OAApBA,MAAMO,OAAO,CAACE,EAAE,EAAC,KAAoB,OAAjBT,MAAMO,OAAO,CAACG,EAAE;QACxE;QACAC,QAAQ;YACJT,SAAS,AAAC,GAAsBF,OAApBA,MAAMO,OAAO,CAACC,EAAE,EAAC,KAAoB,OAAjBR,MAAMO,OAAO,CAACE,EAAE;YAChDJ,OAAO;YACPO,cAAc,AAAC,aAAiC,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AE5E,IAAMG,aAAa;QACfvC,QAAQ4B,GAAGD,QAAQ3B,MAAM,EAAE2B,OAAO,CAACF,QAAQ;QAC3Ce,OAAOb,QAAQL,UAAU;QACzBhC,MAAMqC,QAAQrC,IAAI;QAClBmD,OAAOd,QAAQnC,SAAS;QACxB+B,OAAOI,QAAQJ,KAAK;IACxB;IAEA,qBACI,sBAACmB,WAAK;QAACjB,SAAQ;QAASlC,SAAS;QAAGgD,YAAYA;QAAYI,MAAM;OAAUjB;;0BACxE,qBAACkB;gBAAIC,WAAWlB,QAAQhC,SAAS;0BAAGqC;;YACnCK;;;AAGb;AAEAnD,OAAO4D,MAAM,GAAGV,0BAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/Prompt.tsx"],"names":[],"mappings":"AACA,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;AA8B5C,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC3C;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtD,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"}
1
+ {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/Prompt.tsx"],"names":[],"mappings":"AACA,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;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtD,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"}
@@ -23,7 +23,8 @@ var useStyles = createStyles(function(theme) {
23
23
  width: "100%",
24
24
  borderBottom: "1px solid ".concat(theme.colors.gray[3]),
25
25
  fontSize: theme.headings.sizes.h3.fontSize,
26
- lineHeight: theme.headings.sizes.h3.lineHeight
26
+ lineHeight: theme.headings.sizes.h3.lineHeight,
27
+ overflowWrap: "anywhere"
27
28
  },
28
29
  success: {
29
30
  backgroundColor: theme.colors.lime[6],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {color} from '@coveord/plasma-tokens';\nimport {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => ({\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md} ${theme.spacing.xl} ${theme.spacing.lg}`,\n },\n header: {\n padding: `${theme.spacing.md} ${theme.spacing.xl}`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h3.fontSize,\n lineHeight: theme.headings.sizes.h3.lineHeight,\n },\n success: {backgroundColor: theme.colors.lime[6], color: color.primary.pureWhite},\n warning: {backgroundColor: theme.colors.yellow[5], color: color.primary.pureWhite},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: color.primary.pureWhite,\n },\n info: {backgroundColor: theme.colors.navy[5], color: color.primary.pureWhite},\n whiteClose: {color: color.primary.pureWhite, '&:hover': {backgroundColor: 'transparent'}},\n title: {\n color: color.primary.pureWhite,\n },\n}));\n\nexport interface PromptProps extends ModalProps {\n /**\n * Controls prompt appearance\n *\n * @default \"info\"\n */\n variant?: '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 = 'info', ...otherProps}) => {\n const {classes, cx} = useStyles();\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: classes.whiteClose,\n body: classes.body,\n modal: classes.modalType,\n title: classes.title,\n };\n\n return (\n <Modal variant=\"prompt\" padding={0} classNames={classNames} size={'sm'} {...otherProps}>\n <div className={classes.innerBody}>{otherChildren}</div>\n {footer}\n </Modal>\n );\n};\n\nPrompt.Footer = PromptFooter;\n"],"names":["color","createStyles","Modal","Children","PromptFooter","useStyles","theme","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h3","lineHeight","success","backgroundColor","lime","primary","pureWhite","warning","yellow","critical","red","info","navy","whiteClose","title","Prompt","children","variant","otherProps","classes","cx","convertedChildren","toArray","otherChildren","filter","child","type","footer","find","classNames","close","modal","size","div","className","Footer"],"mappings":";;;;AAAA,SAAQA,KAAK,QAAO,yBAAyB;AAC7C,SAAQC,YAAY,EAAEC,KAAK,QAAmB,gBAAgB;AAC9D,SAAQC,QAAQ,QAAgC,QAAQ;AACxD,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,IAAMC,YAAYJ,aAAa,SAACK;WAAW;QACvCC,MAAM;YACFC,SAAS;QACb;QACAC,WAAW;YAACC,UAAU;YAAUC,OAAO;QAAG;QAC1CC,WAAW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IAAsBpC,aAAAA,aAAfsC,UAAetC,WAAfsC,SAASC,KAAMvC,WAANuC;IAChB,IAAMC,oBAAoB1C,SAAS2C,OAAO,CAACN;IAE3C,IAAMO,gBAAgBF,kBAAkBG,MAAM,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAK9C;;IACzE,IAAM+C,SAASN,kBAAkBO,IAAI,CAAC,SAACH;eAAUA,MAAMC,IAAI,KAAK9C;;IAEhE,IAAMiD,aAAa;QACfpC,QAAQ2B,GAAGD,QAAQ1B,MAAM,EAAE0B,OAAO,CAACF,QAAQ;QAC3Ca,OAAOX,QAAQN,UAAU;QACzB9B,MAAMoC,QAAQpC,IAAI;QAClBgD,OAAOZ,QAAQlC,SAAS;QACxB6B,OAAOK,QAAQL,KAAK;IACxB;IAEA,qBACI,MAACpC;QAAMuC,SAAQ;QAASjC,SAAS;QAAG6C,YAAYA;QAAYG,MAAM;OAAUd;;0BACxE,KAACe;gBAAIC,WAAWf,QAAQ/B,SAAS;0BAAGmC;;YACnCI;;;AAGb,EAAE;AAEFZ,OAAOoB,MAAM,GAAGvD"}
1
+ {"version":3,"sources":["../../../../src/components/prompt/Prompt.tsx"],"sourcesContent":["import {color} from '@coveord/plasma-tokens';\nimport {createStyles, Modal, ModalProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {PromptFooter} from './PromptFooter';\n\nconst useStyles = createStyles((theme) => ({\n body: {\n padding: 0,\n },\n modalType: {overflow: 'hidden', width: 550},\n innerBody: {\n padding: `${theme.spacing.md} ${theme.spacing.xl} ${theme.spacing.lg}`,\n },\n header: {\n padding: `${theme.spacing.md} ${theme.spacing.xl}`,\n width: '100%',\n borderBottom: `1px solid ${theme.colors.gray[3]}`,\n fontSize: theme.headings.sizes.h3.fontSize,\n lineHeight: theme.headings.sizes.h3.lineHeight,\n overflowWrap: 'anywhere',\n },\n success: {backgroundColor: theme.colors.lime[6], color: color.primary.pureWhite},\n warning: {backgroundColor: theme.colors.yellow[5], color: color.primary.pureWhite},\n critical: {\n backgroundColor: theme.colors.red[6],\n color: color.primary.pureWhite,\n },\n info: {backgroundColor: theme.colors.navy[5], color: color.primary.pureWhite},\n whiteClose: {color: color.primary.pureWhite, '&:hover': {backgroundColor: 'transparent'}},\n title: {\n color: color.primary.pureWhite,\n },\n}));\n\nexport interface PromptProps extends ModalProps {\n /**\n * Controls prompt appearance\n *\n * @default \"info\"\n */\n variant?: '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 = 'info', ...otherProps}) => {\n const {classes, cx} = useStyles();\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: classes.whiteClose,\n body: classes.body,\n modal: classes.modalType,\n title: classes.title,\n };\n\n return (\n <Modal variant=\"prompt\" padding={0} classNames={classNames} size={'sm'} {...otherProps}>\n <div className={classes.innerBody}>{otherChildren}</div>\n {footer}\n </Modal>\n );\n};\n\nPrompt.Footer = PromptFooter;\n"],"names":["color","createStyles","Modal","Children","PromptFooter","useStyles","theme","body","padding","modalType","overflow","width","innerBody","spacing","md","xl","lg","header","borderBottom","colors","gray","fontSize","headings","sizes","h3","lineHeight","overflowWrap","success","backgroundColor","lime","primary","pureWhite","warning","yellow","critical","red","info","navy","whiteClose","title","Prompt","children","variant","otherProps","classes","cx","convertedChildren","toArray","otherChildren","filter","child","type","footer","find","classNames","close","modal","size","div","className","Footer"],"mappings":";;;;AAAA,SAAQA,KAAK,QAAO,yBAAyB;AAC7C,SAAQC,YAAY,EAAEC,KAAK,QAAmB,gBAAgB;AAC9D,SAAQC,QAAQ,QAAgC,QAAQ;AACxD,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,IAAMC,YAAYJ,aAAa,SA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QAClC;IACJ;;AAgBA,OAAO,IAAMS,SAAqB;QAAEC,kBAAAA,kCAAUC,SAAAA,sCAAU,yBAAWC;QAA/BF;QAAUC;;IAC1C,IAAsBrC,aAAAA,aAAfuC,UAAevC,WAAfuC,SAASC,KAAMxC,WAANwC;IAChB,IAAMC,oBAAoB3C,SAAS4C,OAAO,CAACN;IAE3C,IAAMO,gBAAgBF,kBAAkBG,MAAM,CAAC,SAACC;eAAUA,MAAMC,IAAI,KAAK/C;;IACzE,IAAMgD,SAASN,kBAAkBO,IAAI,CAAC,SAACH;eAAUA,MAAMC,IAAI,KAAK/C;;IAEhE,IAAMkD,aAAa;QACfrC,QAAQ4B,GAAGD,QAAQ3B,MAAM,EAAE2B,OAAO,CAACF,QAAQ;QAC3Ca,OAAOX,QAAQN,UAAU;QACzB/B,MAAMqC,QAAQrC,IAAI;QAClBiD,OAAOZ,QAAQnC,SAAS;QACxB8B,OAAOK,QAAQL,KAAK;IACxB;IAEA,qBACI,MAACrC;QAAMwC,SAAQ;QAASlC,SAAS;QAAG8C,YAAYA;QAAYG,MAAM;OAAUd;;0BACxE,KAACe;gBAAIC,WAAWf,QAAQhC,SAAS;0BAAGoC;;YACnCI;;;AAGb,EAAE;AAEFZ,OAAOoB,MAAM,GAAGxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "52.14.1",
3
+ "version": "52.15.0",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -41,8 +41,8 @@
41
41
  "lodash.debounce": "4.0.8",
42
42
  "lodash.defaultsdeep": "4.6.1",
43
43
  "monaco-editor": "0.41.0",
44
- "@coveord/plasma-react-icons": "52.14.1",
45
- "@coveord/plasma-tokens": "52.14.1"
44
+ "@coveord/plasma-react-icons": "52.15.0",
45
+ "@coveord/plasma-tokens": "52.15.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@emotion/react": "11.11.1",
@@ -54,9 +54,9 @@
54
54
  "@mantine/modals": "6.0.19",
55
55
  "@mantine/notifications": "6.0.19",
56
56
  "@swc/cli": "0.1.62",
57
- "@swc/core": "1.3.76",
57
+ "@swc/core": "1.3.78",
58
58
  "@swc/jest": "0.2.29",
59
- "@testing-library/jest-dom": "6.0.0",
59
+ "@testing-library/jest-dom": "6.0.1",
60
60
  "@testing-library/react": "14.0.0",
61
61
  "@testing-library/user-event": "14.4.3",
62
62
  "@types/jest": "29.5.3",
@@ -67,22 +67,22 @@
67
67
  "@types/testing-library__jest-dom": "5.14.9",
68
68
  "csstype": "3.1.2",
69
69
  "embla-carousel-react": "7.1.0",
70
- "eslint-plugin-testing-library": "5.11.1",
70
+ "eslint-plugin-testing-library": "6.0.0",
71
71
  "eslint-plugin-vitest": "0.2.8",
72
72
  "eslint-plugin-vitest-globals": "1.4.0",
73
73
  "identity-obj-proxy": "3.0.0",
74
- "jest": "29.6.2",
75
- "jest-environment-jsdom": "29.6.2",
74
+ "jest": "29.6.3",
75
+ "jest-environment-jsdom": "29.6.3",
76
76
  "jest-junit": "16.0.0",
77
77
  "npm-run-all": "4.1.5",
78
- "publint": "0.2.0",
78
+ "publint": "0.2.1",
79
79
  "react": "18.2.0",
80
80
  "react-dom": "18.2.0",
81
81
  "rimraf": "5.0.1",
82
- "tslib": "2.6.1",
82
+ "tslib": "2.6.2",
83
83
  "typescript": "5.1.6",
84
- "vitest": "0.34.1",
85
- "eslint-config-plasma": "52.14.1"
84
+ "vitest": "0.34.2",
85
+ "eslint-config-plasma": "52.15.0"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@emotion/react": "^11.10.0",
@@ -20,11 +20,12 @@ describe('Button', () => {
20
20
  );
21
21
  expect(within(screen.getByRole('button', {name: /I am loading/i})).getByRole('presentation')).toBeVisible();
22
22
  expect(
23
- within(screen.queryByRole('button', {name: /I am not loading/i})).queryByRole('presentation'),
23
+ within(screen.getByRole('button', {name: /I am not loading/i})).queryByRole('presentation'),
24
24
  ).not.toBeInTheDocument();
25
25
  });
26
26
 
27
27
  it('shows a loader while the promise is waiting to be resolved', async () => {
28
+ const user = userEvent.setup();
28
29
  let resolve: () => void;
29
30
  let isResolved = false;
30
31
 
@@ -37,7 +38,7 @@ describe('Button', () => {
37
38
 
38
39
  render(<Button onClick={promise}>promise handler</Button>);
39
40
 
40
- userEvent.click(screen.getByRole('button', {name: /promise handler/i}));
41
+ await user.click(screen.getByRole('button', {name: /promise handler/i}));
41
42
 
42
43
  expect(
43
44
  await within(screen.getByRole('button', {name: /promise handler/i})).findByRole('presentation'),
@@ -50,11 +51,12 @@ describe('Button', () => {
50
51
  });
51
52
 
52
53
  expect(
53
- within(screen.queryByRole('button', {name: /promise handler/i})).queryByRole('presentation'),
54
+ within(screen.getByRole('button', {name: /promise handler/i})).queryByRole('presentation'),
54
55
  ).not.toBeInTheDocument();
55
56
  });
56
57
 
57
58
  it('removes the loading if a promise is rejected', async () => {
59
+ const user = userEvent.setup();
58
60
  let reject: () => void;
59
61
  let isRejected = false;
60
62
 
@@ -67,7 +69,7 @@ describe('Button', () => {
67
69
 
68
70
  render(<Button onClick={promise}>promise handler</Button>);
69
71
 
70
- userEvent.click(screen.getByRole('button', {name: /promise handler/i}));
72
+ await user.click(screen.getByRole('button', {name: /promise handler/i}));
71
73
 
72
74
  expect(
73
75
  await within(screen.getByRole('button', {name: /promise handler/i})).findByRole('presentation'),
@@ -80,7 +82,7 @@ describe('Button', () => {
80
82
  });
81
83
 
82
84
  expect(
83
- within(screen.queryByRole('button', {name: /promise handler/i})).queryByRole('presentation'),
85
+ within(screen.getByRole('button', {name: /promise handler/i})).queryByRole('presentation'),
84
86
  ).not.toBeInTheDocument();
85
87
  });
86
88
  });
@@ -17,6 +17,7 @@ const useStyles = createStyles((theme) => ({
17
17
  borderBottom: `1px solid ${theme.colors.gray[3]}`,
18
18
  fontSize: theme.headings.sizes.h3.fontSize,
19
19
  lineHeight: theme.headings.sizes.h3.lineHeight,
20
+ overflowWrap: 'anywhere',
20
21
  },
21
22
  success: {backgroundColor: theme.colors.lime[6], color: color.primary.pureWhite},
22
23
  warning: {backgroundColor: theme.colors.yellow[5], color: color.primary.pureWhite},
@@ -30,6 +30,7 @@ describe('Th', () => {
30
30
  });
31
31
 
32
32
  it('changes the sort icon when clicking on a table header', async () => {
33
+ const user = userEvent.setup();
33
34
  const data: RowData[] = [
34
35
  {name: 'apple', type: 'fruit', colors: ['red', 'green']},
35
36
  {name: 'potato', type: 'vegetable', colors: ['brown', 'blue', 'yellow']},
@@ -37,17 +38,17 @@ describe('Th', () => {
37
38
  const onChange = vi.fn();
38
39
  render(<Table data={data} columns={columns} onChange={onChange} />);
39
40
 
40
- userEvent.click(screen.getByRole('button', {name: /name doubleArrowHead/i}));
41
+ await user.click(screen.getByRole('button', {name: /name doubleArrowHead/i}));
41
42
  await waitFor(() => {
42
43
  expect(onChange).toHaveBeenCalledWith(expect.objectContaining({sorting: [{id: 'name', desc: false}]}));
43
44
  });
44
45
 
45
- userEvent.click(screen.getByRole('button', {name: /name arrowUp/i}));
46
+ await user.click(screen.getByRole('button', {name: /name arrowUp/i}));
46
47
  await waitFor(() => {
47
48
  expect(onChange).toHaveBeenCalledWith(expect.objectContaining({sorting: [{id: 'name', desc: true}]}));
48
49
  });
49
50
 
50
- userEvent.click(screen.getByRole('button', {name: /name arrowDown/i}));
51
+ await user.click(screen.getByRole('button', {name: /name arrowDown/i}));
51
52
  await waitFor(() => {
52
53
  expect(onChange).toHaveBeenCalledWith(expect.objectContaining({sorting: [{id: 'name', desc: false}]}));
53
54
  });