negodesign 0.0.24 → 0.0.26
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/start.png +0 -0
- 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 +91 -0
- package/dist/components/core/card/highlight/01/CardHighlight01.svelte.d.ts +8 -0
- package/dist/components/core/card/highlight/02/CardHighlight02.svelte +93 -0
- package/dist/components/core/card/highlight/02/CardHighlight02.svelte.d.ts +8 -0
- package/dist/components/core/card/highlight/CardHighlight.svelte +22 -44
- package/dist/components/core/card/highlight/CardHighlight.svelte.d.ts +5 -2
- package/dist/components/core/card/highlight/data.js +32 -1
- package/dist/components/core/card/media/01/CardMedia01.svelte +111 -114
- package/dist/components/core/card/media/02/CardMedia02.svelte +110 -113
- package/dist/components/core/card/media/CardMedia.svelte +17 -17
- package/dist/components/core/card/profile/01/CardProfile01.svelte +98 -101
- package/dist/components/core/card/profile/02/CardProfile02.svelte +98 -97
- package/dist/components/core/card/profile/CardProfile.svelte +17 -17
- package/dist/components/core/card/promotion/CardPromotion.svelte +112 -81
- package/dist/components/core/card/promotion/data.js +31 -0
- package/dist/components/core/card/shared/CardButton.svelte +30 -30
- package/dist/components/core/card/shared/CardCart.svelte +36 -32
- package/dist/components/core/card/shared/CardCart.svelte.d.ts +1 -0
- package/dist/components/core/card/shared/CardDescription.svelte +38 -23
- package/dist/components/core/card/shared/CardDescription.svelte.d.ts +3 -0
- package/dist/components/core/card/shared/CardFavorite.svelte +33 -29
- package/dist/components/core/card/shared/CardFavorite.svelte.d.ts +1 -0
- package/dist/components/core/card/shared/CardStarRating.svelte +20 -20
- package/dist/components/core/card/shared/CardStartPrice.svelte +34 -0
- package/dist/components/core/card/shared/CardStartPrice.svelte.d.ts +8 -0
- package/dist/components/core/card/shared/CardTags.svelte +73 -56
- package/dist/components/core/card/shared/CardTags.svelte.d.ts +2 -1
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte +169 -169
- package/dist/components/core/card/shared/TruncatableText.svelte +55 -55
- package/dist/components/core/card/types.d.ts +13 -0
- package/dist/components/core/carousel/{shared/ui/SimpleBadgeCarousel.svelte → badge/ui/CarouselBadge.svelte} +83 -80
- package/dist/components/core/carousel/badge/ui/CarouselBadge.svelte.d.ts +4 -0
- package/dist/components/core/carousel/hero/CarouselHero.svelte +158 -158
- package/dist/components/core/carousel/highlights/types.d.ts +12 -0
- package/dist/components/core/carousel/highlights/types.js +1 -0
- package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +63 -65
- package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte.d.ts +1 -1
- package/dist/components/core/carousel/promotion/types.d.ts +11 -0
- package/dist/components/core/carousel/promotion/types.js +1 -0
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +64 -65
- package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte.d.ts +1 -1
- package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +55 -0
- package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte.d.ts +9 -0
- package/dist/components/core/carousel/types.d.ts +10 -26
- 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/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/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/menu-links.svelte +27 -27
- package/dist/components/core/nav/ui/mobile/nav-menu-drawer.svelte +85 -85
- package/dist/components/core/nav/ui/nav-menu-bottom-sidebar.svelte +33 -33
- package/dist/components/core/nav/ui/nav-menu-sidebar.svelte +97 -97
- package/dist/components/core/nav/ui/nav-menu-top-bar-sidebar.svelte +103 -103
- package/dist/components/core/nav/ui/nav-menu.svelte +106 -106
- package/dist/components/core/panel/CarouselSlot.svelte +63 -38
- package/dist/components/core/panel/CarouselSlot.svelte.d.ts +5 -2
- package/dist/components/core/panel/LeftHero.svelte +116 -116
- 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/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/globals.css +143 -15
- package/dist/hooks/responsive.svelte.d.ts +1 -1
- package/dist/hooks/responsive.svelte.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/styles/globals.css +149 -149
- package/package.json +113 -113
- package/dist/components/core/carousel/shared/ui/SimpleBadgeCarousel.svelte.d.ts +0 -4
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { CarouselHeroItem, CarouselHeroProps } from "../types";
|
|
3
|
-
import NavMenu from "../../nav/ui/nav-menu.svelte";
|
|
4
|
-
import type { Snippet } from "svelte";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
items,
|
|
8
|
-
navMenu,
|
|
9
|
-
children,
|
|
10
|
-
className,
|
|
11
|
-
titleClass,
|
|
12
|
-
descriptionClass,
|
|
13
|
-
intervalMs = 5000,
|
|
14
|
-
transitionMs = 1200,
|
|
15
|
-
}: CarouselHeroProps & {
|
|
16
|
-
children?: Snippet;
|
|
17
|
-
intervalMs?: number;
|
|
18
|
-
transitionMs?: number;
|
|
19
|
-
} = $props();
|
|
20
|
-
|
|
21
|
-
// Buffer duplo: duas camadas fixas, nunca desmontadas — só a opacidade muda.
|
|
22
|
-
let layers = $state<[string, string]>([items?.[0]?.image ?? "", ""]);
|
|
23
|
-
let active = $state<0 | 1>(0);
|
|
24
|
-
let index = $state(0);
|
|
25
|
-
let switching = false; // evita trocas sobrepostas se o intervalo disparar antes do preload acabar
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
28
|
-
const preloadCache = new Map<string, Promise<void>>();
|
|
29
|
-
|
|
30
|
-
function preload(src: string): Promise<void> {
|
|
31
|
-
if (!src) return Promise.resolve();
|
|
32
|
-
const cached = preloadCache.get(src);
|
|
33
|
-
if (cached) return cached;
|
|
34
|
-
|
|
35
|
-
const promise = new Promise<void>((resolve) => {
|
|
36
|
-
const img = new Image();
|
|
37
|
-
img.onload = () => resolve();
|
|
38
|
-
img.onerror = () => resolve(); // não bloqueia o carousel por uma imagem partida
|
|
39
|
-
img.src = src;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
preloadCache.set(src, promise);
|
|
43
|
-
return promise;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Pré-carrega todas as imagens uma vez, assim que os items ficam disponíveis.
|
|
47
|
-
$effect(() => {
|
|
48
|
-
items?.forEach((item) => void preload(item.image));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
async function goTo(nextIndex: number) {
|
|
52
|
-
if (!items || nextIndex === index || switching) return;
|
|
53
|
-
switching = true;
|
|
54
|
-
|
|
55
|
-
const nextSrc = items[nextIndex].image;
|
|
56
|
-
await preload(nextSrc); // garante decode/cache antes de trocar a camada -> sem flash
|
|
57
|
-
|
|
58
|
-
const nextLayer = active === 0 ? 1 : 0;
|
|
59
|
-
layers[nextLayer] = nextSrc;
|
|
60
|
-
active = nextLayer;
|
|
61
|
-
index = nextIndex;
|
|
62
|
-
switching = false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
$effect(() => {
|
|
66
|
-
if (!items || items.length <= 1) return;
|
|
67
|
-
|
|
68
|
-
const timer = setInterval(() => {
|
|
69
|
-
goTo((index + 1) % items.length);
|
|
70
|
-
}, intervalMs);
|
|
71
|
-
|
|
72
|
-
return () => clearInterval(timer);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
function fadeIn(node: HTMLElement) {
|
|
76
|
-
requestAnimationFrame(() => {
|
|
77
|
-
node.style.opacity = "1";
|
|
78
|
-
});
|
|
79
|
-
return {};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
let selected = $derived<CarouselHeroItem | undefined>(items?.[index]);
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
{#if selected}
|
|
86
|
-
<header
|
|
87
|
-
class="w-full relative flex flex-col justify-center items-center h-75 md:h-100 overflow-hidden {className}"
|
|
88
|
-
>
|
|
89
|
-
{#each layers as bg, i (i)}
|
|
90
|
-
<div
|
|
91
|
-
style="
|
|
92
|
-
position: absolute;
|
|
93
|
-
inset: 0;
|
|
94
|
-
will-change: opacity;
|
|
95
|
-
background-image: {bg ? `url(${bg})` : 'none'};
|
|
96
|
-
background-size: cover;
|
|
97
|
-
background-position: center;
|
|
98
|
-
background-repeat: no-repeat;
|
|
99
|
-
opacity: {i === active ? 1 : 0};
|
|
100
|
-
transition: opacity {transitionMs}ms ease-in-out;
|
|
101
|
-
"
|
|
102
|
-
></div>
|
|
103
|
-
{/each}
|
|
104
|
-
|
|
105
|
-
<div
|
|
106
|
-
style="position: absolute; inset: 0; height: 100%; background-color: rgba(0,0,0,0.4);"
|
|
107
|
-
></div>
|
|
108
|
-
|
|
109
|
-
<div class="relative z-10 w-full flex flex-col items-center flex-1">
|
|
110
|
-
<NavMenu {...navMenu} />
|
|
111
|
-
|
|
112
|
-
<section
|
|
113
|
-
class="flex flex-col justify-center items-center flex-1 w-full h-auto text-center px-4"
|
|
114
|
-
>
|
|
115
|
-
{#key selected.title}
|
|
116
|
-
<div
|
|
117
|
-
style="transition: opacity {transitionMs * 0.6}ms ease-in-out;"
|
|
118
|
-
class="opacity-0 flex flex-col justify-center items-center text-center"
|
|
119
|
-
use:fadeIn
|
|
120
|
-
>
|
|
121
|
-
<div>
|
|
122
|
-
<h1
|
|
123
|
-
class="text-white text-2xl md:text-4xl font-bold {titleClass}"
|
|
124
|
-
>
|
|
125
|
-
{selected.title}
|
|
126
|
-
</h1>
|
|
127
|
-
</div>
|
|
128
|
-
<div class="flex flex-col justify-center items-center">
|
|
129
|
-
<p class="text-white/90 mt-2 max-w-2xl {descriptionClass}">
|
|
130
|
-
{selected.description}
|
|
131
|
-
</p>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
{/key}
|
|
135
|
-
|
|
136
|
-
{#if children}
|
|
137
|
-
{@render children()}
|
|
138
|
-
{/if}
|
|
139
|
-
</section>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
{#if items && items.length > 1}
|
|
143
|
-
<div
|
|
144
|
-
style="position: absolute; bottom: 0.75rem; z-index: 10; display: flex; gap: 0.5rem;"
|
|
145
|
-
>
|
|
146
|
-
{#each items as item, i (i)}
|
|
147
|
-
<button
|
|
148
|
-
aria-label={`Ir para o slide ${i + 1}: ${item.title}`}
|
|
149
|
-
class="w-2 h-2 rounded-full transition-colors {i === index
|
|
150
|
-
? 'bg-white'
|
|
151
|
-
: 'bg-white/40'}"
|
|
152
|
-
onclick={() => goTo(i)}
|
|
153
|
-
></button>
|
|
154
|
-
{/each}
|
|
155
|
-
</div>
|
|
156
|
-
{/if}
|
|
157
|
-
</header>
|
|
158
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CarouselHeroItem, CarouselHeroProps } from "../types";
|
|
3
|
+
import NavMenu from "../../nav/ui/nav-menu.svelte";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
items,
|
|
8
|
+
navMenu,
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
titleClass,
|
|
12
|
+
descriptionClass,
|
|
13
|
+
intervalMs = 5000,
|
|
14
|
+
transitionMs = 1200,
|
|
15
|
+
}: CarouselHeroProps & {
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
intervalMs?: number;
|
|
18
|
+
transitionMs?: number;
|
|
19
|
+
} = $props();
|
|
20
|
+
|
|
21
|
+
// Buffer duplo: duas camadas fixas, nunca desmontadas — só a opacidade muda.
|
|
22
|
+
let layers = $state<[string, string]>([items?.[0]?.image ?? "", ""]);
|
|
23
|
+
let active = $state<0 | 1>(0);
|
|
24
|
+
let index = $state(0);
|
|
25
|
+
let switching = false; // evita trocas sobrepostas se o intervalo disparar antes do preload acabar
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
28
|
+
const preloadCache = new Map<string, Promise<void>>();
|
|
29
|
+
|
|
30
|
+
function preload(src: string): Promise<void> {
|
|
31
|
+
if (!src) return Promise.resolve();
|
|
32
|
+
const cached = preloadCache.get(src);
|
|
33
|
+
if (cached) return cached;
|
|
34
|
+
|
|
35
|
+
const promise = new Promise<void>((resolve) => {
|
|
36
|
+
const img = new Image();
|
|
37
|
+
img.onload = () => resolve();
|
|
38
|
+
img.onerror = () => resolve(); // não bloqueia o carousel por uma imagem partida
|
|
39
|
+
img.src = src;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
preloadCache.set(src, promise);
|
|
43
|
+
return promise;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Pré-carrega todas as imagens uma vez, assim que os items ficam disponíveis.
|
|
47
|
+
$effect(() => {
|
|
48
|
+
items?.forEach((item) => void preload(item.image));
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
async function goTo(nextIndex: number) {
|
|
52
|
+
if (!items || nextIndex === index || switching) return;
|
|
53
|
+
switching = true;
|
|
54
|
+
|
|
55
|
+
const nextSrc = items[nextIndex].image;
|
|
56
|
+
await preload(nextSrc); // garante decode/cache antes de trocar a camada -> sem flash
|
|
57
|
+
|
|
58
|
+
const nextLayer = active === 0 ? 1 : 0;
|
|
59
|
+
layers[nextLayer] = nextSrc;
|
|
60
|
+
active = nextLayer;
|
|
61
|
+
index = nextIndex;
|
|
62
|
+
switching = false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
$effect(() => {
|
|
66
|
+
if (!items || items.length <= 1) return;
|
|
67
|
+
|
|
68
|
+
const timer = setInterval(() => {
|
|
69
|
+
goTo((index + 1) % items.length);
|
|
70
|
+
}, intervalMs);
|
|
71
|
+
|
|
72
|
+
return () => clearInterval(timer);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
function fadeIn(node: HTMLElement) {
|
|
76
|
+
requestAnimationFrame(() => {
|
|
77
|
+
node.style.opacity = "1";
|
|
78
|
+
});
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let selected = $derived<CarouselHeroItem | undefined>(items?.[index]);
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
{#if selected}
|
|
86
|
+
<header
|
|
87
|
+
class="w-full relative flex flex-col justify-center items-center h-75 md:h-100 overflow-hidden {className}"
|
|
88
|
+
>
|
|
89
|
+
{#each layers as bg, i (i)}
|
|
90
|
+
<div
|
|
91
|
+
style="
|
|
92
|
+
position: absolute;
|
|
93
|
+
inset: 0;
|
|
94
|
+
will-change: opacity;
|
|
95
|
+
background-image: {bg ? `url(${bg})` : 'none'};
|
|
96
|
+
background-size: cover;
|
|
97
|
+
background-position: center;
|
|
98
|
+
background-repeat: no-repeat;
|
|
99
|
+
opacity: {i === active ? 1 : 0};
|
|
100
|
+
transition: opacity {transitionMs}ms ease-in-out;
|
|
101
|
+
"
|
|
102
|
+
></div>
|
|
103
|
+
{/each}
|
|
104
|
+
|
|
105
|
+
<div
|
|
106
|
+
style="position: absolute; inset: 0; height: 100%; background-color: rgba(0,0,0,0.4);"
|
|
107
|
+
></div>
|
|
108
|
+
|
|
109
|
+
<div class="relative z-10 w-full flex flex-col items-center flex-1">
|
|
110
|
+
<NavMenu {...navMenu} />
|
|
111
|
+
|
|
112
|
+
<section
|
|
113
|
+
class="flex flex-col justify-center items-center flex-1 w-full h-auto text-center px-4"
|
|
114
|
+
>
|
|
115
|
+
{#key selected.title}
|
|
116
|
+
<div
|
|
117
|
+
style="transition: opacity {transitionMs * 0.6}ms ease-in-out;"
|
|
118
|
+
class="opacity-0 flex flex-col justify-center items-center text-center"
|
|
119
|
+
use:fadeIn
|
|
120
|
+
>
|
|
121
|
+
<div>
|
|
122
|
+
<h1
|
|
123
|
+
class="text-white text-2xl md:text-4xl font-bold {titleClass}"
|
|
124
|
+
>
|
|
125
|
+
{selected.title}
|
|
126
|
+
</h1>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="flex flex-col justify-center items-center">
|
|
129
|
+
<p class="text-white/90 mt-2 max-w-2xl {descriptionClass}">
|
|
130
|
+
{selected.description}
|
|
131
|
+
</p>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
{/key}
|
|
135
|
+
|
|
136
|
+
{#if children}
|
|
137
|
+
{@render children()}
|
|
138
|
+
{/if}
|
|
139
|
+
</section>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
{#if items && items.length > 1}
|
|
143
|
+
<div
|
|
144
|
+
style="position: absolute; bottom: 0.75rem; z-index: 10; display: flex; gap: 0.5rem;"
|
|
145
|
+
>
|
|
146
|
+
{#each items as item, i (i)}
|
|
147
|
+
<button
|
|
148
|
+
aria-label={`Ir para o slide ${i + 1}: ${item.title}`}
|
|
149
|
+
class="w-2 h-2 rounded-full transition-colors {i === index
|
|
150
|
+
? 'bg-white'
|
|
151
|
+
: 'bg-white/40'}"
|
|
152
|
+
onclick={() => goTo(i)}
|
|
153
|
+
></button>
|
|
154
|
+
{/each}
|
|
155
|
+
</div>
|
|
156
|
+
{/if}
|
|
157
|
+
</header>
|
|
158
|
+
{/if}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CardHighlightProps } from "../../card/types";
|
|
2
|
+
import type { CarouselHeaderProps } from "../types";
|
|
3
|
+
export interface CarouselHighlightsProps extends CarouselHeaderProps {
|
|
4
|
+
items: CardHighlightProps[];
|
|
5
|
+
varient?: 1 | 2;
|
|
6
|
+
isBorderBottom?: boolean;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
isDescriptionIcon?: boolean;
|
|
9
|
+
isDescriptionLabel?: boolean;
|
|
10
|
+
isButtonPreviousAndNext?: boolean;
|
|
11
|
+
buttonPreviousAndNextClass?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,65 +1,63 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import CarouselSlot from "../../../panel/CarouselSlot.svelte";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const {
|
|
11
|
-
title,
|
|
12
|
-
items,
|
|
13
|
-
description,
|
|
14
|
-
titleClass,
|
|
15
|
-
descriptionClass,
|
|
16
|
-
isButtonPreviousAndNext = true,
|
|
17
|
-
buttonPreviousAndNextClass = "",
|
|
18
|
-
containerClass = "",
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
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 * as Carousel from "../../../../ui/carousel/index.js";
|
|
6
|
+
import type { CarouselHighlightsProps } from "../types";
|
|
7
|
+
import { useDevice } from "../../../../../hooks/responsive.svelte";
|
|
8
|
+
import Autoplay from "embla-carousel-autoplay";
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
title,
|
|
12
|
+
items,
|
|
13
|
+
description,
|
|
14
|
+
titleClass,
|
|
15
|
+
descriptionClass,
|
|
16
|
+
isButtonPreviousAndNext = true,
|
|
17
|
+
buttonPreviousAndNextClass = "",
|
|
18
|
+
containerClass = "",
|
|
19
|
+
isLoading = false,
|
|
20
|
+
varient = 1,
|
|
21
|
+
isDescriptionIcon,
|
|
22
|
+
isDescriptionLabel,
|
|
23
|
+
onButtonViewAll,
|
|
24
|
+
}: CarouselHighlightsProps = $props();
|
|
25
|
+
|
|
26
|
+
const responsive = useDevice();
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<CarouselHeader
|
|
30
|
+
{title}
|
|
31
|
+
{description}
|
|
32
|
+
{titleClass}
|
|
33
|
+
{descriptionClass}
|
|
34
|
+
{containerClass}
|
|
35
|
+
{onButtonViewAll}
|
|
36
|
+
>
|
|
37
|
+
<CarouselSlot
|
|
38
|
+
isBorderBottom={false}
|
|
39
|
+
{isButtonPreviousAndNext}
|
|
40
|
+
{buttonPreviousAndNextClass}
|
|
41
|
+
containerClass="w-full"
|
|
42
|
+
plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
|
|
43
|
+
>
|
|
44
|
+
{#if isLoading}
|
|
45
|
+
{#each Array.from( { length: responsive.isMobile ? 5 : 10 }, ) as _, i (`loading-${i}`)}
|
|
46
|
+
<Carousel.Item class="pl-2 md:basis-1/2 lg:basis-auto">
|
|
47
|
+
<CardHighlight id={i} {isLoading} {varient} />
|
|
48
|
+
</Carousel.Item>
|
|
49
|
+
{/each}
|
|
50
|
+
{:else}
|
|
51
|
+
{#each items as item (item.id)}
|
|
52
|
+
<Carousel.Item class="pl-2 md:basis-1/2 lg:basis-auto">
|
|
53
|
+
<CardHighlight
|
|
54
|
+
{...item}
|
|
55
|
+
{varient}
|
|
56
|
+
{isDescriptionIcon}
|
|
57
|
+
{isDescriptionLabel}
|
|
58
|
+
/>
|
|
59
|
+
</Carousel.Item>
|
|
60
|
+
{/each}
|
|
61
|
+
{/if}
|
|
62
|
+
</CarouselSlot>
|
|
63
|
+
</CarouselHeader>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CarouselHighlightsProps } from "
|
|
1
|
+
import type { CarouselHighlightsProps } from "../types";
|
|
2
2
|
declare const CarouselHighlights: import("svelte").Component<CarouselHighlightsProps, {}, "">;
|
|
3
3
|
type CarouselHighlights = ReturnType<typeof CarouselHighlights>;
|
|
4
4
|
export default CarouselHighlights;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CardPromotionProps } from "../../card/types";
|
|
2
|
+
import type { CarouselHeaderProps } from "../types";
|
|
3
|
+
export interface CarouselPromotionProps extends CarouselHeaderProps {
|
|
4
|
+
items: CardPromotionProps[];
|
|
5
|
+
isBorderBottom?: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
isButtonPreviousAndNext?: boolean;
|
|
8
|
+
buttonPreviousAndNextClass?: string;
|
|
9
|
+
isDescriptionIcon?: boolean;
|
|
10
|
+
isDescriptionLabel?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import CardPromotion from "../../../card/promotion/CardPromotion.svelte";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const {
|
|
11
|
-
title,
|
|
12
|
-
items,
|
|
13
|
-
description,
|
|
14
|
-
titleClass,
|
|
15
|
-
descriptionClass,
|
|
16
|
-
isButtonPreviousAndNext = true,
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CardPromotion from "../../../card/promotion/CardPromotion.svelte";
|
|
3
|
+
import CarouselSlot from "../../../panel/CarouselSlot.svelte";
|
|
4
|
+
import * as Carousel from "../../../../ui/carousel/index.js";
|
|
5
|
+
import type { CarouselPromotionProps } from "../types";
|
|
6
|
+
import CarouselHeader from "../../shared/ui/CarouselHeader.svelte";
|
|
7
|
+
import { useDevice } from "../../../../../hooks/responsive.svelte";
|
|
8
|
+
import Autoplay from "embla-carousel-autoplay";
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
title,
|
|
12
|
+
items,
|
|
13
|
+
description,
|
|
14
|
+
titleClass,
|
|
15
|
+
descriptionClass,
|
|
16
|
+
isButtonPreviousAndNext = true,
|
|
17
|
+
isLoading = false,
|
|
18
|
+
buttonPreviousAndNextClass = "",
|
|
19
|
+
containerClass = "",
|
|
20
|
+
positionButtonPreviousAndNext,
|
|
21
|
+
isDescriptionIcon,
|
|
22
|
+
isDescriptionLabel,
|
|
23
|
+
onButtonViewAll,
|
|
24
|
+
}: CarouselPromotionProps = $props();
|
|
25
|
+
|
|
26
|
+
const responsive = useDevice();
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<CarouselHeader
|
|
30
|
+
{title}
|
|
31
|
+
{description}
|
|
32
|
+
{titleClass}
|
|
33
|
+
{descriptionClass}
|
|
34
|
+
{containerClass}
|
|
35
|
+
{onButtonViewAll}
|
|
36
|
+
>
|
|
37
|
+
<CarouselSlot
|
|
38
|
+
isBorderBottom={false}
|
|
39
|
+
{isButtonPreviousAndNext}
|
|
40
|
+
{buttonPreviousAndNextClass}
|
|
41
|
+
{positionButtonPreviousAndNext}
|
|
42
|
+
containerClass="w-full"
|
|
43
|
+
plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
|
|
44
|
+
>
|
|
45
|
+
{#if isLoading}
|
|
46
|
+
{#each Array.from( { length: responsive.isMobile ? 5 : 10 }, ) as _, i (`loading-${i}`)}
|
|
47
|
+
<Carousel.Item class="pl-2 md:basis-1/2 lg:basis-1/4">
|
|
48
|
+
<CardPromotion
|
|
49
|
+
id={i}
|
|
50
|
+
{isLoading}
|
|
51
|
+
{isDescriptionIcon}
|
|
52
|
+
{isDescriptionLabel}
|
|
53
|
+
/>
|
|
54
|
+
</Carousel.Item>
|
|
55
|
+
{/each}
|
|
56
|
+
{:else}
|
|
57
|
+
{#each items as item (item.id)}
|
|
58
|
+
<Carousel.Item class="pl-2 md:basis-1/2 lg:basis-1/4">
|
|
59
|
+
<CardPromotion {...item} {isDescriptionIcon} {isDescriptionLabel} />
|
|
60
|
+
</Carousel.Item>
|
|
61
|
+
{/each}
|
|
62
|
+
{/if}
|
|
63
|
+
</CarouselSlot>
|
|
64
|
+
</CarouselHeader>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CarouselPromotionProps } from "
|
|
1
|
+
import type { CarouselPromotionProps } from "../types";
|
|
2
2
|
declare const CarouselPromotion: import("svelte").Component<CarouselPromotionProps, {}, "">;
|
|
3
3
|
type CarouselPromotion = ReturnType<typeof CarouselPromotion>;
|
|
4
4
|
export default CarouselPromotion;
|