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.
@@ -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
- {#if tags}
98
- <CardTags
99
- className="my-4"
100
- tags={tags ?? []}
101
- {isTagBorderBottom}
102
- {isLoading}
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 logo}
53
- <img src={logo} alt={logo} class="w-12 h-12 rounded-lg" />
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">
@@ -2,7 +2,7 @@
2
2
  import type { CardProfileProps } from "../types";
3
3
  import CardProfile01 from "./01/CardProfile01.svelte";
4
4
  import CardProfile02 from "./02/CardProfile02.svelte";
5
-
5
+
6
6
  type Props = {
7
7
  variant?: 1 | 2;
8
8
  isLoading?: boolean;
@@ -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}
@@ -1,4 +1,5 @@
1
1
  type CardDescriptionProps = {
2
+ lines?: number;
2
3
  content?: string;
3
4
  isLoading?: boolean;
4
5
  isDescriptionIcon?: boolean;
@@ -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
- * 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";
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
- type Props = { text: string; class?: string; lines?: 2 | 3 | 4 };
13
- let { text, class: className = "", lines = 2 }: Props = $props();
12
+ type Props = { text: string; class?: string; lines?: number };
13
+ let { text, class: className = "", lines = 2 }: Props = $props();
14
14
 
15
- // Tailwind precisa de classes literais no código-fonte para as gerar —
16
- // "line-clamp-{lines}" interpolado nunca é detectado pelo scanner.
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
- let textEl: HTMLParagraphElement | undefined = $state();
24
- let isTruncated = $state(false);
25
-
26
- $effect(() => {
27
- if (!textEl) return;
28
- const check = () =>
29
- (isTruncated = textEl!.scrollHeight > textEl!.clientHeight + 1);
30
- // requestAnimationFrame garante que o layout com o clamp já foi aplicado
31
- // antes de medirmos — medir no mesmo tick pode dar valores desatualizados.
32
- requestAnimationFrame(check);
33
- const ro = new ResizeObserver(check);
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
- <p bind:this={textEl} class="{clampClasses[lines]} {className}">
41
- {text}
42
- </p>
32
+ <p bind:this={textEl} class="line-clamp-{lines} {className}">
33
+ {text}
34
+ </p>
43
35
 
44
- {#if isTruncated}
45
- <Popover.Root>
46
- <Popover.Trigger
47
- class="absolute bottom-0 right-0 bg-background pl-1 text-[11px] font-medium text-primary underline underline-offset-2 cursor-pointer"
48
- >
49
- {$t("label.view.full")}
50
- </Popover.Trigger>
51
- <Popover.Content>
52
- <p class="max-w-xs text-justify text-[12px]">{text}</p>
53
- </Popover.Content>
54
- </Popover.Root>
55
- {/if}
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>
@@ -1,7 +1,7 @@
1
1
  type Props = {
2
2
  text: string;
3
3
  class?: string;
4
- lines?: 2 | 3 | 4;
4
+ lines?: number;
5
5
  };
6
6
  declare const TruncatableText: import("svelte").Component<Props, {}, "">;
7
7
  type TruncatableText = ReturnType<typeof TruncatableText>;
@@ -9,7 +9,7 @@
9
9
  const {
10
10
  headerProps,
11
11
  slotProps,
12
- gridClass = "lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6",
12
+ gridClass = "lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5",
13
13
  items,
14
14
  variant,
15
15
  isLoading = false,
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-6 {
4104
- grid-template-columns: repeat(6, minmax(0, 1fr));
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;
@@ -1,5 +1,3 @@
1
- @charset "UTF-8";
2
-
3
1
  /*!
4
2
  * animate.css - https://animate.style/
5
3
  * Version - 4.1.1
@@ -1,5 +1,3 @@
1
- @charset "UTF-8";
2
-
3
1
  @import "tailwindcss";
4
2
  @import "tw-animate-css";
5
3
  @import "shadcn-svelte/tailwind.css";
@@ -148,4 +146,4 @@
148
146
  html {
149
147
  @apply font-sans;
150
148
  }
151
- }
149
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "negodesign",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "sideEffects": [