negodesign 0.0.35 → 0.0.37

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 (95) 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/media/ui/CarouselGridMedia.svelte +38 -28
  19. package/dist/components/core/carousel/grid/product/types.d.ts +22 -0
  20. package/dist/components/core/carousel/grid/product/types.js +1 -0
  21. package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte +71 -0
  22. package/dist/components/core/carousel/grid/product/ui/CarouselGridProduct.svelte.d.ts +4 -0
  23. package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +56 -46
  24. package/dist/components/core/carousel/grid/promotion/types.d.ts +23 -0
  25. package/dist/components/core/carousel/grid/promotion/types.js +1 -0
  26. package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte +68 -0
  27. package/dist/components/core/carousel/grid/promotion/ui/CarouselGridPromotion.svelte.d.ts +4 -0
  28. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +57 -47
  29. package/dist/components/core/carousel/product/types.d.ts +21 -0
  30. package/dist/components/core/carousel/product/types.js +1 -0
  31. package/dist/components/core/carousel/product/ui/CarouselProduct.svelte +57 -0
  32. package/dist/components/core/carousel/product/ui/CarouselProduct.svelte.d.ts +4 -0
  33. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +57 -47
  34. package/dist/components/core/panel/NotFoundEmpty.svelte +76 -0
  35. package/dist/components/core/panel/NotFoundEmpty.svelte.d.ts +16 -0
  36. package/dist/components/pages/company-profile/CompanyProfile.svelte +144 -0
  37. package/dist/components/pages/company-profile/CompanyProfile.svelte.d.ts +4 -0
  38. package/dist/components/pages/company-profile/data.d.ts +2 -0
  39. package/dist/components/pages/company-profile/data.js +115 -0
  40. package/dist/components/pages/company-profile/shared/ProfileAboutCompany.svelte +79 -0
  41. package/dist/components/pages/company-profile/shared/ProfileAboutCompany.svelte.d.ts +9 -0
  42. package/dist/components/pages/company-profile/shared/ProfileBanner.svelte +270 -0
  43. package/dist/components/pages/company-profile/shared/ProfileBanner.svelte.d.ts +14 -0
  44. package/dist/components/pages/company-profile/shared/ProfileGallery.svelte +198 -0
  45. package/dist/components/pages/company-profile/shared/ProfileGallery.svelte.d.ts +9 -0
  46. package/dist/components/pages/company-profile/shared/ProfileMenuBadge.svelte +56 -0
  47. package/dist/components/pages/company-profile/shared/ProfileMenuBadge.svelte.d.ts +11 -0
  48. package/dist/components/pages/company-profile/shared/ProfileProducts.svelte +62 -0
  49. package/dist/components/pages/company-profile/shared/ProfileProducts.svelte.d.ts +9 -0
  50. package/dist/components/pages/company-profile/shared/ProfileSidebar.svelte +57 -0
  51. package/dist/components/pages/company-profile/shared/ProfileSidebar.svelte.d.ts +11 -0
  52. package/dist/components/pages/company-profile/types.d.ts +137 -0
  53. package/dist/components/pages/company-profile/types.js +1 -0
  54. package/dist/components/pages/privacy-policy-or-terms-of-use/data.d.ts +3 -0
  55. package/dist/components/pages/privacy-policy-or-terms-of-use/data.js +179 -0
  56. package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte +2 -1
  57. package/dist/components/pages/privacy-policy-or-terms-of-use/shared/DocSectionView.svelte.d.ts +1 -0
  58. package/dist/components/pages/product-details/01/ProductDetails01.svelte +19 -7
  59. package/dist/components/pages/product-details/02/ProductDetails02.svelte +42 -37
  60. package/dist/components/pages/product-details/03/ProductDetails03.svelte +33 -29
  61. package/dist/components/pages/product-details/ProductDetails.svelte +11 -7
  62. package/dist/components/pages/product-details/shared/ProductDetailFeatures.svelte +11 -5
  63. package/dist/components/pages/product-details/shared/ProductDetailFeatures.svelte.d.ts +2 -1
  64. package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte +52 -20
  65. package/dist/components/pages/product-details/shared/ProductDetailFilesVertical.svelte.d.ts +1 -1
  66. package/dist/components/pages/product-details/shared/ProductDetailImage.svelte +51 -20
  67. package/dist/components/pages/product-details/shared/ProductDetailImage.svelte.d.ts +1 -1
  68. package/dist/components/pages/product-details/shared/ProductDetailPrice.svelte +1 -1
  69. package/dist/components/pages/product-details/types.d.ts +9 -2
  70. package/dist/components/pages/profile-user/types.d.ts +7 -0
  71. package/dist/components/ui/empty/empty-content.svelte +23 -0
  72. package/dist/components/ui/empty/empty-content.svelte.d.ts +5 -0
  73. package/dist/components/ui/empty/empty-description.svelte +23 -0
  74. package/dist/components/ui/empty/empty-description.svelte.d.ts +5 -0
  75. package/dist/components/ui/empty/empty-header.svelte +20 -0
  76. package/dist/components/ui/empty/empty-header.svelte.d.ts +5 -0
  77. package/dist/components/ui/empty/empty-media.svelte +41 -0
  78. package/dist/components/ui/empty/empty-media.svelte.d.ts +26 -0
  79. package/dist/components/ui/empty/empty-title.svelte +20 -0
  80. package/dist/components/ui/empty/empty-title.svelte.d.ts +5 -0
  81. package/dist/components/ui/empty/empty.svelte +23 -0
  82. package/dist/components/ui/empty/empty.svelte.d.ts +5 -0
  83. package/dist/components/ui/empty/index.d.ts +7 -0
  84. package/dist/components/ui/empty/index.js +9 -0
  85. package/dist/globals.css +301 -5
  86. package/dist/i18n/langs/en.d.ts +25 -0
  87. package/dist/i18n/langs/en.js +25 -0
  88. package/dist/i18n/langs/pt.d.ts +25 -0
  89. package/dist/i18n/langs/pt.js +25 -0
  90. package/dist/i18n/translations.d.ts +50 -0
  91. package/package.json +1 -1
  92. package/dist/components/core/card/shared/CardStartPrice.svelte.d.ts +0 -8
  93. package/dist/components/pages/product-details/04/ProductDetails04.svelte +0 -65
  94. package/dist/components/pages/product-details/04/ProductDetails04.svelte.d.ts +0 -11
  95. /package/dist/components/core/card/{shared/CardStartPrice.svelte → promotion/CardPromotionPrice.svelte} +0 -0
