@mittwald/flow-react-components 0.1.0-alpha.191 → 0.1.0-alpha.193
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.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import o from "react";
|
|
4
|
-
import
|
|
4
|
+
import f from "clsx";
|
|
5
5
|
import "./propsContext-DzAKlmhS.js";
|
|
6
|
-
import { P as
|
|
6
|
+
import { P as u } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
7
7
|
import "@react-aria/utils";
|
|
8
8
|
import "remeda";
|
|
9
|
-
import { TunnelProvider as
|
|
10
|
-
import { f as
|
|
9
|
+
import { TunnelProvider as v, TunnelExit as y } from "@mittwald/react-tunnel";
|
|
10
|
+
import { f as C } from "./flowComponent-COVzhVCB.js";
|
|
11
11
|
import * as n from "react-aria-components";
|
|
12
12
|
import "mobx";
|
|
13
|
-
import { u as
|
|
14
|
-
import { O as
|
|
15
|
-
import { H as
|
|
13
|
+
import { u as g } from "./useOverlayController-D8N4X2rc.js";
|
|
14
|
+
import { O as w } from "./OverlayContextProvider-DJzKzUwy.js";
|
|
15
|
+
import { H as E } from "./Header-UWuteUuZ.js";
|
|
16
16
|
import { A as O } from "./Action-B9iiMUXq.js";
|
|
17
17
|
import { B as h } from "./Button-CVDWL-od.js";
|
|
18
18
|
import "@tabler/icons-react";
|
|
19
19
|
import "./Icon-CUhvR1IT.js";
|
|
20
20
|
import { I as M } from "./IconClose-BHf4btna.js";
|
|
21
21
|
import { O as N } from "./OverlayTrigger-Bdb65OEJ.js";
|
|
22
|
-
const x = "flow--modal", z = "flow--modal--off-canvas", P = "flow--modal--
|
|
22
|
+
const x = "flow--modal", z = "flow--modal--off-canvas", P = "flow--modal--header", T = "flow--modal--content", B = "flow--modal--action-group", A = "flow--modal--close-button", e = {
|
|
23
23
|
modal: x,
|
|
24
24
|
offCanvas: z,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
header: P,
|
|
26
|
+
content: T,
|
|
27
|
+
actionGroup: B,
|
|
27
28
|
"size-s": "flow--modal--size-s",
|
|
28
29
|
"size-m": "flow--modal--size-m",
|
|
29
30
|
"modal-zoom": "flow--modal--modal-zoom",
|
|
30
|
-
header: B,
|
|
31
31
|
"modal-slide-in": "flow--modal--modal-slide-in",
|
|
32
32
|
"modal-slide-up": "flow--modal--modal-slide-up",
|
|
33
|
-
closeButton:
|
|
34
|
-
},
|
|
35
|
-
overlay:
|
|
33
|
+
closeButton: A
|
|
34
|
+
}, G = "flow--modal-overlay--overlay", I = {
|
|
35
|
+
overlay: G,
|
|
36
36
|
"overlay-fade": "flow--modal-overlay--overlay-fade"
|
|
37
|
-
},
|
|
37
|
+
}, D = (t) => {
|
|
38
38
|
const {
|
|
39
39
|
controller: r,
|
|
40
|
-
children:
|
|
40
|
+
children: l,
|
|
41
41
|
isDismissable: s = !0,
|
|
42
42
|
className: m
|
|
43
|
-
} =
|
|
43
|
+
} = t, p = g("Modal", {
|
|
44
44
|
reuseControllerFromContext: !0
|
|
45
|
-
}), a = r ??
|
|
45
|
+
}), a = r ?? p, c = a.useIsOpen(), i = f(I.overlay, m);
|
|
46
46
|
return /* @__PURE__ */ o.createElement(
|
|
47
47
|
n.ModalOverlay,
|
|
48
48
|
{
|
|
@@ -51,24 +51,24 @@ const x = "flow--modal", z = "flow--modal--off-canvas", P = "flow--modal--conten
|
|
|
51
51
|
isOpen: c,
|
|
52
52
|
onOpenChange: (d) => a.setOpen(d)
|
|
53
53
|
},
|
|
54
|
-
/* @__PURE__ */ o.createElement(n.Modal, null, /* @__PURE__ */ o.createElement(n.Dialog, null, /* @__PURE__ */ o.createElement(
|
|
54
|
+
/* @__PURE__ */ o.createElement(n.Modal, null, /* @__PURE__ */ o.createElement(n.Dialog, null, /* @__PURE__ */ o.createElement(w, { type: "Modal", controller: a }, l)))
|
|
55
55
|
);
|
|
56
|
-
}, Z =
|
|
56
|
+
}, Z = C("Modal", (t) => {
|
|
57
57
|
const {
|
|
58
58
|
size: r = "s",
|
|
59
|
-
offCanvas:
|
|
59
|
+
offCanvas: l,
|
|
60
60
|
controller: s,
|
|
61
61
|
children: m,
|
|
62
|
-
refProp:
|
|
62
|
+
refProp: p,
|
|
63
63
|
className: a,
|
|
64
64
|
...c
|
|
65
|
-
} =
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
} = t, i = f(
|
|
66
|
+
l ? e.offCanvas : e.modal,
|
|
67
|
+
e[`size-${r}`],
|
|
68
68
|
a
|
|
69
69
|
), d = {
|
|
70
70
|
Content: {
|
|
71
|
-
|
|
71
|
+
className: e.content
|
|
72
72
|
},
|
|
73
73
|
Heading: {
|
|
74
74
|
level: 2,
|
|
@@ -76,26 +76,25 @@ const x = "flow--modal", z = "flow--modal--off-canvas", P = "flow--modal--conten
|
|
|
76
76
|
tunnelId: "heading"
|
|
77
77
|
},
|
|
78
78
|
ActionGroup: {
|
|
79
|
-
className:
|
|
80
|
-
tunnelId: "buttons"
|
|
79
|
+
className: e.actionGroup
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
|
-
return /* @__PURE__ */ o.createElement(
|
|
82
|
+
return /* @__PURE__ */ o.createElement(D, { className: i, controller: s, ...c }, /* @__PURE__ */ o.createElement(u, { props: d }, /* @__PURE__ */ o.createElement(v, null, /* @__PURE__ */ o.createElement(E, { className: e.header }, /* @__PURE__ */ o.createElement(y, { id: "heading" }), l && /* @__PURE__ */ o.createElement(O, { closeOverlay: "Modal" }, /* @__PURE__ */ o.createElement(
|
|
84
83
|
h,
|
|
85
84
|
{
|
|
86
85
|
variant: "plain",
|
|
87
86
|
color: "secondary",
|
|
88
|
-
className:
|
|
87
|
+
className: e.closeButton
|
|
89
88
|
},
|
|
90
89
|
/* @__PURE__ */ o.createElement(M, null)
|
|
91
|
-
))),
|
|
92
|
-
}), _ = (
|
|
93
|
-
const { children: r, ...
|
|
90
|
+
))), m)));
|
|
91
|
+
}), _ = (t) => {
|
|
92
|
+
const { children: r, ...l } = t;
|
|
94
93
|
return /* @__PURE__ */ o.createElement(
|
|
95
94
|
N,
|
|
96
95
|
{
|
|
97
96
|
overlayType: "Modal",
|
|
98
|
-
...
|
|
97
|
+
...l,
|
|
99
98
|
component: n.DialogTrigger
|
|
100
99
|
},
|
|
101
100
|
r
|