negodesign 0.0.35 → 0.0.37
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/card/product/01/CardProduct01.svelte +130 -0
- package/dist/components/core/card/product/01/CardProduct01.svelte.d.ts +4 -0
- package/dist/components/core/card/product/02/CardProduct02.svelte +118 -0
- package/dist/components/core/card/product/02/CardProduct02.svelte.d.ts +4 -0
- package/dist/components/core/card/product/CardProduct.svelte +22 -0
- package/dist/components/core/card/product/CardProduct.svelte.d.ts +11 -0
- package/dist/components/core/card/product/data.d.ts +3 -0
- package/dist/components/core/card/product/data.js +89 -0
- package/dist/components/core/card/profile/01/CardProfile01.svelte +0 -1
- package/dist/components/core/card/promotion/CardPromotion.svelte +1 -1
- package/dist/components/core/card/promotion/CardPromotionPrice.svelte.d.ts +8 -0
- package/dist/components/core/card/shared/CardPhoneOrWhatsapp.svelte +12 -5
- package/dist/components/core/card/shared/CardTags.svelte +49 -24
- package/dist/components/core/card/shared/CardTitlePrice.svelte +24 -0
- package/dist/components/core/card/shared/CardTitlePrice.svelte.d.ts +15 -0
- package/dist/components/core/card/shared/TruncatableText.svelte +1 -1
- package/dist/components/core/card/types.d.ts +48 -0
- package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +38 -28
- package/dist/components/core/carousel/grid/product/types.d.ts +22 -0
- package/dist/components/core/carousel/grid/product/types.js +1 -0
- package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte +71 -0
- package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte.d.ts +4 -0
- package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +56 -46
- package/dist/components/core/carousel/grid/promotion/types.d.ts +23 -0
- package/dist/components/core/carousel/grid/promotion/types.js +1 -0
- package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte +68 -0
- package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte.d.ts +4 -0
- package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +57 -47
- package/dist/components/core/carousel/product/types.d.ts +21 -0
- package/dist/components/core/carousel/product/types.js +1 -0
- package/dist/components/core/carousel/product/ui/CarouselProduct.svelte +57 -0
- package/dist/components/core/carousel/product/ui/CarouselProduct.svelte.d.ts +4 -0
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +57 -47
- package/dist/components/core/panel/NotFoundEmpty.svelte +76 -0
- package/dist/components/core/panel/NotFoundEmpty.svelte.d.ts +16 -0
- package/dist/components/pages/company-profile/CompanyProfile.svelte +144 -0
- package/dist/components/pages/company-profile/CompanyProfile.svelte.d.ts +4 -0
- package/dist/components/pages/company-profile/data.d.ts +2 -0
- package/dist/components/pages/company-profile/data.js +115 -0
- package/dist/components/pages/company-profile/shared/ProfileAboutCompany.svelte +79 -0
- package/dist/components/pages/company-profile/shared/ProfileAboutCompany.svelte.d.ts +9 -0
- package/dist/components/pages/company-profile/shared/ProfileBanner.svelte +270 -0
- package/dist/components/pages/company-profile/shared/ProfileBanner.svelte.d.ts +14 -0
- package/dist/components/pages/company-profile/shared/ProfileGallery.svelte +198 -0
- package/dist/components/pages/company-profile/shared/ProfileGallery.svelte.d.ts +9 -0
- package/dist/components/pages/company-profile/shared/ProfileMenuBadge.svelte +56 -0
- package/dist/components/pages/company-profile/shared/ProfileMenuBadge.svelte.d.ts +11 -0
- package/dist/components/pages/company-profile/shared/ProfileProducts.svelte +62 -0
- package/dist/components/pages/company-profile/shared/ProfileProducts.svelte.d.ts +9 -0
- package/dist/components/pages/company-profile/shared/ProfileSidebar.svelte +57 -0
- package/dist/components/pages/company-profile/shared/ProfileSidebar.svelte.d.ts +11 -0
- package/dist/components/pages/company-profile/types.d.ts +137 -0
- package/dist/components/pages/company-profile/types.js +1 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/data.d.ts +3 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/data.js +179 -0
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte +2 -1
- package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte.d.ts +1 -0
- package/dist/components/pages/product-details/01/ProductDetails01.svelte +19 -7
- package/dist/components/pages/product-details/02/ProductDetails02.svelte +42 -37
- package/dist/components/pages/product-details/03/ProductDetails03.svelte +33 -29
- package/dist/components/pages/product-details/ProductDetails.svelte +11 -7
- package/dist/components/pages/product-details/shared/ProductDetailFeatures.svelte +11 -5
- package/dist/components/pages/product-details/shared/ProductDetailFeatures.svelte.d.ts +2 -1
- package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte +52 -20
- package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte.d.ts +1 -1
- package/dist/components/pages/product-details/shared/ProductDetailImage.svelte +51 -20
- package/dist/components/pages/product-details/shared/ProductDetailImage.svelte.d.ts +1 -1
- package/dist/components/pages/product-details/shared/ProductDetailPrice.svelte +1 -1
- package/dist/components/pages/product-details/types.d.ts +9 -2
- package/dist/components/pages/profile-user/types.d.ts +7 -0
- package/dist/components/ui/empty/empty-content.svelte +23 -0
- package/dist/components/ui/empty/empty-content.svelte.d.ts +5 -0
- package/dist/components/ui/empty/empty-description.svelte +23 -0
- package/dist/components/ui/empty/empty-description.svelte.d.ts +5 -0
- package/dist/components/ui/empty/empty-header.svelte +20 -0
- package/dist/components/ui/empty/empty-header.svelte.d.ts +5 -0
- package/dist/components/ui/empty/empty-media.svelte +41 -0
- package/dist/components/ui/empty/empty-media.svelte.d.ts +26 -0
- package/dist/components/ui/empty/empty-title.svelte +20 -0
- package/dist/components/ui/empty/empty-title.svelte.d.ts +5 -0
- package/dist/components/ui/empty/empty.svelte +23 -0
- package/dist/components/ui/empty/empty.svelte.d.ts +5 -0
- package/dist/components/ui/empty/index.d.ts +7 -0
- package/dist/components/ui/empty/index.js +9 -0
- package/dist/globals.css +301 -5
- package/dist/i18n/langs/en.d.ts +25 -0
- package/dist/i18n/langs/en.js +25 -0
- package/dist/i18n/langs/pt.d.ts +25 -0
- package/dist/i18n/langs/pt.js +25 -0
- package/dist/i18n/translations.d.ts +50 -0
- package/package.json +1 -1
- package/dist/components/core/card/shared/CardStartPrice.svelte.d.ts +0 -8
- package/dist/components/pages/product-details/04/ProductDetails04.svelte +0 -65
- package/dist/components/pages/product-details/04/ProductDetails04.svelte.d.ts +0 -11
- /package/dist/components/core/card/{shared/CardStartPrice.svelte → promotion/CardPromotionPrice.svelte} +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import CarouselGridSlot from "../../shared/ui/CarouselGridSlot.svelte";
|
|
3
|
-
import * as Carousel from "../../../../../ui/carousel/index.js";
|
|
4
3
|
import CarouselHeader from "../../../shared/ui/CarouselHeader.svelte";
|
|
4
|
+
import NotFoundEmpty from "../../../../panel/NotFoundEmpty.svelte";
|
|
5
|
+
import * as Carousel from "../../../../../ui/carousel/index.js";
|
|
5
6
|
import { useDevice } from "../../../../../../hooks/responsive.svelte";
|
|
7
|
+
import { t } from "../../../../../../i18n";
|
|
6
8
|
import CardMedia from "../../../../card/media/CardMedia.svelte";
|
|
7
9
|
import type { CarouselGridMediaProps } from "../../../../../../types";
|
|
8
10
|
|
|
@@ -16,34 +18,42 @@
|
|
|
16
18
|
}: CarouselGridMediaProps = $props();
|
|
17
19
|
|
|
18
20
|
const responsive = useDevice();
|
|
21
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
19
22
|
</script>
|
|
20
23
|
|
|
21
24
|
<CarouselHeader {...headerProps}>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
{#if isEmpty}
|
|
26
|
+
<NotFoundEmpty
|
|
27
|
+
title={$t("empty.media.title")}
|
|
28
|
+
description={$t("empty.media.description")}
|
|
29
|
+
/>
|
|
30
|
+
{:else}
|
|
31
|
+
<CarouselGridSlot {slotProps} {gridClass} totalItems={items?.length ?? 0}>
|
|
32
|
+
{#if isLoading}
|
|
33
|
+
{#each Array.from( { length: responsive.isMobile ? 3 : 6 }, ) as _, i (`loading-${i}`)}
|
|
34
|
+
{#if responsive.isMobile}
|
|
35
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
36
|
+
<CardMedia id={i} {variant} isLoading />
|
|
37
|
+
</Carousel.Item>
|
|
38
|
+
{:else}
|
|
39
|
+
<div>
|
|
40
|
+
<CardMedia id={i} {variant} isLoading />
|
|
41
|
+
</div>
|
|
42
|
+
{/if}
|
|
43
|
+
{/each}
|
|
44
|
+
{:else}
|
|
45
|
+
{#each items as item, i (`media-${item.id ?? i}`)}
|
|
46
|
+
{#if responsive.isMobile}
|
|
47
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
48
|
+
<CardMedia {...item} {variant} />
|
|
49
|
+
</Carousel.Item>
|
|
50
|
+
{:else}
|
|
51
|
+
<div>
|
|
52
|
+
<CardMedia {...item} {variant} />
|
|
53
|
+
</div>
|
|
54
|
+
{/if}
|
|
55
|
+
{/each}
|
|
56
|
+
{/if}
|
|
57
|
+
</CarouselGridSlot>
|
|
58
|
+
{/if}
|
|
49
59
|
</CarouselHeader>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CardProductProps } from "../../../card/types";
|
|
2
|
+
import type { CarouselSlotProps } from "../../../panel/type";
|
|
3
|
+
import type { CarouselHeaderProps } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* Props do CarouselGridProduct — layout em grid de cards de product
|
|
6
|
+
*/
|
|
7
|
+
export interface CarouselGridProductProps {
|
|
8
|
+
/** Props do cabeçalho do carousel (título, descrição, etc.) */
|
|
9
|
+
headerProps?: CarouselHeaderProps;
|
|
10
|
+
/** Props do slot/container do carousel (botões navegação, plugins) */
|
|
11
|
+
slotProps?: CarouselSlotProps;
|
|
12
|
+
/** Classe CSS adicional para o container do grid */
|
|
13
|
+
gridClass?: string;
|
|
14
|
+
/** Variante visual do card: 1 ou 2 */
|
|
15
|
+
variant?: 1 | 2;
|
|
16
|
+
/** Lista de perfis para exibir nos cards */
|
|
17
|
+
items: CardProductProps[];
|
|
18
|
+
/** Estado de carregamento (skeleton) */
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
isDescriptionIcon?: boolean;
|
|
21
|
+
isDescriptionLabel?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CarouselGridSlot from "../../shared/ui/CarouselGridSlot.svelte";
|
|
3
|
+
import CarouselHeader from "../../../shared/ui/CarouselHeader.svelte";
|
|
4
|
+
import NotFoundEmpty from "../../../../panel/NotFoundEmpty.svelte";
|
|
5
|
+
import * as Carousel from "../../../../../ui/carousel/index.js";
|
|
6
|
+
import { useDevice } from "../../../../../../hooks/responsive.svelte";
|
|
7
|
+
import { t } from "../../../../../../i18n";
|
|
8
|
+
import CardProduct from "../../../../card/product/CardProduct.svelte";
|
|
9
|
+
import type { CarouselGridProductProps } from "../types";
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
headerProps,
|
|
13
|
+
slotProps,
|
|
14
|
+
gridClass = "lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6",
|
|
15
|
+
items,
|
|
16
|
+
variant,
|
|
17
|
+
isLoading = false,
|
|
18
|
+
isDescriptionIcon = false,
|
|
19
|
+
isDescriptionLabel = false,
|
|
20
|
+
}: CarouselGridProductProps = $props();
|
|
21
|
+
|
|
22
|
+
const responsive = useDevice();
|
|
23
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<CarouselHeader {...headerProps}>
|
|
27
|
+
{#if isEmpty}
|
|
28
|
+
<NotFoundEmpty
|
|
29
|
+
title={$t("empty.products.title")}
|
|
30
|
+
description={$t("empty.products.description")}
|
|
31
|
+
/>
|
|
32
|
+
{:else}
|
|
33
|
+
<CarouselGridSlot {slotProps} {gridClass} totalItems={items?.length ?? 0}>
|
|
34
|
+
{#if isLoading}
|
|
35
|
+
{#each Array.from( { length: responsive.isMobile ? 3 : 6 }, ) as _, i (`loading-${i}`)}
|
|
36
|
+
{#if responsive.isMobile}
|
|
37
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
38
|
+
<CardProduct id={i} {variant} isLoading />
|
|
39
|
+
</Carousel.Item>
|
|
40
|
+
{:else}
|
|
41
|
+
<div>
|
|
42
|
+
<CardProduct id={i} {variant} isLoading />
|
|
43
|
+
</div>
|
|
44
|
+
{/if}
|
|
45
|
+
{/each}
|
|
46
|
+
{:else}
|
|
47
|
+
{#each items as item, i (`product-${item.id ?? i}`)}
|
|
48
|
+
{#if responsive.isMobile}
|
|
49
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
50
|
+
<CardProduct
|
|
51
|
+
{...item}
|
|
52
|
+
{variant}
|
|
53
|
+
{isDescriptionIcon}
|
|
54
|
+
{isDescriptionLabel}
|
|
55
|
+
/>
|
|
56
|
+
</Carousel.Item>
|
|
57
|
+
{:else}
|
|
58
|
+
<div>
|
|
59
|
+
<CardProduct
|
|
60
|
+
{...item}
|
|
61
|
+
{variant}
|
|
62
|
+
{isDescriptionIcon}
|
|
63
|
+
{isDescriptionLabel}
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
{/if}
|
|
67
|
+
{/each}
|
|
68
|
+
{/if}
|
|
69
|
+
</CarouselGridSlot>
|
|
70
|
+
{/if}
|
|
71
|
+
</CarouselHeader>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import CarouselGridSlot from "../../shared/ui/CarouselGridSlot.svelte";
|
|
3
|
-
import * as Carousel from "../../../../../ui/carousel/index.js";
|
|
4
3
|
import CarouselHeader from "../../../shared/ui/CarouselHeader.svelte";
|
|
4
|
+
import NotFoundEmpty from "../../../../panel/NotFoundEmpty.svelte";
|
|
5
|
+
import * as Carousel from "../../../../../ui/carousel/index.js";
|
|
5
6
|
import { useDevice } from "../../../../../../hooks/responsive.svelte";
|
|
7
|
+
import { t } from "../../../../../../i18n";
|
|
6
8
|
import CardProfile from "../../../../card/profile/CardProfile.svelte";
|
|
7
9
|
import type { CarouselGridProfileProps } from "../../../../../../types";
|
|
8
10
|
|
|
@@ -22,52 +24,60 @@
|
|
|
22
24
|
}: CarouselGridProfileProps = $props();
|
|
23
25
|
|
|
24
26
|
const responsive = useDevice();
|
|
27
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
25
28
|
</script>
|
|
26
29
|
|
|
27
30
|
<CarouselHeader {...headerProps}>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
31
|
+
{#if isEmpty}
|
|
32
|
+
<NotFoundEmpty
|
|
33
|
+
title={$t("empty.profiles.title")}
|
|
34
|
+
description={$t("empty.profiles.description")}
|
|
35
|
+
/>
|
|
36
|
+
{:else}
|
|
37
|
+
<CarouselGridSlot {slotProps} {gridClass} totalItems={items?.length ?? 0}>
|
|
38
|
+
{#if isLoading}
|
|
39
|
+
{#each Array.from( { length: responsive.isMobile ? 3 : 6 }, ) as _, i (`loading-${i}`)}
|
|
40
|
+
{#if responsive.isMobile}
|
|
41
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
42
|
+
<CardProfile id={i} {variant} isLoading />
|
|
43
|
+
</Carousel.Item>
|
|
44
|
+
{:else}
|
|
45
|
+
<div>
|
|
46
|
+
<CardProfile id={i} {variant} isLoading />
|
|
47
|
+
</div>
|
|
48
|
+
{/if}
|
|
49
|
+
{/each}
|
|
50
|
+
{:else}
|
|
51
|
+
{#each items as item, i (`profile-${item.id ?? i}`)}
|
|
52
|
+
{#if responsive.isMobile}
|
|
53
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
54
|
+
<CardProfile
|
|
55
|
+
{...item}
|
|
56
|
+
{variant}
|
|
57
|
+
{isDescriptionIcon}
|
|
58
|
+
{isDescriptionLabel}
|
|
59
|
+
{onEmailClick}
|
|
60
|
+
{onWhatsappClick}
|
|
61
|
+
{onButtonProfile}
|
|
62
|
+
{onFavoriteClick}
|
|
63
|
+
/>
|
|
64
|
+
</Carousel.Item>
|
|
65
|
+
{:else}
|
|
66
|
+
<div>
|
|
67
|
+
<CardProfile
|
|
68
|
+
{...item}
|
|
69
|
+
{variant}
|
|
70
|
+
{isDescriptionIcon}
|
|
71
|
+
{isDescriptionLabel}
|
|
72
|
+
{onEmailClick}
|
|
73
|
+
{onWhatsappClick}
|
|
74
|
+
{onButtonProfile}
|
|
75
|
+
{onFavoriteClick}
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
{/if}
|
|
79
|
+
{/each}
|
|
80
|
+
{/if}
|
|
81
|
+
</CarouselGridSlot>
|
|
82
|
+
{/if}
|
|
73
83
|
</CarouselHeader>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CardPromotionProps } from "../../../card/types";
|
|
2
|
+
import type { CarouselSlotProps } from "../../../panel/type";
|
|
3
|
+
import type { CarouselHeaderProps } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* Props do CarouselGridProfile — layout em grid de cards de perfil
|
|
6
|
+
* (guias, intérpretes, organizações). Em mobile vira carousel com swipe.
|
|
7
|
+
*/
|
|
8
|
+
export interface CarouselGridPromotionProps {
|
|
9
|
+
/** Props do cabeçalho do carousel (título, descrição, etc.) */
|
|
10
|
+
headerProps?: CarouselHeaderProps;
|
|
11
|
+
/** Props do slot/container do carousel (botões navegação, plugins) */
|
|
12
|
+
slotProps?: CarouselSlotProps;
|
|
13
|
+
/** Classe CSS adicional para o container do grid */
|
|
14
|
+
gridClass?: string;
|
|
15
|
+
/** Variante visual do card: 1 ou 2 */
|
|
16
|
+
variant?: 1 | 2;
|
|
17
|
+
/** Lista de perfis para exibir nos cards */
|
|
18
|
+
items: CardPromotionProps[];
|
|
19
|
+
/** Estado de carregamento (skeleton) */
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
isDescriptionIcon?: boolean;
|
|
22
|
+
isDescriptionLabel?: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CarouselGridSlot from "../../shared/ui/CarouselGridSlot.svelte";
|
|
3
|
+
import CarouselHeader from "../../../shared/ui/CarouselHeader.svelte";
|
|
4
|
+
import NotFoundEmpty from "../../../../panel/NotFoundEmpty.svelte";
|
|
5
|
+
import * as Carousel from "../../../../../ui/carousel/index.js";
|
|
6
|
+
import { useDevice } from "../../../../../../hooks/responsive.svelte";
|
|
7
|
+
import { t } from "../../../../../../i18n";
|
|
8
|
+
import CardPromotion from "../../../../card/promotion/CardPromotion.svelte";
|
|
9
|
+
import type { CarouselGridPromotionProps } from "../types";
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
headerProps,
|
|
13
|
+
slotProps,
|
|
14
|
+
gridClass = "lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5",
|
|
15
|
+
items,
|
|
16
|
+
isLoading = false,
|
|
17
|
+
isDescriptionIcon = false,
|
|
18
|
+
isDescriptionLabel = false,
|
|
19
|
+
}: CarouselGridPromotionProps = $props();
|
|
20
|
+
|
|
21
|
+
const responsive = useDevice();
|
|
22
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<CarouselHeader {...headerProps}>
|
|
26
|
+
{#if isEmpty}
|
|
27
|
+
<NotFoundEmpty
|
|
28
|
+
title={$t("empty.promotions.title")}
|
|
29
|
+
description={$t("empty.promotions.description")}
|
|
30
|
+
/>
|
|
31
|
+
{:else}
|
|
32
|
+
<CarouselGridSlot {slotProps} {gridClass} totalItems={items?.length ?? 0}>
|
|
33
|
+
{#if isLoading}
|
|
34
|
+
{#each Array.from( { length: responsive.isMobile ? 3 : 6 }, ) as _, i (`loading-${i}`)}
|
|
35
|
+
{#if responsive.isMobile}
|
|
36
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
37
|
+
<CardPromotion id={i} isLoading />
|
|
38
|
+
</Carousel.Item>
|
|
39
|
+
{:else}
|
|
40
|
+
<div>
|
|
41
|
+
<CardPromotion id={i} isLoading />
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
44
|
+
{/each}
|
|
45
|
+
{:else}
|
|
46
|
+
{#each items as item, i (`promotion-${item.id ?? i}`)}
|
|
47
|
+
{#if responsive.isMobile}
|
|
48
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
49
|
+
<CardPromotion
|
|
50
|
+
{...item}
|
|
51
|
+
{isDescriptionIcon}
|
|
52
|
+
{isDescriptionLabel}
|
|
53
|
+
/>
|
|
54
|
+
</Carousel.Item>
|
|
55
|
+
{:else}
|
|
56
|
+
<div>
|
|
57
|
+
<CardPromotion
|
|
58
|
+
{...item}
|
|
59
|
+
{isDescriptionIcon}
|
|
60
|
+
{isDescriptionLabel}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
{/if}
|
|
64
|
+
{/each}
|
|
65
|
+
{/if}
|
|
66
|
+
</CarouselGridSlot>
|
|
67
|
+
{/if}
|
|
68
|
+
</CarouselHeader>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CarouselGridPromotionProps } from "../types";
|
|
2
|
+
declare const CarouselGridPromotion: import("svelte").Component<CarouselGridPromotionProps, {}, "">;
|
|
3
|
+
type CarouselGridPromotion = ReturnType<typeof CarouselGridPromotion>;
|
|
4
|
+
export default CarouselGridPromotion;
|
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import CardHighlight from "../../../card/highlight/CardHighlight.svelte";
|
|
3
|
-
import CarouselHeader from "../../shared/ui/CarouselHeader.svelte";
|
|
4
|
-
import CarouselSlot from "../../../panel/CarouselSlot.svelte";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CardHighlight from "../../../card/highlight/CardHighlight.svelte";
|
|
3
|
+
import CarouselHeader from "../../shared/ui/CarouselHeader.svelte";
|
|
4
|
+
import CarouselSlot from "../../../panel/CarouselSlot.svelte";
|
|
5
|
+
import NotFoundEmpty from "../../../panel/NotFoundEmpty.svelte";
|
|
6
|
+
import * as Carousel from "../../../../ui/carousel/index.js";
|
|
7
|
+
import type { CarouselHighlightsProps } from "../types";
|
|
8
|
+
import { useDevice } from "../../../../../hooks/responsive.svelte";
|
|
9
|
+
import { t } from "../../../../../i18n";
|
|
10
|
+
import Autoplay from "embla-carousel-autoplay";
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
headerProps,
|
|
14
|
+
slotProps,
|
|
15
|
+
items,
|
|
16
|
+
isLoading = false,
|
|
17
|
+
varient = 1,
|
|
18
|
+
isDescriptionIcon,
|
|
19
|
+
isDescriptionLabel,
|
|
20
|
+
}: CarouselHighlightsProps = $props();
|
|
21
|
+
|
|
22
|
+
const responsive = useDevice();
|
|
23
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<CarouselHeader {...headerProps}>
|
|
27
|
+
{#if isEmpty}
|
|
28
|
+
<NotFoundEmpty
|
|
29
|
+
title={$t("empty.highlights.title")}
|
|
30
|
+
description={$t("empty.highlights.description")}
|
|
31
|
+
/>
|
|
32
|
+
{:else}
|
|
33
|
+
<CarouselSlot
|
|
34
|
+
{...slotProps}
|
|
35
|
+
plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
|
|
36
|
+
>
|
|
37
|
+
{#if isLoading}
|
|
38
|
+
{#each Array.from( { length: responsive.isMobile ? 5 : 10 }, ) as _, i (`loading-${i}`)}
|
|
39
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
40
|
+
<CardHighlight id={i} {isLoading} {varient} />
|
|
41
|
+
</Carousel.Item>
|
|
42
|
+
{/each}
|
|
43
|
+
{:else}
|
|
44
|
+
{#each items as item, i (`highlight-${item.id ?? i}`)}
|
|
45
|
+
<Carousel.Item class="pl-2 basis-auto">
|
|
46
|
+
<CardHighlight
|
|
47
|
+
{...item}
|
|
48
|
+
{varient}
|
|
49
|
+
{isDescriptionIcon}
|
|
50
|
+
{isDescriptionLabel}
|
|
51
|
+
/>
|
|
52
|
+
</Carousel.Item>
|
|
53
|
+
{/each}
|
|
54
|
+
{/if}
|
|
55
|
+
</CarouselSlot>
|
|
56
|
+
{/if}
|
|
57
|
+
</CarouselHeader>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CardProductProps } from "../../card/types";
|
|
2
|
+
import type { CarouselSlotProps } from "../../panel/type";
|
|
3
|
+
import type { CarouselHeaderProps } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Props do CarouselProduct — carousel de cards de produto
|
|
6
|
+
* com preços antigo/novo e botões de compra.
|
|
7
|
+
*/
|
|
8
|
+
export interface CarouselProductProps {
|
|
9
|
+
/** Props do cabeçalho do carousel (título, descrição, etc.) */
|
|
10
|
+
headerProps?: CarouselHeaderProps;
|
|
11
|
+
/** Props do slot/container do carousel (botões navegação, plugins) */
|
|
12
|
+
slotProps?: CarouselSlotProps;
|
|
13
|
+
/** Lista de promoções para exibir */
|
|
14
|
+
items: CardProductProps[];
|
|
15
|
+
/** Exibe ícone antes da descrição do card */
|
|
16
|
+
isDescriptionIcon?: boolean;
|
|
17
|
+
/** Exibe etiqueta (label) na descrição do card */
|
|
18
|
+
isDescriptionLabel?: boolean;
|
|
19
|
+
/** Estado de carregamento (skeleton) */
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CarouselSlot from "../../../panel/CarouselSlot.svelte";
|
|
3
|
+
import NotFoundEmpty from "../../../panel/NotFoundEmpty.svelte";
|
|
4
|
+
import * as Carousel from "../../../../ui/carousel/index.js";
|
|
5
|
+
import type { CarouselProductProps } from "../types";
|
|
6
|
+
import CarouselHeader from "../../shared/ui/CarouselHeader.svelte";
|
|
7
|
+
import { useDevice } from "../../../../../hooks/responsive.svelte";
|
|
8
|
+
import { t } from "../../../../../i18n";
|
|
9
|
+
import Autoplay from "embla-carousel-autoplay";
|
|
10
|
+
import CardProduct from "../../../card/product/CardProduct.svelte";
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
headerProps,
|
|
14
|
+
slotProps,
|
|
15
|
+
items,
|
|
16
|
+
isLoading = false,
|
|
17
|
+
isDescriptionIcon,
|
|
18
|
+
isDescriptionLabel,
|
|
19
|
+
}: CarouselProductProps = $props();
|
|
20
|
+
|
|
21
|
+
const responsive = useDevice();
|
|
22
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<CarouselHeader {...headerProps}>
|
|
26
|
+
{#if isEmpty}
|
|
27
|
+
<NotFoundEmpty
|
|
28
|
+
title={$t("empty.products.title")}
|
|
29
|
+
description={$t("empty.products.description")}
|
|
30
|
+
/>
|
|
31
|
+
{:else}
|
|
32
|
+
<CarouselSlot
|
|
33
|
+
{...slotProps}
|
|
34
|
+
containerClass="w-full"
|
|
35
|
+
plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
|
|
36
|
+
>
|
|
37
|
+
{#if isLoading}
|
|
38
|
+
{#each Array.from( { length: responsive.isMobile ? 5 : 10 }, ) as _, i (`loading-${i}`)}
|
|
39
|
+
<Carousel.Item class="pl-5 w-75 basis-auto">
|
|
40
|
+
<CardProduct
|
|
41
|
+
id={i}
|
|
42
|
+
{isLoading}
|
|
43
|
+
{isDescriptionIcon}
|
|
44
|
+
{isDescriptionLabel}
|
|
45
|
+
/>
|
|
46
|
+
</Carousel.Item>
|
|
47
|
+
{/each}
|
|
48
|
+
{:else}
|
|
49
|
+
{#each items as item, i (`product-${item.id ?? i}`)}
|
|
50
|
+
<Carousel.Item class="pl-2 w-75 basis-auto">
|
|
51
|
+
<CardProduct {...item} {isDescriptionIcon} {isDescriptionLabel} />
|
|
52
|
+
</Carousel.Item>
|
|
53
|
+
{/each}
|
|
54
|
+
{/if}
|
|
55
|
+
</CarouselSlot>
|
|
56
|
+
{/if}
|
|
57
|
+
</CarouselHeader>
|