@amateescu/portal-ui-components 0.0.13 → 0.0.15-beta0

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,565 @@
1
+ import { a as F } from "./objectWithoutPropertiesLoose-CIT-1_kH.js";
2
+ import * as i from "react";
3
+ import { I as G, c as p, g as W, m as _, K as D, u as X, C as k, o as z, _ as K } from "./useId-D0OLY2mt.js";
4
+ var J = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, name: "close", theme: "outlined" }, Q = function(t, s) {
5
+ return /* @__PURE__ */ i.createElement(G, F({}, t, {
6
+ ref: s,
7
+ icon: J
8
+ }));
9
+ }, U = /* @__PURE__ */ i.forwardRef(Q);
10
+ process.env.NODE_ENV !== "production" && (U.displayName = "CloseOutlined");
11
+ const w = (e) => {
12
+ const {
13
+ prefixCls: t,
14
+ className: s,
15
+ style: n,
16
+ size: a,
17
+ shape: r
18
+ } = e, c = p({
19
+ [`${t}-lg`]: a === "large",
20
+ [`${t}-sm`]: a === "small"
21
+ }), l = p({
22
+ [`${t}-circle`]: r === "circle",
23
+ [`${t}-square`]: r === "square",
24
+ [`${t}-round`]: r === "round"
25
+ }), o = i.useMemo(() => typeof a == "number" ? {
26
+ width: a,
27
+ height: a,
28
+ lineHeight: `${a}px`
29
+ } : {}, [a]);
30
+ return /* @__PURE__ */ i.createElement("span", {
31
+ className: p(t, c, l, s),
32
+ style: Object.assign(Object.assign({}, o), n)
33
+ });
34
+ }, Y = new D("ant-skeleton-loading", {
35
+ "0%": {
36
+ backgroundPosition: "100% 50%"
37
+ },
38
+ "100%": {
39
+ backgroundPosition: "0 50%"
40
+ }
41
+ }), E = (e) => ({
42
+ height: e,
43
+ lineHeight: X(e)
44
+ }), f = (e) => Object.assign({
45
+ width: e
46
+ }, E(e)), Z = (e) => ({
47
+ background: e.skeletonLoadingBackground,
48
+ backgroundSize: "400% 100%",
49
+ animationName: Y,
50
+ animationDuration: e.skeletonLoadingMotionDuration,
51
+ animationTimingFunction: "ease",
52
+ animationIterationCount: "infinite"
53
+ }), H = (e, t) => Object.assign({
54
+ width: t(e).mul(5).equal(),
55
+ minWidth: t(e).mul(5).equal()
56
+ }, E(e)), ee = (e) => {
57
+ const {
58
+ skeletonAvatarCls: t,
59
+ gradientFromColor: s,
60
+ controlHeight: n,
61
+ controlHeightLG: a,
62
+ controlHeightSM: r
63
+ } = e;
64
+ return {
65
+ [t]: Object.assign({
66
+ display: "inline-block",
67
+ verticalAlign: "top",
68
+ background: s
69
+ }, f(n)),
70
+ [`${t}${t}-circle`]: {
71
+ borderRadius: "50%"
72
+ },
73
+ [`${t}${t}-lg`]: Object.assign({}, f(a)),
74
+ [`${t}${t}-sm`]: Object.assign({}, f(r))
75
+ };
76
+ }, te = (e) => {
77
+ const {
78
+ controlHeight: t,
79
+ borderRadiusSM: s,
80
+ skeletonInputCls: n,
81
+ controlHeightLG: a,
82
+ controlHeightSM: r,
83
+ gradientFromColor: c,
84
+ calc: l
85
+ } = e;
86
+ return {
87
+ [n]: Object.assign({
88
+ display: "inline-block",
89
+ verticalAlign: "top",
90
+ background: c,
91
+ borderRadius: s
92
+ }, H(t, l)),
93
+ [`${n}-lg`]: Object.assign({}, H(a, l)),
94
+ [`${n}-sm`]: Object.assign({}, H(r, l))
95
+ };
96
+ }, V = (e) => Object.assign({
97
+ width: e
98
+ }, E(e)), se = (e) => {
99
+ const {
100
+ skeletonImageCls: t,
101
+ imageSizeBase: s,
102
+ gradientFromColor: n,
103
+ borderRadiusSM: a,
104
+ calc: r
105
+ } = e;
106
+ return {
107
+ [t]: Object.assign(Object.assign({
108
+ display: "inline-flex",
109
+ alignItems: "center",
110
+ justifyContent: "center",
111
+ verticalAlign: "middle",
112
+ background: n,
113
+ borderRadius: a
114
+ }, V(r(s).mul(2).equal())), {
115
+ [`${t}-path`]: {
116
+ fill: "#bfbfbf"
117
+ },
118
+ [`${t}-svg`]: Object.assign(Object.assign({}, V(s)), {
119
+ maxWidth: r(s).mul(4).equal(),
120
+ maxHeight: r(s).mul(4).equal()
121
+ }),
122
+ [`${t}-svg${t}-svg-circle`]: {
123
+ borderRadius: "50%"
124
+ }
125
+ }),
126
+ [`${t}${t}-circle`]: {
127
+ borderRadius: "50%"
128
+ }
129
+ };
130
+ }, B = (e, t, s) => {
131
+ const {
132
+ skeletonButtonCls: n
133
+ } = e;
134
+ return {
135
+ [`${s}${n}-circle`]: {
136
+ width: t,
137
+ minWidth: t,
138
+ borderRadius: "50%"
139
+ },
140
+ [`${s}${n}-round`]: {
141
+ borderRadius: t
142
+ }
143
+ };
144
+ }, R = (e, t) => Object.assign({
145
+ width: t(e).mul(2).equal(),
146
+ minWidth: t(e).mul(2).equal()
147
+ }, E(e)), ne = (e) => {
148
+ const {
149
+ borderRadiusSM: t,
150
+ skeletonButtonCls: s,
151
+ controlHeight: n,
152
+ controlHeightLG: a,
153
+ controlHeightSM: r,
154
+ gradientFromColor: c,
155
+ calc: l
156
+ } = e;
157
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
158
+ [s]: Object.assign({
159
+ display: "inline-block",
160
+ verticalAlign: "top",
161
+ background: c,
162
+ borderRadius: t,
163
+ width: l(n).mul(2).equal(),
164
+ minWidth: l(n).mul(2).equal()
165
+ }, R(n, l))
166
+ }, B(e, n, s)), {
167
+ [`${s}-lg`]: Object.assign({}, R(a, l))
168
+ }), B(e, a, `${s}-lg`)), {
169
+ [`${s}-sm`]: Object.assign({}, R(r, l))
170
+ }), B(e, r, `${s}-sm`));
171
+ }, ae = (e) => {
172
+ const {
173
+ componentCls: t,
174
+ skeletonAvatarCls: s,
175
+ skeletonTitleCls: n,
176
+ skeletonParagraphCls: a,
177
+ skeletonButtonCls: r,
178
+ skeletonInputCls: c,
179
+ skeletonImageCls: l,
180
+ controlHeight: o,
181
+ controlHeightLG: d,
182
+ controlHeightSM: m,
183
+ gradientFromColor: g,
184
+ padding: h,
185
+ marginSM: C,
186
+ borderRadius: b,
187
+ titleHeight: u,
188
+ blockRadius: O,
189
+ paragraphLiHeight: y,
190
+ controlHeightXS: P,
191
+ paragraphMarginTop: $
192
+ } = e;
193
+ return {
194
+ [t]: {
195
+ display: "table",
196
+ width: "100%",
197
+ [`${t}-header`]: {
198
+ display: "table-cell",
199
+ paddingInlineEnd: h,
200
+ verticalAlign: "top",
201
+ // Avatar
202
+ [s]: Object.assign({
203
+ display: "inline-block",
204
+ verticalAlign: "top",
205
+ background: g
206
+ }, f(o)),
207
+ [`${s}-circle`]: {
208
+ borderRadius: "50%"
209
+ },
210
+ [`${s}-lg`]: Object.assign({}, f(d)),
211
+ [`${s}-sm`]: Object.assign({}, f(m))
212
+ },
213
+ [`${t}-content`]: {
214
+ display: "table-cell",
215
+ width: "100%",
216
+ verticalAlign: "top",
217
+ // Title
218
+ [n]: {
219
+ width: "100%",
220
+ height: u,
221
+ background: g,
222
+ borderRadius: O,
223
+ [`+ ${a}`]: {
224
+ marginBlockStart: m
225
+ }
226
+ },
227
+ // paragraph
228
+ [a]: {
229
+ padding: 0,
230
+ "> li": {
231
+ width: "100%",
232
+ height: y,
233
+ listStyle: "none",
234
+ background: g,
235
+ borderRadius: O,
236
+ "+ li": {
237
+ marginBlockStart: P
238
+ }
239
+ }
240
+ },
241
+ [`${a}> li:last-child:not(:first-child):not(:nth-child(2))`]: {
242
+ width: "61%"
243
+ }
244
+ },
245
+ [`&-round ${t}-content`]: {
246
+ [`${n}, ${a} > li`]: {
247
+ borderRadius: b
248
+ }
249
+ }
250
+ },
251
+ [`${t}-with-avatar ${t}-content`]: {
252
+ // Title
253
+ [n]: {
254
+ marginBlockStart: C,
255
+ [`+ ${a}`]: {
256
+ marginBlockStart: $
257
+ }
258
+ }
259
+ },
260
+ // Skeleton element
261
+ [`${t}${t}-element`]: Object.assign(Object.assign(Object.assign(Object.assign({
262
+ display: "inline-block",
263
+ width: "auto"
264
+ }, ne(e)), ee(e)), te(e)), se(e)),
265
+ // Skeleton Block Button, Input
266
+ [`${t}${t}-block`]: {
267
+ width: "100%",
268
+ [r]: {
269
+ width: "100%"
270
+ },
271
+ [c]: {
272
+ width: "100%"
273
+ }
274
+ },
275
+ // With active animation
276
+ [`${t}${t}-active`]: {
277
+ [`
278
+ ${n},
279
+ ${a} > li,
280
+ ${s},
281
+ ${r},
282
+ ${c},
283
+ ${l}
284
+ `]: Object.assign({}, Z(e))
285
+ }
286
+ };
287
+ }, le = (e) => {
288
+ const {
289
+ colorFillContent: t,
290
+ colorFill: s
291
+ } = e, n = t, a = s;
292
+ return {
293
+ color: n,
294
+ colorGradientEnd: a,
295
+ gradientFromColor: n,
296
+ gradientToColor: a,
297
+ titleHeight: e.controlHeight / 2,
298
+ blockRadius: e.borderRadiusSM,
299
+ paragraphMarginTop: e.marginLG + e.marginXXS,
300
+ paragraphLiHeight: e.controlHeight / 2
301
+ };
302
+ }, v = W("Skeleton", (e) => {
303
+ const {
304
+ componentCls: t,
305
+ calc: s
306
+ } = e, n = _(e, {
307
+ skeletonAvatarCls: `${t}-avatar`,
308
+ skeletonTitleCls: `${t}-title`,
309
+ skeletonParagraphCls: `${t}-paragraph`,
310
+ skeletonButtonCls: `${t}-button`,
311
+ skeletonInputCls: `${t}-input`,
312
+ skeletonImageCls: `${t}-image`,
313
+ imageSizeBase: s(e.controlHeight).mul(1.5).equal(),
314
+ borderRadius: 100,
315
+ // Large number to make capsule shape
316
+ skeletonLoadingBackground: `linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,
317
+ skeletonLoadingMotionDuration: "1.4s"
318
+ });
319
+ return [ae(n)];
320
+ }, le, {
321
+ deprecatedTokens: [["color", "gradientFromColor"], ["colorGradientEnd", "gradientToColor"]]
322
+ }), oe = (e) => {
323
+ const {
324
+ prefixCls: t,
325
+ className: s,
326
+ rootClassName: n,
327
+ active: a,
328
+ shape: r = "circle",
329
+ size: c = "default"
330
+ } = e, {
331
+ getPrefixCls: l
332
+ } = i.useContext(k), o = l("skeleton", t), [d, m, g] = v(o), h = z(e, ["prefixCls", "className"]), C = p(o, `${o}-element`, {
333
+ [`${o}-active`]: a
334
+ }, s, n, m, g);
335
+ return d(/* @__PURE__ */ i.createElement("div", {
336
+ className: C
337
+ }, /* @__PURE__ */ i.createElement(w, Object.assign({
338
+ prefixCls: `${o}-avatar`,
339
+ shape: r,
340
+ size: c
341
+ }, h))));
342
+ }, ie = (e) => {
343
+ const {
344
+ prefixCls: t,
345
+ className: s,
346
+ rootClassName: n,
347
+ active: a,
348
+ block: r = !1,
349
+ size: c = "default"
350
+ } = e, {
351
+ getPrefixCls: l
352
+ } = i.useContext(k), o = l("skeleton", t), [d, m, g] = v(o), h = z(e, ["prefixCls"]), C = p(o, `${o}-element`, {
353
+ [`${o}-active`]: a,
354
+ [`${o}-block`]: r
355
+ }, s, n, m, g);
356
+ return d(/* @__PURE__ */ i.createElement("div", {
357
+ className: C
358
+ }, /* @__PURE__ */ i.createElement(w, Object.assign({
359
+ prefixCls: `${o}-button`,
360
+ size: c
361
+ }, h))));
362
+ }, re = "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z", ce = (e) => {
363
+ const {
364
+ prefixCls: t,
365
+ className: s,
366
+ rootClassName: n,
367
+ style: a,
368
+ active: r
369
+ } = e, {
370
+ getPrefixCls: c
371
+ } = i.useContext(k), l = c("skeleton", t), [o, d, m] = v(l), g = p(l, `${l}-element`, {
372
+ [`${l}-active`]: r
373
+ }, s, n, d, m);
374
+ return o(/* @__PURE__ */ i.createElement("div", {
375
+ className: g
376
+ }, /* @__PURE__ */ i.createElement("div", {
377
+ className: p(`${l}-image`, s),
378
+ style: a
379
+ }, /* @__PURE__ */ i.createElement("svg", {
380
+ viewBox: "0 0 1098 1024",
381
+ xmlns: "http://www.w3.org/2000/svg",
382
+ className: `${l}-image-svg`
383
+ }, /* @__PURE__ */ i.createElement("title", null, "Image placeholder"), /* @__PURE__ */ i.createElement("path", {
384
+ d: re,
385
+ className: `${l}-image-path`
386
+ })))));
387
+ }, ge = (e) => {
388
+ const {
389
+ prefixCls: t,
390
+ className: s,
391
+ rootClassName: n,
392
+ active: a,
393
+ block: r,
394
+ size: c = "default"
395
+ } = e, {
396
+ getPrefixCls: l
397
+ } = i.useContext(k), o = l("skeleton", t), [d, m, g] = v(o), h = z(e, ["prefixCls"]), C = p(o, `${o}-element`, {
398
+ [`${o}-active`]: a,
399
+ [`${o}-block`]: r
400
+ }, s, n, m, g);
401
+ return d(/* @__PURE__ */ i.createElement("div", {
402
+ className: C
403
+ }, /* @__PURE__ */ i.createElement(w, Object.assign({
404
+ prefixCls: `${o}-input`,
405
+ size: c
406
+ }, h))));
407
+ }, de = (e) => {
408
+ const {
409
+ prefixCls: t,
410
+ className: s,
411
+ rootClassName: n,
412
+ style: a,
413
+ active: r,
414
+ children: c
415
+ } = e, {
416
+ getPrefixCls: l
417
+ } = i.useContext(k), o = l("skeleton", t), [d, m, g] = v(o), h = p(o, `${o}-element`, {
418
+ [`${o}-active`]: r
419
+ }, m, s, n, g);
420
+ return d(/* @__PURE__ */ i.createElement("div", {
421
+ className: h
422
+ }, /* @__PURE__ */ i.createElement("div", {
423
+ className: p(`${o}-image`, s),
424
+ style: a
425
+ }, c)));
426
+ }, me = (e, t) => {
427
+ const {
428
+ width: s,
429
+ rows: n = 2
430
+ } = t;
431
+ if (Array.isArray(s))
432
+ return s[e];
433
+ if (n - 1 === e)
434
+ return s;
435
+ }, ue = (e) => {
436
+ const {
437
+ prefixCls: t,
438
+ className: s,
439
+ style: n,
440
+ rows: a
441
+ } = e, r = K(new Array(a)).map((c, l) => (
442
+ // eslint-disable-next-line react/no-array-index-key
443
+ /* @__PURE__ */ i.createElement("li", {
444
+ key: l,
445
+ style: {
446
+ width: me(l, e)
447
+ }
448
+ })
449
+ ));
450
+ return /* @__PURE__ */ i.createElement("ul", {
451
+ className: p(t, s),
452
+ style: n
453
+ }, r);
454
+ }, pe = (e) => {
455
+ let {
456
+ prefixCls: t,
457
+ className: s,
458
+ width: n,
459
+ style: a
460
+ } = e;
461
+ return (
462
+ // biome-ignore lint/a11y/useHeadingContent: HOC here
463
+ /* @__PURE__ */ i.createElement("h3", {
464
+ className: p(t, s),
465
+ style: Object.assign({
466
+ width: n
467
+ }, a)
468
+ })
469
+ );
470
+ };
471
+ function q(e) {
472
+ return e && typeof e == "object" ? e : {};
473
+ }
474
+ function he(e, t) {
475
+ return e && !t ? {
476
+ size: "large",
477
+ shape: "square"
478
+ } : {
479
+ size: "large",
480
+ shape: "circle"
481
+ };
482
+ }
483
+ function Ce(e, t) {
484
+ return !e && t ? {
485
+ width: "38%"
486
+ } : e && t ? {
487
+ width: "50%"
488
+ } : {};
489
+ }
490
+ function be(e, t) {
491
+ const s = {};
492
+ return (!e || !t) && (s.width = "61%"), !e && t ? s.rows = 3 : s.rows = 2, s;
493
+ }
494
+ const S = (e) => {
495
+ const {
496
+ prefixCls: t,
497
+ loading: s,
498
+ className: n,
499
+ rootClassName: a,
500
+ style: r,
501
+ children: c,
502
+ avatar: l = !1,
503
+ title: o = !0,
504
+ paragraph: d = !0,
505
+ active: m,
506
+ round: g
507
+ } = e, {
508
+ getPrefixCls: h,
509
+ direction: C,
510
+ skeleton: b
511
+ } = i.useContext(k), u = h("skeleton", t), [O, y, P] = v(u);
512
+ if (s || !("loading" in e)) {
513
+ const $ = !!l, x = !!o, j = !!d;
514
+ let M;
515
+ if ($) {
516
+ const N = Object.assign(Object.assign({
517
+ prefixCls: `${u}-avatar`
518
+ }, he(x, j)), q(l));
519
+ M = /* @__PURE__ */ i.createElement("div", {
520
+ className: `${u}-header`
521
+ }, /* @__PURE__ */ i.createElement(w, Object.assign({}, N)));
522
+ }
523
+ let A;
524
+ if (x || j) {
525
+ let N;
526
+ if (x) {
527
+ const I = Object.assign(Object.assign({
528
+ prefixCls: `${u}-title`
529
+ }, Ce($, j)), q(o));
530
+ N = /* @__PURE__ */ i.createElement(pe, Object.assign({}, I));
531
+ }
532
+ let L;
533
+ if (j) {
534
+ const I = Object.assign(Object.assign({
535
+ prefixCls: `${u}-paragraph`
536
+ }, be($, x)), q(d));
537
+ L = /* @__PURE__ */ i.createElement(ue, Object.assign({}, I));
538
+ }
539
+ A = /* @__PURE__ */ i.createElement("div", {
540
+ className: `${u}-content`
541
+ }, N, L);
542
+ }
543
+ const T = p(u, {
544
+ [`${u}-with-avatar`]: $,
545
+ [`${u}-active`]: m,
546
+ [`${u}-rtl`]: C === "rtl",
547
+ [`${u}-round`]: g
548
+ }, b == null ? void 0 : b.className, n, a, y, P);
549
+ return O(/* @__PURE__ */ i.createElement("div", {
550
+ className: T,
551
+ style: Object.assign(Object.assign({}, b == null ? void 0 : b.style), r)
552
+ }, M, A));
553
+ }
554
+ return c ?? null;
555
+ };
556
+ S.Button = ie;
557
+ S.Avatar = oe;
558
+ S.Input = ge;
559
+ S.Image = ce;
560
+ S.Node = de;
561
+ process.env.NODE_ENV !== "production" && (S.displayName = "Skeleton");
562
+ export {
563
+ U as R,
564
+ S
565
+ };