@mittwald/flow-react-components 0.1.0-alpha.60 → 0.1.0-alpha.61
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/Avatar.js +27 -22
- package/dist/Modal.js +17 -17
- package/dist/styles.css +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +1 -0
- package/dist/types/components/Modal/Modal.d.ts +1 -1
- package/dist/types/components/Modal/stories/Default.stories.d.ts +1 -1
- package/dist/types/components/NumberField/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/StatusBadge/stories/Default.stories.d.ts +1 -0
- package/package.json +3 -3
package/dist/Avatar.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import i, { isValidElement as
|
|
3
|
+
import i, { isValidElement as v } from "react";
|
|
4
4
|
import m from "clsx";
|
|
5
|
-
import { C as
|
|
6
|
-
import { P as
|
|
7
|
-
import { u as
|
|
8
|
-
import { hash as
|
|
9
|
-
import { deepForEach as
|
|
10
|
-
const
|
|
11
|
-
avatar:
|
|
12
|
-
icon:
|
|
13
|
-
initials:
|
|
5
|
+
import { C as p } from "./ClearPropsContext-CeCMjUK9.js";
|
|
6
|
+
import { P as c } from "./PropsContextProvider-BcOGMJkn.js";
|
|
7
|
+
import { u as f } from "./useProps-BiJ72z10.js";
|
|
8
|
+
import { hash as w } from "object-code";
|
|
9
|
+
import { deepForEach as z } from "react-children-utilities";
|
|
10
|
+
const d = "flow--avatar", h = "flow--avatar--icon", u = "flow--avatar--initials", r = {
|
|
11
|
+
avatar: d,
|
|
12
|
+
icon: h,
|
|
13
|
+
initials: u,
|
|
14
14
|
"size-m": "flow--avatar--size-m",
|
|
15
15
|
"size-xs": "flow--avatar--size-xs",
|
|
16
16
|
"size-s": "flow--avatar--size-s",
|
|
@@ -19,23 +19,28 @@ const z = "flow--avatar", d = "flow--avatar--icon", h = "flow--avatar--initials"
|
|
|
19
19
|
"variant-2": "flow--avatar--variant-2",
|
|
20
20
|
"variant-3": "flow--avatar--variant-3",
|
|
21
21
|
"variant-4": "flow--avatar--variant-4"
|
|
22
|
-
},
|
|
22
|
+
}, C = (s) => {
|
|
23
23
|
const a = [];
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
z(s, (t) => {
|
|
25
|
+
v(t) ? a.push({
|
|
26
26
|
props: t.props,
|
|
27
27
|
type: t.type
|
|
28
28
|
}) : a.push(t);
|
|
29
29
|
});
|
|
30
|
-
const o =
|
|
30
|
+
const o = w(a);
|
|
31
31
|
return Math.abs(o % 4) + 1;
|
|
32
|
-
},
|
|
33
|
-
const {
|
|
32
|
+
}, A = (s) => {
|
|
33
|
+
const {
|
|
34
|
+
children: a,
|
|
35
|
+
className: o,
|
|
36
|
+
variant: t,
|
|
37
|
+
size: e = "m"
|
|
38
|
+
} = f("Avatar", s), n = m(
|
|
34
39
|
r.avatar,
|
|
35
|
-
r[`size-${
|
|
40
|
+
r[`size-${e}`],
|
|
36
41
|
o,
|
|
37
|
-
r[`variant-${
|
|
38
|
-
),
|
|
42
|
+
r[`variant-${t ?? C(a)}`]
|
|
43
|
+
), l = {
|
|
39
44
|
Initials: {
|
|
40
45
|
className: r.initials
|
|
41
46
|
},
|
|
@@ -43,9 +48,9 @@ const z = "flow--avatar", d = "flow--avatar--icon", h = "flow--avatar--initials"
|
|
|
43
48
|
className: r.icon
|
|
44
49
|
}
|
|
45
50
|
};
|
|
46
|
-
return /* @__PURE__ */ i.createElement(
|
|
51
|
+
return /* @__PURE__ */ i.createElement(p, null, /* @__PURE__ */ i.createElement("div", { className: n }, /* @__PURE__ */ i.createElement(c, { props: l }, a)));
|
|
47
52
|
};
|
|
48
53
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
A as Avatar,
|
|
55
|
+
A as default
|
|
51
56
|
};
|
package/dist/Modal.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import * as s from "react-aria-components";
|
|
4
4
|
import { DialogTrigger as q } from "react-aria-components";
|
|
5
5
|
import e, { useContext as w, useEffect as r } from "react";
|
|
6
|
-
import
|
|
6
|
+
import C from "clsx";
|
|
7
7
|
import "./propsContext-CauylOgH.js";
|
|
8
|
-
import { P as
|
|
8
|
+
import { P as y } from "./PropsContextProvider-BcOGMJkn.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
10
|
import "remeda";
|
|
11
|
-
import { TunnelProvider as
|
|
12
|
-
import { u as
|
|
13
|
-
const T = "flow--modal", N = "flow--modal--dialog", P = "flow--modal--overlay", b = "flow--modal--button-group", I = "flow--modal--content", G = "flow--modal--
|
|
11
|
+
import { TunnelProvider as E, TunnelExit as m } from "@mittwald/react-tunnel";
|
|
12
|
+
import { u as x, a as z } from "./useOverlayState-BnPe_CrX.js";
|
|
13
|
+
const T = "flow--modal", N = "flow--modal--dialog", P = "flow--modal--overlay", b = "flow--modal--button-group", I = "flow--modal--content", G = "flow--modal--off-canvas", t = {
|
|
14
14
|
modal: T,
|
|
15
15
|
"modal-zoom": "flow--modal--modal-zoom",
|
|
16
16
|
dialog: N,
|
|
@@ -21,7 +21,7 @@ const T = "flow--modal", N = "flow--modal--dialog", P = "flow--modal--overlay",
|
|
|
21
21
|
"size-s": "flow--modal--size-s",
|
|
22
22
|
"size-m": "flow--modal--size-m",
|
|
23
23
|
"size-l": "flow--modal--size-l",
|
|
24
|
-
|
|
24
|
+
offCanvas: G,
|
|
25
25
|
"modal-slide-in": "flow--modal--modal-slide-in",
|
|
26
26
|
"modal-slide-up": "flow--modal--modal-slide-up"
|
|
27
27
|
}, M = (l) => {
|
|
@@ -34,21 +34,21 @@ const T = "flow--modal", N = "flow--modal--dialog", P = "flow--modal--overlay",
|
|
|
34
34
|
}, $ = (l) => {
|
|
35
35
|
const {
|
|
36
36
|
size: o = "s",
|
|
37
|
-
|
|
37
|
+
offCanvas: a,
|
|
38
38
|
state: i,
|
|
39
39
|
defaultOpen: d,
|
|
40
40
|
children: c,
|
|
41
|
-
...
|
|
42
|
-
} = l,
|
|
41
|
+
...f
|
|
42
|
+
} = l, p = x({
|
|
43
43
|
reuseControllerFromContext: !1,
|
|
44
44
|
defaultOpen: d
|
|
45
|
-
}), n = i ??
|
|
45
|
+
}), n = i ?? p, u = n.useIsOpen();
|
|
46
46
|
M(n);
|
|
47
|
-
const
|
|
47
|
+
const v = C(
|
|
48
48
|
t.modal,
|
|
49
49
|
t[`size-${o}`],
|
|
50
|
-
a && t.
|
|
51
|
-
),
|
|
50
|
+
a && t.offCanvas
|
|
51
|
+
), g = {
|
|
52
52
|
Content: {
|
|
53
53
|
tunnelId: "content",
|
|
54
54
|
elementType: e.Fragment
|
|
@@ -66,12 +66,12 @@ const T = "flow--modal", N = "flow--modal--dialog", P = "flow--modal--overlay",
|
|
|
66
66
|
s.ModalOverlay,
|
|
67
67
|
{
|
|
68
68
|
className: t.overlay,
|
|
69
|
-
...
|
|
69
|
+
...f,
|
|
70
70
|
isDismissable: !0,
|
|
71
|
-
isOpen:
|
|
72
|
-
onOpenChange: (
|
|
71
|
+
isOpen: u,
|
|
72
|
+
onOpenChange: (O) => n.setOpen(O)
|
|
73
73
|
},
|
|
74
|
-
/* @__PURE__ */ e.createElement(s.Modal, { className:
|
|
74
|
+
/* @__PURE__ */ e.createElement(s.Modal, { className: v }, /* @__PURE__ */ e.createElement(s.Dialog, { className: t.dialog }, /* @__PURE__ */ e.createElement(z, { value: n }, /* @__PURE__ */ e.createElement(y, { props: g }, /* @__PURE__ */ e.createElement(E, null, /* @__PURE__ */ e.createElement("div", { className: t.content }, /* @__PURE__ */ e.createElement(m, { id: "title" }), /* @__PURE__ */ e.createElement(m, { id: "content" })), c)))))
|
|
75
75
|
);
|
|
76
76
|
};
|
|
77
77
|
export {
|