@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 CHANGED
@@ -1,16 +1,16 @@
1
1
  "use client"
2
2
  /* */
3
- import i, { isValidElement as l } from "react";
3
+ import i, { isValidElement as v } from "react";
4
4
  import m from "clsx";
5
- import { C as v } from "./ClearPropsContext-CeCMjUK9.js";
6
- import { P as p } from "./PropsContextProvider-BcOGMJkn.js";
7
- import { u as c } from "./useProps-BiJ72z10.js";
8
- import { hash as f } from "object-code";
9
- import { deepForEach as w } from "react-children-utilities";
10
- const z = "flow--avatar", d = "flow--avatar--icon", h = "flow--avatar--initials", r = {
11
- avatar: z,
12
- icon: d,
13
- initials: h,
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
- }, u = (s) => {
22
+ }, C = (s) => {
23
23
  const a = [];
24
- w(s, (t) => {
25
- l(t) ? a.push({
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 = f(a);
30
+ const o = w(a);
31
31
  return Math.abs(o % 4) + 1;
32
- }, g = (s) => {
33
- const { children: a, className: o, size: t = "m" } = c("Avatar", s), e = m(
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-${t}`],
40
+ r[`size-${e}`],
36
41
  o,
37
- r[`variant-${u(a)}`]
38
- ), n = {
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(v, null, /* @__PURE__ */ i.createElement("div", { className: e }, /* @__PURE__ */ i.createElement(p, { props: n }, a)));
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
- g as Avatar,
50
- g as default
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 y from "clsx";
6
+ import C from "clsx";
7
7
  import "./propsContext-CauylOgH.js";
8
- import { P as E } from "./PropsContextProvider-BcOGMJkn.js";
8
+ import { P as y } from "./PropsContextProvider-BcOGMJkn.js";
9
9
  import "@react-aria/utils";
10
10
  import "remeda";
11
- import { TunnelProvider as x, TunnelExit as m } from "@mittwald/react-tunnel";
12
- import { u as z, a as C } 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--panel", t = {
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
- panel: G,
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
- panel: a,
37
+ offCanvas: a,
38
38
  state: i,
39
39
  defaultOpen: d,
40
40
  children: c,
41
- ...p
42
- } = l, u = z({
41
+ ...f
42
+ } = l, p = x({
43
43
  reuseControllerFromContext: !1,
44
44
  defaultOpen: d
45
- }), n = i ?? u, f = n.useIsOpen();
45
+ }), n = i ?? p, u = n.useIsOpen();
46
46
  M(n);
47
- const g = y(
47
+ const v = C(
48
48
  t.modal,
49
49
  t[`size-${o}`],
50
- a && t.panel
51
- ), O = {
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
- ...p,
69
+ ...f,
70
70
  isDismissable: !0,
71
- isOpen: f,
72
- onOpenChange: (v) => n.setOpen(v)
71
+ isOpen: u,
72
+ onOpenChange: (O) => n.setOpen(O)
73
73
  },
74
- /* @__PURE__ */ e.createElement(s.Modal, { className: g }, /* @__PURE__ */ e.createElement(s.Dialog, { className: t.dialog }, /* @__PURE__ */ e.createElement(C, { value: n }, /* @__PURE__ */ e.createElement(E, { props: O }, /* @__PURE__ */ e.createElement(x, null, /* @__PURE__ */ e.createElement("div", { className: t.content }, /* @__PURE__ */ e.createElement(m, { id: "title" }), /* @__PURE__ */ e.createElement(m, { id: "content" })), c)))))
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 {