negodesign 0.0.20 → 0.0.21

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.
Files changed (31) hide show
  1. package/dist/components/core/card/highlight/CardHighlight.svelte +44 -0
  2. package/dist/components/core/card/highlight/CardHighlight.svelte.d.ts +8 -0
  3. package/dist/components/core/card/highlight/data.d.ts +3 -0
  4. package/dist/components/core/card/highlight/data.js +31 -0
  5. package/dist/components/core/card/promotion/CardPromotion.svelte +58 -21
  6. package/dist/components/core/card/promotion/data.js +31 -1
  7. package/dist/components/core/card/shared/CardCart.svelte +32 -0
  8. package/dist/components/core/card/shared/CardCart.svelte.d.ts +8 -0
  9. package/dist/components/core/card/shared/CardFavorite.svelte +5 -4
  10. package/dist/components/core/card/shared/CardFavorite.svelte.d.ts +2 -1
  11. package/dist/components/core/card/types.d.ts +13 -0
  12. package/dist/components/core/carousel/hero/CarouselHero.svelte +5 -2
  13. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +65 -0
  14. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte.d.ts +4 -0
  15. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +13 -1
  16. package/dist/components/core/carousel/shared/ui/SimpleBadgeCarousel.svelte +49 -28
  17. package/dist/components/core/carousel/types.d.ts +18 -2
  18. package/dist/components/ui/skeleton/skeleton.svelte +1 -1
  19. package/dist/globals.css +12431 -9
  20. package/dist/i18n/langs/en.d.ts +4 -0
  21. package/dist/i18n/langs/en.js +4 -0
  22. package/dist/i18n/langs/pt.d.ts +4 -0
  23. package/dist/i18n/langs/pt.js +4 -0
  24. package/dist/i18n/translations.d.ts +8 -0
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +2 -1
  27. package/dist/styles/globals.css +2 -1
  28. package/dist/styles/hgi-stroke-rounded.css +1 -0
  29. package/dist/styles/hgi-stroke-rounded.woff2 +0 -0
  30. package/dist/types/index.d.ts +3 -0
  31. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import CardFavorite from "../shared/CardFavorite.svelte";
