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.
Files changed (139) hide show
  1. package/dist/assets/start.png +0 -0
  2. package/dist/components/core/breadcrumb/breadcrumb-list.svelte +31 -31
  3. package/dist/components/core/button/ButtonBack.svelte +18 -18
  4. package/dist/components/core/button/ButtonLogin.svelte +15 -15
  5. package/dist/components/core/button/ButtonLoginWith.svelte +57 -57
  6. package/dist/components/core/button/ButtonSend.svelte +15 -15
  7. package/dist/components/core/card/highlight/01/CardHighlight01.svelte +91 -0
  8. package/dist/components/core/card/highlight/01/CardHighlight01.svelte.d.ts +8 -0
  9. package/dist/components/core/card/highlight/02/CardHighlight02.svelte +93 -0
  10. package/dist/components/core/card/highlight/02/CardHighlight02.svelte.d.ts +8 -0
  11. package/dist/components/core/card/highlight/CardHighlight.svelte +22 -44
  12. package/dist/components/core/card/highlight/CardHighlight.svelte.d.ts +5 -2
  13. package/dist/components/core/card/highlight/data.js +32 -1
  14. package/dist/components/core/card/media/01/CardMedia01.svelte +111 -114
  15. package/dist/components/core/card/media/02/CardMedia02.svelte +110 -113
  16. package/dist/components/core/card/media/CardMedia.svelte +17 -17
  17. package/dist/components/core/card/profile/01/CardProfile01.svelte +98 -101
  18. package/dist/components/core/card/profile/02/CardProfile02.svelte +98 -97
  19. package/dist/components/core/card/profile/CardProfile.svelte +17 -17
  20. package/dist/components/core/card/promotion/CardPromotion.svelte +112 -81
  21. package/dist/components/core/card/promotion/data.js +31 -0
  22. package/dist/components/core/card/shared/CardButton.svelte +30 -30
  23. package/dist/components/core/card/shared/CardCart.svelte +36 -32
  24. package/dist/components/core/card/shared/CardCart.svelte.d.ts +1 -0
  25. package/dist/components/core/card/shared/CardDescription.svelte +38 -23
  26. package/dist/components/core/card/shared/CardDescription.svelte.d.ts +3 -0
  27. package/dist/components/core/card/shared/CardFavorite.svelte +33 -29
  28. package/dist/components/core/card/shared/CardFavorite.svelte.d.ts +1 -0
  29. package/dist/components/core/card/shared/CardStarRating.svelte +20 -20
  30. package/dist/components/core/card/shared/CardStartPrice.svelte +34 -0
  31. package/dist/components/core/card/shared/CardStartPrice.svelte.d.ts +8 -0
  32. package/dist/components/core/card/shared/CardTags.svelte +73 -56
  33. package/dist/components/core/card/shared/CardTags.svelte.d.ts +2 -1
  34. package/dist/components/core/card/shared/CardThumbnailVideo.svelte +169 -169
  35. package/dist/components/core/card/shared/TruncatableText.svelte +55 -55
  36. package/dist/components/core/card/types.d.ts +13 -0
  37. package/dist/components/core/carousel/{shared/ui/SimpleBadgeCarousel.svelte → badge/ui/CarouselBadge.svelte} +83 -80
  38. package/dist/components/core/carousel/badge/ui/CarouselBadge.svelte.d.ts +4 -0
  39. package/dist/components/core/carousel/hero/CarouselHero.svelte +158 -158
  40. package/dist/components/core/carousel/highlights/types.d.ts +12 -0
  41. package/dist/components/core/carousel/highlights/types.js +1 -0
  42. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte +63 -65
  43. package/dist/components/core/carousel/highlights/ui/CarouselHighlights.svelte.d.ts +1 -1
  44. package/dist/components/core/carousel/promotion/types.d.ts +11 -0
  45. package/dist/components/core/carousel/promotion/types.js +1 -0
  46. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte +64 -65
  47. package/dist/components/core/carousel/promotion/ui/CarouselPromotion.svelte.d.ts +1 -1
  48. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +55 -0
  49. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte.d.ts +9 -0
  50. package/dist/components/core/carousel/types.d.ts +10 -26
  51. package/dist/components/core/datatable/ui/DataTableActions.svelte +28 -28
  52. package/dist/components/core/datatable/ui/DataTableCheckbox.svelte +22 -22
  53. package/dist/components/core/datatable/ui/DataTableContent.svelte +59 -59
  54. package/dist/components/core/datatable/ui/DataTableCore.svelte +151 -151
  55. package/dist/components/core/datatable/ui/DataTableDragHandle.svelte +8 -8
  56. package/dist/components/core/datatable/ui/DataTableListFilter.svelte +59 -59
  57. package/dist/components/core/datatable/ui/DataTableListPagination.svelte +35 -35
  58. package/dist/components/core/form/ui/input-base.svelte +81 -81
  59. package/dist/components/core/form/ui/input-email-or-phone.svelte +23 -23
  60. package/dist/components/core/form/ui/input-email.svelte +23 -23
  61. package/dist/components/core/form/ui/input-password-confirm.svelte +23 -23
  62. package/dist/components/core/form/ui/input-password.svelte +23 -23
  63. package/dist/components/core/form/ui/input-phone.svelte +33 -33
  64. package/dist/components/core/form/ui/input-username.svelte +22 -22
  65. package/dist/components/core/hero/SimpleHero.svelte +65 -65
  66. package/dist/components/core/label/LabelOr.svelte +25 -25
  67. package/dist/components/core/link/link-forget-password.svelte +12 -12
  68. package/dist/components/core/link/link-privacy-polity.svelte +12 -12
  69. package/dist/components/core/link/link-terms-of-service.svelte +12 -12
  70. package/dist/components/core/nav/ui/menu-links.svelte +27 -27
  71. package/dist/components/core/nav/ui/mobile/nav-menu-drawer.svelte +85 -85
  72. package/dist/components/core/nav/ui/nav-menu-bottom-sidebar.svelte +33 -33
  73. package/dist/components/core/nav/ui/nav-menu-sidebar.svelte +97 -97
  74. package/dist/components/core/nav/ui/nav-menu-top-bar-sidebar.svelte +103 -103
  75. package/dist/components/core/nav/ui/nav-menu.svelte +106 -106
  76. package/dist/components/core/panel/CarouselSlot.svelte +63 -38
  77. package/dist/components/core/panel/CarouselSlot.svelte.d.ts +5 -2
  78. package/dist/components/core/panel/LeftHero.svelte +116 -116
  79. package/dist/components/core/search/SearchInput.svelte +32 -32
  80. package/dist/components/core/search/shared/SearchInputCore.svelte +66 -66
  81. package/dist/components/core/sidebar/MenuBarSidebar.svelte +70 -70
  82. package/dist/components/core/tabs/ui/tab-underline.svelte +43 -43
  83. package/dist/components/pages/admin/01/ui/AdminContent.svelte +14 -14
  84. package/dist/components/pages/admin/01/ui/AdminPanel.svelte +46 -46
  85. package/dist/components/pages/security/login/01/ui/FormRegister.svelte +28 -28
  86. package/dist/components/pages/security/login/01/ui/LoginCard.svelte +107 -107
  87. package/dist/components/pages/security/login/PageLogin.svelte +22 -22
  88. package/dist/components/ui/badge/badge.svelte +49 -49
  89. package/dist/components/ui/button/button.svelte +82 -82
  90. package/dist/components/ui/chart/chart-container.svelte +80 -80
  91. package/dist/components/ui/chart/chart-style.svelte +37 -37
  92. package/dist/components/ui/chart/chart-tooltip.svelte +184 -184
  93. package/dist/components/ui/checkbox/checkbox.svelte +40 -40
  94. package/dist/components/ui/data-table/flex-render.svelte +40 -40
  95. package/dist/components/ui/drawer/drawer-close.svelte +7 -7
  96. package/dist/components/ui/drawer/drawer-content.svelte +33 -33
  97. package/dist/components/ui/drawer/drawer-description.svelte +17 -17
  98. package/dist/components/ui/drawer/drawer-footer.svelte +20 -20
  99. package/dist/components/ui/drawer/drawer-header.svelte +20 -20
  100. package/dist/components/ui/drawer/drawer-nested.svelte +12 -12
  101. package/dist/components/ui/drawer/drawer-overlay.svelte +17 -17
  102. package/dist/components/ui/drawer/drawer-portal.svelte +7 -7
  103. package/dist/components/ui/drawer/drawer-title.svelte +17 -17
  104. package/dist/components/ui/drawer/drawer-trigger.svelte +7 -7
  105. package/dist/components/ui/drawer/drawer.svelte +12 -12
  106. package/dist/components/ui/select/select-content.svelte +45 -45
  107. package/dist/components/ui/select/select-group-heading.svelte +21 -21
  108. package/dist/components/ui/select/select-group.svelte +17 -17
  109. package/dist/components/ui/select/select-item.svelte +41 -41
  110. package/dist/components/ui/select/select-label.svelte +20 -20
  111. package/dist/components/ui/select/select-portal.svelte +7 -7
  112. package/dist/components/ui/select/select-scroll-down-button.svelte +21 -21
  113. package/dist/components/ui/select/select-scroll-up-button.svelte +21 -21
  114. package/dist/components/ui/select/select-separator.svelte +18 -18
  115. package/dist/components/ui/select/select-trigger.svelte +30 -30
  116. package/dist/components/ui/select/select.svelte +11 -11
  117. package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
  118. package/dist/components/ui/star-rating/star-rating-star.svelte +41 -41
  119. package/dist/components/ui/star-rating/star-rating.svelte +20 -20
  120. package/dist/components/ui/table/table-body.svelte +15 -15
  121. package/dist/components/ui/table/table-caption.svelte +20 -20
  122. package/dist/components/ui/table/table-cell.svelte +15 -15
  123. package/dist/components/ui/table/table-footer.svelte +20 -20
  124. package/dist/components/ui/table/table-head.svelte +15 -15
  125. package/dist/components/ui/table/table-header.svelte +20 -20
  126. package/dist/components/ui/table/table-row.svelte +15 -15
  127. package/dist/components/ui/table/table.svelte +17 -17
  128. package/dist/components/ui/tabs/tabs-content.svelte +17 -17
  129. package/dist/components/ui/tabs/tabs-list.svelte +40 -40
  130. package/dist/components/ui/tabs/tabs-trigger.svelte +23 -23
  131. package/dist/components/ui/tabs/tabs.svelte +19 -19
  132. package/dist/globals.css +143 -15
  133. package/dist/hooks/responsive.svelte.d.ts +1 -1
  134. package/dist/hooks/responsive.svelte.js +1 -1
  135. package/dist/index.d.ts +2 -2
  136. package/dist/index.js +2 -2
  137. package/dist/styles/globals.css +149 -149
  138. package/package.json +113 -113
  139. package/dist/components/core/carousel/shared/ui/SimpleBadgeCarousel.svelte.d.ts +0 -4
