@hybridcore/ui 1.4.25 → 1.4.27

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.
@@ -1,6 +1,6 @@
1
- import { jsx as e, jsxs as a, Fragment as u } from "react/jsx-runtime";
2
- import { Skeleton as n, Box as f, Avatar as M } from "@mui/material";
3
- import { LandscapeCardRoot as I, LandscapeInfoBox as P, LandscapeCardExtraActions as _, PortraitCardRoot as L, PortraitCardExtraActions as U } from "./styled.js";
1
+ import { jsx as e, jsxs as r, Fragment as p } from "react/jsx-runtime";
2
+ import { Skeleton as n, Box as u, Avatar as M } from "@mui/material";
3
+ import { LandscapeCardRoot as A, LandscapeInfoBox as P, LandscapeCardExtraActions as _, PortraitCardRoot as L, PortraitCardExtraActions as U } from "./styled.js";
4
4
  import { _ as x, a as T } from "../../objectWithoutPropertiesLoose-BK36oJDi.js";
5
5
  import * as S from "react";
6
6
  import { P as i } from "../../createStyled-BzvgQjjR.js";
@@ -46,14 +46,14 @@ const z = ["disableSpacing", "className"], $ = (t) => {
46
46
  }), {
47
47
  disableSpacing: l = !1,
48
48
  className: w
49
- } = c, m = T(c, z), p = x({}, c, {
49
+ } = c, h = T(c, z), m = x({}, c, {
50
50
  disableSpacing: l
51
- }), v = $(p);
51
+ }), b = $(m);
52
52
  return /* @__PURE__ */ e(F, x({
53
- className: B(v.root, w),
54
- ownerState: p,
53
+ className: B(b.root, w),
54
+ ownerState: m,
55
55
  ref: s
56
- }, m));
56
+ }, h));
57
57
  });
58
58
  process.env.NODE_ENV !== "production" && (W.propTypes = {
59
59
  // ----------------------------- Warning --------------------------------
@@ -119,37 +119,37 @@ const G = ["children", "className", "component", "image", "src", "style"], q = (
119
119
  }, t.isImageComponent && {
120
120
  // ⚠️ object-fit is not supported by IE11.
121
121
  objectFit: "cover"
122
- })), K = ["video", "audio", "picture", "iframe", "img"], Q = ["picture", "img"], y = /* @__PURE__ */ S.forwardRef(function(o, s) {
122
+ })), K = ["video", "audio", "picture", "iframe", "img"], Q = ["picture", "img"], C = /* @__PURE__ */ S.forwardRef(function(o, s) {
123
123
  const c = k({
124
124
  props: o,
125
125
  name: "MuiCardMedia"
126
126
  }), {
127
127
  children: l,
128
128
  className: w,
129
- component: m = "div",
130
- image: p,
131
- src: v,
132
- style: r
133
- } = c, h = T(c, G), d = K.indexOf(m) !== -1, b = !d && p ? x({
134
- backgroundImage: `url("${p}")`
135
- }, r) : r, C = x({}, c, {
136
- component: m,
129
+ component: h = "div",
130
+ image: m,
131
+ src: b,
132
+ style: y
133
+ } = c, a = T(c, G), d = K.indexOf(h) !== -1, f = !d && m ? x({
134
+ backgroundImage: `url("${m}")`
135
+ }, y) : y, v = x({}, c, {
136
+ component: h,
137
137
  isMediaComponent: d,
138
- isImageComponent: Q.indexOf(m) !== -1
139
- }), A = q(C);
138
+ isImageComponent: Q.indexOf(h) !== -1
139
+ }), I = q(v);
140
140
  return /* @__PURE__ */ e(J, x({
141
- className: B(A.root, w),
142
- as: m,
143
- role: !d && p ? "img" : void 0,
141
+ className: B(I.root, w),
142
+ as: h,
143
+ role: !d && m ? "img" : void 0,
144
144
  ref: s,
145
- style: b,
146
- ownerState: C,
147
- src: d ? p || v : void 0
148
- }, h, {
145
+ style: f,
146
+ ownerState: v,
147
+ src: d ? m || b : void 0
148
+ }, a, {
149
149
  children: l
150
150
  }));
151
151
  });
