@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.
@@ -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 a, jsxs as c } from "react/jsx-runtime";
5
- import { Children as s, isValidElement as m, useEffect as w } from "react";
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 p } from "./utils/index.js";
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: d,
16
- buttonCloseClassName: n,
17
- onClose: i
15
+ className: m,
16
+ buttonCloseClassName: d,
17
+ onClose: a
18
18
  }) => {
19
- const l = s.toArray(e).find(
20
- (o) => m(o) && o.type === r.Header
21
- ), f = s.toArray(e).find(
22
- (o) => m(o) && o.type === r.Body
23
- ), y = s.toArray(e).find(
24
- (o) => m(o) && o.type === r.Footer
25
- ), u = s.toArray(e).filter(
26
- (o) => !m(o) || ![r.Header, r.Body, r.Footer].includes(
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__ */ a(E, { children: /* @__PURE__ */ c(
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__ */ a(
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: i,
40
+ onClick: a,
41
41
  role: "presentation"
42
42
  }
43
43
  ),
44
- /* @__PURE__ */ c(
44
+ /* @__PURE__ */ p(
45
45
  "div",
46
46
  {
47
- className: p(
47
+ className: f(
48
48
  R({
49
- className: d
49
+ className: m
50
50
  })
51
51
  ),
52
52
  role: "dialog",
53
53
  "aria-modal": "true",
54
54
  children: [
55
55
  l,
56
- /* @__PURE__ */ c(
56
+ /* @__PURE__ */ p(
57
57
  "button",
58
58
  {
59
- className: p(
59
+ className: f(
60
60
  N({
61
- className: n
61
+ className: d
62
62
  })
63
63
  ),
64
- onClick: i,
64
+ onClick: a,
65
65
  children: [
66
- /* @__PURE__ */ a(k, {}),
67
- /* @__PURE__ */ a(A, { children: "Dismiss modal" })
66
+ /* @__PURE__ */ n(k, {}),
67
+ /* @__PURE__ */ n(A, { children: "Dismiss modal" })
68
68
  ]
69
69
  }
70
70
  ),
71
- f ?? u,
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 n = new AbortController(), i = (l) => {
81
- l.code === "Escape" && t?.();
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", i, {
84
- signal: n.signal
83
+ return window.addEventListener("keydown", l, {
84
+ signal: a.signal
85
85
  }), () => {
86
- n.abort();
86
+ a.abort();
87
87
  };
88
88
  }, [t]), e ? x.createPortal(
89
- /* @__PURE__ */ a(B, { ...d, onClose: t }),
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-0oht63vU.js";
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-0oht63vU.js";
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-0oht63vU.js";
4
+ import { W as a } from "../../../Modal-V67Uz78z.js";
5
5
  export {
6
6
  e as Body,
7
7
  t as Footer,
@@ -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-0oht63vU.js";
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-0oht63vU.js";
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.1",
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.2",
5
+ "version": "0.1.1-alpha.3",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",