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.
Files changed (73) hide show
  1. package/dist/components/core/card/product/01/CardProduct01.svelte +130 -0
  2. package/dist/components/core/card/product/01/CardProduct01.svelte.d.ts +4 -0
  3. package/dist/components/core/card/product/02/CardProduct02.svelte +118 -0
  4. package/dist/components/core/card/product/02/CardProduct02.svelte.d.ts +4 -0
  5. package/dist/components/core/card/product/CardProduct.svelte +22 -0
  6. package/dist/components/core/card/product/CardProduct.svelte.d.ts +11 -0
  7. package/dist/components/core/card/product/data.d.ts +3 -0
  8. package/dist/components/core/card/product/data.js +89 -0
  9. package/dist/components/core/card/profile/01/CardProfile01.svelte +0 -1
  10. package/dist/components/core/card/promotion/CardPromotion.svelte +1 -1
  11. package/dist/components/core/card/promotion/CardPromotionPrice.svelte.d.ts +8 -0
  12. package/dist/components/core/card/shared/CardPhoneOrWhatsapp.svelte +12 -5
  13. package/dist/components/core/card/shared/CardTags.svelte +49 -24
  14. package/dist/components/core/card/shared/CardTitlePrice.svelte +24 -0
  15. package/dist/components/core/card/shared/CardTitlePrice.svelte.d.ts +15 -0
  16. package/dist/components/core/card/shared/TruncatableText.svelte +1 -1
  17. package/dist/components/core/card/types.d.ts +48 -0
  18. package/dist/components/core/carousel/grid/product/types.d.ts +22 -0
  19. package/dist/components/core/carousel/grid/product/types.js +1 -0
  20. package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte +61 -0
  21. package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte.d.ts +4 -0
  22. package/dist/components/core/carousel/grid/promotion/types.d.ts +23 -0
  23. package/dist/components/core/carousel/grid/promotion/types.js +1 -0
  24. package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte +50 -0
  25. package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte.d.ts +4 -0
  26. package/dist/components/core/carousel/product/types.d.ts +21 -0
  27. package/dist/components/core/carousel/product/types.js +1 -0
  28. package/dist/components/core/carousel/product/ui/CarouselProduct.svelte +47 -0
  29. package/dist/components/core/carousel/product/ui/CarouselProduct.svelte.d.ts +4 -0
  30. package/dist/components/pages/company-profile/CompanyProfile.svelte +140 -0
  31. package/dist/components/pages/company-profile/CompanyProfile.svelte.d.ts +4 -0
  32. package/dist/components/pages/company-profile/data.d.ts +2 -0
  33. package/dist/components/pages/company-profile/data.js +68 -0
  34. package/dist/components/pages/company-profile/shared/ProfileAboutCompany.svelte +79 -0
  35. package/dist/components/pages/company-profile/shared/ProfileAboutCompany.svelte.d.ts +9 -0
  36. package/dist/components/pages/company-profile/shared/ProfileBanner.svelte +194 -0
  37. package/dist/components/pages/company-profile/shared/ProfileBanner.svelte.d.ts +14 -0
  38. package/dist/components/pages/company-profile/shared/ProfileGallery.svelte +198 -0
  39. package/dist/components/pages/company-profile/shared/ProfileGallery.svelte.d.ts +9 -0
  40. package/dist/components/pages/company-profile/shared/ProfileMenuBadge.svelte +56 -0
  41. package/dist/components/pages/company-profile/shared/ProfileMenuBadge.svelte.d.ts +11 -0
  42. package/dist/components/pages/company-profile/shared/ProfileSidebar.svelte +57 -0
  43. package/dist/components/pages/company-profile/shared/ProfileSidebar.svelte.d.ts +11 -0
  44. package/dist/components/pages/company-profile/types.d.ts +117 -0
  45. package/dist/components/pages/company-profile/types.js +1 -0
  46. package/dist/components/pages/privacy-policy-or-terms-of-use/data.d.ts +3 -0
  47. package/dist/components/pages/privacy-policy-or-terms-of-use/data.js +179 -0
  48. package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte +2 -1
  49. package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte.d.ts +1 -0
  50. package/dist/components/pages/product-details/01/ProductDetails01.svelte +19 -7
  51. package/dist/components/pages/product-details/02/ProductDetails02.svelte +42 -37
  52. package/dist/components/pages/product-details/03/ProductDetails03.svelte +33 -29
  53. package/dist/components/pages/product-details/ProductDetails.svelte +11 -7
  54. package/dist/components/pages/product-details/shared/ProductDetailFeatures.svelte +11 -5
  55. package/dist/components/pages/product-details/shared/ProductDetailFeatures.svelte.d.ts +2 -1
  56. package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte +52 -20
  57. package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte.d.ts +1 -1
  58. package/dist/components/pages/product-details/shared/ProductDetailImage.svelte +51 -20
  59. package/dist/components/pages/product-details/shared/ProductDetailImage.svelte.d.ts +1 -1
  60. package/dist/components/pages/product-details/shared/ProductDetailPrice.svelte +1 -1
  61. package/dist/components/pages/product-details/types.d.ts +9 -2
  62. package/dist/components/pages/profile-user/types.d.ts +7 -0
  63. package/dist/globals.css +244 -5
  64. package/dist/i18n/langs/en.d.ts +10 -0
  65. package/dist/i18n/langs/en.js +10 -0
  66. package/dist/i18n/langs/pt.d.ts +10 -0
  67. package/dist/i18n/langs/pt.js +10 -0
  68. package/dist/i18n/translations.d.ts +20 -0
  69. package/package.json +1 -1
  70. package/dist/components/core/card/shared/CardStartPrice.svelte.d.ts +0 -8
  71. package/dist/components/pages/product-details/04/ProductDetails04.svelte +0 -65
  72. package/dist/components/pages/product-details/04/ProductDetails04.svelte.d.ts +0 -11
  73. /package/dist/components/core/card/{shared/CardStartPrice.svelte → promotion/CardPromotionPrice.svelte} +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { ProductDetailsImage } from "../types";
