negodesign 0.0.35 → 0.0.36
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/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 +61 -0
- package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte.d.ts +4 -0
- 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 +50 -0
- package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte.d.ts +4 -0
- 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 +47 -0
- package/dist/components/core/carousel/product/ui/CarouselProduct.svelte.d.ts +4 -0
- package/dist/components/pages/company-profile/CompanyProfile.svelte +140 -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 +68 -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 +194 -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/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 +117 -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/globals.css +244 -5
- package/dist/i18n/langs/en.d.ts +10 -0
- package/dist/i18n/langs/en.js +10 -0
- package/dist/i18n/langs/pt.d.ts +10 -0
- package/dist/i18n/langs/pt.js +10 -0
- package/dist/i18n/translations.d.ts +20 -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,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
/**
|
|
3
|
-
* Galeria de imagens do produto com miniatura selecionável.
|
|
3
|
+
* Galeria de imagens/vídeo do produto com miniatura selecionável.
|
|
4
4
|
* Quando `isLoading` é true, exibe Skeletons.
|
|
5
|
+
* Se houver um item do tipo "video", ele é priorizado (aparece primeiro).
|
|
5
6
|
* @component
|
|
6
7
|
* @example
|
|
7
8
|
* ```svelte
|
|
8
|
-
* <ProductDetailImage
|
|
9
|
+
* <ProductDetailImage files={data.gallery} className="md:col-span-2" />
|
|
9
10
|
* ```
|
|
10
11
|
*/
|
|
11
12
|
</script>
|
|
@@ -15,53 +16,83 @@
|
|
|
15
16
|
import type { ProductDetailsImage } from "../types";
|
|
16
17
|
|
|
17
18
|
let {
|
|
18
|
-
|
|
19
|
+
files,
|
|
19
20
|
className,
|
|
20
21
|
isLoading = false,
|
|
21
22
|
}: {
|
|
22
|
-
|
|
23
|
+
files: ProductDetailsImage[];
|
|
23
24
|
className?: string;
|
|
24
25
|
isLoading?: boolean;
|
|
25
26
|
} = $props();
|
|
26
27
|
|
|
28
|
+
// Vídeo primeiro, mantendo a ordem relativa do resto
|
|
29
|
+
const sortedFiles = $derived(
|
|
30
|
+
[...(files ?? [])].sort(
|
|
31
|
+
(a, b) => (a.type === "video" ? 0 : 1) - (b.type === "video" ? 0 : 1),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
27
35
|
let activeIndex = $state(0);
|
|
28
|
-
const active = $derived(
|
|
36
|
+
const active = $derived(sortedFiles[activeIndex]);
|
|
29
37
|
</script>
|
|
30
38
|
|
|
39
|
+
{#snippet media(file: ProductDetailsImage, cls: string)}
|
|
40
|
+
{#if file.type === "video"}
|
|
41
|
+
<video src={file.src} class={cls} muted playsinline></video>
|
|
42
|
+
{:else}
|
|
43
|
+
<img src={file.src} alt={file.alt ?? ""} class={cls} />
|
|
44
|
+
{/if}
|
|
45
|
+
{/snippet}
|
|
46
|
+
|
|
31
47
|
<div class="flex flex-col gap-3 {className}">
|
|
32
48
|
{#if isLoading}
|
|
33
49
|
<Skeleton class="aspect-4/3 w-full rounded-lg" />
|
|
34
50
|
<div class="flex gap-2">
|
|
35
|
-
{#each Array.from({ length: Math.min(
|
|
51
|
+
{#each Array.from({ length: Math.min(files.length || 3, 4) }) as _, i (i)}
|
|
36
52
|
<Skeleton class="h-16 w-16 rounded-md md:h-20 md:w-20" />
|
|
37
53
|
{/each}
|
|
38
54
|
</div>
|
|
39
55
|
{:else if active}
|
|
40
56
|
<div class="overflow-hidden rounded-lg border">
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
{#if active.type === "video"}
|
|
58
|
+
<!-- svelte-ignore a11y_media_has_caption -->
|
|
59
|
+
<video
|
|
60
|
+
src={active.src}
|
|
61
|
+
class="aspect-4/3 w-full object-cover"
|
|
62
|
+
controls
|
|
63
|
+
playsinline
|
|
64
|
+
></video>
|
|
65
|
+
{:else}
|
|
66
|
+
{@render media(active, "aspect-4/3 w-full object-cover")}
|
|
67
|
+
{/if}
|
|
46
68
|
</div>
|
|
47
69
|
|
|
48
|
-
{#if
|
|
70
|
+
{#if sortedFiles.length > 1}
|
|
49
71
|
<div class="flex gap-2 overflow-x-auto no-scrollbar">
|
|
50
|
-
{#each
|
|
72
|
+
{#each sortedFiles as file, i (file.src)}
|
|
51
73
|
<button
|
|
52
74
|
type="button"
|
|
53
|
-
aria-label={
|
|
75
|
+
aria-label={file.alt ?? `Item ${i + 1}`}
|
|
54
76
|
onclick={() => (activeIndex = i)}
|
|
55
|
-
class="shrink-0 overflow-hidden rounded-md border transition-opacity {i ===
|
|
77
|
+
class="relative shrink-0 overflow-hidden rounded-md border transition-opacity {i ===
|
|
56
78
|
activeIndex
|
|
57
79
|
? 'border-foreground opacity-100'
|
|
58
80
|
: 'border-muted opacity-60 hover:opacity-100'}"
|
|
59
81
|
>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
{@render media(file, "h-16 w-16 object-cover md:h-20 md:w-20")}
|
|
83
|
+
{#if file.type === "video"}
|
|
84
|
+
<span
|
|
85
|
+
class="absolute inset-0 flex items-center justify-center bg-black/30"
|
|
86
|
+
>
|
|
87
|
+
<svg
|
|
88
|
+
viewBox="0 0 24 24"
|
|
89
|
+
class="h-5 w-5 fill-white"
|
|
90
|
+
aria-hidden="true"
|
|
91
|
+
>
|
|
92
|
+
<path d="M8 5v14l11-7z" />
|
|
93
|
+
</svg>
|
|
94
|
+
</span>
|
|
95
|
+
{/if}
|
|
65
96
|
</button>
|
|
66
97
|
{/each}
|
|
67
98
|
</div>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
import CardStartPrice from "../../../core/card/
|
|
14
|
+
import CardStartPrice from "../../../core/card/promotion/CardPromotionPrice.svelte";
|
|
15
15
|
import Skeleton from "../../../ui/skeleton/skeleton.svelte";
|
|
16
16
|
|
|
17
17
|
let {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { IconSvgElement } from "@hugeicons/svelte";
|
|
2
|
+
export interface ProductDetailsFeatureProps {
|
|
3
|
+
icon?: IconSvgElement | string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Item individual do breadcrumb de navegação.
|
|
4
8
|
* Representa um nível hierárquico na navegação da página
|
|
@@ -29,6 +33,7 @@ export interface ProductDetailsImage {
|
|
|
29
33
|
src: string;
|
|
30
34
|
/** Texto alternativo para acessibilidade (recomendado). */
|
|
31
35
|
alt?: string;
|
|
36
|
+
type?: "image" | "video";
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
34
39
|
* Informações de localização do produto.
|
|
@@ -45,6 +50,8 @@ export interface ProductDetailsLocation {
|
|
|
45
50
|
* Se não for fornecido, usa um mapa padrão.
|
|
46
51
|
*/
|
|
47
52
|
mapUrl?: string;
|
|
53
|
+
latitude?: number;
|
|
54
|
+
longitude?: number;
|
|
48
55
|
}
|
|
49
56
|
/**
|
|
50
57
|
* Avaliação de um cliente sobre o produto.
|
|
@@ -117,7 +124,7 @@ export interface ProductDetailsData {
|
|
|
117
124
|
/** Quantidade disponível em stock. */
|
|
118
125
|
quantityAvailable?: number;
|
|
119
126
|
/** Lista de características/features do produto (strings). */
|
|
120
|
-
features?: string[];
|
|
127
|
+
features?: string[] | ProductDetailsFeatureProps[];
|
|
121
128
|
/**
|
|
122
129
|
* Abas de conteúdo personalizadas.
|
|
123
130
|
* Se não for fornecido, usa padrão: Descrição + Avaliações.
|
|
@@ -143,7 +150,7 @@ export interface ProductDetailsProps {
|
|
|
143
150
|
* - 4: Abas de conteúdo (descrição e avaliações) abaixo da info
|
|
144
151
|
* @default 1
|
|
145
152
|
*/
|
|
146
|
-
varient?: 1 | 2 | 3
|
|
153
|
+
varient?: 1 | 2 | 3;
|
|
147
154
|
/** Dados completos do produto a serem exibidos. */
|
|
148
155
|
data: ProductDetailsData;
|
|
149
156
|
/**
|
|
@@ -136,6 +136,13 @@ export interface ProfileUserProps {
|
|
|
136
136
|
id: string;
|
|
137
137
|
label: string;
|
|
138
138
|
}[];
|
|
139
|
+
onLoginAsUser?: (id: string | number) => void;
|
|
140
|
+
onAddAddress?: () => void;
|
|
141
|
+
onChangePassword?: (payload: {
|
|
142
|
+
currentPassword: string;
|
|
143
|
+
newPassword: string;
|
|
144
|
+
confirmPassword: string;
|
|
145
|
+
}) => void;
|
|
139
146
|
userHeader?: ProfileUserHeaderProps;
|
|
140
147
|
userAddress?: ProfileUserAddressProps;
|
|
141
148
|
userResetPassword?: ProfileUserResetPasswordProps;
|