negodesign 0.0.33 → 0.0.34
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/profile/01/CardProfile01.svelte +10 -15
- package/dist/components/core/card/profile/02/CardProfile02.svelte +10 -2
- package/dist/components/core/card/profile/CardProfile.svelte +1 -1
- package/dist/components/core/card/shared/CardDescription.svelte +3 -0
- package/dist/components/core/card/shared/CardDescription.svelte.d.ts +1 -0
- package/dist/components/core/card/shared/CardPhoneOrWhatsapp.svelte +6 -2
- package/dist/components/core/card/shared/CardTags.svelte +2 -2
- package/dist/components/core/card/shared/TruncatableText.svelte +39 -47
- package/dist/components/core/card/shared/TruncatableText.svelte.d.ts +1 -1
- package/dist/components/core/carousel/grid/profile/ui/CarouselGridProfile.svelte +1 -1
- package/dist/globals.css +2 -28
- package/dist/styles/animate.min.css +0 -2
- package/dist/styles/globals.css +1 -3
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
|
|
15
15
|
import CardPhoneOrWhatsapp from "../../shared/CardPhoneOrWhatsapp.svelte";
|
|
16
16
|
import CardThumbnailVideo from "../../shared/CardThumbnailVideo.svelte";
|
|
17
|
+
import ImgPlaceholder from "../../../../../assets/placeholder-image.png";
|
|
17
18
|
|
|
18
19
|
let {
|
|
19
20
|
id,
|
|
@@ -56,6 +57,8 @@
|
|
|
56
57
|
src={imageUrl}
|
|
57
58
|
alt={imageUrl}
|
|
58
59
|
class="w-12 h-12 md:w-14 md:h-14 lg:w-20 lg:h-20 rounded-full"
|
|
60
|
+
onerror={(e) =>
|
|
61
|
+
((e.target as HTMLImageElement).src = ImgPlaceholder)}
|
|
59
62
|
/>
|
|
60
63
|
{/if}
|
|
61
64
|
</div>
|
|
@@ -91,24 +94,16 @@
|
|
|
91
94
|
{isLoading}
|
|
92
95
|
{isDescriptionIcon}
|
|
93
96
|
{isDescriptionLabel}
|
|
97
|
+
lines={tags?.length == 0 ? 3 : 2}
|
|
94
98
|
/>
|
|
95
99
|
</div>
|
|
96
100
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/>
|
|
104
|
-
{:else}
|
|
105
|
-
<CardTags
|
|
106
|
-
className="my-4"
|
|
107
|
-
tags={[{ text: "- - -" }]}
|
|
108
|
-
{isTagBorderBottom}
|
|
109
|
-
{isLoading}
|
|
110
|
-
/>
|
|
111
|
-
{/if}
|
|
101
|
+
<CardTags
|
|
102
|
+
className="my-4"
|
|
103
|
+
tags={tags ?? []}
|
|
104
|
+
{isTagBorderBottom}
|
|
105
|
+
{isLoading}
|
|
106
|
+
/>
|
|
112
107
|
|
|
113
108
|
<CardThumbnailVideo
|
|
114
109
|
{imageUrl}
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
import Skeleton from "../../../../ui/skeleton/skeleton.svelte";
|
|
15
15
|
import CardThumbnailVideo from "../../shared/CardThumbnailVideo.svelte";
|
|
16
16
|
import CardPhoneOrWhatsapp from "../../shared/CardPhoneOrWhatsapp.svelte";
|
|
17
|
+
import ImgPlaceholder from "../../../../../assets/placeholder-image.png";
|
|
18
|
+
|
|
17
19
|
let {
|
|
18
20
|
id,
|
|
19
21
|
tags,
|
|
@@ -49,8 +51,14 @@
|
|
|
49
51
|
<div class="flex justify-center items-center">
|
|
50
52
|
{#if isLoading}
|
|
51
53
|
<Skeleton class="w-12 h-12 rounded-lg bg-gray-400 mt-0.5" />
|
|
52
|
-
{:else if
|
|
53
|
-
<img
|
|
54
|
+
{:else if imageUrl}
|
|
55
|
+
<img
|
|
56
|
+
src={imageUrl}
|
|
57
|
+
alt={imageUrl}
|
|
58
|
+
class="w-12 h-12 rounded-lg"
|
|
59
|
+
onerror={(e) =>
|
|
60
|
+
((e.target as HTMLImageElement).src = ImgPlaceholder)}
|
|
61
|
+
/>
|
|
54
62
|
{/if}
|
|
55
63
|
</div>
|
|
56
64
|
<div class="flex flex-col justify-start items-start">
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import Skeleton from "../../../ui/skeleton/skeleton.svelte";
|
|
7
7
|
|
|
8
8
|
type CardDescriptionProps = {
|
|
9
|
+
lines?: number;
|
|
9
10
|
content?: string;
|
|
10
11
|
isLoading?: boolean;
|
|
11
12
|
isDescriptionIcon?: boolean;
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
let {
|
|
17
|
+
lines = 2,
|
|
16
18
|
content,
|
|
17
19
|
isLoading = false,
|
|
18
20
|
isDescriptionIcon = false,
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
{/if}
|
|
34
36
|
<TruncatableText
|
|
35
37
|
text={content}
|
|
38
|
+
{lines}
|
|
36
39
|
class="text-justify text-[13px] md:text-[14px] text-gray-800 dark:text-gray-50 mt-3 my-2"
|
|
37
40
|
/>
|
|
38
41
|
{/if}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
<div class="flex border-t border-gray-300 dark:border-gray-700">
|
|
13
13
|
{#if onEmailClick}
|
|
14
14
|
<button
|
|
15
|
-
class="flex-1 flex justify-center items-center gap-2 p-3 hover:bg-red-800 hover:text-white cursor-pointer rounded-bl-lg
|
|
15
|
+
class="flex-1 flex justify-center items-center gap-2 p-3 hover:bg-red-800 hover:text-white cursor-pointer rounded-bl-lg {isFlex
|
|
16
|
+
? 'rounded-br-lg'
|
|
17
|
+
: ''}"
|
|
16
18
|
onclick={() => onEmailClick?.(id)}
|
|
17
19
|
>
|
|
18
20
|
<HugeiconsIcon icon={Mail01Icon} size={20} />
|
|
@@ -24,7 +26,9 @@
|
|
|
24
26
|
{/if}
|
|
25
27
|
{#if onWhatsappClick}
|
|
26
28
|
<button
|
|
27
|
-
class="flex-1 flex justify-center items-center gap-2 p-3 hover:bg-green-600 hover:text-white cursor-pointer rounded-br-lg
|
|
29
|
+
class="flex-1 flex justify-center items-center gap-2 p-3 hover:bg-green-600 hover:text-white cursor-pointer rounded-br-lg {isFlex
|
|
30
|
+
? 'rounded-bl-lg'
|
|
31
|
+
: ''}"
|
|
28
32
|
onclick={() => onWhatsappClick?.(id)}
|
|
29
33
|
>
|
|
30
34
|
<HugeiconsIcon icon={WhatsappIcon} size={20} />
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const {
|
|
15
|
-
tags,
|
|
15
|
+
tags = [],
|
|
16
16
|
className,
|
|
17
17
|
isTagBorderBottom,
|
|
18
18
|
isWrap = false,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
</div>
|
|
56
56
|
{:else}
|
|
57
57
|
<div
|
|
58
|
-
class="flex overflow-x-auto no-scrollbar w-full
|
|
58
|
+
class="flex overflow-x-auto no-scrollbar w-full min-w-0
|
|
59
59
|
{isJustify ? 'justify-between gap-3' : 'gap-4 md:gap-5 lg:gap-10'}
|
|
60
60
|
{className}"
|
|
61
61
|
>
|
|
@@ -1,56 +1,48 @@
|
|
|
1
1
|
<!-- shared/TruncatableText.svelte -->
|
|
2
2
|
<script lang="ts">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Clamps text to N lines; if it overflows, shows an indicator
|
|
5
|
+
* ("Ler texto completo") positioned absolutely at the end of the
|
|
6
|
+
* text, that opens the full text in a Popover.
|
|
7
|
+
* @component
|
|
8
|
+
*/
|
|
9
|
+
import * as Popover from "../../../ui/popover";
|
|
10
|
+
import { t } from "../../../../i18n";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type Props = { text: string; class?: string; lines?: number };
|
|
13
|
+
let { text, class: className = "", lines = 2 }: Props = $props();
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const clampClasses = {
|
|
18
|
-
2: "line-clamp-2",
|
|
19
|
-
3: "line-clamp-3",
|
|
20
|
-
4: "line-clamp-4",
|
|
21
|
-
} as const;
|
|
15
|
+
let textEl: HTMLParagraphElement | undefined = $state();
|
|
16
|
+
let isTruncated = $state(false);
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ro.observe(textEl);
|
|
35
|
-
return () => ro.disconnect();
|
|
36
|
-
});
|
|
18
|
+
$effect(() => {
|
|
19
|
+
if (!textEl) return;
|
|
20
|
+
const check = () =>
|
|
21
|
+
(isTruncated = textEl!.scrollHeight > textEl!.clientHeight + 1);
|
|
22
|
+
// requestAnimationFrame garante que o layout com o clamp já foi aplicado
|
|
23
|
+
// antes de medirmos — medir no mesmo tick pode dar valores desatualizados.
|
|
24
|
+
requestAnimationFrame(check);
|
|
25
|
+
const ro = new ResizeObserver(check);
|
|
26
|
+
ro.observe(textEl);
|
|
27
|
+
return () => ro.disconnect();
|
|
28
|
+
});
|
|
37
29
|
</script>
|
|
38
30
|
|
|
39
31
|
<div class="relative">
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
<p bind:this={textEl} class="line-clamp-{lines} {className}">
|
|
33
|
+
{text}
|
|
34
|
+
</p>
|
|
43
35
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</div>
|
|
36
|
+
{#if isTruncated}
|
|
37
|
+
<Popover.Root>
|
|
38
|
+
<Popover.Trigger
|
|
39
|
+
class="absolute bottom-0 right-0 bg-background pl-1 text-[11px] font-medium text-primary underline underline-offset-2 cursor-pointer"
|
|
40
|
+
>
|
|
41
|
+
{$t("label.view.full")}
|
|
42
|
+
</Popover.Trigger>
|
|
43
|
+
<Popover.Content>
|
|
44
|
+
<p class="max-w-xs text-justify text-[12px]">{text}</p>
|
|
45
|
+
</Popover.Content>
|
|
46
|
+
</Popover.Root>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
package/dist/globals.css
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@charset "UTF-8";
|
|
3
2
|
@layer properties;
|
|
4
3
|
@layer theme, base, components, utilities;
|
|
5
4
|
@layer theme {
|
|
@@ -594,24 +593,6 @@
|
|
|
594
593
|
-webkit-box-orient: vertical;
|
|
595
594
|
-webkit-line-clamp: 1;
|
|
596
595
|
}
|
|
597
|
-
.line-clamp-2 {
|
|
598
|
-
overflow: hidden;
|
|
599
|
-
display: -webkit-box;
|
|
600
|
-
-webkit-box-orient: vertical;
|
|
601
|
-
-webkit-line-clamp: 2;
|
|
602
|
-
}
|
|
603
|
-
.line-clamp-3 {
|
|
604
|
-
overflow: hidden;
|
|
605
|
-
display: -webkit-box;
|
|
606
|
-
-webkit-box-orient: vertical;
|
|
607
|
-
-webkit-line-clamp: 3;
|
|
608
|
-
}
|
|
609
|
-
.line-clamp-4 {
|
|
610
|
-
overflow: hidden;
|
|
611
|
-
display: -webkit-box;
|
|
612
|
-
-webkit-box-orient: vertical;
|
|
613
|
-
-webkit-line-clamp: 4;
|
|
614
|
-
}
|
|
615
596
|
.block {
|
|
616
597
|
display: block;
|
|
617
598
|
}
|
|
@@ -4069,9 +4050,6 @@
|
|
|
4069
4050
|
.lg\:grid-cols-3 {
|
|
4070
4051
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
4071
4052
|
}
|
|
4072
|
-
.lg\:grid-cols-4 {
|
|
4073
|
-
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
4074
|
-
}
|
|
4075
4053
|
.lg\:grid-cols-\[1fr_22rem\] {
|
|
4076
4054
|
grid-template-columns: 1fr 22rem;
|
|
4077
4055
|
}
|
|
@@ -4095,13 +4073,10 @@
|
|
|
4095
4073
|
.xl\:grid-cols-4 {
|
|
4096
4074
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
4097
4075
|
}
|
|
4098
|
-
.xl\:grid-cols-5 {
|
|
4099
|
-
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
4100
|
-
}
|
|
4101
4076
|
}
|
|
4102
4077
|
@media (width >= 96rem) {
|
|
4103
|
-
.\32 xl\:grid-cols-
|
|
4104
|
-
grid-template-columns: repeat(
|
|
4078
|
+
.\32 xl\:grid-cols-5 {
|
|
4079
|
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
4105
4080
|
}
|
|
4106
4081
|
}
|
|
4107
4082
|
.ltr\:fill-current:where(:dir(ltr), [dir="ltr"], [dir="ltr"] *) {
|
|
@@ -17238,7 +17213,6 @@
|
|
|
17238
17213
|
*
|
|
17239
17214
|
* Copyright (c) 2020 Animate.css
|
|
17240
17215
|
*/
|
|
17241
|
-
@charset "UTF-8";
|
|
17242
17216
|
:root {
|
|
17243
17217
|
--animate-duration: 1s;
|
|
17244
17218
|
--animate-delay: 1s;
|
package/dist/styles/globals.css
CHANGED