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.
- package/dist/assets/placeholder-company.png +0 -0
- package/dist/assets/placeholder-image.png +0 -0
- package/dist/components/core/banner/BannerNotification.svelte +94 -0
- package/dist/components/core/banner/BannerNotification.svelte.d.ts +4 -0
- package/dist/components/core/banner/CardAdBanner.svelte +74 -0
- package/dist/components/core/banner/CardAdBanner.svelte.d.ts +4 -0
- package/dist/components/core/banner/types.d.ts +42 -0
- package/dist/components/core/banner/types.js +1 -0
- package/dist/components/core/card/highlight/01/CardHighlight01.svelte +29 -6
- package/dist/components/core/card/highlight/02/CardHighlight02.svelte +27 -10
- package/dist/components/core/card/media/01/CardMedia01.svelte +124 -98
- package/dist/components/core/card/media/02/CardMedia02.svelte +125 -99
- package/dist/components/core/card/media/CardMedia.svelte +10 -9
- package/dist/components/core/card/media/CardMedia.svelte.d.ts +1 -0
- package/dist/components/core/card/profile/01/CardProfile01.svelte +104 -86
- package/dist/components/core/card/profile/02/CardProfile02.svelte +103 -87
- package/dist/components/core/card/profile/CardProfile.svelte +8 -7
- package/dist/components/core/card/profile/CardProfile.svelte.d.ts +1 -0
- package/dist/components/core/card/promotion/CardPromotion.svelte +30 -7
- package/dist/components/core/card/shared/CardButton.svelte +30 -21
- package/dist/components/core/card/shared/CardButton.svelte.d.ts +1 -0
- package/dist/components/core/card/shared/CardDescription.svelte +30 -30
- package/dist/components/core/card/shared/CardStarRating.svelte +18 -14
- package/dist/components/core/card/shared/CardStarRating.svelte.d.ts +1 -0
- package/dist/components/core/card/shared/CardStartPrice.svelte +26 -28
- package/dist/components/core/card/shared/CardTags.svelte +54 -57
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte +207 -148
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte.d.ts +1 -0
- package/dist/components/core/card/types.d.ts +2 -0
- package/dist/components/core/carousel/grid/media/types.d.ts +10 -0
- package/dist/components/core/carousel/grid/media/types.js +1 -0
- package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +48 -0
- package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte.d.ts +4 -0
- package/dist/components/core/carousel/grid/profile/types.d.ts +10 -0
- package/dist/components/core/carousel/grid/profile/types.js +1 -0
- package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +51 -0
- package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte.d.ts +4 -0
- package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +38 -0
- package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte.d.ts +10 -0
- package/dist/components/core/carousel/hero/CarouselHero.svelte +21 -19
- package/dist/components/core/carousel/hero/CarouselHero.svelte.d.ts +1 -0
- package/dist/components/core/carousel/highlights/types.d.ts +4 -4
- package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +6 -22
- package/dist/components/core/carousel/promotion/types.d.ts +5 -5
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +6 -23
- package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +6 -1
- package/dist/components/core/carousel/types.d.ts +1 -0
- package/dist/components/core/panel/CarouselSlot.svelte +3 -14
- package/dist/components/core/panel/CarouselSlot.svelte.d.ts +2 -12
- package/dist/components/core/panel/type.d.ts +11 -0
- package/dist/components/core/panel/type.js +1 -0
- package/dist/globals.css +358 -83
- package/dist/index.d.ts +15 -5
- package/dist/index.js +15 -5
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -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">→</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">→</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,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,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
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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-
|
|
35
|
-
<div class="left-1 z-2 flex gap-1
|
|
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-
|
|
39
|
+
<Skeleton class="w-full h-full rounded-lg" />
|
|
38
40
|
{:else if logo}
|
|
39
|
-
<img
|
|
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="
|
|
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
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
let isShowButtonProfileAndDetails = $derived(
|
|
42
|
+
onButtonProfile != null && onButtonDetails != null,
|
|
43
|
+
);
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
<article
|
|
47
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
75
|
-
|
|
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
|
-
|
|
88
|
+
<div class="h-15 my-2">
|
|
89
|
+
<CardDescription {content} {isLoading} />
|
|
90
|
+
</div>
|
|
79
91
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
<CardTags
|
|
93
|
+
className="my-6"
|
|
94
|
+
tags={tags ?? []}
|
|
95
|
+
{isTagBorderBottom}
|
|
96
|
+
{isLoading}
|
|
97
|
+
/>
|
|
86
98
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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>
|