@cfx-dev/ui-components 2.1.2 → 2.1.3
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.
|
@@ -10,6 +10,7 @@ export interface ModalProps {
|
|
|
10
10
|
disableBackdropClose?: boolean;
|
|
11
11
|
ariaDescribedby?: string;
|
|
12
12
|
ariaLabelledby?: string;
|
|
13
|
+
disableFocusLock?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export declare namespace Modal {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import C from "react";
|
|
3
3
|
import "../Button/Button.js";
|
|
4
|
-
import { ButtonBar as
|
|
4
|
+
import { ButtonBar as N } from "../Button/ButtonBar.js";
|
|
5
5
|
import "../Button/LinkButton.js";
|
|
6
|
-
import
|
|
7
|
-
import { Overlay as
|
|
6
|
+
import k from "../IconButton/IconButton.js";
|
|
7
|
+
import { Overlay as t } from "../Overlay/Overlay.js";
|
|
8
8
|
import { Text as d } from "../Text/Text.js";
|
|
9
9
|
import { clsx as m } from "../../utils/clsx.js";
|
|
10
10
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
11
|
-
import { useKeyboardClose as
|
|
11
|
+
import { useKeyboardClose as y } from "../../utils/hooks/useKeyboardClose.js";
|
|
12
12
|
import "../../index-2hJuj4UN.js";
|
|
13
|
-
import '../../assets/Modal.css';const
|
|
14
|
-
root:
|
|
13
|
+
import '../../assets/Modal.css';const B = "_root_1u329_1", x = "_close_1u329_26", g = "_header_1u329_32", v = "_footer_1u329_38", s = {
|
|
14
|
+
root: B,
|
|
15
15
|
"modal-appearance": "_modal-appearance_1u329_1",
|
|
16
|
-
close:
|
|
17
|
-
header:
|
|
18
|
-
footer:
|
|
16
|
+
close: x,
|
|
17
|
+
header: g,
|
|
18
|
+
footer: v
|
|
19
19
|
};
|
|
20
|
-
function p(
|
|
20
|
+
function p(l) {
|
|
21
21
|
const {
|
|
22
22
|
onClose: o,
|
|
23
23
|
children: a,
|
|
@@ -26,13 +26,14 @@ function p(t) {
|
|
|
26
26
|
contentClassName: u,
|
|
27
27
|
ariaDescribedby: _,
|
|
28
28
|
ariaLabelledby: b,
|
|
29
|
-
disableBackdropClose: i = !1
|
|
30
|
-
|
|
29
|
+
disableBackdropClose: i = !1,
|
|
30
|
+
disableFocusLock: h = !1
|
|
31
|
+
} = l, n = C.useCallback(() => {
|
|
31
32
|
i || !o || o();
|
|
32
33
|
}, [o, i]);
|
|
33
|
-
return
|
|
34
|
-
/* @__PURE__ */ r(
|
|
35
|
-
/* @__PURE__ */ r(
|
|
34
|
+
return y(n), /* @__PURE__ */ c(t, { children: [
|
|
35
|
+
/* @__PURE__ */ r(t.Backdrop, { onClick: n, className: f }),
|
|
36
|
+
/* @__PURE__ */ r(t.Content, { className: u, disableFocusLock: h, children: /* @__PURE__ */ c(
|
|
36
37
|
"div",
|
|
37
38
|
{
|
|
38
39
|
role: "dialog",
|
|
@@ -40,7 +41,7 @@ function p(t) {
|
|
|
40
41
|
"aria-labelledby": b,
|
|
41
42
|
className: m(s.root, e),
|
|
42
43
|
children: [
|
|
43
|
-
!!o && /* @__PURE__ */ r(
|
|
44
|
+
!!o && /* @__PURE__ */ r(k, { className: s.close, name: "Close", onClick: o }),
|
|
44
45
|
a
|
|
45
46
|
]
|
|
46
47
|
}
|
|
@@ -76,7 +77,7 @@ p.Footer = function(o) {
|
|
|
76
77
|
className: a,
|
|
77
78
|
...e
|
|
78
79
|
} = o;
|
|
79
|
-
return /* @__PURE__ */ r(
|
|
80
|
+
return /* @__PURE__ */ r(N, { ...e, className: m(s.footer, a) });
|
|
80
81
|
};
|
|
81
82
|
export {
|
|
82
83
|
p as Modal
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { F as
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { F as i } from "../../Combination-BRUj3CHE.js";
|
|
4
4
|
import { Interactive as m } from "../Interactive/Interactive.js";
|
|
5
|
-
import { clsx as
|
|
5
|
+
import { clsx as n } from "../../utils/clsx.js";
|
|
6
6
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
7
7
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
8
8
|
import { useOutlet as _ } from "../../utils/hooks/useOutlet.js";
|
|
9
|
-
import '../../assets/Overlay.css';const
|
|
10
|
-
root:
|
|
11
|
-
backdrop:
|
|
9
|
+
import '../../assets/Overlay.css';const f = "_root_17xdt_1", p = "_backdrop_17xdt_9", u = "_content_17xdt_27", a = {
|
|
10
|
+
root: f,
|
|
11
|
+
backdrop: p,
|
|
12
12
|
"backdrop-appearance": "_backdrop-appearance_17xdt_1",
|
|
13
13
|
content: u
|
|
14
14
|
}, k = "overlay-outlet";
|
|
15
|
-
function
|
|
15
|
+
function s(c) {
|
|
16
16
|
const {
|
|
17
17
|
className: o,
|
|
18
18
|
children: t
|
|
19
|
-
} = c,
|
|
20
|
-
return /* @__PURE__ */ r(
|
|
19
|
+
} = c, e = n(a.root, o), d = _(k);
|
|
20
|
+
return /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r("div", { className: e, children: t }) });
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
return /* @__PURE__ */ r(m, { ref: t, onClick: o.onClick, className:
|
|
22
|
+
s.Backdrop = l.forwardRef(function(o, t) {
|
|
23
|
+
return /* @__PURE__ */ r(m, { ref: t, onClick: o.onClick, className: n(a.backdrop, o.className), children: o.children });
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
s.Content = l.forwardRef(function(o, t) {
|
|
26
|
+
const {
|
|
27
|
+
disableFocusLock: e = !1
|
|
28
|
+
} = o;
|
|
29
|
+
return /* @__PURE__ */ r("div", { ref: t, className: n(a.content, o.className), children: /* @__PURE__ */ r(i, { disabled: e, children: o.children }) });
|
|
27
30
|
});
|
|
28
31
|
export {
|
|
29
32
|
k as OVERLAY_OUTLET_ID,
|
|
30
|
-
|
|
33
|
+
s as Overlay
|
|
31
34
|
};
|