negodesign 0.0.52 → 0.0.53
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.
- package/dist/components/core/card/media/01/CardMedia01.svelte +2 -2
- package/dist/components/core/card/media/02/CardMedia02.svelte +2 -7
- package/dist/components/core/card/shared/CardButton.svelte +1 -4
- package/dist/components/core/card/shared/CardTags.svelte +1 -1
- package/dist/components/core/card/shared/CardThumbnailVideo.svelte +3 -9
- package/dist/components/core/carousel/grid/media/types.d.ts +4 -0
- package/dist/components/core/carousel/grid/media/ui/CarouselGridMedia.svelte +12 -24
- package/dist/components/core/nav/data/nav-menu.d.ts +6 -0
- package/dist/components/core/nav/ui/menu-links.svelte +37 -25
- package/dist/components/core/nav/ui/menu-links.svelte.d.ts +2 -0
- package/dist/components/core/nav/ui/nav-menu.svelte +18 -2
- package/dist/globals.css +0 -9
- package/package.json +1 -1
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
|
|
79
|
-
<div class="
|
|
79
|
+
<div class=" my-2 mb-2 md:mb-0">
|
|
80
80
|
<CardDescription
|
|
81
81
|
{content}
|
|
82
82
|
{isLoading}
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
88
|
<CardTags
|
|
89
|
-
className="
|
|
89
|
+
className="mt-1 mb-5"
|
|
90
90
|
tags={tags ?? []}
|
|
91
91
|
{isTagBorderBottom}
|
|
92
92
|
{isLoading}
|
|
@@ -74,15 +74,10 @@
|
|
|
74
74
|
{isLoading}
|
|
75
75
|
/>
|
|
76
76
|
</div>
|
|
77
|
-
<CardTags
|
|
78
|
-
className="my-2"
|
|
79
|
-
tags={tags ?? []}
|
|
80
|
-
{isTagBorderBottom}
|
|
81
|
-
{isLoading}
|
|
82
|
-
/>
|
|
77
|
+
<CardTags tags={tags ?? []} {isTagBorderBottom} {isLoading} />
|
|
83
78
|
</div>
|
|
84
79
|
|
|
85
|
-
<div class="h-
|
|
80
|
+
<div class="h-24">
|
|
86
81
|
<CardDescription
|
|
87
82
|
{content}
|
|
88
83
|
{isLoading}
|
|
@@ -29,10 +29,7 @@
|
|
|
29
29
|
class="w-full h-7.5 rounded-lg bg-gray-500/80 dark:bg-gray-500/30"
|
|
30
30
|
/>
|
|
31
31
|
{:else}
|
|
32
|
-
<Button
|
|
33
|
-
class="bg-gradient {isFlex ? 'flex-1' : ''} {className}"
|
|
34
|
-
onclick={() => onClick(id)}
|
|
35
|
-
>
|
|
32
|
+
<Button class="bg-gradient flex-1 {className}" onclick={() => onClick(id)}>
|
|
36
33
|
{#if icon}
|
|
37
34
|
{#if typeof icon === "string"}
|
|
38
35
|
<i class={icon}></i>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
let {
|
|
28
28
|
imageUrl,
|
|
29
29
|
videoUrl,
|
|
30
|
-
class: className = "h-32
|
|
30
|
+
class: className = "h-32 w-full md:h-64",
|
|
31
31
|
isImageButtonMaximized = false,
|
|
32
32
|
isVideoButtonMaximized = false,
|
|
33
33
|
isLoading = false,
|
|
@@ -130,16 +130,10 @@
|
|
|
130
130
|
loading="lazy"
|
|
131
131
|
decoding="async"
|
|
132
132
|
alt={imageUrl}
|
|
133
|
-
class="absolute inset-0 w-full
|
|
133
|
+
class="absolute inset-0 h-full w-full rounded-md object-cover transition-opacity duration-500"
|
|
134
134
|
class:opacity-0={videoUrl && showVideo}
|
|
135
135
|
onerror={(e) => ((e.target as HTMLImageElement).src = ImgPlaceholder)}
|
|
136
136
|
/>
|
|
137
|
-
{:else}
|
|
138
|
-
<img
|
|
139
|
-
src={ImgPlaceholder}
|
|
140
|
-
alt={imageUrl}
|
|
141
|
-
class="rounded-lg w-50 h-[50px] object-cover object-center"
|
|
142
|
-
/>
|
|
143
137
|
{/if}
|
|
144
138
|
|
|
145
139
|
{#if videoUrl && isVisible}
|
|
@@ -148,7 +142,7 @@
|
|
|
148
142
|
src={videoUrl}
|
|
149
143
|
preload="metadata"
|
|
150
144
|
onloadedmetadata={onLoadedMetadata}
|
|
151
|
-
class="absolute inset-0 w-full
|
|
145
|
+
class="absolute inset-0 h-full w-full rounded-md object-cover transition-opacity duration-500"
|
|
152
146
|
class:opacity-0={imageUrl && !showVideo}
|
|
153
147
|
muted
|
|
154
148
|
loop
|
|
@@ -22,6 +22,10 @@ export interface CarouselGridMediaProps {
|
|
|
22
22
|
items: CardMediaProps[];
|
|
23
23
|
/** Estado de carregamento (skeleton) */
|
|
24
24
|
isLoading?: boolean;
|
|
25
|
+
/** Exibe o botão de maximizar no vídeo */
|
|
26
|
+
isVideoButtonMaximized?: boolean;
|
|
27
|
+
/** Exibe o botão de maximizar na imagem */
|
|
28
|
+
isImageButtonMaximized?: boolean;
|
|
25
29
|
/** Callback acionado ao clicar no botão de favorito */
|
|
26
30
|
onFavoriteClick?: (id: string | number) => void;
|
|
27
31
|
/** Callback acionado ao clicar no botão de perfil */
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
isLoading = false,
|
|
18
18
|
isDescriptionIcon,
|
|
19
19
|
isDescriptionLabel,
|
|
20
|
+
isVideoButtonMaximized = false,
|
|
21
|
+
isImageButtonMaximized = false,
|
|
20
22
|
onFavoriteClick,
|
|
21
23
|
onButtonProfile,
|
|
22
24
|
onButtonDetails,
|
|
@@ -55,18 +57,11 @@
|
|
|
55
57
|
{variant}
|
|
56
58
|
{isDescriptionIcon}
|
|
57
59
|
{isDescriptionLabel}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
item?.onButtonProfile?.(id);
|
|
64
|
-
onButtonProfile?.(id);
|
|
65
|
-
}}
|
|
66
|
-
onButtonDetails={(id: string | number) => {
|
|
67
|
-
item?.onButtonDetails?.(id);
|
|
68
|
-
onButtonDetails?.(id);
|
|
69
|
-
}}
|
|
60
|
+
{isVideoButtonMaximized}
|
|
61
|
+
{isImageButtonMaximized}
|
|
62
|
+
{onFavoriteClick}
|
|
63
|
+
{onButtonProfile}
|
|
64
|
+
{onButtonDetails}
|
|
70
65
|
/>
|
|
71
66
|
</Carousel.Item>
|
|
72
67
|
{:else}
|
|
@@ -76,18 +71,11 @@
|
|
|
76
71
|
{variant}
|
|
77
72
|
{isDescriptionIcon}
|
|
78
73
|
{isDescriptionLabel}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
item?.onButtonProfile?.(id);
|
|
85
|
-
onButtonProfile?.(id);
|
|
86
|
-
}}
|
|
87
|
-
onButtonDetails={(id: string | number) => {
|
|
88
|
-
item?.onButtonDetails?.(id);
|
|
89
|
-
onButtonDetails?.(id);
|
|
90
|
-
}}
|
|
74
|
+
{isVideoButtonMaximized}
|
|
75
|
+
{isImageButtonMaximized}
|
|
76
|
+
{onFavoriteClick}
|
|
77
|
+
{onButtonProfile}
|
|
78
|
+
{onButtonDetails}
|
|
91
79
|
/>
|
|
92
80
|
</div>
|
|
93
81
|
{/if}
|
|
@@ -18,6 +18,8 @@ export interface NavMenuLogoProps {
|
|
|
18
18
|
* Props de um link individual no menu de navegação.
|
|
19
19
|
*/
|
|
20
20
|
export interface NavMenuLinksProps {
|
|
21
|
+
/** Key menu */
|
|
22
|
+
key?: string;
|
|
21
23
|
/** URL de destino do link */
|
|
22
24
|
url?: string;
|
|
23
25
|
/** Alias de `url` — URL de destino do link (compatibilidade) */
|
|
@@ -52,6 +54,10 @@ export interface NavMenuActionsProps {
|
|
|
52
54
|
* com logo, links, ações (login/registo), language switcher e light switch.
|
|
53
55
|
*/
|
|
54
56
|
export interface NavMenuProps {
|
|
57
|
+
/** Key nav menu */
|
|
58
|
+
menuKey?: string;
|
|
59
|
+
/** Key CSS nav menu */
|
|
60
|
+
activeClass?: string;
|
|
55
61
|
/** Classe CSS adicional para o container do nav */
|
|
56
62
|
navClass?: string;
|
|
57
63
|
/** Classe CSS personalizada para cada link */
|
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
links: NavMenuLinksProps[];
|
|
7
|
-
linkClass?: string;
|
|
8
|
-
groupClass?: string;
|
|
9
|
-
orientation?: "horizontal" | "vertical";
|
|
10
|
-
};
|
|
2
|
+
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
3
|
+
import type { NavMenuLinksProps } from "../data/nav-menu";
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
type Props = {
|
|
6
|
+
links: NavMenuLinksProps[];
|
|
7
|
+
linkClass?: string;
|
|
8
|
+
groupClass?: string;
|
|
9
|
+
menuKey?: string;
|
|
10
|
+
activeClass?: string;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
links,
|
|
16
|
+
linkClass,
|
|
17
|
+
groupClass,
|
|
18
|
+
menuKey,
|
|
19
|
+
activeClass = "bg-gradient text-white",
|
|
20
|
+
orientation,
|
|
21
|
+
}: Props = $props();
|
|
13
22
|
</script>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
23
|
+
|
|
24
|
+
<ul
|
|
25
|
+
class={`flex ${orientation === "vertical" ? "flex-col" : "items-center"} gap-2 md:gap-5 lg:gap-15 ${groupClass}`}
|
|
26
|
+
>
|
|
27
|
+
{#each links as item (item.label)}
|
|
28
|
+
<li>
|
|
29
|
+
<a
|
|
30
|
+
class={`flex items-center gap-1 ${linkClass} ${menuKey === item.key ? activeClass : ""}`}
|
|
31
|
+
href={item.url ?? item.href ?? "#"}
|
|
32
|
+
>
|
|
33
|
+
{#if item.icon}
|
|
34
|
+
<HugeiconsIcon icon={item.icon} size={15} />
|
|
35
|
+
{/if}
|
|
36
|
+
{item.label}
|
|
37
|
+
</a>
|
|
38
|
+
</li>
|
|
39
|
+
{/each}
|
|
40
|
+
</ul>
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
logo,
|
|
15
15
|
links,
|
|
16
16
|
actions,
|
|
17
|
+
menuKey,
|
|
18
|
+
activeClass,
|
|
17
19
|
navClass = "w-full",
|
|
18
20
|
linkClass = "",
|
|
19
21
|
groupClass = "",
|
|
@@ -95,11 +97,25 @@
|
|
|
95
97
|
{#if responsive.isMobile}
|
|
96
98
|
<NavMenuDrawer {links} {onclickButtonLogin} {onclickButtonRegister} />
|
|
97
99
|
{:else if align === "LINK_SEPARATED_ACTIONS"}
|
|
98
|
-
<MenuLinks
|
|
100
|
+
<MenuLinks
|
|
101
|
+
{menuKey}
|
|
102
|
+
{activeClass}
|
|
103
|
+
{links}
|
|
104
|
+
{linkClass}
|
|
105
|
+
{groupClass}
|
|
106
|
+
orientation="horizontal"
|
|
107
|
+
/>
|
|
99
108
|
{@render actionButtons()}
|
|
100
109
|
{:else if align === "LINK_INTO_ACTIONS"}
|
|
101
110
|
<div class="flex items-center gap-2">
|
|
102
|
-
<MenuLinks
|
|
111
|
+
<MenuLinks
|
|
112
|
+
{menuKey}
|
|
113
|
+
{activeClass}
|
|
114
|
+
{links}
|
|
115
|
+
{linkClass}
|
|
116
|
+
{groupClass}
|
|
117
|
+
orientation="vertical"
|
|
118
|
+
/>
|
|
103
119
|
{@render actionButtons()}
|
|
104
120
|
</div>
|
|
105
121
|
{/if}
|
package/dist/globals.css
CHANGED
|
@@ -479,9 +479,6 @@
|
|
|
479
479
|
.my-2 {
|
|
480
480
|
margin-block: calc(var(--spacing) * 2);
|
|
481
481
|
}
|
|
482
|
-
.my-6 {
|
|
483
|
-
margin-block: calc(var(--spacing) * 6);
|
|
484
|
-
}
|
|
485
482
|
.my-auto {
|
|
486
483
|
margin-block: auto;
|
|
487
484
|
}
|
|
@@ -813,9 +810,6 @@
|
|
|
813
810
|
.h-75 {
|
|
814
811
|
height: calc(var(--spacing) * 75);
|
|
815
812
|
}
|
|
816
|
-
.h-\[50px\] {
|
|
817
|
-
height: 50px;
|
|
818
|
-
}
|
|
819
813
|
.h-\[65px\] {
|
|
820
814
|
height: 65px;
|
|
821
815
|
}
|
|
@@ -4065,9 +4059,6 @@
|
|
|
4065
4059
|
.md\:w-25 {
|
|
4066
4060
|
width: calc(var(--spacing) * 25);
|
|
4067
4061
|
}
|
|
4068
|
-
.md\:w-64 {
|
|
4069
|
-
width: calc(var(--spacing) * 64);
|
|
4070
|
-
}
|
|
4071
4062
|
.md\:w-225 {
|
|
4072
4063
|
width: calc(var(--spacing) * 225);
|
|
4073
4064
|
}
|