@popsure/dirty-swan 0.56.0 → 0.56.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.
- package/dist/cjs/index.js +13 -24
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/modal/bottomModal/index.d.ts +1 -1
- package/dist/cjs/lib/components/modal/fullScreenModal/index.d.ts +2 -2
- package/dist/cjs/lib/components/modal/genericModal/index.d.ts +16 -14
- package/dist/cjs/lib/components/modal/index.d.ts +2 -0
- package/dist/cjs/lib/components/modal/index.stories.d.ts +15 -1
- package/dist/cjs/lib/components/modal/regularModal/index.d.ts +1 -1
- package/dist/esm/components/modal/bottomModal/index.js +4 -8
- package/dist/esm/components/modal/bottomModal/index.js.map +1 -1
- package/dist/esm/components/modal/fullScreenModal/index.js +4 -8
- package/dist/esm/components/modal/fullScreenModal/index.js.map +1 -1
- package/dist/esm/components/modal/genericModal/index.js +1 -1
- package/dist/esm/components/modal/genericModal/index.js.map +1 -1
- package/dist/esm/components/modal/index.stories.js +31 -17
- package/dist/esm/components/modal/index.stories.js.map +1 -1
- package/dist/esm/components/modal/regularModal/index.js +4 -7
- package/dist/esm/components/modal/regularModal/index.js.map +1 -1
- package/dist/esm/lib/components/modal/bottomModal/index.d.ts +1 -1
- package/dist/esm/lib/components/modal/fullScreenModal/index.d.ts +2 -2
- package/dist/esm/lib/components/modal/genericModal/index.d.ts +16 -14
- package/dist/esm/lib/components/modal/index.d.ts +2 -0
- package/dist/esm/lib/components/modal/index.stories.d.ts +15 -1
- package/dist/esm/lib/components/modal/regularModal/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/components/modal/bottomModal/index.tsx +17 -13
- package/src/lib/components/modal/fullScreenModal/index.tsx +19 -15
- package/src/lib/components/modal/genericModal/index.tsx +18 -11
- package/src/lib/components/modal/index.stories.tsx +92 -87
- package/src/lib/components/modal/index.ts +2 -0
- package/src/lib/components/modal/regularModal/index.tsx +17 -12
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Props } from
|
|
2
|
-
declare const FullScreenModal: ({ className, ...rest }: Props) => JSX.Element;
|
|
1
|
+
import { Props } from '..';
|
|
2
|
+
declare const FullScreenModal: ({ className, classNames, ...rest }: Props) => JSX.Element;
|
|
3
3
|
export { FullScreenModal };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { Props } from '..';
|
|
2
|
+
export interface GenericModalClassNames {
|
|
3
|
+
wrapper?: string | (({ isClosing }: {
|
|
4
|
+
isClosing: boolean;
|
|
5
|
+
}) => string);
|
|
6
|
+
container?: string | (({ isClosing }: {
|
|
7
|
+
isClosing: boolean;
|
|
8
|
+
}) => string);
|
|
9
|
+
overlay?: string;
|
|
10
|
+
header?: string;
|
|
11
|
+
closeButton?: string;
|
|
12
|
+
closeButtonIcon?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
body?: string;
|
|
15
|
+
footer?: string;
|
|
16
|
+
}
|
|
2
17
|
interface GenericModalProps extends Props {
|
|
3
|
-
classNames?:
|
|
4
|
-
wrapper?: string | (({ isClosing }: {
|
|
5
|
-
isClosing: boolean;
|
|
6
|
-
}) => string);
|
|
7
|
-
container?: string | (({ isClosing }: {
|
|
8
|
-
isClosing: boolean;
|
|
9
|
-
}) => string);
|
|
10
|
-
overlay?: string;
|
|
11
|
-
header?: string;
|
|
12
|
-
closeButton?: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
body?: string;
|
|
15
|
-
footer?: string;
|
|
16
|
-
};
|
|
18
|
+
classNames?: GenericModalClassNames;
|
|
17
19
|
titleSize?: 'small' | 'default';
|
|
18
20
|
}
|
|
19
21
|
export declare const GenericModal: (props: GenericModalProps) => JSX.Element | null;
|
|
@@ -3,6 +3,7 @@ import { RegularModal } from './regularModal';
|
|
|
3
3
|
import { BottomOrRegularModal } from './bottomOrRegularModal';
|
|
4
4
|
import { FullScreenModal } from './fullScreenModal';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
|
+
import { GenericModalClassNames } from './genericModal';
|
|
6
7
|
export interface Props {
|
|
7
8
|
title?: ReactNode;
|
|
8
9
|
isOpen: boolean;
|
|
@@ -10,6 +11,7 @@ export interface Props {
|
|
|
10
11
|
onClose: () => void;
|
|
11
12
|
onModalScroll?: (scrollTop: number, element: HTMLDivElement) => void;
|
|
12
13
|
className?: string;
|
|
14
|
+
classNames?: GenericModalClassNames;
|
|
13
15
|
dismissible?: boolean;
|
|
14
16
|
size?: 'default' | 'large';
|
|
15
17
|
footer?: ReactNode;
|
|
@@ -15,6 +15,9 @@ declare const story: {
|
|
|
15
15
|
className: {
|
|
16
16
|
description: string;
|
|
17
17
|
};
|
|
18
|
+
classNames: {
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
18
21
|
size: {
|
|
19
22
|
description: string;
|
|
20
23
|
control: string;
|
|
@@ -52,6 +55,17 @@ declare const story: {
|
|
|
52
55
|
isOpen: boolean;
|
|
53
56
|
dismissible: boolean;
|
|
54
57
|
className: string;
|
|
58
|
+
classNames: {
|
|
59
|
+
wrapper: string;
|
|
60
|
+
container: string;
|
|
61
|
+
overlay: string;
|
|
62
|
+
header: string;
|
|
63
|
+
closeButton: string;
|
|
64
|
+
closeButtonIcon: string;
|
|
65
|
+
title: string;
|
|
66
|
+
body: string;
|
|
67
|
+
footer: string;
|
|
68
|
+
};
|
|
55
69
|
children: string;
|
|
56
70
|
size: string;
|
|
57
71
|
};
|
|
@@ -65,7 +79,7 @@ declare const story: {
|
|
|
65
79
|
};
|
|
66
80
|
};
|
|
67
81
|
export declare const BottomOrRegularModalStory: {
|
|
68
|
-
({ children, className, dismissible, isOpen, onClose, onModalScroll, size, title, }: Props): JSX.Element;
|
|
82
|
+
({ children, className, classNames, dismissible, isOpen, onClose, onModalScroll, size, title, }: Props): JSX.Element;
|
|
69
83
|
storyName: string;
|
|
70
84
|
};
|
|
71
85
|
export declare const RegularModalStory: {
|
|
@@ -15,18 +15,14 @@ var styles = {"wrapper":"style-module_wrapper__200Xu","container":"style-module_
|
|
|
15
15
|
styleInject(css_248z);
|
|
16
16
|
|
|
17
17
|
var BottomModal = function (_a) {
|
|
18
|
-
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
19
|
-
return (jsx(GenericModal, __assign({ titleSize:
|
|
20
|
-
wrapper: classNames('w100', styles.wrapper),
|
|
21
|
-
container: function (_a) {
|
|
18
|
+
var className = _a.className, classNames$1 = _a.classNames, rest = __rest(_a, ["className", "classNames"]);
|
|
19
|
+
return (jsx(GenericModal, __assign({ titleSize: "small", classNames: __assign(__assign({}, classNames$1), { wrapper: classNames('w100', styles.wrapper, classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.wrapper), container: function (_a) {
|
|
22
20
|
var _b;
|
|
23
21
|
var isClosing = _a.isClosing;
|
|
24
|
-
return classNames('bg-white d-flex fd-column w100', className, styles.container, (_b = {},
|
|
22
|
+
return classNames('bg-white d-flex fd-column w100', className, styles.container, classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.container, (_b = {},
|
|
25
23
|
_b[styles.containerClose] = isClosing,
|
|
26
24
|
_b));
|
|
27
|
-
},
|
|
28
|
-
body: styles.body,
|
|
29
|
-
} }, rest)));
|
|
25
|
+
}, body: classNames(styles.body, classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.body) }) }, rest)));
|
|
30
26
|
};
|
|
31
27
|
|
|
32
28
|
export { BottomModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/modal/bottomModal/index.tsx"],"sourcesContent":["import { Props } from '..';\nimport styles from './style.module.scss';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/modal/bottomModal/index.tsx"],"sourcesContent":["import { Props } from '..';\nimport styles from './style.module.scss';\nimport classNamesUtil from 'classnames';\nimport { GenericModal } from '../genericModal';\n\nconst BottomModal = ({ className, classNames, ...rest }: Props) => (\n <GenericModal\n titleSize=\"small\"\n classNames={{\n ...classNames,\n wrapper: classNamesUtil('w100', styles.wrapper, classNames?.wrapper),\n container: ({ isClosing }) =>\n classNamesUtil(\n 'bg-white d-flex fd-column w100',\n className,\n styles.container,\n classNames?.container,\n {\n [styles.containerClose]: isClosing,\n }\n ),\n body: classNamesUtil(styles.body, classNames?.body),\n }}\n {...rest}\n />\n);\n\nexport { BottomModal };\n"],"names":["classNames","_jsx","classNamesUtil"],"mappings":";;;;;;;;;;;;;;;;IAKM,WAAW,GAAG,UAAC,EAAyC;IAAvC,IAAA,SAAS,eAAA,EAAEA,YAAU,gBAAA,EAAK,IAAI,cAAhC,2BAAkC,CAAF;IAAc,QACjEC,IAAC,YAAY,aACX,SAAS,EAAC,OAAO,EACjB,UAAU,wBACLD,YAAU,KACb,OAAO,EAAEE,UAAc,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAEF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,OAAO,CAAC,EACpE,SAAS,EAAE,UAAC,EAAa;;oBAAX,SAAS,eAAA;gBACrB,OAAAE,UAAc,CACZ,gCAAgC,EAChC,SAAS,EACT,MAAM,CAAC,SAAS,EAChBF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,SAAS;oBAEnB,GAAC,MAAM,CAAC,cAAc,IAAG,SAAS;wBAErC;aAAA,EACH,IAAI,EAAEE,UAAc,CAAC,MAAM,CAAC,IAAI,EAAEF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,IAAI,CAAC,OAEjD,IAAI,EACR,EACH;;;;;"}
|
|
@@ -15,18 +15,14 @@ var styles = {"container":"style-module_container__dyFzK","appear-in":"style-mod
|
|
|
15
15
|
styleInject(css_248z);
|
|
16
16
|
|
|
17
17
|
var FullScreenModal = function (_a) {
|
|
18
|
-
var className = _a.className, rest = __rest(_a, ["className"]);
|
|
19
|
-
return (jsx(GenericModal, __assign({ titleSize: "small", classNames: {
|
|
20
|
-
wrapper: "w100",
|
|
21
|
-
container: function (_a) {
|
|
18
|
+
var className = _a.className, classNames$1 = _a.classNames, rest = __rest(_a, ["className", "classNames"]);
|
|
19
|
+
return (jsx(GenericModal, __assign({ titleSize: "small", classNames: __assign(__assign({}, classNames$1), { wrapper: classNames(classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.wrapper, 'w100'), container: function (_a) {
|
|
22
20
|
var _b;
|
|
23
21
|
var isClosing = _a.isClosing;
|
|
24
|
-
return classNames(
|
|
22
|
+
return classNames('bg-white d-flex fd-column w100', className, styles.container, classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.container, (_b = {},
|
|
25
23
|
_b[styles.containerClose] = isClosing,
|
|
26
24
|
_b));
|
|
27
|
-
},
|
|
28
|
-
body: styles.body,
|
|
29
|
-
} }, rest)));
|
|
25
|
+
}, body: classNames(styles.body, classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.body) }) }, rest)));
|
|
30
26
|
};
|
|
31
27
|
|
|
32
28
|
export { FullScreenModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/modal/fullScreenModal/index.tsx"],"sourcesContent":["import { Props } from
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/modal/fullScreenModal/index.tsx"],"sourcesContent":["import { Props } from '..';\nimport styles from './style.module.scss';\nimport classNamesUtil from 'classnames';\nimport { GenericModal } from '../genericModal';\n\nconst FullScreenModal = ({ className, classNames, ...rest }: Props) => (\n <GenericModal\n titleSize=\"small\"\n classNames={{\n ...classNames,\n wrapper: classNamesUtil(classNames?.wrapper, 'w100'),\n container: ({ isClosing }) =>\n classNamesUtil(\n 'bg-white d-flex fd-column w100',\n className,\n styles.container,\n classNames?.container,\n {\n [styles.containerClose]: isClosing,\n }\n ),\n body: classNamesUtil(styles.body, classNames?.body),\n }}\n {...rest}\n />\n);\n\nexport { FullScreenModal };\n"],"names":["classNames","_jsx","classNamesUtil"],"mappings":";;;;;;;;;;;;;;;;IAKM,eAAe,GAAG,UAAC,EAAyC;IAAvC,IAAA,SAAS,eAAA,EAAEA,YAAU,gBAAA,EAAK,IAAI,cAAhC,2BAAkC,CAAF;IAAc,QACrEC,IAAC,YAAY,aACX,SAAS,EAAC,OAAO,EACjB,UAAU,wBACLD,YAAU,KACb,OAAO,EAAEE,UAAc,CAACF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,OAAO,EAAE,MAAM,CAAC,EACpD,SAAS,EAAE,UAAC,EAAa;;oBAAX,SAAS,eAAA;gBACrB,OAAAE,UAAc,CACZ,gCAAgC,EAChC,SAAS,EACT,MAAM,CAAC,SAAS,EAChBF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,SAAS;oBAEnB,GAAC,MAAM,CAAC,cAAc,IAAG,SAAS;wBAErC;aAAA,EACH,IAAI,EAAEE,UAAc,CAAC,MAAM,CAAC,IAAI,EAAEF,YAAU,aAAVA,YAAU,uBAAVA,YAAU,CAAE,IAAI,CAAC,OAEjD,IAAI,EACR,EACH;;;;;"}
|
|
@@ -1837,7 +1837,7 @@ var InnerModal = function (_a) {
|
|
|
1837
1837
|
: (_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(FocusLockCombination, { returnFocus: true, children: [jsxs("div", { className: classNames('bg-white d-flex ai-center w100 px24 pt24 pb16', styles.header, {
|
|
1838
1838
|
'jc-between': !!title,
|
|
1839
1839
|
'jc-end': !title,
|
|
1840
|
-
}), 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), ref: modalBodyRef, 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: "p24 pt16", children: footer }) }))] }) }) }) }));
|
|
1840
|
+
}), 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", className: classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.closeButtonIcon }), 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), ref: modalBodyRef, 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: "p24 pt16", children: footer }) }))] }) }) }) }));
|
|
1841
1841
|
};
|
|
1842
1842
|
var GenericModal = function (props) {
|
|
1843
1843
|
var isOpen = props.isOpen, onClose = props.onClose, _a = props.dismissible, dismissible = _a === void 0 ? true : _a;
|