@coveord/plasma-mantine 48.25.4 → 48.26.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,"sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import {Modal as MantineModal, ModalProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\nimport {Header, HeaderProps} from '../header';\n\nexport interface CustomModalProps extends Omit<ModalProps, 'title'> {\n /**\n * Header component props (layout/Header)\n */\n header?: Omit<HeaderProps, 'children' | 'description'>;\n /**\n * The title text displayed on top of the modal\n */\n title: string;\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: HeaderProps['description'];\n}\n\nexport const Modal: FunctionComponent<CustomModalProps> = ({children, title, header, description, ...otherProps}) => (\n <MantineModal\n {...otherProps}\n styles={{title: {width: '100%'}}}\n title={\n <Header py={0} px={0} description={description} {...header}>\n {title}\n </Header>\n }\n >\n {children}\n </MantineModal>\n);\n"],"names":["Modal","children","title","header","description","otherProps","MantineModal","styles","width","Header","py","px"],"mappings":"AAAA;;;;+BAmBaA;;;eAAAA;;;;;;;oBAnBmC;sBAEd;AAiB3B,IAAMA,QAA6C,+BACtD;QADwDC,kBAAAA,UAAUC,eAAAA,OAAOC,gBAAAA,QAAQC,qBAAAA,aAAgBC;QAAzCJ;QAAUC;QAAOC;QAAQC;;WACjF,qBAACE,WAAY,uCACLD;QACJE,QAAQ;YAACL,OAAO;gBAACM,OAAO;YAAM;QAAC;QAC/BN,qBACI,qBAACO,cAAM;YAACC,IAAI;YAAGC,IAAI;YAAGP,aAAaA;WAAiBD;sBAC/CD;;kBAIRD;;AACS"}
1
+ {"version":3,"sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import {Modal as MantineModal, ModalProps} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\nimport {Header, HeaderProps} from '../header';\n\nexport interface CustomModalProps extends Omit<ModalProps, 'title'> {\n /**\n * Header component props (layout/Header)\n */\n header?: Omit<HeaderProps, 'children' | 'description'>;\n /**\n * The title text displayed on top of the modal\n */\n title: ReactNode;\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: HeaderProps['description'];\n}\n\nexport const Modal: FunctionComponent<CustomModalProps> = ({children, title, header, description, ...otherProps}) => (\n <MantineModal\n {...otherProps}\n styles={{title: {width: '100%'}}}\n title={\n <Header py={0} px={0} description={description} {...header}>\n {title}\n </Header>\n }\n >\n {children}\n </MantineModal>\n);\n"],"names":["Modal","children","title","header","description","otherProps","MantineModal","styles","width","Header","py","px"],"mappings":"AAAA;;;;+BAmBaA;;;eAAAA;;;;;;;oBAnBmC;sBAEd;AAiB3B,IAAMA,QAA6C,+BACtD;QADwDC,kBAAAA,UAAUC,eAAAA,OAAOC,gBAAAA,QAAQC,qBAAAA,aAAgBC;QAAzCJ;QAAUC;QAAOC;QAAQC;;WACjF,qBAACE,WAAY,uCACLD;QACJE,QAAQ;YAACL,OAAO;gBAACM,OAAO;YAAM;QAAC;QAC/BN,qBACI,qBAACO,cAAM;YAACC,IAAI;YAAGC,IAAI;YAAGP,aAAaA;WAAiBD;sBAC/CD;;kBAIRD;;AACS"}
@@ -1,5 +1,5 @@
1
1
  import { ModalProps } from '@mantine/core';
2
- import { FunctionComponent } from 'react';
2
+ import { FunctionComponent, ReactNode } from 'react';
3
3
  import { HeaderProps } from '../header';
