@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 e from "react";
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--action-group", P = "flow--modal--content", T = "flow--modal--off-canvas", I = "flow--modal--header", l = {
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
- "modal-zoom": "flow--modal--modal-zoom",
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
- offCanvas: T,
30
+ "modal-zoom": "flow--modal--modal-zoom",
31
+ header: B,
31
32
  "modal-slide-in": "flow--modal--modal-slide-in",
32
- header: I,
33
- "modal-slide-up": "flow--modal--modal-slide-up"
34
- }, A = "flow--modal-overlay--overlay", F = {
35
- overlay: A,
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
- }, G = (t) => {
38
+ }, F = (t) => {
38
39
  const {
39
- controller: r,
40
- children: o,
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
- }), a = r ?? f, c = a.useIsOpen(), i = u(F.overlay, m);
46
- return /* @__PURE__ */ e.createElement(
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) => a.setOpen(d)
53
+ onOpenChange: (d) => r.setOpen(d)
53
54
  },
54
- /* @__PURE__ */ e.createElement(n.Modal, null, /* @__PURE__ */ e.createElement(n.Dialog, null, /* @__PURE__ */ e.createElement(E, { type: "Modal", controller: a }, o)))
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
- }, Y = g("Modal", (t) => {
57
+ }, Z = g("Modal", (t) => {
57
58
  const {
58
- size: r = "s",
59
- offCanvas: o,
59
+ size: a = "s",
60
+ offCanvas: e,
60
61
  controller: s,
61
62
  children: m,
62
63
  refProp: f,
63
- className: a,
64
+ className: r,
64
65
  ...c
65
66
  } = t, i = u(
66
- l.modal,
67
- l[`size-${r}`],
68
- o && l.offCanvas,
69
- a
67
+ e ? l.offCanvas : l.modal,
68
+ l[`size-${a}`],
69
+ r
70
70
  ), d = {
71
71
  Content: {
72
- elementType: e.Fragment
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__ */ e.createElement(G, { className: i, controller: s, ...c }, /* @__PURE__ */ e.createElement(v, { props: d }, /* @__PURE__ */ e.createElement(y, null, o && /* @__PURE__ */ e.createElement(w, { className: l.header }, /* @__PURE__ */ e.createElement(p, { id: "heading" }), /* @__PURE__ */ e.createElement(O, { closeOverlay: "Modal" }, /* @__PURE__ */ e.createElement(
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__ */ e.createElement(z, null)
93
- ))), /* @__PURE__ */ e.createElement("div", { className: l.content }, !o && /* @__PURE__ */ e.createElement(p, { id: "heading" }), m), /* @__PURE__ */ e.createElement(p, { id: "buttons" }))));
94
- }), Z = (t) => {
95
- const { children: r, ...o } = t;
96
- return /* @__PURE__ */ e.createElement(
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
- ...o,
100
+ ...e,
101
101
  component: n.DialogTrigger
102
102
  },
103
- r
103
+ a
104
104
  );
105
105
  };
106
106
  export {
107
- Y as Modal,
108
- Z as ModalTrigger,
109
- Y as default
107
+ Z as Modal,
108
+ _ as ModalTrigger,
109
+ Z as default
110
110
  };