@mittwald/flow-react-components 0.1.0-alpha.131 → 0.1.0-alpha.133
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-BzgwSHYE.js → Accordion-rCpRbkUM.js} +5 -5
- package/dist/Accordion.js +1 -1
- package/dist/Action-Dp9FyJCZ.js +282 -0
- package/dist/Action.js +1 -1
- package/dist/ActionGroup.js +25 -25
- package/dist/Avatar.js +4 -4
- package/dist/Breadcrumb.js +21 -19
- package/dist/{Button-DAoWF37n.js → Button-BPAhEOTg.js} +24 -24
- package/dist/Button.js +1 -1
- package/dist/{Checkbox-2PUuXc0T.js → Checkbox-CD6v6jqo.js} +6 -6
- package/dist/Checkbox.js +1 -1
- package/dist/{CheckboxButton-BPHQLZJq.js → CheckboxButton-I0WYBLv2.js} +5 -5
- package/dist/CheckboxButton.js +1 -1
- package/dist/CheckboxGroup.js +5 -5
- package/dist/{ClearPropsContext-mes1t7Bj.js → ClearPropsContext-CUvsbMn8.js} +1 -1
- package/dist/{Content-eQoJ_gHK.js → Content-DlB-BYko.js} +3 -3
- package/dist/Content.js +1 -1
- package/dist/ContextMenu.js +3 -3
- package/dist/{ContextMenuTrigger-AyIRlUZ8.js → ContextMenuTrigger-BwhLrGm5.js} +15 -18
- package/dist/CopyButton.js +7 -7
- package/dist/CounterBadge.js +18 -0
- package/dist/FieldDescription.js +4 -4
- package/dist/{FieldError-BKoqRvQY.js → FieldError-D_VRyiJG.js} +5 -5
- package/dist/FieldError.js +1 -1
- package/dist/{Header-XA8CGkKW.js → Header-BetbThNR.js} +1 -1
- package/dist/Header.js +1 -1
- package/dist/HeaderNavigation.js +23 -24
- package/dist/{Heading-C-bS3Ayo.js → Heading-CfQzGjxY.js} +4 -4
- package/dist/Heading.js +1 -1
- package/dist/{Icon-DdmDlHdu.js → Icon-D4bkU_pz.js} +3 -3
- package/dist/Icon.js +1 -1
- package/dist/{IconCheck-B1Dn4nJ7.js → IconCheck-CMWmQYpS.js} +1 -1
- package/dist/{IconCheckboxEmpty-BxpTlSro.js → IconCheckboxEmpty-DQLeOSmS.js} +1 -1
- package/dist/{IconCheckboxIndeterminate-Cc72OI6v.js → IconCheckboxIndeterminate-DoNQre-9.js} +1 -1
- package/dist/{IconChevronDown-1Ln2Aunx.js → IconChevronDown-HLDPe1kj.js} +1 -1
- package/dist/{IconChevronRight-CAcIYBGT.js → IconChevronRight-DmCZeDFh.js} +1 -1
- package/dist/IconChevronUp-CUKpaGeP.js +9 -0
- package/dist/{IconClose-BuwjCtDl.js → IconClose-FTrJdf_N.js} +1 -1
- package/dist/{IconContextMenu-Cbh6mtE6.js → IconContextMenu-Bmk1_j_0.js} +1 -1
- package/dist/{IconCopy-CMzS4NPN.js → IconCopy-DH_CNzXF.js} +1 -1
- package/dist/{IconDanger-DJImCjO3.js → IconDanger-PwvUWqzQ.js} +1 -1
- package/dist/{IconPending-D_CAUjui.js → IconPending-BV7TXz8_.js} +1 -1
- package/dist/IconPlus-CAQpgAH5.js +10 -0
- package/dist/{IconRadioOn-DV1XnVyC.js → IconRadioOn-BIS8wd64.js} +1 -1
- package/dist/{IconSearch-zHh8DtpL.js → IconSearch-DadOOeXe.js} +1 -1
- package/dist/{IconSucceeded-cPVVsQAs.js → IconSucceeded-KKiDIenP.js} +1 -1
- package/dist/{IconWarning-Cl_jqXKr.js → IconWarning-DFG_1t6M.js} +1 -1
- package/dist/Icons.js +39 -38
- package/dist/{IllustratedMessage-D07W9uSy.js → IllustratedMessage-DadLfPs9.js} +2 -2
- package/dist/IllustratedMessage.js +1 -1
- package/dist/Image.js +3 -3
- package/dist/Initials.js +3 -3
- package/dist/InlineAlert.js +5 -5
- package/dist/{InlineCode-Sk5wfXAE.js → InlineCode-BT-PKxVv.js} +2 -2
- package/dist/InlineCode.js +1 -1
- package/dist/{Label-BK1BkCCd.js → Label-CJi7iMmE.js} +3 -3
- package/dist/Label.js +1 -1
- package/dist/LabeledValue.js +3 -3
- package/dist/LayoutCard.js +3 -3
- package/dist/{Link-DufTU3kG.js → Link-TcBL3IVI.js} +4 -4
- package/dist/Link.js +1 -1
- package/dist/List.js +42 -43
- package/dist/{LoadingSpinner-VQh3iQVs.js → LoadingSpinner-CoSM7GIL.js} +2 -2
- package/dist/LoadingSpinner.js +1 -1
- package/dist/{MenuItem-DL25To7v.js → MenuItem-Dny58Rqq.js} +7 -7
- package/dist/MenuItem.js +1 -1
- package/dist/Modal.js +4 -4
- package/dist/Navigation.js +37 -35
- package/dist/NumberField.js +21 -20
- package/dist/OffCanvas.js +8 -8
- package/dist/OverlayTrigger-DbjMkqKf.js +20 -0
- package/dist/ProgressBar.js +2 -2
- package/dist/{PropsContextProvider-B7e3QrmR.js → PropsContextProvider-C6Z4XGp6.js} +17 -17
- package/dist/RadioGroup.js +8 -8
- package/dist/Section.js +3 -3
- package/dist/Select.js +44 -45
- package/dist/Slider.js +105 -0
- package/dist/StatusBadge.js +5 -5
- package/dist/{StatusIcon-DEiuIEOs.js → StatusIcon-Dj5p-iL1.js} +5 -5
- package/dist/StatusIcon.js +1 -1
- package/dist/Switch.js +7 -7
- package/dist/Tabs.js +9 -9
- package/dist/{Text-CZrXXfX3.js → Text-D6e-S6em.js} +4 -4
- package/dist/Text.js +1 -1
- package/dist/TextArea.js +4 -4
- package/dist/TextField.js +4 -4
- package/dist/{TextFieldBase-BItZ1rm6.js → TextFieldBase-D6wA8562.js} +4 -4
- package/dist/flowComponent-CPKCCJEg.js +120 -0
- package/dist/getActionGroupSlot-izllH4ID.js +59 -0
- package/dist/propsContext-DzAKlmhS.js +10 -0
- package/dist/react-hook-form.js +10 -9
- package/dist/slotContext-DoCFkzCA.js +8 -0
- package/dist/styles.css +1 -1
- package/dist/types/components/Action/hooks/useActionButtonState.d.ts +4 -0
- package/dist/types/components/Action/hooks/useConfirmationModalButtonSlot.d.ts +3 -0
- package/dist/types/components/ActionGroup/ActionGroup.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Content/Content.d.ts +1 -1
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/types/components/CopyButton/CopyButton.d.ts +1 -1
- package/dist/types/components/CounterBadge/CounterBadge.d.ts +9 -0
- package/dist/types/components/CounterBadge/index.d.ts +4 -0
- package/dist/types/components/{CounterLabel → CounterBadge}/stories/Default.stories.d.ts +3 -3
- package/dist/types/components/Header/Header.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +1 -1
- package/dist/types/components/MenuItem/MenuItem.d.ts +1 -1
- package/dist/types/components/Modal/Modal.d.ts +1 -1
- package/dist/types/components/Section/Section.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts +9 -0
- package/dist/types/components/Slider/index.d.ts +4 -0
- package/dist/types/components/Slider/stories/Default.stories.d.ts +10 -0
- package/dist/types/components/propTypes/index.d.ts +5 -3
- package/dist/types/lib/componentFactory/flowComponent.d.ts +6 -4
- package/dist/types/lib/propsContext/propsContext.d.ts +6 -4
- package/dist/types/lib/slotContext/SlotContextProvider.d.ts +9 -0
- package/dist/types/lib/slotContext/slotContext.d.ts +44 -0
- package/dist/types/lib/slotContext/types.d.ts +5 -0
- package/dist/types/lib/slotContext/useContextSlot.d.ts +4 -0
- package/dist/types/lib/types/props.d.ts +1 -4
- package/package.json +36 -32
- package/dist/Action-COYULIMl.js +0 -307
- package/dist/ActionStateContext-C_nPivaA.js +0 -55
- package/dist/ComponentRenderContextProvider-C-1_ziLI.js +0 -29
- package/dist/CounterLabel.js +0 -18
- package/dist/IconPlus-CUaWlT-v.js +0 -11
- package/dist/OverlayTrigger-Bb8cs_IA.js +0 -21
- package/dist/context-D_-mRqs8.js +0 -8
- package/dist/flowComponent-CpHt0lsO.js +0 -124
- package/dist/getActionGroupSlot-B4Vu4Kix.js +0 -9
- package/dist/types/components/Action/components/ActionButton.d.ts +0 -4
- package/dist/types/components/Action/components/ActionComponentsRenderContext.d.ts +0 -3
- package/dist/types/components/Action/components/ActionLink.d.ts +0 -4
- package/dist/types/components/Action/components/ActionModal.d.ts +0 -4
- package/dist/types/components/Action/components/ModalActionButton.d.ts +0 -4
- package/dist/types/components/CounterLabel/CounterLabel.d.ts +0 -9
- package/dist/types/components/CounterLabel/index.d.ts +0 -4
- package/dist/types/lib/propsContext/render/ComponentRenderContextProvider.d.ts +0 -18
- package/dist/types/lib/propsContext/render/useComponentRenderFn.d.ts +0 -8
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import e, { useState as E, useId as a } from "react";
|
|
4
4
|
import I from "clsx";
|
|
5
|
-
import "./
|
|
6
|
-
import { P as N } from "./PropsContextProvider-
|
|
5
|
+
import "./propsContext-DzAKlmhS.js";
|
|
6
|
+
import { P as N } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
7
7
|
import "@react-aria/utils";
|
|
8
8
|
import "remeda";
|
|
9
9
|
import { d } from "./dynamic-ClpUSmEt.js";
|
|
10
|
-
import { B as w } from "./Button-
|
|
10
|
+
import { B as w } from "./Button-BPAhEOTg.js";
|
|
11
11
|
import "@tabler/icons-react";
|
|
12
|
-
import "./Icon-
|
|
13
|
-
import { I as y } from "./IconChevronDown-
|
|
12
|
+
import "./Icon-D4bkU_pz.js";
|
|
13
|
+
import { I as y } from "./IconChevronDown-HLDPe1kj.js";
|
|
14
14
|
import { TunnelProvider as B, TunnelExit as C } from "@mittwald/react-tunnel";
|
|
15
15
|
import { A as P } from "./Activity-CmfZpgOM.js";
|
|
16
16
|
const A = "flow--accordion", b = "flow--accordion--header", g = "flow--accordion--header-button", D = "flow--accordion--content", T = "flow--accordion--content-inner", H = "flow--accordion--chevron", L = "flow--accordion--expanded", n = {
|
package/dist/Accordion.js
CHANGED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
var S = Object.defineProperty;
|
|
4
|
+
var B = (o, t, e) => t in o ? S(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
5
|
+
var c = (o, t, e) => (B(o, typeof t != "symbol" ? t + "" : t, e), e);
|
|
6
|
+
import y, { createContext as F, useRef as k, useContext as A } from "react";
|
|
7
|
+
import { makeObservable as O, observable as I, action as M, computed as E } from "mobx";
|
|
8
|
+
import { u as w } from "./useOverlayController-CGKumeGL.js";
|
|
9
|
+
import D from "invariant";
|
|
10
|
+
import { u as b } from "./useSelector-DpU7_HMO.js";
|
|
11
|
+
import { a as T, g as N, u as R } from "./getActionGroupSlot-izllH4ID.js";
|
|
12
|
+
import "./propsContext-DzAKlmhS.js";
|
|
13
|
+
import { P as $ } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
14
|
+
import "@react-aria/utils";
|
|
15
|
+
import "remeda";
|
|
16
|
+
import { d as u } from "./dynamic-ClpUSmEt.js";
|
|
17
|
+
import { u as V } from "./slotContext-DoCFkzCA.js";
|
|
18
|
+
const m = F(void 0), G = m.Provider, g = (o) => new Promise((t) => setTimeout(t, o)), f = {
|
|
19
|
+
pending: 1e3,
|
|
20
|
+
succeeded: 1500,
|
|
21
|
+
failed: 2e3
|
|
22
|
+
};
|
|
23
|
+
class C {
|
|
24
|
+
constructor() {
|
|
25
|
+
c(this, "showFeedback");
|
|
26
|
+
c(this, "state", "isIdle");
|
|
27
|
+
c(this, "setPendingTimeout");
|
|
28
|
+
c(this, "error");
|
|
29
|
+
c(this, "isAsync", !1);
|
|
30
|
+
O(this, {
|
|
31
|
+
state: I,
|
|
32
|
+
updateState: M,
|
|
33
|
+
isBusy: E
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
static useNew() {
|
|
37
|
+
return k(new C()).current;
|
|
38
|
+
}
|
|
39
|
+
updateState(t) {
|
|
40
|
+
this.state = t;
|
|
41
|
+
}
|
|
42
|
+
useValue() {
|
|
43
|
+
return b(() => this.state, [this]);
|
|
44
|
+
}
|
|
45
|
+
useIsBusy() {
|
|
46
|
+
return b(() => this.isBusy, [this]);
|
|
47
|
+
}
|
|
48
|
+
get isBusy() {
|
|
49
|
+
return this.state === "isExecuting" || this.state === "isPending";
|
|
50
|
+
}
|
|
51
|
+
onAsyncStart() {
|
|
52
|
+
this.isAsync = !0, this.updateState("isExecuting"), this.setPendingTimeout = window.setTimeout(
|
|
53
|
+
() => this.startPending(),
|
|
54
|
+
f.pending
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
async onSucceeded() {
|
|
58
|
+
await this.onDone();
|
|
59
|
+
}
|
|
60
|
+
async onFailed(t) {
|
|
61
|
+
this.error = t ?? new Error("Unknown error"), await this.onDone();
|
|
62
|
+
}
|
|
63
|
+
withFeedback(t) {
|
|
64
|
+
return this.showFeedback = t, this;
|
|
65
|
+
}
|
|
66
|
+
async startFailedFeedback() {
|
|
67
|
+
this.updateState("isFailed"), await g(f.failed), this.resetAfterDone();
|
|
68
|
+
}
|
|
69
|
+
async startSucceededFeedback() {
|
|
70
|
+
this.updateState("isSucceeded"), await g(f.succeeded), this.resetAfterDone();
|
|
71
|
+
}
|
|
72
|
+
resetAfterDone() {
|
|
73
|
+
this.updateState("isIdle"), this.isAsync = !1, this.error = void 0;
|
|
74
|
+
}
|
|
75
|
+
async onDone() {
|
|
76
|
+
this.setPendingTimeout && window.clearTimeout(this.setPendingTimeout), this.error ? await this.startFailedFeedback() : this.showFeedback !== !1 && (this.showFeedback || this.isAsync) ? await this.startSucceededFeedback() : this.resetAfterDone();
|
|
77
|
+
}
|
|
78
|
+
startPending() {
|
|
79
|
+
this.updateState("isPending");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const x = (o) => (...t) => {
|
|
83
|
+
const e = [...o], s = e.shift();
|
|
84
|
+
if (s) {
|
|
85
|
+
const i = s(...t), n = () => e.length === 0 ? i : x(e)(...t);
|
|
86
|
+
return i instanceof Promise ? i.then(n) : n();
|
|
87
|
+
}
|
|
88
|
+
}, d = () => {
|
|
89
|
+
}, L = (o, t = {}) => {
|
|
90
|
+
const {
|
|
91
|
+
onSync: e = d,
|
|
92
|
+
onAsync: s = d,
|
|
93
|
+
then: i = d,
|
|
94
|
+
catch: n = d,
|
|
95
|
+
finally: r = d
|
|
96
|
+
} = t;
|
|
97
|
+
try {
|
|
98
|
+
const a = o();
|
|
99
|
+
return a instanceof Promise ? (s(), a.then(i).catch(n).finally(r)) : (e(), i(a), r(), a);
|
|
100
|
+
} catch (a) {
|
|
101
|
+
e(), n(a), r();
|
|
102
|
+
}
|
|
103
|
+
}, U = () => {
|
|
104
|
+
};
|
|
105
|
+
function j(o) {
|
|
106
|
+
if (o.needsConfirmation)
|
|
107
|
+
return o.confirmationModalController.open;
|
|
108
|
+
const t = o.getOverlayController(), {
|
|
109
|
+
action: e,
|
|
110
|
+
toggleOverlay: s,
|
|
111
|
+
closeOverlay: i,
|
|
112
|
+
openOverlay: n
|
|
113
|
+
} = o.actionProps;
|
|
114
|
+
return e || (n && t ? t.open : i && t || s && t ? t.close : U);
|
|
115
|
+
}
|
|
116
|
+
class v {
|
|
117
|
+
constructor(t) {
|
|
118
|
+
c(this, "actions", []);
|
|
119
|
+
c(this, "baseAction");
|
|
120
|
+
this.baseAction = t;
|
|
121
|
+
}
|
|
122
|
+
addAction(t) {
|
|
123
|
+
this.actions.push(t);
|
|
124
|
+
}
|
|
125
|
+
async executeBatch(t) {
|
|
126
|
+
if (this.actions.length === 0)
|
|
127
|
+
return;
|
|
128
|
+
const e = this.actions[this.actions.length - 1].actionProps.showFeedback, s = this.baseAction.state.withFeedback(
|
|
129
|
+
this.baseAction.needsConfirmation ? !1 : e
|
|
130
|
+
), i = this.actions.map((a) => j(a)), n = x(i);
|
|
131
|
+
let r;
|
|
132
|
+
if (await L(() => n(...t), {
|
|
133
|
+
onAsync: () => s.onAsyncStart(),
|
|
134
|
+
then: () => s.onSucceeded(),
|
|
135
|
+
catch: (a) => {
|
|
136
|
+
s.onFailed(a), r = a;
|
|
137
|
+
}
|
|
138
|
+
}), r)
|
|
139
|
+
throw r;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
class q {
|
|
143
|
+
constructor(t) {
|
|
144
|
+
c(this, "action");
|
|
145
|
+
c(this, "execute", (...t) => {
|
|
146
|
+
const e = this.getBatchedActions();
|
|
147
|
+
(async () => {
|
|
148
|
+
for (const i of e)
|
|
149
|
+
await i.executeBatch(t);
|
|
150
|
+
})().catch((i) => console.error(i));
|
|
151
|
+
});
|
|
152
|
+
c(this, "getBatchedActions", () => {
|
|
153
|
+
let t = this.action;
|
|
154
|
+
const e = [];
|
|
155
|
+
let s = new v(
|
|
156
|
+
this.action
|
|
157
|
+
), i = 0;
|
|
158
|
+
for (; t; ) {
|
|
159
|
+
const { action: n, break: r, skip: a } = t.actionProps;
|
|
160
|
+
if (t.needsConfirmation) {
|
|
161
|
+
s.addAction(t);
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
if (a) {
|
|
165
|
+
i = a === !0 ? 1 : a, t = t.parentAction;
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (i > 0) {
|
|
169
|
+
t = t.parentAction, i--;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (r)
|
|
173
|
+
break;
|
|
174
|
+
n || (e.push(s), s = new v(this.action)), s.addAction(t), t = t.parentAction;
|
|
175
|
+
}
|
|
176
|
+
return e.push(s), e;
|
|
177
|
+
});
|
|
178
|
+
this.action = t;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
class l {
|
|
182
|
+
constructor(t) {
|
|
183
|
+
c(this, "state");
|
|
184
|
+
c(this, "needsConfirmation");
|
|
185
|
+
c(this, "actionProps");
|
|
186
|
+
c(this, "parentAction");
|
|
187
|
+
c(this, "confirmationModalController");
|
|
188
|
+
c(this, "overlayController");
|
|
189
|
+
c(this, "execute", (...t) => {
|
|
190
|
+
new q(this).execute(...t);
|
|
191
|
+
});
|
|
192
|
+
const {
|
|
193
|
+
actionProps: e,
|
|
194
|
+
needsConfirmation: s,
|
|
195
|
+
parentAction: i,
|
|
196
|
+
overlayController: n,
|
|
197
|
+
confirmationModalController: r,
|
|
198
|
+
state: a
|
|
199
|
+
} = t;
|
|
200
|
+
this.actionProps = e, this.parentAction = i, this.confirmationModalController = r, this.needsConfirmation = s, this.overlayController = n, this.state = a;
|
|
201
|
+
}
|
|
202
|
+
static useNew(t, e = {}) {
|
|
203
|
+
const s = A(m), i = w(), n = w(), r = C.useNew();
|
|
204
|
+
return new l({
|
|
205
|
+
parentAction: s,
|
|
206
|
+
overlayController: i,
|
|
207
|
+
confirmationModalController: n,
|
|
208
|
+
needsConfirmation: !1,
|
|
209
|
+
actionProps: t,
|
|
210
|
+
state: r,
|
|
211
|
+
...e
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
static use() {
|
|
215
|
+
const t = A(m);
|
|
216
|
+
return D(!!t, "Action context is not defined"), T.useRegisterState(t.state), t;
|
|
217
|
+
}
|
|
218
|
+
static useConfirmationAction() {
|
|
219
|
+
const t = l.use();
|
|
220
|
+
return new l({
|
|
221
|
+
actionProps: t.actionProps,
|
|
222
|
+
confirmationModalController: t.confirmationModalController,
|
|
223
|
+
overlayController: t.overlayController,
|
|
224
|
+
state: t.state,
|
|
225
|
+
needsConfirmation: !1,
|
|
226
|
+
parentAction: l.useNew(
|
|
227
|
+
{
|
|
228
|
+
closeOverlay: !0
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
parentAction: t.parentAction
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
getOverlayController() {
|
|
237
|
+
const t = (e) => e === void 0 ? void 0 : e === !0 ? this.overlayController : e === !1 ? void 0 : e;
|
|
238
|
+
return t(this.actionProps.openOverlay) ?? t(this.actionProps.closeOverlay) ?? t(this.actionProps.toggleOverlay);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const z = (o) => V()[o], p = (o) => z("Modal") === "actionConfirm" ? N(o) : void 0, h = (o) => {
|
|
242
|
+
const t = l.use(), e = t.state.useValue(), s = p(o) === "primary", i = t.confirmationModalController.useIsOpen();
|
|
243
|
+
return t.needsConfirmation && i && !s ? "isIdle" : e;
|
|
244
|
+
}, it = (o) => {
|
|
245
|
+
const { children: t, ...e } = o, s = l.useNew(e), i = {
|
|
246
|
+
Button: {
|
|
247
|
+
onPress: u((n) => {
|
|
248
|
+
const r = l.use(), a = l.useConfirmationAction(), P = p(n) === "primary";
|
|
249
|
+
return p(n) === "abort" ? r.confirmationModalController.close : P ? a.execute : r.execute;
|
|
250
|
+
}),
|
|
251
|
+
isPending: u(
|
|
252
|
+
(n) => h(n) === "isPending"
|
|
253
|
+
),
|
|
254
|
+
isSucceeded: u(
|
|
255
|
+
(n) => h(n) === "isSucceeded"
|
|
256
|
+
),
|
|
257
|
+
isFailed: u((n) => h(n) === "isFailed"),
|
|
258
|
+
"aria-disabled": u(() => {
|
|
259
|
+
const n = h(o), r = R().useIsBusy();
|
|
260
|
+
return n === "isExecuting" || r;
|
|
261
|
+
})
|
|
262
|
+
},
|
|
263
|
+
Link: {
|
|
264
|
+
onPress: u(() => l.use().execute)
|
|
265
|
+
},
|
|
266
|
+
Modal: {
|
|
267
|
+
slot: u((n) => {
|
|
268
|
+
const { slot: r } = n, a = l.use();
|
|
269
|
+
return a.needsConfirmation = r === "actionConfirm", r;
|
|
270
|
+
}),
|
|
271
|
+
isDismissable: u((n) => l.use().state.useIsBusy() ? !1 : n.isDismissable),
|
|
272
|
+
controller: u(() => {
|
|
273
|
+
const n = l.use();
|
|
274
|
+
return n.needsConfirmation ? n.confirmationModalController : n.getOverlayController();
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
return /* @__PURE__ */ y.createElement(G, { value: s }, /* @__PURE__ */ y.createElement($, { props: i, mergeInParentContext: !0 }, t));
|
|
279
|
+
};
|
|
280
|
+
export {
|
|
281
|
+
it as A
|
|
282
|
+
};
|
package/dist/Action.js
CHANGED
package/dist/ActionGroup.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import o from "react";
|
|
4
|
-
import "./
|
|
5
|
-
import { P as
|
|
4
|
+
import "./propsContext-DzAKlmhS.js";
|
|
5
|
+
import { P as y } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
6
6
|
import "@react-aria/utils";
|
|
7
7
|
import "remeda";
|
|
8
|
-
import { d as
|
|
9
|
-
import
|
|
10
|
-
import { f as
|
|
11
|
-
import { TunnelProvider as
|
|
12
|
-
import { A as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
secondary: A,
|
|
8
|
+
import { d as e } from "./dynamic-ClpUSmEt.js";
|
|
9
|
+
import i from "clsx";
|
|
10
|
+
import { f as g } from "./flowComponent-CPKCCJEg.js";
|
|
11
|
+
import { TunnelProvider as E, TunnelExit as n } from "@mittwald/react-tunnel";
|
|
12
|
+
import { A as C, g as a } from "./getActionGroupSlot-izllH4ID.js";
|
|
13
|
+
const G = "flow--action-group--action-group-container", v = "flow--action-group", x = "flow--action-group--primary", N = "flow--action-group--secondary", P = "flow--action-group--abort", r = {
|
|
14
|
+
actionGroupContainer: G,
|
|
15
|
+
actionGroup: v,
|
|
16
|
+
primary: x,
|
|
17
|
+
secondary: N,
|
|
19
18
|
abort: P
|
|
20
|
-
},
|
|
21
|
-
const { children: m, className: l, refProp: p, ...u } = s, d =
|
|
19
|
+
}, k = g("ActionGroup", (s) => {
|
|
20
|
+
const { children: m, className: l, refProp: p, ...u } = s, d = i(r.actionGroupContainer, l), f = {
|
|
22
21
|
Button: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
tunnelId: e((t) => a(t)),
|
|
23
|
+
slot: e((t) => a(t)),
|
|
24
|
+
className: e((t) => {
|
|
25
|
+
const c = a(t);
|
|
26
|
+
return i(
|
|
27
|
+
t.className,
|
|
28
|
+
c !== "secondary" ? r[c] : void 0
|
|
27
29
|
);
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
tunnelId: g((r) => i(r))
|
|
30
|
+
})
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
return /* @__PURE__ */ o.createElement(
|
|
33
|
+
return /* @__PURE__ */ o.createElement(C, null, /* @__PURE__ */ o.createElement(y, { props: f, mergeInParentContext: !0 }, /* @__PURE__ */ o.createElement(E, null, /* @__PURE__ */ o.createElement("div", { ...u, className: d, ref: p }, /* @__PURE__ */ o.createElement("div", { className: r.actionGroup, role: "group" }, m, /* @__PURE__ */ o.createElement(n, { id: "primary" }), /* @__PURE__ */ o.createElement("div", { className: r.secondary }, /* @__PURE__ */ o.createElement(n, { id: "secondary" })), /* @__PURE__ */ o.createElement(n, { id: "abort" }))))));
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
k as ActionGroup,
|
|
37
|
+
k as default
|
|
38
38
|
};
|
package/dist/Avatar.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import i, { isValidElement as p } from "react";
|
|
4
4
|
import v from "clsx";
|
|
5
|
-
import { C as c } from "./ClearPropsContext-
|
|
6
|
-
import { P as f } from "./PropsContextProvider-
|
|
5
|
+
import { C as c } from "./ClearPropsContext-CUvsbMn8.js";
|
|
6
|
+
import { P as f } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
7
7
|
import "@react-aria/utils";
|
|
8
|
-
import "./
|
|
8
|
+
import "./propsContext-DzAKlmhS.js";
|
|
9
9
|
import "remeda";
|
|
10
10
|
import { hash as w } from "object-code";
|
|
11
11
|
import { deepForEach as z } from "react-children-utilities";
|
|
12
|
-
import { f as d } from "./flowComponent-
|
|
12
|
+
import { f as d } from "./flowComponent-CPKCCJEg.js";
|
|
13
13
|
const C = "flow--avatar", h = "flow--avatar--icon", x = "flow--avatar--initials", r = {
|
|
14
14
|
avatar: C,
|
|
15
15
|
icon: h,
|
package/dist/Breadcrumb.js
CHANGED
|
@@ -4,31 +4,33 @@ import r from "react";
|
|
|
4
4
|
import * as m from "react-aria-components";
|
|
5
5
|
import a from "clsx";
|
|
6
6
|
import "@tabler/icons-react";
|
|
7
|
-
import "./Icon-
|
|
8
|
-
import { I as
|
|
9
|
-
import "./
|
|
10
|
-
import { P as
|
|
7
|
+
import "./Icon-D4bkU_pz.js";
|
|
8
|
+
import { I as b } from "./IconChevronRight-DmCZeDFh.js";
|
|
9
|
+
import "./propsContext-DzAKlmhS.js";
|
|
10
|
+
import { P as d } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
11
11
|
import "@react-aria/utils";
|
|
12
12
|
import "remeda";
|
|
13
|
-
const
|
|
14
|
-
breadcrumb:
|
|
15
|
-
link:
|
|
16
|
-
breadcrumbItem:
|
|
17
|
-
icon:
|
|
18
|
-
dark:
|
|
19
|
-
light:
|
|
20
|
-
},
|
|
13
|
+
const u = "flow--breadcrumb", p = "flow--breadcrumb--link", f = "flow--breadcrumb--breadcrumb-item", h = "flow--breadcrumb--icon", k = "flow--breadcrumb--dark", w = "flow--breadcrumb--light", e = {
|
|
14
|
+
breadcrumb: u,
|
|
15
|
+
link: p,
|
|
16
|
+
breadcrumbItem: f,
|
|
17
|
+
icon: h,
|
|
18
|
+
dark: k,
|
|
19
|
+
light: w
|
|
20
|
+
}, N = (t) => {
|
|
21
21
|
const { children: o } = t, c = a(e.breadcrumbItem);
|
|
22
|
-
return /* @__PURE__ */ r.createElement(m.Breadcrumb, { className: c }, o, /* @__PURE__ */ r.createElement(
|
|
23
|
-
},
|
|
24
|
-
const { children: o, className: c, color: s = "primary", ...n } = t, l = a(e.breadcrumb, e[s], c),
|
|
22
|
+
return /* @__PURE__ */ r.createElement(m.Breadcrumb, { className: c }, o, /* @__PURE__ */ r.createElement(b, { size: "s", className: e.icon }));
|
|
23
|
+
}, R = (t) => {
|
|
24
|
+
const { children: o, className: c, color: s = "primary", ...n } = t, l = a(e.breadcrumb, e[s], c), i = {
|
|
25
25
|
Link: {
|
|
26
|
-
|
|
26
|
+
unstyled: !0,
|
|
27
|
+
className: e.link,
|
|
28
|
+
wrapWith: /* @__PURE__ */ r.createElement(N, null)
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
return /* @__PURE__ */ r.createElement(m.Breadcrumbs, { ...n, className: l }, /* @__PURE__ */ r.createElement(
|
|
31
|
+
return /* @__PURE__ */ r.createElement(m.Breadcrumbs, { ...n, className: l }, /* @__PURE__ */ r.createElement(d, { props: i }, o));
|
|
30
32
|
};
|
|
31
33
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
R as Breadcrumb,
|
|
35
|
+
R as default
|
|
34
36
|
};
|
|
@@ -3,28 +3,28 @@
|
|
|
3
3
|
import o, { useEffect as x } from "react";
|
|
4
4
|
import * as F from "react-aria-components";
|
|
5
5
|
import E from "clsx";
|
|
6
|
-
import { C as y } from "./ClearPropsContext-
|
|
7
|
-
import { P as C } from "./PropsContextProvider-
|
|
6
|
+
import { C as y } from "./ClearPropsContext-CUvsbMn8.js";
|
|
7
|
+
import { P as C } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
8
8
|
import "@react-aria/utils";
|
|
9
|
-
import "./
|
|
9
|
+
import "./propsContext-DzAKlmhS.js";
|
|
10
10
|
import "remeda";
|
|
11
11
|
import "@tabler/icons-react";
|
|
12
|
-
import "./Icon-
|
|
13
|
-
import { I as h, a as I } from "./IconSucceeded-
|
|
12
|
+
import "./Icon-D4bkU_pz.js";
|
|
13
|
+
import { I as h, a as I } from "./IconSucceeded-KKiDIenP.js";
|
|
14
14
|
import { W as f } from "./Wrap-DGT1h1o3.js";
|
|
15
|
-
import { T as N } from "./Text-
|
|
16
|
-
import { f as
|
|
17
|
-
import { L as k } from "./LoadingSpinner-
|
|
15
|
+
import { T as N } from "./Text-D6e-S6em.js";
|
|
16
|
+
import { f as B } from "./flowComponent-CPKCCJEg.js";
|
|
17
|
+
import { L as k } from "./LoadingSpinner-CoSM7GIL.js";
|
|
18
18
|
import { useLocalizedStringFormatter as A } from "react-aria";
|
|
19
19
|
import { useLiveRegion as D } from "@chakra-ui/live-region";
|
|
20
|
-
const T = "flow--button", z = "flow--button--content",
|
|
20
|
+
const T = "flow--button", z = "flow--button--content", L = "flow--button--state-icon", R = "flow--button--avatar", K = "flow--button--icon", U = "flow--button--text", W = "flow--button--counter-badge", $ = "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--dark", Y = "flow--button--light", Z = "flow--button--soft", t = {
|
|
21
21
|
button: T,
|
|
22
22
|
content: z,
|
|
23
|
-
stateIcon:
|
|
23
|
+
stateIcon: L,
|
|
24
24
|
avatar: R,
|
|
25
25
|
icon: K,
|
|
26
26
|
text: U,
|
|
27
|
-
|
|
27
|
+
counterBadge: W,
|
|
28
28
|
isSucceeded: $,
|
|
29
29
|
isFailed: j,
|
|
30
30
|
isPending: q,
|
|
@@ -64,7 +64,7 @@ const T = "flow--button", z = "flow--button--content", B = "flow--button--state-
|
|
|
64
64
|
x(() => {
|
|
65
65
|
e === "isPending" ? n.speak(s) : e === "isSucceeded" ? n.speak(c) : e === "isFailed" && n.speak(a);
|
|
66
66
|
}, [e]);
|
|
67
|
-
}, te = (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), ve =
|
|
67
|
+
}, te = (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), ve = B("Button", (e) => {
|
|
68
68
|
e = te(e);
|
|
69
69
|
const {
|
|
70
70
|
color: r = "primary",
|
|
@@ -73,17 +73,17 @@ const T = "flow--button", z = "flow--button--content", B = "flow--button--state-
|
|
|
73
73
|
className: c,
|
|
74
74
|
size: a = "m",
|
|
75
75
|
isPending: n,
|
|
76
|
-
isSucceeded:
|
|
77
|
-
isFailed:
|
|
78
|
-
"aria-disabled":
|
|
79
|
-
refProp:
|
|
76
|
+
isSucceeded: d,
|
|
77
|
+
isFailed: l,
|
|
78
|
+
"aria-disabled": g,
|
|
79
|
+
refProp: b,
|
|
80
80
|
unstyled: m,
|
|
81
81
|
...P
|
|
82
82
|
} = e, w = m ? c : E(
|
|
83
83
|
t.button,
|
|
84
84
|
n && t.isPending,
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
d && t.isSucceeded,
|
|
86
|
+
l && t.isFailed,
|
|
87
87
|
t[`size-${a}`],
|
|
88
88
|
t[r],
|
|
89
89
|
t[i],
|
|
@@ -92,10 +92,10 @@ const T = "flow--button", z = "flow--button--content", B = "flow--button--state-
|
|
|
92
92
|
* Workaround warning: The Aria.Button does not support "aria-disabled"
|
|
93
93
|
* by now, so this Button will be visually disabled via CSS.
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
g && t.ariaDisabled
|
|
96
96
|
);
|
|
97
97
|
ee(
|
|
98
|
-
n ? "isPending" :
|
|
98
|
+
n ? "isPending" : d ? "isSucceeded" : l ? "isFailed" : "isIdle"
|
|
99
99
|
);
|
|
100
100
|
const v = {
|
|
101
101
|
Icon: {
|
|
@@ -109,11 +109,11 @@ const T = "flow--button", z = "flow--button--content", B = "flow--button--state-
|
|
|
109
109
|
Avatar: {
|
|
110
110
|
className: t.avatar
|
|
111
111
|
},
|
|
112
|
-
|
|
113
|
-
className: t.
|
|
112
|
+
CounterBadge: {
|
|
113
|
+
className: t.counterBadge
|
|
114
114
|
}
|
|
115
|
-
}, u =
|
|
116
|
-
return /* @__PURE__ */ o.createElement(y, null, /* @__PURE__ */ o.createElement(F.Button, { className: w, ref:
|
|
115
|
+
}, u = d ? h : l ? I : n ? k : void 0, p = u && /* @__PURE__ */ o.createElement(u, { size: a, className: t.stateIcon }), S = typeof s == "string";
|
|
116
|
+
return /* @__PURE__ */ o.createElement(y, null, /* @__PURE__ */ o.createElement(F.Button, { className: w, ref: b, ...P }, /* @__PURE__ */ o.createElement(C, { props: v }, /* @__PURE__ */ o.createElement(f, { if: !m }, /* @__PURE__ */ o.createElement("span", { className: t.content }, /* @__PURE__ */ o.createElement(f, { if: S }, /* @__PURE__ */ o.createElement(N, null, s))))), p));
|
|
117
117
|
});
|
|
118
118
|
export {
|
|
119
119
|
ve as B
|
package/dist/Button.js
CHANGED
|
@@ -4,15 +4,15 @@ import e from "react";
|
|
|
4
4
|
import * as i from "react-aria-components";
|
|
5
5
|
import p from "clsx";
|
|
6
6
|
import "@tabler/icons-react";
|
|
7
|
-
import "./Icon-
|
|
8
|
-
import { I as x, a as f } from "./IconCheckboxEmpty-
|
|
9
|
-
import { I as h } from "./IconCheckboxIndeterminate-
|
|
10
|
-
import { C } from "./ClearPropsContext-
|
|
11
|
-
import "./
|
|
7
|
+
import "./Icon-D4bkU_pz.js";
|
|
8
|
+
import { I as x, a as f } from "./IconCheckboxEmpty-DQLeOSmS.js";
|
|
9
|
+
import { I as h } from "./IconCheckboxIndeterminate-DoNQre-9.js";
|
|
10
|
+
import { C } from "./ClearPropsContext-CUvsbMn8.js";
|
|
11
|
+
import "./propsContext-DzAKlmhS.js";
|
|
12
12
|
import "@react-aria/utils";
|
|
13
13
|
import "remeda";
|
|
14
14
|
import "dot-prop";
|
|
15
|
-
import { f as k } from "./flowComponent-
|
|
15
|
+
import { f as k } from "./flowComponent-CPKCCJEg.js";
|
|
16
16
|
const b = "flow--checkbox", E = "flow--checkbox--icon", o = {
|
|
17
17
|
checkbox: b,
|
|
18
18
|
icon: E
|
package/dist/Checkbox.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import o from "react";
|
|
4
4
|
import m from "clsx";
|
|
5
|
-
import { C as p } from "./ClearPropsContext-
|
|
6
|
-
import { P as b } from "./PropsContextProvider-
|
|
5
|
+
import { C as p } from "./ClearPropsContext-CUvsbMn8.js";
|
|
6
|
+
import { P as b } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
7
7
|
import "@react-aria/utils";
|
|
8
|
-
import "./
|
|
8
|
+
import "./propsContext-DzAKlmhS.js";
|
|
9
9
|
import "remeda";
|
|
10
|
-
import { C as x } from "./Checkbox-
|
|
11
|
-
import { f } from "./flowComponent-
|
|
10
|
+
import { C as x } from "./Checkbox-CD6v6jqo.js";
|
|
11
|
+
import { f } from "./flowComponent-CPKCCJEg.js";
|
|
12
12
|
const C = "flow--checkbox-button", i = "flow--checkbox-button--label", h = "flow--checkbox-button--content", t = {
|
|
13
13
|
checkboxButton: C,
|
|
14
14
|
label: i,
|
package/dist/CheckboxButton.js
CHANGED
package/dist/CheckboxGroup.js
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import e from "react";
|
|
4
4
|
import * as x from "react-aria-components";
|
|
5
5
|
import b from "clsx";
|
|
6
|
-
import "./
|
|
7
|
-
import { P as h } from "./PropsContextProvider-
|
|
6
|
+
import "./propsContext-DzAKlmhS.js";
|
|
7
|
+
import { P as h } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
8
8
|
import "@react-aria/utils";
|
|
9
9
|
import "remeda";
|
|
10
|
-
import { F as E } from "./FieldError-
|
|
11
|
-
import { C as k } from "./CheckboxButton-
|
|
10
|
+
import { F as E } from "./FieldError-D_VRyiJG.js";
|
|
11
|
+
import { C as k } from "./CheckboxButton-I0WYBLv2.js";
|
|
12
12
|
import { TunnelProvider as C, TunnelExit as r } from "@mittwald/react-tunnel";
|
|
13
13
|
import { s as o } from "./FormField.module-DHK6nIcD.js";
|
|
14
14
|
import { C as N } from "./ColumnLayout-FMONjI17.js";
|
|
15
15
|
import { d as F } from "./deepFindOfType-6pG0fH7S.js";
|
|
16
|
-
import { f as G } from "./flowComponent-
|
|
16
|
+
import { f as G } from "./flowComponent-CPKCCJEg.js";
|
|
17
17
|
const P = "flow--checkbox-group", s = {
|
|
18
18
|
checkboxGroup: P
|
|
19
19
|
}, j = G("CheckboxGroup", (l) => {
|