@mittwald/flow-react-components 0.1.0-alpha.276 → 0.1.0-alpha.277

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,75 +1,81 @@
1
1
  "use client"
2
2
  /* */
3
3
  import o from "react";
4
- import p from "clsx";
4
+ import v from "clsx";
5
5
  import "./propsContext-DzAKlmhS.js";
6
- import { P as v } from "./PropsContextProvider-C6Z4XGp6.js";
6
+ import { P as y } from "./PropsContextProvider-C6Z4XGp6.js";
7
7
  import "@react-aria/utils";
8
8
  import "remeda";
9
- import { TunnelProvider as g, TunnelExit as y } from "@mittwald/react-tunnel";
10
- import { f as C } from "./flowComponent-Cnrr91a8.js";
11
- import * as n from "react-aria-components";
9
+ import { TunnelProvider as C, TunnelExit as E } from "@mittwald/react-tunnel";
10
+ import { f as w } from "./flowComponent-Cnrr91a8.js";
11
+ import { createHtmlPortalNode as h, InPortal as N, OutPortal as O } from "react-reverse-portal";
12
+ import * as c from "react-aria-components";
12
13
  import "mobx";
13
- import { u as w } from "./useOverlayController-D8pgx8nV.js";
14
- import { O as E, a as h } from "./OverlayTrigger-bD8_mPel.js";
15
- import { H as O } from "./Header-Dyx52LYx.js";
16
- import { A as M } from "./Action-BkFTzx0k.js";
17
- import { B as N } from "./Button-DtpO7pbw.js";
14
+ import { u as M } from "./useOverlayController-D8pgx8nV.js";
15
+ import { O as P, a as x } from "./OverlayTrigger-bD8_mPel.js";
16
+ import { A as z } from "./Activity-CmfZpgOM.js";
17
+ import { H as A } from "./Header-Dyx52LYx.js";
18
+ import { A as T } from "./Action-BkFTzx0k.js";
19
+ import { B } from "./Button-DtpO7pbw.js";
18
20
  import "@tabler/icons-react";
19
21
  import "./Icon-9pbeBcg1.js";
20
- import { I as x } from "./IconClose-Cv0NnMI0.js";
21
- const z = "flow--modal", P = "flow--modal--off-canvas", T = "flow--modal--header", B = "flow--modal--content", A = "flow--modal--action-group", G = "flow--modal--left", I = "flow--modal--close-button", e = {
22
- modal: z,
23
- offCanvas: P,
24
- header: T,
25
- content: B,
26
- actionGroup: A,
22
+ import { I } from "./IconClose-Cv0NnMI0.js";
23
+ const F = "flow--modal", G = "flow--modal--off-canvas", H = "flow--modal--header", D = "flow--modal--content", b = "flow--modal--action-group", R = "flow--modal--left", $ = "flow--modal--close-button", e = {
24
+ modal: F,
25
+ offCanvas: G,
26
+ header: H,
27
+ content: D,
28
+ actionGroup: b,
27
29
  "size-s": "flow--modal--size-s",
28
30
  "size-m": "flow--modal--size-m",
29
31
  "modal-zoom": "flow--modal--modal-zoom",
30
32
  "modal-slide-in-from-right": "flow--modal--modal-slide-in-from-right",
31
- left: G,
33
+ left: R,
32
34
  "modal-slide-in-from-left": "flow--modal--modal-slide-in-from-left",
33
35
  "modal-slide-up": "flow--modal--modal-slide-up",
34
- closeButton: I
35
- }, D = "flow--modal-overlay--overlay", F = {
36
- overlay: D,
36
+ closeButton: $
37
+ }, U = "flow--modal-overlay--overlay", _ = {
38
+ overlay: U,
37
39
  "overlay-fade": "flow--modal-overlay--overlay-fade"
38
- }, H = (t) => {
40
+ }, j = (l) => {
39
41
  const {
40
- controller: a,
41
- children: l,
42
- isDismissable: s = !0,
43
- className: m
44
- } = t, f = w("Modal", {
42
+ controller: r,
43
+ children: t,
44
+ isDismissable: i = !0,
45
+ className: d,
46
+ _experimentalNoUnmountContent: u = !1
47
+ } = l, f = M("Modal", {
45
48
  reuseControllerFromContext: !0
46
- }), r = a ?? f, c = r.useIsOpen(), i = p(F.overlay, m);
47
- return /* @__PURE__ */ o.createElement(
48
- n.ModalOverlay,
49
+ }), a = r ?? f, n = a.useIsOpen(), p = v(_.overlay, d), s = /* @__PURE__ */ o.createElement(c.Dialog, null, /* @__PURE__ */ o.createElement(P, { type: "Modal", controller: a }, t)), m = o.useMemo(
50
+ () => u ? h() : null,
51
+ []
52
+ );
53
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, m && /* @__PURE__ */ o.createElement(N, { node: m }, /* @__PURE__ */ o.createElement(z, { isActive: n }, s)), /* @__PURE__ */ o.createElement(
54
+ c.ModalOverlay,
49
55
  {
50
- className: i,
51
- isDismissable: s,
52
- isOpen: c,
53
- onOpenChange: (d) => r.setOpen(d)
56
+ className: p,
57
+ isDismissable: i,
58
+ isOpen: n,
59
+ onOpenChange: (g) => a.setOpen(g)
54
60
  },
55
- /* @__PURE__ */ o.createElement(n.Modal, null, /* @__PURE__ */ o.createElement(n.Dialog, null, /* @__PURE__ */ o.createElement(E, { type: "Modal", controller: r }, l)))
56
- );
57
- }, _ = C("Modal", (t) => {
61
+ /* @__PURE__ */ o.createElement(c.Modal, null, m ? /* @__PURE__ */ o.createElement(O, { node: m }) : s)
62
+ ));
63
+ }, so = w("Modal", (l) => {
58
64
  const {
59
- size: a = "s",
60
- offCanvas: l,
61
- controller: s,
62
- children: m,
63
- refProp: f,
64
- className: r,
65
- offCanvasOrientation: c = "right",
66
- ...i
67
- } = t, d = p(
68
- l ? e.offCanvas : e.modal,
69
- e[`size-${a}`],
70
- e[c],
71
- r
72
- ), u = {
65
+ size: r = "s",
66
+ offCanvas: t,
67
+ controller: i,
68
+ children: d,
69
+ refProp: u,
70
+ className: f,
71
+ offCanvasOrientation: a = "right",
72
+ ...n
73
+ } = l, p = v(
74
+ t ? e.offCanvas : e.modal,
75
+ e[`size-${r}`],
76
+ e[a],
77
+ f
78
+ ), s = {
73
79
  Content: {
74
80
  className: e.content
75
81
  },
@@ -83,29 +89,29 @@ const z = "flow--modal", P = "flow--modal--off-canvas", T = "flow--modal--header
83
89
  spacing: "m"
84
90
  }
85
91
  };
86
- return /* @__PURE__ */ o.createElement(H, { className: d, controller: s, ...i }, /* @__PURE__ */ o.createElement(v, { props: u }, /* @__PURE__ */ o.createElement(g, null, /* @__PURE__ */ o.createElement(O, { className: e.header }, /* @__PURE__ */ o.createElement(y, { id: "heading" }), l && /* @__PURE__ */ o.createElement(M, { closeOverlay: "Modal" }, /* @__PURE__ */ o.createElement(
87
- N,
92
+ return /* @__PURE__ */ o.createElement(j, { className: p, controller: i, ...n }, /* @__PURE__ */ o.createElement(y, { props: s }, /* @__PURE__ */ o.createElement(C, null, /* @__PURE__ */ o.createElement(A, { className: e.header }, /* @__PURE__ */ o.createElement(E, { id: "heading" }), t && /* @__PURE__ */ o.createElement(T, { closeOverlay: "Modal" }, /* @__PURE__ */ o.createElement(
93
+ B,
88
94
  {
89
95
  variant: "plain",
90
96
  color: "secondary",
91
97
  className: e.closeButton
92
98
  },
93
- /* @__PURE__ */ o.createElement(x, null)
94
- ))), m)));
95
- }), oo = (t) => {
96
- const { children: a, ...l } = t;
99
+ /* @__PURE__ */ o.createElement(I, null)
100
+ ))), d)));
101
+ }), mo = (l) => {
102
+ const { children: r, ...t } = l;
97
103
  return /* @__PURE__ */ o.createElement(
98
- h,
104
+ x,
99
105
  {
100
106
  overlayType: "Modal",
101
- ...l,
102
- component: n.DialogTrigger
107
+ ...t,
108
+ component: c.DialogTrigger
103
109
  },
104
- a
110
+ r
105
111
  );
106
112
  };
