@konstructio/ui 0.1.2-alpha.117 → 0.1.2-alpha.119

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.
@@ -0,0 +1,84 @@
1
+ import { t as A } from "./x-Vur_9PXW.js";
2
+ import { t as H } from "./dist-C_jtUTU9.js";
3
+ import { t as h } from "./utils-DnIJruo0.js";
4
+ import { t as x } from "./Combination-CnMM05mt.js";
5
+ import { Body as B } from "./components/Modal/components/Body/Body.js";
6
+ import { Footer as C } from "./components/Modal/components/Footer/Footer.js";
7
+ import { Header as E } from "./components/Modal/components/Header/Header.js";
8
+ import { t as R } from "./es2015-B_07N-UL.js";
9
+ import { buttonCloseVariants as V, modalVariants as j } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
10
+ import { Children as d, isValidElement as l, useEffect as g, useRef as D, useState as S } from "react";
11
+ import { createPortal as z } from "react-dom";
12
+ import { Fragment as I, jsx as a, jsxs as m } from "react/jsx-runtime";
13
+ import { motion as K } from "motion/react";
14
+ var L = ({ animateResize: c = !1, ariaLabel: n, ariaLabelledBy: s, autoFocus: i = !0, buttonCloseClassName: f, children: r, className: u, containerClassName: p, showCloseButton: o = !0, theme: y, transition: b, onClose: v }) => {
15
+ const F = d.toArray(r).find((e) => l(e) && e.type === t.Header), N = d.toArray(r).find((e) => l(e) && e.type === t.Body), k = d.toArray(r).find((e) => l(e) && e.type === t.Footer), w = d.toArray(r).filter((e) => !l(e) || ![
16
+ t.Header,
17
+ t.Body,
18
+ t.Footer
19
+ ].includes(e.type));
20
+ return /* @__PURE__ */ a(x, { children: /* @__PURE__ */ m("div", {
21
+ className: h("fixed inset-0 grid place-content-center", p),
22
+ "data-theme": y,
23
+ children: [/* @__PURE__ */ a("div", {
24
+ className: "absolute inset-0 bg-black opacity-70 dark:opacity-85 animate-in fade-in-0",
25
+ onClick: v,
26
+ role: "presentation"
27
+ }), /* @__PURE__ */ a(R, {
28
+ returnFocus: !0,
29
+ autoFocus: i,
30
+ className: "contents",
31
+ children: /* @__PURE__ */ m(K.div, {
32
+ className: h(j({ className: u })),
33
+ role: "dialog",
34
+ "aria-modal": "true",
35
+ "aria-label": n,
36
+ "aria-labelledby": s,
37
+ layout: c ? "size" : void 0,
38
+ transition: b ?? {
39
+ duration: 0.25,
40
+ ease: "easeInOut"
41
+ },
42
+ children: [
43
+ F,
44
+ o && /* @__PURE__ */ m("button", {
45
+ className: h(V({ className: f })),
46
+ onClick: v,
47
+ children: [/* @__PURE__ */ a(A, {}), /* @__PURE__ */ a(H, { children: "Dismiss modal" })]
48
+ }),
49
+ N ?? w,
50
+ k
51
+ ]
52
+ })
53
+ })]
54
+ }) });
55
+ }, t = ({ isOpen: c, onClose: n, container: s, theme: i, ...f }) => {
56
+ const r = D(null), [u, p] = S(null);
57
+ return g(() => {
58
+ if (!r.current || i || s) return;
59
+ const o = r.current.closest("[data-theme]");
60
+ o && p(o);
61
+ }, [i, s]), g(() => {
62
+ const o = new AbortController(), y = (b) => {
63
+ b.code === "Escape" && n?.();
64
+ };
65
+ return window.addEventListener("keydown", y, { signal: o.signal }), () => {
66
+ o.abort();
67
+ };
68
+ }, [n]), /* @__PURE__ */ m(I, { children: [/* @__PURE__ */ a("span", {
69
+ ref: r,
70
+ "data-testid": "modal-anchor",
71
+ hidden: !0
72
+ }), c && z(/* @__PURE__ */ a(L, {
73
+ ...f,
74
+ theme: i,
75
+ onClose: n
76
+ }), s || u || document.body)] });
77
+ };
78
+ t.Header = E;
79
+ t.Body = B;
80
+ t.Footer = C;
81
+ export {
82
+ L as n,
83
+ t
84
+ };
@@ -4,7 +4,7 @@ import { WarningIcon as T } from "../../assets/icons/components/Warning.js";
4
4
  import { Button as C } from "../Button/Button.js";
