@mittwald/flow-react-components 0.1.0-alpha.242 → 0.1.0-alpha.243

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,55 +1,61 @@
1
1
  "use client"
2
2
  /* */
3
- import s, { isValidElement as v } from "react";
4
- import p from "clsx";
5
- import { C as f } from "./ClearPropsContext-CUvsbMn8.js";
6
- import { P as c } from "./PropsContextProvider-C6Z4XGp6.js";
3
+ import l, { isValidElement as p } from "react";
4
+ import f from "clsx";
5
+ import { C as v } from "./ClearPropsContext-CUvsbMn8.js";
6
+ import { P as w } from "./PropsContextProvider-C6Z4XGp6.js";
7
7
  import "@react-aria/utils";
8
8
  import "./propsContext-DzAKlmhS.js";
9
9
  import "remeda";
10
- import { hash as w } from "object-code";
11
- import { deepForEach as z } from "react-children-utilities";
12
- import { f as d } from "./flowComponent-DT1Ap-ot.js";
13
- const C = "flow--avatar", h = "flow--avatar--icon", x = "flow--avatar--initials", r = {
14
- avatar: C,
10
+ import { hash as u } from "object-code";
11
+ import { deepForEach as C } from "react-children-utilities";
12
+ import { f as z } from "./flowComponent-DT1Ap-ot.js";
13
+ const d = "flow--avatar", h = "flow--avatar--icon", b = "flow--avatar--initials", g = "flow--avatar--blue", x = "flow--avatar--teal", E = "flow--avatar--green", N = "flow--avatar--violet", P = "flow--avatar--lilac", o = {
14
+ avatar: d,
15
15
  icon: h,
16
- initials: x,
16
+ initials: b,
17
17
  "size-m": "flow--avatar--size-m",
18
18
  "size-xs": "flow--avatar--size-xs",
19
19
  "size-s": "flow--avatar--size-s",
20
20
  "size-l": "flow--avatar--size-l",
21
- "variant-1": "flow--avatar--variant-1",
22
- "variant-2": "flow--avatar--variant-2",
23
- "variant-3": "flow--avatar--variant-3",
24
- "variant-4": "flow--avatar--variant-4",
25
- "variant-5": "flow--avatar--variant-5"
26
- }, u = (o) => {
21
+ blue: g,
22
+ teal: x,
23
+ green: E,
24
+ violet: N,
25
+ lilac: P
26
+ }, y = (e) => {
27
27
  const a = [];
28
- z(o, (t) => {
29
- v(t) ? a.push({
28
+ C(e, (t) => {
29
+ p(t) ? a.push({
30
30
  props: t.props,
31
31
  type: t.type
32
32
  }) : a.push(t);
33
33
  });
34
- const i = w(a);
35
- return Math.abs(i % 4) + 1;
36
- }, $ = d("Avatar", (o) => {
37
- const { children: a, className: i, variant: t, size: e = "m", refProp: n } = o, l = p(
38
- r.avatar,
39
- r[`size-${e}`],
40
- i,
41
- r[`variant-${t ?? u(a)}`]
34
+ const r = u(a), s = Math.abs(r % (i.length - 1));
35
+ return i[s];
36
+ }, i = [
37
+ "blue",
38
+ "teal",
39
+ "green",
40
+ "violet",
41
+ "lilac"
42
+ ], q = z("Avatar", (e) => {
43
+ const { children: a, className: r, color: s, size: t = "m", refProp: n } = e, c = f(
44
+ o.avatar,
45
+ o[`size-${t}`],
46
+ r,
47
+ o[s ?? y(a)]
42
48
  ), m = {
43
49
  Initials: {
44
- className: r.initials
50
+ className: o.initials
45
51
  },
46
52
  Icon: {
47
- className: r.icon
53
+ className: o.icon
48
54
  }
49
55
  };
50
- return /* @__PURE__ */ s.createElement(f, null, /* @__PURE__ */ s.createElement("div", { className: l, ref: n }, /* @__PURE__ */ s.createElement(c, { props: m }, a)));
56
+ return /* @__PURE__ */ l.createElement(v, null, /* @__PURE__ */ l.createElement("div", { className: c, ref: n }, /* @__PURE__ */ l.createElement(w, { props: m }, a)));
51
57
  });
52
58
  export {
53
- $ as Avatar,
54
- $ as default
59
+ q as Avatar,
60
+ q as default
55
61
  };