@mittwald/flow-react-components 0.1.0-alpha.85 → 0.1.0-alpha.86

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.
@@ -7,7 +7,7 @@ import "@react-aria/utils";
7
7
  import "./propsContext-CauylOgH.js";
8
8
  import "remeda";
9
9
  import p from "clsx";
10
- import { S as u } from "./StatusIcon-DYuGj4gU.js";
10
+ import { S as u } from "./StatusIcon-BMyHmLNg.js";
11
11
  import { f as d } from "./flowComponent-dvQga3NG.js";
12
12
  const w = "flow--inline-alert", g = "flow--inline-alert--status-icon", C = "flow--inline-alert--heading", I = "flow--inline-alert--content", N = "flow--inline-alert--info", h = "flow--inline-alert--warning", x = "flow--inline-alert--danger", A = "flow--inline-alert--success", n = {
13
13
  inlineAlert: w,
@@ -2,7 +2,7 @@
2
2
  /* */
3
3
  import t from "react";
4
4
  import l from "clsx";
5
- import { S as f } from "./StatusIcon-DYuGj4gU.js";
5
+ import { S as f } from "./StatusIcon-BMyHmLNg.js";
6
6
  import { T as i } from "./Text-CKd46eHq.js";
7
7
  import { C as u } from "./ClearPropsContext-CeCMjUK9.js";
8
8
  import "./propsContext-CauylOgH.js";
@@ -0,0 +1,49 @@
1
+ "use client"
2
+ /* */
3
+ import t from "react";
4
+ import "@tabler/icons-react";
5
+ import "./Icon-DwHDa4pA.js";
6
+ import { I as m } from "./IconDanger-MdCt1mDP.js";
7
+ import { I as f, a as l, b as I } from "./IconWarning-Dbq3oj5j.js";
8
+ import { useLocalizedStringFormatter as g } from "react-aria";
9
+ import { C as p } from "./ClearPropsContext-CeCMjUK9.js";
10
+ import "./propsContext-CauylOgH.js";
11
+ import "@react-aria/utils";
12
+ import "remeda";
13
+ import "dot-prop";
14
+ import w from "clsx";
15
+ const S = {
16
+ "de-DE": {
17
+ "statusIcon.danger": "Status Fehler",
18
+ "statusIcon.info": "Status Information",
19
+ "statusIcon.success": "Status Erfolg",
20
+ "statusIcon.warning": "Status Warnung"
21
+ },
22
+ "en-EN": {
23
+ "statusIcon.danger": "Status error",
24
+ "statusIcon.info": "Status information",
25
+ "statusIcon.success": "Status success",
26
+ "statusIcon.warning": "Status warning"
27
+ }
28
+ }, d = "flow--status-icon--info", E = "flow--status-icon", C = "flow--status-icon--warning", N = "flow--status-icon--danger", x = "flow--status-icon--success", o = {
29
+ info: d,
30
+ statusIcon: E,
31
+ warning: C,
32
+ danger: N,
33
+ success: x
34
+ }, F = {
35
+ danger: m,
36
+ info: f,
37
+ success: l,
38
+ warning: I
39
+ }, q = (n) => {
40
+ const { status: s = "info", className: a, ...c } = n, r = w(o.statusIcon, o[s], a), e = g(S), i = F[s], u = {
41
+ className: r,
42
+ "aria-label": e.format(`statusIcon.${s}`),
43
+ ...c
44
+ };
45
+ return /* @__PURE__ */ t.createElement(p, null, /* @__PURE__ */ t.createElement(i, { ...u }));
46
+ };
47
+ export {
48
+ q as S
49
+ };
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
- import { S as a } from "./StatusIcon-DYuGj4gU.js";
3
+ import { S as a } from "./StatusIcon-BMyHmLNg.js";
4
4
  export {
5
5
  a as StatusIcon,
6
6
  a as default
package/dist/Tabs.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client"
2
2
  /* */
3
- import e, { useRef as M, useState as T, useEffect as N, useId as C, createContext as y, useContext as I } from "react";
4
- import * as f from "react-aria-components";
3
+ import e, { useRef as h, useState as C, useEffect as M, useId as p, createContext as I, useContext as y } from "react";
4
+ import * as E from "react-aria-components";
5
5
  import { MenuTrigger as O } from "react-aria-components";
6
6
  import m from "clsx";
7
- import { TunnelExit as u, TunnelProvider as P, TunnelEntry as b } from "@mittwald/react-tunnel";
7
+ import { TunnelExit as f, TunnelProvider as P, TunnelEntry as u } from "@mittwald/react-tunnel";
8
8
  import { f as S } from "./flowComponent-dvQga3NG.js";
9
9
  import { useCallbackRef as B } from "use-callback-ref";
10
10
  import { C as K } from "./ContextMenu-BeySGa4K.js";
@@ -17,51 +17,53 @@ import { T as R } from "./Text-CKd46eHq.js";
17
17
  const W = "flow--tabs", $ = "flow--tabs--list", k = {
18
18
  tabs: W,
19
19
  list: $
20
- }, j = "flow--tabs--tab-list", q = "flow--tabs--tab-list--context-menu-button", z = "flow--tabs--tab-list--titles", D = "flow--tabs--tab-list--collapsed", d = {
20
+ }, j = "flow--tabs--tab-list", q = "flow--tabs--tab-list--context-menu-button", z = "flow--tabs--tab-list--titles", D = "flow--tabs--tab-list--collapsed", b = {
21
21
  tabList: j,
22
22
  contextMenuButton: q,
23
23
  titles: z,
24
24
  collapsed: D
25
25
  }, G = () => {
26
- const s = M(), [n, r] = T(!1), o = B(null, (t) => {
27
- a(), c(t);
28
- }), l = ([
26
+ const s = h(), [n, r] = C(!1), o = B(null, (t) => {
27
+ l(), c(t);
28
+ }), a = ([
29
29
  t
30
30
  ]) => {
31
31
  t && r(!t.isIntersecting);
32
32
  }, c = (t = o.current) => {
33
33
  if (t && t instanceof Element) {
34
- const i = new IntersectionObserver(l, {
34
+ const i = new IntersectionObserver(a, {
35
35
  root: t.parentElement,
36
36
  // 1 = invoke callback when the element is 100% visible within the parent element
37
37
  threshold: 1
38
38
  });
39
39
  s.current = i, i.observe(t);
40
40
  }
41
- }, a = () => {
41
+ }, l = () => {
42
42
  var t;
43
43
  (t = s.current) == null || t.disconnect();
44
44
  };
45
- return N(() => (c(), a), [s.current]), {
45
+ return M(() => (c(), l), [s.current]), {
46
46
  ref: o,
47
47
  isOverflowing: n
48
48
  };
49
- }, H = "flow--tabs--tab-title", p = {
50
- tabTitle: H
51
- }, J = (s) => {
52
- const { className: n, ...r } = s, o = m(n, p.tabTitle);
53
- return /* @__PURE__ */ e.createElement("div", { ...r, className: o, "data-selected": !0 }, /* @__PURE__ */ e.createElement(u, { id: "ActiveTitle" }));
54
- }, Q = (s) => {
55
- const { selection: n, disabledKeys: r, onContextMenuSelectionChange: o } = s, l = C(), c = G(), a = c.isOverflowing, t = m(d.tabList, a && d.collapsed), i = (w) => {
56
- const [E] = w;
57
- E && o(E);
58
- }, x = /* @__PURE__ */ e.createElement(f.TabList, { className: d.titles, ref: c.ref }, /* @__PURE__ */ e.createElement(u, { id: "Titles" })), g = a && /* @__PURE__ */ e.createElement(J, { id: l }), h = a && /* @__PURE__ */ e.createElement(O, null, /* @__PURE__ */ e.createElement(
49
+ }, H = "flow--tabs--tab-title", J = "flow--tabs--tab-title--text", Q = "flow--tabs--tab-title--menu-item", d = {
50
+ tabTitle: H,
51
+ text: J,
52
+ menuItem: Q
53
+ }, U = (s) => {
54
+ const { className: n, ...r } = s, o = m(n, d.tabTitle);
55
+ return /* @__PURE__ */ e.createElement("div", { ...r, className: o, "data-selected": !0 }, /* @__PURE__ */ e.createElement(f, { id: "ActiveTitle" }));
56
+ }, V = (s) => {
57
+ const { selection: n, disabledKeys: r, onContextMenuSelectionChange: o } = s, a = p(), c = G(), l = c.isOverflowing, t = m(b.tabList, l && b.collapsed), i = (N) => {
58
+ const [T] = N;
59
+ T && o(T);
60
+ }, v = /* @__PURE__ */ e.createElement(E.TabList, { className: b.titles, ref: c.ref }, /* @__PURE__ */ e.createElement(f, { id: "Titles" })), g = l && /* @__PURE__ */ e.createElement(U, { id: a }), w = l && /* @__PURE__ */ e.createElement(O, null, /* @__PURE__ */ e.createElement(
59
61
  F,
60
62
  {
61
63
  style: "soft",
62
- className: d.contextMenuButton,
64
+ className: b.contextMenuButton,
63
65
  variant: "secondary",
64
- "aria-labelledby": l
66
+ "aria-labelledby": a
65
67
  },
66
68
  /* @__PURE__ */ e.createElement(A, null)
67
69
  ), /* @__PURE__ */ e.createElement(
@@ -72,60 +74,60 @@ const W = "flow--tabs", $ = "flow--tabs--list", k = {
72
74
  selectionMode: "navigation",
73
75
  onSelectionChange: i
74
76
  },
75
- /* @__PURE__ */ e.createElement(u, { id: "ContextMenuItems" })
77
+ /* @__PURE__ */ e.createElement(f, { id: "ContextMenuItems" })
76
78
  ));
77
- return /* @__PURE__ */ e.createElement("div", { className: t }, x, g, h);
79
+ return /* @__PURE__ */ e.createElement("div", { className: t }, v, g, w);
78
80
  }, de = S("Tabs", (s) => {
79
- const { children: n, className: r, defaultSelectedKey: o, disabledKeys: l, ...c } = s, a = m(k.tabs, r), [t, i] = T(
81
+ const { children: n, className: r, defaultSelectedKey: o, disabledKeys: a, ...c } = s, l = m(k.tabs, r), [t, i] = C(
80
82
  o
81
83
  );
82
84
  return /* @__PURE__ */ e.createElement(P, null, n, /* @__PURE__ */ e.createElement(
83
- f.Tabs,
85
+ E.Tabs,
84
86
  {
85
- className: a,
87
+ className: l,
86
88
  ...c,
87
89
  selectedKey: t,
88
90
  onSelectionChange: i,
89
- disabledKeys: l
91
+ disabledKeys: a
90
92
  },
91
93
  /* @__PURE__ */ e.createElement(
92
- Q,
94
+ V,
93
95
  {
94
96
  selection: t,
95
97
  onContextMenuSelectionChange: i,
96
- disabledKeys: l
98
+ disabledKeys: a
97
99
  }
98
100
  ),
99
- /* @__PURE__ */ e.createElement(u, { id: "Panels" })
101
+ /* @__PURE__ */ e.createElement(f, { id: "Panels" })
100
102
  ));
101
- }), v = y({
103
+ }), x = I({
102
104
  id: "undefined"
103
- }), U = () => I(v), V = v.Provider, be = (s) => {
104
- const { children: n, className: r, ...o } = s, { id: l } = U(), c = m(p.tabTitle, r);
105
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(b, { id: "Titles" }, /* @__PURE__ */ e.createElement(f.Tab, { ...o, id: l, className: c }, (a) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(R, { emulateBoldWidth: !0 }, n), /* @__PURE__ */ e.createElement(b, { id: "ActiveTitle" }, a.isSelected && n)))), /* @__PURE__ */ e.createElement(b, { id: "ContextMenuItems" }, /* @__PURE__ */ e.createElement(L, { id: l }, n)));
106
- }, X = "flow--tabs--tab--tab-panel", Y = {
107
- tabPanel: X
108
- }, ue = (s) => {
105
+ }), X = () => y(x), Y = x.Provider, fe = (s) => {
106
+ const { children: n, className: r, ...o } = s, { id: a } = X(), c = m(d.tabTitle, r);
107
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(u, { id: "Titles" }, /* @__PURE__ */ e.createElement(E.Tab, { ...o, id: a, className: c }, (l) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(R, { emulateBoldWidth: !0 }, /* @__PURE__ */ e.createElement("span", { className: d.text }, n)), /* @__PURE__ */ e.createElement(u, { id: "ActiveTitle" }, l.isSelected && n)))), /* @__PURE__ */ e.createElement(u, { id: "ContextMenuItems" }, /* @__PURE__ */ e.createElement(L, { className: d.menuItem, id: a }, n)));
108
+ }, Z = "flow--tabs--tab--tab-panel", _ = {
109
+ tabPanel: Z
110
+ }, Ee = (s) => {
109
111
  const {
110
112
  children: n,
111
113
  className: r,
112
114
  shouldForceMount: o = !0,
113
- id: l,
115
+ id: a,
114
116
  ...c
115
- } = s, a = m(Y.tabPanel, r), t = C(), i = l ?? t;
116
- return /* @__PURE__ */ e.createElement(b, { id: "Panels" }, /* @__PURE__ */ e.createElement(
117
- f.TabPanel,
117
+ } = s, l = m(_.tabPanel, r), t = p(), i = a ?? t;
118
+ return /* @__PURE__ */ e.createElement(u, { id: "Panels" }, /* @__PURE__ */ e.createElement(
119
+ E.TabPanel,
118
120
  {
119
- className: a,
121
+ className: l,
120
122
  shouldForceMount: o,
121
123
  id: i,
122
124
  ...c
123
125
  },
124
- /* @__PURE__ */ e.createElement(V, { value: { id: i } }, n)
126
+ /* @__PURE__ */ e.createElement(Y, { value: { id: i } }, n)
125
127
  ));
126
128
  };
127
129
  export {
128
- ue as Tab,
129
- be as TabTitle,
130
+ Ee as Tab,
131
+ fe as TabTitle,
130
132
  de as Tabs
131
133
  };