@mittwald/flow-react-components 0.1.0-alpha.100 → 0.1.0-alpha.102
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/Accordion-DUOvbD7N.js +76 -0
- package/dist/Accordion.js +7 -0
- package/dist/Button-DNeV_sZ5.js +117 -0
- package/dist/Button.js +1 -1
- package/dist/Content-hKTYy54n.js +23 -0
- package/dist/Content.js +3 -13
- package/dist/CopyButton.js +1 -1
- package/dist/List.js +1 -1
- package/dist/Navigation.js +36 -34
- package/dist/NumberField.js +1 -1
- package/dist/OffCanvas.js +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +7 -0
- package/dist/types/components/Accordion/index.d.ts +4 -0
- package/dist/types/components/Accordion/stories/Default.stories.d.ts +9 -0
- package/dist/types/components/Accordion/stories/EdgeCases.stories.d.ts +7 -0
- package/dist/types/components/Navigation/components/NavigationGroup/NavigationGroup.d.ts +1 -0
- package/dist/types/components/Navigation/stories/Default.stories.d.ts +1 -0
- package/package.json +12 -8
- package/dist/Button-DoFsBmn5.js +0 -116
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import n, { useState as E, useId as a } from "react";
|
|
4
|
+
import I from "clsx";
|
|
5
|
+
import "./propsContext-CauylOgH.js";
|
|
6
|
+
import { P as N } from "./PropsContextProvider-DZvwqHLP.js";
|
|
7
|
+
import "@react-aria/utils";
|
|
8
|
+
import "remeda";
|
|
9
|
+
import { d } from "./dynamic-ClpUSmEt.js";
|
|
10
|
+
import { B as w } from "./Button-DNeV_sZ5.js";
|
|
11
|
+
import "@tabler/icons-react";
|
|
12
|
+
import "./Icon-DXXYYNLl.js";
|
|
13
|
+
import { I as B } from "./IconChevronDown-Hoy6GbIi.js";
|
|
14
|
+
import { TunnelProvider as C, TunnelExit as P } from "@mittwald/react-tunnel";
|
|
15
|
+
const b = "flow--accordion", y = "flow--accordion--header", g = "flow--accordion--header-button", A = "flow--accordion--content", T = "flow--accordion--content-inner", D = "flow--accordion--chevron", H = "flow--accordion--expanded", e = {
|
|
16
|
+
accordion: b,
|
|
17
|
+
header: y,
|
|
18
|
+
headerButton: g,
|
|
19
|
+
content: A,
|
|
20
|
+
contentInner: T,
|
|
21
|
+
chevron: D,
|
|
22
|
+
expanded: H
|
|
23
|
+
}, O = (s) => {
|
|
24
|
+
const { children: l, className: i, defaultExpanded: m = !1, ...p } = s, [t, h] = E(m), u = I(
|
|
25
|
+
e.accordion,
|
|
26
|
+
t && e.expanded,
|
|
27
|
+
i
|
|
28
|
+
), f = a(), r = a(), c = (o) => /* @__PURE__ */ n.createElement(
|
|
29
|
+
w,
|
|
30
|
+
{
|
|
31
|
+
unstyled: !0,
|
|
32
|
+
"aria-expanded": t,
|
|
33
|
+
className: e.headerButton,
|
|
34
|
+
onPress: () => h((v) => !v),
|
|
35
|
+
"aria-controls": r
|
|
36
|
+
},
|
|
37
|
+
o,
|
|
38
|
+
/* @__PURE__ */ n.createElement(B, { className: e.chevron })
|
|
39
|
+
), x = {
|
|
40
|
+
Content: {
|
|
41
|
+
className: e.contentInner,
|
|
42
|
+
tunnelId: "content"
|
|
43
|
+
},
|
|
44
|
+
Heading: {
|
|
45
|
+
className: e.header,
|
|
46
|
+
level: 4,
|
|
47
|
+
children: d((o) => c(o.children))
|
|
48
|
+
},
|
|
49
|
+
Label: {
|
|
50
|
+
className: e.header,
|
|
51
|
+
children: d((o) => c(o.children))
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return /* @__PURE__ */ n.createElement("div", { ...p, className: u }, /* @__PURE__ */ n.createElement(
|
|
55
|
+
N,
|
|
56
|
+
{
|
|
57
|
+
mergeInParentContext: !0,
|
|
58
|
+
props: x,
|
|
59
|
+
dependencies: [t]
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ n.createElement(C, null, l, /* @__PURE__ */ n.createElement(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"aria-labelledby": f,
|
|
65
|
+
id: r,
|
|
66
|
+
role: "region",
|
|
67
|
+
hidden: !t,
|
|
68
|
+
className: e.content
|
|
69
|
+
},
|
|
70
|
+
/* @__PURE__ */ n.createElement(P, { id: "content" })
|
|
71
|
+
))
|
|
72
|
+
));
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
O as A
|
|
76
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import n, { useEffect as F } from "react";
|
|
4
|
+
import * as E from "react-aria-components";
|
|
5
|
+
import y from "clsx";
|
|
6
|
+
import { C } from "./ClearPropsContext-CeCMjUK9.js";
|
|
7
|
+
import { P as I } from "./PropsContextProvider-DZvwqHLP.js";
|
|
8
|
+
import "@react-aria/utils";
|
|
9
|
+
import "./propsContext-CauylOgH.js";
|
|
10
|
+
import "remeda";
|
|
11
|
+
import "@tabler/icons-react";
|
|
12
|
+
import "./Icon-DXXYYNLl.js";
|
|
13
|
+
import { I as N, a as h } from "./IconSucceeded-DQfjj1t4.js";
|
|
14
|
+
import { W as u } from "./Wrap-DGT1h1o3.js";
|
|
15
|
+
import { T as A } from "./Text-DdC3zDyH.js";
|
|
16
|
+
import { f as D } from "./flowComponent-CEBe_ATh.js";
|
|
17
|
+
import { L as T } from "./LoadingSpinner-BmvbSvoO.js";
|
|
18
|
+
import { useLocalizedStringFormatter as z } from "react-aria";
|
|
19
|
+
import { useLiveRegion as B } from "@chakra-ui/live-region";
|
|
20
|
+
const L = "flow--button", k = "flow--button--content", R = "flow--button--state-icon", K = "flow--button--avatar", U = "flow--button--icon", W = "flow--button--text", $ = "flow--button--is-succeeded", j = "flow--button--is-failed", q = "flow--button--is-pending", G = "flow--button--plain", H = "flow--button--primary", J = "flow--button--solid", M = "flow--button--aria-disabled", O = "flow--button--accent", Q = "flow--button--danger", V = "flow--button--secondary", X = "flow--button--soft", Y = "flow--button--inverse", t = {
|
|
21
|
+
button: L,
|
|
22
|
+
content: k,
|
|
23
|
+
stateIcon: R,
|
|
24
|
+
avatar: K,
|
|
25
|
+
icon: U,
|
|
26
|
+
text: W,
|
|
27
|
+
isSucceeded: $,
|
|
28
|
+
isFailed: j,
|
|
29
|
+
isPending: q,
|
|
30
|
+
plain: G,
|
|
31
|
+
"size-s": "flow--button--size-s",
|
|
32
|
+
primary: H,
|
|
33
|
+
solid: J,
|
|
34
|
+
ariaDisabled: M,
|
|
35
|
+
accent: O,
|
|
36
|
+
danger: Q,
|
|
37
|
+
secondary: V,
|
|
38
|
+
soft: X,
|
|
39
|
+
inverse: Y
|
|
40
|
+
}, Z = {
|
|
41
|
+
"de-DE": {
|
|
42
|
+
"action.isFailed": "Fehlgeschlagen",
|
|
43
|
+
"action.isPending": "Ausstehend...",
|
|
44
|
+
"action.isSucceeded": "Erfolgreich"
|
|
45
|
+
},
|
|
46
|
+
"en-EN": {
|
|
47
|
+
"action.isFailed": "Failed",
|
|
48
|
+
"action.isPending": "Pending...",
|
|
49
|
+
"action.isSucceeded": "Succeeded"
|
|
50
|
+
}
|
|
51
|
+
}, _ = (e, r = {}) => {
|
|
52
|
+
const i = z(Z), {
|
|
53
|
+
isPendingText: a = i.format("action.isPending"),
|
|
54
|
+
isSucceededText: c = i.format("action.isSucceeded"),
|
|
55
|
+
isFailedText: s = i.format("action.isFailed")
|
|
56
|
+
} = r, o = B({
|
|
57
|
+
"aria-live": "polite",
|
|
58
|
+
"aria-atomic": !1,
|
|
59
|
+
"aria-relevant": "text additions",
|
|
60
|
+
role: "status"
|
|
61
|
+
});
|
|
62
|
+
F(() => {
|
|
63
|
+
e === "isPending" ? o.speak(a) : e === "isSucceeded" ? o.speak(c) : e === "isFailed" && o.speak(s);
|
|
64
|
+
}, [e]);
|
|
65
|
+
}, ee = (e) => ((e.isPending || e.isSucceeded || e.isFailed || e["aria-disabled"]) && (e = { ...e }, e.onPress = void 0, e.onPressStart = void 0, e.onPressEnd = void 0, e.onPressChange = void 0, e.onPressUp = void 0, e.onKeyDown = void 0, e.onKeyUp = void 0), e), Pe = D("Button", (e) => {
|
|
66
|
+
e = ee(e);
|
|
67
|
+
const {
|
|
68
|
+
color: r = "primary",
|
|
69
|
+
variant: i = "solid",
|
|
70
|
+
children: a,
|
|
71
|
+
className: c,
|
|
72
|
+
size: s = "m",
|
|
73
|
+
isPending: o,
|
|
74
|
+
isSucceeded: d,
|
|
75
|
+
isFailed: l,
|
|
76
|
+
"aria-disabled": b,
|
|
77
|
+
ref: g,
|
|
78
|
+
inverse: v,
|
|
79
|
+
unstyled: m,
|
|
80
|
+
...P
|
|
81
|
+
} = e, w = m ? c : y(
|
|
82
|
+
t.button,
|
|
83
|
+
o && t.isPending,
|
|
84
|
+
d && t.isSucceeded,
|
|
85
|
+
l && t.isFailed,
|
|
86
|
+
v && t.inverse,
|
|
87
|
+
t[`size-${s}`],
|
|
88
|
+
t[r],
|
|
89
|
+
t[i],
|
|
90
|
+
c,
|
|
91
|
+
/**
|
|
92
|
+
* Workaround warning: The Aria.Button does not support "aria-disabled"
|
|
93
|
+
* by now, so this Button will be visually disabled via CSS.
|
|
94
|
+
*/
|
|
95
|
+
b && t.ariaDisabled
|
|
96
|
+
);
|
|
97
|
+
_(
|
|
98
|
+
o ? "isPending" : d ? "isSucceeded" : l ? "isFailed" : "isIdle"
|
|
99
|
+
);
|
|
100
|
+
const p = {
|
|
101
|
+
Icon: {
|
|
102
|
+
className: t.icon,
|
|
103
|
+
"aria-hidden": !0,
|
|
104
|
+
size: s
|
|
105
|
+
},
|
|
106
|
+
Text: {
|
|
107
|
+
className: t.text
|
|
108
|
+
},
|
|
109
|
+
Avatar: {
|
|
110
|
+
className: t.avatar
|
|
111
|
+
}
|
|
112
|
+
}, f = d ? N : l ? h : o ? T : void 0, S = f && /* @__PURE__ */ n.createElement(f, { size: s, className: t.stateIcon }), x = typeof a == "string";
|
|
113
|
+
return /* @__PURE__ */ n.createElement(C, null, /* @__PURE__ */ n.createElement(E.Button, { className: w, ref: g, ...P }, /* @__PURE__ */ n.createElement(I, { props: p }, /* @__PURE__ */ n.createElement(u, { if: !m }, /* @__PURE__ */ n.createElement("span", { className: t.content }, /* @__PURE__ */ n.createElement(u, { if: x }, /* @__PURE__ */ n.createElement(A, null, a))))), S));
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
Pe as B
|
|
117
|
+
};
|
package/dist/Button.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import t from "react";
|
|
4
|
+
import { C as i } from "./ClearPropsContext-CeCMjUK9.js";
|
|
5
|
+
import "./propsContext-CauylOgH.js";
|
|
6
|
+
import "@react-aria/utils";
|
|
7
|
+
import "remeda";
|
|
8
|
+
import "dot-prop";
|
|
9
|
+
import { f as l } from "./flowComponent-CEBe_ATh.js";
|
|
10
|
+
import { W as s } from "./Wrap-DGT1h1o3.js";
|
|
11
|
+
const W = l("Content", (e) => {
|
|
12
|
+
const {
|
|
13
|
+
children: r,
|
|
14
|
+
elementType: o = "div",
|
|
15
|
+
ref: n,
|
|
16
|
+
clearPropsContext: m = !0,
|
|
17
|
+
...p
|
|
18
|
+
} = e, a = o;
|
|
19
|
+
return /* @__PURE__ */ t.createElement(s, { if: m }, /* @__PURE__ */ t.createElement(i, null, /* @__PURE__ */ t.createElement(a, { ref: n, ...p }, r)));
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
W as C
|
|
23
|
+
};
|
package/dist/Content.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import
|
|
4
|
-
import { C as l } from "./ClearPropsContext-CeCMjUK9.js";
|
|
5
|
-
import "./propsContext-CauylOgH.js";
|
|
6
|
-
import "@react-aria/utils";
|
|
7
|
-
import "remeda";
|
|
8
|
-
import "dot-prop";
|
|
9
|
-
import { f as i } from "./flowComponent-CEBe_ATh.js";
|
|
10
|
-
const E = i("Content", (e) => {
|
|
11
|
-
const { children: o, elementType: r = "div", ref: n, ...m } = e, p = r;
|
|
12
|
-
return /* @__PURE__ */ t.createElement(l, null, /* @__PURE__ */ t.createElement(p, { ref: n, ...m }, o));
|
|
13
|
-
});
|
|
3
|
+
import { C as o } from "./Content-hKTYy54n.js";
|
|
14
4
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
o as Content,
|
|
6
|
+
o as default
|
|
17
7
|
};
|
package/dist/CopyButton.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import o from "react";
|
|
4
4
|
import a from "copy-to-clipboard";
|
|
5
|
-
import { B as i } from "./Button-
|
|
5
|
+
import { B as i } from "./Button-DNeV_sZ5.js";
|
|
6
6
|
import "@tabler/icons-react";
|
|
7
7
|
import "./Icon-DXXYYNLl.js";
|
|
8
8
|
import { I as c } from "./IconCopy-CWcw0z9V.js";
|
package/dist/List.js
CHANGED
|
@@ -12,7 +12,7 @@ import { T as b } from "./Text-DdC3zDyH.js";
|
|
|
12
12
|
import "@tabler/icons-react";
|
|
13
13
|
import "./Icon-DXXYYNLl.js";
|
|
14
14
|
import { I as $ } from "./IconChevronDown-Hoy6GbIi.js";
|
|
15
|
-
import { B as h } from "./Button-
|
|
15
|
+
import { B as h } from "./Button-DNeV_sZ5.js";
|
|
16
16
|
import { useMessageFormatter as H, useLocalizedStringFormatter as q } from "react-aria";
|
|
17
17
|
import K from "clsx";
|
|
18
18
|
import { I as rt } from "./IconClose-DBGgwbZE.js";
|
package/dist/Navigation.js
CHANGED
|
@@ -1,57 +1,59 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { d } from "./deepFindOfType-6pG0fH7S.js";
|
|
6
|
-
import { W as
|
|
3
|
+
import e, { useId as v } from "react";
|
|
4
|
+
import g from "clsx";
|
|
5
|
+
import { d as E } from "./deepFindOfType-6pG0fH7S.js";
|
|
6
|
+
import { W as x } from "./Wrap-DGT1h1o3.js";
|
|
7
7
|
import "./propsContext-CauylOgH.js";
|
|
8
|
-
import { P as
|
|
8
|
+
import { P as i } from "./PropsContextProvider-DZvwqHLP.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
10
|
import "remeda";
|
|
11
|
-
import { TunnelProvider as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
import { TunnelProvider as p, TunnelExit as u } from "@mittwald/react-tunnel";
|
|
12
|
+
import { A as N } from "./Accordion-DUOvbD7N.js";
|
|
13
|
+
import { C as b } from "./Content-hKTYy54n.js";
|
|
14
|
+
const C = "flow--navigation", I = "flow--navigation--item", P = "flow--navigation--icon", w = "flow--navigation--text", y = "flow--navigation--control-icon", l = {
|
|
15
|
+
navigation: C,
|
|
16
|
+
item: I,
|
|
17
|
+
icon: P,
|
|
18
|
+
text: w,
|
|
19
|
+
controlIcon: y
|
|
20
|
+
}, B = (s) => {
|
|
21
|
+
const { className: n, children: o, ...c } = s, m = g(l.navigation, n), a = !!E(o, h), r = {
|
|
20
22
|
Link: {
|
|
21
|
-
render: (
|
|
23
|
+
render: (t, f) => /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(t, { ...f, className: l.item, unstyled: !0 })),
|
|
22
24
|
Text: {
|
|
23
|
-
className:
|
|
25
|
+
className: l.text
|
|
24
26
|
},
|
|
25
27
|
Icon: {
|
|
26
|
-
className:
|
|
28
|
+
className: l.icon
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
},
|
|
32
|
-
navigationGroup:
|
|
33
|
-
label:
|
|
34
|
-
},
|
|
35
|
-
const { children:
|
|
32
|
+
return /* @__PURE__ */ e.createElement("nav", { className: m, role: "navigation", ...c }, /* @__PURE__ */ e.createElement(i, { props: r }, /* @__PURE__ */ e.createElement(x, { if: !a }, /* @__PURE__ */ e.createElement("ul", null, o))));
|
|
33
|
+
}, G = "flow--navigation--navigation-group", L = "flow--navigation--navigation-group--label", d = {
|
|
34
|
+
navigationGroup: G,
|
|
35
|
+
label: L
|
|
36
|
+
}, h = (s) => {
|
|
37
|
+
const { children: n, className: o, collapsable: c, ...m } = s, a = g(d.navigationGroup, o), r = v(), t = {
|
|
36
38
|
Label: {
|
|
37
39
|
tunnelId: "Label",
|
|
38
|
-
id:
|
|
39
|
-
className:
|
|
40
|
+
id: r,
|
|
41
|
+
className: d.label,
|
|
40
42
|
"aria-hidden": !0
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
|
-
return /* @__PURE__ */ t.createElement(
|
|
45
|
+
return c ? /* @__PURE__ */ e.createElement(i, { mergeInParentContext: !0, props: t }, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(N, { defaultExpanded: !0, className: a }, /* @__PURE__ */ e.createElement(u, { id: "Label" }), /* @__PURE__ */ e.createElement(b, { clearPropsContext: !1 }, /* @__PURE__ */ e.createElement("ul", null, n))))) : /* @__PURE__ */ e.createElement(i, { mergeInParentContext: !0, props: t }, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(
|
|
44
46
|
"section",
|
|
45
47
|
{
|
|
46
|
-
"aria-labelledby":
|
|
47
|
-
className:
|
|
48
|
-
...
|
|
48
|
+
"aria-labelledby": r,
|
|
49
|
+
className: a,
|
|
50
|
+
...m
|
|
49
51
|
},
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
));
|
|
52
|
+
/* @__PURE__ */ e.createElement(i, { mergeInParentContext: !0, props: t }, /* @__PURE__ */ e.createElement(u, { id: "Label" }), /* @__PURE__ */ e.createElement("ul", null, n))
|
|
53
|
+
)));
|
|
52
54
|
};
|
|
53
55
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
B as Navigation,
|
|
57
|
+
h as NavigationGroup,
|
|
58
|
+
B as default
|
|
57
59
|
};
|
package/dist/NumberField.js
CHANGED
|
@@ -10,7 +10,7 @@ import "@react-aria/utils";
|
|
|
10
10
|
import "./propsContext-CauylOgH.js";
|
|
11
11
|
import "remeda";
|
|
12
12
|
import { F as I } from "./FieldError-1ByhwDR1.js";
|
|
13
|
-
import { B as c } from "./Button-
|
|
13
|
+
import { B as c } from "./Button-DNeV_sZ5.js";
|
|
14
14
|
import "@tabler/icons-react";
|
|
15
15
|
import "./Icon-DXXYYNLl.js";
|
|
16
16
|
import { I as C } from "./IconChevronDown-Hoy6GbIi.js";
|
package/dist/OffCanvas.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import o from "react";
|
|
4
4
|
import c from "clsx";
|
|
5
|
-
import { B as f } from "./Button-
|
|
5
|
+
import { B as f } from "./Button-DNeV_sZ5.js";
|
|
6
6
|
import "@tabler/icons-react";
|
|
7
7
|
import "./Icon-DXXYYNLl.js";
|
|
8
8
|
import { I as m } from "./IconClose-DBGgwbZE.js";
|
package/dist/Tabs.js
CHANGED
|
@@ -9,7 +9,7 @@ import { f as S } from "./flowComponent-CEBe_ATh.js";
|
|
|
9
9
|
import { useCallbackRef as B } from "use-callback-ref";
|
|
10
10
|
import { C as K } from "./ContextMenu-DgjLaam6.js";
|
|
11
11
|
import { M as L } from "./MenuItem-_30E41JK.js";
|
|
12
|
-
import { B as F } from "./Button-
|
|
12
|
+
import { B as F } from "./Button-DNeV_sZ5.js";
|
|
13
13
|
import "@tabler/icons-react";
|
|
14
14
|
import "./Icon-DXXYYNLl.js";
|
|
15
15
|
import { I as A } from "./IconContextMenu-DpGh2Lgn.js";
|