@asdp/ferryui 0.1.14 → 0.1.16

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/index.d.mts CHANGED
@@ -231,6 +231,10 @@ interface CardPromoProps {
231
231
  * custom description className
232
232
  */
233
233
  descriptionClassName?: string;
234
+ /**
235
+ * Loading state
236
+ */
237
+ isLoading?: boolean;
234
238
  }
235
239
  declare const CardPromo: React$1.FC<CardPromoProps>;
236
240
 
@@ -255,6 +259,10 @@ interface CardBannerProps {
255
259
  * Click handler for the banner
256
260
  */
257
261
  onClick?: () => void;
262
+ /**
263
+ * Loading state
264
+ */
265
+ isLoading?: boolean;
258
266
  }
259
267
  declare const CardBanner: React$1.FC<CardBannerProps>;
260
268
 
package/dist/index.d.ts CHANGED
@@ -231,6 +231,10 @@ interface CardPromoProps {
231
231
  * custom description className
232
232
  */
233
233
  descriptionClassName?: string;
234
+ /**
235
+ * Loading state
236
+ */
237
+ isLoading?: boolean;
234
238
  }
235
239
  declare const CardPromo: React$1.FC<CardPromoProps>;
236
240
 
@@ -255,6 +259,10 @@ interface CardBannerProps {
255
259
  * Click handler for the banner
256
260
  */
257
261
  onClick?: () => void;
262
+ /**
263
+ * Loading state
264
+ */
265
+ isLoading?: boolean;
258
266
  }
259
267
  declare const CardBanner: React$1.FC<CardBannerProps>;
260
268
 
package/dist/index.js CHANGED
@@ -352,10 +352,29 @@ var CardPromo = ({
352
352
  buttonText = "Lihat Detail",
353
353
  className,
354
354
  imageClassName,
355
- descriptionClassName
355
+ descriptionClassName,
356
+ isLoading = false
356
357
  }) => {
357
358
  const classes = useStyles3();
358
359
  const ariaLabel = totalCards ? `Card ${index + 1} of ${totalCards}` : `Promo card ${index + 1}`;
360
+ if (isLoading) {
361
+ return /* @__PURE__ */ jsxRuntime.jsx(
362
+ reactComponents.CarouselCard,
363
+ {
364
+ autoSize: true,
365
+ className: reactComponents.mergeClasses(classes.actionCard, className),
366
+ style: { cursor: "default" },
367
+ children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Skeleton, { "aria-label": "Loading content", children: [
368
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: reactComponents.mergeClasses(classes.imageContainer, imageClassName), children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { shape: "rectangle", style: { width: "100%", height: "100%" } }) }),
369
+ /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Row, { className: classes.infoWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { className: classes.info, xs: 12, children: [
370
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { style: { width: "70%", height: "20px" } }),
371
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { style: { width: "90%", height: "16px" } }),
372
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { style: { width: "80%", height: "16px" } })
373
+ ] }) })
374
+ ] })
375
+ }
376
+ );
377
+ }
359
378
  return /* @__PURE__ */ jsxRuntime.jsxs(
360
379
  reactComponents.CarouselCard,
361
380
  {
@@ -403,14 +422,17 @@ var useStyles4 = reactComponents.makeStyles({
403
422
  margin: 0,
404
423
  padding: 0,
405
424
  backgroundColor: "transparent",
406
- border: "none"
425
+ border: "none",
426
+ height: "450px",
427
+ borderRadius: reactComponents.tokens.borderRadiusXLarge
407
428
  },
408
429
  bannerImage: {
409
430
  width: "100%",
410
431
  height: "auto",
411
432
  objectFit: "cover",
412
433
  display: "block",
413
- cursor: "pointer"
434
+ cursor: "pointer",
435
+ borderRadius: reactComponents.tokens.borderRadiusXLarge
414
436
  }
415
437
  });
416
438
  var CardBanner = ({
@@ -418,10 +440,24 @@ var CardBanner = ({
418
440
  alt,
419
441
  index = 0,
420
442
  totalBanners,
421
- onClick
443
+ onClick,
444
+ isLoading = false
422
445
  }) => {
423
446
  const classes = useStyles4();
424
447
  const ariaLabel = totalBanners ? `Banner ${index + 1} of ${totalBanners}` : `Banner ${index + 1}`;
448
+ if (isLoading) {
449
+ return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.CarouselCard, { className: classes.bannerCard, children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Skeleton, { "aria-label": "Loading banner", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
450
+ reactComponents.SkeletonItem,
451
+ {
452
+ shape: "rectangle",
453
+ style: {
454
+ width: "100%",
455
+ height: "100%",
456
+ borderRadius: reactComponents.tokens.borderRadiusXLarge
457
+ }
458
+ }
459
+ ) }) });
460
+ }
425
461
  return /* @__PURE__ */ jsxRuntime.jsx(
426
462
  reactComponents.CarouselCard,
427
463
  {