@popsure/dirty-swan 0.51.3 → 0.52.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 (31) hide show
  1. package/dist/cjs/index.d.ts +1 -1
  2. package/dist/cjs/index.js +207 -39034
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/lib/index.d.ts +1 -2
  5. package/dist/esm/components/modal/genericModal/index.js +1 -1
  6. package/dist/esm/components/modal/genericModal/index.js.map +1 -1
  7. package/dist/esm/components/modal/index.stories.js +3 -10
  8. package/dist/esm/components/modal/index.stories.js.map +1 -1
  9. package/dist/esm/index.d.ts +1 -1
  10. package/dist/esm/index.js +0 -6
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/lib/index.d.ts +1 -2
  13. package/package.json +1 -5
  14. package/src/index.tsx +0 -1
  15. package/src/lib/components/modal/genericModal/index.tsx +1 -0
  16. package/src/lib/components/modal/index.stories.tsx +7 -16
  17. package/src/lib/index.tsx +0 -2
  18. package/dist/cjs/lib/components/markdown/config.d.ts +0 -22
  19. package/dist/cjs/lib/components/markdown/index.d.ts +0 -10
  20. package/dist/cjs/lib/components/markdown/index.stories.d.ts +0 -39
  21. package/dist/esm/components/markdown/index.js +0 -38833
  22. package/dist/esm/components/markdown/index.js.map +0 -1
  23. package/dist/esm/components/markdown/index.stories.js +0 -61
  24. package/dist/esm/components/markdown/index.stories.js.map +0 -1
  25. package/dist/esm/lib/components/markdown/config.d.ts +0 -22
  26. package/dist/esm/lib/components/markdown/index.d.ts +0 -10
  27. package/dist/esm/lib/components/markdown/index.stories.d.ts +0 -39
  28. package/src/lib/components/markdown/config.ts +0 -45
  29. package/src/lib/components/markdown/index.stories.tsx +0 -185
  30. package/src/lib/components/markdown/index.tsx +0 -163
  31. package/src/lib/components/markdown/styles.module.scss +0 -37
@@ -19,7 +19,6 @@ import Chip from './components/chip';
19
19
  import { AutoSuggestInput } from './components/input/autoSuggestInput';
20
20
  import { ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, TableHeader } from './components/comparisonTable';
21
21
  import { SegmentedControl } from './components/segmentedControl';
22
- import { Markdown } from './components/markdown';
23
22
  import { Link } from './components/link';
24
23
  import { illustrations, images, IllustrationKeys } from './util/images';
25
24
  import { Spinner } from './components/spinner';
@@ -27,6 +26,6 @@ import { Toggle } from './components/input/toggle';
27
26
  import { Toaster, toast } from './components/toast';
28
27
  import { IconWrapperProps } from './components/icon/IconWrapper';
29
28
  export * from './components/icon';
30
- export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, InfoCard, Card, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Markdown, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Toggle, Toaster, toast, };
29
+ export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, InfoCard, Card, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Toggle, Toaster, toast, };
31
30
  export type { IllustrationKeys, InformationBoxProps, FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus, CardProps, IconWrapperProps };
32
31
  export type { DownloadStatus } from './models/download';
@@ -84,7 +84,7 @@ var GenericModal = function (_a) {
84
84
  : (_d = classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.container) === null || _d === void 0 ? void 0 : _d.call(classNames$1, { isClosing: isClosing }), onClick: handleContainerClick, children: [jsxs("div", { className: classNames('bg-white d-flex ai-center w100 px24 pt24 pb16', styles.header, {
85
85
  'jc-between': !!title,
86
86
  'jc-end': !title,
87
- }), children: [title && (jsx("div", { className: classNames(styles.title, titleSize === 'small' ? 'p-h4' : 'p-h2'), children: title })), dismissible && (jsx(Button, { hideLabel: true, leftIcon: jsx(XIcon, { color: "grey-700" }), onClick: handleOnClose, type: "button", variant: "textColor", className: classNames(classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.closeButton, 'p0', styles.closeButton), children: "Close modal" }))] }), jsx("div", { className: classNames(classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.body, styles.body), children: children }), footer && (jsx("div", { className: classNames(classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.footer, 'w100 bg-white', styles.footer), children: jsx("div", { className: "px24 py16", children: footer }) }))] }) }) }));
87
+ }), children: [title && (jsx("div", { className: classNames(styles.title, titleSize === 'small' ? 'p-h4' : 'p-h2'), children: title })), dismissible && (jsx(Button, { hideLabel: true, leftIcon: jsx(XIcon, { color: "grey-700" }), onClick: handleOnClose, type: "button", variant: "textColor", className: classNames(classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.closeButton, 'p0', styles.closeButton), children: "Close modal" }))] }), jsx("div", { className: classNames('w100', classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.body, styles.body), children: children }), footer && (jsx("div", { className: classNames(classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.footer, 'w100 bg-white', styles.footer), children: jsx("div", { className: "px24 py16", children: footer }) }))] }) }) }));
88
88
  };
89
89
 
