@mittwald/flow-react-components 0.1.0-alpha.136 → 0.1.0-alpha.137

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.
@@ -2,19 +2,19 @@
2
2
  /* */
3
3
  var S = Object.defineProperty;
4
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";
5
+ var a = (o, t, e) => (B(o, typeof t != "symbol" ? t + "" : t, e), e);
6
+ import A, { createContext as F, useRef as k, useContext as y } from "react";
7
+ import { makeObservable as O, observable as M, action as I, computed as E } from "mobx";
8
8
  import { u as w } from "./useOverlayController-CGKumeGL.js";
9
9
  import D from "invariant";
10
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";
11
+ import { a as T, g as N, u as R } from "./getActionGroupSlot-Do-bk4GU.js";
12
12
  import "./propsContext-DzAKlmhS.js";
13
- import { P as $ } from "./PropsContextProvider-C6Z4XGp6.js";
13
+ import { P as V } from "./PropsContextProvider-C6Z4XGp6.js";
14
14
  import "@react-aria/utils";
15
15
  import "remeda";
16
16
  import { d as u } from "./dynamic-ClpUSmEt.js";
17
- import { u as V } from "./slotContext-DoCFkzCA.js";
17
+ import { u as $ } from "./slotContext-DoCFkzCA.js";
18
18
  const m = F(void 0), G = m.Provider, g = (o) => new Promise((t) => setTimeout(t, o)), f = {
19
19
  pending: 1e3,
20
20
  succeeded: 1500,
@@ -22,14 +22,14 @@ const m = F(void 0), G = m.Provider, g = (o) => new Promise((t) => setTimeout(t,
22
22
  };
23
23
  class C {
24
24
  constructor() {
25
- c(this, "showFeedback");
26
- c(this, "state", "isIdle");
27
- c(this, "setPendingTimeout");
28
- c(this, "error");
29
- c(this, "isAsync", !1);
25
+ a(this, "showFeedback");
26
+ a(this, "state", "isIdle");
27
+ a(this, "setPendingTimeout");
28
+ a(this, "error");
29
+ a(this, "isAsync", !1);
30
30
  O(this, {
31
- state: I,
32
- updateState: M,
31
+ state: M,
32
+ updateState: I,
33
33
  isBusy: E
34
34
  });
35
35
  }
@@ -46,7 +46,7 @@ class C {
46
46
  return b(() => this.isBusy, [this]);
47
47
  }
48
48
  get isBusy() {
49
- return this.state === "isExecuting" || this.state === "isPending";
49
+ return this.state !== "isIdle";
50
50
  }
51
51
  onAsyncStart() {
52
52
  this.isAsync = !0, this.updateState("isExecuting"), this.setPendingTimeout = window.setTimeout(
@@ -79,26 +79,26 @@ class C {
79
79
  this.updateState("isPending");
80
80
  }
81
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();
82
+ const P = (o) => (...t) => {
83
+ const e = [...o], n = e.shift();
84
+ if (n) {
85
+ const s = n(...t), i = () => e.length === 0 ? s : P(e)(...t);
86
+ return s instanceof Promise ? s.then(i) : i();
87
87
  }
88
88
  }, d = () => {
89
89
  }, L = (o, t = {}) => {
90
90
  const {
91
91
  onSync: e = d,
92
- onAsync: s = d,
93
- then: i = d,
94
- catch: n = d,
95
- finally: r = d
92
+ onAsync: n = d,
93
+ then: s = d,
94
+ catch: i = d,
95
+ finally: c = d
96
96
  } = t;
97
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();
98
+ const r = o();
99
+ return r instanceof Promise ? (n(), r.then(s).catch(i).finally(c)) : (e(), s(r), c(), r);
100
+ } catch (r) {
101
+ e(), i(r), c();
102
102
  }
103
103
  }, U = () => {
104
104
  };
@@ -107,16 +107,16 @@ function j(o) {
107
107
  return o.confirmationModalController.open;
108
108
  const t = o.getOverlayController(), {
109
109
  action: e,
110
- toggleOverlay: s,
111
- closeOverlay: i,
112
- openOverlay: n
110
+ toggleOverlay: n,
111
+ closeOverlay: s,
112
+ openOverlay: i
113
113
  } = o.actionProps;
114
- return e || (n && t ? t.open : i && t || s && t ? t.close : U);
114
+ return e || (i && t ? t.open : s && t || n && t ? t.close : U);
115
115
  }
116
116
  class v {
117
117
  constructor(t) {
118
- c(this, "actions", []);
119
- c(this, "baseAction");
118
+ a(this, "actions", []);
119
+ a(this, "baseAction");
120
120
  this.baseAction = t;
121
121
  }
122
122
  addAction(t) {
@@ -125,94 +125,94 @@ class v {
125
125
  async executeBatch(t) {
126
126
  if (this.actions.length === 0)
127
127
  return;
128
- const e = this.actions[this.actions.length - 1].actionProps.showFeedback, s = this.baseAction.state.withFeedback(
128
+ const e = this.actions[this.actions.length - 1].actionProps.showFeedback, n = this.baseAction.state.withFeedback(
129
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;
130
+ ), s = this.actions.map((r) => j(r)), i = P(s);
131
+ let c;
132
+ if (await L(() => i(...t), {
133
+ onAsync: () => n.onAsyncStart(),
134
+ then: () => n.onSucceeded(),
135
+ catch: (r) => {
136
+ n.onFailed(r), c = r;
137
137
  }
138
- }), r)
139
- throw r;
138
+ }), c)
139
+ throw c;
140
140
  }
141
141
  }
142
142
  class q {
143
143
  constructor(t) {
144
- c(this, "action");
145
- c(this, "execute", (...t) => {
144
+ a(this, "action");
145
+ a(this, "execute", (...t) => {
146
146
  const e = this.getBatchedActions();
147
147
  (async () => {
148
- for (const i of e)
149
- await i.executeBatch(t);
150
- })().catch((i) => console.error(i));
148
+ for (const s of e)
149
+ await s.executeBatch(t);
150
+ })().catch((s) => console.error(s));
151
151
  });
152
- c(this, "getBatchedActions", () => {
152
+ a(this, "getBatchedActions", () => {
153
153
  let t = this.action;
154
154
  const e = [];
155
- let s = new v(
155
+ let n = new v(
156
156
  this.action
157
- ), i = 0;
157
+ ), s = 0;
158
158
  for (; t; ) {
159
- const { action: n, break: r, skip: a } = t.actionProps;
159
+ const { action: i, break: c, skip: r } = t.actionProps;
160
160
  if (t.needsConfirmation) {
161
- s.addAction(t);
161
+ n.addAction(t);
162
162
  break;
163
163
  }
164
- if (a) {
165
- i = a === !0 ? 1 : a, t = t.parentAction;
164
+ if (r) {
165
+ s = r === !0 ? 1 : r, t = t.parentAction;
166
166
  continue;
167
167
  }
168
- if (i > 0) {
169
- t = t.parentAction, i--;
168
+ if (s > 0) {
169
+ t = t.parentAction, s--;
170
170
  continue;
171
171
  }
172
- if (r)
172
+ if (c)
173
173
  break;
174
- n || (e.push(s), s = new v(this.action)), s.addAction(t), t = t.parentAction;
174
+ i || (e.push(n), n = new v(this.action)), n.addAction(t), t = t.parentAction;
175
175
  }
176
- return e.push(s), e;
176
+ return e.push(n), e;
177
177
  });
178
178
  this.action = t;
179
179
  }
180
180
  }
181
181
  class l {
182
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) => {
183
+ a(this, "state");
184
+ a(this, "needsConfirmation");
185
+ a(this, "actionProps");
186
+ a(this, "parentAction");
187
+ a(this, "confirmationModalController");
188
+ a(this, "overlayController");
189
+ a(this, "execute", (...t) => {
190
190
  new q(this).execute(...t);
191
191
  });
192
192
  const {
193
193
  actionProps: e,
194
- needsConfirmation: s,
195
- parentAction: i,
196
- overlayController: n,
197
- confirmationModalController: r,
198
- state: a
194
+ needsConfirmation: n,
195
+ parentAction: s,
196
+ overlayController: i,
197
+ confirmationModalController: c,
198
+ state: r
199
199
  } = t;
200
- this.actionProps = e, this.parentAction = i, this.confirmationModalController = r, this.needsConfirmation = s, this.overlayController = n, this.state = a;
200
+ this.actionProps = e, this.parentAction = s, this.confirmationModalController = c, this.needsConfirmation = n, this.overlayController = i, this.state = r;
201
201
  }
202
202
  static useNew(t, e = {}) {
203
- const s = A(m), i = w(), n = w(), r = C.useNew();
203
+ const n = y(m), s = w(), i = w(), c = C.useNew();
204
204
  return new l({
205
- parentAction: s,
206
- overlayController: i,
207
- confirmationModalController: n,
205
+ parentAction: n,
206
+ overlayController: s,
207
+ confirmationModalController: i,
208
208
  needsConfirmation: !1,
209
209
  actionProps: t,
210
- state: r,
210
+ state: c,
211
211
  ...e
212
212
  });
213
213
  }
214
214
  static use() {
215
- const t = A(m);
215
+ const t = y(m);
216
216
  return D(!!t, "Action context is not defined"), T.useRegisterState(t.state), t;
217
217
  }
218
218
  static useConfirmationAction() {
@@ -238,45 +238,49 @@ class l {
238
238
  return t(this.actionProps.openOverlay) ?? t(this.actionProps.closeOverlay) ?? t(this.actionProps.toggleOverlay);
239
239
  }
240
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
- },
241
+ const z = (o) => $()[o], p = (o) => z("Modal") === "actionConfirm" ? N(o) : void 0, h = (o) => {
242
+ const t = l.use(), e = t.state.useValue(), n = p(o) === "primary", s = t.confirmationModalController.useIsOpen();
243
+ return t.needsConfirmation && s && !n ? "isIdle" : e;
244
+ }, x = {
245
+ onPress: u((o) => {
246
+ const t = l.use(), e = l.useConfirmationAction(), n = p(o) === "primary";
247
+ return p(o) === "abort" ? t.confirmationModalController.close : n ? e.execute : t.execute;
248
+ }),
249
+ isPending: u((o) => h(o) === "isPending"),
250
+ isSucceeded: u(
251
+ (o) => h(o) === "isSucceeded"
252
+ ),
253
+ isFailed: u((o) => h(o) === "isFailed"),
254
+ "aria-disabled": u((o) => {
255
+ const t = h(o), e = R().useIsBusy();
256
+ return t === "isExecuting" || e;
257
+ })
258
+ }, st = (o) => {
259
+ const { children: t, ...e } = o, n = l.useNew(e), s = {
260
+ Button: x,
263
261
  Link: {
264
262
  onPress: u(() => l.use().execute)
265
263
  },
266
264
  Modal: {
267
- slot: u((n) => {
268
- const { slot: r } = n, a = l.use();
269
- return a.needsConfirmation = r === "actionConfirm", r;
265
+ slot: u((i) => {
266
+ const { slot: c } = i, r = l.use();
267
+ return r.needsConfirmation = c === "actionConfirm", c;
268
+ }),
269
+ isDismissable: u((i) => {
270
+ const r = l.use().state.useValue();
271
+ return r === "isExecuting" || r === "isPending" ? !1 : i.isDismissable;
270
272
  }),
271
- isDismissable: u((n) => l.use().state.useIsBusy() ? !1 : n.isDismissable),
272
273
  controller: u(() => {
273
- const n = l.use();
274
- return n.needsConfirmation ? n.confirmationModalController : n.getOverlayController();
275
- })
274
+ const i = l.use();
275
+ return i.needsConfirmation ? i.confirmationModalController : i.getOverlayController();
276
+ }),
277
+ ActionGroup: {
278
+ Button: x
279
+ }
276
280
  }
277
281
  };
278
- return /* @__PURE__ */ y.createElement(G, { value: s }, /* @__PURE__ */ y.createElement($, { props: i, mergeInParentContext: !0 }, t));
282
+ return /* @__PURE__ */ A.createElement(G, { value: n }, /* @__PURE__ */ A.createElement(V, { props: s, mergeInParentContext: !0 }, t));
279
283
  };
280
284
  export {
281
- it as A
285
+ st as A
282
286
  };
package/dist/Action.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
- import { A as t } from "./Action-Dp9FyJCZ.js";
3
+ import { A as t } from "./Action-BGsLXvb9.js";
4
4
  export {
5
5
  t as Action,
6
6
  t as default
@@ -9,7 +9,7 @@ import { d as e } from "./dynamic-ClpUSmEt.js";
9
9
  import i from "clsx";
10
10
  import { f as g } from "./flowComponent-CPKCCJEg.js";
11
11
  import { TunnelProvider as E, TunnelExit as n } from "@mittwald/react-tunnel";
12
- import { A as C, g as a } from "./getActionGroupSlot-izllH4ID.js";
12
+ import { A as C, g as a } from "./getActionGroupSlot-Do-bk4GU.js";
13
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
14
  actionGroupContainer: G,
15
15
  actionGroup: v,
@@ -15,7 +15,7 @@ import "@react-aria/utils";
15
15
  import "remeda";
16
16
  import "dot-prop";
17
17
  import { f as C } from "./flowComponent-CPKCCJEg.js";
18
- import { A as E } from "./Action-Dp9FyJCZ.js";
18
+ import { A as E } from "./Action-BGsLXvb9.js";
19
19
  const B = {
20
20
  "de-DE": {
21
21
  "copyButton.copy": "Kopieren"
package/dist/Modal.js CHANGED
@@ -11,7 +11,7 @@ import { f as u } from "./flowComponent-CPKCCJEg.js";
11
11
  import { M as g } from "./ModalOverlay-BSu4UEnW.js";
12
12
  import * as v from "react-aria-components";
13
13
  import { O as w } from "./OverlayTrigger-DbjMkqKf.js";
14
- const z = "flow--modal", C = "flow--modal--action-group", E = "flow--modal--content", x = "flow--modal--off-canvas", e = {
14
+ const z = "flow--modal", C = "flow--modal--action-group", E = "flow--modal--content", T = "flow--modal--off-canvas", e = {
15
15
  modal: z,
16
16
  "modal-zoom": "flow--modal--modal-zoom",
17
17
  actionGroup: C,
@@ -19,20 +19,20 @@ const z = "flow--modal", C = "flow--modal--action-group", E = "flow--modal--cont
19
19
  "size-s": "flow--modal--size-s",
20
20
  "size-m": "flow--modal--size-m",
21
21
  "size-l": "flow--modal--size-l",
22
- offCanvas: x,
22
+ offCanvas: T,
23
23
  "modal-slide-in": "flow--modal--modal-slide-in",
24
24
  "modal-slide-up": "flow--modal--modal-slide-up"
25
- }, R = u("Modal", (t) => {
25
+ }, D = u("Modal", (l) => {
26
26
  const {
27
- size: l = "s",
27
+ size: t = "s",
28
28
  offCanvas: a,
29
29
  controller: n,
30
30
  children: r,
31
- refProp: P,
31
+ refProp: x,
32
32
  ...m
33
- } = t, s = d(
33
+ } = l, s = d(
34
34
  e.modal,
35
- e[`size-${l}`],
35
+ e[`size-${t}`],
36
36
  a && e.offCanvas
37
37
  ), i = {
38
38
  Content: {
@@ -47,10 +47,10 @@ const z = "flow--modal", C = "flow--modal--action-group", E = "flow--modal--cont
47
47
  tunnelId: "buttons"
48
48
  }
49
49
  };
50
- return /* @__PURE__ */ o.createElement(g, { className: s, controller: n, ...m }, /* @__PURE__ */ o.createElement(c, { props: i, mergeInParentContext: !0 }, /* @__PURE__ */ o.createElement(f, null, /* @__PURE__ */ o.createElement("div", { className: e.content }, r), /* @__PURE__ */ o.createElement(p, { id: "buttons" }))));
51
- }), D = (t) => /* @__PURE__ */ o.createElement(w, null, /* @__PURE__ */ o.createElement(v.DialogTrigger, null, t.children));
50
+ return /* @__PURE__ */ o.createElement(g, { className: s, controller: n, ...m }, /* @__PURE__ */ o.createElement(c, { props: i }, /* @__PURE__ */ o.createElement(f, null, /* @__PURE__ */ o.createElement("div", { className: e.content }, r), /* @__PURE__ */ o.createElement(p, { id: "buttons" }))));
51
+ }), F = (l) => /* @__PURE__ */ o.createElement(w, null, /* @__PURE__ */ o.createElement(v.DialogTrigger, null, l.children));
52
52
  export {
53
- R as Modal,
54
- D as ModalTrigger,
55
- R as default
53
+ D as Modal,
54
+ F as ModalTrigger,
55
+ D as default
56
56
  };
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  /* */
3
3
  var w = Object.defineProperty;
4
- var A = (i, t, e) => t in i ? w(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
5
- var o = (i, t, e) => (A(i, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var A = (o, t, e) => t in o ? w(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
5
+ var i = (o, t, e) => (A(o, typeof t != "symbol" ? t + "" : t, e), e);
6
6
  import s, { useRef as v, cloneElement as D, createContext as C, useContext as N } from "react";
7
7
  import { u as E } from "./useSelector-DpU7_HMO.js";
8
8
  import { makeObservable as g, observable as x, action as c } from "mobx";
@@ -13,11 +13,11 @@ import { LazyMotion as I, domAnimation as M, AnimatePresence as P, m as k } from
13
13
  import { useIsSSR as L } from "react-aria";
14
14
  class R {
15
15
  constructor() {
16
- o(this, "duration", u.fromDurationLike(0));
17
- o(this, "onDone");
18
- o(this, "startedAt");
19
- o(this, "pausedAt");
20
- o(this, "runningTimeoutId");
16
+ i(this, "duration", u.fromDurationLike(0));
17
+ i(this, "onDone");
18
+ i(this, "startedAt");
19
+ i(this, "pausedAt");
20
+ i(this, "runningTimeoutId");
21
21
  }
22
22
  start(t, e) {
23
23
  if (this.startedAt)
@@ -58,8 +58,8 @@ class R {
58
58
  }
59
59
  class a {
60
60
  constructor() {
61
- o(this, "notificationsData", /* @__PURE__ */ new Map());
62
- o(this, "id", 0);
61
+ i(this, "notificationsData", /* @__PURE__ */ new Map());
62
+ i(this, "id", 0);
63
63
  g(this, {
64
64
  notificationsData: x.shallow,
65
65
  add: c.bound,
@@ -92,8 +92,8 @@ class a {
92
92
  const S = "flow--notification-provider--notification-container", O = "flow--notification-provider--notification", d = {
93
93
  notificationContainer: S,
94
94
  notification: O
95
- }, z = (i) => {
96
- const { notification: t, controller: e } = i;
95
+ }, z = (o) => {
96
+ const { notification: t, controller: e } = o;
97
97
  return D(t.element, {
98
98
  onMouseEnter: () => {
99
99
  t.meta.autoCloseTimer.pause();
@@ -105,8 +105,8 @@ const S = "flow--notification-provider--notification-container", O = "flow--noti
105
105
  e.remove(t.meta.id);
106
106
  }
107
107
  });
108
- }, B = (i) => {
109
- const { className: t, controller: e, ...n } = i, f = b(d.notificationContainer, t), h = e.useNotifications(), p = L(), T = /* @__PURE__ */ s.createElement(I, { features: M }, /* @__PURE__ */ s.createElement("div", { className: f, ...n }, /* @__PURE__ */ s.createElement(P, null, h.map((r) => /* @__PURE__ */ s.createElement(
108
+ }, B = (o) => {
109
+ const { className: t, ...e } = o, n = j(), f = n.useNotifications(), h = L(), p = b(d.notificationContainer, t), T = /* @__PURE__ */ s.createElement(I, { features: M }, /* @__PURE__ */ s.createElement("div", { className: p, ...e }, /* @__PURE__ */ s.createElement(P, null, f.map((r) => /* @__PURE__ */ s.createElement(
110
110
  k.div,
111
111
  {
112
112
  className: d.notification,
@@ -122,19 +122,19 @@ const S = "flow--notification-provider--notification-container", O = "flow--noti
122
122
  z,
123
123
  {
124
124
  notification: r,
125
- controller: e
125
+ controller: n
126
126
  }
127
127
  )
128
128
  )))));
129
- return p ? null : y.createPortal(T, document.body);
129
+ return h ? null : y.createPortal(T, document.body);
130
130
  }, l = C(
131
131
  new a()
132
- ), V = () => N(l), W = (i) => {
133
- const { children: t, ...e } = i, n = a.useNew();
134
- return /* @__PURE__ */ s.createElement(l.Provider, { value: n }, /* @__PURE__ */ s.createElement(B, { controller: n, ...e }), t);
132
+ ), j = () => N(l), W = (o) => {
133
+ const { children: t, ...e } = o, n = a.useNew();
134
+ return /* @__PURE__ */ s.createElement(l.Provider, { value: n }, /* @__PURE__ */ s.createElement(B, { ...e }), t);
135
135
  };
136
136
  export {
137
137
  W as NotificationProvider,
138
138
  W as default,
139
- V as useNotificationController
139
+ j as useNotificationController
140
140
  };
package/dist/OffCanvas.js CHANGED
@@ -6,7 +6,7 @@ import { B as f } from "./Button-BPAhEOTg.js";
6
6
  import "@tabler/icons-react";
7
7
  import "./Icon-D4bkU_pz.js";
8
8
  import { I as m } from "./IconClose-FTrJdf_N.js";
9
- import { A as i } from "./Action-Dp9FyJCZ.js";
9
+ import { A as i } from "./Action-BGsLXvb9.js";
10
10
  import { M as p } from "./ModalOverlay-BSu4UEnW.js";
11
11
  import "./propsContext-DzAKlmhS.js";
12
12
  import { P as v } from "./PropsContextProvider-C6Z4XGp6.js";
@@ -4,8 +4,8 @@ var u = Object.defineProperty;
4
4
  var i = (s, t, e) => t in s ? u(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
5
5
  var r = (s, t, e) => (i(s, typeof t != "symbol" ? t + "" : t, e), e);
6
6
  import d, { createContext as l, useRef as m, useEffect as S, useContext as f } from "react";
7
- import { makeObservable as p, observable as v, action as a, computed as h } from "mobx";
8
- import { u as y } from "./useSelector-DpU7_HMO.js";
7
+ import { makeObservable as p, observable as v, action as a, computed as y } from "mobx";
8
+ import { u as b } from "./useSelector-DpU7_HMO.js";
9
9
  class o {
10
10
  constructor() {
11
11
  r(this, "states", /* @__PURE__ */ new Set());
@@ -13,14 +13,14 @@ class o {
13
13
  states: v,
14
14
  addState: a,
15
15
  removeState: a,
16
- isBusy: h
16
+ isBusy: y
17
17
  });
18
18
  }
19
19
  static useNew() {
20
20
  return m(new o()).current;
21
21
  }
22
22
  static useRegisterState(t) {
23
- const e = b();
23
+ const e = g();
24
24
  S(() => (e == null || e.addState(t), () => {
25
25
  e == null || e.removeState(t);
26
26
  }), [e, t]);
@@ -32,7 +32,7 @@ class o {
32
32
  this.states.delete(t);
33
33
  }
34
34
  useIsBusy() {
35
- return y(() => this.isBusy, [this.states.size]);
35
+ return b(() => this.isBusy);
36
36
  }
37
37
  get isBusy() {
38
38
  for (const t of this.states)
@@ -44,7 +44,7 @@ class o {
44
44
  const n = l(void 0), C = (s) => {
45
45
  const { children: t } = s, e = o.useNew();
46
46
  return /* @__PURE__ */ d.createElement(n.Provider, { value: e }, t);
47
- }, b = () => {
47
+ }, g = () => {
48
48
  const s = o.useNew();
49
49
  return f(n) ?? s;
50
50
  }, A = (s) => {
@@ -55,5 +55,5 @@ export {
55
55
  C as A,
56
56
  o as a,
57
57
  A as g,
58
- b as u
58
+ g as u
59
59
  };
@@ -0,0 +1,5 @@
1
+ import { ComponentProps, FC } from 'react';
2
+
3
+ export type NotificationsContainerProps = ComponentProps<"div">;
4
+ export declare const NotificationContainer: FC<NotificationsContainerProps>;
5
+ export default NotificationContainer;
@@ -1,7 +1,8 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { default as NotificationController } from './NotificationController';
3
+ import { NotificationsContainerProps } from './NotificationContainer';
3
4
 
4
- type Props = PropsWithChildren;
5
+ type Props = PropsWithChildren<NotificationsContainerProps>;
5
6
  export declare const useNotificationController: () => NotificationController;
6
7
  export declare const NotificationProvider: FC<Props>;
7
8
  export default NotificationProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.136",
3
+ "version": "0.1.0-alpha.137",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -271,7 +271,7 @@
271
271
  },
272
272
  "dependencies": {
273
273
  "@chakra-ui/live-region": "^2.1.0",
274
- "@mittwald/react-tunnel": "^0.1.0-alpha.136",
274
+ "@mittwald/react-tunnel": "^0.1.0-alpha.137",
275
275
  "@mittwald/react-use-promise": "^2.3.13",
276
276
  "@react-aria/utils": "^3.24.1",
277
277
  "@react-types/shared": "^3.23.1",
@@ -298,7 +298,7 @@
298
298
  },
299
299
  "devDependencies": {
300
300
  "@faker-js/faker": "^8.4.1",
301
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.136",
301
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.137",
302
302
  "@mittwald/react-use-promise": "^2.3.13",
303
303
  "@nx/storybook": "^19.1.2",
304
304
  "@storybook/addon-a11y": "^8.1.5",
@@ -374,5 +374,5 @@
374
374
  "optional": true
375
375
  }
376
376
  },
377
- "gitHead": "670d2ad6f55eac8e94a114df0060adb77d364c3a"
377
+ "gitHead": "0b61dc89158f322fffd8e9618520400e43115827"
378
378
  }
@@ -1,8 +0,0 @@
1
- import { ComponentProps, FC } from 'react';
2
- import { default as NotificationController } from './NotificationController';
3
-
4
- export interface NotificationsContainerProps extends ComponentProps<"div"> {
5
- controller: NotificationController;
6
- }
7
- export declare const NotificationsContainer: FC<NotificationsContainerProps>;
8
- export default NotificationsContainer;