@mittwald/flow-react-components 0.1.0-alpha.400 → 0.1.0-alpha.402

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.
@@ -0,0 +1,59 @@
1
+ "use client"
2
+ /* */
3
+ import e from "react";
4
+ import * as I from "react-aria-components";
5
+ import i from "clsx";
6
+ import "./propsContext-DzAKlmhS.js";
7
+ import { PropsContextProvider as p } from "./PropsContextProvider.js";
8
+ import "@react-aria/utils";
9
+ import "remeda";
10
+ import "@tabler/icons-react";
11
+ import "./Icon--OEo4TjW.js";
12
+ import { I as f, a as w } from "./IconCheckboxEmpty-CZrD3f3O.js";
13
+ import { I as h, a as E } from "./IconRadioOn-D7w6KLWm.js";
14
+ import { S as u } from "./Switch-BhDMHWjv.js";
15
+ import { f as d } from "./flowComponent-BQs9wMX_.js";
16
+ const x = "flow--menu-item", C = "flow--menu-item--icon", N = "flow--menu-item--control-icon", v = "flow--menu-item--avatar", t = {
17
+ menuItem: x,
18
+ switch: "flow--menu-item--switch",
19
+ icon: C,
20
+ controlIcon: N,
21
+ avatar: v
22
+ }, M = (r) => {
23
+ const {
24
+ selectionMode: n,
25
+ isSelected: o,
26
+ selectionVariant: c = "control",
27
+ children: a
28
+ } = r, m = {
29
+ Icon: {
30
+ className: t.icon
31
+ },
32
+ Text: {
33
+ className: t.text
34
+ },
35
+ Avatar: {
36
+ className: t.avatar
37
+ }
38
+ }, s = {
39
+ Icon: {
40
+ className: i(t.controlIcon, t.icon)
41
+ },
42
+ Switch: {
43
+ className: i(t.controlIcon, t.switch)
44
+ }
45
+ }, l = n === "none" || c === "navigation" ? null : c === "switch" && o ? /* @__PURE__ */ e.createElement(u, { isReadOnly: !0, isSelected: !0 }) : c === "switch" && !o ? /* @__PURE__ */ e.createElement(u, { isReadOnly: !0 }) : n === "single" && o ? /* @__PURE__ */ e.createElement(h, null) : n === "single" && !o ? /* @__PURE__ */ e.createElement(E, null) : n === "multiple" && o ? /* @__PURE__ */ e.createElement(f, null) : /* @__PURE__ */ e.createElement(w, null);
46
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(p, { props: s }, l), /* @__PURE__ */ e.createElement(p, { props: m }, a));
47
+ }, j = d("MenuItem", (r) => {
48
+ const {
49
+ children: n,
50
+ className: o,
51
+ selectionVariant: c,
52
+ refProp: a,
53
+ ...m
54
+ } = r, s = i(t.menuItem, o);
55
+ return /* @__PURE__ */ e.createElement(I.MenuItem, { ...m, className: s, ref: a }, (l) => /* @__PURE__ */ e.createElement(M, { ...l, selectionVariant: c }, n));
56
+ });
57
+ export {
58
+ j as M
59
+ };
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
- import { M as t } from "./MenuItem-D5BsewlU.js";
3
+ import { M as t } from "./MenuItem-B6P8yo9s.js";
4
4
  export {
5
5
  t as MenuItem,
6
6
  t as default
@@ -2,69 +2,67 @@
2
2
  /* */
3
3
  import e, { useId as d } from "react";
4
4
  import v from "clsx";
5
- import { W as f } from "./Wrap-DGT1h1o3.js";
6
5
  import "./propsContext-DzAKlmhS.js";
7
- import { PropsContextProvider as i } from "./PropsContextProvider.js";
6
+ import { PropsContextProvider as l } from "./PropsContextProvider.js";
8
7
  import "@react-aria/utils";
9
8
  import "remeda";
10
- import { d as E } from "./deepHas-KHS5X1F_.js";
11
- import { TunnelProvider as g, TunnelExit as p } from "@mittwald/react-tunnel";
12
- import { A as x } from "./Accordion-Btnh1ek-.js";
13
- import { C as b } from "./Content-BHs6Idqq.js";
14
- const w = "flow--navigation", N = "flow--navigation--item", C = "flow--navigation--icon", I = "flow--navigation--text", P = "flow--navigation--control-icon", h = "flow--navigation--avatar", r = {
15
- navigation: w,
16
- item: N,
9
+ import { TunnelExit as r, TunnelProvider as g } from "@mittwald/react-tunnel";
10
+ import { A as E } from "./Accordion-Btnh1ek-.js";
11
+ import { C as f } from "./Content-BHs6Idqq.js";
12
+ const x = "flow--navigation", b = "flow--navigation--item", N = "flow--navigation--icon", w = "flow--navigation--control-icon", C = "flow--navigation--avatar", o = {
13
+ navigation: x,
14
+ item: b,
17
15
  switch: "flow--navigation--switch",
18
- icon: C,
19
- text: I,
20
- controlIcon: P,
21
- avatar: h
22
- }, F = (s) => {
23
- const { className: t, children: n, ...a } = s, c = v(r.navigation, t), o = E(n, L), l = {
16
+ icon: N,
17
+ controlIcon: w,
18
+ avatar: C
19
+ }, j = (i) => {
20
+ const { className: t, children: s, ...n } = i, c = v(o.navigation, t), a = {
24
21
  Link: {
25
22
  wrapWith: /* @__PURE__ */ e.createElement("li", null),
26
- className: r.item,
23
+ className: o.item,
27
24
  unstyled: !0,
28
25
  Text: {
29
- className: r.text
26
+ className: o.text
30
27
  },
31
28
  Icon: {
32
- className: r.icon
33
- }
29
+ className: o.icon
30
+ },
31
+ tunnelId: "links"
34
32
  }
35
33
  };
36
- return /* @__PURE__ */ e.createElement("nav", { className: c, role: "navigation", ...a }, /* @__PURE__ */ e.createElement(i, { props: l, mergeInParentContext: !0 }, /* @__PURE__ */ e.createElement(f, { if: !o }, /* @__PURE__ */ e.createElement("ul", null, n))));
37
- }, k = "flow--navigation--navigation-group", G = "flow--navigation--navigation-group--collapsable", y = "flow--navigation--navigation-group--label", u = {
38
- navigationGroup: k,
39
- collapsable: G,
40
- label: y
41
- }, L = (s) => {
42
- const { children: t, className: n, collapsable: a, ...c } = s, o = v(
43
- u.navigationGroup,
44
- a && u.collapsable,
45
- n
46
- ), l = d(), m = {
34
+ return /* @__PURE__ */ e.createElement("nav", { className: c, role: "navigation", ...n }, /* @__PURE__ */ e.createElement(l, { props: a, mergeInParentContext: !0 }, /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(r, { id: "links" })), s));
35
+ }, I = "flow--navigation--navigation-group", P = "flow--navigation--navigation-group--collapsable", k = "flow--navigation--navigation-group--label", p = {
36
+ navigationGroup: I,
37
+ collapsable: P,
38
+ label: k
39
+ }, q = (i) => {
40
+ const { children: t, className: s, collapsable: n, ...c } = i, a = v(
41
+ p.navigationGroup,
42
+ n && p.collapsable,
43
+ s
44
+ ), u = d(), m = {
47
45
  Label: {
48
- id: l,
49
- className: u.label,
46
+ id: u,
47
+ className: p.label,
50
48
  "aria-hidden": !0
51
49
  },
52
50
  Link: {
53
- tunnelId: "links"
51
+ tunnelId: "groupLinks"
54
52
  }
55
53
  };
56
- return a ? /* @__PURE__ */ e.createElement(i, { mergeInParentContext: !0, props: m }, /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(x, { defaultExpanded: !0, className: o }, t, /* @__PURE__ */ e.createElement(b, { clearPropsContext: !1 }, /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(p, { id: "links" })))))) : /* @__PURE__ */ e.createElement(i, { mergeInParentContext: !0, props: m }, /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(
54
+ return n ? /* @__PURE__ */ e.createElement(l, { mergeInParentContext: !0, props: m }, /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(E, { defaultExpanded: !0, className: a }, t, /* @__PURE__ */ e.createElement(f, { clearPropsContext: !1 }, /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(r, { id: "groupLinks" })))))) : /* @__PURE__ */ e.createElement(l, { mergeInParentContext: !0, props: m }, /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(
57
55
  "section",
58
56
  {
59
- "aria-labelledby": l,
60
- className: o,
57
+ "aria-labelledby": u,
58
+ className: a,
61
59
  ...c
62
60
  },
63
- /* @__PURE__ */ e.createElement(i, { mergeInParentContext: !0, props: m }, t, /* @__PURE__ */ e.createElement(p, { id: "Label" }), /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(p, { id: "links" })))
61
+ /* @__PURE__ */ e.createElement(l, { mergeInParentContext: !0, props: m }, t, /* @__PURE__ */ e.createElement(r, { id: "Label" }), /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(r, { id: "groupLinks" })))
64
62
  )));