90
90
  export { GenericModal };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/modal/hooks/useOnClose.ts","../../../../../../src/lib/components/modal/genericModal/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\ninterface OnCloseReturn {\n isClosing: boolean;\n isVisible: boolean;\n handleOnCloseAnimationEnded: () => void;\n handleContainerClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n handleOnClose: () => void;\n handleOnOverlayClick: () => void;\n}\n\nconst useOnClose = (\n onClose: () => void,\n isOpen: boolean,\n dismissable: boolean\n): OnCloseReturn => {\n const [isVisible, setIsVisible] = useState(false);\n const [isClosing, setIsClosing] = useState(false);\n\n const handleOnClose = useCallback(() => {\n setIsClosing(true);\n }, []);\n\n const handleOnCloseAnimationEnded = useCallback(() => {\n if (isVisible && isClosing) {\n onClose();\n setIsVisible(false);\n setIsClosing(false);\n }\n }, [isClosing, isVisible, onClose]);\n\n const handleOnOverlayClick = useCallback(() => {\n if (!dismissable) {\n return;\n }\n\n handleOnClose();\n }, [dismissable, handleOnClose]);\n\n const handleEscKey = useCallback(\n (e: KeyboardEvent) => {\n if (e.code !== 'Escape') return;\n if (!dismissable) return null;\n if (!isOpen) return null;\n\n handleOnClose();\n },\n [isOpen, dismissable, handleOnClose]\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handleEscKey);\n\n return () => {\n window.removeEventListener('keydown', handleEscKey);\n };\n }, [handleEscKey]);\n\n useEffect(() => {\n if (isOpen) {\n setIsVisible(true);\n }\n \n if (!isOpen && isVisible){\n handleOnClose();\n }\n\n document.body.style.overflow = isOpen ? 'hidden' : 'auto';\n\n return () => {\n document.body.style.overflow = 'auto';\n };\n }, [handleOnClose, isOpen, isVisible]);\n\n const handleContainerClick = (\n e: React.MouseEvent<HTMLDivElement, MouseEvent>\n ) => {\n e.stopPropagation();\n };\n\n return {\n isClosing,\n isVisible,\n handleContainerClick,\n handleOnCloseAnimationEnded,\n handleOnClose,\n handleOnOverlayClick\n };\n};\n\nexport default useOnClose;\n","import { Props } from '..';\nimport useOnClose from '../hooks/useOnClose';\n\nimport styles from './style.module.scss';\nimport classNamesUtil from 'classnames';\nimport { Button } from '../../button';\nimport { XIcon } from '../../icon';\n\ninterface GenericModalProps extends Props {\n classNames?: {\n wrapper?: string | (({ isClosing }: { isClosing: boolean }) => string);\n container?: string | (({ isClosing }: { isClosing: boolean }) => string);\n overlay?: string;\n header?: string;\n closeButton?: string;\n title?: string;\n body?: string;\n footer?: string;\n };\n titleSize?: 'small' | 'default';\n}\n\nexport const GenericModal = ({\n title,\n isOpen,\n children,\n onClose,\n classNames,\n dismissible = true,\n footer,\n titleSize = 'default',\n}: GenericModalProps) => {\n const {\n isClosing,\n isVisible,\n handleContainerClick,\n handleOnCloseAnimationEnded,\n handleOnClose,\n handleOnOverlayClick,\n } = useOnClose(onClose, isOpen, dismissible);\n\n return !isVisible ? null : (\n <div\n className={classNamesUtil(\n classNames?.overlay,\n styles.overlay, {\n [styles.overlayClose]: isClosing,\n }\n )}\n onAnimationEnd={handleOnCloseAnimationEnded}\n onClick={handleOnOverlayClick}\n >\n <div \n className={\n typeof classNames?.wrapper === 'string' \n ? classNames?.wrapper \n : classNames?.wrapper?.({ isClosing })\n }\n >\n <div\n className={\n typeof classNames?.container === 'string' \n ? classNames?.container \n : classNames?.container?.({ isClosing })\n }\n onClick={handleContainerClick}\n >\n\n <div\n className={classNamesUtil(\n 'bg-white d-flex ai-center w100 px24 pt24 pb16',\n styles.header, {\n 'jc-between': !!title,\n 'jc-end': !title,\n }\n )}\n >\n {title && (\n <div\n className={classNamesUtil(\n styles.title,\n titleSize === 'small' ? 'p-h4' : 'p-h2'\n )}\n >\n {title}\n </div>\n )}\n \n {dismissible && (\n <Button\n hideLabel\n leftIcon={<XIcon color=\"grey-700\" />}\n onClick={handleOnClose}\n type=\"button\"\n variant=\"textColor\"\n className={classNamesUtil(\n classNames?.closeButton,\n 'p0',\n styles.closeButton\n )}\n >\n Close modal\n </Button>\n )}\n </div>\n\n <div\n className={classNamesUtil(\n classNames?.body,\n styles.body\n )}\n >\n {children}\n </div>\n\n {footer && (\n <div\n className={classNamesUtil(\n classNames?.footer,\n 'w100 bg-white',\n styles.footer\n )}\n >\n <div className=\"px24 py16\">\n {footer}\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n};\n"],"names":["classNames","_jsx","classNamesUtil","_jsxs"],"mappings":";;;;;;;;;AAWA,IAAM,UAAU,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ACE,SAAS,EAAEC,UAAc,CACvBF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,IAAI,EAChB,MAAM,CAAC,IAAI,CACZ,YAEA,QAAQ,GACL,EAEL,MAAM,KACLC,aACE,SAAS,EAAEC,UAAc,CACvBF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,MAAM,EAClB,eAAe,EACf,MAAM,CAAC,MAAM,CACd,YAEDC,aAAK,SAAS,EAAC,WAAW,YACvB,MAAM,GACH,GACF,CACP,IACG,GACF,GACF,CACP,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/modal/hooks/useOnClose.ts","../../../../../../src/lib/components/modal/genericModal/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\ninterface OnCloseReturn {\n isClosing: boolean;\n isVisible: boolean;\n handleOnCloseAnimationEnded: () => void;\n handleContainerClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n handleOnClose: () => void;\n handleOnOverlayClick: () => void;\n}\n\nconst useOnClose = (\n onClose: () => void,\n isOpen: boolean,\n dismissable: boolean\n): OnCloseReturn => {\n const [isVisible, setIsVisible] = useState(false);\n const [isClosing, setIsClosing] = useState(false);\n\n const handleOnClose = useCallback(() => {\n setIsClosing(true);\n }, []);\n\n const handleOnCloseAnimationEnded = useCallback(() => {\n if (isVisible && isClosing) {\n onClose();\n setIsVisible(false);\n setIsClosing(false);\n }\n }, [isClosing, isVisible, onClose]);\n\n const handleOnOverlayClick = useCallback(() => {\n if (!dismissable) {\n return;\n }\n\n handleOnClose();\n }, [dismissable, handleOnClose]);\n\n const handleEscKey = useCallback(\n (e: KeyboardEvent) => {\n if (e.code !== 'Escape') return;\n if (!dismissable) return null;\n if (!isOpen) return null;\n\n handleOnClose();\n },\n [isOpen, dismissable, handleOnClose]\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handleEscKey);\n\n return () => {\n window.removeEventListener('keydown', handleEscKey);\n };\n }, [handleEscKey]);\n\n useEffect(() => {\n if (isOpen) {\n setIsVisible(true);\n }\n \n if (!isOpen && isVisible){\n handleOnClose();\n }\n\n document.body.style.overflow = isOpen ? 'hidden' : 'auto';\n\n return () => {\n document.body.style.overflow = 'auto';\n };\n }, [handleOnClose, isOpen, isVisible]);\n\n const handleContainerClick = (\n e: React.MouseEvent<HTMLDivElement, MouseEvent>\n ) => {\n e.stopPropagation();\n };\n\n return {\n isClosing,\n isVisible,\n handleContainerClick,\n handleOnCloseAnimationEnded,\n handleOnClose,\n handleOnOverlayClick\n };\n};\n\nexport default useOnClose;\n","import { Props } from '..';\nimport useOnClose from '../hooks/useOnClose';\n\nimport styles from './style.module.scss';\nimport classNamesUtil from 'classnames';\nimport { Button } from '../../button';\nimport { XIcon } from '../../icon';\n\ninterface GenericModalProps extends Props {\n classNames?: {\n wrapper?: string | (({ isClosing }: { isClosing: boolean }) => string);\n container?: string | (({ isClosing }: { isClosing: boolean }) => string);\n overlay?: string;\n header?: string;\n closeButton?: string;\n title?: string;\n body?: string;\n footer?: string;\n };\n titleSize?: 'small' | 'default';\n}\n\nexport const GenericModal = ({\n title,\n isOpen,\n children,\n onClose,\n classNames,\n dismissible = true,\n footer,\n titleSize = 'default',\n}: GenericModalProps) => {\n const {\n isClosing,\n isVisible,\n handleContainerClick,\n handleOnCloseAnimationEnded,\n handleOnClose,\n handleOnOverlayClick,\n } = useOnClose(onClose, isOpen, dismissible);\n\n return !isVisible ? null : (\n <div\n className={classNamesUtil(\n classNames?.overlay,\n styles.overlay, {\n [styles.overlayClose]: isClosing,\n }\n )}\n onAnimationEnd={handleOnCloseAnimationEnded}\n onClick={handleOnOverlayClick}\n >\n <div \n className={\n typeof classNames?.wrapper === 'string' \n ? classNames?.wrapper \n : classNames?.wrapper?.({ isClosing })\n }\n >\n <div\n className={\n typeof classNames?.container === 'string' \n ? classNames?.container \n : classNames?.container?.({ isClosing })\n }\n onClick={handleContainerClick}\n >\n\n <div\n className={classNamesUtil(\n 'bg-white d-flex ai-center w100 px24 pt24 pb16',\n styles.header, {\n 'jc-between': !!title,\n 'jc-end': !title,\n }\n )}\n >\n {title && (\n <div\n className={classNamesUtil(\n styles.title,\n titleSize === 'small' ? 'p-h4' : 'p-h2'\n )}\n >\n {title}\n </div>\n )}\n \n {dismissible && (\n <Button\n hideLabel\n leftIcon={<XIcon color=\"grey-700\" />}\n onClick={handleOnClose}\n type=\"button\"\n variant=\"textColor\"\n className={classNamesUtil(\n classNames?.closeButton,\n 'p0',\n styles.closeButton\n )}\n >\n Close modal\n </Button>\n )}\n </div>\n\n <div\n className={classNamesUtil(\n 'w100',\n classNames?.body,\n styles.body\n )}\n >\n {children}\n </div>\n\n {footer && (\n <div\n className={classNamesUtil(\n classNames?.footer,\n 'w100 bg-white',\n styles.footer\n )}\n >\n <div className=\"px24 py16\">\n {footer}\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n};\n"],"names":["classNames","_jsx","classNamesUtil","_jsxs"],"mappings":";;;;;;;;;AAWA,IAAM,UAAU,GAAG,UACjB,OAAmB,EACnB,MAAe,EACf,WAAoB;IAEd,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAC5C,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAElD,IAAM,aAAa,GAAG,WAAW,CAAC;QAChC,YAAY,CAAC,IAAI,CAAC,CAAC;KACpB,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,2BAA2B,GAAG,WAAW,CAAC;QAC9C,IAAI,SAAS,IAAI,SAAS,EAAE;YAC1B,OAAO,EAAE,CAAC;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,YAAY,CAAC,KAAK,CAAC,CAAC;SACrB;KACF,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpC,IAAM,oBAAoB,G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C,OAAO,EAAE,oBAAoB,aAG7BG,cACE,SAAS,EAAED,UAAc,CACvB,+CAA+C,EAC/C,MAAM,CAAC,MAAM,EAAE;4BACb,YAAY,EAAE,CAAC,CAAC,KAAK;4BACrB,QAAQ,EAAE,CAAC,KAAK;yBACjB,CACF,aAEA,KAAK,KACJD,aACE,SAAS,EAAEC,UAAc,CACvB,MAAM,CAAC,KAAK,EACZ,SAAS,KAAK,OAAO,GAAG,MAAM,GAAG,MAAM,CACxC,YAEA,KAAK,GACF,CACP,EAEA,WAAW,KACVD,IAAC,MAAM,IACL,SAAS,QACT,QAAQ,EAAEA,IAAC,KAAK,IAAC,KAAK,EAAC,UAAU,GAAG,EACpC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,WAAW,EACnB,SAAS,EAAEC,UAAc,CACvBF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,WAAW,EACvB,IAAI,EACJ,MAAM,CAAC,WAAW,CACnB,4BAGM,CACV,IACG,EAENC,aACE,SAAS,EAAEC,UAAc,CACvB,MAAM,EACNF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,IAAI,EAChB,MAAM,CAAC,IAAI,CACZ,YAEA,QAAQ,GACL,EAEL,MAAM,KACLC,aACE,SAAS,EAAEC,UAAc,CACvBF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,MAAM,EAClB,eAAe,EACf,MAAM,CAAC,MAAM,CACd,YAEDC,aAAK,SAAS,EAAC,WAAW,YACvB,MAAM,GACH,GACF,CACP,IACG,GACF,GACF,CACP,CAAC;AACJ;;;;"}
@@ -3,7 +3,6 @@ import { useState } from 'react';
3
3
  import { BottomModal } from './bottomModal/index.js';
4
4
  import { RegularModal } from './regularModal/index.js';
5
5
  import { BottomOrRegularModal } from './bottomOrRegularModal/index.js';
6
- import { Markdown } from '../markdown/index.js';
7
6
  import { Button } from '../button/index.js';
8
7
  import '../../tslib.es6-5bc94358.js';
9
8
  import '../../style-inject.es-1f59c1d0.js';
@@ -11,12 +10,6 @@ import '../../index-6ea95111.js';
11
10
  import './genericModal/index.js';
12
11
  import '../icon/icons/X.js';
13
12
  import '../icon/IconWrapper/IconWrapper.js';
14
- import 'devlop';
15
- import 'vfile/do-not-use-conditional-minpath';
16
- import 'vfile/do-not-use-conditional-minproc';
17
- import 'vfile/do-not-use-conditional-minurl';
18
- import 'unist-util-visit-parents/do-not-use-color';
19
- import '../../_commonjsHelpers-e7f67fd8.js';
20
13
 
21
14
  var story = {
22
15
  title: 'JSX/Modals',
@@ -84,7 +77,7 @@ var RegularModalStory = function (_a) {
84
77
  onClose();
85
78
  setDisplay(false);
86
79
  };
87
- return (jsxs(Fragment, { children: ["Regular modals are primary meant to be used on Desktop or Tablet environment. The modal will appear in the middle of the screen and the user will be able to dismiss them using the top left \"X\" icon.", jsx(Markdown, { children: "If you want to use it for Mobile only, you should check [Bottom modal](#bottommodal) instead. Want to use either Regular Modal or Bottom Modal based on the screen width? You can use [Bottom or Regular modal](#bottomorregularmodal)." }), jsx("button", { className: "p-btn--primary wmn2 mt24", onClick: function () { return setDisplay(true); }, children: "Click to open modal" }), jsx(RegularModal, { title: title, isOpen: display, onClose: handleOnClose, children: jsxs("div", { style: { padding: '0 24px 24px 24px' }, children: [jsx("div", { children: children }), jsx("button", { className: "p-btn--primary mt24 wmn3", onClick: function () { return setDisplay(false); }, children: "Continue" })] }) })] }));
80
+ return (jsxs(Fragment, { children: ["Regular modals are primary meant to be used on Desktop or Tablet environment. The modal will appear in the middle of the screen and the user will be able to dismiss them using the top left \"X\" icon. If you want to use it for Mobile only, you should check BottomModal instead. Want to use either Regular Modal or Bottom Modal based on the screen width? You can use Bottom or Regular modal.", jsx("button", { className: "p-btn--primary wmn2 mt24", onClick: function () { return setDisplay(true); }, children: "Click to open modal" }), jsx(RegularModal, { title: title, isOpen: display, onClose: handleOnClose, children: jsxs("div", { style: { padding: '0 24px 24px 24px' }, children: [jsx("div", { children: children }), jsx("button", { className: "p-btn--primary mt24 wmn3", onClick: function () { return setDisplay(false); }, children: "Continue" })] }) })] }));
88
81
  };
89
82
  RegularModalStory.storyName = 'RegularModal';
90
83
  var BottomModalStory = function (_a) {
@@ -94,7 +87,7 @@ var BottomModalStory = function (_a) {
94
87
  onClose();
95
88
  setDisplay(false);
96
89
  };
97
- return (jsxs(Fragment, { children: ["Bottom modals are primary meant to be used on Mobile environment. The modal will appear from the bottom of the screen and the user will be able to dismiss them using the top left \"X\" icon.", jsx(Markdown, { children: "If you want to use it for Desktop only, you should check [Regular modal](#regularmodal) instead. Want to use either Regular Modal or Bottom Modal based on the screen width? You can use [Bottom or Regular modal](#bottomorregularmodal)." }), jsx("button", { className: "p-btn--primary wmn2 mt24", onClick: function () { return setDisplay(true); }, children: "Click to open modal" }), jsx(BottomModal, { title: title, isOpen: display, onClose: handleOnClose, children: jsxs("div", { style: { padding: '0 24px 24px 24px' }, children: [jsx("div", { children: children }), jsx("button", { className: "p-btn--primary mt24 wmn3", onClick: function () { return setDisplay(false); }, children: "Continue" })] }) })] }));
90
+ return (jsxs(Fragment, { children: ["Bottom modals are primary meant to be used on Mobile environment. The modal will appear from the bottom of the screen and the user will be able to dismiss them using the top left \"X\" icon. If you want to use it for Desktop only, you should check Regular modal instead. Want to use either Regular Modal or Bottom Modal based on the screen width? You can use Bottom or Regular modal.", jsx("button", { className: "p-btn--primary wmn2 mt24", onClick: function () { return setDisplay(true); }, children: "Click to open modal" }), jsx(BottomModal, { title: title, isOpen: display, onClose: handleOnClose, children: jsxs("div", { style: { padding: '0 24px 24px 24px' }, children: [jsx("div", { children: children }), jsx("button", { className: "p-btn--primary mt24 wmn3", onClick: function () { return setDisplay(false); }, children: "Continue" })] }) })] }));
98
91
  };
99
92
  BottomModalStory.storyName = 'BottomModal';
100
93
  var NonDismissibleModal = function (_a) {
@@ -104,7 +97,7 @@ var NonDismissibleModal = function (_a) {
104
97
  onClose();
105
98
  setDisplay(false);
106
99
  };
107
- return (jsxs(Fragment, { children: [jsx(Markdown, { children: "Setting the dismissible prop to false will hide the close button and prevent the user from closing it using the escape key or clicking outside. This prop can be useful if we want the user to explicitly interact with the modal options." }), jsx(Markdown, { children: "**Warning:** a modal with the dismissible prop can only be closed by changing the isOpen prop to false." }), jsx("button", { className: "p-btn--primary wmn2 mt24", onClick: function () { return setDisplay(true); }, children: "Click to open modal" }), jsx(BottomOrRegularModal, { dismissible: false, title: title, isOpen: display, onClose: handleOnClose, children: jsxs("div", { style: { padding: '0 24px 24px 24px' }, children: [jsx("div", { children: children }), jsx("button", { className: "p-btn--primary mt24 wmn3", onClick: function () { return setDisplay(false); }, children: "Continue" })] }) })] }));
100
+ return (jsxs(Fragment, { children: ["Setting the dismissible prop to false will hide the close button and prevent the user from closing it using the escape key or clicking outside. This prop can be useful if we want the user to explicitly interact with the modal options.", jsx("strong", { children: "Warning:" }), " a modal with the dismissible prop can only be closed by changing the isOpen prop to false.", jsx("button", { className: "p-btn--primary wmn2 mt24", onClick: function () { return setDisplay(true); }, children: "Click to open modal" }), jsx(BottomOrRegularModal, { dismissible: false, title: title, isOpen: display, onClose: handleOnClose, children: jsxs("div", { style: { padding: '0 24px 24px 24px' }, children: [jsx("div", { children: children }), jsx("button", { className: "p-btn--primary mt24 wmn3", onClick: function () { return setDisplay(false); }, children: "Continue" })] }) })] }));
108
101
  };
109
102
  var ModalWithFooter = function (_a) {
110
103
  var children = _a.children, isOpen = _a.isOpen, onClose = _a.onClose, title = _a.title;
@@ -1 +1 @@
1
- {"version":3,"file":"index.stories.js","sources":["../../../../../src/lib/components/modal/index.stories.tsx"],"sourcesContent":["\nimport { useState } from 'react';\nimport { BottomModal, BottomOrRegularModal, Props, RegularModal } from '.';\nimport { Markdown } from '../markdown';\nimport { Button } from '../button';\n\nconst story = {\n title: 'JSX/Modals',\n component: BottomOrRegularModal,\n argTypes: {\n title: {\n description: \"The title that needs to be displayed on the modal\",\n },\n isOpen: {\n description: \"When set to `true`, the modal is displayed. When set to `false` the modal gets removed\",\n },\n dismissible: {\n description: \"The content that gets displayed on the modal\",\n },\n className: {\n description: 'Any additional className',\n },\n children: {\n description: 'The content that gets displayed on the modal',\n type: 'text',\n table: {\n type: {\n summary: 'ReactNode'\n }\n }\n },\n onClose: {\n description: 'Callback when the user close the modal',\n action: true,\n table: {\n category: \"Callbacks\",\n },\n },\n },\n args: {\n title: \"Modal title\",\n isOpen: false,\n dismissible: true,\n className: '',\n children: 'Modal content to be displayed',\n },\n parameters: {\n componentSubtitle: 'Bottom or Regular modal will automatically choose what’s best to display based on the users screen width.',\n docs: {\n description: {\n component: 'Modals are dialog overlays that prevent the user from interacting with the rest of the website until an action is taken or the dialog is dismissed. Modals are purposefully disruptive and should be used thoughtfully and sparingly.',\n }\n },\n },\n};\n\nexport const BottomOrRegularModalStory = ({\n children,\n className,\n dismissible,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <button\n className=\"p-btn--primary wmn2\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n dismissible={dismissible}\n className={className}\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nBottomOrRegularModalStory.storyName = 'BottomOrRegularModal';\n\nexport const RegularModalStory = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n Regular modals are primary meant to be used on Desktop or Tablet environment. The modal will appear in the middle of the screen and the user will be able to dismiss them using the top left \"X\" icon. \n <Markdown>\n If you want to use it for Mobile only, you should check [Bottom modal](#bottommodal) instead.\n Want to use either Regular Modal or Bottom Modal based on the screen width? You can use [Bottom or Regular modal](#bottomorregularmodal).\n </Markdown>\n\n <button\n className=\"p-btn--primary wmn2 mt24\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <RegularModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </RegularModal>\n </>\n );\n}\n\nRegularModalStory.storyName = 'RegularModal';\n\nexport const BottomModalStory = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n Bottom modals are primary meant to be used on Mobile environment. The modal will appear from the bottom of the screen and the user will be able to dismiss them using the top left \"X\" icon.\n <Markdown>\n If you want to use it for Desktop only, you should check [Regular modal](#regularmodal) instead.\n Want to use either Regular Modal or Bottom Modal based on the screen width? You can use [Bottom or Regular modal](#bottomorregularmodal).\n </Markdown>\n\n <button\n className=\"p-btn--primary wmn2 mt24\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </BottomModal>\n </>\n );\n}\n\nBottomModalStory.storyName = 'BottomModal';\n\nexport const NonDismissibleModal = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <Markdown>\n Setting the dismissible prop to false will hide the close button and prevent the user from closing it using the escape key or clicking outside.\n This prop can be useful if we want the user to explicitly interact with the modal options.\n </Markdown>\n\n <Markdown>\n **Warning:** a modal with the dismissible prop can only be closed by changing the isOpen prop to false.\n </Markdown>\n\n <button\n className=\"p-btn--primary wmn2 mt24\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n dismissible={false}\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nexport const ModalWithFooter = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <button\n className=\"p-btn--primary wmn2\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n footer={(\n <div className='d-flex fd-row gap8'>\n <Button variant='textColor' className='w100' onClick={handleOnClose}>\n Skip\n </Button>\n <Button className='w100' onClick={handleOnClose}>\n Continue\n </Button>\n </div>\n )}\n >\n <div className='p24'>\n <div>\n {children}\n </div>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nexport const ModalWithFooterAndScroll = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <button\n className=\"p-btn--primary wmn2\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n footer={(\n <div className='d-flex fd-row gap8'>\n <Button variant='textColor' className='w100' onClick={handleOnClose}>\n Skip\n </Button>\n <Button className='w100' onClick={handleOnClose}>\n Continue\n </Button>\n </div>\n )}\n >\n <div className='p24'>\n <div>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n <div style={{ height: '840px' }} />\n {children}\n </div>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nexport default story;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;IAMM,KAAK,GAAG;IACZ,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,WAAW,EAAE,mDAAmD;SACjE;QACD,MAAM,EAAE;YACN,WAAW,EAAE,wFAAwF;SACtG;QACD,WAAW,EAAE;YACX,WAAW,EAAE,8CAA8C;SAC5D;QACD,SAAS,EAAE;YACT,WAAW,EAAE,0BAA0B;SACxC;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,8CAA8C;YAC3D,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;gBACL,IAAI,EAAE;oBACF,OAAO,EAAE,WAAW;iBACvB;aACF;SACF;QACD,OAAO,EAAE;YACP,WAAW,EAAE,wCAAwC;YACrD,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE;gBACL,QAAQ,EAAE,WAAW;aACtB;SACF;KACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,+BAA+B;KAC1C;IACD,UAAU,EAAE;QACV,iBAAiB,EAAE,2GAA2G;QAC9H,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EAAE,uOAAuO;aACnP;SACF;KACF;EACD;IAEW,yBAAyB,GAAG,UAAC,EAOlC;QANN,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,MAAM,YAAA,EACN,OAAO,aAAA,EACP,KAAK,WAAA;IAEC,IAAA,KAAwB,QAAQ,CAAC,MAAM,CAAC,EAAvC,OAAO,QAAA,EAAE,UAAU,QAAoB,CAAC;IAC/C,IAAM,aAAa,G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,YAClBA,uBACG,QAAQ,GACL,GACF,GACe,IACtB,EACH;AACJ,EAAC;IAEY,wBAAwB,GAAG,UAAC,EAKjC;QAJN,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,OAAO,aAAA,EACP,KAAK,WAAA;IAEC,IAAA,KAAwB,QAAQ,CAAC,MAAM,CAAC,EAAvC,OAAO,QAAA,EAAE,UAAU,QAAoB,CAAC;IAC/C,IAAM,aAAa,GAAG;QACpB,OAAO,EAAE,CAAC;QACV,UAAU,CAAC,KAAK,CAAC,CAAC;KACnB,CAAC;IAEF,QACED,4BACEC,gBACE,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,cAAM,OAAA,UAAU,CAAC,IAAI,CAAC,GAAA,oCAGxB,EAETA,IAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,aAAa,EACtB,MAAM,GACJD,cAAK,SAAS,EAAC,oBAAoB,aACjCC,IAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,aAAa,qBAE1D,EACTA,IAAC,MAAM,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,aAAa,yBAEtC,IACL,CACP,YAEDA,aAAK,SAAS,EAAC,KAAK,YAClBD,qFAEEC,aAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAI,EAClC,QAAQ,IACL,GACF,GACe,IACtB,EACH;AACJ;;;;;"}
1
+ {"version":3,"file":"index.stories.js","sources":["../../../../../src/lib/components/modal/index.stories.tsx"],"sourcesContent":["\nimport { useState } from 'react';\nimport { BottomModal, BottomOrRegularModal, Props, RegularModal } from '.';\nimport { Button } from '../button';\n\nconst story = {\n title: 'JSX/Modals',\n component: BottomOrRegularModal,\n argTypes: {\n title: {\n description: \"The title that needs to be displayed on the modal\",\n },\n isOpen: {\n description: \"When set to `true`, the modal is displayed. When set to `false` the modal gets removed\",\n },\n dismissible: {\n description: \"The content that gets displayed on the modal\",\n },\n className: {\n description: 'Any additional className',\n },\n children: {\n description: 'The content that gets displayed on the modal',\n type: 'text',\n table: {\n type: {\n summary: 'ReactNode'\n }\n }\n },\n onClose: {\n description: 'Callback when the user close the modal',\n action: true,\n table: {\n category: \"Callbacks\",\n },\n },\n },\n args: {\n title: \"Modal title\",\n isOpen: false,\n dismissible: true,\n className: '',\n children: 'Modal content to be displayed',\n },\n parameters: {\n componentSubtitle: 'Bottom or Regular modal will automatically choose what’s best to display based on the users screen width.',\n docs: {\n description: {\n component: 'Modals are dialog overlays that prevent the user from interacting with the rest of the website until an action is taken or the dialog is dismissed. Modals are purposefully disruptive and should be used thoughtfully and sparingly.',\n }\n },\n },\n};\n\nexport const BottomOrRegularModalStory = ({\n children,\n className,\n dismissible,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <button\n className=\"p-btn--primary wmn2\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n dismissible={dismissible}\n className={className}\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nBottomOrRegularModalStory.storyName = 'BottomOrRegularModal';\n\nexport const RegularModalStory = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n Regular modals are primary meant to be used on Desktop or Tablet environment. The modal will appear in the middle of the screen and the user will be able to dismiss them using the top left \"X\" icon. \n If you want to use it for Mobile only, you should check BottomModal instead.\n Want to use either Regular Modal or Bottom Modal based on the screen width? You can use Bottom or Regular modal.\n\n <button\n className=\"p-btn--primary wmn2 mt24\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <RegularModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </RegularModal>\n </>\n );\n}\n\nRegularModalStory.storyName = 'RegularModal';\n\nexport const BottomModalStory = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n Bottom modals are primary meant to be used on Mobile environment. The modal will appear from the bottom of the screen and the user will be able to dismiss them using the top left \"X\" icon.\n If you want to use it for Desktop only, you should check Regular modal instead.\n Want to use either Regular Modal or Bottom Modal based on the screen width? You can use Bottom or Regular modal.\n\n <button\n className=\"p-btn--primary wmn2 mt24\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </BottomModal>\n </>\n );\n}\n\nBottomModalStory.storyName = 'BottomModal';\n\nexport const NonDismissibleModal = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n Setting the dismissible prop to false will hide the close button and prevent the user from closing it using the escape key or clicking outside.\n This prop can be useful if we want the user to explicitly interact with the modal options.\n\n <strong>Warning:</strong> a modal with the dismissible prop can only be closed by changing the isOpen prop to false.\n\n <button\n className=\"p-btn--primary wmn2 mt24\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n dismissible={false}\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n >\n <div style={{ padding: '0 24px 24px 24px' }}>\n <div>\n {children}\n </div>\n <button\n className=\"p-btn--primary mt24 wmn3\"\n onClick={() => setDisplay(false)}\n >\n Continue\n </button>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nexport const ModalWithFooter = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <button\n className=\"p-btn--primary wmn2\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n footer={(\n <div className='d-flex fd-row gap8'>\n <Button variant='textColor' className='w100' onClick={handleOnClose}>\n Skip\n </Button>\n <Button className='w100' onClick={handleOnClose}>\n Continue\n </Button>\n </div>\n )}\n >\n <div className='p24'>\n <div>\n {children}\n </div>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nexport const ModalWithFooterAndScroll = ({\n children,\n isOpen,\n onClose,\n title,\n}: Props) => {\n const [display, setDisplay] = useState(isOpen);\n const handleOnClose = () => {\n onClose();\n setDisplay(false);\n };\n\n return (\n <>\n <button\n className=\"p-btn--primary wmn2\"\n onClick={() => setDisplay(true)}\n >\n Click to open modal\n </button>\n\n <BottomOrRegularModal\n title={title}\n isOpen={display}\n onClose={handleOnClose}\n footer={(\n <div className='d-flex fd-row gap8'>\n <Button variant='textColor' className='w100' onClick={handleOnClose}>\n Skip\n </Button>\n <Button className='w100' onClick={handleOnClose}>\n Continue\n </Button>\n </div>\n )}\n >\n <div className='p24'>\n <div>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n <div style={{ height: '840px' }} />\n {children}\n </div>\n </div>\n </BottomOrRegularModal>\n </>\n );\n}\n\nexport default story;\n"],"names":["_jsxs","_jsx"],"m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E,UAAU,QAAoB,CAAC;IAC/C,IAAM,aAAa,GAAG;QACpB,OAAO,EAAE,CAAC;QACV,UAAU,CAAC,KAAK,CAAC,CAAC;KACnB,CAAC;IAEF,QACED,4BACEC,gBACE,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,cAAM,OAAA,UAAU,CAAC,IAAI,CAAC,GAAA,oCAGxB,EAETA,IAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,aAAa,EACtB,MAAM,GACJD,cAAK,SAAS,EAAC,oBAAoB,aACjCC,IAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,aAAa,qBAE1D,EACTA,IAAC,MAAM,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,aAAa,yBAEtC,IACL,CACP,YAEDA,aAAK,SAAS,EAAC,KAAK,YAClBD,qFAEEC,aAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAI,EAClC,QAAQ,IACL,GACF,GACe,IACtB,EACH;AACJ;;;;;"}
@@ -1,3 +1,3 @@
1
- export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, IbanInput, CurrencyInput, BottomModal, RegularModal, BottomOrRegularModal, InfoCard, CardButton, Card, Button, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, DownloadButton, Markdown, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Toggle, Toaster, toast, } from './lib';
1
+ export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, IbanInput, CurrencyInput, BottomModal, RegularModal, BottomOrRegularModal, InfoCard, CardButton, Card, Button, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, DownloadButton, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Toggle, Toaster, toast, } from './lib';
2
2
  export * from './lib/components/icon';
3
3
  export type { DownloadStatus, InformationBoxProps, IllustrationKeys, FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus, CardProps, IconWrapperProps } from './lib';
package/dist/esm/index.js CHANGED
@@ -22,7 +22,6 @@ export { default as Chip } from './components/chip/index.js';
22
22
  export { AutoSuggestInput } from './components/input/autoSuggestInput/index.js';
23
23
  export { ComparisonTable } from './components/comparisonTable/index.js';
24
24
  export { SegmentedControl } from './components/segmentedControl/index.js';
25
- export { Markdown } from './components/markdown/index.js';
26
25
  export { Link } from './components/link/index.js';
27
26
  export { i as illustrations, a as images } from './index-29e6f39e.js';
28
27
  export { Spinner } from './components/spinner/index.js';
@@ -418,9 +417,4 @@ import './components/comparisonTable/components/TableArrows/Arrow.js';
418
417
  import './components/comparisonTable/components/AccordionItem/AccordionItem.js';
419
418
  import './components/comparisonTable/components/TableRating/StarIcon.js';
420
419
  import './components/comparisonTable/components/TableRating/ZapIcon.js';
421
- import 'devlop';
422
- import 'vfile/do-not-use-conditional-minpath';
423
- import 'vfile/do-not-use-conditional-minproc';
424
- import 'vfile/do-not-use-conditional-minurl';
425
- import 'unist-util-visit-parents/do-not-use-color';
426
420
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -19,7 +19,6 @@ import Chip from './components/chip';
19
19
  import { AutoSuggestInput } from './components/input/autoSuggestInput';
20
20
  import { ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, TableHeader } from './components/comparisonTable';
21
21
  import { SegmentedControl } from './components/segmentedControl';
22
- import { Markdown } from './components/markdown';
23
22
  import { Link } from './components/link';
24
23
  import { illustrations, images, IllustrationKeys } from './util/images';
25
24
  import { Spinner } from './components/spinner';
@@ -27,6 +26,6 @@ import { Toggle } from './components/input/toggle';
27
26
  import { Toaster, toast } from './components/toast';
28
27
  import { IconWrapperProps } from './components/icon/IconWrapper';
29
28
  export * from './components/icon';
30
- export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, InfoCard, Card, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Markdown, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Toggle, Toaster, toast, };
29
+ export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, InfoCard, Card, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Checkbox, Radio, Link, InformationBox, Badge, images, illustrations, Spinner, Toggle, Toaster, toast, };
31
30
  export type { IllustrationKeys, InformationBoxProps, FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus, CardProps, IconWrapperProps };