152
- process.env.NODE_ENV !== "production" && (y.propTypes = {
152
+ process.env.NODE_ENV !== "production" && (C.propTypes = {
153
153
  // ----------------------------- Warning --------------------------------
154
154
  // | These PropTypes are generated from the TypeScript type definitions |
155
155
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -199,17 +199,18 @@ const ae = ({
199
199
  orientation: c = "portrait",
200
200
  avatar: l,
201
201
  actions: w,
202
+ menu: h,
202
203
  extraActions: m,
203
- extraInfo: p,
204
- stats: v,
205
- loading: r = !1,
206
- onClick: h
204
+ extraInfo: b,
205
+ stats: y,
206
+ loading: a = !1,
207
+ onClick: d
207
208
  }) => {
208
- const d = () => {
209
- h && h();
209
+ const f = () => {
210
+ d && d();
210
211
  };
211
- return c === "landscape" ? /* @__PURE__ */ a(I, { children: [
212
- r ? /* @__PURE__ */ e(
212
+ return c === "landscape" ? /* @__PURE__ */ r(A, { children: [
213
+ a ? /* @__PURE__ */ e(
213
214
  n,
214
215
  {
215
216
  sx: { width: 330, height: 200 },
@@ -217,7 +218,7 @@ const ae = ({
217
218
  variant: "rounded"
218
219
  }
219
220
  ) : /* @__PURE__ */ e(
220
- y,
221
+ C,
221
222
  {
222
223
  component: "img",
223
224
  alt: t,
@@ -225,21 +226,22 @@ const ae = ({
225
226
  sx: {
226
227
  width: 330,
227
228
  height: 200,
228
- cursor: h ? "pointer" : "default"
229
+ cursor: d ? "pointer" : "default"
229
230
  },
230
- onClick: d
231
+ onClick: f
231
232
  }
232
233
  ),
233
- /* @__PURE__ */ a(O, { children: [
234
- /* @__PURE__ */ e(f, { flex: 1, children: /* @__PURE__ */ a(
235
- f,
234
+ /* @__PURE__ */ r(O, { sx: { position: "relative" }, children: [
235
+ h ? /* @__PURE__ */ e(u, { position: "absolute", top: -8, right: -8, children: h }) : null,
236
+ /* @__PURE__ */ e(u, { flex: 1, children: /* @__PURE__ */ r(
237
+ u,
236
238
  {
237
239
  display: "flex",
238
240
  flexDirection: "column",
239
241
  justifyContent: "space-between",
240
242
  height: "100%",
241
243
  children: [
242
- /* @__PURE__ */ e(f, { children: r ? /* @__PURE__ */ a(u, { children: [
244
+ /* @__PURE__ */ e(u, { children: a ? /* @__PURE__ */ r(p, { children: [
243
245
  /* @__PURE__ */ e(
244
246
  n,
245
247
  {
@@ -265,7 +267,7 @@ const ae = ({
265
267
  style: { marginBottom: 6 }
266
268
  }
267
269
  )
268
- ] }) : /* @__PURE__ */ a(u, { children: [
270
+ ] }) : /* @__PURE__ */ r(p, { children: [
269
271
  /* @__PURE__ */ e(
270
272
  g,
271
273
  {
@@ -278,9 +280,9 @@ const ae = ({
278
280
  display: "-webkit-box",
279
281
  WebkitLineClamp: 3,
280
282
  WebkitBoxOrient: "vertical",
281
- cursor: h ? "pointer" : "default"
283
+ cursor: d ? "pointer" : "default"
282
284
  },
283
- onClick: d,
285
+ onClick: f,
284
286
  children: t
285
287
  }
286
288
  ),
@@ -297,14 +299,14 @@ const ae = ({
297
299
  WebkitLineClamp: 4,
298
300
  WebkitBoxOrient: "vertical",
299
301
  lineHeight: "16px",
300
- cursor: h ? "pointer" : "default"
302
+ cursor: d ? "pointer" : "default"
301
303
  },
302
- onClick: d,
304
+ onClick: f,
303
305
  children: /* @__PURE__ */ e("small", { children: o })
304
306
  }
305
307
  )
306
308
  ] }) }),
307
- /* @__PURE__ */ e(f, { children: r ? /* @__PURE__ */ e(
309
+ /* @__PURE__ */ e(u, { children: a ? /* @__PURE__ */ e(
308
310
  n,
309
311
  {
310
312
  animation: "wave",
@@ -312,12 +314,12 @@ const ae = ({
312
314
  width: "40%",
313
315
  style: { marginBottom: 6 }
314
316
  }
315
- ) : v })
317
+ ) : y })
316
318
  ]
317
319
  }
318
320
  ) }),
319
- /* @__PURE__ */ a(P, { children: [
320
- r ? /* @__PURE__ */ e(
321
+ /* @__PURE__ */ r(P, { children: [
322
+ a ? /* @__PURE__ */ e(
321
323
  n,
322
324
  {
323
325
  animation: "wave",
@@ -326,7 +328,7 @@ const ae = ({
326
328
  height: 42
327
329
  }
328
330
  ) : /* @__PURE__ */ e(M, { src: l.image, sx: { width: 42, height: 42 } }),
329
- r ? /* @__PURE__ */ a(u, { children: [
331
+ a ? /* @__PURE__ */ r(p, { children: [
330
332
  /* @__PURE__ */ e(
331
333
  n,
332
334
  {
@@ -345,7 +347,7 @@ const ae = ({
345
347
  sx: { mb: 0.25 }
346
348
  }
347
349
  )
348
- ] }) : /* @__PURE__ */ a(u, { children: [
350
+ ] }) : /* @__PURE__ */ r(p, { children: [
349
351
  /* @__PURE__ */ e(
350
352
  g,
351
353
  {
@@ -367,7 +369,7 @@ const ae = ({
367
369
  }
368
370
  )
369
371
  ] }),
370
- /* @__PURE__ */ e(_, { children: r ? /* @__PURE__ */ a(u, { children: [
372
+ /* @__PURE__ */ e(_, { children: a ? /* @__PURE__ */ r(p, { children: [
371
373
  /* @__PURE__ */ e(
372
374
  n,
373
375
  {
@@ -396,7 +398,7 @@ const ae = ({
396
398
  }
397
399
  )
398
400
  ] }) : m }),
399
- r ? /* @__PURE__ */ e(
401
+ a ? /* @__PURE__ */ e(
400
402
  n,
401
403
  {
402
404
  animation: "wave",
@@ -409,34 +411,34 @@ const ae = ({
409
411
  {
410
412
  variant: "caption",
411
413
  sx: { color: "text.secondary", lineHeight: "12px" },
412
- children: /* @__PURE__ */ e("small", { children: p })
414
+ children: /* @__PURE__ */ e("small", { children: b })
413
415
  }
414
416
  ),
415
- /* @__PURE__ */ e(f, { display: "flex", mt: 1, width: "100%", children: r ? /* @__PURE__ */ e(
417
+ /* @__PURE__ */ e(u, { display: "flex", mt: 1, width: "100%", children: a ? /* @__PURE__ */ e(
416
418
  n,
417
419
  {
418
420
  variant: "rounded",
419
421
  animation: "wave",
420
422
  height: 36,
421
423
  width: "100%",
422
- sx: { borderRadius: (b) => b.shape.borderRadius }
424
+ sx: { borderRadius: (v) => v.shape.borderRadius }
423
425
  }
424
426
  ) : w })
425
427
  ] })
426
428
  ] })
427
- ] }) : /* @__PURE__ */ a(L, { children: [
428
- r ? /* @__PURE__ */ e(n, { sx: { height: 172 }, animation: "wave", variant: "rectangular" }) : /* @__PURE__ */ e(
429
- y,
429
+ ] }) : /* @__PURE__ */ r(L, { children: [
430
+ a ? /* @__PURE__ */ e(n, { sx: { height: 172 }, animation: "wave", variant: "rectangular" }) : /* @__PURE__ */ e(
431
+ C,
430
432
  {
431
433
  component: "img",
432
434
  alt: t,
433
435
  height: "172",
434
436
  image: s,
435
- sx: { cursor: h ? "pointer" : "default" },
436
- onClick: d
437
+ sx: { cursor: d ? "pointer" : "default" },
438
+ onClick: f
437
439
  }
438
440
  ),
439
- /* @__PURE__ */ e(O, { children: r ? /* @__PURE__ */ a(u, { children: [
441
+ /* @__PURE__ */ e(O, { children: a ? /* @__PURE__ */ r(p, { children: [
440
442
  /* @__PURE__ */ e(
441
443
  n,
442
444
  {
@@ -462,7 +464,7 @@ const ae = ({
462
464
  style: { marginBottom: 8 }
463
465
  }
464
466
  )
465
- ] }) : /* @__PURE__ */ a(u, { children: [
467
+ ] }) : /* @__PURE__ */ r(p, { children: [
466
468
  /* @__PURE__ */ e(
467
469
  g,
468
470
  {
@@ -470,8 +472,8 @@ const ae = ({
470
472
  variant: "subtitle1",
471
473
  component: "h3",
472
474
  noWrap: !0,
473
- sx: { cursor: h ? "pointer" : "default" },
474
- onClick: d,
475
+ sx: { cursor: d ? "pointer" : "default" },
476
+ onClick: f,
475
477
  children: t
476
478
  }
477
479
  ),
@@ -488,24 +490,24 @@ const ae = ({
488
490
  WebkitLineClamp: 2,
489
491
  WebkitBoxOrient: "vertical",
490
492
  lineHeight: "16px",
491
- cursor: h ? "pointer" : "default"
493
+ cursor: d ? "pointer" : "default"
492
494
  },
493
- onClick: d,
495
+ onClick: f,
494
496
  children: /* @__PURE__ */ e("small", { children: o })
495
497
  }
496
498
  )
497
499
  ] }) }),
498
- /* @__PURE__ */ a(
500
+ /* @__PURE__ */ r(
499
501
  W,
500
502
  {
501
503
  sx: {
502
504
  display: "flex",
503
505
  justifyContent: "space-between",
504
- p: (b) => b.spacing(2)
506
+ p: (v) => v.spacing(2)
505
507
  },
506
508
  children: [
507
- /* @__PURE__ */ a(f, { display: "flex", justifyItems: "center", flex: 1, children: [
508
- r ? /* @__PURE__ */ e(
509
+ /* @__PURE__ */ r(u, { display: "flex", justifyItems: "center", flex: 1, children: [
510
+ a ? /* @__PURE__ */ e(
509
511
  n,
510
512
  {
511
513
  animation: "wave",
@@ -515,7 +517,7 @@ const ae = ({
515
517
  sx: { mb: 0.6 }
516
518
  }
517
519
  ) : /* @__PURE__ */ e(M, { src: l.image, sx: { width: 29, height: 29 } }),
518
- /* @__PURE__ */ e(f, { display: "flex", flexDirection: "column", ml: 1, flex: 1, children: r ? /* @__PURE__ */ a(u, { children: [
520
+ /* @__PURE__ */ e(u, { display: "flex", flexDirection: "column", ml: 1, flex: 1, children: a ? /* @__PURE__ */ r(p, { children: [
519
521
  /* @__PURE__ */ e(
520
522
  n,
521
523
  {
@@ -526,7 +528,7 @@ const ae = ({
526
528
  }
527
529
  ),
528
530
  /* @__PURE__ */ e(n, { animation: "wave", height: 10, width: "60%" })
529
- ] }) : /* @__PURE__ */ a(u, { children: [
531
+ ] }) : /* @__PURE__ */ r(p, { children: [
530
532
  /* @__PURE__ */ e(
531
533
  g,
532
534
  {
@@ -551,11 +553,14 @@ const ae = ({
551
553
  )
552
554
  ] }) })
553
555
  ] }),
554
- !r && /* @__PURE__ */ e(f, { display: "flex", children: w })
556
+ !a && /* @__PURE__ */ e(u, { display: "flex", children: w })
555
557
  ]
556
558
  }
557
559
  ),
558
- r === !1 && m !== void 0 && /* @__PURE__ */ e(U, { className: "extra-actions", children: m })
560
+ a === !1 && (m !== void 0 || h !== m) && /* @__PURE__ */ r(U, { className: "extra-actions", children: [
561
+ m,
562
+ h
563
+ ] })
559
564
  ] });
560
565
  };
561
566
  export {
@@ -54,7 +54,7 @@ function Te(e, j) {
54
54
  for (let i = 0; i < r.length; i++) {
55
55
  const l = r[i], d = ee.get(t, `variables.${l.propertyId}`);
56
56
  if (d && e.keyAuth) {
57
- const c = await ae(ye), u = await ie(c, d);
57
+ const c = await ae(ye), u = await ie(c, String(d));
58
58
  u.data && (b(`variables.${l.propertyId}`, u.data), Q((f) => f + 1));
59
59
  }
60
60
  }
package/dist/main.d.ts CHANGED
@@ -69,6 +69,7 @@ declare interface CardProps {
69
69
  avatar: AvatarType;
70
70
  actions: default_2.ReactNode;
71
71
  onClick?(): void;
72
+ menu?: default_2.ReactNode;
72
73
  orientation?: OrientationType_2;
73
74
  extraActions?: default_2.ReactNode;
74
75
  /**
@@ -1223,7 +1224,7 @@ declare namespace INSTANCE {
1223
1224
  }
1224
1225
 
1225
1226
  interface Variable {
1226
- [key: string | number]: string;
1227
+ [key: string | number]: string | number | boolean;
1227
1228
  }
1228
1229
 
1229
1230
  interface Location {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.4.25",
4
+ "version": "1.4.27",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",