negodesign 0.0.25 → 0.0.26

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 (36) hide show
  1. package/dist/assets/start.png +0 -0
  2. package/dist/components/core/card/highlight/01/CardHighlight01.svelte +91 -0
  3. package/dist/components/core/card/highlight/01/CardHighlight01.svelte.d.ts +8 -0
  4. package/dist/components/core/card/highlight/02/CardHighlight02.svelte +93 -0
  5. package/dist/components/core/card/highlight/02/CardHighlight02.svelte.d.ts +8 -0
  6. package/dist/components/core/card/highlight/CardHighlight.svelte +13 -58
  7. package/dist/components/core/card/highlight/CardHighlight.svelte.d.ts +5 -2
  8. package/dist/components/core/card/highlight/data.js +32 -1
  9. package/dist/components/core/card/media/01/CardMedia01.svelte +8 -11
  10. package/dist/components/core/card/media/02/CardMedia02.svelte +4 -7
  11. package/dist/components/core/card/profile/01/CardProfile01.svelte +7 -10
  12. package/dist/components/core/card/profile/02/CardProfile02.svelte +2 -1
  13. package/dist/components/core/card/promotion/CardPromotion.svelte +49 -39
  14. package/dist/components/core/card/promotion/data.js +31 -0
  15. package/dist/components/core/card/shared/CardDescription.svelte +23 -8
  16. package/dist/components/core/card/shared/CardDescription.svelte.d.ts +3 -0
  17. package/dist/components/core/card/shared/CardStartPrice.svelte +34 -0
  18. package/dist/components/core/card/shared/CardStartPrice.svelte.d.ts +8 -0
  19. package/dist/components/core/card/shared/CardTags.svelte +32 -15
  20. package/dist/components/core/card/shared/CardTags.svelte.d.ts +2 -1
  21. package/dist/components/core/card/types.d.ts +13 -1
  22. package/dist/components/core/carousel/badge/ui/CarouselBadge.svelte +8 -5
  23. package/dist/components/core/carousel/highlights/types.d.ts +3 -0
  24. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +27 -5
  25. package/dist/components/core/carousel/promotion/types.d.ts +2 -0
  26. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +28 -5
  27. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +10 -5
  28. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte.d.ts +6 -1
  29. package/dist/components/core/carousel/types.d.ts +1 -2
  30. package/dist/components/core/nav/ui/nav-menu.svelte +3 -3
  31. package/dist/components/core/panel/CarouselSlot.svelte +37 -12
  32. package/dist/components/core/panel/CarouselSlot.svelte.d.ts +5 -2
  33. package/dist/globals.css +139 -17
  34. package/dist/hooks/responsive.svelte.d.ts +1 -1
  35. package/dist/hooks/responsive.svelte.js +1 -1
  36. package/package.json +3 -3