65
63
  };
66
64
  export {
67
- F as Navigation,
68
- L as NavigationGroup,
69
- F as default
65
+ j as Navigation,
66
+ q as NavigationGroup,
67
+ j as default
70
68
  };
@@ -1,45 +1,30 @@
1
1
  "use client"
2
2
  /* */
3
3
  import o from "react";
4
- import * as N from "react-aria-components";
4
+ import * as E from "react-aria-components";
5
5
  import u from "clsx";
6
6
  import "./propsContext-DzAKlmhS.js";
7
- import { PropsContextProvider as C } from "./PropsContextProvider.js";
7
+ import { PropsContextProvider as N } from "./PropsContextProvider.js";
8
8
  import "@react-aria/utils";
9
9
  import "remeda";
10
- import { F } from "./FieldError-B_3nLHFz.js";
11
- import { C as G } from "./ColumnLayout-BhsG7J-Z.js";
12
- import { TunnelProvider as I, TunnelExit as c } from "@mittwald/react-tunnel";
10
+ import { F as g } from "./FieldError-B_3nLHFz.js";
11
+ import { C as B } from "./ColumnLayout-BhsG7J-Z.js";
12
+ import { TunnelProvider as F, TunnelExit as c } from "@mittwald/react-tunnel";
13
13
  import { f as l } from "./FormField.module-CqWpTQKP.js";
