@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
|
|
4
|
+
import v from "clsx";
|
|
5
5
|
import "./propsContext-DzAKlmhS.js";
|
|
6
|
-
import { P as
|
|
6
|
+
import { P as y } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
7
7
|
import "@react-aria/utils";
|
|
8
8
|
import "remeda";
|
|
9
|
-
import { TunnelProvider as
|
|
10
|
-
import { f as
|
|
11
|
-
import
|
|
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
|
|
14
|
-
import { O as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
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
|
|
21
|
-
const
|
|
22
|
-
modal:
|
|
23
|
-
offCanvas:
|
|
24
|
-
header:
|
|
25
|
-
content:
|
|
26
|
-
actionGroup:
|
|
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:
|
|
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:
|
|
35
|
-
},
|
|
36
|
-
overlay:
|
|
36
|
+
closeButton: $
|
|
37
|
+
}, U = "flow--modal-overlay--overlay", _ = {
|
|
38
|
+
overlay: U,
|
|
37
39
|
"overlay-fade": "flow--modal-overlay--overlay-fade"
|
|
38
|
-
},
|
|
40
|
+
}, j = (l) => {
|
|
39
41
|
const {
|
|
40
|
-
controller:
|
|
41
|
-
children:
|
|
42
|
-
isDismissable:
|
|
43
|
-
className:
|
|
44
|
-
|
|
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
|
-
}),
|
|
47
|
-
|
|
48
|
-
|
|
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:
|
|
51
|
-
isDismissable:
|
|
52
|
-
isOpen:
|
|
53
|
-
onOpenChange: (
|
|
56
|
+
className: p,
|
|
57
|
+
isDismissable: i,
|
|
58
|
+
isOpen: n,
|
|
59
|
+
onOpenChange: (g) => a.setOpen(g)
|
|
54
60
|
},
|
|
55
|
-
/* @__PURE__ */ o.createElement(
|
|
56
|
-
);
|
|
57
|
-
},
|
|
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:
|
|
60
|
-
offCanvas:
|
|
61
|
-
controller:
|
|
62
|
-
children:
|
|
63
|
-
refProp:
|
|
64
|
-
className:
|
|
65
|
-
offCanvasOrientation:
|
|
66
|
-
...
|
|
67
|
-
} =
|
|
68
|
-
|
|
69
|
-
e[`size-${
|
|
70
|
-
e[
|
|
71
|
-
|
|
72
|
-
),
|
|
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(
|
|
87
|
-
|
|
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(
|
|
94
|
-
))),
|
|
95
|
-
}),
|
|
96
|
-
const { children:
|
|
99
|
+
/* @__PURE__ */ o.createElement(I, null)
|
|
100
|
+
))), d)));
|
|
101
|
+
}), mo = (l) => {
|
|
102
|
+
const { children: r, ...t } = l;
|
|
97
103
|
return /* @__PURE__ */ o.createElement(
|
|
98
|
-
|
|
104
|
+
x,
|
|
99
105
|
{
|
|
100
106
|
overlayType: "Modal",
|
|
101
|
-
...
|
|
102
|
-
component:
|
|
107
|
+
...t,
|
|
108
|
+
component: c.DialogTrigger
|
|
103
109
|
},
|
|
104
|
-
|
|
110
|
+
r
|
|
105
111
|
);
|
|
106
112
|
};
|
|
107
113
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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": "
|
|
421
|
+
"gitHead": "a0c7af734768c4d7d241c61de37de45d39d53199"
|
|
421
422
|
}
|