32
31
  export type { DownloadStatus } from './models/download';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popsure/dirty-swan",
3
- "version": "0.51.3",
3
+ "version": "0.52.0",
4
4
  "author": "Vincent Audoire <vincent@getpopsure.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -34,11 +34,7 @@
34
34
  "react-day-picker": "^7.4.10",
35
35
  "react-dropzone": "^14.2.2",
36
36
  "react-hot-toast": "^2.4.1",
37
- "react-markdown": "^9.0.1",
38
37
  "react-scroll-sync": "^0.11.2",
39
- "rehype-raw": "^7.0.0",
40
- "remark-directive": "^3.0.0",
41
- "remark-gfm": "^4.0.0",
42
38
  "sass": "^1.35.1",
43
39
  "signature_pad": "^3.0.0-beta.3"
44
40
  },
package/src/index.tsx CHANGED
@@ -27,7 +27,6 @@ export {
27
27
  TableInfoButton,
28
28
  SegmentedControl,
29
29
  DownloadButton,
30
- Markdown,
31
30
  Checkbox,
32
31
  Radio,
33
32
  Link,
@@ -106,6 +106,7 @@ export const GenericModal = ({
106
106
 
107
107
  <div
108
108
  className={classNamesUtil(
109
+ 'w100',
109
110
  classNames?.body,
110
111
  styles.body
111
112
  )}
@@ -1,7 +1,6 @@
1
1
 
2
2
  import { useState } from 'react';
3
3
  import { BottomModal, BottomOrRegularModal, Props, RegularModal } from '.';
4
- import { Markdown } from '../markdown';
5
4
  import { Button } from '../button';
6
5
 
7
6
  const story = {
@@ -117,10 +116,8 @@ export const RegularModalStory = ({
117
116
  return (
118
117
  <>
119
118
  Regular modals are primary meant to be used on Desktop or Tablet environment. The modal will appear in the middle of the screen and the user will be able to dismiss them using the top left "X" icon.
120
- <Markdown>
121
- If you want to use it for Mobile only, you should check [Bottom modal](#bottommodal) instead.
122
- Want to use either Regular Modal or Bottom Modal based on the screen width? You can use [Bottom or Regular modal](#bottomorregularmodal).
123
- </Markdown>
119
+ If you want to use it for Mobile only, you should check BottomModal instead.
120
+ Want to use either Regular Modal or Bottom Modal based on the screen width? You can use Bottom or Regular modal.
124
121
 
125
122
  <button
126
123
  className="p-btn--primary wmn2 mt24"
@@ -167,10 +164,8 @@ export const BottomModalStory = ({
167
164
  return (
168
165
  <>
169
166
  Bottom modals are primary meant to be used on Mobile environment. The modal will appear from the bottom of the screen and the user will be able to dismiss them using the top left "X" icon.
170
- <Markdown>
171
- If you want to use it for Desktop only, you should check [Regular modal](#regularmodal) instead.
172
- Want to use either Regular Modal or Bottom Modal based on the screen width? You can use [Bottom or Regular modal](#bottomorregularmodal).
173
- </Markdown>
167
+ If you want to use it for Desktop only, you should check Regular modal instead.
168
+ Want to use either Regular Modal or Bottom Modal based on the screen width? You can use Bottom or Regular modal.
174
169
 
175
170
  <button
176
171
  className="p-btn--primary wmn2 mt24"
@@ -216,14 +211,10 @@ export const NonDismissibleModal = ({
216
211
 
217
212
  return (
218
213
  <>
219
- <Markdown>
220
- Setting the dismissible prop to false will hide the close button and prevent the user from closing it using the escape key or clicking outside.
221
- This prop can be useful if we want the user to explicitly interact with the modal options.
222
- </Markdown>
214
+ Setting the dismissible prop to false will hide the close button and prevent the user from closing it using the escape key or clicking outside.
215
+ This prop can be useful if we want the user to explicitly interact with the modal options.
223
216
 
224
- <Markdown>
225
- **Warning:** a modal with the dismissible prop can only be closed by changing the isOpen prop to false.
226
- </Markdown>
217
+ <strong>Warning:</strong> a modal with the dismissible prop can only be closed by changing the isOpen prop to false.
227
218
 
228
219
  <button
229
220
  className="p-btn--primary wmn2 mt24"
package/src/lib/index.tsx CHANGED
@@ -37,7 +37,6 @@ import {
37
37
  TableHeader,
38
38
  } from './components/comparisonTable';
39
39
  import { SegmentedControl } from './components/segmentedControl';
40
- import { Markdown } from './components/markdown';
41
40
  import { Link } from './components/link';
42
41
  import { illustrations, images, IllustrationKeys } from './util/images';
43
42
  import { Spinner } from './components/spinner';
@@ -73,7 +72,6 @@ export {
73
72
  TableButton,
74
73
  TableInfoButton,
75
74
  SegmentedControl,
76
- Markdown,
77
75
  Checkbox,
78
76
  Radio,
79
77
  Link,
@@ -1,22 +0,0 @@
1
- export interface MarkdownStyling {
2
- a: string;
3
- p: string;
4
- h1: string;
5
- h2: string;
6
- h3: string;
7
- h4: string;
8
- h5: string;
9
- h6: string;
10
- ol: string;
11
- ul: string;
12
- strong: string;
13
- em: string;
14
- table: string;
15
- th: string;
16
- tr: string;
17
- td: string;
18
- blockquote: string;
19
- code: string;
20
- pre: string;
21
- }
22
- export declare const defaultStyling: MarkdownStyling;
@@ -1,10 +0,0 @@
1
- import { MarkdownStyling } from './config';
2
- export interface MarkdownProps {
3
- children: string;
4
- className?: string;
5
- openLinksInNewTab?: boolean;
6
- styling?: Partial<MarkdownStyling>;
7
- renderRawMarkdownChild?: boolean;
8
- }
9
- declare const Markdown: ({ children: rawMarkdownChild, className, openLinksInNewTab, styling: rawStyling, renderRawMarkdownChild }: MarkdownProps) => JSX.Element;
10
- export { Markdown };
@@ -1,39 +0,0 @@
1
- import { MarkdownProps } from '.';
2
- declare const story: {
3
- title: string;
4
- component: ({ children: rawMarkdownChild, className, openLinksInNewTab, styling: rawStyling, renderRawMarkdownChild }: MarkdownProps) => JSX.Element;
5
- argTypes: {
6
- children: {
7
- description: string;
8
- };
9
- className: {
10
- description: string;
11
- };
12
- renderRawMarkdownChild: {
13
- description: string;
14
- };
15
- openLinksInNewTab: {
16
- description: string;
17
- };
18
- styling: {
19
- desription: string;
20
- };
21
- };
22
- args: {
23
- children: string;
24
- className: string;
25
- renderRawMarkdownChild: boolean;
26
- openLinksInNewTab: boolean;
27
- styling: {};
28
- };
29
- parameters: {
30
- componentSubtitle: JSX.Element;
31
- };
32
- };
33
- export declare const MarkdownStory: {
34
- ({ children, className }: MarkdownProps): JSX.Element;
35
- storyName: string;
36
- };
37
- export declare const AvailableMDComponents: ({ className }: MarkdownProps) => JSX.Element;
38
- export declare const AddingCustomComponents: ({ className, openLinksInNewTab, renderRawMarkdownChild }: MarkdownProps) => JSX.Element;
39
- export default story;