negodesign 0.0.53 → 0.0.54

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.
@@ -56,13 +56,13 @@
56
56
  {#if title}
57
57
  <div class="text-center font-bold text-lg">{title}</div>
58
58
  {:else if isLoading}
59
- <Skeleton class="w-40 h-5 rounded-lg bg-gray-400 mb-0.5" />
59
+ <Skeleton class="w-5 md:w-40 h-5 rounded-lg bg-gray-400 mb-0.5" />
60
60
  {/if}
61
61
 
62
62
  {#if startNumber}
63
63
  <CardStarRating {startNumber} {startMax} {isLoading} />
64
64
  {:else if isLoading}
65
- <Skeleton class="w-20 h-4 rounded-lg bg-gray-300 mt-0.5" />
65
+ <Skeleton class="w-5 md:w-20 h-4 rounded-lg bg-gray-300 mt-0.5" />
66
66
  {/if}
67
67
  </div>
68
68
  </div>
@@ -10,16 +10,23 @@
10
10
  imageClass,
11
11
  iconClass,
12
12
  labelClass,
13
- activeClass = "bg-gradient text-white rounded-sm px-3",
14
- isLoading = false,
13
+ activeClass = "bg-gradient text-white rounded-full px-3",
15
14
  orientation = "horizontal",
15
+ itemStyle = "DEFAULT",
16
+ isBorderInline = false,
17
+ showButton = true,
18
+ isLoading = false,
19
+ btnNavClass,
16
20
  itemClass,
17
21
  onClick,
18
22
  }: CarouselBadgeProps = $props();
19
23
 
20
- const DEFAULT_IMG_OR_ICON_CLASS = "size-3";
21
- const NAV_BUTTON_CLASS =
22
- "absolute top-1/2 -translate-y-1/2 mt-0.5 md:mr-0 z-50 bg-blue-700! text-white! cursor-pointer!";
24
+ const TOP_NAV = $derived(isBorderInline ? "top-5.5" : "top-7.5");
25
+ const borderB = $derived(
26
+ isBorderInline ? `border-b-2 ${itemStyle == "BORDER" ? "pb-2" : ""}` : "",
27
+ );
28
+ const isInlineBorder = $derived(isBorderInline && itemStyle == "INLINE");
29
+ const DEFAULT_IMG_OR_ICON_CLASS = "size-3 md:size-6";
23
30
 
24
31
  const responsive = useDevice();
25
32
  const skeletonCount = $derived(responsive.isMobile ? 2 : 8);
@@ -54,31 +61,49 @@
54
61
  {/if}
55
62
  {/snippet}
56
63
 
57
- <Carousel.Root>
58
- <Carousel.Content>
59
- {#if isLoading}
60
- <div class="flex items-center justify-between w-full gap-1 md:gap-2">
61
- {#each Array.from({ length: skeletonCount }) as _, i (`skeleton-${i}`)}
62
- <Skeleton class="h-4 w-25 bg-gray-900/90" />
63
- {/each}
64
- </div>
65
- {:else}
66
- {#each items as item, i (`badge-${i}-${item.value ?? item.label ?? i}`)}
67
- <Carousel.Item class="basis-auto" onclick={() => selectItem(item)}>
68
- <div
69
- class="flex gap-1 mx-2 p-0.5 justify-center items-center cursor-pointer
64
+ {#if items.length > 0}
65
+ <Carousel.Root>
66
+ <Carousel.Content class={borderB}>
67
+ {#if isLoading}
68
+ <div class="flex items-center justify-between w-full gap-1 md:gap-2">
69
+ {#each Array.from( { length: skeletonCount }, ) as _, i (`skeleton-${i}`)}
70
+ <Skeleton class="h-4 w-25 bg-gray-50/90" />
71
+ {/each}
72
+ </div>
73
+ {:else}
74
+ {#each items as item, i (`badge-${i}-${item.value ?? item.label ?? i}`)}
75
+ <Carousel.Item
76
+ class="basis-auto relative"
77
+ onclick={() => selectItem(item)}
78
+ >
79
+ <div
80
+ class="flex gap-1 mx-2 p-1 justify-center items-center cursor-pointer relative hover:text-lg hover:font-bold
81
+ {isSelected(item)
82
+ ? isInlineBorder
83
+ ? 'text-gradient font-bold'
84
+ : activeClass
85
+ : ''}
86
+ {itemStyle == 'BORDER' ? 'border-2 rounded-full min-w-25 px-1' : ''}
70
87
  {orientation === 'horizontal' ? 'flex-row' : 'flex-col'}
71
- {isSelected(item) ? activeClass : ''}
88
+ {isInlineBorder ? 'pb-3' : ''}
72
89
  {itemClass}
73
90
  "
74
- >
75
- {@render itemVisual(item)}
76
- <div class={labelClass}>{item.label}</div>
77
- </div>
78
- </Carousel.Item>
79
- {/each}
91
+ >
92
+ {@render itemVisual(item)}
93
+ <div class={labelClass}>{item.label}</div>
94
+ </div>
95
+ {#if isSelected(item) && isInlineBorder}
96
+ <div class="absolute pt-5 w-full h-2 bg-gradient"></div>
97
+ {/if}
98
+ </Carousel.Item>
99
+ {/each}
100
+ {/if}
101
+ </Carousel.Content>
102
+ {#if showButton}
103
+ {@const navClass =
104
+ "absolute -translate-y-1/2 z-50 bg-blue-700! text-white! cursor-pointer"}
105
+ <Carousel.Previous class="-left-8 {navClass} {TOP_NAV} {btnNavClass}" />
106
+ <Carousel.Next class="-right-8 {navClass} {TOP_NAV} {btnNavClass}" />
80
107
  {/if}
81
- </Carousel.Content>
82
- <Carousel.Previous class="-left-8 {NAV_BUTTON_CLASS}" />
83
- <Carousel.Next class="-right-8 {NAV_BUTTON_CLASS}" />
84
- </Carousel.Root>
108
+ </Carousel.Root>
109
+ {/if}
@@ -15,8 +15,6 @@
15
15
  const { slotProps, totalItems, gridClass, children }: Props = $props();
16
16
 
17
17
  const responsive = useDevice();
18
-
19
- const colsClass = $derived(totalItems <= 2 ? "grid-cols-2" : "grid-cols-3");
20
18
  </script>
21
19
 
22
20
  {#if responsive.isMobile}
@@ -27,7 +25,9 @@
27
25
  {@render children()}
28
26
  </CarouselSlot>
29
27
  {:else}
30
- <div class="grid {colsClass} gap-4 p-2 {gridClass}">
28
+ <div
29
+ class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-4 p-2 {gridClass}"
30
+ >
31
31
  {@render children()}
32
32
  </div>
33
33
  {/if}
@@ -62,6 +62,10 @@ export interface CarouselBadgeProps {
62
62
  /** Estado de carregamento (skeleton) */
63
63
  isLoading?: boolean;
64
64
  itemClass?: string;
65
+ btnNavClass?: string;
66
+ isBorderInline?: boolean;
67
+ showButton?: boolean;
68
+ itemStyle?: 'BORDER' | 'INLINE' | 'DEFAULT';
65
69
  onClick?: (value: string | number) => void;
66
70
  }
67
71
  /**
@@ -27,7 +27,7 @@
27
27
  {#each links as item (item.label)}
28
28
  <li>
29
29
  <a
30
- class={`flex items-center gap-1 ${linkClass} ${menuKey === item.key ? activeClass : ""}`}
30
+ class={`flex items-center gap-1 ${linkClass} ${item.key && menuKey === item.key ? activeClass : ""}`}
31
31
  href={item.url ?? item.href ?? "#"}
32
32
  >
33
33
  {#if item.icon}
package/dist/globals.css CHANGED
@@ -329,6 +329,12 @@
329
329
  .top-4 {
330
330
  top: calc(var(--spacing) * 4);
331
331
  }
332
+ .top-5\.5 {
333
+ top: calc(var(--spacing) * 5.5);
334
+ }
335
+ .top-7\.5 {
336
+ top: calc(var(--spacing) * 7.5);
337
+ }
332
338
  .top-8 {
333
339
  top: calc(var(--spacing) * 8);
334
340
  }
@@ -1225,9 +1231,6 @@
1225
1231
  .grid-cols-2 {
1226
1232
  grid-template-columns: repeat(2, minmax(0, 1fr));
1227
1233
  }
1228
- .grid-cols-3 {
1229
- grid-template-columns: repeat(3, minmax(0, 1fr));
1230
- }
1231
1234
  .grid-cols-10 {
1232
1235
  grid-template-columns: repeat(10, minmax(0, 1fr));
1233
1236
  }
@@ -1473,6 +1476,10 @@
1473
1476
  border-style: var(--tw-border-style);
1474
1477
  border-width: 0px;
1475
1478
  }
1479
+ .border-2 {
1480
+ border-style: var(--tw-border-style);
1481
+ border-width: 2px;
1482
+ }
1476
1483
  .border-4 {
1477
1484
  border-style: var(--tw-border-style);
1478
1485
  border-width: 4px;
@@ -1710,6 +1717,12 @@
1710
1717
  .bg-gray-50 {
1711
1718
  background-color: var(--color-gray-50);
1712
1719
  }
1720
+ .bg-gray-50\/90 {
1721
+ background-color: color-mix(in srgb, oklch(98.5% 0.002 247.839) 90%, transparent);
1722
+ @supports (color: color-mix(in lab, red, red)) {
1723
+ background-color: color-mix(in oklab, var(--color-gray-50) 90%, transparent);
1724
+ }
1725
+ }
1713
1726
  .bg-gray-100 {
1714
1727
  background-color: var(--color-gray-100);
1715
1728
  }
@@ -1749,12 +1762,6 @@
1749
1762
  background-color: color-mix(in oklab, var(--color-gray-800) 50%, transparent);
1750
1763
  }
1751
1764
  }
1752
- .bg-gray-900\/90 {
1753
- background-color: color-mix(in srgb, oklch(21% 0.034 264.665) 90%, transparent);
1754
- @supports (color: color-mix(in lab, red, red)) {
1755
- background-color: color-mix(in oklab, var(--color-gray-900) 90%, transparent);
1756
- }
1757
- }
1758
1765
  .bg-green-500 {
1759
1766
  background-color: var(--color-green-500);
1760
1767
  }
@@ -1913,9 +1920,6 @@
1913
1920
  .p-0 {
1914
1921
  padding: 0px;
1915
1922
  }
1916
- .p-0\.5 {
1917
- padding: calc(var(--spacing) * 0.5);
1918
- }
1919
1923
  .p-1 {
1920
1924
  padding: var(--spacing);
1921
1925
  }
@@ -2033,6 +2037,9 @@
2033
2037
  .pt-4 {
2034
2038
  padding-top: calc(var(--spacing) * 4);
2035
2039
  }
2040
+ .pt-5 {
2041
+ padding-top: calc(var(--spacing) * 5);
2042
+ }
2036
2043
  .pt-6 {
2037
2044
  padding-top: calc(var(--spacing) * 6);
2038
2045
  }
@@ -2057,6 +2064,9 @@
2057
2064
  .pb-2 {
2058
2065
  padding-bottom: calc(var(--spacing) * 2);
2059
2066
  }
2067
+ .pb-3 {
2068
+ padding-bottom: calc(var(--spacing) * 3);
2069
+ }
2060
2070
  .pb-5 {
2061
2071
  padding-bottom: calc(var(--spacing) * 5);
2062
2072
  }
@@ -3231,6 +3241,14 @@
3231
3241
  background-color: color-mix(in oklab, var(--color-white) 90%, transparent);
3232
3242
  }
3233
3243
  }
3244
+ .hover\:text-lg:hover {
3245
+ font-size: var(--text-lg);
3246
+ line-height: var(--tw-leading, var(--text-lg--line-height));
3247
+ }
3248
+ .hover\:font-bold:hover {
3249
+ --tw-font-weight: var(--font-weight-bold);
3250
+ font-weight: var(--font-weight-bold);
3251
+ }
3234
3252
  .hover\:text-foreground:hover {
3235
3253
  color: var(--foreground);
3236
3254
  }
@@ -4005,6 +4023,10 @@
4005
4023
  .md\:aspect-auto {
4006
4024
  aspect-ratio: auto;
4007
4025
  }
4026
+ .md\:size-6 {
4027
+ width: calc(var(--spacing) * 6);
4028
+ height: calc(var(--spacing) * 6);
4029
+ }
4008
4030
  .md\:h-14 {
4009
4031
  height: calc(var(--spacing) * 14);
4010
4032
  }
@@ -4059,6 +4081,9 @@
4059
4081
  .md\:w-25 {
4060
4082
  width: calc(var(--spacing) * 25);
4061
4083
  }
4084
+ .md\:w-40 {
4085
+ width: calc(var(--spacing) * 40);
4086
+ }
4062
4087
  .md\:w-225 {
4063
4088
  width: calc(var(--spacing) * 225);
4064
4089
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "negodesign",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "sideEffects": [