@konstructio/ui 0.1.1-alpha.2 → 0.1.1-alpha.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.
- package/dist/{Modal-0oht63vU.js → Modal-V67Uz78z.js} +35 -35
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import { Body as b } from "./components/Modal/components/Body/Body.js";
|
|
2
2
|
import { Footer as g } from "./components/Modal/components/Footer/Footer.js";
|
|
3
3
|
import { Header as v } from "./components/Modal/components/Header/Header.js";
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { Children as
|
|
4
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import { Children as i, isValidElement as s, useEffect as w } from "react";
|
|
6
6
|
import { r as x } from "./index-C9T9HQaa.js";
|
|
7
7
|
import { R as A } from "./index-iXyXtdgP.js";
|
|
8
8
|
import { R as E } from "./Combination-VYaRRJBZ.js";
|
|
9
|
-
import { cn as
|
|
9
|
+
import { cn as f } from "./utils/index.js";
|
|
10
10
|
import { buttonCloseVariants as N, modalVariants as R } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
|
|
11
11
|
import { X as k } from "./x-BPcqkRZd.js";
|
|
12
12
|
const B = ({
|
|
13
13
|
children: e,
|
|
14
14
|
theme: t,
|
|
15
|
-
className:
|
|
16
|
-
buttonCloseClassName:
|
|
17
|
-
onClose:
|
|
15
|
+
className: m,
|
|
16
|
+
buttonCloseClassName: d,
|
|
17
|
+
onClose: a
|
|
18
18
|
}) => {
|
|
19
|
-
const l =
|
|
20
|
-
(o) =>
|
|
21
|
-
),
|
|
22
|
-
(o) =>
|
|
23
|
-
), y =
|
|
24
|
-
(o) =>
|
|
25
|
-
), u =
|
|
26
|
-
(o) => !
|
|
19
|
+
const l = i.toArray(e).find(
|
|
20
|
+
(o) => s(o) && o.type === r.Header
|
|
21
|
+
), c = i.toArray(e).find(
|
|
22
|
+
(o) => s(o) && o.type === r.Body
|
|
23
|
+
), y = i.toArray(e).find(
|
|
24
|
+
(o) => s(o) && o.type === r.Footer
|
|
25
|
+
), u = i.toArray(e).filter(
|
|
26
|
+
(o) => !s(o) || ![r.Header, r.Body, r.Footer].includes(
|
|
27
27
|
o.type
|
|
28
28
|
)
|
|
29
29
|
);
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ n(E, { children: /* @__PURE__ */ p(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
className: "fixed inset-0 grid place-content-center",
|
|
34
34
|
"data-theme": t,
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ n(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
39
|
className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: a,
|
|
41
41
|
role: "presentation"
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ p(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: f(
|
|
48
48
|
R({
|
|
49
|
-
className:
|
|
49
|
+
className: m
|
|
50
50
|
})
|
|
51
51
|
),
|
|
52
52
|
role: "dialog",
|
|
53
53
|
"aria-modal": "true",
|
|
54
54
|
children: [
|
|
55
55
|
l,
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ p(
|
|
57
57
|
"button",
|
|
58
58
|
{
|
|
59
|
-
className:
|
|
59
|
+
className: f(
|
|
60
60
|
N({
|
|
61
|
-
className:
|
|
61
|
+
className: d
|
|
62
62
|
})
|
|
63
63
|
),
|
|
64
|
-
onClick:
|
|
64
|
+
onClick: a,
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ n(k, {}),
|
|
67
|
+
/* @__PURE__ */ n(A, { children: "Dismiss modal" })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
|
|
71
|
+
c ?? u,
|
|
72
72
|
y
|
|
73
73
|
]
|
|
74
74
|
}
|
|
@@ -76,18 +76,18 @@ const B = ({
|
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
) });
|
|
79
|
-
}, r = ({ isOpen: e, onClose: t, ...d }) => (w(() => {
|
|
80
|
-
const
|
|
81
|
-
|
|
79
|
+
}, r = ({ isOpen: e, onClose: t, container: m, ...d }) => (w(() => {
|
|
80
|
+
const a = new AbortController(), l = (c) => {
|
|
81
|
+
c.code === "Escape" && t?.();
|
|
82
82
|
};
|
|
83
|
-
return window.addEventListener("keydown",
|
|
84
|
-
signal:
|
|
83
|
+
return window.addEventListener("keydown", l, {
|
|
84
|
+
signal: a.signal
|
|
85
85
|
}), () => {
|
|
86
|
-
|
|
86
|
+
a.abort();
|
|
87
87
|
};
|
|
88
88
|
}, [t]), e ? x.createPortal(
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
document.body
|
|
89
|
+
/* @__PURE__ */ n(B, { ...d, onClose: t }),
|
|
90
|
+
m || document.body
|
|
91
91
|
) : null);
|
|
92
92
|
r.Header = v;
|
|
93
93
|
r.Body = b;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../index-C9T9HQaa.js";
|
|
4
|
-
import { M as d } from "../../Modal-
|
|
4
|
+
import { M as d } from "../../Modal-V67Uz78z.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
6
|
import "./components/Body/Body.js";
|
|
7
7
|
import "./components/Footer/Footer.js";
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "../../../../index-iXyXtdgP.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../../../../Combination-VYaRRJBZ.js";
|
|
5
|
-
import { W as f } from "../../../../Modal-
|
|
5
|
+
import { W as f } from "../../../../Modal-V67Uz78z.js";
|
|
6
6
|
import "../../../../utils/index.js";
|
|
7
7
|
import "./Wrapper.variants.js";
|
|
8
8
|
import "../../../../x-BPcqkRZd.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body as e } from "./Body/Body.js";
|
|
2
2
|
import { Footer as t } from "./Footer/Footer.js";
|
|
3
3
|
import { Header as m } from "./Header/Header.js";
|
|
4
|
-
import { W as a } from "../../../Modal-
|
|
4
|
+
import { W as a } from "../../../Modal-V67Uz78z.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Body,
|
|
7
7
|
t as Footer,
|
package/dist/components/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { DropdownButton as N } from "./DropdownButton/DropdownButton.js";
|
|
|
13
13
|
import { Filter as h } from "./Filter/Filter.js";
|
|
14
14
|
import { Input as A } from "./Input/Input.js";
|
|
15
15
|
import { Loading as k } from "./Loading/Loading.js";
|
|
16
|
-
import { M as G } from "../Modal-
|
|
16
|
+
import { M as G } from "../Modal-V67Uz78z.js";
|
|
17
17
|
import { NumberInput as M } from "./NumberInput/NumberInput.js";
|
|
18
18
|
import { PieChart as I } from "./PieChart/PieChart.js";
|
|
19
19
|
import { ProgressBar as j } from "./ProgressBar/ProgressBar.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -313,6 +313,7 @@ declare type ModalChildProps = {
|
|
|
313
313
|
declare interface ModalProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
314
314
|
buttonCloseClassName?: string;
|
|
315
315
|
className?: string;
|
|
316
|
+
container?: Element | DocumentFragment;
|
|
316
317
|
isOpen?: boolean;
|
|
317
318
|
theme?: Theme;
|
|
318
319
|
onClose?: () => void;
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { BadgeMultiSelect as w } from "./components/Filter/components/BadgeDropd
|
|
|
15
15
|
import { DateFilterDropdown as k } from "./components/Filter/components/DateFilterDropdown/DateFilterDropdown.js";
|
|
16
16
|
import { Input as G } from "./components/Input/Input.js";
|
|
17
17
|
import { Loading as M } from "./components/Loading/Loading.js";
|
|
18
|
-
import { M as I } from "./Modal-
|
|
18
|
+
import { M as I } from "./Modal-V67Uz78z.js";
|
|
19
19
|
import { NumberInput as j } from "./components/NumberInput/NumberInput.js";
|
|
20
20
|
import { PieChart as z } from "./components/PieChart/PieChart.js";
|
|
21
21
|
import { ProgressBar as H } from "./components/ProgressBar/ProgressBar.js";
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.1-alpha.
|
|
5
|
+
"version": "0.1.1-alpha.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.1-alpha.
|
|
5
|
+
"version": "0.1.1-alpha.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|