negodesign 0.0.28 → 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/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 +5 -1
- package/dist/components/core/card/highlight/02/CardHighlight02.svelte +5 -3
- package/dist/components/core/card/highlight/data.js +1 -4
- 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 +6 -4
- 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 +1 -1
- 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 +4 -22
- package/dist/components/core/carousel/promotion/types.d.ts +5 -5
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +4 -21
- 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 +351 -43
- package/dist/index.d.ts +15 -5
- package/dist/index.js +15 -5
- package/package.json +1 -1
|
@@ -12,17 +12,18 @@
|
|
|
12
12
|
descriptionClass,
|
|
13
13
|
intervalMs = 5000,
|
|
14
14
|
transitionMs = 1200,
|
|
15
|
+
indicatorShow = false,
|
|
15
16
|
}: CarouselHeroProps & {
|
|
16
17
|
children?: Snippet;
|
|
17
18
|
intervalMs?: number;
|
|
18
19
|
transitionMs?: number;
|
|
20
|
+
indicatorShow?: boolean;
|
|
19
21
|
} = $props();
|
|
20
22
|
|
|
21
|
-
// Buffer duplo: duas camadas fixas, nunca desmontadas — só a opacidade muda.
|
|
22
23
|
let layers = $state<[string, string]>([items?.[0]?.image ?? "", ""]);
|
|
23
24
|
let active = $state<0 | 1>(0);
|
|
24
25
|
let index = $state(0);
|
|
25
|
-
let switching = false;
|
|
26
|
+
let switching = false;
|
|
26
27
|
|
|
27
28
|
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
28
29
|
const preloadCache = new Map<string, Promise<void>>();
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
const promise = new Promise<void>((resolve) => {
|
|
36
37
|
const img = new Image();
|
|
37
38
|
img.onload = () => resolve();
|
|
38
|
-
img.onerror = () => resolve();
|
|
39
|
+
img.onerror = () => resolve();
|
|
39
40
|
img.src = src;
|
|
40
41
|
});
|
|
41
42
|
|
|
@@ -43,7 +44,6 @@
|
|
|
43
44
|
return promise;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
// Pré-carrega todas as imagens uma vez, assim que os items ficam disponíveis.
|
|
47
47
|
$effect(() => {
|
|
48
48
|
items?.forEach((item) => void preload(item.image));
|
|
49
49
|
});
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
switching = true;
|
|
54
54
|
|
|
55
55
|
const nextSrc = items[nextIndex].image;
|
|
56
|
-
await preload(nextSrc);
|
|
56
|
+
await preload(nextSrc);
|
|
57
57
|
|
|
58
58
|
const nextLayer = active === 0 ? 1 : 0;
|
|
59
59
|
layers[nextLayer] = nextSrc;
|
|
@@ -139,20 +139,22 @@
|
|
|
139
139
|
</section>
|
|
140
140
|
</div>
|
|
141
141
|
|
|
142
|
-
{#if
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
142
|
+
{#if indicatorShow}
|
|
143
|
+
{#if items && items.length > 1}
|
|
144
|
+
<div
|
|
145
|
+
style="position: absolute; bottom: 0.75rem; z-index: 10; display: flex; gap: 0.5rem;"
|
|
146
|
+
>
|
|
147
|
+
{#each items as item, i (`hero-dot-${i}`)}
|
|
148
|
+
<button
|
|
149
|
+
aria-label={`Ir para o slide ${i + 1}: ${item.title}`}
|
|
150
|
+
class="w-2 h-2 rounded-full transition-colors {i === index
|
|
151
|
+
? 'bg-white'
|
|
152
|
+
: 'bg-white/40'}"
|
|
153
|
+
onclick={() => goTo(i)}
|
|
154
|
+
></button>
|
|
155
|
+
{/each}
|
|
156
|
+
</div>
|
|
157
|
+
{/if}
|
|
156
158
|
{/if}
|
|
157
159
|
</header>
|
|
158
160
|
{/if}
|
|
@@ -4,6 +4,7 @@ type $$ComponentProps = CarouselHeroProps & {
|
|
|
4
4
|
children?: Snippet;
|
|
5
5
|
intervalMs?: number;
|
|
6
6
|
transitionMs?: number;
|
|
7
|
+
indicatorShow?: boolean;
|
|
7
8
|
};
|
|
8
9
|
declare const CarouselHero: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
10
|
type CarouselHero = ReturnType<typeof CarouselHero>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CardHighlightProps } from "../../card/types";
|
|
2
|
+
import type { CarouselSlotProps } from "../../panel/type";
|
|
2
3
|
import type { CarouselHeaderProps } from "../types";
|
|
3
|
-
export interface CarouselHighlightsProps
|
|
4
|
+
export interface CarouselHighlightsProps {
|
|
5
|
+
headerProps?: CarouselHeaderProps;
|
|
6
|
+
slotProps?: CarouselSlotProps;
|
|
4
7
|
items: CardHighlightProps[];
|
|
5
8
|
varient?: 1 | 2;
|
|
6
|
-
isBorderBottom?: boolean;
|
|
7
9
|
isLoading?: boolean;
|
|
8
10
|
isDescriptionIcon?: boolean;
|
|
9
11
|
isDescriptionLabel?: boolean;
|
|
10
|
-
isButtonPreviousAndNext?: boolean;
|
|
11
|
-
buttonPreviousAndNextClass?: string;
|
|
12
12
|
}
|
|
@@ -8,39 +8,21 @@
|
|
|
8
8
|
import Autoplay from "embla-carousel-autoplay";
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
|
-
|
|
11
|
+
headerProps,
|
|
12
|
+
slotProps,
|
|
12
13
|
items,
|
|
13
|
-
description,
|
|
14
|
-
titleClass,
|
|
15
|
-
descriptionClass,
|
|
16
|
-
isButtonPreviousAndNext = true,
|
|
17
|
-
buttonPreviousAndNextClass = "",
|
|
18
|
-
containerClass = "",
|
|
19
14
|
isLoading = false,
|
|
20
15
|
varient = 1,
|
|
21
16
|
isDescriptionIcon,
|
|
22
17
|
isDescriptionLabel,
|
|
23
|
-
onButtonViewAll,
|
|
24
|
-
positionButtonPreviousAndNext,
|
|
25
18
|
}: CarouselHighlightsProps = $props();
|
|
26
19
|
|
|
27
20
|
const responsive = useDevice();
|
|
28
21
|
</script>
|
|
29
22
|
|
|
30
|
-
<CarouselHeader
|
|
31
|
-
{title}
|
|
32
|
-
{description}
|
|
33
|
-
{titleClass}
|
|
34
|
-
{descriptionClass}
|
|
35
|
-
{containerClass}
|
|
36
|
-
{onButtonViewAll}
|
|
37
|
-
>
|
|
23
|
+
<CarouselHeader {...headerProps}>
|
|
38
24
|
<CarouselSlot
|
|
39
|
-
|
|
40
|
-
{isButtonPreviousAndNext}
|
|
41
|
-
{buttonPreviousAndNextClass}
|
|
42
|
-
{positionButtonPreviousAndNext}
|
|
43
|
-
containerClass="w-full"
|
|
25
|
+
{...slotProps}
|
|
44
26
|
plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
|
|
45
27
|
>
|
|
46
28
|
{#if isLoading}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CardPromotionProps } from "../../card/types";
|
|
2
|
+
import type { CarouselSlotProps } from "../../panel/type";
|
|
2
3
|
import type { CarouselHeaderProps } from "../types";
|
|
3
|
-
export interface CarouselPromotionProps
|
|
4
|
+
export interface CarouselPromotionProps {
|
|
5
|
+
headerProps?: CarouselHeaderProps;
|
|
6
|
+
slotProps?: CarouselSlotProps;
|
|
4
7
|
items: CardPromotionProps[];
|
|
5
|
-
isBorderBottom?: boolean;
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
isButtonPreviousAndNext?: boolean;
|
|
8
|
-
buttonPreviousAndNextClass?: string;
|
|
9
8
|
isDescriptionIcon?: boolean;
|
|
10
9
|
isDescriptionLabel?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
11
11
|
}
|
|
@@ -8,37 +8,20 @@
|
|
|
8
8
|
import Autoplay from "embla-carousel-autoplay";
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
|
-
|
|
11
|
+
headerProps,
|
|
12
|
+
slotProps,
|
|
12
13
|
items,
|
|
13
|
-
description,
|
|
14
|
-
titleClass,
|
|
15
|
-
descriptionClass,
|
|
16
|
-
isButtonPreviousAndNext = true,
|
|
17
14
|
isLoading = false,
|
|
18
|
-
buttonPreviousAndNextClass = "",
|
|
19
|
-
containerClass = "",
|
|
20
|
-
positionButtonPreviousAndNext,
|
|
21
15
|
isDescriptionIcon,
|
|
22
16
|
isDescriptionLabel,
|
|
23
|
-
onButtonViewAll,
|
|
24
17
|
}: CarouselPromotionProps = $props();
|
|
25
18
|
|
|
26
19
|
const responsive = useDevice();
|
|
27
20
|
</script>
|
|
28
21
|
|
|
29
|
-
<CarouselHeader
|
|
30
|
-
{title}
|
|
31
|
-
{description}
|
|
32
|
-
{titleClass}
|
|
33
|
-
{descriptionClass}
|
|
34
|
-
{containerClass}
|
|
35
|
-
{onButtonViewAll}
|
|
36
|
-
>
|
|
22
|
+
<CarouselHeader {...headerProps}>
|
|
37
23
|
<CarouselSlot
|
|
38
|
-
|
|
39
|
-
{isButtonPreviousAndNext}
|
|
40
|
-
{buttonPreviousAndNextClass}
|
|
41
|
-
{positionButtonPreviousAndNext}
|
|
24
|
+
{...slotProps}
|
|
42
25
|
containerClass="w-full"
|
|
43
26
|
plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
|
|
44
27
|
>
|
|
@@ -18,11 +18,16 @@
|
|
|
18
18
|
containerClass = "",
|
|
19
19
|
onButtonViewAll,
|
|
20
20
|
children,
|
|
21
|
+
isBorder,
|
|
21
22
|
}: CarouselHeaderProps & Props = $props();
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
25
|
<div class="w-full flex justify-center">
|
|
25
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
class="w-[95%] p-2 rounded-xl
|
|
28
|
+
{isBorder ? 'border border-gray-50 dark:border-gray-800' : ''}
|
|
29
|
+
{containerClass}"
|
|
30
|
+
>
|
|
26
31
|
<div class="flex flex-col gap-1">
|
|
27
32
|
<div class="flex justify-between">
|
|
28
33
|
<div>
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as Carousel from "../../ui/carousel/index.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { CarouselPlugins } from "../../ui/carousel/context.js";
|
|
5
|
-
|
|
6
|
-
type Props = {
|
|
7
|
-
positionButtonPreviousAndNext?: "center" | "top_right";
|
|
8
|
-
buttonPreviousAndNextClass?: string;
|
|
9
|
-
isButtonPreviousAndNext?: boolean;
|
|
10
|
-
isBorderBottom?: boolean;
|
|
11
|
-
containerClass?: string;
|
|
12
|
-
plugins?: CarouselPlugins;
|
|
13
|
-
children: Snippet;
|
|
14
|
-
};
|
|
3
|
+
import type { CarouselSlotProps } from "./type";
|
|
15
4
|
|
|
16
5
|
const {
|
|
17
6
|
positionButtonPreviousAndNext = "center",
|
|
18
7
|
isButtonPreviousAndNext = true,
|
|
19
8
|
buttonPreviousAndNextClass = "",
|
|
20
9
|
isBorderBottom = true,
|
|
21
|
-
containerClass = "",
|
|
10
|
+
containerClass = "w-full",
|
|
22
11
|
plugins = [],
|
|
23
12
|
children,
|
|
24
|
-
}:
|
|
13
|
+
}: CarouselSlotProps = $props();
|
|
25
14
|
|
|
26
15
|
const styleTopCenter = "bg-blue-700! text-white! cursor-pointer!";
|
|
27
16
|
const styleCenter =
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
type Props = {
|
|
4
|
-
positionButtonPreviousAndNext?: "center" | "top_right";
|
|
5
|
-
buttonPreviousAndNextClass?: string;
|
|
6
|
-
isButtonPreviousAndNext?: boolean;
|
|
7
|
-
isBorderBottom?: boolean;
|
|
8
|
-
containerClass?: string;
|
|
9
|
-
plugins?: CarouselPlugins;
|
|
10
|
-
children: Snippet;
|
|
11
|
-
};
|
|
12
|
-
declare const CarouselSlot: import("svelte").Component<Props, {}, "">;
|
|
1
|
+
import type { CarouselSlotProps } from "./type";
|
|
2
|
+
declare const CarouselSlot: import("svelte").Component<CarouselSlotProps, {}, "">;
|
|
13
3
|
type CarouselSlot = ReturnType<typeof CarouselSlot>;
|
|
14
4
|
export default CarouselSlot;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CarouselPlugins } from "../../ui/carousel/context";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
export type CarouselSlotProps = {
|
|
4
|
+
positionButtonPreviousAndNext?: "center" | "top_right";
|
|
5
|
+
buttonPreviousAndNextClass?: string;
|
|
6
|
+
isButtonPreviousAndNext?: boolean;
|
|
7
|
+
isBorderBottom?: boolean;
|
|
8
|
+
containerClass?: string;
|
|
9
|
+
plugins?: CarouselPlugins;
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|