@mittwald/flow-react-components 0.1.0-alpha.160 → 0.1.0-alpha.161
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,6 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import
|
|
3
|
+
import o from "react";
|
|
4
4
|
import u from "clsx";
|
|
5
5
|
import "./propsContext-DzAKlmhS.js";
|
|
6
6
|
import { P as v } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
@@ -19,57 +19,57 @@ import "@tabler/icons-react";
|
|
|
19
19
|
import "./Icon-DZtYAxOE.js";
|
|
20
20
|
import { I as z } from "./IconClose-DT3oFw36.js";
|
|
21
21
|
import { O as M } from "./OverlayTrigger-Bdb65OEJ.js";
|
|
22
|
-
const N = "flow--modal", x = "flow--modal--
|
|
22
|
+
const N = "flow--modal", x = "flow--modal--off-canvas", P = "flow--modal--content", T = "flow--modal--action-group", B = "flow--modal--header", I = "flow--modal--close-button", l = {
|
|
23
23
|
modal: N,
|
|
24
|
-
|
|
25
|
-
actionGroup: x,
|
|
24
|
+
offCanvas: x,
|
|
26
25
|
content: P,
|
|
26
|
+
actionGroup: T,
|
|
27
27
|
"size-s": "flow--modal--size-s",
|
|
28
28
|
"size-m": "flow--modal--size-m",
|
|
29
29
|
"size-l": "flow--modal--size-l",
|
|
30
|
-
|
|
30
|
+
"modal-zoom": "flow--modal--modal-zoom",
|
|
31
|
+
header: B,
|
|
31
32
|
"modal-slide-in": "flow--modal--modal-slide-in",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
overlay:
|
|
33
|
+
"modal-slide-up": "flow--modal--modal-slide-up",
|
|
34
|
+
closeButton: I
|
|
35
|
+
}, b = "flow--modal-overlay--overlay", A = {
|
|
36
|
+
overlay: b,
|
|
36
37
|
"overlay-fade": "flow--modal-overlay--overlay-fade"
|
|
37
|
-
},
|
|
38
|
+
}, F = (t) => {
|
|
38
39
|
const {
|
|
39
|
-
controller:
|
|
40
|
-
children:
|
|
40
|
+
controller: a,
|
|
41
|
+
children: e,
|
|
41
42
|
isDismissable: s = !0,
|
|
42
43
|
className: m
|
|
43
44
|
} = t, f = C("Modal", {
|
|
44
45
|
reuseControllerFromContext: !0
|
|
45
|
-
}),
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
}), r = a ?? f, c = r.useIsOpen(), i = u(A.overlay, m);
|
|
47
|
+
return /* @__PURE__ */ o.createElement(
|
|
47
48
|
n.ModalOverlay,
|
|
48
49
|
{
|
|
49
50
|
className: i,
|
|
50
51
|
isDismissable: s,
|
|
51
52
|
isOpen: c,
|
|
52
|
-
onOpenChange: (d) =>
|
|
53
|
+
onOpenChange: (d) => r.setOpen(d)
|
|
53
54
|
},
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ o.createElement(n.Modal, null, /* @__PURE__ */ o.createElement(n.Dialog, null, /* @__PURE__ */ o.createElement(E, { type: "Modal", controller: r }, e)))
|
|
55
56
|
);
|
|
56
|
-
},
|
|
57
|
+
}, Z = g("Modal", (t) => {
|
|
57
58
|
const {
|
|
58
|
-
size:
|
|
59
|
-
offCanvas:
|
|
59
|
+
size: a = "s",
|
|
60
|
+
offCanvas: e,
|
|
60
61
|
controller: s,
|
|
61
62
|
children: m,
|
|
62
63
|
refProp: f,
|
|
63
|
-
className:
|
|
64
|
+
className: r,
|
|
64
65
|
...c
|
|
65
66
|
} = t, i = u(
|
|
66
|
-
l.modal,
|
|
67
|
-
l[`size-${
|
|
68
|
-
|
|
69
|
-
a
|
|
67
|
+
e ? l.offCanvas : l.modal,
|
|
68
|
+
l[`size-${a}`],
|
|
69
|
+
r
|
|
70
70
|
), d = {
|
|
71
71
|
Content: {
|
|
72
|
-
elementType:
|
|
72
|
+
elementType: o.Fragment
|
|
73
73
|
},
|
|
74
74
|
Heading: {
|
|
75
75
|
level: 2,
|
|
@@ -82,29 +82,29 @@ const N = "flow--modal", x = "flow--modal--action-group", P = "flow--modal--cont
|
|
|
82
82
|
tunnelId: "buttons"
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ o.createElement(F, { className: i, controller: s, ...c }, /* @__PURE__ */ o.createElement(v, { props: d }, /* @__PURE__ */ o.createElement(y, null, e && /* @__PURE__ */ o.createElement(w, { className: l.header }, /* @__PURE__ */ o.createElement(p, { id: "heading" }), /* @__PURE__ */ o.createElement(O, { closeOverlay: "Modal" }, /* @__PURE__ */ o.createElement(
|
|
86
86
|
h,
|
|
87
87
|
{
|
|
88
88
|
variant: "plain",
|
|
89
89
|
color: "secondary",
|
|
90
90
|
className: l.closeButton
|
|
91
91
|
},
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
))), /* @__PURE__ */
|
|
94
|
-
}),
|
|
95
|
-
const { children:
|
|
96
|
-
return /* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ o.createElement(z, null)
|
|
93
|
+
))), /* @__PURE__ */ o.createElement("div", { className: l.content }, !e && /* @__PURE__ */ o.createElement(p, { id: "heading" }), m), /* @__PURE__ */ o.createElement(p, { id: "buttons" }))));
|
|
94
|
+
}), _ = (t) => {
|
|
95
|
+
const { children: a, ...e } = t;
|
|
96
|
+
return /* @__PURE__ */ o.createElement(
|
|
97
97
|
M,
|
|
98
98
|
{
|
|
99
99
|
overlayType: "Modal",
|
|
100
|
-
...
|
|
100
|
+
...e,
|
|
101
101
|
component: n.DialogTrigger
|
|
102
102
|
},
|
|
103
|
-
|
|
103
|
+
a
|
|
104
104
|
);
|
|
105
105
|
};
|
|
106
106
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
Z as Modal,
|
|
108
|
+
_ as ModalTrigger,
|
|
109
|
+
Z as default
|
|
110
110
|
};
|