negodesign 0.0.59 → 0.0.60
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/components/core/banner/AdCardBanner.svelte +74 -74
- package/dist/components/core/banner/CtaCardBanner.svelte +118 -118
- package/dist/components/core/breadcrumb/breadcrumb-list.svelte +31 -31
- package/dist/components/core/button/ButtonBack.svelte +18 -18
- package/dist/components/core/button/ButtonLogin.svelte +15 -15
- package/dist/components/core/button/ButtonLoginWith.svelte +57 -57
- package/dist/components/core/button/ButtonSend.svelte +15 -15
- package/dist/components/core/card/highlight/01/CardHighlight01.svelte +103 -103
- package/dist/components/core/card/highlight/02/CardHighlight02.svelte +99 -99
- package/dist/components/core/card/highlight/CardHighlight.svelte +22 -22
- package/dist/components/core/card/media/01/CardMedia01.svelte +133 -133
- package/dist/components/core/card/media/02/CardMedia02.svelte +127 -127
- package/dist/components/core/card/media/CardMedia.svelte +18 -18
- package/dist/components/core/card/product/01/CardProduct01.svelte +136 -136
- package/dist/components/core/card/product/02/CardProduct02.svelte +124 -124
- package/dist/components/core/card/product/CardProduct.svelte +22 -22
- package/dist/components/core/card/profile/01/CardProfile01.svelte +134 -134
- package/dist/components/core/card/profile/02/CardProfile02.svelte +132 -132
- package/dist/components/core/card/profile/CardProfile.svelte +18 -18
- package/dist/components/core/card/promotion/CardPromotion.svelte +139 -139
- package/dist/components/core/card/promotion/CardPromotionPrice.svelte +32 -32
- package/dist/components/core/card/shared/CardButton.svelte +42 -42
- package/dist/components/core/card/shared/CardCart.svelte +36 -36
- package/dist/components/core/card/shared/CardDescription.svelte +41 -41
- package/dist/components/core/card/shared/CardFavorite.svelte +33 -33
- package/dist/components/core/card/shared/CardLogo.svelte +19 -19
- package/dist/components/core/card/shared/CardPhoneOrWhatsapp.svelte +45 -45
- package/dist/components/core/card/shared/CardStarRating.svelte +24 -24
- package/dist/components/core/card/shared/CardTags.svelte +95 -95
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte +232 -232
- package/dist/components/core/card/shared/CardTitlePrice.svelte +24 -24
- package/dist/components/core/card/shared/TruncatableText.svelte +49 -49
- package/dist/components/core/carousel/badge/ui/CarouselBadge.svelte +109 -109
- package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +38 -38
- package/dist/components/core/carousel/hero/ui/CarouselHero.svelte +163 -163
- package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +60 -60
- package/dist/components/core/datatable/ui/DataTableActions.svelte +28 -28
- package/dist/components/core/datatable/ui/DataTableCheckbox.svelte +22 -22
- package/dist/components/core/datatable/ui/DataTableContent.svelte +59 -59
- package/dist/components/core/datatable/ui/DataTableCore.svelte +151 -151
- package/dist/components/core/datatable/ui/DataTableDragHandle.svelte +8 -8
- package/dist/components/core/datatable/ui/DataTableListFilter.svelte +59 -59
- package/dist/components/core/datatable/ui/DataTableListPagination.svelte +35 -35
- package/dist/components/core/footer/ui/Footer.svelte +18 -18
- package/dist/components/core/form/ui/input-base.svelte +81 -81
- package/dist/components/core/form/ui/input-email-or-phone.svelte +23 -23
- package/dist/components/core/form/ui/input-email.svelte +23 -23
- package/dist/components/core/form/ui/input-password-confirm.svelte +23 -23
- package/dist/components/core/form/ui/input-password.svelte +23 -23
- package/dist/components/core/form/ui/input-phone.svelte +33 -33
- package/dist/components/core/form/ui/input-username.svelte +22 -22
- package/dist/components/core/grid/ui/01/Grid01.svelte +28 -28
- package/dist/components/core/grid/ui/02/Grid02.svelte +28 -28
- package/dist/components/core/grid/ui/PanelGrid.svelte +27 -27
- package/dist/components/core/grid/ui/SimpleGrid.svelte +35 -35
- package/dist/components/core/grid/ui/shared/DescriptionGrid.svelte +23 -23
- package/dist/components/core/grid/ui/shared/IconRenderGrid.svelte +21 -21
- package/dist/components/core/grid/ui/shared/TitleGrid.svelte +19 -19
- package/dist/components/core/hero/SimpleHero.svelte +65 -65
- package/dist/components/core/label/LabelOr.svelte +25 -25
- package/dist/components/core/link/link-forget-password.svelte +12 -12
- package/dist/components/core/link/link-privacy-polity.svelte +12 -12
- package/dist/components/core/link/link-terms-of-service.svelte +12 -12
- package/dist/components/core/nav/ui/ComplexMenu.svelte +36 -36
- package/dist/components/core/nav/ui/Menu.svelte +70 -70
- package/dist/components/core/nav/ui/SimpleMenu.svelte +14 -14
- package/dist/components/core/nav/ui/mobile/MenuMobile.svelte +54 -54
- package/dist/components/core/nav/ui/shared/MenuButton.svelte +51 -51
- package/dist/components/core/nav/ui/shared/MenuLinks.svelte +40 -40
- package/dist/components/core/nav/ui/shared/MenuListItem.svelte +48 -48
- package/dist/components/core/nav/ui/shared/MenuLogo.svelte +13 -13
- package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItem.svelte +15 -15
- package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItemCard.svelte +62 -62
- package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItemGrid.svelte +32 -32
- package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItemList.svelte +24 -24
- package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItems.svelte +21 -21
- package/dist/components/core/panel/CarouselSlot.svelte +57 -57
- package/dist/components/core/panel/LeftHero.svelte +117 -117
- package/dist/components/core/search/SearchInput.svelte +32 -32
- package/dist/components/core/search/shared/SearchInputCore.svelte +66 -66
- package/dist/components/core/sidebar/MenuBarSidebar.svelte +70 -70
- package/dist/components/core/sidebar/ui/navbar/NavMenuBarSidebar.svelte +97 -97
- package/dist/components/core/sidebar/ui/navbar/NavMenuBottomSidebar.svelte +33 -33
- package/dist/components/core/sidebar/ui/navbar/NavMenuTopBarSidebar.svelte +103 -103
- package/dist/components/core/tabs/ui/tab-underline.svelte +43 -43
- package/dist/components/pages/admin/01/ui/AdminContent.svelte +14 -14
- package/dist/components/pages/admin/01/ui/AdminPanel.svelte +46 -46
- package/dist/components/pages/security/login/01/ui/FormRegister.svelte +28 -28
- package/dist/components/pages/security/login/01/ui/LoginCard.svelte +107 -107
- package/dist/components/pages/security/login/PageLogin.svelte +22 -22
- package/dist/components/ui/badge/badge.svelte +49 -49
- package/dist/components/ui/button/button.svelte +82 -82
- package/dist/components/ui/chart/chart-container.svelte +80 -80
- package/dist/components/ui/chart/chart-style.svelte +37 -37
- package/dist/components/ui/chart/chart-tooltip.svelte +184 -184
- package/dist/components/ui/checkbox/checkbox.svelte +40 -40
- package/dist/components/ui/data-table/flex-render.svelte +40 -40
- package/dist/components/ui/drawer/drawer-close.svelte +7 -7
- package/dist/components/ui/drawer/drawer-content.svelte +33 -33
- package/dist/components/ui/drawer/drawer-description.svelte +17 -17
- package/dist/components/ui/drawer/drawer-footer.svelte +20 -20
- package/dist/components/ui/drawer/drawer-header.svelte +20 -20
- package/dist/components/ui/drawer/drawer-nested.svelte +12 -12
- package/dist/components/ui/drawer/drawer-overlay.svelte +17 -17
- package/dist/components/ui/drawer/drawer-portal.svelte +7 -7
- package/dist/components/ui/drawer/drawer-title.svelte +17 -17
- package/dist/components/ui/drawer/drawer-trigger.svelte +7 -7
- package/dist/components/ui/drawer/drawer.svelte +12 -12
- package/dist/components/ui/select/select-content.svelte +45 -45
- package/dist/components/ui/select/select-group-heading.svelte +21 -21
- package/dist/components/ui/select/select-group.svelte +17 -17
- package/dist/components/ui/select/select-item.svelte +41 -41
- package/dist/components/ui/select/select-label.svelte +20 -20
- package/dist/components/ui/select/select-portal.svelte +7 -7
- package/dist/components/ui/select/select-scroll-down-button.svelte +21 -21
- package/dist/components/ui/select/select-scroll-up-button.svelte +21 -21
- package/dist/components/ui/select/select-separator.svelte +18 -18
- package/dist/components/ui/select/select-trigger.svelte +30 -30
- package/dist/components/ui/select/select.svelte +11 -11
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
- package/dist/components/ui/star-rating/star-rating-star.svelte +41 -41
- package/dist/components/ui/star-rating/star-rating.svelte +20 -20
- package/dist/components/ui/table/table-body.svelte +15 -15
- package/dist/components/ui/table/table-caption.svelte +20 -20
- package/dist/components/ui/table/table-cell.svelte +15 -15
- package/dist/components/ui/table/table-footer.svelte +20 -20
- package/dist/components/ui/table/table-head.svelte +15 -15
- package/dist/components/ui/table/table-header.svelte +20 -20
- package/dist/components/ui/table/table-row.svelte +15 -15
- package/dist/components/ui/table/table.svelte +17 -17
- package/dist/components/ui/tabs/tabs-content.svelte +17 -17
- package/dist/components/ui/tabs/tabs-list.svelte +40 -40
- package/dist/components/ui/tabs/tabs-trigger.svelte +23 -23
- package/dist/components/ui/tabs/tabs.svelte +19 -19
- package/dist/styles/globals.css +149 -149
- package/package.json +113 -113
|
@@ -1,136 +1,136 @@
|
|
|
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 ImgPlaceHolderGallery from "../../../../../assets/placeholder-image.png";
|
|
6
|
-
import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
|
|
7
|
-
import type { CardProductProps } from "../../types";
|
|
8
|
-
import CardFavorite from "../../shared/CardFavorite.svelte";
|
|
9
|
-
import CardCart from "../../shared/CardCart.svelte";
|
|
10
|
-
import CardDescription from "../../shared/CardDescription.svelte";
|
|
11
|
-
import CardTags from "../../shared/CardTags.svelte";
|
|
12
|
-
import CardTitlePrice from "../../shared/CardTitlePrice.svelte";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Card component with a title and content.
|
|
16
|
-
* @component
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
let {
|
|
20
|
-
id,
|
|
21
|
-
tags,
|
|
22
|
-
logo,
|
|
23
|
-
title,
|
|
24
|
-
imageUrl,
|
|
25
|
-
rating = 0,
|
|
26
|
-
isFavorite = false,
|
|
27
|
-
isCart = false,
|
|
28
|
-
isLoading = false,
|
|
29
|
-
content,
|
|
30
|
-
price,
|
|
31
|
-
buttonBuyText,
|
|
32
|
-
buttonBuyClass,
|
|
33
|
-
isDescriptionIcon,
|
|
34
|
-
isDescriptionLabel,
|
|
35
|
-
onClickBuy,
|
|
36
|
-
onClickShop,
|
|
37
|
-
onClickFavorite,
|
|
38
|
-
}: CardProductProps = $props();
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<article class="relative rounded-lg border">
|
|
42
|
-
<aside class="relative w-full p-2">
|
|
43
|
-
<div class="absolute top-2 left-2 z-2 gap-1 p-2">
|
|
44
|
-
{#if isLoading}
|
|
45
|
-
<Skeleton class="h-5 w-20 rounded-full bg-black/20" />
|
|
46
|
-
{:else if logo}
|
|
47
|
-
<img
|
|
48
|
-
src={logo}
|
|
49
|
-
width={30}
|
|
50
|
-
height={30}
|
|
51
|
-
alt={title}
|
|
52
|
-
onerror={(e) =>
|
|
53
|
-
((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
|
|
54
|
-
class="rounded-lg"
|
|
55
|
-
/>
|
|
56
|
-
{:else}
|
|
57
|
-
<img
|
|
58
|
-
src={ImgPlaceholderCompany}
|
|
59
|
-
width={30}
|
|
60
|
-
height={30}
|
|
61
|
-
alt={title}
|
|
62
|
-
class="rounded-lg"
|
|
63
|
-
/>
|
|
64
|
-
{/if}
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div class="absolute top-2 right-2 z-2 flex items-center gap-1 p-2">
|
|
68
|
-
<CardFavorite
|
|
69
|
-
{id}
|
|
70
|
-
{isFavorite}
|
|
71
|
-
{isLoading}
|
|
72
|
-
onFavoriteClick={onClickFavorite}
|
|
73
|
-
/>
|
|
74
|
-
<CardCart {id} {isCart} {isLoading} onCartClick={onClickShop} />
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
{#if isLoading}
|
|
78
|
-
<Skeleton
|
|
79
|
-
class="rounded-lg h-30 w-full object-cover object-center bg-black/15"
|
|
80
|
-
/>
|
|
81
|
-
{:else if imageUrl}
|
|
82
|
-
<img
|
|
83
|
-
src={imageUrl}
|
|
84
|
-
alt={imageUrl}
|
|
85
|
-
class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
|
|
86
|
-
onerror={(e) =>
|
|
87
|
-
((e.target as HTMLImageElement).src = ImgPlaceHolderGallery)}
|
|
88
|
-
/>
|
|
89
|
-
{:else}
|
|
90
|
-
<img
|
|
91
|
-
src={ImgPlaceHolderGallery}
|
|
92
|
-
alt="Not Found"
|
|
93
|
-
class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
|
|
94
|
-
/>
|
|
95
|
-
{/if}
|
|
96
|
-
<div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
|
|
97
|
-
</aside>
|
|
98
|
-
|
|
99
|
-
<aside
|
|
100
|
-
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"
|
|
101
|
-
>
|
|
102
|
-
<div class="flex justify-between w-full items-center mb-1">
|
|
103
|
-
{#if title}
|
|
104
|
-
{#if isLoading}
|
|
105
|
-
<Skeleton class="h-4 w-30 rounded-lg" />
|
|
106
|
-
{:else}
|
|
107
|
-
<div class="font-semibold line-clamp-1 flex-nowrap">
|
|
108
|
-
{title}
|
|
109
|
-
</div>
|
|
110
|
-
{/if}
|
|
111
|
-
{/if}
|
|
112
|
-
<CardTitlePrice {title} {isLoading} {price} />
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
{#if tags && tags.length > 0}
|
|
116
|
-
<div class="w-full my-1">
|
|
117
|
-
<CardTags {tags} />
|
|
118
|
-
</div>
|
|
119
|
-
{/if}
|
|
120
|
-
|
|
121
|
-
<div>
|
|
122
|
-
<CardDescription {content} {isDescriptionIcon} {isDescriptionLabel} />
|
|
123
|
-
</div>
|
|
124
|
-
|
|
125
|
-
{#if isLoading}
|
|
126
|
-
<Skeleton class="h-9 w-full rounded-md" />
|
|
127
|
-
{:else}
|
|
128
|
-
<Button
|
|
129
|
-
onclick={() => onClickBuy!(id)}
|
|
130
|
-
class="w-full mb-2 bg-gradient text-white rounded-full {buttonBuyClass}"
|
|
131
|
-
>
|
|
132
|
-
{buttonBuyText || $t("label.buy")}
|
|
133
|
-
</Button>
|
|
134
|
-
{/if}
|
|
135
|
-
</aside>
|
|
136
|
-
</article>
|
|
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 ImgPlaceHolderGallery from "../../../../../assets/placeholder-image.png";
|
|
6
|
+
import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
|
|
7
|
+
import type { CardProductProps } from "../../types";
|
|
8
|
+
import CardFavorite from "../../shared/CardFavorite.svelte";
|
|
9
|
+
import CardCart from "../../shared/CardCart.svelte";
|
|
10
|
+
import CardDescription from "../../shared/CardDescription.svelte";
|
|
11
|
+
import CardTags from "../../shared/CardTags.svelte";
|
|
12
|
+
import CardTitlePrice from "../../shared/CardTitlePrice.svelte";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Card component with a title and content.
|
|
16
|
+
* @component
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
id,
|
|
21
|
+
tags,
|
|
22
|
+
logo,
|
|
23
|
+
title,
|
|
24
|
+
imageUrl,
|
|
25
|
+
rating = 0,
|
|
26
|
+
isFavorite = false,
|
|
27
|
+
isCart = false,
|
|
28
|
+
isLoading = false,
|
|
29
|
+
content,
|
|
30
|
+
price,
|
|
31
|
+
buttonBuyText,
|
|
32
|
+
buttonBuyClass,
|
|
33
|
+
isDescriptionIcon,
|
|
34
|
+
isDescriptionLabel,
|
|
35
|
+
onClickBuy,
|
|
36
|
+
onClickShop,
|
|
37
|
+
onClickFavorite,
|
|
38
|
+
}: CardProductProps = $props();
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<article class="relative rounded-lg border">
|
|
42
|
+
<aside class="relative w-full p-2">
|
|
43
|
+
<div class="absolute top-2 left-2 z-2 gap-1 p-2">
|
|
44
|
+
{#if isLoading}
|
|
45
|
+
<Skeleton class="h-5 w-20 rounded-full bg-black/20" />
|
|
46
|
+
{:else if logo}
|
|
47
|
+
<img
|
|
48
|
+
src={logo}
|
|
49
|
+
width={30}
|
|
50
|
+
height={30}
|
|
51
|
+
alt={title}
|
|
52
|
+
onerror={(e) =>
|
|
53
|
+
((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
|
|
54
|
+
class="rounded-lg"
|
|
55
|
+
/>
|
|
56
|
+
{:else}
|
|
57
|
+
<img
|
|
58
|
+
src={ImgPlaceholderCompany}
|
|
59
|
+
width={30}
|
|
60
|
+
height={30}
|
|
61
|
+
alt={title}
|
|
62
|
+
class="rounded-lg"
|
|
63
|
+
/>
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="absolute top-2 right-2 z-2 flex items-center gap-1 p-2">
|
|
68
|
+
<CardFavorite
|
|
69
|
+
{id}
|
|
70
|
+
{isFavorite}
|
|
71
|
+
{isLoading}
|
|
72
|
+
onFavoriteClick={onClickFavorite}
|
|
73
|
+
/>
|
|
74
|
+
<CardCart {id} {isCart} {isLoading} onCartClick={onClickShop} />
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
{#if isLoading}
|
|
78
|
+
<Skeleton
|
|
79
|
+
class="rounded-lg h-30 w-full object-cover object-center bg-black/15"
|
|
80
|
+
/>
|
|
81
|
+
{:else if imageUrl}
|
|
82
|
+
<img
|
|
83
|
+
src={imageUrl}
|
|
84
|
+
alt={imageUrl}
|
|
85
|
+
class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
|
|
86
|
+
onerror={(e) =>
|
|
87
|
+
((e.target as HTMLImageElement).src = ImgPlaceHolderGallery)}
|
|
88
|
+
/>
|
|
89
|
+
{:else}
|
|
90
|
+
<img
|
|
91
|
+
src={ImgPlaceHolderGallery}
|
|
92
|
+
alt="Not Found"
|
|
93
|
+
class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
|
|
94
|
+
/>
|
|
95
|
+
{/if}
|
|
96
|
+
<div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
|
|
97
|
+
</aside>
|
|
98
|
+
|
|
99
|
+
<aside
|
|
100
|
+
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"
|
|
101
|
+
>
|
|
102
|
+
<div class="flex justify-between w-full items-center mb-1">
|
|
103
|
+
{#if title}
|
|
104
|
+
{#if isLoading}
|
|
105
|
+
<Skeleton class="h-4 w-30 rounded-lg" />
|
|
106
|
+
{:else}
|
|
107
|
+
<div class="font-semibold line-clamp-1 flex-nowrap">
|
|
108
|
+
{title}
|
|
109
|
+
</div>
|
|
110
|
+
{/if}
|
|
111
|
+
{/if}
|
|
112
|
+
<CardTitlePrice {title} {isLoading} {price} />
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
{#if tags && tags.length > 0}
|
|
116
|
+
<div class="w-full my-1">
|
|
117
|
+
<CardTags {tags} />
|
|
118
|
+
</div>
|
|
119
|
+
{/if}
|
|
120
|
+
|
|
121
|
+
<div>
|
|
122
|
+
<CardDescription {content} {isDescriptionIcon} {isDescriptionLabel} />
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{#if isLoading}
|
|
126
|
+
<Skeleton class="h-9 w-full rounded-md" />
|
|
127
|
+
{:else}
|
|
128
|
+
<Button
|
|
129
|
+
onclick={() => onClickBuy!(id)}
|
|
130
|
+
class="w-full mb-2 bg-gradient text-white rounded-full {buttonBuyClass}"
|
|
131
|
+
>
|
|
132
|
+
{buttonBuyText || $t("label.buy")}
|
|
133
|
+
</Button>
|
|
134
|
+
{/if}
|
|
135
|
+
</aside>
|
|
136
|
+
</article>
|
|
@@ -1,124 +1,124 @@
|
|
|
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 ImgPlaceHolderGallery from "../../../../../assets/placeholder-image.png";
|
|
6
|
-
import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
|
|
7
|
-
import type { CardProductProps } from "../../types";
|
|
8
|
-
import CardFavorite from "../../shared/CardFavorite.svelte";
|
|
9
|
-
import CardCart from "../../shared/CardCart.svelte";
|
|
10
|
-
import CardDescription from "../../shared/CardDescription.svelte";
|
|
11
|
-
import CardTags from "../../shared/CardTags.svelte";
|
|
12
|
-
import CardTitlePrice from "../../shared/CardTitlePrice.svelte";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Card component with a title and content.
|
|
16
|
-
* @component
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
let {
|
|
20
|
-
id,
|
|
21
|
-
tags,
|
|
22
|
-
logo,
|
|
23
|
-
title,
|
|
24
|
-
imageUrl,
|
|
25
|
-
isFavorite = false,
|
|
26
|
-
isCart = false,
|
|
27
|
-
isLoading = false,
|
|
28
|
-
content,
|
|
29
|
-
price,
|
|
30
|
-
buttonBuyText,
|
|
31
|
-
buttonBuyClass,
|
|
32
|
-
isDescriptionIcon,
|
|
33
|
-
isDescriptionLabel,
|
|
34
|
-
onClickBuy,
|
|
35
|
-
onClickShop,
|
|
36
|
-
onClickFavorite,
|
|
37
|
-
}: CardProductProps = $props();
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<article class="relative rounded-lg border">
|
|
41
|
-
<aside class="relative w-full">
|
|
42
|
-
<div class="absolute top-1 left-1 z-2 gap-1 p-2">
|
|
43
|
-
{#if isLoading}
|
|
44
|
-
<Skeleton class="h-5 w-20 rounded-full bg-black/20" />
|
|
45
|
-
{:else if logo}
|
|
46
|
-
<img
|
|
47
|
-
src={logo}
|
|
48
|
-
width={30}
|
|
49
|
-
height={30}
|
|
50
|
-
alt={title}
|
|
51
|
-
onerror={(e) =>
|
|
52
|
-
((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
|
|
53
|
-
class="rounded-lg"
|
|
54
|
-
/>
|
|
55
|
-
{:else}
|
|
56
|
-
<img
|
|
57
|
-
src={ImgPlaceholderCompany}
|
|
58
|
-
width={30}
|
|
59
|
-
height={30}
|
|
60
|
-
alt={title}
|
|
61
|
-
class="rounded-lg"
|
|
62
|
-
/>
|
|
63
|
-
{/if}
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div class="absolute top-1 right-1 z-2 flex items-center gap-1 p-2">
|
|
67
|
-
<CardFavorite
|
|
68
|
-
{id}
|
|
69
|
-
{isFavorite}
|
|
70
|
-
{isLoading}
|
|
71
|
-
onFavoriteClick={onClickFavorite}
|
|
72
|
-
/>
|
|
73
|
-
<CardCart {id} {isCart} {isLoading} onCartClick={onClickShop} />
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
{#if isLoading}
|
|
77
|
-
<Skeleton
|
|
78
|
-
class="rounded-lg h-30 w-full object-cover object-center bg-black/15"
|
|
79
|
-
/>
|
|
80
|
-
{:else if imageUrl}
|
|
81
|
-
<img
|
|
82
|
-
src={imageUrl}
|
|
83
|
-
alt={imageUrl}
|
|
84
|
-
class="rounded-tr-lg rounded-tl-lg h-36 md:h-44 w-full object-cover object-center"
|
|
85
|
-
onerror={(e) =>
|
|
86
|
-
((e.target as HTMLImageElement).src = ImgPlaceHolderGallery)}
|
|
87
|
-
/>
|
|
88
|
-
{:else}
|
|
89
|
-
<img
|
|
90
|
-
src={ImgPlaceHolderGallery}
|
|
91
|
-
alt="Not Found"
|
|
92
|
-
class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
|
|
93
|
-
/>
|
|
94
|
-
{/if}
|
|
95
|
-
<div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
|
|
96
|
-
</aside>
|
|
97
|
-
|
|
98
|
-
<aside
|
|
99
|
-
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"
|
|
100
|
-
>
|
|
101
|
-
<CardTitlePrice {title} {isLoading} {price} />
|
|
102
|
-
|
|
103
|
-
<div>
|
|
104
|
-
<CardDescription {content} {isDescriptionIcon} {isDescriptionLabel} />
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
{#if tags && tags.length > 0}
|
|
108
|
-
<div class="w-full mb-2">
|
|
109
|
-
<CardTags {tags} />
|
|
110
|
-
</div>
|
|
111
|
-
{/if}
|
|
112
|
-
|
|
113
|
-
{#if isLoading}
|
|
114
|
-
<Skeleton class="h-9 w-full rounded-md" />
|
|
115
|
-
{:else}
|
|
116
|
-
<Button
|
|
117
|
-
onclick={() => onClickBuy!(id)}
|
|
118
|
-
class="w-full bottom-0 bg-gradient {buttonBuyClass}"
|
|
119
|
-
>
|
|
120
|
-
{buttonBuyText || $t("label.buy")}
|
|
121
|
-
</Button>
|
|
122
|
-
{/if}
|
|
123
|
-
</aside>
|
|
124
|
-
</article>
|
|
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 ImgPlaceHolderGallery from "../../../../../assets/placeholder-image.png";
|
|
6
|
+
import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
|
|
7
|
+
import type { CardProductProps } from "../../types";
|
|
8
|
+
import CardFavorite from "../../shared/CardFavorite.svelte";
|
|
9
|
+
import CardCart from "../../shared/CardCart.svelte";
|
|
10
|
+
import CardDescription from "../../shared/CardDescription.svelte";
|
|
11
|
+
import CardTags from "../../shared/CardTags.svelte";
|
|
12
|
+
import CardTitlePrice from "../../shared/CardTitlePrice.svelte";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Card component with a title and content.
|
|
16
|
+
* @component
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
id,
|
|
21
|
+
tags,
|
|
22
|
+
logo,
|
|
23
|
+
title,
|
|
24
|
+
imageUrl,
|
|
25
|
+
isFavorite = false,
|
|
26
|
+
isCart = false,
|
|
27
|
+
isLoading = false,
|
|
28
|
+
content,
|
|
29
|
+
price,
|
|
30
|
+
buttonBuyText,
|
|
31
|
+
buttonBuyClass,
|
|
32
|
+
isDescriptionIcon,
|
|
33
|
+
isDescriptionLabel,
|
|
34
|
+
onClickBuy,
|
|
35
|
+
onClickShop,
|
|
36
|
+
onClickFavorite,
|
|
37
|
+
}: CardProductProps = $props();
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<article class="relative rounded-lg border">
|
|
41
|
+
<aside class="relative w-full">
|
|
42
|
+
<div class="absolute top-1 left-1 z-2 gap-1 p-2">
|
|
43
|
+
{#if isLoading}
|
|
44
|
+
<Skeleton class="h-5 w-20 rounded-full bg-black/20" />
|
|
45
|
+
{:else if logo}
|
|
46
|
+
<img
|
|
47
|
+
src={logo}
|
|
48
|
+
width={30}
|
|
49
|
+
height={30}
|
|
50
|
+
alt={title}
|
|
51
|
+
onerror={(e) =>
|
|
52
|
+
((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
|
|
53
|
+
class="rounded-lg"
|
|
54
|
+
/>
|
|
55
|
+
{:else}
|
|
56
|
+
<img
|
|
57
|
+
src={ImgPlaceholderCompany}
|
|
58
|
+
width={30}
|
|
59
|
+
height={30}
|
|
60
|
+
alt={title}
|
|
61
|
+
class="rounded-lg"
|
|
62
|
+
/>
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="absolute top-1 right-1 z-2 flex items-center gap-1 p-2">
|
|
67
|
+
<CardFavorite
|
|
68
|
+
{id}
|
|
69
|
+
{isFavorite}
|
|
70
|
+
{isLoading}
|
|
71
|
+
onFavoriteClick={onClickFavorite}
|
|
72
|
+
/>
|
|
73
|
+
<CardCart {id} {isCart} {isLoading} onCartClick={onClickShop} />
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
{#if isLoading}
|
|
77
|
+
<Skeleton
|
|
78
|
+
class="rounded-lg h-30 w-full object-cover object-center bg-black/15"
|
|
79
|
+
/>
|
|
80
|
+
{:else if imageUrl}
|
|
81
|
+
<img
|
|
82
|
+
src={imageUrl}
|
|
83
|
+
alt={imageUrl}
|
|
84
|
+
class="rounded-tr-lg rounded-tl-lg h-36 md:h-44 w-full object-cover object-center"
|
|
85
|
+
onerror={(e) =>
|
|
86
|
+
((e.target as HTMLImageElement).src = ImgPlaceHolderGallery)}
|
|
87
|
+
/>
|
|
88
|
+
{:else}
|
|
89
|
+
<img
|
|
90
|
+
src={ImgPlaceHolderGallery}
|
|
91
|
+
alt="Not Found"
|
|
92
|
+
class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
|
|
93
|
+
/>
|
|
94
|
+
{/if}
|
|
95
|
+
<div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
|
|
96
|
+
</aside>
|
|
97
|
+
|
|
98
|
+
<aside
|
|
99
|
+
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"
|
|
100
|
+
>
|
|
101
|
+
<CardTitlePrice {title} {isLoading} {price} />
|
|
102
|
+
|
|
103
|
+
<div>
|
|
104
|
+
<CardDescription {content} {isDescriptionIcon} {isDescriptionLabel} />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
{#if tags && tags.length > 0}
|
|
108
|
+
<div class="w-full mb-2">
|
|
109
|
+
<CardTags {tags} />
|
|
110
|
+
</div>
|
|
111
|
+
{/if}
|
|
112
|
+
|
|
113
|
+
{#if isLoading}
|
|
114
|
+
<Skeleton class="h-9 w-full rounded-md" />
|
|
115
|
+
{:else}
|
|
116
|
+
<Button
|
|
117
|
+
onclick={() => onClickBuy!(id)}
|
|
118
|
+
class="w-full bottom-0 bg-gradient {buttonBuyClass}"
|
|
119
|
+
>
|
|
120
|
+
{buttonBuyText || $t("label.buy")}
|
|
121
|
+
</Button>
|
|
122
|
+
{/if}
|
|
123
|
+
</aside>
|
|
124
|
+
</article>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Card component with a title and content.
|
|
4
|
-
* @component
|
|
5
|
-
*/
|
|
6
|
-
import type { CardProductProps } from "../types";
|
|
7
|
-
import CardProduct01 from "./01/CardProduct01.svelte";
|
|
8
|
-
import CardProduct02 from "./02/CardProduct02.svelte";
|
|
9
|
-
|
|
10
|
-
let {
|
|
11
|
-
variant,
|
|
12
|
-
...restProps
|
|
13
|
-
}: CardProductProps & {
|
|
14
|
-
variant?: 1 | 2;
|
|
15
|
-
} = $props();
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
{#if variant === 2}
|
|
19
|
-
<CardProduct02 {...restProps} />
|
|
20
|
-
{:else}
|
|
21
|
-
<CardProduct01 {...restProps} />
|
|
22
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Card component with a title and content.
|
|
4
|
+
* @component
|
|
5
|
+
*/
|
|
6
|
+
import type { CardProductProps } from "../types";
|
|
7
|
+
import CardProduct01 from "./01/CardProduct01.svelte";
|
|
8
|
+
import CardProduct02 from "./02/CardProduct02.svelte";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
variant,
|
|
12
|
+
...restProps
|
|
13
|
+
}: CardProductProps & {
|
|
14
|
+
variant?: 1 | 2;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#if variant === 2}
|
|
19
|
+
<CardProduct02 {...restProps} />
|
|
20
|
+
{:else}
|
|
21
|
+
<CardProduct01 {...restProps} />
|
|
22
|
+
{/if}
|