@@ -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
- <CarouselGridSlot {slotProps} {gridClass} totalItems={items.length}>
23
- {#if isLoading}
24
- {#each Array.from( { length: responsive.isMobile ? 3 : 6 }, ) as _, i (`loading-${i}`)}
25
- {#if responsive.isMobile}
26
- <Carousel.Item class="pl-2 basis-auto">
27
- <CardMedia id={i} {variant} isLoading />
28
- </Carousel.Item>
29
- {:else}
30
- <div>
31
- <CardMedia id={i} {variant} isLoading />
32
- </div>
33
- {/if}
34
- {/each}
35
- {:else}
36
- {#each items as item, i (`media-${item.id ?? i}`)}
37
- {#if responsive.isMobile}
38
- <Carousel.Item class="pl-2 basis-auto">
39
- <CardMedia {...item} {variant} />
40
- </Carousel.Item>
41
- {:else}
42
- <div>
43
- <CardMedia {...item} {variant} />
44
- </div>
45
- {/if}
46
- {/each}
47
- {/if}
48
- </CarouselGridSlot>
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>
@@ -0,0 +1,22 @@
1
+ import type { CardProductProps } from "../../../card/types";
2
+ import type { CarouselSlotProps } from "../../../panel/type";
3
+ import type { CarouselHeaderProps } from "../../types";
4
+ /**
5
+ * Props do CarouselGridProduct — layout em grid de cards de product
6
+ */
7
+ export interface CarouselGridProductProps {
8
+ /** Props do cabeçalho do carousel (título, descrição, etc.) */
9
+ headerProps?: CarouselHeaderProps;
10
+ /** Props do slot/container do carousel (botões navegação, plugins) */
11
+ slotProps?: CarouselSlotProps;
12
+ /** Classe CSS adicional para o container do grid */
13
+ gridClass?: string;
14
+ /** Variante visual do card: 1 ou 2 */
15
+ variant?: 1 | 2;
16
+ /** Lista de perfis para exibir nos cards */
17
+ items: CardProductProps[];
18
+ /** Estado de carregamento (skeleton) */
19
+ isLoading?: boolean;
20
+ isDescriptionIcon?: boolean;
21
+ isDescriptionLabel?: boolean;
22
+ }
@@ -0,0 +1,71 @@
1
+ <script lang="ts">
2
+ import CarouselGridSlot from "../../shared/ui/CarouselGridSlot.svelte";
3
+ import CarouselHeader from "../../../shared/ui/CarouselHeader.svelte";
4
+ import NotFoundEmpty from "../../../../panel/NotFoundEmpty.svelte";
5
+ import * as Carousel from "../../../../../ui/carousel/index.js";
6
+ import { useDevice } from "../../../../../../hooks/responsive.svelte";
7
+ import { t } from "../../../../../../i18n";
8
+ import CardProduct from "../../../../card/product/CardProduct.svelte";
9
+ import type { CarouselGridProductProps } from "../types";
10
+
11
+ const {
12
+ headerProps,
13
+ slotProps,
14
+ gridClass = "lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6",
15
+ items,
16
+ variant,
17
+ isLoading = false,
18
+ isDescriptionIcon = false,
19
+ isDescriptionLabel = false,
20
+ }: CarouselGridProductProps = $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.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}
71
+ </CarouselHeader>
@@ -0,0 +1,4 @@
1
+ import type { CarouselGridProductProps } from "../types";
2
+ declare const CarouselGridProduct: import("svelte").Component<CarouselGridProductProps, {}, "">;
3
+ type CarouselGridProduct = ReturnType<typeof CarouselGridProduct>;
4
+ export default CarouselGridProduct;
@@ -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
- <CarouselGridSlot {slotProps} {gridClass} totalItems={items.length}>
29
- {#if isLoading}
30
- {#each Array.from( { length: responsive.isMobile ? 3 : 6 }, ) as _, i (`loading-${i}`)}
31
- {#if responsive.isMobile}
32
- <Carousel.Item class="pl-2 basis-auto">
33
- <CardProfile id={i} {variant} isLoading />
34
- </Carousel.Item>
35
- {:else}
36
- <div>
37
- <CardProfile id={i} {variant} isLoading />
38
- </div>
39
- {/if}
40
- {/each}
41
- {:else}
42
- {#each items as item, i (`profile-${item.id ?? i}`)}
43
- {#if responsive.isMobile}
44
- <Carousel.Item class="pl-2 basis-auto">
45
- <CardProfile
46
- {...item}
47
- {variant}
48
- {isDescriptionIcon}
49
- {isDescriptionLabel}
50
- {onEmailClick}
51
- {onWhatsappClick}
52
- {onButtonProfile}
53
- {onFavoriteClick}
54
- />
55
- </Carousel.Item>
56
- {:else}
57
- <div>
58
- <CardProfile
59
- {...item}
60
- {variant}
61
- {isDescriptionIcon}
62
- {isDescriptionLabel}
63
- {onEmailClick}
64
- {onWhatsappClick}
65
- {onButtonProfile}
66
- {onFavoriteClick}
67
- />
68
- </div>
69
- {/if}
70
- {/each}
71
- {/if}
72
- </CarouselGridSlot>
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>
@@ -0,0 +1,23 @@
1
+ import type { CardPromotionProps } from "../../../card/types";
2
+ import type { CarouselSlotProps } from "../../../panel/type";
3
+ import type { CarouselHeaderProps } from "../../types";
4
+ /**
5
+ * Props do CarouselGridProfile — layout em grid de cards de perfil
6
+ * (guias, intérpretes, organizações). Em mobile vira carousel com swipe.
7
+ */
8
+ export interface CarouselGridPromotionProps {
9
+ /** Props do cabeçalho do carousel (título, descrição, etc.) */
10
+ headerProps?: CarouselHeaderProps;
11
+ /** Props do slot/container do carousel (botões navegação, plugins) */
12
+ slotProps?: CarouselSlotProps;
13
+ /** Classe CSS adicional para o container do grid */
14
+ gridClass?: string;
15
+ /** Variante visual do card: 1 ou 2 */
16
+ variant?: 1 | 2;
17
+ /** Lista de perfis para exibir nos cards */
18
+ items: CardPromotionProps[];
19
+ /** Estado de carregamento (skeleton) */
20
+ isLoading?: boolean;
21
+ isDescriptionIcon?: boolean;
22
+ isDescriptionLabel?: boolean;
23
+ }
@@ -0,0 +1,68 @@
1
+ <script lang="ts">
2
+ import CarouselGridSlot from "../../shared/ui/CarouselGridSlot.svelte";
3
+ import CarouselHeader from "../../../shared/ui/CarouselHeader.svelte";
4
+ import NotFoundEmpty from "../../../../panel/NotFoundEmpty.svelte";
5
+ import * as Carousel from "../../../../../ui/carousel/index.js";
6
+ import { useDevice } from "../../../../../../hooks/responsive.svelte";
7
+ import { t } from "../../../../../../i18n";
8
+ import CardPromotion from "../../../../card/promotion/CardPromotion.svelte";
9
+ import type { CarouselGridPromotionProps } from "../types";
10
+
11
+ const {
12
+ headerProps,
13
+ slotProps,
14
+ gridClass = "lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5",
15
+ items,
16
+ isLoading = false,
17
+ isDescriptionIcon = false,
18
+ isDescriptionLabel = false,
19
+ }: CarouselGridPromotionProps = $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.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}
68
+ </CarouselHeader>
@@ -0,0 +1,4 @@
1
+ import type { CarouselGridPromotionProps } from "../types";
2
+ declare const CarouselGridPromotion: import("svelte").Component<CarouselGridPromotionProps, {}, "">;
3
+ type CarouselGridPromotion = ReturnType<typeof CarouselGridPromotion>;
4
+ export default CarouselGridPromotion;
@@ -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 * 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
- headerProps,
12
- slotProps,
13
- items,
14
- isLoading = false,
15
- varient = 1,
16
- isDescriptionIcon,
17
- isDescriptionLabel,
18
- }: CarouselHighlightsProps = $props();
19
-
20
- const responsive = useDevice();
21
- </script>
22
-
23
- <CarouselHeader {...headerProps}>
24
- <CarouselSlot
25
- {...slotProps}
26
- plugins={[Autoplay({ delay: 4000, stopOnInteraction: true })]}
27
- >
28
- {#if isLoading}
29
- {#each Array.from( { length: responsive.isMobile ? 5 : 10 }, ) as _, i (`loading-${i}`)}
30
- <Carousel.Item class="pl-2 basis-auto">
31
- <CardHighlight id={i} {isLoading} {varient} />
32
- </Carousel.Item>
33
- {/each}
34
- {:else}
35
- {#each items as item, i (`highlight-${item.id ?? i}`)}
36
- <Carousel.Item class="pl-2 basis-auto">
37
- <CardHighlight
38
- {...item}
39
- {varient}
40
- {isDescriptionIcon}
41
- {isDescriptionLabel}
42
- />
43
- </Carousel.Item>
44
- {/each}
45
- {/if}
46
- </CarouselSlot>
47
- </CarouselHeader>
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>
@@ -0,0 +1,21 @@
1
+ import type { CardProductProps } from "../../card/types";
2
+ import type { CarouselSlotProps } from "../../panel/type";
3
+ import type { CarouselHeaderProps } from "../types";
4
+ /**
5
+ * Props do CarouselProduct — carousel de cards de produto
6
+ * com preços antigo/novo e botões de compra.
7
+ */
8
+ export interface CarouselProductProps {
9
+ /** Props do cabeçalho do carousel (título, descrição, etc.) */
10
+ headerProps?: CarouselHeaderProps;
11
+ /** Props do slot/container do carousel (botões navegação, plugins) */
12
+ slotProps?: CarouselSlotProps;
13
+ /** Lista de promoções para exibir */
14
+ items: CardProductProps[];
15
+ /** Exibe ícone antes da descrição do card */
16
+ isDescriptionIcon?: boolean;
17
+ /** Exibe etiqueta (label) na descrição do card */
18
+ isDescriptionLabel?: boolean;
19
+ /** Estado de carregamento (skeleton) */
20
+ isLoading?: boolean;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,57 @@
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>
@@ -0,0 +1,4 @@
1
+ import type { CarouselProductProps } from "../types";
2
+ declare const CarouselProduct: import("svelte").Component<CarouselProductProps, {}, "">;
3
+ type CarouselProduct = ReturnType<typeof CarouselProduct>;
4
+ export default CarouselProduct;