@caseparts-org/caseblocks 0.0.270 → 0.0.271

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.
@@ -1,19 +1,20 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import v from "react";
3
+ import { r as p } from "../../index-BkF-BQ3Q.js";
3
4
  import { c as n } from "../../clsx-OuTLNxxd.js";
4
- import { Text as p } from "../../atoms/Text/Text.js";
5
- import { Icon as g } from "../../atoms/Icon/Icon.js";
6
- import '../../assets/Modal.css';const b = "_overlay_1imlv_1", y = "_container_1imlv_11", T = "_toolbar_1imlv_30", x = "_toolbarPlain_1imlv_47", z = "_headerGroup_1imlv_52", B = "_headerLeft_1imlv_60", M = "_headerRight_1imlv_64", N = "_closeButton_1imlv_68", R = "_content_1imlv_87", r = {
7
- overlay: b,
8
- container: y,
9
- toolbar: T,
10
- toolbarPlain: x,
11
- headerGroup: z,
12
- headerLeft: B,
13
- headerRight: M,
14
- closeButton: N,
15
- content: R
16
- }, w = {
5
+ import { Text as g } from "../../atoms/Text/Text.js";
6
+ import { Icon as b } from "../../atoms/Icon/Icon.js";
7
+ import '../../assets/Modal.css';const y = "_overlay_1imlv_1", T = "_container_1imlv_11", x = "_toolbar_1imlv_30", z = "_toolbarPlain_1imlv_47", B = "_headerGroup_1imlv_52", M = "_headerLeft_1imlv_60", N = "_headerRight_1imlv_64", R = "_closeButton_1imlv_68", w = "_content_1imlv_87", r = {
8
+ overlay: y,
9
+ container: T,
10
+ toolbar: x,
11
+ toolbarPlain: z,
12
+ headerGroup: B,
13
+ headerLeft: M,
14
+ headerRight: N,
15
+ closeButton: R,
16
+ content: w
17
+ }, P = {
17
18
  sm: "sm",
18
19
  md: "md",
19
20
  lg: "lg"
@@ -32,35 +33,46 @@ import '../../assets/Modal.css';const b = "_overlay_1imlv_1", y = "_container_1i
32
33
  ..._
33
34
  }) => {
34
35
  const c = v.useRef(!1);
35
- if (!t) return null;
36
- const h = (i) => {
36
+ if (!t || typeof document > "u") return null;
37
+ const f = (i) => {
37
38
  e && (c.current = i.target === i.currentTarget);
38
- }, f = (i) => {
39
+ }, h = (i) => {
39
40
  if (!e) {
40
41
  c.current = !1;
41
42
  return;
42
43
  }
43
44
  c.current && i.target === i.currentTarget && o(), c.current = !1;
44
45
  };
45
- return /* @__PURE__ */ a("div", { className: n(r.overlay), onMouseDown: h, onMouseUp: f, children: /* @__PURE__ */ a(
46
- "div",
47
- {
48
- className: n(r.container, s),
49
- role: "dialog",
50
- "aria-modal": "true",
51
- style: { ...m, "--modal-width": l },
52
- ..._,
53
- children: u
54
- }
55
- ) });
56
- }, G = ({ variant: t = "standard", className: o, children: e, ...l }) => /* @__PURE__ */ a(
46
+ return p.createPortal(
47
+ /* @__PURE__ */ a(
48
+ "div",
49
+ {
50
+ className: n(r.overlay),
51
+ onMouseDown: f,
52
+ onMouseUp: h,
53
+ children: /* @__PURE__ */ a(
54
+ "div",
55
+ {
56
+ className: n(r.container, s),
57
+ role: "dialog",
58
+ "aria-modal": "true",
59
+ style: { ...m, "--modal-width": l },
60
+ ..._,
61
+ children: u
62
+ }
63
+ )
64
+ }
65
+ ),
66
+ document.body
67
+ );
68
+ }, D = ({ variant: t = "standard", className: o, children: e, ...l }) => /* @__PURE__ */ a(
57
69
  "div",
58
70
  {
59
71
  className: n(r.toolbar, t === "plain" && r.toolbarPlain, o),
60
72
  ...l,
61
73
  children: e
62
74
  }
63
- ), L = ({
75
+ ), G = ({
64
76
  align: t = "left",
65
77
  size: o = "md",
66
78
  variant: e = "display",
@@ -74,13 +86,13 @@ import '../../assets/Modal.css';const b = "_overlay_1imlv_1", y = "_container_1i
74
86
  {
75
87
  className: n(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight, l),
76
88
  ...m,
77
- children: u ? /* @__PURE__ */ a(p, { as: "div", size: w[o], variant: e, weight: "medium", children: s }) : s
89
+ children: u ? /* @__PURE__ */ a(g, { as: "div", size: P[o], variant: e, weight: "medium", children: s }) : s
78
90
  }
79
91
  );
80
- }, P = ({ size: t = "md", className: o, ...e }) => /* @__PURE__ */ a("button", { type: "button", className: n(r.closeButton, o), "aria-label": "Close", ...e, children: /* @__PURE__ */ a(g, { iconKey: "fa-regular fa-xmark", size: C[t] }) }), S = ({ className: t, children: o, ...e }) => /* @__PURE__ */ a("div", { className: n(r.content, t), ...e, children: o });
81
- d.Toolbar = G;
82
- d.Header = L;
83
- d.CloseButton = P;
92
+ }, L = ({ size: t = "md", className: o, ...e }) => /* @__PURE__ */ a("button", { type: "button", className: n(r.closeButton, o), "aria-label": "Close", ...e, children: /* @__PURE__ */ a(b, { iconKey: "fa-regular fa-xmark", size: C[t] }) }), S = ({ className: t, children: o, ...e }) => /* @__PURE__ */ a("div", { className: n(r.content, t), ...e, children: o });
93
+ d.Toolbar = D;
94
+ d.Header = G;
95
+ d.CloseButton = L;
84
96
  d.Content = S;
85
97
  export {
86
98
  d as Modal
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.270",
4
+ "version": "0.0.271",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",