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.
Files changed (53) hide show
  1. package/dist/components/core/banner/BannerNotification.svelte +94 -0
  2. package/dist/components/core/banner/BannerNotification.svelte.d.ts +4 -0
  3. package/dist/components/core/banner/CardAdBanner.svelte +74 -0
  4. package/dist/components/core/banner/CardAdBanner.svelte.d.ts +4 -0
  5. package/dist/components/core/banner/types.d.ts +42 -0
  6. package/dist/components/core/banner/types.js +1 -0
  7. package/dist/components/core/card/highlight/01/CardHighlight01.svelte +5 -1
  8. package/dist/components/core/card/highlight/02/CardHighlight02.svelte +5 -3
  9. package/dist/components/core/card/highlight/data.js +1 -4
  10. package/dist/components/core/card/media/01/CardMedia01.svelte +124 -98
  11. package/dist/components/core/card/media/02/CardMedia02.svelte +125 -99
  12. package/dist/components/core/card/media/CardMedia.svelte +10 -9
  13. package/dist/components/core/card/media/CardMedia.svelte.d.ts +1 -0
  14. package/dist/components/core/card/profile/01/CardProfile01.svelte +104 -86
  15. package/dist/components/core/card/profile/02/CardProfile02.svelte +103 -87
  16. package/dist/components/core/card/profile/CardProfile.svelte +8 -7
  17. package/dist/components/core/card/profile/CardProfile.svelte.d.ts +1 -0
  18. package/dist/components/core/card/promotion/CardPromotion.svelte +6 -4
  19. package/dist/components/core/card/shared/CardButton.svelte +30 -21
  20. package/dist/components/core/card/shared/CardButton.svelte.d.ts +1 -0
  21. package/dist/components/core/card/shared/CardDescription.svelte +30 -30
  22. package/dist/components/core/card/shared/CardStarRating.svelte +18 -14
  23. package/dist/components/core/card/shared/CardStarRating.svelte.d.ts +1 -0
  24. package/dist/components/core/card/shared/CardStartPrice.svelte +1 -1
  25. package/dist/components/core/card/shared/CardThumbnailVideo.svelte +207 -148
  26. package/dist/components/core/card/shared/CardThumbnailVideo.svelte.d.ts +1 -0
  27. package/dist/components/core/card/types.d.ts +2 -0
  28. package/dist/components/core/carousel/grid/media/types.d.ts +10 -0
  29. package/dist/components/core/carousel/grid/media/types.js +1 -0
  30. package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +48 -0
  31. package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte.d.ts +4 -0
  32. package/dist/components/core/carousel/grid/profile/types.d.ts +10 -0
  33. package/dist/components/core/carousel/grid/profile/types.js +1 -0
  34. package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +51 -0
  35. package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte.d.ts +4 -0
  36. package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +38 -0
  37. package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte.d.ts +10 -0
  38. package/dist/components/core/carousel/hero/CarouselHero.svelte +21 -19
  39. package/dist/components/core/carousel/hero/CarouselHero.svelte.d.ts +1 -0
  40. package/dist/components/core/carousel/highlights/types.d.ts +4 -4
  41. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +4 -22
  42. package/dist/components/core/carousel/promotion/types.d.ts +5 -5
  43. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +4 -21
  44. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +6 -1
  45. package/dist/components/core/carousel/types.d.ts +1 -0
  46. package/dist/components/core/panel/CarouselSlot.svelte +3 -14
  47. package/dist/components/core/panel/CarouselSlot.svelte.d.ts +2 -12
  48. package/dist/components/core/panel/type.d.ts +11 -0
  49. package/dist/components/core/panel/type.js +1 -0
  50. package/dist/globals.css +351 -43
  51. package/dist/index.d.ts +15 -5
  52. package/dist/index.js +15 -5
  53. package/package.json +1 -1
@@ -1,110 +1,136 @@
1
1
  <script lang="ts">
