@mittwald/flow-react-components 0.1.0-alpha.157 → 0.1.0-alpha.158
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/NotificationProvider.js +18 -12
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var w = Object.defineProperty;
|
|
4
4
|
var A = (o, t, e) => t in o ? w(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
5
5
|
var i = (o, t, e) => A(o, typeof t != "symbol" ? t + "" : t, e);
|
|
6
|
-
import s, { useRef as v, cloneElement as
|
|
6
|
+
import s, { useRef as v, cloneElement as C, createContext as D, 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";
|
|
9
9
|
import { Duration as u, DateTime as m } from "luxon";
|
|
@@ -88,12 +88,12 @@ class a {
|
|
|
88
88
|
this.notificationsData.delete(t);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
const S = "flow--notification-provider--notification-container",
|
|
91
|
+
const S = "flow--notification-provider--notification-container", B = "flow--notification-provider--notification", d = {
|
|
92
92
|
notificationContainer: S,
|
|
93
|
-
notification:
|
|
94
|
-
},
|
|
93
|
+
notification: B
|
|
94
|
+
}, O = (o) => {
|
|
95
95
|
const { notification: t, controller: e } = o;
|
|
96
|
-
return
|
|
96
|
+
return C(t.element, {
|
|
97
97
|
onMouseEnter: () => {
|
|
98
98
|
t.meta.autoCloseTimer.pause();
|
|
99
99
|
},
|
|
@@ -102,10 +102,16 @@ const S = "flow--notification-provider--notification-container", O = "flow--noti
|
|
|
102
102
|
},
|
|
103
103
|
onClose: () => {
|
|
104
104
|
e.remove(t.meta.id);
|
|
105
|
+
},
|
|
106
|
+
onFocus: () => {
|
|
107
|
+
t.meta.autoCloseTimer.pause();
|
|
108
|
+
},
|
|
109
|
+
onBlur: () => {
|
|
110
|
+
t.meta.autoCloseTimer.resume();
|
|
105
111
|
}
|
|
106
112
|
});
|
|
107
|
-
},
|
|
108
|
-
const { className: t, ...e } = o, n =
|
|
113
|
+
}, z = (o) => {
|
|
114
|
+
const { className: t, ...e } = o, n = F(), 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(
|
|
109
115
|
k.div,
|
|
110
116
|
{
|
|
111
117
|
className: d.notification,
|
|
@@ -118,7 +124,7 @@ const S = "flow--notification-provider--notification-container", O = "flow--noti
|
|
|
118
124
|
}
|
|
119
125
|
},
|
|
120
126
|
/* @__PURE__ */ s.createElement(
|
|
121
|
-
|
|
127
|
+
O,
|
|
122
128
|
{
|
|
123
129
|
notification: r,
|
|
124
130
|
controller: n
|
|
@@ -126,14 +132,14 @@ const S = "flow--notification-provider--notification-container", O = "flow--noti
|
|
|
126
132
|
)
|
|
127
133
|
)))));
|
|
128
134
|
return h ? null : y.createPortal(T, document.body);
|
|
129
|
-
}, l =
|
|
135
|
+
}, l = D(
|
|
130
136
|
new a()
|
|
131
|
-
),
|
|
137
|
+
), F = () => N(l), W = (o) => {
|
|
132
138
|
const { children: t, ...e } = o, n = a.useNew();
|
|
133
|
-
return /* @__PURE__ */ s.createElement(l.Provider, { value: n }, /* @__PURE__ */ s.createElement(
|
|
139
|
+
return /* @__PURE__ */ s.createElement(l.Provider, { value: n }, /* @__PURE__ */ s.createElement(z, { ...e }), t);
|
|
134
140
|
};
|
|
135
141
|
export {
|
|
136
142
|
W as NotificationProvider,
|
|
137
143
|
W as default,
|
|
138
|
-
|
|
144
|
+
F as useNotificationController
|
|
139
145
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.158",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
"dependencies": {
|
|
281
281
|
"@chakra-ui/live-region": "^2.1.0",
|
|
282
282
|
"@internationalized/string-compiler": "^3.2.4",
|
|
283
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
283
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.158",
|
|
284
284
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
285
285
|
"@react-aria/utils": "^3.24.1",
|
|
286
286
|
"@react-types/shared": "^3.23.1",
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
},
|
|
308
308
|
"devDependencies": {
|
|
309
309
|
"@faker-js/faker": "^8.4.1",
|
|
310
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
310
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.158",
|
|
311
311
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
312
312
|
"@nx/storybook": "^19.3.0",
|
|
313
313
|
"@storybook/addon-a11y": "^8.1.10",
|
|
@@ -383,5 +383,5 @@
|
|
|
383
383
|
"optional": true
|
|
384
384
|
}
|
|
385
385
|
},
|
|
386
|
-
"gitHead": "
|
|
386
|
+
"gitHead": "a51c43dc244c5cf570c87fa2db483dbe0a60ee0f"
|
|
387
387
|
}
|