negodesign 0.0.27 → 0.0.29

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 (55) hide show
  1. package/dist/assets/placeholder-company.png +0 -0
  2. package/dist/assets/placeholder-image.png +0 -0
  3. package/dist/components/core/banner/BannerNotification.svelte +94 -0
  4. package/dist/components/core/banner/BannerNotification.svelte.d.ts +4 -0
  5. package/dist/components/core/banner/CardAdBanner.svelte +74 -0
  6. package/dist/components/core/banner/CardAdBanner.svelte.d.ts +4 -0
  7. package/dist/components/core/banner/types.d.ts +42 -0
  8. package/dist/components/core/banner/types.js +1 -0
  9. package/dist/components/core/card/highlight/01/CardHighlight01.svelte +29 -6
  10. package/dist/components/core/card/highlight/02/CardHighlight02.svelte +27 -10
  11. package/dist/components/core/card/media/01/CardMedia01.svelte +124 -98
  12. package/dist/components/core/card/media/02/CardMedia02.svelte +125 -99
  13. package/dist/components/core/card/media/CardMedia.svelte +10 -9
  14. package/dist/components/core/card/media/CardMedia.svelte.d.ts +1 -0
  15. package/dist/components/core/card/profile/01/CardProfile01.svelte +104 -86
  16. package/dist/components/core/card/profile/02/CardProfile02.svelte +103 -87
  17. package/dist/components/core/card/profile/CardProfile.svelte +8 -7
  18. package/dist/components/core/card/profile/CardProfile.svelte.d.ts +1 -0
  19. package/dist/components/core/card/promotion/CardPromotion.svelte +30 -7
  20. package/dist/components/core/card/shared/CardButton.svelte +30 -21
  21. package/dist/components/core/card/shared/CardButton.svelte.d.ts +1 -0
  22. package/dist/components/core/card/shared/CardDescription.svelte +30 -30
  23. package/dist/components/core/card/shared/CardStarRating.svelte +18 -14
  24. package/dist/components/core/card/shared/CardStarRating.svelte.d.ts +1 -0
  25. package/dist/components/core/card/shared/CardStartPrice.svelte +26 -28
  26. package/dist/components/core/card/shared/CardTags.svelte +54 -57
  27. package/dist/components/core/card/shared/CardThumbnailVideo.svelte +207 -148
  28. package/dist/components/core/card/shared/CardThumbnailVideo.svelte.d.ts +1 -0
  29. package/dist/components/core/card/types.d.ts +2 -0
  30. package/dist/components/core/carousel/grid/media/types.d.ts +10 -0
  31. package/dist/components/core/carousel/grid/media/types.js +1 -0
  32. package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +48 -0
  33. package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte.d.ts +4 -0
  34. package/dist/components/core/carousel/grid/profile/types.d.ts +10 -0
  35. package/dist/components/core/carousel/grid/profile/types.js +1 -0
  36. package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +51 -0
  37. package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte.d.ts +4 -0
  38. package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +38 -0
  39. package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte.d.ts +10 -0
  40. package/dist/components/core/carousel/hero/CarouselHero.svelte +21 -19
  41. package/dist/components/core/carousel/hero/CarouselHero.svelte.d.ts +1 -0
  42. package/dist/components/core/carousel/highlights/types.d.ts +4 -4
  43. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +6 -22
  44. package/dist/components/core/carousel/promotion/types.d.ts +5 -5
  45. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +6 -23
  46. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +6 -1
  47. package/dist/components/core/carousel/types.d.ts +1 -0
  48. package/dist/components/core/panel/CarouselSlot.svelte +3 -14
  49. package/dist/components/core/panel/CarouselSlot.svelte.d.ts +2 -12
  50. package/dist/components/core/panel/type.d.ts +11 -0
  51. package/dist/components/core/panel/type.js +1 -0
  52. package/dist/globals.css +358 -83
  53. package/dist/index.d.ts +15 -5
  54. package/dist/index.js +15 -5
  55. package/package.json +1 -1