14
- import { C as R } from "./ClearPropsContext-CUvsbMn8.js";
14
+ import { f } from "./flowComponent-BQs9wMX_.js";
15
15
  import "@tabler/icons-react";
16
16
  import "./Icon--OEo4TjW.js";
17
- import { I as P, a as w } from "./IconRadioOn-D7w6KLWm.js";
18
- import { f } from "./flowComponent-BQs9wMX_.js";
17
+ import { I as G, a as I } from "./IconRadioOn-D7w6KLWm.js";
18
+ import { C } from "./ClearPropsContext-CUvsbMn8.js";
19
19
  import "dot-prop";
20
- import { d as B } from "./deepHas-KHS5X1F_.js";
21
- const y = "flow--radio-group", m = {
22
- radioGroup: y
23
- }, h = "flow--radio-group--radio-button", D = "flow--radio-group--radio-button--content", v = "flow--radio-group--radio-button--label", d = {
24
- radioButton: h,
25
- content: D,
26
- label: v
27
- }, T = f("RadioButton", (r) => {
28
- const { children: e, className: t, refProp: a, ...n } = r, s = u(d.radioButton, t), i = {
29
- Text: {
30
- className: d.label
31
- },
32
- Content: {
33
- className: d.content
34
- }
35
- };
36
- return /* @__PURE__ */ o.createElement(R, null, /* @__PURE__ */ o.createElement($, { ...n, className: s, ref: a }, /* @__PURE__ */ o.createElement(C, { props: i }, e)));
37
- }), _ = f("RadioGroup", (r) => {
38
- const { children: e, className: t, s: a, m: n, l: s, refProp: i, ...b } = r, x = u(
20
+ const P = "flow--radio-group", m = {
21
+ radioGroup: P
22
+ }, W = f("RadioGroup", (e) => {
23
+ const { children: r, className: t, s: a, m: n, l: i, refProp: s, ...R } = e, b = u(
39
24
  l.formField,
40
25
  m.radioGroupContainer,
41
26
  t
42
- ), g = {
27
+ ), x = {
43
28
  Label: {
44
29
  className: l.label
45
30
  },
@@ -52,35 +37,49 @@ const y = "flow--radio-group", m = {
52
37
  tunnelId: "fieldError"
53
38
  },
54
39
  RadioButton: {
55
- tunnelId: "radios"
40
+ tunnelId: "radioButtons"
56
41
  },
57
42
  Radio: {
58
43
  tunnelId: "radios"
59
44
  }
60
- }, E = B(e, T);
61
- return /* @__PURE__ */ o.createElement(N.RadioGroup, { ...b, className: x, ref: i }, /* @__PURE__ */ o.createElement(I, null, /* @__PURE__ */ o.createElement(
62
- C,
45
+ };
46
+ return /* @__PURE__ */ o.createElement(E.RadioGroup, { ...R, className: b, ref: s }, /* @__PURE__ */ o.createElement(F, null, /* @__PURE__ */ o.createElement(
47
+ N,
63
48
  {
64
49
  dependencies: ["radio"],
65
- props: g,
50
+ props: x,
66
51
  mergeInParentContext: !0
67
52
  },
68
- e,
69
- E && /* @__PURE__ */ o.createElement(G, { s: a, m: n, l: s, className: m.radioGroup }, /* @__PURE__ */ o.createElement(c, { id: "radios" })),
70
- !E && /* @__PURE__ */ o.createElement("div", { className: m.radioGroup }, /* @__PURE__ */ o.createElement(c, { id: "radios" })),
53
+ r,
54
+ /* @__PURE__ */ o.createElement(B, { s: a, m: n, l: i, className: m.radioGroup }, /* @__PURE__ */ o.createElement(c, { id: "radioButtons" })),
55
+ /* @__PURE__ */ o.createElement("div", { className: m.radioGroup }, /* @__PURE__ */ o.createElement(c, { id: "radios" })),
71
56
  /* @__PURE__ */ o.createElement(c, { id: "fieldDescription" }),
72
57
  /* @__PURE__ */ o.createElement(c, { id: "fieldError" })
73
- )), /* @__PURE__ */ o.createElement(F, { className: l.fieldError }));
74
- }), L = "flow--radio-group--radio", O = "flow--radio-group--radio--icon", p = {
75
- radio: L,
76
- icon: O
77
- }, $ = f("Radio", (r) => {
78
- const { children: e, className: t, refProp: a, ...n } = r, s = u(p.radio, t);
79
- return /* @__PURE__ */ o.createElement(R, null, /* @__PURE__ */ o.createElement(N.Radio, { ...n, className: s, ref: a }, ({ isSelected: i }) => /* @__PURE__ */ o.createElement(o.Fragment, null, i ? /* @__PURE__ */ o.createElement(P, { className: p.icon }) : /* @__PURE__ */ o.createElement(w, { className: p.icon }), e)));
58
+ )), /* @__PURE__ */ o.createElement(g, { className: l.fieldError }));
59
+ }), w = "flow--radio-group--radio", y = "flow--radio-group--radio--icon", d = {
60
+ radio: w,
61
+ icon: y
62
+ }, D = f("Radio", (e) => {
63
+ const { children: r, className: t, refProp: a, ...n } = e, i = u(d.radio, t);
64
+ return /* @__PURE__ */ o.createElement(C, null, /* @__PURE__ */ o.createElement(E.Radio, { ...n, className: i, ref: a }, ({ isSelected: s }) => /* @__PURE__ */ o.createElement(o.Fragment, null, s ? /* @__PURE__ */ o.createElement(G, { className: d.icon }) : /* @__PURE__ */ o.createElement(I, { className: d.icon }), r)));
65
+ }), h = "flow--radio-group--radio-button", v = "flow--radio-group--radio-button--content", T = "flow--radio-group--radio-button--label", p = {
66
+ radioButton: h,
67
+ content: v,
68
+ label: T
69
+ }, X = f("RadioButton", (e) => {
70
+ const { children: r, className: t, refProp: a, ...n } = e, i = u(p.radioButton, t), s = {
71
+ Text: {
72
+ className: p.label
73
+ },
74
+ Content: {
75
+ className: p.content
76
+ }
77
+ };
78
+ return /* @__PURE__ */ o.createElement(C, null, /* @__PURE__ */ o.createElement(D, { ...n, className: i, ref: a }, /* @__PURE__ */ o.createElement(N, { props: s }, r)));
80
79
  });
81
80
  export {
82
- $ as Radio,
83
- T as RadioButton,
84
- _ as RadioGroup,
85
- _ as default
81
+ D as Radio,
82
+ X as RadioButton,
83
+ W as RadioGroup,
84
+ W as default
86
85
  };
package/dist/js/Select.js CHANGED
@@ -28,7 +28,7 @@ const f = "flow--select", D = "flow--select--toggle", M = {
28
28
  }, U = (e) => {
29
29
  const { className: i, children: r, ...t } = e, o = m(C.options, i), s = p("Select");
30
30
  return /* @__PURE__ */ n.createElement(L, { className: C.popover, controller: s }, /* @__PURE__ */ n.createElement(u.ListBox, { className: o, ...t }, r));
31
- }, Me = S("Select", (e) => {
31
+ }, Se = S("Select", (e) => {
32
32
  const {
33
33
  children: i,
34
34
  className: r,
@@ -74,15 +74,14 @@ const f = "flow--select", D = "flow--select--toggle", M = {
74
74
  },
75
75
  /* @__PURE__ */ n.createElement(k, { type: "Select", controller: d }, /* @__PURE__ */ n.createElement(P, { props: A }, /* @__PURE__ */ n.createElement(F, null, /* @__PURE__ */ n.createElement(u.Button, { className: M.toggle }, /* @__PURE__ */ n.createElement(u.SelectValue, null), /* @__PURE__ */ n.createElement(b, null)), i, /* @__PURE__ */ n.createElement(U, null, /* @__PURE__ */ n.createElement(R, { id: "options" })), /* @__PURE__ */ n.createElement(K, { className: a.fieldError }))))
76
76
  );
77
- }), V = "flow--select--option", w = "flow--select--option--icon", v = "flow--select--option--text", J = "flow--select--option--control-icon", Z = "flow--select--option--avatar", W = {
77
+ }), V = "flow--select--option", w = "flow--select--option--icon", v = "flow--select--option--control-icon", J = "flow--select--option--avatar", Z = {
78
78
  option: V,
79
79
  switch: "flow--select--option--switch",
80
80
  icon: w,
81
- text: v,
82
- controlIcon: J,
83
- avatar: Z
84
- }, z = S("Option", (e) => {
85
- const { className: i, children: r, value: t, refProp: o, ...s } = e, l = m(W.option, i);
81
+ controlIcon: v,
82
+ avatar: J
83
+ }, W = S("Option", (e) => {
84
+ const { className: i, children: r, value: t, refProp: o, ...s } = e, l = m(Z.option, i);
86
85
  return /* @__PURE__ */ n.createElement(u.ListBoxItem, { className: l, ref: o, ...s, id: t }, r);
87
86
  }), B = { "de-DE": {
88
87
  "countries.AD": "Andorra",
@@ -586,26 +585,26 @@ const f = "flow--select", D = "flow--select--toggle", M = {
586
585
  "countries.ZA": "South Africa",
587
586
  "countries.ZM": "Zambia",
588
587
  "countries.ZW": "Zimbabwe"
589
- } }, Y = Object.keys(B["de-DE"]).filter((e) => e.startsWith("countries.")).map((e) => e.replace("countries.", "")), x = (e, i) => e.name.localeCompare(i.name), Q = () => 0, X = () => !0, Ce = S(
588
+ } }, z = Object.keys(B["de-DE"]).filter((e) => e.startsWith("countries.")).map((e) => e.replace("countries.", "")), Y = (e, i) => e.name.localeCompare(i.name), x = () => 0, Q = () => !0, Me = S(
590
589
  "CountryOptions",
591
590
  ({
592
- filterBy: e = X,
593
- sortBy: i = Q
591
+ filterBy: e = Q,
592
+ sortBy: i = x
594
593
  }) => {
595
594
  const r = y(B), t = E(
596
- () => Y.map((o) => ({
595
+ () => z.map((o) => ({
597
596
  code: o,
598
597
  name: r.format(`countries.${o}`)
599
- })).filter(e).sort(x).sort(i),
598
+ })).filter(e).sort(Y).sort(i),
600
599
  [r, e, i]
601
600
  );
602
- return /* @__PURE__ */ n.createElement(n.Fragment, null, t.map((o) => /* @__PURE__ */ n.createElement(z, { key: o.code, value: o.code }, o.name)));
601
+ return /* @__PURE__ */ n.createElement(n.Fragment, null, t.map((o) => /* @__PURE__ */ n.createElement(W, { key: o.code, value: o.code }, o.name)));
603
602
  }
604
- ), h = ["DE", "AT", "CH"], he = (e, i) => h.includes(i.code) ? 1 : 0 - (h.includes(e.code) ? 1 : 0);
603
+ ), h = ["DE", "AT", "CH"], Ce = (e, i) => h.includes(i.code) ? 1 : 0 - (h.includes(e.code) ? 1 : 0);
605
604
  export {
606
- Ce as CountryOptions,
607
- z as Option,
608
- Me as Select,
609
- Me as default,
610
- he as sortByDachFirst
605
+ Me as CountryOptions,
606
+ W as Option,
607
+ Se as Select,
608
+ Se as default,
609
+ Ce as sortByDachFirst
611
610
  };
package/dist/js/Tabs.js CHANGED
@@ -7,7 +7,7 @@ import { TunnelExit as E, TunnelProvider as P, TunnelEntry as f } from "@mittwal
7
7
  import { f as O } from "./flowComponent-BQs9wMX_.js";
8
8
  import { useCallbackRef as S } from "use-callback-ref";
9
9
  import { a as A, C as B } from "./ContextMenuTrigger-C6ZCPTHC.js";
10
- import { M as K } from "./MenuItem-D5BsewlU.js";
10
+ import { M as K } from "./MenuItem-B6P8yo9s.js";
11
11
  import "./ContextMenuSection-kLzjPKqH.js";
12
12
  import { B as L } from "./Button-BTc_iJae.js";
13
13
  import "@tabler/icons-react";