negodesign 0.0.36 → 0.0.38
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/shared/CardDescription.svelte +1 -1
- package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +38 -28
- package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte +48 -38
- package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +56 -46
- package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte +46 -28
- package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +57 -47
- package/dist/components/core/carousel/product/ui/CarouselProduct.svelte +57 -47
- package/dist/components/core/carousel/promotion/types.d.ts +5 -0
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +67 -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 +13 -9
- package/dist/components/pages/company-profile/data.js +47 -0
- package/dist/components/pages/company-profile/shared/ProfileBanner.svelte +136 -60
- 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 +1 -1
- package/dist/components/pages/company-profile/types.d.ts +25 -5
- 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 +60 -0
- package/dist/i18n/langs/en.d.ts +15 -0
- package/dist/i18n/langs/en.js +15 -0
- package/dist/i18n/langs/pt.d.ts +15 -0
- package/dist/i18n/langs/pt.js +15 -0
- package/dist/i18n/translations.d.ts +30 -0
- package/package.json +1 -1
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
<TruncatableText
|
|
37
37
|
text={content}
|
|
38
38
|
{lines}
|
|
39
|
-
class="text-justify text-[13px] md:text-[14px] text-gray-800 dark:text-gray-50 mt-3 my-2"
|
|
39
|
+
class="text-justify text-[13px] md:text-[14px] text-gray-800 dark:text-gray-50 mt-3 my-2 h-[65px] mb-1"
|
|
40
40
|
/>
|
|
41
41
|
{/if}
|
|
@@ -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>
|
|
@@ -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 CardProduct from "../../../../card/product/CardProduct.svelte";
|
|
7
9
|
import type { CarouselGridProductProps } from "../types";
|
|
8
10
|
|
|
@@ -18,44 +20,52 @@
|
|
|
18
20
|
}: CarouselGridProductProps = $props();
|
|
19
21
|
|
|
20
22
|
const responsive = useDevice();
|
|
23
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
21
24
|
</script>
|
|
22
25
|
|
|
23
26
|
<CarouselHeader {...headerProps}>
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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}
|
|
61
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>
|
|
@@ -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 CardPromotion from "../../../../card/promotion/CardPromotion.svelte";
|
|
7
9
|
import type { CarouselGridPromotionProps } from "../types";
|
|
8
10
|
|
|
@@ -17,34 +19,50 @@
|
|
|
17
19
|
}: CarouselGridPromotionProps = $props();
|
|
18
20
|
|
|
19
21
|
const responsive = useDevice();
|
|
22
|
+
const isEmpty = $derived(!isLoading && (!items || items.length === 0));
|
|
20
23
|
</script>
|
|
21
24
|
|
|
22
25
|
<CarouselHeader {...headerProps}>
|
|
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
|
-
|
|
49
|
-
|
|
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}
|
|
50
68
|
</CarouselHeader>
|
|
@@ -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>
|
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import CarouselSlot from "../../../panel/CarouselSlot.svelte";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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 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>
|
|
@@ -18,4 +18,9 @@ export interface CarouselPromotionProps {
|
|
|
18
18
|
isDescriptionLabel?: boolean;
|
|
19
19
|
/** Estado de carregamento (skeleton) */
|
|
20
20
|
isLoading?: boolean;
|
|
21
|
+
onClickBuy?: (id: string | number) => void;
|
|
22
|
+
/** Callback ao clicar no botão carrinho */
|
|
23
|
+
onClickShop?: (id: string | number) => void;
|
|
24
|
+
/** Callback ao clicar no botão favorito */
|
|
25
|
+
onClickFavorite?: (id: string | number) => void;
|
|
21
26
|
}
|