@@ -0,0 +1,94 @@
1
+ <script lang="ts">
2
+ import type { BannerNotificationProps } from "./types";
3
+
4
+ let {
5
+ strongText,
6
+ description,
7
+ ctaText,
8
+ ctaHref,
9
+ onCtaClick,
10
+ onDismiss,
11
+ bgClass = "bg-gray-800/50",
12
+ textClass = "text-gray-100",
13
+ ctaClass,
14
+ class: className = "",
15
+ }: BannerNotificationProps = $props();
16
+ </script>
17
+
18
+ <div
19
+ class="relative isolate flex items-center gap-x-6 overflow-hidden {bgClass} px-6 py-2.5 after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-white/10 sm:px-3.5 sm:before:flex-1 {className}"
20
+ >
21
+ <!-- Blur decorations -->
22
+ <div
23
+ aria-hidden="true"
24
+ class="absolute top-1/2 left-[max(-7rem,calc(50%-52rem))] -z-10 -translate-y-1/2 transform-gpu blur-2xl"
25
+ >
26
+ <div
27
+ style="clip-path: polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)"
28
+ class="aspect-577/310 w-144.25 bg-linear-to-r from-[#ff80b5] to-[#9089fc] opacity-40"
29
+ ></div>
30
+ </div>
31
+ <div
32
+ aria-hidden="true"
33
+ class="absolute top-1/2 left-[max(45rem,calc(50%+8rem))] -z-10 -translate-y-1/2 transform-gpu blur-2xl"
34
+ >
35
+ <div
36
+ style="clip-path: polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)"
37
+ class="aspect-577/310 w-144.25 bg-linear-to-r from-[#ff80b5] to-[#9089fc] opacity-40"
38
+ ></div>
39
+ </div>
40
+
41
+ <!-- Content -->
42
+ <div class="flex flex-wrap items-center gap-x-4 gap-y-2">
43
+ <p class="text-sm/6 {textClass}">
44
+ {#if strongText}
45
+ <strong class="font-semibold">{strongText}</strong><svg
46
+ viewBox="0 0 2 2"
47
+ aria-hidden="true"
48
+ class="mx-2 inline size-0.5 fill-current"><circle r="1" cx="1" cy="1" /></svg
49
+ >
50
+ {/if}
51
+ {description}
52
+ </p>
53
+ {#if ctaText}
54
+ {#if ctaHref}
55
+ <a
56
+ href={ctaHref}
57
+ class="flex-none rounded-full bg-white/10 px-3.5 py-1 text-sm font-semibold text-white shadow-xs inset-ring-white/20 hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white {ctaClass}"
58
+ >
59
+ {ctaText} <span aria-hidden="true">&rarr;</span>
60
+ </a>
61
+ {:else}
62
+ <button
63
+ type="button"
64
+ onclick={onCtaClick}
65
+ class="flex-none rounded-full bg-white/10 px-3.5 py-1 text-sm font-semibold text-white shadow-xs inset-ring-white/20 hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white {ctaClass}"
66
+ >
67
+ {ctaText} <span aria-hidden="true">&rarr;</span>
68
+ </button>
69
+ {/if}
70
+ {/if}
71
+ </div>
72
+
73
+ <!-- Dismiss -->
74
+ <div class="flex flex-1 justify-end">
75
+ <button
76
+ type="button"
77
+ onclick={onDismiss}
78
+ class="-m-3 p-3 focus-visible:-outline-offset-4"
79
+ >
80
+ <span class="sr-only">Dismiss</span>
81
+ <svg
82
+ viewBox="0 0 20 20"
83
+ fill="currentColor"
84
+ data-slot="icon"
85
+ aria-hidden="true"
86
+ class="size-5 text-gray-100"
87
+ >
88
+ <path
89
+ d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"
90
+ />
91
+ </svg>
92
+ </button>
93
+ </div>
94
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { BannerNotificationProps } from "./types";
2
+ declare const BannerNotification: import("svelte").Component<BannerNotificationProps, {}, "">;
3
+ type BannerNotification = ReturnType<typeof BannerNotification>;
4
+ export default BannerNotification;
@@ -0,0 +1,74 @@
1
+ <script lang="ts">
2
+ import { HugeiconsIcon } from "@hugeicons/svelte";
3
+ import Button from "../../ui/button/button.svelte";
4
+ import type { BannerProps } from "./types";
5
+ import { AdvertisimentIcon } from "@hugeicons/core-free-icons";
6
+
7
+ let {
8
+ tagText,
9
+ titleHighlight,
10
+ titleMain,
11
+ buttonText = "Saiba mais",
12
+ onClickButton,
13
+ href,
14
+ class: className = "",
15
+ titleHighlightClass,
16
+ titleMainClass,
17
+ tagTextClass,
18
+ buttonClass,
19
+ titleBgClass,
20
+ tagBgClass,
21
+ }: BannerProps = $props();
22
+ </script>
23
+
24
+ {#snippet content()}
25
+ <article
26
+ class="relative flex w-full items-stretch overflow-hidden rounded-lg border border-transparent {className}"
27
+ >
28
+ <!-- Left accent strip -->
29
+ <aside
30
+ class="flex w-28 shrink-0 flex-col justify-center gap-1 {tagBgClass ||
31
+ 'bg-blue-400'} px-3 py-2 sm:w-32"
32
+ >
33
+ <HugeiconsIcon
34
+ icon={AdvertisimentIcon}
35
+ size={30}
36
+ color="#ffffff"
37
+ strokeWidth={1}
38
+ />
39
+ <p
40
+ class={`text-sm leading-tight font-bold ${tagTextClass || "text-[#dce9e7]"}`}
41
+ >
42
+ {tagText}
43
+ </p>
44
+ </aside>
45
+
46
+ <!-- Main content -->
47
+ <div
48
+ class="flex flex-1 flex-wrap items-center justify-between gap-3 {titleBgClass ||
49
+ 'bg-[#dabc16]'} px-4 py-3 sm:px-6"
50
+ >
51
+ <h3 class="text-lg font-extrabold tracking-tight sm:text-2xl">
52
+ <span class="{titleHighlightClass || 'text-white'} pr-2"
53
+ >{titleHighlight}</span
54
+ >
55
+ <span class={titleMainClass || "text-gray-200"}>{titleMain}</span>
56
+ </h3>
57
+
58
+ <Button
59
+ onclick={() => onClickButton?.()}
60
+ class="shrink-0 rounded-md bg-white px-4 py-2 text-sm font-medium text-indigo-600 hover:bg-white/90 {buttonClass}"
61
+ >
62
+ {buttonText}
63
+ </Button>
64
+ </div>
65
+ </article>
66
+ {/snippet}
67
+
68
+ {#if href}
69
+ <a {href} class="block">
70
+ {@render content()}
71
+ </a>
72
+ {:else}
73
+ {@render content()}
74
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { BannerProps } from "./types";
2
+ declare const CardAdBanner: import("svelte").Component<BannerProps, {}, "">;
3
+ type CardAdBanner = ReturnType<typeof CardAdBanner>;
4
+ export default CardAdBanner;
@@ -0,0 +1,42 @@
1
+ export type BannerProps = {
2
+ /** Text shown stacked inside the amber side strip, e.g. "Este anúncio pode ser seu." */
3
+ tagText: string;
4
+ /** First part of the headline (rendered in the amber accent color) */
5
+ titleHighlight: string;
6
+ /** Second part of the headline (rendered in the green accent color) */
7
+ titleMain: string;
8
+ /** CTA button label */
9
+ buttonText?: string;
10
+ /** Called when the CTA button is clicked */
11
+ onClickButton?: () => void;
12
+ /** Optional href — if provided, the whole card navigates on click */
13
+ href?: string;
14
+ class?: string;
15
+ titleHighlightClass?: string;
16
+ titleMainClass?: string;
17
+ titleBgClass?: string;
18
+ tagTextClass?: string;
19
+ buttonClass?: string;
20
+ tagBgClass?: string;
21
+ };
22
+ export type BannerNotificationProps = {
23
+ /** Strong text before the separator, e.g. "GeneriCon 2023" */
24
+ strongText?: string;
25
+ /** Main description text */
26
+ description: string;
27
+ /** CTA button label */
28
+ ctaText?: string;
29
+ /** CTA button href */
30
+ ctaHref?: string;
31
+ /** Called when the CTA button is clicked */
32
+ onCtaClick?: () => void;
33
+ /** Called when the dismiss button is clicked */
34
+ onDismiss?: () => void;
35
+ /** Background class, default: bg-gray-800/50 */
36
+ bgClass?: string;
37
+ /** Text class for the description */
38
+ textClass?: string;
39
+ /** CTA button class */
40
+ ctaClass?: string;
41
+ class?: string;
42
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -5,6 +5,9 @@
5
5
  import CardDescription from "../../shared/CardDescription.svelte";
6
6
  import CardFavorite from "../../shared/CardFavorite.svelte";
7
7
  import CardTags from "../../shared/CardTags.svelte";
8
+ import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
9
+ import ImgPlaceholder from "../../../../../assets/placeholder-image.png";
10
+
8
11
  /**
9
12
  * Card component with a title and content.
10
13
  * @component
@@ -32,15 +35,25 @@
32
35
  class="flex gap-1 bg-white dark:bg-background p-3 rounded-lg shadow border"
33
36
  >
34
37
  <aside class="relative rounded-lg border h-50">
35
- <div class="left-1 z-2 flex gap-1 w-50">
38
+ <div class="absolute top-3 left-1 z-2 flex gap-1 w-50">
36
39
  {#if isLoading}
37
40
  <Skeleton class="w-hull h-full rounded-lg" />
38
41
  {:else if logo}
39
- <img src={logo} alt={title} class="rounded-lg" />
42
+ <img
43
+ src={logo}
44
+ alt={`Logo company ${title}`}
45
+ class="rounded-lg w-8 h-8 object-cover object-center"
46
+ />
47
+ {:else}
48
+ <img
49
+ src={ImgPlaceholderCompany}
50
+ alt={logo}
51
+ class="rounded-lg w-8 h-8 object-cover object-center"
52
+ />
40
53
  {/if}
41
54
  </div>
42
55
 
43
- <div class="absolute top-3 right-1">
56
+ <div class="absolute top-3 right-1 z-2">
44
57
  <CardFavorite
45
58
  {id}
46
59
  {isFavorite}
@@ -50,12 +63,18 @@
50
63
  </div>
51
64
 
52
65
  {#if isLoading}
53
- <Skeleton class="rounded-lg w-full h-full object-cover object-center" />
66
+ <Skeleton class="rounded-lg w-50 h-full object-cover object-center" />
54
67
  {:else if imageUrl}
55
68
  <img
56
69
  src={imageUrl}
57
70
  alt={imageUrl}
58
- class="rounded-lg w-full h-full object-cover object-center"
71
+ class="rounded-lg w-50 h-full object-cover object-center"
72
+ />
73
+ {:else}
74
+ <img
75
+ src={ImgPlaceholder}
76
+ alt={imageUrl}
77
+ class="rounded-lg w-50 h-full object-cover object-center"
59
78
  />
60
79
  {/if}
61
80
  <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
@@ -78,7 +97,11 @@
78
97
  />
79
98
  </div>
80
99
 
81
- <CardTags {tags} {isLoading} />
100
+ {#if tags && tags.length > 0}
101
+ <div class="w-full mb-2">
102
+ <CardTags {tags} />
103
+ </div>
104
+ {/if}
82
105
 
83
106
  {#if isLoading}
84
107
  <Skeleton class="h-10 w-full rounded-md mt-2 md:mt-3" />
@@ -5,6 +5,8 @@
5
5
  import CardDescription from "../../shared/CardDescription.svelte";
6
6
  import CardFavorite from "../../shared/CardFavorite.svelte";
7
7
  import CardTags from "../../shared/CardTags.svelte";
8
+ import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
9
+ import ImgPlaceholder from "../../../../../assets/placeholder-image.png";
8
10
  /**
9
11
  * Card component with a title and content.
10
12
  * @component
@@ -31,16 +33,28 @@
31
33
  <article
32
34
  class="flex flex-col gap-1 bg-white dark:bg-background p-3 rounded-lg shadow border"
33
35
  >
34
- <aside class="relative rounded-lg border h-50">
35
- <div class="left-1 z-2 flex gap-1 w-50">
36
+ <aside class="relative rounded-lg border h-36">
37
+ <div class="absolute top-3 left-1 z-2 flex gap-1">
36
38
  {#if isLoading}
37
- <Skeleton class="w-hull h-full rounded-lg" />
39
+ <Skeleton class="w-full h-full rounded-lg" />
38
40
  {:else if logo}
39
- <img src={logo} alt={title} class="rounded-lg" />
41
+ <img
42
+ src={logo}
43
+ alt={logo}
44
+ class="rounded-lg w-8 h-8 object-cover object-center"
45
+ onerror={(e) =>
46
+ ((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
47
+ />
48
+ {:else}
49
+ <img
50
+ src={ImgPlaceholderCompany}
51
+ alt={logo}
52
+ class="rounded-lg w-8 h-8 object-cover object-center"
53
+ />
40
54
  {/if}
41
55
  </div>
42
56
 
43
- <div class="absolute top-3 right-1">
57
+ <div class="absolute top-3 right-1 z-2">
44
58
  <CardFavorite
45
59
  {id}
46
60
  {isFavorite}
@@ -56,11 +70,12 @@
56
70
  src={imageUrl}
57
71
  alt={imageUrl}
58
72
  class="rounded-lg w-full h-full object-cover object-center"
73
+ onerror={(e) => ((e.target as HTMLImageElement).src = ImgPlaceholder)}
59
74
  />
60
75
  {/if}
61
76
  <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
62
77
  </aside>
63
- <div class="px-2">
78
+ <div class="px-2 w-55">
64
79
  <div class="rounded-md">
65
80
  {#if isLoading}
66
81
  <Skeleton class="h-4 w-30 rounded-lg" />
@@ -69,7 +84,7 @@
69
84
  {/if}
70
85
  </div>
71
86
 
72
- <div class="w-75 my-2">
87
+ <div class="my-2">
73
88
  <CardDescription
74
89
  {content}
75
90
  {isLoading}
@@ -78,9 +93,11 @@
78
93
  />
79
94
  </div>
80
95
 
81
- <div class="my-2">
82
- <CardTags {tags} {isLoading} />
83
- </div>
96
+ {#if tags && tags.length > 0}
97
+ <div class="my-2">
98
+ <CardTags {tags} {isLoading} />
99
+ </div>
100
+ {/if}
84
101
 
85
102
  {#if isLoading}
86
103
  <Skeleton class="h-10 w-full rounded-md mt-2 md:mt-3" />
@@ -1,111 +1,137 @@
1
1
  <script lang="ts">
2
- /**
3
- * Card component with a title and content.
4
- * @component
5
- */
6
- import {
7
- InformationCircleIcon,
8
- UserIcon,
9
- } from "@hugeicons/core-free-icons";
10
- import { t } from "../../../../../i18n";
11
- import type { CardMediaProps } from "../../types";
12
- import CardStarRating from "../../shared/CardStarRating.svelte";
13
- import CardDescription from "../../shared/CardDescription.svelte";
14
- import CardTags from "../../shared/CardTags.svelte";
15
- import CardThumbnailVideo from "../../shared/CardThumbnailVideo.svelte";
16
- import CardButton from "../../shared/CardButton.svelte";
17
- import CardFavorite from "../../shared/CardFavorite.svelte";
2
+ /**
3
+ * Card component with a title and content.
4
+ * @component
5
+ */
6
+ import { InformationCircleIcon, UserIcon } from "@hugeicons/core-free-icons";
7
+ import { t } from "../../../../../i18n";
8
+ import type { CardMediaProps } from "../../types";
9
+ import CardStarRating from "../../shared/CardStarRating.svelte";
10
+ import CardDescription from "../../shared/CardDescription.svelte";
11
+ import CardTags from "../../shared/CardTags.svelte";
12
+ import CardThumbnailVideo from "../../shared/CardThumbnailVideo.svelte";
13
+ import CardButton from "../../shared/CardButton.svelte";
14
+ import CardFavorite from "../../shared/CardFavorite.svelte";
15
+ import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
16
+ import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
18
17
 
19
- let {
20
- id,
21
- tags,
22
- logo,
23
- title,
24
- content,
25
- imageUrl,
26
- videoUrl,
27
- //videoAction,
28
- startNumber,
29
- startMax = 5,
30
- isImageButtonMaximized = false,
31
- isVideoButtonMaximized = false,
32
- isTagBorderBottom = false,
33
- isFavorite = false,
34
- buttonProfileClass,
35
- buttonDetailsClass,
36
- onFavoriteClick,
37
- onButtonProfile,
38
- onButtonDetails,
39
- }: CardMediaProps = $props();
18
+ let {
19
+ id,
20
+ tags,
21
+ logo,
22
+ title,
23
+ content,
24
+ imageUrl,
25
+ videoUrl,
26
+ //videoAction,
27
+ startNumber,
28
+ startMax = 5,
29
+ isImageButtonMaximized = false,
30
+ isVideoButtonMaximized = false,
31
+ isTagBorderBottom = false,
32
+ isFavorite = false,
33
+ isLoading = false,
34
+ buttonProfileClass,
35
+ buttonDetailsClass,
36
+ onFavoriteClick,
37
+ onButtonProfile,
38
+ onButtonDetails,
39
+ }: CardMediaProps = $props();
40
40
 
41
- let isShowButtonProfileAndDetails = $derived(
42
- onButtonProfile != null && onButtonDetails != null,
43
- );
41
+ let isShowButtonProfileAndDetails = $derived(
42
+ onButtonProfile != null && onButtonDetails != null,
43
+ );
44
44
  </script>
45
45
 
46
46
  <article
47
- class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg p-5 space-y-1 md:space-y-3"
47
+ class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg p-5 space-y-1 md:space-y-3"
48
48
  >
49
- <div class="flex justify-between items-center w-full mb-4">
50
- <div class="flex justify-start gap-2">
51
- <div class="flex justify-center items-center">
52
- {#if logo}
53
- <img src={logo} alt={logo} class="w-12 h-12 rounded-lg" />
54
- {/if}
55
- </div>
56
- <div class="flex-col">
57
- {#if title}
58
- <div class="text-center font-bold text-lg">{title}</div>
59
- {/if}
60
- {#if startNumber}
61
- <CardStarRating {startNumber} {startMax} />
62
- {/if}
63
- </div>
64
- </div>
65
- <div class="flex justify-end items-center">
66
- <CardFavorite
67
- {id}
68
- {isFavorite}
69
- onFavoriteClick={() => onFavoriteClick!(id)}
70
- />
71
- </div>
72
- </div>
49
+ <div class="flex justify-between items-center w-full mb-4">
50
+ <div class="flex justify-start gap-2">
51
+ <div class="flex justify-center items-center">
52
+ {#if isLoading}
53
+ <Skeleton class="w-12 h-12 rounded-lg bg-gray-300" />
54
+ {:else if logo}
55
+ <img
56
+ src={logo}
57
+ alt={logo}
58
+ class="w-12 h-12 rounded-lg"
59
+ onerror={(e) =>
60
+ ((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
61
+ />
62
+ {/if}
63
+ </div>
64
+ <div class="flex-col">
65
+ {#if title}
66
+ <div class="text-center font-bold text-lg">{title}</div>
67
+ {:else if isLoading}
68
+ <Skeleton class="w-40 h-5 rounded-lg bg-gray-400 mb-0.5" />
69
+ {/if}
73
70
 
74
- <div class="h-15 my-2">
75
- <CardDescription {content} />
71
+ {#if startNumber}
72
+ <CardStarRating {startNumber} {startMax} {isLoading} />
73
+ {:else if isLoading}
74
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-300 mt-0.5" />
75
+ {/if}
76
+ </div>
77
+ </div>
78
+ <div class="flex justify-end items-center">
79
+ <CardFavorite
80
+ {id}
81
+ {isFavorite}
82
+ {isLoading}
83
+ onFavoriteClick={() => onFavoriteClick!(id)}
84
+ />
76
85
  </div>
86
+ </div>
77
87
 
78
- <CardTags className="my-6" tags={tags ?? []} {isTagBorderBottom} />
88
+ <div class="h-15 my-2">
89
+ <CardDescription {content} {isLoading} />
90
+ </div>
79
91
 
80
- <CardThumbnailVideo
81
- {imageUrl}
82
- {videoUrl}
83
- {isImageButtonMaximized}
84
- {isVideoButtonMaximized}
85
- />
92
+ <CardTags
93
+ className="my-6"
94
+ tags={tags ?? []}
95
+ {isTagBorderBottom}
96
+ {isLoading}
97
+ />
86
98
 
87
- {#if onButtonProfile || onButtonDetails}
88
- <div class="flex justify-center items-center gap-2 mt-4 w-full">
89
- {#if onButtonProfile}
90
- <CardButton
91
- {id}
92
- icon={UserIcon}
93
- className={buttonProfileClass}
94
- text={$t("label.view.profile")}
95
- onClick={onButtonProfile}
96
- isFlex={isShowButtonProfileAndDetails}
97
- />
98
- {/if}
99
- {#if onButtonDetails}
100
- <CardButton
101
- {id}
102
- icon={InformationCircleIcon}
103
- className={buttonDetailsClass}
104
- text={$t("label.more.details")}
105
- onClick={onButtonDetails}
106
- isFlex={isShowButtonProfileAndDetails}
107
- />
108
- {/if}
109
- </div>
110
- {/if}
99
+ <CardThumbnailVideo
100
+ {imageUrl}
101
+ {videoUrl}
102
+ {isImageButtonMaximized}
103
+ {isVideoButtonMaximized}
104
+ {isLoading}
105
+ />
106
+
107
+ {#if onButtonProfile || onButtonDetails}
108
+ <div class="flex justify-center items-center gap-2 mt-4 w-full">
109
+ {#if onButtonProfile}
110
+ <CardButton
111
+ {id}
112
+ icon={UserIcon}
113
+ className={buttonProfileClass}
114
+ text={$t("label.view.profile")}
115
+ onClick={onButtonProfile}
116
+ isFlex={isShowButtonProfileAndDetails}
117
+ {isLoading}
118
+ />
119
+ {:else if isLoading}
120
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-400 mt-0.5" />
121
+ {/if}
122
+ {#if onButtonDetails}
123
+ <CardButton
124
+ {id}
125
+ icon={InformationCircleIcon}
126
+ className={buttonDetailsClass}
127
+ text={$t("label.more.details")}
128
+ onClick={onButtonDetails}
129
+ isFlex={isShowButtonProfileAndDetails}
130
+ {isLoading}
131
+ />
132
+ {:else if isLoading}
133
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-400 mt-0.5" />
134
+ {/if}
135
+ </div>
136
+ {/if}
111
137
  </article>