5
5
  import { Typography as d } from "../Typography/Typography.js";
6
6
  import { CopyButton as V } from "../CopyButton/CopyButton.js";
7
- import { t as l } from "../../Modal-prJwxFba.js";
7
+ import { t as l } from "../../Modal-0Wp5szX4.js";
8
8
  import { useEffect as W, useId as A, useState as G } from "react";
9
9
  import { Fragment as J, jsx as e, jsxs as r } from "react/jsx-runtime";
10
10
  var L = ({ autoFocus: N, cancelLabel: v = "Cancel", children: k, className: I, confirmationInputClassName: w, confirmationInputLabel: B, confirmationPrompt: j, confirmationText: a, confirmLabel: n = "Confirm", containerClassName: D, copyLabel: F = "Copy", description: i, icon: c, isOpen: o, isPending: t = !1, pendingLabel: S, theme: $, title: M, variant: f = "danger", onClose: q, onConfirm: z }) => {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t } from "../../Modal-prJwxFba.js";
2
+ import { t } from "../../Modal-0Wp5szX4.js";
3
3
  export {
4
4
  t as Modal
5
5
  };
@@ -1,4 +1,4 @@
1
- import { n as p } from "../../../../Modal-prJwxFba.js";
1
+ import { n as p } from "../../../../Modal-0Wp5szX4.js";
2
2
  export {
3
3
  p as Wrapper
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import { Body as o } from "./Body/Body.js";
2
2
  import { Footer as p } from "./Footer/Footer.js";
3
3
  import { Header as e } from "./Header/Header.js";
4
- import { n as i } from "../../../Modal-prJwxFba.js";
4
+ import { n as i } from "../../../Modal-0Wp5szX4.js";
5
5
  export {
6
6
  o as Body,
7
7
  p as Footer,
@@ -1,41 +1,44 @@
1
- import { i as a, t as i } from "../../utils-DnIJruo0.js";
2
- import { Actions as m } from "./components/Actions/Actions.js";
3
- import { sendResetFiltersEvent as n } from "./events/filters/filters.js";
4
- import { sendRefreshEvent as l } from "./events/refresh/refresh.js";
5
- import { sendCollapseRowEvent as s, sendExpandRowEvent as p, sendToggleRowEvent as f } from "./events/row/row.js";
6
- import { EmptyState as d } from "./components/EmptyState/EmptyState.js";
7
- import { EmptyResults as u } from "./components/EmptyResults/EmptyResults.js";
8
- import { ErrorState as c } from "./components/ErrorState/ErrorState.js";
9
- import { TruncateText as E } from "./components/TruncateText/TruncateText.js";
10
- import { loadVirtualizedTableContent as o } from "./utils/load-content/load-content.js";
11
- import { Suspense as v, lazy as T } from "react";
1
+ import { i, t as n } from "../../utils-DnIJruo0.js";
2
+ import { Actions as l } from "./components/Actions/Actions.js";
3
+ import { sendResetFiltersEvent as m } from "./events/filters/filters.js";
4
+ import { sendRefreshEvent as s } from "./events/refresh/refresh.js";
5
+ import { sendCollapseRowEvent as d, sendExpandRowEvent as p, sendToggleRowEvent as u } from "./events/row/row.js";
6
+ import { EmptyState as f } from "./components/EmptyState/EmptyState.js";
7
+ import { EmptyResults as c } from "./components/EmptyResults/EmptyResults.js";
8
+ import { ErrorState as E } from "./components/ErrorState/ErrorState.js";
9
+ import { TruncateText as T } from "./components/TruncateText/TruncateText.js";
10
+ import { getLoadedVirtualizedTableContent as v, loadVirtualizedTableContent as o } from "./utils/load-content/load-content.js";
11
+ import { Suspense as b, lazy as z } from "react";
12
12
  import { jsx as r } from "react/jsx-runtime";
13
- a && o().catch(() => {
13
+ i && o().catch(() => {
14
14
  });
15
- var b = T(() => o().then((e) => ({ default: e.VirtualizedTableContent }))), y = (e) => /* @__PURE__ */ r(v, {
16
- fallback: /* @__PURE__ */ r("section", {
17
- className: i("kvt", "w-full min-w-fit", e.className),
18
- "aria-busy": "true"
19
- }),
20
- children: /* @__PURE__ */ r(b, { ...e })
21
- }), t = y;
15
+ var C = z(() => o().then((e) => ({ default: e.VirtualizedTableContent }))), V = (e) => {
16
+ const a = v()?.VirtualizedTableContent ?? C;
17
+ return /* @__PURE__ */ r(b, {
18
+ fallback: /* @__PURE__ */ r("section", {
19
+ className: n("kvt", "w-full min-w-fit", e.className),
20
+ "aria-busy": "true"
21
+ }),
22
+ children: /* @__PURE__ */ r(a, { ...e })
23
+ });
24
+ }, t = V;
22
25
  t.displayName = "KonstructVirtualizedTable";
23
- t.TruncateText = E;
24
- t.EmptyState = d;
25
- t.EmptyResults = u;
26
- t.ErrorState = c;
27
- t.Actions = m;
26
+ t.TruncateText = T;
27
+ t.EmptyState = f;
28
+ t.EmptyResults = c;
29
+ t.ErrorState = E;
30
+ t.Actions = l;
28
31
  t.Events = {
29
32
  sendExpandRowEvent: p,
30
- sendCollapseRowEvent: s,
31
- sendToggleRowEvent: f,
32
- sendResetFiltersEvent: n,
33
- sendRefreshEvent: l
33
+ sendCollapseRowEvent: d,
34
+ sendToggleRowEvent: u,
35
+ sendResetFiltersEvent: m,
36
+ sendRefreshEvent: s
34
37
  };
35
38
  export {
36
- u as EmptyResults,
37
- d as EmptyState,
38
- c as ErrorState,
39
- E as TruncateText,
39
+ c as EmptyResults,
40
+ f as EmptyState,
41
+ E as ErrorState,
42
+ T as TruncateText,
40
43
  t as VirtualizedTable
41
44
  };
@@ -1,11 +1,12 @@
1
1
  import { getTableId as i } from "./get-table-id.js";
2
- import { isVirtualizedTableContentLoaded as a, loadVirtualizedTableContent as o, preloadVirtualizedTable as r, subscribeToVirtualizedTableContent as l } from "./load-content/load-content.js";
2
+ import { getLoadedVirtualizedTableContent as a, isVirtualizedTableContentLoaded as o, loadVirtualizedTableContent as r, preloadVirtualizedTable as l, subscribeToVirtualizedTableContent as d } from "./load-content/load-content.js";
3
3
  import { isPaginationBarVisible as b } from "./pagination.js";
4
4
  export {
5
+ a as getLoadedVirtualizedTableContent,
5
6
  i as getTableId,
6
7
  b as isPaginationBarVisible,
7
- a as isVirtualizedTableContentLoaded,
8
- o as loadVirtualizedTableContent,
9
- r as preloadVirtualizedTable,
10
- l as subscribeToVirtualizedTableContent
8
+ o as isVirtualizedTableContentLoaded,
9
+ r as loadVirtualizedTableContent,
10
+ l as preloadVirtualizedTable,
11
+ d as subscribeToVirtualizedTableContent
11
12
  };
@@ -1,7 +1,8 @@
1
- import { isVirtualizedTableContentLoaded as t, loadVirtualizedTableContent as a, preloadVirtualizedTable as i, subscribeToVirtualizedTableContent as l } from "./load-content.js";
1
+ import { getLoadedVirtualizedTableContent as t, isVirtualizedTableContentLoaded as a, loadVirtualizedTableContent as i, preloadVirtualizedTable as l, subscribeToVirtualizedTableContent as o } from "./load-content.js";
2
2
  export {
3
- t as isVirtualizedTableContentLoaded,
4
- a as loadVirtualizedTableContent,
5
- i as preloadVirtualizedTable,
6
- l as subscribeToVirtualizedTableContent
3
+ t as getLoadedVirtualizedTableContent,
4
+ a as isVirtualizedTableContentLoaded,
5
+ i as loadVirtualizedTableContent,
6
+ l as preloadVirtualizedTable,
7
+ o as subscribeToVirtualizedTableContent
7
8
  };
@@ -1,14 +1,15 @@
1
- var t, a = !1, r = /* @__PURE__ */ new Set(), o = () => (t || (t = import("../../components/VirtualizedTableContent/VirtualizedTableContent.js").then((e) => (a = !0, r.forEach((n) => {
2
- n();
1
+ var r, a, t = /* @__PURE__ */ new Set(), n = () => (r || (r = import("../../components/VirtualizedTableContent/VirtualizedTableContent.js").then((e) => (a = e, t.forEach((d) => {
2
+ d();
3
3
  }), e)).catch((e) => {
4
- throw t = void 0, e;
5
- })), t), d = () => a, i = (e) => (r.add(e), () => {
6
- r.delete(e);
7
- }), l = () => o().then(() => {
4
+ throw r = void 0, e;
5
+ })), r), o = () => a !== void 0, i = () => a, l = (e) => (t.add(e), () => {
6
+ t.delete(e);
7
+ }), u = () => n().then(() => {
8
8
  });
9
9
  export {
10
- d as isVirtualizedTableContentLoaded,
11
- o as loadVirtualizedTableContent,
12
- l as preloadVirtualizedTable,
13
- i as subscribeToVirtualizedTableContent
10
+ i as getLoadedVirtualizedTableContent,
11
+ o as isVirtualizedTableContentLoaded,
12
+ n as loadVirtualizedTableContent,
13
+ u as preloadVirtualizedTable,
14
+ l as subscribeToVirtualizedTableContent
14
15
  };
@@ -19,7 +19,7 @@ import { Card as _ } from "./Card/Card.js";
19
19
  import { CheckboxCard as y } from "./CheckboxCard/CheckboxCard.js";
20
20
  import { Collapse as M } from "./Collapse/Collapse.js";
21
21
  import { CopyButton as z } from "./CopyButton/CopyButton.js";
22
- import { t as W } from "../Modal-prJwxFba.js";
22
+ import { t as W } from "../Modal-0Wp5szX4.js";
23
23
  import { ConfirmDialog as j } from "./ConfirmDialog/ConfirmDialog.js";
24
24
  import { DatePicker as H } from "./Datepicker/DatePicker.js";
25
25
  import { Radio as K } from "./Radio/Radio.js";
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import { Card as X } from "./components/Card/Card.js";
24
24
  import { CheckboxCard as q } from "./components/CheckboxCard/CheckboxCard.js";
25
25
  import { Collapse as K } from "./components/Collapse/Collapse.js";
26
26
  import { CopyButton as Z } from "./components/CopyButton/CopyButton.js";
27
- import { t as rr } from "./Modal-prJwxFba.js";
27
+ import { t as rr } from "./Modal-0Wp5szX4.js";
28
28
  import { ConfirmDialog as tr } from "./components/ConfirmDialog/ConfirmDialog.js";
29
29
  import { DatePicker as ir } from "./components/Datepicker/DatePicker.js";
30
30
  import { Radio as er } from "./components/Radio/Radio.js";
@@ -19,6 +19,8 @@ import { modalVariants } from './components/Wrapper/Wrapper.variants';
19
19
  */
20
20
  export type Props = PropsWithChildren & VariantProps<typeof modalVariants> & {
21
21
  /** CSS classes for the close button */
22
+ /** Animate height changes of the content, e.g. when a step is swapped. Defaults to false */
23
+ animateResize?: boolean;
22
24
  ariaLabel?: string;
23
25
  ariaLabelledBy?: string;
24
26
  /** Move focus to the first focusable element when the modal opens. Defaults to true */
@@ -36,7 +38,7 @@ export type Props = PropsWithChildren & VariantProps<typeof modalVariants> & {
36
38
  showCloseButton?: boolean;
37
39
  /** Theme override for this component */
38
40
  theme?: Theme;
39
- /** Motion transition config for the modal animation */
41
+ /** Motion transition used when `animateResize` is enabled */
40
42
  transition?: Transition;
41
43
  /** Callback when modal is closed (Escape key or close button) */
42
44
  onClose?: () => void;
@@ -4,6 +4,7 @@ import { PropsWithChildren } from 'react';
4
4
  import { Theme } from '../../../../domain/theme';
5
5
  import { modalVariants } from './Wrapper.variants';
6
6
  export type Props = PropsWithChildren & VariantProps<typeof modalVariants> & {
7
+ animateResize?: boolean;
7
8
  ariaLabel?: string;
8
9
  ariaLabelledBy?: string;
9
10
  autoFocus?: boolean;
@@ -2,6 +2,7 @@ type ContentModule = typeof import('../../components/VirtualizedTableContent/Vir
2
2
  type Listener = () => void;
3
3
  export declare const loadVirtualizedTableContent: () => Promise<ContentModule>;
4
4
  export declare const isVirtualizedTableContentLoaded: () => boolean;
5
+ export declare const getLoadedVirtualizedTableContent: () => ContentModule | undefined;
5
6
  export declare const subscribeToVirtualizedTableContent: (listener: Listener) => (() => void);
6
7
  export declare const preloadVirtualizedTable: () => Promise<void>;
7
8
  export {};
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.2-alpha.116",
5
+ "version": "0.1.2-alpha.118",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -96,13 +96,13 @@
96
96
  "class-variance-authority": "^0.7.1",
97
97
  "clsx": "^2.1.1",
98
98
  "cmdk": "^1.1.1",
99
- "countries-and-timezones": "^3.10.0",
99
+ "countries-and-timezones": "^3.11.0",
100
100
  "country-flag-icons": "^1.6.20",
101
101
  "country-locale-map": "^1.9.14",
102
102
  "google-libphonenumber": "^3.2.47",
103
103
  "i18n-iso-countries": "^7.14.0",
104
104
  "js-cookie": "^3.0.8",
105
- "lucide-react": "^1.56.0",
105
+ "lucide-react": "^1.59.0",
106
106
  "react-chartjs-2": "^5.3.1",
107
107
  "react-day-picker": "^10.0.2",
108
108
  "react-feather": "^2.0.10",
@@ -150,7 +150,7 @@
150
150
  "@storybook/addon-links": "^10.6.2",
151
151
  "@storybook/react-vite": "^10.6.2",
152
152
  "@tailwindcss/vite": "^4.3.3",
153
- "@tanstack/react-query": "^5.104.2",
153
+ "@tanstack/react-query": "^5.104.5",
154
154
  "@testing-library/jest-dom": "^7.0.1",
155
155
  "@testing-library/react": "^16.3.3",
156
156
  "@testing-library/user-event": "^14.6.8",
@@ -160,10 +160,10 @@
160
160
  "@types/lodash": "^4.17.26",
161
161
  "@types/react": "^19.3.0",
162
162
  "@types/react-dom": "^19.3.0",
163
- "@typescript-eslint/eslint-plugin": "^8.71.2",
164
- "@typescript-eslint/parser": "^8.71.2",
163
+ "@typescript-eslint/eslint-plugin": "^8.72.0",
164
+ "@typescript-eslint/parser": "^8.72.0",
165
165
  "@vitejs/plugin-react": "^6.1.2",
166
- "@vitest/coverage-v8": "^5.0.4",
166
+ "@vitest/coverage-v8": "^5.0.5",
167
167
  "autoprefixer": "^10.6.1",
168
168
  "eslint": "^9.39.5",
169
169
  "eslint-plugin-react": "^7.37.5",
@@ -174,10 +174,10 @@
174
174
  "glob": "^13.0.6",
175
175
  "husky": "^9.1.7",
176
176
  "jest-axe": "^11.0.0",
177
- "jsdom": "^30.1.2",
177
+ "jsdom": "^30.1.3",
178
178
  "lodash": "^4.18.1",
179
- "motion": "^14.2.0",
180
- "postcss": "^8.5.30",
179
+ "motion": "^14.4.0",
180
+ "postcss": "^8.5.31",
181
181
  "prettier": "^3.9.10",
182
182
  "rimraf": "^6.1.3",
183
183
  "storybook": "^10.6.2",
@@ -188,7 +188,7 @@
188
188
  "vite-plugin-dts": "^5.1.2",
189
189
  "vite-plugin-lib-inject-css": "^2.2.2",
190
190
  "vite-plugin-svgr": "^5.2.0",
191
- "vitest": "^5.0.4"
191
+ "vitest": "^5.0.5"
192
192
  },
193
193
  "overrides": {
194
194
  "storybook": "$storybook",
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.2-alpha.117",
5
+ "version": "0.1.2-alpha.119",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -96,13 +96,13 @@
96
96
  "class-variance-authority": "^0.7.1",
97
97
  "clsx": "^2.1.1",
98
98
  "cmdk": "^1.1.1",
99
- "countries-and-timezones": "^3.10.0",
99
+ "countries-and-timezones": "^3.11.0",
100
100
  "country-flag-icons": "^1.6.20",
101
101
  "country-locale-map": "^1.9.14",
102
102
  "google-libphonenumber": "^3.2.47",
103
103
  "i18n-iso-countries": "^7.14.0",
104
104
  "js-cookie": "^3.0.8",
105
- "lucide-react": "^1.56.0",
105
+ "lucide-react": "^1.59.0",
106
106
  "react-chartjs-2": "^5.3.1",
107
107
  "react-day-picker": "^10.0.2",
108
108
  "react-feather": "^2.0.10",
@@ -150,7 +150,7 @@
150
150
  "@storybook/addon-links": "^10.6.2",
151
151
  "@storybook/react-vite": "^10.6.2",
152
152
  "@tailwindcss/vite": "^4.3.3",
153
- "@tanstack/react-query": "^5.104.2",
153
+ "@tanstack/react-query": "^5.104.5",
154
154
  "@testing-library/jest-dom": "^7.0.1",
155
155
  "@testing-library/react": "^16.3.3",
156
156
  "@testing-library/user-event": "^14.6.8",
@@ -160,10 +160,10 @@
160
160
  "@types/lodash": "^4.17.26",
161
161
  "@types/react": "^19.3.0",
162
162
  "@types/react-dom": "^19.3.0",
163
- "@typescript-eslint/eslint-plugin": "^8.71.2",
164
- "@typescript-eslint/parser": "^8.71.2",
163
+ "@typescript-eslint/eslint-plugin": "^8.72.0",
164
+ "@typescript-eslint/parser": "^8.72.0",
165
165
  "@vitejs/plugin-react": "^6.1.2",
166
- "@vitest/coverage-v8": "^5.0.4",
166
+ "@vitest/coverage-v8": "^5.0.5",
167
167
  "autoprefixer": "^10.6.1",
168
168
  "eslint": "^9.39.5",
169
169
  "eslint-plugin-react": "^7.37.5",
@@ -174,10 +174,10 @@
174
174
  "glob": "^13.0.6",
175
175
  "husky": "^9.1.7",
176
176
  "jest-axe": "^11.0.0",
177
- "jsdom": "^30.1.2",
177
+ "jsdom": "^30.1.3",
178
178
  "lodash": "^4.18.1",
179
- "motion": "^14.2.0",
180
- "postcss": "^8.5.30",
179
+ "motion": "^14.4.0",
180
+ "postcss": "^8.5.31",
181
181
  "prettier": "^3.9.10",
182
182
  "rimraf": "^6.1.3",
183
183
  "storybook": "^10.6.2",
@@ -188,7 +188,7 @@
188
188
  "vite-plugin-dts": "^5.1.2",
189
189
  "vite-plugin-lib-inject-css": "^2.2.2",
190
190
  "vite-plugin-svgr": "^5.2.0",
191
- "vitest": "^5.0.4"
191
+ "vitest": "^5.0.5"
192
192
  },
193
193
  "overrides": {
194
194
  "storybook": "$storybook",
@@ -1,84 +0,0 @@
1
- import { t as w } from "./x-Vur_9PXW.js";
2
- import { t as A } from "./dist-C_jtUTU9.js";
3
- import { t as h } from "./utils-DnIJruo0.js";
4
- import { t as H } from "./Combination-CnMM05mt.js";
5
- import { Body as x } from "./components/Modal/components/Body/Body.js";
6
- import { Footer as B } from "./components/Modal/components/Footer/Footer.js";
7
- import { Header as C } from "./components/Modal/components/Header/Header.js";
8
- import { t as E } from "./es2015-B_07N-UL.js";
9
- import { buttonCloseVariants as R, modalVariants as V } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
10
- import { Children as m, isValidElement as c, useEffect as g, useRef as j, useState as D } from "react";
11
- import { createPortal as S } from "react-dom";
12
- import { Fragment as z, jsx as o, jsxs as f } from "react/jsx-runtime";
13
- import { motion as I } from "motion/react";
14
- var K = ({ ariaLabel: u, ariaLabelledBy: n, autoFocus: s = !0, buttonCloseClassName: i, children: a, className: d, containerClassName: p, showCloseButton: y = !0, theme: r, transition: b, onClose: l }) => {
15
- const v = m.toArray(a).find((e) => c(e) && e.type === t.Header), F = m.toArray(a).find((e) => c(e) && e.type === t.Body), N = m.toArray(a).find((e) => c(e) && e.type === t.Footer), k = m.toArray(a).filter((e) => !c(e) || ![
16
- t.Header,
17
- t.Body,
18
- t.Footer
19
- ].includes(e.type));
20
- return /* @__PURE__ */ o(H, { children: /* @__PURE__ */ f("div", {
21
- className: h("fixed inset-0 grid place-content-center", p),
22
- "data-theme": r,
23
- children: [/* @__PURE__ */ o("div", {
24
- className: "absolute inset-0 bg-black opacity-70 dark:opacity-85 animate-in fade-in-0",
25
- onClick: l,
26
- role: "presentation"
27
- }), /* @__PURE__ */ o(E, {
28
- returnFocus: !0,
29
- autoFocus: s,
30
- className: "contents",
31
- children: /* @__PURE__ */ f(I.div, {
32
- className: h(V({ className: d })),
33
- role: "dialog",
34
- "aria-modal": "true",
35
- "aria-label": u,
36
- "aria-labelledby": n,
37
- layout: "size",
38
- transition: b ?? {
39
- duration: 0.25,
40
- ease: "easeInOut"
41
- },
42
- children: [
43
- v,
44
- y && /* @__PURE__ */ f("button", {
45
- className: h(R({ className: i })),
46
- onClick: l,
47
- children: [/* @__PURE__ */ o(w, {}), /* @__PURE__ */ o(A, { children: "Dismiss modal" })]
48
- }),
49
- F ?? k,
50
- N
51
- ]
52
- })
53
- })]
54
- }) });
55
- }, t = ({ isOpen: u, onClose: n, container: s, theme: i, ...a }) => {
56
- const d = j(null), [p, y] = D(null);
57
- return g(() => {
58
- if (!d.current || i || s) return;
59
- const r = d.current.closest("[data-theme]");
60
- r && y(r);
61
- }, [i, s]), g(() => {
62
- const r = new AbortController(), b = (l) => {
63
- l.code === "Escape" && n?.();
64
- };
65
- return window.addEventListener("keydown", b, { signal: r.signal }), () => {
66
- r.abort();
67
- };
68
- }, [n]), /* @__PURE__ */ f(z, { children: [/* @__PURE__ */ o("span", {
69
- ref: d,
70
- "data-testid": "modal-anchor",
71
- hidden: !0
72
- }), u && S(/* @__PURE__ */ o(K, {
73
- ...a,
74
- theme: i,
75
- onClose: n
76
- }), s || p || document.body)] });
77
- };
78
- t.Header = C;
79
- t.Body = x;
80
- t.Footer = B;
81
- export {
82
- K as n,
83
- t
84
- };