2
- /**
3
- * Card component with a title and content.
4
- * @component
5
- */
6
- import {
7
- InformationCircleIcon,
8
- UserIcon,
9
- } from "@hugeicons/core-free-icons";
10
- import { t } from "../../../../../i18n";
11
- import type { CardMediaProps } from "../../types";
12
- import CardStarRating from "../../shared/CardStarRating.svelte";
13
- import CardTags from "../../shared/CardTags.svelte";
14
- import CardDescription from "../../shared/CardDescription.svelte";
15
- import CardThumbnailVideo from "../../shared/CardThumbnailVideo.svelte";
16
- import CardButton from "../../shared/CardButton.svelte";
17
- import CardFavorite from "../../shared/CardFavorite.svelte";
18
- let {
19
- id,
20
- tags,
21
- logo,
22
- title,
23
- content,
24
- className,
25
- imageUrl,
26
- videoUrl,
27
- //videoAction,
28
- startNumber,
29
- startMax = 5,
30
- isImageButtonMaximized = false,
31
- isVideoButtonMaximized = false,
32
- isTagBorderBottom = false,
33
- isFavorite = false,
34
- buttonProfileClass,
35
- buttonDetailsClass,
36
- onFavoriteClick,
37
- onButtonProfile,
38
- onButtonDetails,
39
- }: CardMediaProps = $props();
2
+ /**
3
+ * Card component with a title and content.
4
+ * @component
5
+ */
6
+ import { InformationCircleIcon, UserIcon } from "@hugeicons/core-free-icons";
7
+ import { t } from "../../../../../i18n";
8
+ import type { CardMediaProps } from "../../types";
9
+ import CardStarRating from "../../shared/CardStarRating.svelte";
10
+ import CardTags from "../../shared/CardTags.svelte";
11
+ import CardDescription from "../../shared/CardDescription.svelte";
12
+ import CardThumbnailVideo from "../../shared/CardThumbnailVideo.svelte";
13
+ import CardButton from "../../shared/CardButton.svelte";
14
+ import CardFavorite from "../../shared/CardFavorite.svelte";
15
+ import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
16
+ import ImgPlaceholderCompany from "../../../../../assets/placeholder-company.png";
17
+ let {
18
+ id,
19
+ tags,
20
+ logo,
21
+ title,
22
+ content,
23
+ className,
24
+ imageUrl,
25
+ videoUrl,
26
+ //videoAction,
27
+ startNumber,
28
+ startMax = 5,
29
+ isImageButtonMaximized = false,
30
+ isVideoButtonMaximized = false,
31
+ isTagBorderBottom = false,
32
+ isFavorite = false,
33
+ isLoading = false,
34
+ buttonProfileClass,
35
+ buttonDetailsClass,
36
+ onFavoriteClick,
37
+ onButtonProfile,
38
+ onButtonDetails,
39
+ }: CardMediaProps = $props();
40
40
 
41
- let isShowButtonProfileAndDetails = $derived(
42
- onButtonProfile != null && onButtonDetails != null,
43
- );
41
+ let isShowButtonProfileAndDetails = $derived(
42
+ onButtonProfile != null && onButtonDetails != null,
43
+ );
44
44
  </script>
45
45
 
46
46
  <article
47
- class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg p-5 space-y-1 md:space-y-3 {className}"
47
+ class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg p-5 space-y-1 md:space-y-3 {className}"
48
48
  >