3
+ /**
4
+ * Card component with a title and content.
5
+ * @component
6
+ */
7
+ import type { CardPromotionProps } from "../types";
8
+
9
+ let {
10
+ logo,
11
+ imageUrl,
12
+ title,
13
+ isFavorite = false,
14
+ }: CardPromotionProps = $props();
15
+ </script>
16
+
17
+ <article class="relative rounded-sm">
18
+ {#if logo}
19
+ <div class="absolute top-1 left-1 z-2 flex gap-1 p-2">
20
+ <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
21
+ </div>
22
+ {/if}
23
+
24
+ <div class="absolute top-1 right-1 z-2 flex gap-1 p-2">
25
+ <CardFavorite {isFavorite} />
26
+ </div>
27
+
28
+ {#if imageUrl}
29
+ <img
30
+ src={imageUrl}
31
+ alt={imageUrl}
32
+ class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
33
+ />
34
+ {/if}
35
+ <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
36
+
37
+ <div
38
+ class="absolute bottom-1 inset-x-0 flex justify-center m-auto bg-black/10 backdrop-blur-sm max-w-11/12 p-2 rounded-md"
39
+ >
40
+ {#if title}
41
+ <div class="text-center font-semibold text-[12px]">{title}</div>
42
+ {/if}
43
+ </div>
44
+ </article>
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Card component with a title and content.
3
+ * @component
4
+ */
5
+ import type { CardPromotionProps } from "../types";
6
+ declare const CardHighlight: import("svelte").Component<CardPromotionProps, {}, "">;
7
+ type CardHighlight = ReturnType<typeof CardHighlight>;
8
+ export default CardHighlight;
@@ -0,0 +1,3 @@
1
+ import type { CardHighlightProps } from "../types";
2
+ declare const items: CardHighlightProps[];
3
+ export default items;
@@ -0,0 +1,31 @@
1
+ const items = [
2
+ {
3
+ id: 1,
4
+ imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
5
+ title: 'Hotel Baía Azul',
6
+ isFavorite: true,
7
+ },
8
+ {
9
+ id: 2,
10
+ imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
11
+ title: 'Miramar Suites',
12
+ },
13
+ {
14
+ id: 3,
15
+ imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
16
+ title: 'Palm Resort & Spa',
17
+ isFavorite: true
18
+ },
19
+ {
20
+ id: 4,
21
+ imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
22
+ title: 'Hotel Central Park',
23
+ },
24
+ {
25
+ id: 5,
26
+ imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
27
+ title: 'Villa Serena Boutique',
28
+ isFavorite: true,
29
+ },
30
+ ];
31
+ export default items;
@@ -1,4 +1,7 @@
1
1
  <script lang="ts">
2
+ import Button from "../../../ui/button/button.svelte";
3
+ import { t } from "../../../../i18n";
4
+ import CardCart from "../shared/CardCart.svelte";
2
5
  import CardFavorite from "../shared/CardFavorite.svelte";
3
6
  /**
4
7
  * Card component with a title and content.
@@ -7,38 +10,72 @@
7
10
  import type { CardPromotionProps } from "../types";
8
11
 
9
12
  let {
13
+ id,
10
14
  logo,
11
15
  imageUrl,
12
16
  title,
13
17
  isFavorite = false,
18
+ isCart = false,
19
+ newPrice,
20
+ oldPrice,
21
+ buttonBuyText,
22
+ onClickBuy,
23
+ onClickShop,
24
+ onClickFavorite,
14
25
  }: CardPromotionProps = $props();
15
26
  </script>
16
27
 
17
- <article class="relative rounded-sm">
18
- {#if logo}
19
- <div class="absolute top-1 left-1 z-2 flex gap-1 p-2">
20
- <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
21
- </div>
22
- {/if}
28
+ <article class="relative rounded-sm bg-background">
29
+ <div class="relative w-full p-2">
30
+ {#if logo}
31
+ <div class="absolute top-1 left-1 z-2 hidden gap-1 p-2">
32
+ <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
33
+ </div>
34
+ {/if}
23
35
 
24
- <div class="absolute top-1 right-1 z-2 flex gap-1 p-2">
25
- <CardFavorite {isFavorite} />
26
- </div>
36
+ <div class="absolute top-1 right-1 z-2 flex items-center gap-1 p-2">
37
+ <CardFavorite {id} {isFavorite} onFavoriteClick={onClickFavorite} />
38
+ <CardCart {id} {isCart} onCartClick={onClickShop} />
39
+ </div>
27
40
 
28
- {#if imageUrl}
29
- <img
30
- src={imageUrl}
31
- alt={imageUrl}
32
- class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
33
- />
34
- {/if}
35
- <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
41
+ {#if imageUrl}
42
+ <img
43
+ src={imageUrl}
44
+ alt={imageUrl}
45
+ class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
46
+ />
47
+ {/if}
48
+ <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
36
49
 
50
+ {#if newPrice || oldPrice}
51
+ <div class="absolute bottom-2 right-3 z-2 flex items-center gap-2 mb-1">
52
+ {#if oldPrice}
53
+ <div
54
+ class="text-[10px] md:text-sm line-through bg-red-500 text-white p-1 rounded-sm"
55
+ >
56
+ {oldPrice}
57
+ </div>
58
+ {/if}
59
+ {#if newPrice}
60
+ <div class="font-bold text-lg md:text-xl lg:text-2xl relative">
61
+ {newPrice}
62
+ </div>
63
+ {/if}
64
+ </div>
65
+ {/if}
66
+ </div>
37
67
  <div
38
- class="absolute bottom-1 inset-x-0 flex justify-center m-auto bg-black/10 backdrop-blur-sm max-w-11/12 p-2 rounded-md"
68
+ class="bottom-1 inset-x-0 flex flex-col items-center justify-center gap-0.5 m-auto max-w-11/12 p-1 rounded-md"
39
69
  >
40
- {#if title}
41
- <div class="text-center font-semibold text-[12px]">{title}</div>
42
- {/if}
70
+ <div class="flex justify-between w-full items-center">
71
+ {#if title}
72
+ <div class="font-semibold line-clamp-1 flex-nowrap">
73
+ {title}
74
+ </div>
75
+ {/if}
76
+ </div>
77
+ <Button onclick={() => onClickBuy!(id)} class="w-full">
78
+ {buttonBuyText || $t("label.buy")}
79
+ </Button>
43
80
  </div>
44
81
  </article>
@@ -4,28 +4,58 @@ const items = [
4
4
  imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
5
5
  title: 'Hotel Baía Azul',
6
6
  isFavorite: true,
7
+ newPrice: 1000,
8
+ oldPrice: 2000,
9
+ buttonBuyText: 'Comprar',
10
+ onClickBuy: () => alert('Comprar'),
11
+ onClickShop: (id) => alert(`Shop ${id}`),
12
+ isCart: true,
7
13
  },
8
14
  {
9
15
  id: 2,
10
16
  imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
11
17
  title: 'Miramar Suites',
18
+ newPrice: 1000,
19
+ oldPrice: 2000,
20
+ buttonBuyText: 'Comprar',
21
+ onClickBuy: (id) => alert(`Buy ${id}`),
22
+ onClickShop: (id) => alert(`Shop ${id}`),
23
+ isCart: true,
12
24
  },
13
25
  {
14
26
  id: 3,
15
27
  imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
16
28
  title: 'Palm Resort & Spa',
17
- isFavorite: true
29
+ isFavorite: true,
30
+ newPrice: 1000,
31
+ oldPrice: 2000,
32
+ buttonBuyText: 'Comprar',
33
+ onClickBuy: (id) => alert(`Buy ${id}`),
34
+ onClickShop: (id) => alert(`Shop ${id}`),
35
+ isCart: true,
18
36
  },
19
37
  {
20
38
  id: 4,
21
39
  imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
22
40
  title: 'Hotel Central Park',
41
+ newPrice: 1000,
42
+ oldPrice: 2000,
43
+ buttonBuyText: 'Comprar',
44
+ onClickBuy: (id) => alert(`Buy ${id}`),
45
+ onClickShop: (id) => alert(`Shop ${id}`),
46
+ isCart: true,
23
47
  },
24
48
  {
25
49
  id: 5,
26
50
  imageUrl: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
27
51
  title: 'Villa Serena Boutique',
28
52
  isFavorite: true,
53
+ newPrice: 1000,
54
+ oldPrice: 2000,
55
+ buttonBuyText: 'Comprar',
56
+ onClickBuy: (id) => alert(`Buy ${id}`),
57
+ onClickShop: (id) => alert(`Shop ${id}`),
58
+ isCart: true,
29
59
  },
30
60
  ];
31
61
  export default items;
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+ import { Button } from "../../../ui/button/index.js";
3
+ import {
4
+ ShoppingCartAdd01Icon,
5
+ ShoppingCartRemove01Icon,
6
+ } from "@hugeicons/core-free-icons";
7
+ import { HugeiconsIcon } from "@hugeicons/svelte";
8
+
9
+ type Props = {
10
+ id: string | number;
11
+ isCart: boolean;
12
+ onCartClick?: (id: string | number) => void;
13
+ };
14
+
15
+ let { id, isCart, onCartClick }: Props = $props();
16
+ </script>
17
+
18
+ {#if isCart}
19
+ <Button
20
+ class="w-8 h-8 rounded-full bg-[#1d63be]"
21
+ onclick={() => onCartClick!(id)}
22
+ >
23
+ <HugeiconsIcon icon={ShoppingCartRemove01Icon} />
24
+ </Button>
25
+ {:else}
26
+ <Button
27
+ class="w-8 h-8 rounded-full bg-[#808080]"
28
+ onclick={() => onCartClick!(id)}
29
+ >
30
+ <HugeiconsIcon icon={ShoppingCartAdd01Icon} />
31
+ </Button>
32
+ {/if}
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ id: string | number;
3
+ isCart: boolean;
4
+ onCartClick?: (id: string | number) => void;
5
+ };
6
+ declare const CardCart: import("svelte").Component<Props, {}, "">;
7
+ type CardCart = ReturnType<typeof CardCart>;
8
+ export default CardCart;
@@ -4,24 +4,25 @@
4
4
  import { HugeiconsIcon } from "@hugeicons/svelte";
5
5
 
6
6
  type Props = {
7
+ id: string | number;
7
8
  isFavorite: boolean;
8
- onFavoriteClick?: () => void;
9
+ onFavoriteClick?: (id: string | number) => void;
9
10
  };
10
11
 
11
- let { isFavorite, onFavoriteClick }: Props = $props();
12
+ let { id, isFavorite, onFavoriteClick }: Props = $props();
12
13
  </script>
13
14
 
14
15
  {#if isFavorite}
15
16
  <Button
16
17
  class="w-8 h-8 rounded-full bg-[#ce2356]"
17
- onclick={() => onFavoriteClick!()}
18
+ onclick={() => onFavoriteClick!(id)}
18
19
  >
19
20
  <HugeiconsIcon icon={HeartRemoveIcon} />
20
21
  </Button>
21
22
  {:else}
22
23
  <Button
23
24
  class="w-8 h-8 rounded-full bg-[#808080]"
24
- onclick={() => onFavoriteClick!()}
25
+ onclick={() => onFavoriteClick!(id)}
25
26
  >
26
27
  <HugeiconsIcon icon={HeartAddIcon} />
27
28
  </Button>
@@ -1,6 +1,7 @@
1
1
  type Props = {
2
+ id: string | number;
2
3
  isFavorite: boolean;
3
- onFavoriteClick?: () => void;
4
+ onFavoriteClick?: (id: string | number) => void;
4
5
  };
5
6
  declare const CardFavorite: import("svelte").Component<Props, {}, "">;
6
7
  type CardFavorite = ReturnType<typeof CardFavorite>;
@@ -48,7 +48,20 @@ export interface CardPromotionProps {
48
48
  imageUrl?: string;
49
49
  title?: string;
50
50
  className?: string;
51
+ isCart?: boolean;
51
52
  isFavorite?: boolean;
52
53
  oldPrice?: string | number;
53
54
  newPrice?: string | number;
55
+ buttonBuyText?: string;
56
+ onClickBuy?: (id: string | number) => void;
57
+ onClickShop?: (id: string | number) => void;
58
+ onClickFavorite?: (id: string | number) => void;
59
+ }
60
+ export interface CardHighlightProps {
61
+ id: string | number;
62
+ logo?: string;
63
+ imageUrl?: string;
64
+ title?: string;
65
+ className?: string;
66
+ isFavorite?: boolean;
54
67
  }
@@ -88,16 +88,19 @@
88
88
  >
89
89
  {#each layers as bg, i (i)}
90
90
  <div
91
- class="absolute inset-0 bg-cover bg-center bg-no-repeat will-change-[opacity]"
91
+ class="absolute inset-0 will-change-[opacity]"
92
92
  style="
93
93
  background-image: {bg ? `url(${bg})` : 'none'};
94
+ background-size: cover;
95
+ background-position: center;
96
+ background-repeat: no-repeat;
94
97
  opacity: {i === active ? 1 : 0};
95
98
  transition: opacity {transitionMs}ms ease-in-out;
96
99
  "
97
100
  ></div>
98
101
  {/each}
99
102
 
100
- <div class="absolute inset-0 bg-black/40"></div>
103
+ <div class="h-full absolute inset-0 bg-black/40"></div>
101
104
 
102
105
  <div class="relative z-10 w-full flex flex-col items-center flex-1">
103
106
  <NavMenu {...navMenu} />
@@ -0,0 +1,65 @@
1
+ <script lang="ts">
2
+ import type { CarouselHighlightsProps } from "../../types.js";
3
+ import Button from "../../../../ui/button/button.svelte";
4
+ import CarouselSlot from "../../../panel/CarouselSlot.svelte";
5
+ import { t } from "../../../../../i18n";
6
+ import { HugeiconsIcon } from "@hugeicons/svelte";
7
+ import { ArrowRight02Icon } from "@hugeicons/core-free-icons";
8
+ import CardHighlight from "../../../card/highlight/CardHighlight.svelte";
9
+
10
+ const {
11
+ title,
12
+ items,
13
+ description,
14
+ titleClass,
15
+ descriptionClass,
16
+ isButtonPreviousAndNext = true,
17
+ buttonPreviousAndNextClass = "",
18
+ containerClass = "",
19
+ onButtonViewAll,
20
+ }: CarouselHighlightsProps = $props();
21
+ </script>
22
+
23
+ <div class="w-full flex justify-center">
24
+ <div class="w-[95%] p-2 rounded-xl {containerClass}">
25
+ <div class="ml-10 flex flex-col gap-1">
26
+ <div class="flex justify-between">
27
+ <div>
28
+ {#if title}
29
+ <h1 class={`text-xl ${titleClass}`}>{title}</h1>
30
+ {/if}
31
+ {#if description}
32
+ <div class={`mt-3 w-11/12 ${descriptionClass}`}>
33
+ {description}
34
+ </div>
35
+ {/if}
36
+ </div>
37
+ {#if onButtonViewAll}
38
+ <div>
39
+ <Button
40
+ variant="ghost"
41
+ size="sm"
42
+ class="flex items-center gap-0.5"
43
+ onclick={onButtonViewAll}
44
+ >
45
+ {$t("label.view.full")}
46
+ <HugeiconsIcon icon={ArrowRight02Icon} />
47
+ </Button>
48
+ </div>
49
+ {/if}
50
+ </div>
51
+ </div>
52
+ <CarouselSlot
53
+ isBorderBottom={false}
54
+ {isButtonPreviousAndNext}
55
+ {buttonPreviousAndNextClass}
56
+ containerClass="w-full"
57
+ >
58
+ {#each items as item (item.id)}
59
+ <div class="mx-2">
60
+ <CardHighlight {...item} />
61
+ </div>
62
+ {/each}
63
+ </CarouselSlot>
64
+ </div>
65
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { CarouselHighlightsProps } from "../../types.js";
2
+ declare const CarouselHighlights: import("svelte").Component<CarouselHighlightsProps, {}, "">;
3
+ type CarouselHighlights = ReturnType<typeof CarouselHighlights>;
4
+ export default CarouselHighlights;
@@ -10,6 +10,9 @@
10
10
  const {
11
11
  title,
12
12
  items,
13
+ description,
14
+ titleClass,
15
+ descriptionClass,
13
16
  isButtonPreviousAndNext = true,
14
17
  buttonPreviousAndNextClass = "",
15
18
  containerClass = "",
@@ -21,7 +24,16 @@
21
24
  <div class="w-[95%] p-2 rounded-xl {containerClass}">
22
25
  <div class="ml-10 flex flex-col gap-1">
23
26
  <div class="flex justify-between">
24
- <div class="text-xl">{title ?? $t("label.promotion")}</div>
27
+ <div>
28
+ {#if title}
29
+ <h1 class={`text-xl ${titleClass}`}>{title}</h1>
30
+ {/if}
31
+ {#if description}
32
+ <div class={`mt-3 w-11/12 ${descriptionClass}`}>
33
+ {description}
34
+ </div>
35
+ {/if}
36
+ </div>
25
37
  {#if onButtonViewAll}
26
38
  <div>
27
39
  <Button
@@ -3,6 +3,7 @@
3
3
  import type { SimpleBadgeCarouselProps } from "../../types.js";
4
4
  import { HugeiconsIcon } from "@hugeicons/svelte";
5
5
  import CarouselSlot from "../../../panel/CarouselSlot.svelte";
6
+ import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
6
7
 
7
8
  const {
8
9
  items,
@@ -11,14 +12,16 @@
11
12
  labelClass,
12
13
  activeClass,
13
14
  valueActive,
15
+ isLoading = false,
16
+ itemCarouselClass,
14
17
  orientation = "horizontal",
15
- isBorderItem = true,
16
- isBorderBottom = true,
18
+ isBorderItem = false,
19
+ isBorderBottom = false,
17
20
  isButtonPreviousAndNext = true,
18
21
  buttonPreviousAndNextClass = "",
19
22
  }: SimpleBadgeCarouselProps = $props();
20
23
 
21
- const DEFAULT_IMG_OR_ICON_CLASS = "size-5 rounded-lg";
24
+ const DEFAULT_IMG_OR_ICON_CLASS = "size-3";
22
25
  </script>
23
26
 
24
27
  <CarouselSlot
@@ -26,34 +29,52 @@
26
29
  {isButtonPreviousAndNext}
27
30
  {buttonPreviousAndNextClass}
28
31
  >
29
- {#each items as item (item.value)}
30
- <Carousel.Item
31
- onclick={() => item.onClick?.(item.value)}
32
- class={`
32
+ {#if isLoading}
33
+ {#each Array.from({ length: 10 }) as it (it)}
34
+ <Carousel.Item>
35
+ <Skeleton class="h-4 w-37.5" />
36
+ </Carousel.Item>
37
+ {/each}
38
+ {:else}
39
+ {#each items as item (item.value)}
40
+ <Carousel.Item
41
+ onclick={() => item.onClick?.(item.value)}
42
+ class={`
33
43
  flex cursor-pointer items-center justify-center gap-1 basis-auto mx-3 pl-0
34
44
  ${isBorderItem ? "border border-solid border-gray-300 rounded-lg" : ""}
35
- ${item.value === valueActive ? activeClass : ""}`}
36
- >
37
- <div
38
- class={`
45
+ ${item.value === valueActive ? activeClass : ""}
46
+ ${itemCarouselClass}`}
47
+ >
48
+ <div
49
+ class={`
39
50
  flex gap-1 mx-2 p-0.5 justify-center items-center
40
51
  ${orientation === "horizontal" ? "flex-row" : "flex-col"}
41
52
  `}
42
- >
43
- {#if item.image}
44
- <img
45
- src={item.image}
46
- alt={item.label}
47
- class={imageClass || DEFAULT_IMG_OR_ICON_CLASS}
48
- />
49
- {:else if item.icon}
50
- <HugeiconsIcon
51
- icon={item.icon}
52
- class={iconClass || DEFAULT_IMG_OR_ICON_CLASS}
53
- />
54
- {/if}
55
- <div class={`${labelClass}`}>{item.label}</div>
56
- </div>
57
- </Carousel.Item>
58
- {/each}
53
+ >
54
+ {#if item.image}
55
+ <img
56
+ src={item.image}
57
+ alt={item.label}
58
+ class={imageClass || DEFAULT_IMG_OR_ICON_CLASS}
59
+ />
60
+ {:else if item.icon}
61
+ {#if typeof item.icon === "string"}
62
+ <div>
63
+ <i
64
+ class={`${item.icon} ${iconClass || DEFAULT_IMG_OR_ICON_CLASS}`}
65
+ >
66
+ </i>
67
+ </div>
68
+ {:else}
69
+ <HugeiconsIcon
70
+ icon={item.icon}
71
+ class={iconClass || DEFAULT_IMG_OR_ICON_CLASS}
72
+ />
73
+ {/if}
74
+ {/if}
75
+ <div class={`${labelClass}`}>{item.label}</div>
76
+ </div>
77
+ </Carousel.Item>
78
+ {/each}
79
+ {/if}
59
80
  </CarouselSlot>
@@ -1,12 +1,12 @@
1
1
  import type { IconSvgElement } from "@hugeicons/svelte";
2
- import type { CardPromotionProps } from "../card/types";
2
+ import type { CardHighlightProps, CardPromotionProps } from "../card/types";
3
3
  import type { NavMenuProps } from "../nav/data/nav-menu";
4
4
  export interface ItemCarousel {
5
5
  value: string;
6
6
  label: string;
7
7
  image?: string;
8
8
  link?: string;
9
- icon?: IconSvgElement;
9
+ icon?: IconSvgElement | string;
10
10
  isActive?: boolean;
11
11
  onClick?: (value: string) => void;
12
12
  }
@@ -18,14 +18,18 @@ export interface SimpleBadgeCarouselProps {
18
18
  labelClass?: string;
19
19
  activeClass?: string;
20
20
  valueActive?: string;
21
+ isLoading?: boolean;
21
22
  isBorderItem?: boolean;
22
23
  isBorderBottom?: boolean;
24
+ itemCarouselClass?: string;
23
25
  isButtonPreviousAndNext?: boolean;
24
26
  buttonPreviousAndNextClass?: string;
25
27
  }
26
28
  export interface CarouselPromotionProps {
27
29
  title?: string;
28
30
  description?: string;
31
+ titleClass?: string;
32
+ descriptionClass?: string;
29
33
  items: CardPromotionProps[];
30
34
  isBorderBottom?: boolean;
31
35
  isButtonPreviousAndNext?: boolean;
@@ -45,3 +49,15 @@ export interface CarouselHeroProps {
45
49
  titleClass?: string;
46
50
  descriptionClass?: string;
47
51
  }
52
+ export interface CarouselHighlightsProps {
53
+ title?: string;
54
+ description?: string;
55
+ titleClass?: string;
56
+ descriptionClass?: string;
57
+ items: CardHighlightProps[];
58
+ isBorderBottom?: boolean;
59
+ isButtonPreviousAndNext?: boolean;
60
+ buttonPreviousAndNextClass?: string;
61
+ containerClass?: string;
62
+ onButtonViewAll?: () => void;
63
+ }
@@ -12,6 +12,6 @@
12
12
  <div
13
13
  bind:this={ref}
14
14
  data-slot="skeleton"
15
- class={cn("bg-muted rounded-xl animate-pulse", className)}
15
+ class={cn("rounded-xl bg-muted animate-pulse", className)}
16
16
  {...restProps}
17
17
  ></div>