@mittwald/flow-react-components 0.1.0-alpha.191 → 0.1.0-alpha.192

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 u from "clsx";
4
+ import f from "clsx";
5
5
  import "./propsContext-DzAKlmhS.js";
6
- import { P as v } from "./PropsContextProvider-C6Z4XGp6.js";
6
+ import { P as u } from "./PropsContextProvider-C6Z4XGp6.js";
7
7
  import "@react-aria/utils";
8
8
  import "remeda";
9
- import { TunnelProvider as y, TunnelExit as p } from "@mittwald/react-tunnel";
10
- import { f as g } from "./flowComponent-COVzhVCB.js";
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 C } from "./useOverlayController-D8N4X2rc.js";
14
- import { O as E } from "./OverlayContextProvider-DJzKzUwy.js";
15
- import { H as w } from "./Header-UWuteUuZ.js";
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--content", T = "flow--modal--action-group", B = "flow--modal--header", I = "flow--modal--close-button", t = {
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
- content: P,
26
- actionGroup: T,
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: I
34
- }, b = "flow--modal-overlay--overlay", A = {
35
- overlay: b,
33
+ closeButton: A
34
+ }, G = "flow--modal-overlay--overlay", I = {
35
+ overlay: G,
36
36
  "overlay-fade": "flow--modal-overlay--overlay-fade"
37
- }, F = (l) => {
37
+ }, D = (t) => {
38
38
  const {
39
39
  controller: r,
40
- children: e,
40
+ children: l,
41
41
  isDismissable: s = !0,
42
42
  className: m
43
- } = l, f = C("Modal", {
43
+ } = t, p = g("Modal", {
44
44
  reuseControllerFromContext: !0
45
- }), a = r ?? f, c = a.useIsOpen(), i = u(A.overlay, m);
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(E, { type: "Modal", controller: a }, e)))
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 = g("Modal", (l) => {
56
+ }, Z = C("Modal", (t) => {
57
57
  const {
58
58
  size: r = "s",
59
- offCanvas: e,
59
+ offCanvas: l,
60
60
  controller: s,
61
61
  children: m,
62
- refProp: f,
62
+ refProp: p,
63
63
  className: a,
64
64
  ...c
65
- } = l, i = u(
66
- e ? t.offCanvas : t.modal,
67
- t[`size-${r}`],
65
+ } = t, i = f(
66
+ l ? e.offCanvas : e.modal,
67
+ e[`size-${r}`],
68
68
  a
69
69
  ), d = {
70
70
  Content: {
71
- elementType: o.Fragment
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: t.actionGroup,
80
- tunnelId: "buttons"
79
+ className: e.actionGroup
81
80
  }
82
81
  };
83
- 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: t.header }, /* @__PURE__ */ o.createElement(p, { id: "heading" }), /* @__PURE__ */ o.createElement(O, { closeOverlay: "Modal" }, /* @__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: t.closeButton
87
+ className: e.closeButton
89
88
  },
90
89
  /* @__PURE__ */ o.createElement(M, null)
91
- ))), /* @__PURE__ */ o.createElement("div", { className: t.content }, !e && /* @__PURE__ */ o.createElement(p, { id: "heading" }), m), /* @__PURE__ */ o.createElement(p, { id: "buttons" }))));
92
- }), _ = (l) => {
93
- const { children: r, ...e } = l;
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
- ...e,
97
+ ...l,
99
98
  component: n.DialogTrigger
100
99
  },
101
100
  r