@citygross/components_v2 0.0.53 → 0.0.54
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.
|
@@ -2,16 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import { TPaletteKeys } from '@citygross/design-tokens_v2';
|
|
3
3
|
|
|
4
4
|
declare type TModal = {
|
|
5
|
-
|
|
5
|
+
background?: TPaletteKeys;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
|
|
8
|
-
subTitle?: string;
|
|
9
|
-
hideCancel?: boolean;
|
|
10
|
-
querySelector?: string;
|
|
7
|
+
className?: string;
|
|
11
8
|
footer?: JSX.Element;
|
|
12
|
-
|
|
9
|
+
hideCancel?: boolean;
|
|
13
10
|
isConfirm?: boolean;
|
|
14
|
-
|
|
11
|
+
onBackdropClick?: () => void;
|
|
12
|
+
querySelector?: string;
|
|
13
|
+
subTitle?: string;
|
|
14
|
+
title?: string;
|
|
15
15
|
};
|
|
16
16
|
declare const Modal: React.ForwardRefExoticComponent<TModal & React.RefAttributes<HTMLDivElement>>;
|
|
17
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
1
|
+
import React, { forwardRef, Fragment } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { Icons } from '@citygross/icons_v2';
|
|
4
4
|
import { Spacer } from '../Spacer/Spacer.js';
|
|
@@ -8,16 +8,16 @@ import { BodyText } from '../../typography/BodyText/BodyText.js';
|
|
|
8
8
|
|
|
9
9
|
const Modal = forwardRef(
|
|
10
10
|
({
|
|
11
|
-
|
|
11
|
+
background = "white",
|
|
12
12
|
children,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
className,
|
|
14
|
+
footer,
|
|
15
15
|
hideCancel = true,
|
|
16
16
|
isConfirm,
|
|
17
|
-
|
|
17
|
+
onBackdropClick,
|
|
18
18
|
querySelector = "#root",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
subTitle,
|
|
20
|
+
title
|
|
21
21
|
}, ref) => {
|
|
22
22
|
const domSafe = typeof document !== "undefined";
|
|
23
23
|
return domSafe ? createPortal(
|
|
@@ -31,11 +31,13 @@ const Modal = forwardRef(
|
|
|
31
31
|
/* @__PURE__ */ React.createElement(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
+
"aria-modal": "true",
|
|
34
35
|
className: `${modalContainer({
|
|
35
36
|
backgroundColor: background,
|
|
36
37
|
maxWidth: isConfirm ? "confirm" : "regular"
|
|
37
38
|
})} ${className}`,
|
|
38
|
-
onClick: (e) => e.stopPropagation()
|
|
39
|
+
onClick: (e) => e.stopPropagation(),
|
|
40
|
+
role: "dialog"
|
|
39
41
|
},
|
|
40
42
|
title && /* @__PURE__ */ React.createElement("div", { className: modalHeaderContainer }, /* @__PURE__ */ React.createElement("div", { className: modalHeader }, /* @__PURE__ */ React.createElement(H2, null, title), !hideCancel && /* @__PURE__ */ React.createElement(
|
|
41
43
|
"div",
|
|
@@ -46,7 +48,7 @@ const Modal = forwardRef(
|
|
|
46
48
|
/* @__PURE__ */ React.createElement(Icons.Cross, null)
|
|
47
49
|
)), /* @__PURE__ */ React.createElement(BodyText, null, subTitle)),
|
|
48
50
|
children && /* @__PURE__ */ React.createElement("div", { className: childrenWrapper }, children),
|
|
49
|
-
footer && /* @__PURE__ */ React.createElement(
|
|
51
|
+
footer && /* @__PURE__ */ React.createElement(Fragment, null, /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement("div", { className: footerWrapper }, footer))
|
|
50
52
|
)
|
|
51
53
|
),
|
|
52
54
|
document.querySelector(querySelector) || document.body
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components_v2",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"react-slick": "^0.30.1",
|
|
80
80
|
"slick-carousel": "^1.8.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "830c0216869887f1ce92050246d7ccf6cbe37e03"
|
|
83
83
|
}
|