2
2
  type $$ComponentProps = {
3
- images: ProductDetailsImage[];
3
+ files: ProductDetailsImage[];
4
4
  className?: string;
5
5
  isLoading?: boolean;
6
6
  };
@@ -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 images={data.gallery} className="md:col-span-2" />
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
- images,
19
+ files,
19
20
  className,
20
21
  isLoading = false,
21
22
  }: {
22
- images: ProductDetailsImage[];
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(images[activeIndex]);
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(images.length || 3, 4) }) as _, i (i)}
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
- <img
42
- src={active.src}
43
- alt={active.alt ?? ""}
44
- class="aspect-4/3 w-full object-cover"
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 images.length > 1}
70
+ {#if sortedFiles.length > 1}
49
71
  <div class="flex gap-2 overflow-x-auto no-scrollbar">
50
- {#each images as image, i (image.src)}
72
+ {#each sortedFiles as file, i (file.src)}
51
73
  <button
52
74
  type="button"
53
- aria-label={image.alt ?? `Imagem ${i + 1}`}
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
- <img
61
- src={image.src}
62
- alt={image.alt ?? ""}
63
- class="h-16 w-16 object-cover md:h-20 md:w-20"
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>
@@ -1,6 +1,6 @@
1
1
  import type { ProductDetailsImage } from "../types";
2
2
  type $$ComponentProps = {
3
- images: ProductDetailsImage[];
3
+ files: ProductDetailsImage[];
4
4
  className?: string;
5
5
  isLoading?: boolean;
6
6
  };
@@ -11,7 +11,7 @@
11
11
  </script>
12
12
 
13
13
  <script lang="ts">
14
- import CardStartPrice from "../../../core/card/shared/CardStartPrice.svelte";
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 | 4;
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;