107
113
  export {
108
- _ as Modal,
109
- oo as ModalTrigger,
110
- _ as default
114
+ so as Modal,
115
+ mo as ModalTrigger,
116
+ so as default
111
117
  };
@@ -10,6 +10,7 @@ export interface ModalProps extends PropsWithChildren, FlowComponentProps, Props
10
10
  controller?: OverlayController;
11
11
  slot?: string;
12
12
  isDismissable?: boolean;
13
+ _experimentalNoUnmountContent?: boolean;
13
14
  }
14
15
  export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<never>>;
15
16
  export default Modal;
@@ -4,6 +4,7 @@ export interface ModalOverlayProps extends PropsWithChildren {
4
4
  controller?: OverlayController;
5
5
  isDismissable?: boolean;
6
6
  className?: string;
7
+ _experimentalNoUnmountContent?: boolean;
7
8
  }
8
9
  export declare const ModalOverlay: FC<ModalOverlayProps>;
9
10
  export default ModalOverlay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.276",
3
+ "version": "0.1.0-alpha.277",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -313,7 +313,7 @@
313
313
  "@chakra-ui/live-region": "^2.1.0",
314
314
  "@internationalized/date": "^3.5.6",
315
315
  "@internationalized/string-compiler": "^3.2.5",
316
- "@mittwald/react-tunnel": "^0.1.0-alpha.276",
316
+ "@mittwald/react-tunnel": "^0.1.0-alpha.277",
317
317
  "@mittwald/react-use-promise": "^2.5.0",
318
318
  "@react-aria/utils": "^3.25.3",
319
319
  "@react-types/shared": "^3.25.0",
@@ -333,6 +333,7 @@
333
333
  "react-aria": "^3.35.0",
334
334
  "react-aria-components": "^1.4.0",
335
335
  "react-children-utilities": "^2.10.0",
336
+ "react-reverse-portal": "^2.1.2",
336
337
  "react-stately": "^3.33.0",
337
338
  "remeda": "^2.15.0",
338
339
  "use-callback-ref": "^1.3.2",
@@ -340,7 +341,7 @@
340
341
  },
341
342
  "devDependencies": {
342
343
  "@faker-js/faker": "^9.0.3",
343
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.276",
344
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.277",
344
345
  "@mittwald/react-use-promise": "^2.5.0",
345
346
  "@nx/storybook": "^20.0.0",
346
347
  "@storybook/addon-a11y": "^8.3.5",
@@ -417,5 +418,5 @@
417
418
  "optional": true
418
419
  }
419
420
  },
420
- "gitHead": "9d75f275ef19a886f696af21cb19b59e7006a87b"
421
+ "gitHead": "a0c7af734768c4d7d241c61de37de45d39d53199"
421
422
  }