Binary file
@@ -0,0 +1,91 @@
1
+ <script lang="ts">
2
+ import Button from "../../../../ui/button/button.svelte";
3
+ import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
4
+ import { t } from "../../../../../i18n";
5
+ import CardDescription from "../../shared/CardDescription.svelte";
6
+ import CardFavorite from "../../shared/CardFavorite.svelte";
7
+ import CardTags from "../../shared/CardTags.svelte";
8
+ /**
9
+ * Card component with a title and content.
10
+ * @component
11
+ */
12
+ import type { CardHighlightProps } from "../../types";
13
+
14
+ let {
15
+ id,
16
+ logo,
17
+ tags,
18
+ title,
19
+ content,
20
+ imageUrl,
21
+ isLoading = false,
22
+ isFavorite = false,
23
+ buttonText,
24
+ isDescriptionIcon,
25
+ isDescriptionLabel,
26
+ onClickBtn,
27
+ onClickFavorite,
28
+ }: CardHighlightProps = $props();
29
+ </script>
30
+
31
+ <article
32
+ class="flex gap-1 bg-white dark:bg-background p-3 rounded-lg shadow border"
33
+ >
34
+ <aside class="relative rounded-lg border h-50">
35
+ <div class="left-1 z-2 flex gap-1 w-50">
36
+ {#if isLoading}
37
+ <Skeleton class="w-hull h-full rounded-lg" />
38
+ {:else if logo}
39
+ <img src={logo} alt={title} class="rounded-lg" />
40
+ {/if}
41
+ </div>
42
+
43
+ <div class="absolute top-3 right-1">
44
+ <CardFavorite
45
+ {id}
46
+ {isFavorite}
47
+ {isLoading}
48
+ onFavoriteClick={() => onClickFavorite?.(id)}
49
+ />
50
+ </div>
51
+
52
+ {#if isLoading}
53
+ <Skeleton class="rounded-lg w-full h-full object-cover object-center" />
54
+ {:else if imageUrl}
55
+ <img
56
+ src={imageUrl}
57
+ alt={imageUrl}
58
+ class="rounded-lg w-full h-full object-cover object-center"
59
+ />
60
+ {/if}
61
+ <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
62
+ </aside>
63
+ <div class="px-5">
64
+ <div class="p-2 rounded-md">
65
+ {#if isLoading}
66
+ <Skeleton class="h-4 w-30 rounded-lg" />
67
+ {:else if title}
68
+ <div class="font-semibold">{title}</div>
69
+ {/if}
70
+ </div>
71
+
72
+ <div class="w-75">
73
+ <CardDescription
74
+ {content}
75
+ {isLoading}
76
+ {isDescriptionIcon}
77
+ {isDescriptionLabel}
78
+ />
79
+ </div>
80
+
81
+ <CardTags {tags} {isLoading} />
82
+
83
+ {#if isLoading}
84
+ <Skeleton class="h-10 w-full rounded-md mt-2 md:mt-3" />
85
+ {:else}
86
+ <Button onclick={() => onClickBtn!(id)} class="mt-2 md:mt-3 md:min-w-32">
87
+ {buttonText || $t("label.buy")}
88
+ </Button>
89
+ {/if}
90
+ </div>
91
+ </article>
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Card component with a title and content.
3
+ * @component
4
+ */
5
+ import type { CardHighlightProps } from "../../types";
6
+ declare const CardHighlight01: import("svelte").Component<CardHighlightProps, {}, "">;
7
+ type CardHighlight01 = ReturnType<typeof CardHighlight01>;
8
+ export default CardHighlight01;
@@ -0,0 +1,93 @@
1
+ <script lang="ts">
2
+ import Button from "../../../../ui/button/button.svelte";
3
+ import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
4
+ import { t } from "../../../../../i18n";
5
+ import CardDescription from "../../shared/CardDescription.svelte";
6
+ import CardFavorite from "../../shared/CardFavorite.svelte";
7
+ import CardTags from "../../shared/CardTags.svelte";
8
+ /**
9
+ * Card component with a title and content.
10
+ * @component
11
+ */
12
+ import type { CardHighlightProps } from "../../types";
13
+
14
+ let {
15
+ id,
16
+ logo,
17
+ tags,
18
+ title,
19
+ content,
20
+ imageUrl,
21
+ isLoading = false,
22
+ isFavorite = false,
23
+ isDescriptionIcon,
24
+ isDescriptionLabel,
25
+ buttonText,
26
+ onClickBtn,
27
+ onClickFavorite,
28
+ }: CardHighlightProps = $props();
29
+ </script>
30
+
31
+ <article
32
+ class="flex flex-col gap-1 bg-white dark:bg-background p-3 rounded-lg shadow border"
33
+ >
34
+ <aside class="relative rounded-lg border h-50">
35
+ <div class="left-1 z-2 flex gap-1 w-50">
36
+ {#if isLoading}
37
+ <Skeleton class="w-hull h-full rounded-lg" />
38
+ {:else if logo}
39
+ <img src={logo} alt={title} class="rounded-lg" />
40
+ {/if}
41
+ </div>
42
+
43
+ <div class="absolute top-3 right-1">
44
+ <CardFavorite
45
+ {id}
46
+ {isFavorite}
47
+ {isLoading}
48
+ onFavoriteClick={() => onClickFavorite?.(id)}
49
+ />
50
+ </div>
51
+
52
+ {#if isLoading}
53
+ <Skeleton class="rounded-lg w-full h-full object-cover object-center" />
54
+ {:else if imageUrl}
55
+ <img
56
+ src={imageUrl}
57
+ alt={imageUrl}
58
+ class="rounded-lg w-full h-full object-cover object-center"
59
+ />
60
+ {/if}
61
+ <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
62
+ </aside>
63
+ <div class="px-2">
64
+ <div class="rounded-md">
65
+ {#if isLoading}
66
+ <Skeleton class="h-4 w-30 rounded-lg" />
67
+ {:else if title}
68
+ <div class="font-semibold my-2">{title}</div>
69
+ {/if}
70
+ </div>
71
+
72
+ <div class="w-75 my-2">
73
+ <CardDescription
74
+ {content}
75
+ {isLoading}
76
+ {isDescriptionIcon}
77
+ {isDescriptionLabel}
78
+ />
79
+ </div>
80
+
81
+ <div class="my-2">
82
+ <CardTags {tags} {isLoading} />
83
+ </div>
84
+
85
+ {#if isLoading}
86
+ <Skeleton class="h-10 w-full rounded-md mt-2 md:mt-3" />
87
+ {:else}
88
+ <Button onclick={() => onClickBtn!(id)} class="mt-2 md:mt-3 md:min-w-32">
89
+ {buttonText || $t("label.buy")}
90
+ </Button>
91
+ {/if}
92
+ </div>
93
+ </article>
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Card component with a title and content.
3
+ * @component
4
+ */
5
+ import type { CardHighlightProps } from "../../types";
6
+ declare const CardHighlight02: import("svelte").Component<CardHighlightProps, {}, "">;
7
+ type CardHighlight02 = ReturnType<typeof CardHighlight02>;
8
+ export default CardHighlight02;
@@ -1,67 +1,22 @@
1
1
  <script lang="ts">
2
- import Skeleton from "../../../ui/skeleton/skeleton.svelte";
3
- import CardFavorite from "../shared/CardFavorite.svelte";
4
2
  /**
5
3
  * Card component with a title and content.
6
4
  * @component
7
5
  */
8
- import type { CardPromotionProps } from "../types";
6
+ import type { CardHighlightProps } from "../types";
7
+ import CardHighlight01 from "./01/CardHighlight01.svelte";
8
+ import CardHighlight02 from "./02/CardHighlight02.svelte";
9
9
 
10
10
  let {
11
- id,
12
- logo,
13
- imageUrl,
14
- title,
15
- isLoading = false,
16
- isFavorite = false,
17
- onClickFavorite,
18
- }: CardPromotionProps = $props();
11
+ varient = 1,
12
+ ...restProps
13
+ }: CardHighlightProps & {
14
+ varient?: 1 | 2;
15
+ } = $props();
19
16
  </script>
20
17
 
21
- <article class="relative rounded-sm">
22
- {#if logo}
23
- <div class="absolute top-1 left-1 z-2 flex gap-1 p-2">
24
- {#if isLoading}
25
- <Skeleton class="h-30 w-30 rounded-lg" />
26
- {:else}
27
- <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
28
- {/if}
29
- </div>
30
- {/if}
31
-
32
- <div class="absolute top-1 right-1 z-2 flex gap-1 p-2">
33
- <CardFavorite
34
- {id}
35
- {isFavorite}
36
- {isLoading}
37
- onFavoriteClick={() => onClickFavorite?.(id)}
38
- />
39
- </div>
40
-
41
- {#if imageUrl}
42
- {#if isLoading}
43
- <Skeleton
44
- class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
45
- />
46
- {:else}
47
- <img
48
- src={imageUrl}
49
- alt={imageUrl}
50
- class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
51
- />
52
- {/if}
53
- {/if}
54
- <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
55
-
56
- <div
57
- 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"
58
- >
59
- {#if title}
60
- {#if isLoading}
61
- <Skeleton class="h-4 w-30 rounded-lg" />
62
- {:else}
63
- <div class="text-center font-semibold text-[12px]">{title}</div>
64
- {/if}
65
- {/if}
66
- </div>
67
- </article>
18
+ {#if varient == 2}
19
+ <CardHighlight02 {...restProps} />
20
+ {:else}
21
+ <CardHighlight01 {...restProps} />
22
+ {/if}
@@ -2,7 +2,10 @@
2
2
  * Card component with a title and content.
3
3
  * @component
4
4
  */
5
- import type { CardPromotionProps } from "../types";
6
- declare const CardHighlight: import("svelte").Component<CardPromotionProps, {}, "">;
5
+ import type { CardHighlightProps } from "../types";
6
+ type $$ComponentProps = CardHighlightProps & {
7
+ varient?: 1 | 2;
8
+ };
9
+ declare const CardHighlight: import("svelte").Component<$$ComponentProps, {}, "">;
7
10
  type CardHighlight = ReturnType<typeof CardHighlight>;
8
11
  export default CardHighlight;
@@ -1,31 +1,62 @@
1
+ import { GlobalIcon, MapPin, NecklaceIcon } from "@hugeicons/core-free-icons";
1
2
  const items = [
2
3
  {
3
4
  id: 1,
4
5
  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
6
  title: 'Hotel Baía Azul',
6
7
  isFavorite: true,
8
+ content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum",
9
+ tags: [
10
+ { icon: GlobalIcon, text: 'Luanda', },
11
+ { icon: MapPin, text: 'Kilamba', },
12
+ { icon: NecklaceIcon, text: 'Rua 19', },
13
+ ]
7
14
  },
8
15
  {
9
16
  id: 2,
10
17
  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
18
  title: 'Miramar Suites',
19
+ content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum",
20
+ tags: [
21
+ { icon: GlobalIcon, text: 'Luanda', },
22
+ { icon: MapPin, text: 'Kilamba', },
23
+ { icon: NecklaceIcon, text: 'Rua 19', },
24
+ ]
12
25
  },
13
26
  {
14
27
  id: 3,
15
28
  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
29
  title: 'Palm Resort & Spa',
17
- isFavorite: true
30
+ isFavorite: true,
31
+ content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum",
32
+ tags: [
33
+ { icon: GlobalIcon, text: 'Luanda', },
34
+ { icon: MapPin, text: 'Kilamba', },
35
+ { icon: NecklaceIcon, text: 'Rua 19', },
36
+ ]
18
37
  },
19
38
  {
20
39
  id: 4,
21
40
  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
41
  title: 'Hotel Central Park',
42
+ content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum",
43
+ tags: [
44
+ { icon: GlobalIcon, text: 'Luanda', },
45
+ { icon: MapPin, text: 'Kilamba', },
46
+ { icon: NecklaceIcon, text: 'Rua 19', },
47
+ ]
23
48
  },
24
49
  {
25
50
  id: 5,
26
51
  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
52
  title: 'Villa Serena Boutique',
28
53
  isFavorite: true,
54
+ content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum",
55
+ tags: [
56
+ { icon: GlobalIcon, text: 'Luanda', },
57
+ { icon: MapPin, text: 'Kilamba', },
58
+ { icon: NecklaceIcon, text: 'Rua 19', },
59
+ ]
29
60
  },
30
61
  ];
31
62
  export default items;
@@ -58,28 +58,25 @@
58
58
  <div class="text-center font-bold text-lg">{title}</div>
59
59
  {/if}
60
60
  {#if startNumber}
61
- <CardStarRating startNumber={startNumber} startMax={startMax} />
61
+ <CardStarRating {startNumber} {startMax} />
62
62
  {/if}
63
63
  </div>
64
64
  </div>
65
65
  <div class="flex justify-end items-center">
66
66
  <CardFavorite
67
- isFavorite={isFavorite}
67
+ {id}
68
+ {isFavorite}
68
69
  onFavoriteClick={() => onFavoriteClick!(id)}
69
70
  />
70
71
  </div>
71
72
  </div>
72
73
 
73
74
  <div class="h-15 my-2">
74
- <CardDescription content={content}/>
75
+ <CardDescription {content} />
75
76
  </div>
76
77
 
77
- <CardTags
78
- className="my-6"
79
- tags={tags ?? []}
80
- isTagBorderBottom={isTagBorderBottom}
81
- />
82
-
78
+ <CardTags className="my-6" tags={tags ?? []} {isTagBorderBottom} />
79
+
83
80
  <CardThumbnailVideo
84
81
  {imageUrl}
85
82
  {videoUrl}
@@ -91,7 +88,7 @@
91
88
  <div class="flex justify-center items-center gap-2 mt-4 w-full">
92
89
  {#if onButtonProfile}
93
90
  <CardButton
94
- id={id}
91
+ {id}
95
92
  icon={UserIcon}
96
93
  className={buttonProfileClass}
97
94
  text={$t("label.view.profile")}
@@ -101,7 +98,7 @@
101
98
  {/if}
102
99
  {#if onButtonDetails}
103
100
  <CardButton
104
- id={id}
101
+ {id}
105
102
  icon={InformationCircleIcon}
106
103
  className={buttonDetailsClass}
107
104
  text={$t("label.more.details")}
@@ -58,21 +58,18 @@
58
58
  <div class="text-center font-bold text-lg">{title}</div>
59
59
  {/if}
60
60
  {#if startNumber}
61
- <CardStarRating startNumber={startNumber} startMax={startMax} />
61
+ <CardStarRating {startNumber} {startMax} />
62
62
  {/if}
63
63
  </div>
64
64
  </div>
65
65
  <div class="flex justify-end items-center absolute top-0 right-0">
66
66
  <CardFavorite
67
- isFavorite={isFavorite}
67
+ {id}
68
+ {isFavorite}
68
69
  onFavoriteClick={() => onFavoriteClick!(id)}
69
70
  />
70
71
  </div>
71
- <CardTags
72
- className="my-4"
73
- tags={tags ?? []}
74
- {isTagBorderBottom}
75
- />
72
+ <CardTags className="my-4" tags={tags ?? []} {isTagBorderBottom} />
76
73
  </div>
77
74
 
78
75
  <div class="h-15 mb-8">
@@ -52,33 +52,30 @@
52
52
  <div class="text-center font-bold text-lg">{title}</div>
53
53
  {/if}
54
54
  {#if startNumber}
55
- <CardStarRating startNumber={startNumber} startMax={startMax} />
55
+ <CardStarRating {startNumber} {startMax} />
56
56
  {/if}
57
57
  </div>
58
58
  </div>
59
59
  <div class="flex justify-end items-center">
60
60
  <CardFavorite
61
- isFavorite={isFavorite}
61
+ {id}
62
+ {isFavorite}
62
63
  onFavoriteClick={() => onFavoriteClick!(id)}
63
64
  />
64
65
  </div>
65
66
  </div>
66
67
 
67
68
  <div class="h-15 my-2">
68
- <CardDescription content={content}/>
69
+ <CardDescription {content} />
69
70
  </div>
70
71
 
71
- <CardTags
72
- className="my-6"
73
- tags={tags ?? []}
74
- isTagBorderBottom={isTagBorderBottom}
75
- />
72
+ <CardTags className="my-6" tags={tags ?? []} {isTagBorderBottom} />
76
73
 
77
74
  {#if onButtonProfile || onButtonDetails}
78
75
  <div class="flex justify-center items-center gap-2 mt-4 w-full">
79
76
  {#if onButtonProfile}
80
77
  <CardButton
81
- id={id}
78
+ {id}
82
79
  icon={UserIcon}
83
80
  className={buttonProfileClass}
84
81
  text={$t("label.view.profile")}
@@ -88,7 +85,7 @@
88
85
  {/if}
89
86
  {#if onButtonDetails}
90
87
  <CardButton
91
- id={id}
88
+ {id}
92
89
  icon={InformationCircleIcon}
93
90
  className={buttonDetailsClass}
94
91
  text={$t("label.more.details")}
@@ -58,6 +58,7 @@
58
58
  </div>
59
59
  <div class="flex justify-end items-center absolute top-0 right-0">
60
60
  <CardFavorite
61
+ {id}
61
62
  {isFavorite}
62
63
  onFavoriteClick={() => onFavoriteClick!(id)}
63
64
  />
@@ -68,7 +69,7 @@
68
69
  <CardDescription {content} />
69
70
  </div>
70
71
 
71
- <CardTags className="my-4" tags={tags ?? []} {isTagBorderBottom}/>
72
+ <CardTags className="my-4" tags={tags ?? []} {isTagBorderBottom} />
72
73
 
73
74
  {#if onButtonProfile || onButtonDetails}
74
75
  <div class="flex justify-center items-center gap-2 mt-4 w-full">
@@ -3,7 +3,10 @@
3
3
  import Skeleton from "../../../ui/skeleton/skeleton.svelte";
4
4
  import { t } from "../../../../i18n";
5
5
  import CardCart from "../shared/CardCart.svelte";
6
+ import CardDescription from "../shared/CardDescription.svelte";
6
7
  import CardFavorite from "../shared/CardFavorite.svelte";
8
+ import CardStartPrice from "../shared/CardStartPrice.svelte";
9
+ import CardTags from "../shared/CardTags.svelte";
7
10
  /**
8
11
  * Card component with a title and content.
9
12
  * @component
@@ -12,28 +15,34 @@
12
15
 
13
16
  let {
14
17
  id,
18
+ tags,
15
19
  logo,
16
- imageUrl,
17
20
  title,
21
+ imageUrl,
18
22
  isFavorite = false,
19
23
  isCart = false,
20
24
  isLoading = false,
21
25
  newPrice,
22
26
  oldPrice,
27
+ content,
23
28
  buttonBuyText,
29
+ isDescriptionIcon,
30
+ isDescriptionLabel,
24
31
  onClickBuy,
25
32
  onClickShop,
26
33
  onClickFavorite,
27
34
  }: CardPromotionProps = $props();
28
35
  </script>
29
36
 
30
- <article class="relative rounded-sm bg-background">
31
- <div class="relative w-full p-2">
32
- {#if logo}
33
- <div class="absolute top-1 left-1 z-2 hidden gap-1 p-2">
37
+ <article class="relative rounded-lg border">
38
+ <aside class="relative w-full">
39
+ <div class="absolute top-1 left-1 z-2 gap-1 p-2">
40
+ {#if isLoading}
41
+ <Skeleton class="h-5 w-20 rounded-full bg-black/20" />
42
+ {:else if logo}
34
43
  <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
35
- </div>
36
- {/if}
44
+ {/if}
45
+ </div>
37
46
 
38
47
  <div class="absolute top-1 right-1 z-2 flex items-center gap-1 p-2">
39
48
  <CardFavorite
@@ -45,42 +54,24 @@
45
54
  <CardCart {id} {isCart} {isLoading} onCartClick={onClickShop} />
46
55
  </div>
47
56
 
48
- {#if imageUrl}
49
- {#if isLoading}
50
- <Skeleton
51
- class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
52
- />
53
- {:else}
54
- <img
55
- src={imageUrl}
56
- alt={imageUrl}
57
- class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
58
- />
59
- {/if}
57
+ {#if isLoading}
58
+ <Skeleton
59
+ class="rounded-lg md:h-25 md:w-25 lg:h-45 lg:w-45 object-cover object-center bg-black/15"
60
+ />
61
+ {:else if imageUrl}
62
+ <img
63
+ src={imageUrl}
64
+ alt={imageUrl}
65
+ class="rounded-tr-lg rounded-tl-lg h-25 lg:h-45 w-full object-cover object-center"
66
+ />
60
67
  {/if}
61
68
  <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
69
+ </aside>
62
70
 
63
- {#if newPrice || oldPrice}
64
- <div class="absolute bottom-2 right-3 z-2 flex items-center gap-2 mb-1">
65
- {#if oldPrice}
66
- <div
67
- class="text-[10px] md:text-sm line-through bg-red-500 text-white p-1 rounded-sm"
68
- >
69
- {oldPrice}
70
- </div>
71
- {/if}
72
- {#if newPrice}
73
- <div class="font-bold text-lg md:text-xl lg:text-2xl relative">
74
- {newPrice}
75
- </div>
76
- {/if}
77
- </div>
78
- {/if}
79
- </div>
80
- <div
71
+ <aside
81
72
  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"
82
73
  >
83
- <div class="flex justify-between w-full items-center">
74
+ <div class="flex justify-between w-full items-center mb-1">
84
75
  {#if title}
85
76
  {#if isLoading}
86
77
  <Skeleton class="h-4 w-30 rounded-lg" />
@@ -91,6 +82,25 @@
91
82
  {/if}
92
83
  {/if}
93
84
  </div>
85
+
86
+ <div>
87
+ <CardDescription {content} {isDescriptionIcon} {isDescriptionLabel} />
88
+ </div>
89
+
90
+ <div class="w-full mb-3">
91
+ <CardTags {tags} />
92
+ </div>
93
+
94
+ <div class="flex justify-start gap-2 w-full">
95
+ {#if isLoading}
96
+ <Skeleton class="h-5 bg-black/10 w-25 my-2 mr-2" />
97
+ {:else if newPrice || oldPrice}
98
+ <div>
99
+ <CardStartPrice {newPrice} {oldPrice} />
100
+ </div>
101
+ {/if}
102
+ </div>
103
+
94
104
  {#if isLoading}
95
105
  <Skeleton class="h-9 w-full rounded-md" />
96
106
  {:else}
@@ -98,5 +108,5 @@
98
108
  {buttonBuyText || $t("label.buy")}
99
109
  </Button>
100
110
  {/if}
101
- </div>
111
+ </aside>
102
112
  </article>