negodesign 0.0.26 → 0.0.28

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