@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 h from "react";
2
+ import C from "react";
3
3
  import "../Button/Button.js";
4
- import { ButtonBar as C } from "../Button/ButtonBar.js";
4
+ import { ButtonBar as N } from "../Button/ButtonBar.js";
5
5
  import "../Button/LinkButton.js";
6
- import N from "../IconButton/IconButton.js";
7
- import { Overlay as l } from "../Overlay/Overlay.js";
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 k } from "../../utils/hooks/useKeyboardClose.js";
11
+ import { useKeyboardClose as y } from "../../utils/hooks/useKeyboardClose.js";
12
12
  import "../../index-2hJuj4UN.js";
13
- import '../../assets/Modal.css';const y = "_root_1u329_1", B = "_close_1u329_26", x = "_header_1u329_32", g = "_footer_1u329_38", s = {
14
- root: y,
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: B,
17
- header: x,
18
- footer: g
16
+ close: x,
17
+ header: g,
18
+ footer: v
19
19
  };
20
- function p(t) {
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
- } = t, n = h.useCallback(() => {
29
+ disableBackdropClose: i = !1,
30
+ disableFocusLock: h = !1
31
+ } = l, n = C.useCallback(() => {
31
32
  i || !o || o();
32
33
  }, [o, i]);
33
- return k(n), /* @__PURE__ */ c(l, { children: [
34
- /* @__PURE__ */ r(l.Backdrop, { onClick: n, className: f }),
35
- /* @__PURE__ */ r(l.Content, { className: u, children: /* @__PURE__ */ c(
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(N, { className: s.close, name: "Close", onClick: o }),
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(C, { ...e, className: m(s.footer, a) });
80
+ return /* @__PURE__ */ r(N, { ...e, className: m(s.footer, a) });
80
81
  };
81
82
  export {
82
83
  p as Modal
@@ -18,4 +18,5 @@ export interface OverlayBackdropProps {
18
18
  export interface OverlayContentProps {
19
19
  children?: React.ReactNode;
20
20
  className?: string;
21
+ disableFocusLock?: boolean;
21
22
  }
@@ -1,31 +1,34 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import a from "react";
3
- import { F as d } from "../../Combination-BRUj3CHE.js";
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 e } from "../../utils/clsx.js";
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 p = "_root_17xdt_1", f = "_backdrop_17xdt_9", u = "_content_17xdt_27", n = {
10
- root: p,
11
- backdrop: f,
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 l(c) {
15
+ function s(c) {
16
16
  const {
17
17
  className: o,
18
18
  children: t
19
- } = c, i = e(n.root, o), s = _(k);
20
- return /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r("div", { className: i, children: t }) });
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
- l.Backdrop = a.forwardRef(function(o, t) {
23
- return /* @__PURE__ */ r(m, { ref: t, onClick: o.onClick, className: e(n.backdrop, o.className), children: o.children });
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
- l.Content = a.forwardRef(function(o, t) {
26
- return /* @__PURE__ */ r("div", { ref: t, className: e(n.content, o.className), children: /* @__PURE__ */ r(d, { children: o.children }) });
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
- l as Overlay
33
+ s as Overlay
31
34
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "2.1.2",
4
+ "version": "2.1.3",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",