@notificationapi/react 0.0.5 → 0.0.6

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.
@@ -0,0 +1,269 @@
1
+ import * as a from "react";
2
+ import { g as z, m as D, r as M, P as R, a as $, c as P, b as V } from "./colors.js";
3
+ import { i as A, g as H, a as K, b as L, P as F, u as G, c as U, d as X, K as Y } from "./index3.js";
4
+ const C = (e) => e ? typeof e == "function" ? e() : e : null, Z = (e) => {
5
+ const {
6
+ componentCls: n,
7
+ popoverColor: o,
8
+ titleMinWidth: t,
9
+ fontWeightStrong: r,
10
+ innerPadding: l,
11
+ boxShadowSecondary: i,
12
+ colorTextHeading: c,
13
+ borderRadiusLG: d,
14
+ zIndexPopup: f,
15
+ titleMarginBottom: p,
16
+ colorBgElevated: v,
17
+ popoverBg: u,
18
+ titleBorderBottom: m,
19
+ innerContentPadding: y,
20
+ titlePadding: g
21
+ } = e;
22
+ return [
23
+ {
24
+ [n]: Object.assign(Object.assign({}, M(e)), {
25
+ position: "absolute",
26
+ top: 0,
27
+ // use `left` to fix https://github.com/ant-design/ant-design/issues/39195
28
+ left: {
29
+ _skip_check_: !0,
30
+ value: 0
31
+ },
32
+ zIndex: f,
33
+ fontWeight: "normal",
34
+ whiteSpace: "normal",
35
+ textAlign: "start",
36
+ cursor: "auto",
37
+ userSelect: "text",
38
+ transformOrigin: "var(--arrow-x, 50%) var(--arrow-y, 50%)",
39
+ "--antd-arrow-background-color": v,
40
+ width: "max-content",
41
+ maxWidth: "100vw",
42
+ "&-rtl": {
43
+ direction: "rtl"
44
+ },
45
+ "&-hidden": {
46
+ display: "none"
47
+ },
48
+ [`${n}-content`]: {
49
+ position: "relative"
50
+ },
51
+ [`${n}-inner`]: {
52
+ backgroundColor: u,
53
+ backgroundClip: "padding-box",
54
+ borderRadius: d,
55
+ boxShadow: i,
56
+ padding: l
57
+ },
58
+ [`${n}-title`]: {
59
+ minWidth: t,
60
+ marginBottom: p,
61
+ color: c,
62
+ fontWeight: r,
63
+ borderBottom: m,
64
+ padding: g
65
+ },
66
+ [`${n}-inner-content`]: {
67
+ color: o,
68
+ padding: y
69
+ }
70
+ })
71
+ },
72
+ // Arrow Style
73
+ H(e, "var(--antd-arrow-background-color)"),
74
+ // Pure Render
75
+ {
76
+ [`${n}-pure`]: {
77
+ position: "relative",
78
+ maxWidth: "none",
79
+ margin: e.sizePopupArrow,
80
+ display: "inline-block",
81
+ [`${n}-content`]: {
82
+ display: "inline-block"
83
+ }
84
+ }
85
+ }
86
+ ];
87
+ }, q = (e) => {
88
+ const {
89
+ componentCls: n
90
+ } = e;
91
+ return {
92
+ [n]: R.map((o) => {
93
+ const t = e[`${o}6`];
94
+ return {
95
+ [`&${n}-${o}`]: {
96
+ "--antd-arrow-background-color": t,
97
+ [`${n}-inner`]: {
98
+ backgroundColor: t
99
+ },
100
+ [`${n}-arrow`]: {
101
+ background: "transparent"
102
+ }
103
+ }
104
+ };
105
+ })
106
+ };
107
+ }, J = (e) => {
108
+ const {
109
+ lineWidth: n,
110
+ controlHeight: o,
111
+ fontHeight: t,
112
+ padding: r,
113
+ wireframe: l,
114
+ zIndexPopupBase: i,
115
+ borderRadiusLG: c,
116
+ marginXS: d,
117
+ lineType: f,
118
+ colorSplit: p,
119
+ paddingSM: v
120
+ } = e, u = o - t, m = u / 2, y = u / 2 - n, g = r;
121
+ return Object.assign(Object.assign(Object.assign({
122
+ titleMinWidth: 177,
123
+ zIndexPopup: i + 30
124
+ }, K(e)), L({
125
+ contentRadius: c,
126
+ limitVerticalRadius: !0
127
+ })), {
128
+ // internal
129
+ innerPadding: l ? 0 : 12,
130
+ titleMarginBottom: l ? 0 : d,
131
+ titlePadding: l ? `${m}px ${g}px ${y}px` : 0,
132
+ titleBorderBottom: l ? `${n}px ${f} ${p}` : "none",
133
+ innerContentPadding: l ? `${v}px ${g}px` : 0
134
+ });
135
+ }, S = z("Popover", (e) => {
136
+ const {
137
+ colorBgElevated: n,
138
+ colorText: o
139
+ } = e, t = D(e, {
140
+ popoverBg: n,
141
+ popoverColor: o
142
+ });
143
+ return [Z(t), q(t), A(t, "zoom-big")];
144
+ }, J, {
145
+ resetStyle: !1,
146
+ deprecatedTokens: [["width", "titleMinWidth"], ["minWidth", "titleMinWidth"]]
147
+ });
148
+ var Q = function(e, n) {
149
+ var o = {};
150
+ for (var t in e)
151
+ Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
152
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
153
+ for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
154
+ n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (o[t[r]] = e[t[r]]);
155
+ return o;
156
+ };
157
+ const ee = (e, n, o) => !n && !o ? null : /* @__PURE__ */ a.createElement(a.Fragment, null, n && /* @__PURE__ */ a.createElement("div", {
158
+ className: `${e}-title`
159
+ }, C(n)), /* @__PURE__ */ a.createElement("div", {
160
+ className: `${e}-inner-content`
161
+ }, C(o))), te = (e) => {
162
+ const {
163
+ hashId: n,
164
+ prefixCls: o,
165
+ className: t,
166
+ style: r,
167
+ placement: l = "top",
168
+ title: i,
169
+ content: c,
170
+ children: d
171
+ } = e;
172
+ return /* @__PURE__ */ a.createElement("div", {
173
+ className: P(n, o, `${o}-pure`, `${o}-placement-${l}`, t),
174
+ style: r
175
+ }, /* @__PURE__ */ a.createElement("div", {
176
+ className: `${o}-arrow`
177
+ }), /* @__PURE__ */ a.createElement(F, Object.assign({}, e, {
178
+ className: n,
179
+ prefixCls: o
180
+ }), d || ee(o, i, c)));
181
+ }, ne = (e) => {
182
+ const {
183
+ prefixCls: n,
184
+ className: o
185
+ } = e, t = Q(e, ["prefixCls", "className"]), {
186
+ getPrefixCls: r
187
+ } = a.useContext($), l = r("popover", n), [i, c, d] = S(l);
188
+ return i(/* @__PURE__ */ a.createElement(te, Object.assign({}, t, {
189
+ prefixCls: l,
190
+ hashId: c,
191
+ className: P(o, d)
192
+ })));
193
+ };
194
+ var oe = function(e, n) {
195
+ var o = {};
196
+ for (var t in e)
197
+ Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
198
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
199
+ for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
200
+ n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (o[t[r]] = e[t[r]]);
201
+ return o;
202
+ };
203
+ const re = (e) => {
204
+ let {
205
+ title: n,
206
+ content: o,
207
+ prefixCls: t
208
+ } = e;
209
+ return /* @__PURE__ */ a.createElement(a.Fragment, null, n && /* @__PURE__ */ a.createElement("div", {
210
+ className: `${t}-title`
211
+ }, C(n)), /* @__PURE__ */ a.createElement("div", {
212
+ className: `${t}-inner-content`
213
+ }, C(o)));
214
+ }, ae = /* @__PURE__ */ a.forwardRef((e, n) => {
215
+ var o, t;
216
+ const {
217
+ prefixCls: r,
218
+ title: l,
219
+ content: i,
220
+ overlayClassName: c,
221
+ placement: d = "top",
222
+ trigger: f = "hover",
223
+ children: p,
224
+ mouseEnterDelay: v = 0.1,
225
+ mouseLeaveDelay: u = 0.1,
226
+ onOpenChange: m,
227
+ overlayStyle: y = {}
228
+ } = e, g = oe(e, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "children", "mouseEnterDelay", "mouseLeaveDelay", "onOpenChange", "overlayStyle"]), {
229
+ getPrefixCls: O
230
+ } = a.useContext($), h = O("popover", r), [E, B, N] = S(h), j = O(), k = P(c, B, N), [_, I] = G(!1, {
231
+ value: (o = e.open) !== null && o !== void 0 ? o : e.visible,
232
+ defaultValue: (t = e.defaultOpen) !== null && t !== void 0 ? t : e.defaultVisible
233
+ }), w = (s, b) => {
234
+ I(s, !0), m == null || m(s, b);
235
+ }, T = (s) => {
236
+ s.keyCode === Y.ESC && w(!1, s);
237
+ }, W = (s) => {
238
+ w(s);
239
+ };
240
+ return E(/* @__PURE__ */ a.createElement(U, Object.assign({
241
+ placement: d,
242
+ trigger: f,
243
+ mouseEnterDelay: v,
244
+ mouseLeaveDelay: u,
245
+ overlayStyle: y
246
+ }, g, {
247
+ prefixCls: h,
248
+ overlayClassName: k,
249
+ ref: n,
250
+ open: _,
251
+ onOpenChange: W,
252
+ overlay: l || i ? /* @__PURE__ */ a.createElement(re, {
253
+ prefixCls: h,
254
+ title: l,
255
+ content: i
256
+ }) : null,
257
+ transitionName: X(j, "zoom-big", g.transitionName),
258
+ "data-popover-inject": !0
259
+ }), V(p, {
260
+ onKeyDown: (s) => {
261
+ var b, x;
262
+ /* @__PURE__ */ a.isValidElement(p) && ((x = p == null ? void 0 : (b = p.props).onKeyDown) === null || x === void 0 || x.call(b, s)), T(s);
263
+ }
264
+ })));
265
+ }), le = ae;
266
+ le._InternalPanelDoNotUseOrYouWillBeFired = ne;
267
+ export {
268
+ le as P
269
+ };