49
- <div class="flex flex-col justify-center items-center w-full relative">
50
- <div class="flex flex-col justify-start gap-2">
51
- <div class="flex justify-center items-center">
52
- {#if logo}
53
- <img src={logo} alt={logo} class="w-12 h-12 rounded-lg" />
54
- {/if}
55
- </div>
56
- <div class="flex flex-col justify-center items-center">
57
- {#if title}
58
- <div class="text-center font-bold text-lg">{title}</div>
59
- {/if}
60
- {#if startNumber}
61
- <CardStarRating {startNumber} {startMax} />
62
- {/if}
63
- </div>
64
- </div>
65
- <div class="flex justify-end items-center absolute top-0 right-0">
66
- <CardFavorite
67
- {id}
68
- {isFavorite}
69
- onFavoriteClick={() => onFavoriteClick!(id)}
70
- />
71
- </div>
72
- <CardTags className="my-4" tags={tags ?? []} {isTagBorderBottom} />
73
- </div>
49
+ <div class="flex flex-col justify-center items-center w-full relative">
50
+ <div class="flex flex-col justify-start gap-2">
51
+ <div class="flex justify-center items-center">
52
+ {#if isLoading}
53
+ <Skeleton class="w-12 h-12 rounded-lg bg-gray-300" />
54
+ {:else if logo}
55
+ <img
56
+ src={logo}
57
+ alt={logo}
58
+ class="w-12 h-12 rounded-lg"
59
+ onerror={(e) =>
60
+ ((e.target as HTMLImageElement).src = ImgPlaceholderCompany)}
61
+ />
62
+ {/if}
63
+ </div>
64
+ <div class="flex flex-col justify-center items-center">
65
+ {#if title}
66
+ <div class="text-center font-bold text-lg">{title}</div>
67
+ {:else if isLoading}
68
+ <Skeleton class="w-40 h-5 rounded-lg bg-gray-400 mb-0.5" />
69
+ {/if}
74
70
 
75
- <div class="h-15 mb-8">
76
- <CardDescription {content} />
71
+ {#if startNumber}
72
+ <CardStarRating {startNumber} {startMax} {isLoading} />
73
+ {:else if isLoading}
74
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-300 mt-0.5" />
75
+ {/if}
76
+ </div>
77
77
  </div>
78
-
79
- <CardThumbnailVideo
80
- {imageUrl}
81
- {videoUrl}
82
- {isImageButtonMaximized}
83
- {isVideoButtonMaximized}
78
+ <div class="flex justify-end items-center absolute top-0 right-0">
79
+ <CardFavorite
80
+ {id}
81
+ {isFavorite}
82
+ onFavoriteClick={() => onFavoriteClick!(id)}
83
+ {isLoading}
84
+ />
85
+ </div>
86
+ <CardTags
87
+ className="my-2"
88
+ tags={tags ?? []}
89
+ {isTagBorderBottom}
90
+ {isLoading}
84
91
  />
92
+ </div>
85
93
 
86
- {#if onButtonProfile || onButtonDetails}
87
- <div class="flex justify-center items-center gap-2 mt-4 w-full">
88
- {#if onButtonProfile}
89
- <CardButton
90
- {id}
91
- icon={UserIcon}
92
- className={buttonProfileClass}
93
- text={$t("label.view.profile")}
94
- onClick={onButtonProfile}
95
- isFlex={isShowButtonProfileAndDetails}
96
- />
97
- {/if}
98
- {#if onButtonDetails}
99
- <CardButton
100
- {id}
101
- icon={InformationCircleIcon}
102
- className={buttonDetailsClass}
103
- text={$t("label.more.details")}
104
- onClick={onButtonDetails}
105
- isFlex={isShowButtonProfileAndDetails}
106
- />
107
- {/if}
108
- </div>
109
- {/if}
94
+ <div class="h-15 mb-4">
95
+ <CardDescription {content} {isLoading} />
96
+ </div>
97
+
98
+ <CardThumbnailVideo
99
+ {imageUrl}
100
+ {videoUrl}
101
+ {isImageButtonMaximized}
102
+ {isVideoButtonMaximized}
103
+ {isLoading}
104
+ />
105
+
106
+ {#if onButtonProfile || onButtonDetails}
107
+ <div class="flex justify-center items-center gap-2 mt-4 w-full">
108
+ {#if onButtonProfile}
109
+ <CardButton
110
+ {id}
111
+ icon={UserIcon}
112
+ className={buttonProfileClass}
113
+ text={$t("label.view.profile")}
114
+ onClick={onButtonProfile}
115
+ isFlex={isShowButtonProfileAndDetails}
116
+ {isLoading}
117
+ />
118
+ {:else if isLoading}
119
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-400 mt-0.5" />
120
+ {/if}
121
+ {#if onButtonDetails}
122
+ <CardButton
123
+ {id}
124
+ icon={InformationCircleIcon}
125
+ className={buttonDetailsClass}
126
+ text={$t("label.more.details")}
127
+ onClick={onButtonDetails}
128
+ isFlex={isShowButtonProfileAndDetails}
129
+ {isLoading}
130
+ />
131
+ {:else if isLoading}
132
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-400 mt-0.5" />
133
+ {/if}
134
+ </div>
135
+ {/if}
110
136
  </article>
@@ -1,17 +1,18 @@
1
1
  <script lang="ts">
2
- import type { CardMediaProps } from "../types";
3
- import CardMedia01 from "./01/CardMedia01.svelte";
4
- import CardMedia02 from "./02/CardMedia02.svelte";
2
+ import type { CardMediaProps } from "../types";
3
+ import CardMedia01 from "./01/CardMedia01.svelte";
4
+ import CardMedia02 from "./02/CardMedia02.svelte";
5
5
 
6
- type Props = {
7
- variant?: 1 | 2;
8
- };
6
+ type Props = {
7
+ variant?: 1 | 2;
8
+ isLoading?: boolean;
9
+ };
9
10
 
10
- let { variant, ...restProps }: CardMediaProps & Props = $props();
11
+ let { variant, isLoading, ...restProps }: CardMediaProps & Props = $props();
11
12
  </script>
12
13
 
13
14
  {#if variant === 2}
14
- <CardMedia02 {...restProps} />
15
+ <CardMedia02 {...restProps} {isLoading} />
15
16
  {:else}
16
- <CardMedia01 {...restProps} />
17
+ <CardMedia01 {...restProps} {isLoading} />
17
18
  {/if}
@@ -1,6 +1,7 @@
1
1
  import type { CardMediaProps } from "../types";
2
2
  type Props = {
3
3
  variant?: 1 | 2;
4
+ isLoading?: boolean;
4
5
  };
5
6
  type $$ComponentProps = CardMediaProps & Props;
6
7
  declare const CardMedia: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1,98 +1,116 @@
1
1
  <script lang="ts">
2
- /**
3
- * Card component with a title and content.
4
- * @component
5
- */
6
- import {
7
- InformationCircleIcon,
8
- UserIcon,
9
- } from "@hugeicons/core-free-icons";
10
- import { t } from "../../../../../i18n";
11
- import type { CardProfileProps } from "../../types";
12
- import CardStarRating from "../../shared/CardStarRating.svelte";
13
- import CardDescription from "../../shared/CardDescription.svelte";
14
- import CardTags from "../../shared/CardTags.svelte";
15
- import CardButton from "../../shared/CardButton.svelte";
16
- import CardFavorite from "../../shared/CardFavorite.svelte";
2
+ /**
3
+ * Card component with a title and content.
4
+ * @component
5
+ */
6
+ import { InformationCircleIcon, UserIcon } from "@hugeicons/core-free-icons";
7
+ import { t } from "../../../../../i18n";
8
+ import type { CardProfileProps } from "../../types";
9
+ import CardStarRating from "../../shared/CardStarRating.svelte";
10
+ import CardDescription from "../../shared/CardDescription.svelte";
11
+ import CardTags from "../../shared/CardTags.svelte";
12
+ import CardButton from "../../shared/CardButton.svelte";
13
+ import CardFavorite from "../../shared/CardFavorite.svelte";
14
+ import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
17
15
 
18
- let {
19
- id,
20
- tags,
21
- logo,
22
- title,
23
- content,
24
- startNumber,
25
- startMax = 5,
26
- isTagBorderBottom = true,
27
- isFavorite = false,
28
- buttonProfileClass,
29
- buttonDetailsClass,
30
- onFavoriteClick,
31
- onButtonProfile,
32
- onButtonDetails,
33
- }: CardProfileProps = $props();
16
+ let {
17
+ id,
18
+ tags,
19
+ logo,
20
+ title,
21
+ content,
22
+ startNumber,
23
+ startMax = 5,
24
+ isTagBorderBottom = true,
25
+ isFavorite = false,
26
+ buttonProfileClass,
27
+ buttonDetailsClass,
28
+ isLoading = false,
29
+ onFavoriteClick,
30
+ onButtonProfile,
31
+ onButtonDetails,
32
+ }: CardProfileProps = $props();
34
33
 
35
- let isShowButtonProfileAndDetails = $derived(
36
- onButtonProfile != null && onButtonDetails != null,
37
- );
34
+ let isShowButtonProfileAndDetails = $derived(
35
+ onButtonProfile != null && onButtonDetails != null,
36
+ );
38
37
  </script>
39
38
 
40
39
  <article
41
- class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg p-5 space-y-1 md:space-y-3"
40
+ class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg p-5 space-y-1 md:space-y-3"
42
41
  >
43
- <div class="flex justify-between items-center w-full mb-4">
44
- <div class="flex justify-start gap-2">
45
- <div class="flex justify-center items-center">
46
- {#if logo}
47
- <img src={logo} alt={logo} class="w-12 h-12 rounded-lg" />
48
- {/if}
49
- </div>
50
- <div class="flex-col">
51
- {#if title}
52
- <div class="text-center font-bold text-lg">{title}</div>
53
- {/if}
54
- {#if startNumber}
55
- <CardStarRating {startNumber} {startMax} />
56
- {/if}
57
- </div>
58
- </div>
59
- <div class="flex justify-end items-center">
60
- <CardFavorite
61
- {id}
62
- {isFavorite}
63
- onFavoriteClick={() => onFavoriteClick!(id)}
64
- />
65
- </div>
66
- </div>
42
+ <div class="flex justify-between items-center w-full mb-4">
43
+ <div class="flex justify-start gap-2">
44
+ <div class="flex justify-center items-center">
45
+ {#if isLoading}
46
+ <Skeleton class="w-12 h-12 rounded-lg bg-gray-300" />
47
+ {:else if logo}
48
+ <img src={logo} alt={logo} class="w-12 h-12 rounded-lg" />
49
+ {/if}
50
+ </div>
51
+ <div class="flex-col">
52
+ {#if title}
53
+ <div class="text-center font-bold text-lg">{title}</div>
54
+ {:else if isLoading}
55
+ <Skeleton class="w-40 h-5 rounded-lg bg-gray-400 mb-0.5" />
56
+ {/if}
67
57
 
68
- <div class="h-15 my-2">
69
- <CardDescription {content} />
58
+ {#if startNumber}
59
+ <CardStarRating {startNumber} {startMax} {isLoading} />
60
+ {:else if isLoading}
61
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-300 mt-0.5" />
62
+ {/if}
63
+ </div>
64
+ </div>
65
+ <div class="flex justify-end items-center">
66
+ <CardFavorite
67
+ {id}
68
+ {isFavorite}
69
+ onFavoriteClick={() => onFavoriteClick!(id)}
70
+ {isLoading}
71
+ />
70
72
  </div>
73
+ </div>
71
74
 
72
- <CardTags className="my-6" tags={tags ?? []} {isTagBorderBottom} />
75
+ <div class="h-15 my-2">
76
+ <CardDescription {content} {isLoading} />
77
+ </div>
73
78
 
74
- {#if onButtonProfile || onButtonDetails}
75
- <div class="flex justify-center items-center gap-2 mt-4 w-full">
76
- {#if onButtonProfile}
77
- <CardButton
78
- {id}
79
- icon={UserIcon}
80
- className={buttonProfileClass}
81
- text={$t("label.view.profile")}
82
- onClick={onButtonProfile}
83
- isFlex={isShowButtonProfileAndDetails}
84
- />
85
- {/if}
86
- {#if onButtonDetails}
87
- <CardButton
88
- {id}
89
- icon={InformationCircleIcon}
90
- className={buttonDetailsClass}
91
- text={$t("label.more.details")}
92
- onClick={onButtonDetails}
93
- isFlex={isShowButtonProfileAndDetails}
94
- />
95
- {/if}
96
- </div>
97
- {/if}
79
+ <CardTags
80
+ className="my-6"
81
+ tags={tags ?? []}
82
+ {isTagBorderBottom}
83
+ {isLoading}
84
+ />
85
+
86
+ {#if onButtonProfile || onButtonDetails}
87
+ <div class="flex justify-center items-center gap-2 mt-4 w-full">
88
+ {#if onButtonProfile}
89
+ <CardButton
90
+ {id}
91
+ icon={UserIcon}
92
+ className={buttonProfileClass}
93
+ text={$t("label.view.profile")}
94
+ onClick={onButtonProfile}
95
+ isFlex={isShowButtonProfileAndDetails}
96
+ {isLoading}
97
+ />
98
+ {:else if isLoading}
99
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-400 mt-0.5" />
100
+ {/if}
101
+ {#if onButtonDetails}
102
+ <CardButton
103
+ {id}
104
+ icon={InformationCircleIcon}
105
+ className={buttonDetailsClass}
106
+ text={$t("label.more.details")}
107
+ onClick={onButtonDetails}
108
+ isFlex={isShowButtonProfileAndDetails}
109
+ {isLoading}
110
+ />
111
+ {:else if isLoading}
112
+ <Skeleton class="w-20 h-4 rounded-lg bg-gray-400 mt-0.5" />
113
+ {/if}
114
+ </div>
115
+ {/if}
98
116
  </article>