4
4
  export interface CustomModalProps extends Omit<ModalProps, 'title'> {
5
5
  /**
@@ -9,7 +9,7 @@ export interface CustomModalProps extends Omit<ModalProps, 'title'> {
9
9
  /**
10
10
  * The title text displayed on top of the modal
11
11
  */
12
- title: string;
12
+ title: ReactNode;
13
13
  /**
14
14
  * The description text displayed inside the header underneath the title
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAS,WAAW,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/D;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,aAAa,CAAC,CAAC;IACvD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAYrD,CAAC"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAS,WAAW,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/D;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,aAAa,CAAC,CAAC;IACvD;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAYrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import {Modal as MantineModal, ModalProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\nimport {Header, HeaderProps} from '../header';\n\nexport interface CustomModalProps extends Omit<ModalProps, 'title'> {\n /**\n * Header component props (layout/Header)\n */\n header?: Omit<HeaderProps, 'children' | 'description'>;\n /**\n * The title text displayed on top of the modal\n */\n title: string;\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: HeaderProps['description'];\n}\n\nexport const Modal: FunctionComponent<CustomModalProps> = ({children, title, header, description, ...otherProps}) => (\n <MantineModal\n {...otherProps}\n styles={{title: {width: '100%'}}}\n title={\n <Header py={0} px={0} description={description} {...header}>\n {title}\n </Header>\n }\n >\n {children}\n </MantineModal>\n);\n"],"names":["Modal","MantineModal","Header","children","title","header","description","otherProps","styles","width","py","px"],"mappings":"AAAA;;;;AAAA,SAAQA,SAASC,YAAY,QAAmB,gBAAgB;AAEhE,SAAQC,MAAM,QAAoB,YAAY;AAiB9C,OAAO,IAAMF,QAA6C,+BACtD;QADwDG,kBAAAA,UAAUC,eAAAA,OAAOC,gBAAAA,QAAQC,qBAAAA,aAAgBC;QAAzCJ;QAAUC;QAAOC;QAAQC;;WACjF,KAACL,sDACOM;QACJC,QAAQ;YAACJ,OAAO;gBAACK,OAAO;YAAM;QAAC;QAC/BL,qBACI,KAACF;YAAOQ,IAAI;YAAGC,IAAI;YAAGL,aAAaA;WAAiBD;sBAC/CD;;kBAIRD;;AACS,EAChB"}
1
+ {"version":3,"sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import {Modal as MantineModal, ModalProps} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\nimport {Header, HeaderProps} from '../header';\n\nexport interface CustomModalProps extends Omit<ModalProps, 'title'> {\n /**\n * Header component props (layout/Header)\n */\n header?: Omit<HeaderProps, 'children' | 'description'>;\n /**\n * The title text displayed on top of the modal\n */\n title: ReactNode;\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: HeaderProps['description'];\n}\n\nexport const Modal: FunctionComponent<CustomModalProps> = ({children, title, header, description, ...otherProps}) => (\n <MantineModal\n {...otherProps}\n styles={{title: {width: '100%'}}}\n title={\n <Header py={0} px={0} description={description} {...header}>\n {title}\n </Header>\n }\n >\n {children}\n </MantineModal>\n);\n"],"names":["Modal","MantineModal","Header","children","title","header","description","otherProps","styles","width","py","px"],"mappings":"AAAA;;;;AAAA,SAAQA,SAASC,YAAY,QAAmB,gBAAgB;AAEhE,SAAQC,MAAM,QAAoB,YAAY;AAiB9C,OAAO,IAAMF,QAA6C,+BACtD;QADwDG,kBAAAA,UAAUC,eAAAA,OAAOC,gBAAAA,QAAQC,qBAAAA,aAAgBC;QAAzCJ;QAAUC;QAAOC;QAAQC;;WACjF,KAACL,sDACOM;QACJC,QAAQ;YAACJ,OAAO;gBAACK,OAAO;YAAM;QAAC;QAC/BL,qBACI,KAACF;YAAOQ,IAAI;YAAGC,IAAI;YAAGL,aAAaA;WAAiBD;sBAC/CD;;kBAIRD;;AACS,EAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveord/plasma-mantine",
3
- "version": "48.25.4",
3
+ "version": "48.26.0",
4
4
  "description": "A Plasma flavoured Mantine theme",
5
5
  "keywords": [
6
6
  "plasma",
@@ -1,5 +1,5 @@
1
1
  import {Modal as MantineModal, ModalProps} from '@mantine/core';
2
- import {FunctionComponent} from 'react';
2
+ import {FunctionComponent, ReactNode} from 'react';
3
3
  import {Header, HeaderProps} from '../header';
4
4
 
5
5
  export interface CustomModalProps extends Omit<ModalProps, 'title'> {
@@ -10,7 +10,7 @@ export interface CustomModalProps extends Omit<ModalProps, 'title'> {
10
10
  /**
11
11
  * The title text displayed on top of the modal
12
12
  */
13
- title: string;
13
+ title: ReactNode;
14
14
  /**
15
15
  * The description text displayed inside the header underneath the title
16
16
  */
@@ -1,5 +1,6 @@
1
+ import {QuestionSize32Px} from '@coveord/plasma-react-icons';
1
2
  import {Container} from '@mantine/core';
2
- import {render, screen, fireEvent} from '@test-utils';
3
+ import {fireEvent, render, screen} from '@test-utils';
3
4
  import {Modal} from '../Modal';
4
5
 
5
6
  describe('Modal', () => {
@@ -17,6 +18,25 @@ describe('Modal', () => {
17
18
  expect(screen.getByRole('button')).toBeInTheDocument();
18
19
  });
19
20
 
21
+ it('allows ReactNode as title', async () => {
22
+ render(
23
+ <Modal
24
+ opened
25
+ onClose={jest.fn()}
26
+ title={
27
+ <div>
28
+ <QuestionSize32Px />
29
+ ReactNode title
30
+ </div>
31
+ }
32
+ >
33
+ <Container>Children</Container>
34
+ </Modal>
35
+ );
36
+ expect(await screen.findByRole('img', {name: /question/i})).toBeInTheDocument();
37
+ expect(screen.getByText(/reactnode title/i)).toBeInTheDocument();
38
+ });
39
+
20
40
  it('trigger onClose function when click on the close button', () => {
21
41
  const onClose = jest.fn();
22
42
  render(