@@ -1,101 +1,98 @@
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";
17
-
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();
34
-
35
- let isShowButtonProfileAndDetails = $derived(
36
- onButtonProfile != null && onButtonDetails != null,
37
- );
38
- </script>
39
-
40
- <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"
42
- >
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={startNumber} startMax={startMax} />
56
- {/if}
57
- </div>
58
- </div>
59
- <div class="flex justify-end items-center">
60
- <CardFavorite
61
- isFavorite={isFavorite}
62
- onFavoriteClick={() => onFavoriteClick!(id)}
63
- />
64
- </div>
65
- </div>
66
-
67
- <div class="h-15 my-2">
68
- <CardDescription content={content}/>
69
- </div>
70
-
71
- <CardTags
72
- className="my-6"
73
- tags={tags ?? []}
74
- isTagBorderBottom={isTagBorderBottom}
75
- />
76
-
77
- {#if onButtonProfile || onButtonDetails}
78
- <div class="flex justify-center items-center gap-2 mt-4 w-full">
79
- {#if onButtonProfile}
80
- <CardButton
81
- id={id}
82
- icon={UserIcon}
83
- className={buttonProfileClass}
84
- text={$t("label.view.profile")}
85
- onClick={onButtonProfile}
86
- isFlex={isShowButtonProfileAndDetails}
87
- />
88
- {/if}
89
- {#if onButtonDetails}
90
- <CardButton
91
- id={id}
92
- icon={InformationCircleIcon}
93
- className={buttonDetailsClass}
94
- text={$t("label.more.details")}
95
- onClick={onButtonDetails}
96
- isFlex={isShowButtonProfileAndDetails}
97
- />
98
- {/if}
99
- </div>
100
- {/if}
101
- </article>
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";
17
+
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();
34
+
35
+ let isShowButtonProfileAndDetails = $derived(
36
+ onButtonProfile != null && onButtonDetails != null,
37
+ );
38
+ </script>
39
+
40
+ <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"
42
+ >
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>
67
+
68
+ <div class="h-15 my-2">
69
+ <CardDescription {content} />
70
+ </div>
71
+
72
+ <CardTags className="my-6" tags={tags ?? []} {isTagBorderBottom} />
73
+
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}
98
+ </article>
@@ -1,97 +1,98 @@
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 CardTags from "../../shared/CardTags.svelte";
14
- import CardDescription from "../../shared/CardDescription.svelte";
15
- import CardButton from "../../shared/CardButton.svelte";
16
- import CardFavorite from "../../shared/CardFavorite.svelte";
17
- let {
18
- id,
19
- tags,
20
- logo,
21
- title,
22
- content,
23
- className,
24
- startNumber,
25
- startMax = 5,
26
- isTagBorderBottom = true,
27
- isFavorite = false,
28
- buttonProfileClass,
29
- buttonDetailsClass,
30
- onFavoriteClick,
31
- onButtonProfile,
32
- onButtonDetails,
33
- }: CardProfileProps = $props();
34
-
35
- let isShowButtonProfileAndDetails = $derived(
36
- onButtonProfile != null && onButtonDetails != null,
37
- );
38
- </script>
39
-
40
- <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 {className}"
42
- >
43
- <div class="flex flex-col justify-center items-center w-full relative">
44
- <div class="flex flex-col 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 flex-col justify-center items-center">
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 absolute top-0 right-0">
60
- <CardFavorite
61
- {isFavorite}
62
- onFavoriteClick={() => onFavoriteClick!(id)}
63
- />
64
- </div>
65
- </div>
66
-
67
- <div class="h-15 mb-8">
68
- <CardDescription {content} />
69
- </div>
70
-
71
- <CardTags className="my-4" tags={tags ?? []} {isTagBorderBottom}/>
72
-
73
- {#if onButtonProfile || onButtonDetails}
74
- <div class="flex justify-center items-center gap-2 mt-4 w-full">
75
- {#if onButtonProfile}
76
- <CardButton
77
- {id}
78
- icon={UserIcon}
79
- className={buttonProfileClass}
80
- text={$t("label.view.profile")}
81
- onClick={onButtonProfile}
82
- isFlex={isShowButtonProfileAndDetails}
83
- />
84
- {/if}
85
- {#if onButtonDetails}
86
- <CardButton
87
- {id}
88
- icon={InformationCircleIcon}
89
- className={buttonDetailsClass}
90
- text={$t("label.more.details")}
91
- onClick={onButtonDetails}
92
- isFlex={isShowButtonProfileAndDetails}
93
- />
94
- {/if}
95
- </div>
96
- {/if}
97
- </article>
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 CardTags from "../../shared/CardTags.svelte";
14
+ import CardDescription from "../../shared/CardDescription.svelte";
15
+ import CardButton from "../../shared/CardButton.svelte";
16
+ import CardFavorite from "../../shared/CardFavorite.svelte";
17
+ let {
18
+ id,
19
+ tags,
20
+ logo,
21
+ title,
22
+ content,
23
+ className,
24
+ startNumber,
25
+ startMax = 5,
26
+ isTagBorderBottom = true,
27
+ isFavorite = false,
28
+ buttonProfileClass,
29
+ buttonDetailsClass,
30
+ onFavoriteClick,
31
+ onButtonProfile,
32
+ onButtonDetails,
33
+ }: CardProfileProps = $props();
34
+
35
+ let isShowButtonProfileAndDetails = $derived(
36
+ onButtonProfile != null && onButtonDetails != null,
37
+ );
38
+ </script>
39
+
40
+ <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 {className}"
42
+ >
43
+ <div class="flex flex-col justify-center items-center w-full relative">
44
+ <div class="flex flex-col 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 flex-col justify-center items-center">
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 absolute top-0 right-0">
60
+ <CardFavorite
61
+ {id}
62
+ {isFavorite}
63
+ onFavoriteClick={() => onFavoriteClick!(id)}
64
+ />
65
+ </div>
66
+ </div>
67
+
68
+ <div class="h-15 mb-8">
69
+ <CardDescription {content} />
70
+ </div>
71
+
72
+ <CardTags className="my-4" tags={tags ?? []} {isTagBorderBottom} />
73
+
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}
98
+ </article>
@@ -1,17 +1,17 @@
1
- <script lang="ts">
2
- import type { CardProfileProps } from "../types";
3
- import CardProfile01 from "./01/CardProfile01.svelte";
4
- import CardProfile02 from "./02/CardProfile02.svelte";
5
-
6
- type Props = {
7
- variant?: 1 | 2;
8
- };
9
-
10
- let { variant, ...restProps }: CardProfileProps & Props = $props();
11
- </script>
12
-
13
- {#if variant === 2}
14
- <CardProfile02 {...restProps} />
15
- {:else}
16
- <CardProfile01 {...restProps} />
17
- {/if}
1
+ <script lang="ts">
2
+ import type { CardProfileProps } from "../types";
3
+ import CardProfile01 from "./01/CardProfile01.svelte";
4
+ import CardProfile02 from "./02/CardProfile02.svelte";
5
+
6
+ type Props = {
7
+ variant?: 1 | 2;
8
+ };
9
+
10
+ let { variant, ...restProps }: CardProfileProps & Props = $props();
11
+ </script>
12
+
13
+ {#if variant === 2}
14
+ <CardProfile02 {...restProps} />
15
+ {:else}
16
+ <CardProfile01 {...restProps} />
17
+ {/if}
@@ -1,81 +1,112 @@
1
- <script lang="ts">
2
- import Button from "../../../ui/button/button.svelte";
3
- import { t } from "../../../../i18n";
4
- import CardCart from "../shared/CardCart.svelte";
5
- import CardFavorite from "../shared/CardFavorite.svelte";
6
- /**
7
- * Card component with a title and content.
8
- * @component
9
- */
10
- import type { CardPromotionProps } from "../types";
11
-
12
- let {
13
- id,
14
- logo,
15
- imageUrl,
16
- title,
17
- isFavorite = false,
18
- isCart = false,
19
- newPrice,
20
- oldPrice,
21
- buttonBuyText,
22
- onClickBuy,
23
- onClickShop,
24
- onClickFavorite,
25
- }: CardPromotionProps = $props();
26
- </script>
27
-
28
- <article class="relative rounded-sm bg-background">
29
- <div class="relative w-full p-2">
30
- {#if logo}
31
- <div class="absolute top-1 left-1 z-2 hidden gap-1 p-2">
32
- <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
33
- </div>
34
- {/if}
35
-
36
- <div class="absolute top-1 right-1 z-2 flex items-center gap-1 p-2">
37
- <CardFavorite {id} {isFavorite} onFavoriteClick={onClickFavorite} />
38
- <CardCart {id} {isCart} onCartClick={onClickShop} />
39
- </div>
40
-
41
- {#if imageUrl}
42
- <img
43
- src={imageUrl}
44
- alt={imageUrl}
45
- class="rounded-lg md:h-37.5 md:w-37.5 lg:h-50 lg:w-50 object-cover object-center"
46
- />
47
- {/if}
48
- <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
49
-
50
- {#if newPrice || oldPrice}
51
- <div class="absolute bottom-2 right-3 z-2 flex items-center gap-2 mb-1">
52
- {#if oldPrice}
53
- <div
54
- class="text-[10px] md:text-sm line-through bg-red-500 text-white p-1 rounded-sm"
55
- >
56
- {oldPrice}
57
- </div>
58
- {/if}
59
- {#if newPrice}
60
- <div class="font-bold text-lg md:text-xl lg:text-2xl relative">
61
- {newPrice}
62
- </div>
63
- {/if}
64
- </div>
65
- {/if}
66
- </div>
67
- <div
68
- class="bottom-1 inset-x-0 flex flex-col items-center justify-center gap-0.5 m-auto max-w-11/12 p-1 rounded-md"
69
- >
70
- <div class="flex justify-between w-full items-center">
71
- {#if title}
72
- <div class="font-semibold line-clamp-1 flex-nowrap">
73
- {title}
74
- </div>
75
- {/if}
76
- </div>
77
- <Button onclick={() => onClickBuy!(id)} class="w-full">
78
- {buttonBuyText || $t("label.buy")}
79
- </Button>
80
- </div>
81
- </article>
1
+ <script lang="ts">
2
+ import Button from "../../../ui/button/button.svelte";
3
+ import Skeleton from "../../../ui/skeleton/skeleton.svelte";
4
+ import { t } from "../../../../i18n";
5
+ import CardCart from "../shared/CardCart.svelte";
6
+ import CardDescription from "../shared/CardDescription.svelte";
7
+ import CardFavorite from "../shared/CardFavorite.svelte";
8
+ import CardStartPrice from "../shared/CardStartPrice.svelte";
9
+ import CardTags from "../shared/CardTags.svelte";
10
+ /**
11
+ * Card component with a title and content.
12
+ * @component
13
+ */
14
+ import type { CardPromotionProps } from "../types";
15
+
16
+ let {
17
+ id,
18
+ tags,
19
+ logo,
20
+ title,
21
+ imageUrl,
22
+ isFavorite = false,
23
+ isCart = false,
24
+ isLoading = false,
25
+ newPrice,
26
+ oldPrice,
27
+ content,
28
+ buttonBuyText,
29
+ isDescriptionIcon,
30
+ isDescriptionLabel,
31
+ onClickBuy,
32
+ onClickShop,
33
+ onClickFavorite,
34
+ }: CardPromotionProps = $props();
35
+ </script>
36
+
37
+ <article class="relative rounded-lg border">
38
+ <aside class="relative w-full">
39
+ <div class="absolute top-1 left-1 z-2 gap-1 p-2">
40
+ {#if isLoading}
41
+ <Skeleton class="h-5 w-20 rounded-full bg-black/20" />
42
+ {:else if logo}
43
+ <img src={logo} width={30} height={30} alt={title} class="rounded-lg" />
44
+ {/if}
45
+ </div>
46
+
47
+ <div class="absolute top-1 right-1 z-2 flex items-center gap-1 p-2">
48
+ <CardFavorite
49
+ {id}
50
+ {isFavorite}
51
+ {isLoading}
52
+ onFavoriteClick={onClickFavorite}
53
+ />
54
+ <CardCart {id} {isCart} {isLoading} onCartClick={onClickShop} />
55
+ </div>
56
+
57
+ {#if isLoading}
58
+ <Skeleton
59
+ class="rounded-lg md:h-25 md:w-25 lg:h-45 lg:w-45 object-cover object-center bg-black/15"
60
+ />
61
+ {:else if imageUrl}
62
+ <img
63
+ src={imageUrl}
64
+ alt={imageUrl}
65
+ class="rounded-tr-lg rounded-tl-lg h-25 lg:h-45 w-full object-cover object-center"
66
+ />
67
+ {/if}
68
+ <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
69
+ </aside>
70
+
71
+ <aside
72
+ class="bottom-1 inset-x-0 flex flex-col items-center justify-center gap-0.5 m-auto max-w-11/12 p-1 rounded-md"
73
+ >
74
+ <div class="flex justify-between w-full items-center mb-1">
75
+ {#if title}
76
+ {#if isLoading}
77
+ <Skeleton class="h-4 w-30 rounded-lg" />
78
+ {:else}
79
+ <div class="font-semibold line-clamp-1 flex-nowrap">
80
+ {title}
81
+ </div>
82
+ {/if}
83
+ {/if}
84
+ </div>
85
+
86
+ <div>
87
+ <CardDescription {content} {isDescriptionIcon} {isDescriptionLabel} />
88
+ </div>
89
+
90
+ <div class="w-full mb-3">
91
+ <CardTags {tags} />
92
+ </div>
93
+
94
+ <div class="flex justify-start gap-2 w-full">
95
+ {#if isLoading}
96
+ <Skeleton class="h-5 bg-black/10 w-25 my-2 mr-2" />
97
+ {:else if newPrice || oldPrice}
98
+ <div>
99
+ <CardStartPrice {newPrice} {oldPrice} />
100
+ </div>
101
+ {/if}
102
+ </div>
103
+
104
+ {#if isLoading}
105
+ <Skeleton class="h-9 w-full rounded-md" />
106
+ {:else}
107
+ <Button onclick={() => onClickBuy!(id)} class="w-full">
108
+ {buttonBuyText || $t("label.buy")}
109
+ </Button>
110
+ {/if}
111
+ </aside>
112
+ </article>