negodesign 0.0.33 → 0.0.35

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,11 +14,11 @@
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,
20
- tags,
21
- logo,
21
+ tags = [],
22
22
  title,
23
23
  content,
24
24
  startNumber,
@@ -44,7 +44,7 @@
44
44
  class="border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-transparent rounded-lg relative"
45
45
  >
46
46
  <div class="p-5">
47
- <div class="flex justify-between items-center w-full">
47
+ <div class="flex justify-between items-center w-full border-b-2">
48
48
  <div class="w-full flex flex-col justify-center items-center relative">
49
49
  <div>
50
50
  {#if isLoading}
@@ -56,6 +56,8 @@
56
56
  src={imageUrl}
57
57
  alt={imageUrl}
58
58
  class="w-12 h-12 md:w-14 md:h-14 lg:w-20 lg:h-20 rounded-full"
59
+ onerror={(e) =>
60
+ ((e.target as HTMLImageElement).src = ImgPlaceholder)}
59
61
  />
60
62
  {/if}
61
63
  </div>
@@ -91,24 +93,16 @@
91
93
  {isLoading}
92
94
  {isDescriptionIcon}
93
95
  {isDescriptionLabel}
96
+ lines={tags.length == 0 ? 3 : 2}
94
97
  />
95
98
  </div>
96
99
 
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}
100
+ <CardTags
101
+ className="mb-2"
102
+ tags={tags ?? []}
103
+ {isTagBorderBottom}
104
+ {isLoading}
105
+ />
112
106
 
113
107
  <CardThumbnailVideo
114
108
  {imageUrl}
@@ -14,10 +14,11 @@
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
- tags,
20
- logo,
21
+ tags = [],
21
22
  title,
22
23
  content,
23
24
  className,
@@ -49,8 +50,14 @@
49
50
  <div class="flex justify-center items-center">
50
51
  {#if isLoading}
51
52
  <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" />
53
+ {:else if imageUrl}
54
+ <img
55
+ src={imageUrl}
56
+ alt={imageUrl}
57
+ class="w-12 h-12 rounded-lg"
58
+ onerror={(e) =>
59
+ ((e.target as HTMLImageElement).src = ImgPlaceholder)}
60
+ />
54
61
  {/if}
55
62
  </div>
56
63
  <div class="flex flex-col justify-start items-start">
@@ -84,24 +91,16 @@
84
91
  {isLoading}
85
92
  {isDescriptionLabel}
86
93
  {isDescriptionIcon}
94
+ lines={tags.length == 0 ? 3 : 2}
87
95
  />
88
96
  </div>
89
97
 
90
- {#if tags && tags.length > 0}
91
- <CardTags
92
- className="my-4"
93
- tags={tags ?? []}
94
- {isTagBorderBottom}
95
- {isLoading}
96
- />
97
- {:else}
98
- <CardTags
99
- className="my-4"
100
- tags={[{ text: "- - -" }]}
101
- {isTagBorderBottom}
102
- {isLoading}
103
- />
104
- {/if}
98
+ <CardTags
99
+ className="my-2"
100
+ tags={tags ?? []}
101
+ {isTagBorderBottom}
102
+ {isLoading}
103
+ />
105
104
 
106
105
  <CardThumbnailVideo
107
106
  {imageUrl}
@@ -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 {
@@ -467,9 +466,6 @@
467
466
  .my-2 {
468
467
  margin-block: calc(var(--spacing) * 2);
469
468
  }
470
- .my-4 {
471
- margin-block: calc(var(--spacing) * 4);
472
- }
473
469
  .my-6 {
474
470
  margin-block: calc(var(--spacing) * 6);
475
471
  }
@@ -594,24 +590,6 @@
594
590
  -webkit-box-orient: vertical;
595
591
  -webkit-line-clamp: 1;
596
592
  }
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
593
  .block {
616
594
  display: block;
617
595
  }
@@ -4069,9 +4047,6 @@
4069
4047
  .lg\:grid-cols-3 {
4070
4048
  grid-template-columns: repeat(3, minmax(0, 1fr));
4071
4049
  }
4072
- .lg\:grid-cols-4 {
4073
- grid-template-columns: repeat(4, minmax(0, 1fr));
4074
- }
4075
4050
  .lg\:grid-cols-\[1fr_22rem\] {
4076
4051
  grid-template-columns: 1fr 22rem;
4077
4052
  }
@@ -4095,13 +4070,10 @@
4095
4070
  .xl\:grid-cols-4 {
4096
4071
  grid-template-columns: repeat(4, minmax(0, 1fr));
4097
4072
  }
4098
- .xl\:grid-cols-5 {
4099
- grid-template-columns: repeat(5, minmax(0, 1fr));
4100
- }
4101
4073
  }
4102
4074
  @media (width >= 96rem) {
4103
- .\32 xl\:grid-cols-6 {
4104
- grid-template-columns: repeat(6, minmax(0, 1fr));
4075
+ .\32 xl\:grid-cols-5 {
4076
+ grid-template-columns: repeat(5, minmax(0, 1fr));
4105
4077
  }
4106
4078
  }
4107
4079
  .ltr\:fill-current:where(:dir(ltr), [dir="ltr"], [dir="ltr"] *) {
@@ -17238,7 +17210,6 @@
17238
17210
  *
17239
17211
  * Copyright (c) 2020 Animate.css
17240
17212
  */
17241
- @charset "UTF-8";
17242
17213
  :root {
17243
17214
  --animate-duration: 1s;
17244
17215
  --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.35",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "sideEffects": [