negodesign 0.0.67 → 0.0.69

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.
Files changed (41) hide show
  1. package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +1 -1
  2. package/dist/components/core/carousel/shared/ui/CarouselHeader.svelte +3 -4
  3. package/dist/components/core/grid/data/types.d.ts +3 -0
  4. package/dist/components/core/grid/ui/01/Grid01.svelte +2 -1
  5. package/dist/components/core/grid/ui/02/Grid02.svelte +2 -1
  6. package/dist/components/core/grid/ui/ItemsPanel.svelte +26 -0
  7. package/dist/components/core/grid/ui/ItemsPanel.svelte.d.ts +7 -0
  8. package/dist/components/core/grid/ui/ItemsPanelCarousel.svelte +37 -0
  9. package/dist/components/core/grid/ui/ItemsPanelCarousel.svelte.d.ts +4 -0
  10. package/dist/components/core/grid/ui/{PanelGrid.svelte → ItemsPanelGrid.svelte} +11 -5
  11. package/dist/components/core/grid/ui/ItemsPanelGrid.svelte.d.ts +4 -0
  12. package/dist/components/core/grid/ui/ItemsSimpleGrid.svelte.d.ts +4 -0
  13. package/dist/components/core/nav/data/types.d.ts +9 -0
  14. package/dist/components/core/nav/ui/ComplexMenu.svelte +10 -8
  15. package/dist/components/core/nav/ui/mobile/ComplexMenuMobile.svelte +41 -14
  16. package/dist/components/core/nav/ui/shared/MenuListItem.svelte +7 -2
  17. package/dist/components/core/nav/ui/shared/MenuListItem.svelte.d.ts +5 -1
  18. package/dist/components/core/nav/ui/shared/dropdown/DropdownNavigationMenuItemGrid.svelte +1 -1
  19. package/dist/components/core/nav/ui/shared/navigation/NavDropdown.svelte +2 -2
  20. package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItem.svelte +3 -3
  21. package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItemCard.svelte +12 -6
  22. package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItemGrid.svelte +9 -4
  23. package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItemList.svelte +5 -2
  24. package/dist/components/core/nav/ui/shared/navigation/NavigationMenuItems.svelte +2 -2
  25. package/dist/globals.css +13 -14
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +3 -3
  28. package/package.json +1 -1
  29. package/dist/components/core/grid/ui/PanelGrid.svelte.d.ts +0 -4
  30. package/dist/components/core/grid/ui/SimpleGrid.svelte.d.ts +0 -4
  31. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItem.svelte +0 -15
  32. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItem.svelte.d.ts +0 -4
  33. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItemCard.svelte +0 -62
  34. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItemCard.svelte.d.ts +0 -4
  35. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItemGrid.svelte +0 -32
  36. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItemGrid.svelte.d.ts +0 -4
  37. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItemList.svelte +0 -24
  38. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItemList.svelte.d.ts +0 -4
  39. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItems.svelte +0 -21
  40. package/dist/components/core/nav/ui/shared/navigation-old/NavigationMenuItems.svelte.d.ts +0 -4
  41. /package/dist/components/core/grid/ui/{SimpleGrid.svelte → ItemsSimpleGrid.svelte} +0 -0
@@ -5,7 +5,7 @@
5
5
  import { useDevice } from "../../../../../../hooks/responsive.svelte";
6
6
  import Autoplay from "embla-carousel-autoplay";
7
7
  import type { GridProps } from "../../../../grid/data/types";
8
- import SimpleGrid from "../../../../grid/ui/SimpleGrid.svelte";
8
+ import SimpleGrid from "../../../../grid/ui/ItemsSimpleGrid.svelte";
9
9
 
10
10
  type Props = {
11
11
  slotProps?: CarouselSlotProps;
@@ -24,7 +24,7 @@
24
24
 
25
25
  <div class="w-full flex justify-center">
26
26
  <div
27
- class="w-[95%] p-2 rounded-xl
27
+ class="w-full p-2 rounded-xl
28
28
  {isBorder ? 'border border-gray-50 dark:border-gray-800' : ''}
29
29
  {containerClass}"
30
30
  >
@@ -43,9 +43,8 @@
43
43
  {#if onButtonViewAll}
44
44
  <div>
45
45
  <Button
46
- variant="ghost"
47
- size="sm"
48
- class="flex items-center gap-0.5"
46
+ variant="outline"
47
+ class="flex items-center gap-0.5 border"
49
48
  onclick={onButtonViewAll}
50
49
  >
51
50
  {$t("label.view.full")}
@@ -6,14 +6,17 @@ export interface ItemGridProps {
6
6
  description?: string;
7
7
  iconClass?: string;
8
8
  titleClass?: string;
9
+ itemClassName?: string;
9
10
  descriptionClass?: string;
10
11
  icon: string | IconSvgElement;
11
12
  onClick?: (id: string | number) => void;
12
13
  }
13
14
  export interface GridProps {
14
15
  items?: ItemGridProps[];
16
+ itemClassName?: string;
15
17
  className?: string;
16
18
  variant?: 1 | 2;
17
19
  isLoading?: boolean;
20
+ selectedKey?: string | number;
18
21
  onClick?: (id: string | number) => void;
19
22
  }
@@ -12,6 +12,7 @@
12
12
  iconClass,
13
13
  titleClass,
14
14
  description,
15
+ itemClassName,
15
16
  descriptionClass,
16
17
  onClick,
17
18
  }: ItemGridProps = $props();
@@ -21,7 +22,7 @@
21
22
  onclick={() => {
22
23
  if (id && onClick) onClick(id);
23
24
  }}
24
- class="flex flex-col justify-center items-center gap-2 hover:bg-primary/30 rounded-xl"
25
+ class="flex flex-col justify-center items-center gap-2 rounded-xl {itemClassName}"
25
26
  >
26
27
  <IconRenderGrid {icon} {iconClass} {isLoading} />
27
28
  <TitleGrid {titleClass} {title} {isLoading} />
@@ -12,6 +12,7 @@
12
12
  description,
13
13
  iconClass,
14
14
  titleClass,
15
+ itemClassName,
15
16
  descriptionClass,
16
17
  onClick,
17
18
  }: ItemGridProps = $props();
@@ -21,7 +22,7 @@
21
22
  onclick={() => {
22
23
  if (id && onClick) onClick(id);
23
24
  }}
24
- class="flex flex-col justify-center items-center gap-2 border rounded-lg p-2 cursor-pointer hover:bg-primary/30"
25
+ class="flex flex-col justify-center items-center gap-2 border rounded-lg p-2 cursor-pointer {itemClassName}"
25
26
  >
26
27
  <IconRenderGrid {icon} {iconClass} {isLoading} />
27
28
  <TitleGrid {titleClass} {title} {isLoading} />
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import type { GridProps } from "../data/types";
3
+ import PanelCarousel from "./ItemsPanelCarousel.svelte";
4
+ import PanelGrid from "./ItemsPanelGrid.svelte";
5
+
6
+ let {
7
+ style = "grid",
8
+ onClick,
9
+ ...restProps
10
+ }: GridProps & {
11
+ style?: "inline" | "grid";
12
+ } = $props();
13
+
14
+ let selectedKey = $state<string | number | undefined>("");
15
+
16
+ function selectItem(id: string | number) {
17
+ selectedKey = `${id}`;
18
+ onClick?.(id);
19
+ }
20
+ </script>
21
+
22
+ {#if style == "inline"}
23
+ <PanelCarousel {...restProps} {selectedKey} onClick={selectItem} />
24
+ {:else}
25
+ <PanelGrid {...restProps} {selectedKey} onClick={selectItem} />
26
+ {/if}
@@ -0,0 +1,7 @@
1
+ import type { GridProps } from "../data/types";
2
+ type $$ComponentProps = GridProps & {
3
+ style?: "inline" | "grid";
4
+ };
5
+ declare const ItemsPanel: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ItemsPanel = ReturnType<typeof ItemsPanel>;
7
+ export default ItemsPanel;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import * as Carousel from "../../../ui/carousel/index.js";
3
+ import type { GridProps } from "../data/types";
4
+ import Grid02 from "./02/Grid02.svelte";
5
+ import Grid01 from "./01/Grid01.svelte";
6
+
7
+ let { variant, isLoading, items, itemClassName, onClick }: GridProps =
8
+ $props();
9
+ </script>
10
+
11
+ <Carousel.Root>
12
+ <Carousel.Content>
13
+ {#if isLoading}
14
+ <div class="flex items-center justify-between w-full gap-1 md:gap-2">
15
+ {#each Array.from({ length: 10 }) as _, i (`skeleton-${i}`)}
16
+ <Carousel.Item class="basis-auto relative">
17
+ {#if variant == 2}
18
+ <Grid02 title={`${i}`} description="" icon="" {isLoading} />
19
+ {:else}
20
+ <Grid01 title={`${i}`} description="" icon="" {isLoading} />
21
+ {/if}
22
+ </Carousel.Item>
23
+ {/each}
24
+ </div>
25
+ {:else}
26
+ {#each items as item, i (`panel-${i}`)}
27
+ <Carousel.Item class="basis-auto relative">
28
+ {#if variant == 2}
29
+ <Grid02 {...item} {onClick} {itemClassName} />
30
+ {:else}
31
+ <Grid01 {...item} {onClick} {itemClassName} />
32
+ {/if}
33
+ </Carousel.Item>
34
+ {/each}
35
+ {/if}
36
+ </Carousel.Content>
37
+ </Carousel.Root>
@@ -0,0 +1,4 @@
1
+ import type { GridProps } from "../data/types";
2
+ declare const ItemsPanelCarousel: import("svelte").Component<GridProps, {}, "">;
3
+ type ItemsPanelCarousel = ReturnType<typeof ItemsPanelCarousel>;
4
+ export default ItemsPanelCarousel;
@@ -4,7 +4,14 @@
4
4
  import Grid02 from "./02/Grid02.svelte";
5
5
  import Grid01 from "./01/Grid01.svelte";
6
6
 
7
- let { variant, className, isLoading, items, onClick }: GridProps = $props();
7
+ let {
8
+ variant,
9
+ className,
10
+ isLoading,
11
+ items,
12
+ itemClassName,
13
+ onClick,
14
+ }: GridProps = $props();
8
15
 
9
16
  const styleMobile = "flex justify-between overflow-x-auto no-scrollbar";
10
17
 
@@ -14,8 +21,7 @@
14
21
  <div
15
22
  class="gap-4 my-2 {responsive.isMobile
16
23
  ? styleMobile
17
- : 'grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 max-h-237.5 overflow-y-auto'}
18
- {className}"
24
+ : 'grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 max-h-237.5 overflow-y-auto'} {className}"
19
25
  >
20
26
  {#if isLoading}
21
27
  {#each Array.from({ length: responsive.isMobile ? 3 : 10 }) as it, i (i)}
@@ -28,9 +34,9 @@
28
34
  {:else}
29
35
  {#each items as item, i (i)}
30
36
  {#if variant == 2}
31
- <Grid02 {...item} {onClick} />
37
+ <Grid02 {...item} {onClick} {itemClassName} />
32
38
  {:else}
33
- <Grid01 {...item} {onClick} />
39
+ <Grid01 {...item} {onClick} {itemClassName} />
34
40
  {/if}
35
41
  {/each}
36
42
  {/if}
@@ -0,0 +1,4 @@
1
+ import type { GridProps } from "../data/types";
2
+ declare const ItemsPanelGrid: import("svelte").Component<GridProps, {}, "">;
3
+ type ItemsPanelGrid = ReturnType<typeof ItemsPanelGrid>;
4
+ export default ItemsPanelGrid;
@@ -0,0 +1,4 @@
1
+ import type { GridProps } from "../data/types";
2
+ declare const ItemsSimpleGrid: import("svelte").Component<GridProps, {}, "">;
3
+ type ItemsSimpleGrid = ReturnType<typeof ItemsSimpleGrid>;
4
+ export default ItemsSimpleGrid;
@@ -9,9 +9,12 @@ export type ListItemProps = HTMLAttributes<HTMLAnchorElement> & {
9
9
  export type NavigationMenuItemProps = {
10
10
  label: string;
11
11
  href?: string;
12
+ textClass?: string;
12
13
  };
13
14
  export type NavigationMenuItemCardProps = {
14
15
  label?: string;
16
+ textClass?: string;
17
+ subTextClass?: string;
15
18
  header?: {
16
19
  label: string;
17
20
  description: string;
@@ -24,14 +27,19 @@ export type NavigationMenuItemCardProps = {
24
27
  };
25
28
  export type NavigationMenuItemGridProps = {
26
29
  label: string;
30
+ textClass?: string;
31
+ subTextClass?: string;
27
32
  grids?: ListItemProps[];
28
33
  };
29
34
  export type NavigationMenuItemListProps = {
30
35
  label: string;
36
+ textClass?: string;
37
+ subTextClass?: string;
31
38
  list?: ListItemProps[];
32
39
  };
33
40
  export type NavigationMenuItemsProps = {
34
41
  label: string;
42
+ textClass?: string;
35
43
  items?: {
36
44
  title: string;
37
45
  href: string;
@@ -40,6 +48,7 @@ export type NavigationMenuItemsProps = {
40
48
  export type ComplexMenuProps = IMenuProps & {
41
49
  menus: (NavigationMenuItemProps | NavigationMenuItemListProps | NavigationMenuItemCardProps | NavigationMenuItemGridProps | NavigationMenuItemsProps)[];
42
50
  textClass?: string;
51
+ subTextClass?: string;
43
52
  };
44
53
  export type MenuVarientProps = ComplexMenuProps | SimpleMenuProps;
45
54
  export type MenuProps = IMenuProps & {
@@ -13,21 +13,23 @@
13
13
  import NavigationMenuItemList from "./shared/navigation/NavigationMenuItemList.svelte";
14
14
  import NavigationMenuItems from "./shared/navigation/NavigationMenuItems.svelte";
15
15
 
16
- let { menus: links, textClass }: ComplexMenuProps = $props();
16
+ let { menus: links, textClass, subTextClass }: ComplexMenuProps = $props();
17
17
  </script>
18
18
 
19
- <ul class="flex list-none flex-1 flex-wrap items-center justify-center {textClass}">
19
+ <ul
20
+ class="flex list-none flex-1 flex-wrap items-center justify-center {textClass}"
21
+ >
20
22
  {#each links as link, i (i)}
21
23
  {#if isCard(link)}
22
- <NavigationMenuItemCard {...link} />
24
+ <NavigationMenuItemCard {...link} {textClass} {subTextClass} />
23
25
  {:else if isGrid(link)}
24
- <NavigationMenuItemGrid {...link} />
26
+ <NavigationMenuItemGrid {...link} {textClass} {subTextClass} />
25
27
  {:else if isList(link)}
26
- <NavigationMenuItemList {...link} />
28
+ <NavigationMenuItemList {...link} {textClass} {subTextClass} />
27
29
  {:else if isItems(link)}
28
- <NavigationMenuItems {...link} />
30
+ <NavigationMenuItems {...link} {textClass} />
29
31
  {:else if isItem(link)}
30
- <NavigationMenuItem {...link} />
32
+ <NavigationMenuItem {...link} {textClass} />
31
33
  {/if}
32
34
  {/each}
33
- </ul>
35
+ </ul>
@@ -21,9 +21,18 @@
21
21
  let { menus: links }: ComplexMenuProps = $props();
22
22
  </script>
23
23
 
24
- {#snippet headerSnippet(header: NonNullable<NavigationMenuItemCardProps["header"]>)}
25
- <div class="mt-4 mb-2 text-lg font-medium {header.labelClass}">{header.label}</div>
26
- <p class="text-sm leading-tight {header.descriptionClass || 'text-muted-foreground'}">{header.description}</p>
24
+ {#snippet headerSnippet(
25
+ header: NonNullable<NavigationMenuItemCardProps["header"]>,
26
+ )}
27
+ <div class="mt-4 mb-2 text-lg font-medium {header.labelClass}">
28
+ {header.label}
29
+ </div>
30
+ <p
31
+ class="text-sm leading-tight {header.descriptionClass ||
32
+ 'text-muted-foreground'}"
33
+ >
34
+ {header.description}
35
+ </p>
27
36
  {/snippet}
28
37
 
29
38
  <MenuMobile>
@@ -34,8 +43,19 @@
34
43
  <CollapsibleNavMenu label={card.label ?? card.header?.label ?? ""}>
35
44
  <ul class="grid gap-2 p-2">
36
45
  {#if card.header}
37
- <li class="relative row-span-3" style={card.header.imgUrl ? `background-image: url(${card.header.imgUrl}); background-repeat: no-repeat; background-size: cover; background-position: center; border-radius: 12px;` : ""}>
38
- <a href={card.header.href ?? "#"} class="flex h-full w-full flex-col justify-end p-4 {card.header.imgUrl ? "no-underline outline-hidden select-none" : "bg-linear-to-b from-muted/50 to-muted rounded-md"}">
46
+ <li
47
+ class="relative row-span-3"
48
+ style={card.header.imgUrl
49
+ ? `background-image: url(${card.header.imgUrl}); background-repeat: no-repeat; background-size: cover; background-position: center; border-radius: 12px;`
50
+ : ""}
51
+ >
52
+ <a
53
+ href={card.header.href ?? "#"}
54
+ class="flex h-full w-full flex-col justify-end p-4 {card
55
+ .header.imgUrl
56
+ ? 'no-underline outline-hidden select-none'
57
+ : 'bg-linear-to-b from-muted/50 to-muted rounded-md'}"
58
+ >
39
59
  {@render headerSnippet(card.header)}
40
60
  </a>
41
61
  </li>
@@ -47,49 +67,56 @@
47
67
  {/if}
48
68
  </ul>
49
69
  </CollapsibleNavMenu>
50
-
51
70
  {:else if isGrid(link)}
52
71
  {@const grid = link as NavigationMenuItemGridProps}
53
72
  <CollapsibleNavMenu label={grid.label}>
54
- <ul class="grid grid-cols-2 gap-2 p-2">
73
+ <ul class="grid grid-cols-2 gap-2 max-h-37.5 overflow-y-auto p-2">
55
74
  {#each grid.grids ?? [] as item, j (j)}
56
75
  <NavMenuItem {...item} />
57
76
  {/each}
58
77
  </ul>
59
78
  </CollapsibleNavMenu>
60
-
61
79
  {:else if isList(link)}
62
80
  {@const list = link as NavigationMenuItemListProps}
63
81
  <CollapsibleNavMenu label={list.label}>
64
82
  <ul class="grid gap-4 p-2">
65
83
  {#each list.list ?? [] as item, j (j)}
66
84
  <li>
67
- <a href={item.href} class="block rounded-md p-2 no-underline hover:bg-accent">
85
+ <a
86
+ href={item.href}
87
+ class="block rounded-md p-2 no-underline hover:bg-accent"
88
+ >
68
89
  <div class="font-medium">{item.title ?? ""}</div>
69
- <div class="text-sm text-muted-foreground">{item.content}</div>
90
+ <div class="text-sm text-muted-foreground">
91
+ {item.content}
92
+ </div>
70
93
  </a>
71
94
  </li>
72
95
  {/each}
73
96
  </ul>
74
97
  </CollapsibleNavMenu>
75
-
76
98
  {:else if isItems(link)}
77
99
  {@const items = link as NavigationMenuItemsProps}
78
100
  <CollapsibleNavMenu label={items.label}>
79
101
  <ul class="grid min-w-50 gap-4 p-2">
80
102
  {#each items.items ?? [] as item, j (j)}
81
103
  <li>
82
- <a href={item.href} class="block rounded-md px-3 py-2 text-sm font-medium no-underline hover:bg-accent">
104
+ <a
105
+ href={item.href}
106
+ class="block rounded-md px-3 py-2 text-sm font-medium no-underline hover:bg-accent"
107
+ >
83
108
  {item.title}
84
109
  </a>
85
110
  </li>
86
111
  {/each}
87
112
  </ul>
88
113
  </CollapsibleNavMenu>
89
-
90
114
  {:else if isItem(link)}
91
115
  {@const item = link as NavigationMenuItemProps}
92
- <a href={item.href} class="block w-full rounded-xl px-3 py-2 text-sm font-medium no-underline hover:bg-accent focus:bg-accent">
116
+ <a
117
+ href={item.href}
118
+ class="block w-full rounded-xl px-3 py-2 text-sm font-medium no-underline hover:bg-accent focus:bg-accent"
119
+ >
93
120
  {item.label}
94
121
  </a>
95
122
  {/if}
@@ -6,9 +6,14 @@
6
6
  content,
7
7
  href,
8
8
  icon,
9
+ textClass,
10
+ subTextClass,
9
11
  class: className,
10
12
  ...restProps
11
- }: ListItemProps = $props();
13
+ }: ListItemProps & {
14
+ textClass?: string;
15
+ subTextClass?: string;
16
+ } = $props();
12
17
  </script>
13
18
 
14
19
  <li>
@@ -36,4 +41,4 @@
36
41
  {content}
37
42
  </p>
38
43
  </a>
39
- </li>
44
+ </li>
@@ -1,4 +1,8 @@
1
1
  import type { ListItemProps } from "../../data/types";
2
- declare const MenuListItem: import("svelte").Component<ListItemProps, {}, "">;
2
+ type $$ComponentProps = ListItemProps & {
3
+ textClass?: string;
4
+ subTextClass?: string;
5
+ };
6
+ declare const MenuListItem: import("svelte").Component<$$ComponentProps, {}, "">;
3
7
  type MenuListItem = ReturnType<typeof MenuListItem>;
4
8
  export default MenuListItem;
@@ -20,7 +20,7 @@
20
20
  {#if items}
21
21
  {@const gridCols = cols()}
22
22
  <DropdownMenu.SubContent>
23
- <ul class={`grid w-75 gap-2 p-2 sm:w-100 md:w-125 ${gridCols}`}>
23
+ <ul class={`grid w-75 gap-2 p-2 sm:w-100 md:w-125 ${gridCols}`}>
24
24
  {#each items as item, i (i)}
25
25
  <DropdownMenuListItem {...item} />
26
26
  {/each}
@@ -70,9 +70,9 @@
70
70
 
71
71
  {#if open}
72
72
  <div
73
- class="absolute left-0 top-full z-50 mt-1.5 w-max rounded-2xl bg-popover p-2.5 pr-3 overflow-hidden text-popover-foreground shadow-2xl ring-1 ring-foreground/5"
73
+ class="absolute left-0 top-full z-50 md:z-100 mt-1.5 w-max rounded-2xl bg-popover p-2.5 pr-3 overflow-hidden text-popover-foreground shadow-2xl ring-1 ring-foreground/5"
74
74
  >
75
75
  {@render children()}
76
76
  </div>
77
77
  {/if}
78
- </li>
78
+ </li>
@@ -1,14 +1,14 @@
1
1
  <script lang="ts">
2
2
  import type { NavigationMenuItemProps } from "../../../data/types";
3
3
 
4
- let { label, href }: NavigationMenuItemProps = $props();
4
+ let { label, href, textClass }: NavigationMenuItemProps = $props();
5
5
  </script>
6
6
 
7
7
  <li>
8
8
  <a
9
9
  {href}
10
- class="inline-flex h-9 w-max items-center justify-center rounded-2xl px-4.5 py-2.5 text-sm font-medium transition-all outline-none select-none hover:bg-muted focus:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
10
+ class="inline-flex h-9 w-max items-center justify-center rounded-2xl px-4.5 py-2.5 text-sm font-medium transition-all outline-none select-none hover:bg-muted focus:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 {textClass}"
11
11
  >
12
12
  {label}
13
13
  </a>
14
- </li>
14
+ </li>
@@ -3,11 +3,19 @@
3
3
  import MenuListItem from "../MenuListItem.svelte";
4
4
  import NavDropdown from "./NavDropdown.svelte";
5
5
 
6
- let { label, header, cards: items }: NavigationMenuItemCardProps = $props();
6
+ let {
7
+ label,
8
+ header,
9
+ cards: items,
10
+ textClass,
11
+ subTextClass,
12
+ }: NavigationMenuItemCardProps = $props();
7
13
  </script>
8
14
 
9
15
  {#snippet headerSnippet(label: string, description: string)}
10
- <div class="mt-4 mb-2 text-lg font-medium {header?.labelClass}">{label}</div>
16
+ <div class="mt-4 mb-2 text-lg font-medium {header?.labelClass}">
17
+ {label}
18
+ </div>
11
19
  <p
12
20
  class="text-sm leading-tight {header?.descriptionClass ||
13
21
  'text-muted-foreground'}"
@@ -17,9 +25,7 @@
17
25
  {/snippet}
18
26
 
19
27
  <NavDropdown label={label ?? header?.label ?? ""}>
20
- <ul
21
- class="grid gap-2 p-2 w-100 lg:w-125 lg:grid-cols-[.75fr_1fr]"
22
- >
28
+ <ul class="grid gap-2 p-2 w-100 lg:w-125 lg:grid-cols-[.75fr_1fr]">
23
29
  {#if header}
24
30
  <li
25
31
  class="row-span-3 relative"
@@ -45,4 +51,4 @@
45
51
  {/each}
46
52
  {/if}
47
53
  </ul>
48
- </NavDropdown>
54
+ </NavDropdown>
@@ -3,7 +3,12 @@
3
3
  import MenuListItem from "../MenuListItem.svelte";
4
4
  import NavDropdown from "./NavDropdown.svelte";
5
5
 
6
- let { label, grids: items }: NavigationMenuItemGridProps = $props();
6
+ let {
7
+ label,
8
+ grids: items,
9
+ textClass,
10
+ subTextClass,
11
+ }: NavigationMenuItemGridProps = $props();
7
12
 
8
13
  const cols = (): string => {
9
14
  const len = items?.length ?? 0;
@@ -20,11 +25,11 @@
20
25
  <NavDropdown {label}>
21
26
  {#if items}
22
27
  <ul
23
- class={`grid w-75 gap-2 p-2 sm:w-100 md:w-125 lg:min-w-150 ${gridCols}`}
28
+ class={`grid w-75 gap-2 p-2 sm:w-100 md:w-125 lg:min-w-150 max-h-75 overflow-y-auto ${gridCols}`}
24
29
  >
25
30
  {#each items as item, i (i)}
26
- <MenuListItem {...item} />
31
+ <MenuListItem {...item} {textClass} {subTextClass} />
27
32
  {/each}
28
33
  </ul>
29
34
  {/if}
30
- </NavDropdown>
35
+ </NavDropdown>
@@ -9,7 +9,10 @@
9
9
  <ul class="grid w-75 gap-4 p-2">
10
10
  {#each list as item, i (i)}
11
11
  <li>
12
- <a href={item.href} class="block rounded-xl p-2 no-underline hover:bg-muted">
12
+ <a
13
+ href={item.href}
14
+ class="block rounded-xl p-2 no-underline hover:bg-muted"
15
+ >
13
16
  <div class="font-medium">{item.title ?? ""}</div>
14
17
  <div class="text-muted-foreground">
15
18
  {item.content}
@@ -18,4 +21,4 @@
18
21
  </li>
19
22
  {/each}
20
23
  </ul>
21
- </NavDropdown>
24
+ </NavDropdown>
@@ -2,7 +2,7 @@
2
2
  import type { NavigationMenuItemsProps } from "../../../data/types";
3
3
  import NavDropdown from "./NavDropdown.svelte";
4
4
 
5
- let { label, items }: NavigationMenuItemsProps = $props();
5
+ let { label, items, textClass }: NavigationMenuItemsProps = $props();
6
6
  </script>
7
7
 
8
8
  <NavDropdown {label} className="hidden md:block">
@@ -18,4 +18,4 @@
18
18
  </li>
19
19
  {/each}
20
20
  </ul>
21
- </NavDropdown>
21
+ </NavDropdown>
package/dist/globals.css CHANGED
@@ -9,6 +9,7 @@
9
9
  --color-red-600: oklch(57.7% 0.245 27.325);
10
10
  --color-red-800: oklch(44.4% 0.177 26.899);
11
11
  --color-red-900: oklch(39.6% 0.141 25.723);
12
+ --color-amber-50: oklch(98.7% 0.022 95.277);
12
13
  --color-yellow-500: oklch(79.5% 0.184 86.047);
13
14
  --color-green-500: oklch(72.3% 0.219 149.579);
14
15
  --color-green-600: oklch(62.7% 0.194 149.214);
@@ -876,12 +877,18 @@
876
877
  .h-svh {
877
878
  height: 100svh;
878
879
  }
880
+ .max-h-37\.5 {
881
+ max-height: calc(var(--spacing) * 37.5);
882
+ }
879
883
  .max-h-50 {
880
884
  max-height: calc(var(--spacing) * 50);
881
885
  }
882
886
  .max-h-72 {
883
887
  max-height: calc(var(--spacing) * 72);
884
888
  }
889
+ .max-h-75 {
890
+ max-height: calc(var(--spacing) * 75);
891
+ }
885
892
  .max-h-237\.5 {
886
893
  max-height: calc(var(--spacing) * 237.5);
887
894
  }
@@ -1029,9 +1036,6 @@
1029
1036
  .w-\[60\%\] {
1030
1037
  width: 60%;
1031
1038
  }
1032
- .w-\[95\%\] {
1033
- width: 95%;
1034
- }
1035
1039
  .w-\[100px\] {
1036
1040
  width: 100px;
1037
1041
  }
@@ -1695,6 +1699,9 @@
1695
1699
  .bg-accent {
1696
1700
  background-color: var(--accent);
1697
1701
  }
1702
+ .bg-amber-50 {
1703
+ background-color: var(--color-amber-50);
1704
+ }
1698
1705
  .bg-background {
1699
1706
  background-color: var(--background);
1700
1707
  }
@@ -3361,14 +3368,6 @@
3361
3368
  .hover\:bg-neutral-800:hover {
3362
3369
  background-color: var(--color-neutral-800);
3363
3370
  }
3364
- .hover\:bg-primary\/30:hover {
3365
- background-color: var(--primary);
3366
- }
3367
- @supports (color: color-mix(in lab, red, red)) {
3368
- .hover\:bg-primary\/30:hover {
3369
- background-color: color-mix(in oklab, var(--primary) 30%, transparent);
3370
- }
3371
- }
3372
3371
  .hover\:bg-primary\/80:hover {
3373
3372
  background-color: var(--primary);
3374
3373
  }
@@ -4274,6 +4273,9 @@
4274
4273
  .md\:left-6 {
4275
4274
  left: calc(var(--spacing) * 6);
4276
4275
  }
4276
+ .md\:z-100 {
4277
+ z-index: 100;
4278
+ }
4277
4279
  .md\:col-span-2 {
4278
4280
  grid-column: span 2 / span 2;
4279
4281
  }
@@ -4381,9 +4383,6 @@
4381
4383
  .md\:w-52 {
4382
4384
  width: calc(var(--spacing) * 52);
4383
4385
  }
4384
- .md\:w-100 {
4385
- width: calc(var(--spacing) * 100);
4386
- }
4387
4386
  .md\:w-125 {
4388
4387
  width: calc(var(--spacing) * 125);
4389
4388
  }
package/dist/index.d.ts CHANGED
@@ -34,8 +34,8 @@ import PageLogin from "./components/pages/security/login/PageLogin.svelte";
34
34
  import SearchInput from "./components/core/search/SearchInput.svelte";
35
35
  import Footer from "./components/core/footer/ui/Footer.svelte";
36
36
  import NegoDesign from "./components/NegoDesign.svelte";
37
- import SimpleGrid from "./components/core/grid/ui/SimpleGrid.svelte";
38
- import PanelGrid from "./components/core/grid/ui/PanelGrid.svelte";
37
+ import ItemsSimpleGrid from "./components/core/grid/ui/ItemsSimpleGrid.svelte";
38
+ import ItemsPanel from "./components/core/grid/ui/ItemsPanel.svelte";
39
39
  /** Store reativa do idioma atual. Altere com `$locale = "pt"`. */
40
40
  export { locale } from "./i18n";
41
41
  /** Lista de idiomas disponíveis. Atualizado automaticamente. */
@@ -46,7 +46,7 @@ export { t } from "./i18n";
46
46
  export { getMergedTranslations } from "./i18n/config";
47
47
  /** Retorna a lista de idiomas disponíveis. */
48
48
  export { getLocales } from "./i18n/config";
49
- export { Menu, SimpleGrid, PanelGrid,
49
+ export { Menu, ItemsSimpleGrid, ItemsPanel,
50
50
  /**
51
51
  * Componente raiz do Negodesign.
52
52
  * Configura o tema, idioma e traduções da aplicação.
package/dist/index.js CHANGED
@@ -34,8 +34,8 @@ import PageLogin from "./components/pages/security/login/PageLogin.svelte";
34
34
  import SearchInput from "./components/core/search/SearchInput.svelte";
35
35
  import Footer from "./components/core/footer/ui/Footer.svelte";
36
36
  import NegoDesign from "./components/NegoDesign.svelte";
37
- import SimpleGrid from "./components/core/grid/ui/SimpleGrid.svelte";
38
- import PanelGrid from "./components/core/grid/ui/PanelGrid.svelte";
37
+ import ItemsSimpleGrid from "./components/core/grid/ui/ItemsSimpleGrid.svelte";
38
+ import ItemsPanel from "./components/core/grid/ui/ItemsPanel.svelte";
39
39
  /** Store reativa do idioma atual. Altere com `$locale = "pt"`. */
40
40
  export { locale } from "./i18n";
41
41
  /** Lista de idiomas disponíveis. Atualizado automaticamente. */
@@ -46,7 +46,7 @@ export { t } from "./i18n";
46
46
  export { getMergedTranslations } from "./i18n/config";
47
47
  /** Retorna a lista de idiomas disponíveis. */
48
48
  export { getLocales } from "./i18n/config";
49
- export { Menu, SimpleGrid, PanelGrid,
49
+ export { Menu, ItemsSimpleGrid, ItemsPanel,
50
50
  /**
51
51
  * Componente raiz do Negodesign.
52
52
  * Configura o tema, idioma e traduções da aplicação.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "negodesign",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -1,4 +0,0 @@
1
- import type { GridProps } from "../data/types";
2
- declare const PanelGrid: import("svelte").Component<GridProps, {}, "">;
3
- type PanelGrid = ReturnType<typeof PanelGrid>;
4
- export default PanelGrid;
@@ -1,4 +0,0 @@
1
- import type { GridProps } from "../data/types";
2
- declare const SimpleGrid: import("svelte").Component<GridProps, {}, "">;
3
- type SimpleGrid = ReturnType<typeof SimpleGrid>;
4
- export default SimpleGrid;
@@ -1,15 +0,0 @@
1
- <script lang="ts">
2
- import * as NavigationMenu from "../../../../../ui/navigation-menu/index.js";
3
- import type { NavigationMenuItemProps } from "../../../data/types";
4
- import { navigationMenuTriggerStyle } from "../../../../../ui/navigation-menu/navigation-menu-trigger.svelte";
5
-
6
- let { label, href }: NavigationMenuItemProps = $props();
7
- </script>
8
-
9
- <NavigationMenu.Item>
10
- <NavigationMenu.Link>
11
- {#snippet child()}
12
- <a {href} class={navigationMenuTriggerStyle()}>{label}</a>
13
- {/snippet}
14
- </NavigationMenu.Link>
15
- </NavigationMenu.Item>
@@ -1,4 +0,0 @@
1
- import type { NavigationMenuItemProps } from "../../../data/types";
2
- declare const NavigationMenuItem: import("svelte").Component<NavigationMenuItemProps, {}, "">;
3
- type NavigationMenuItem = ReturnType<typeof NavigationMenuItem>;
4
- export default NavigationMenuItem;
@@ -1,62 +0,0 @@
1
- <script lang="ts">
2
- import * as NavigationMenu from "../../../../../ui/navigation-menu/index.js";
3
- import type { NavigationMenuItemCardProps } from "../../../data/types";
4
- import MenuListItem from "../MenuListItem.svelte";
5
-
6
- let { label, header, cards: items }: NavigationMenuItemCardProps = $props();
7
- </script>
8
-
9
- {#snippet headerSnippet(label: string, description: string)}
10
- <div class="mt-4 mb-2 text-lg font-medium {header?.labelClass}">{label}</div>
11
- <p
12
- class="text-sm leading-tight {header?.descriptionClass ||
13
- 'text-muted-foreground'}"
14
- >
15
- {description}
16
- </p>
17
- {/snippet}
18
-
19
- <NavigationMenu.Item>
20
- <NavigationMenu.Trigger>{label}</NavigationMenu.Trigger>
21
- <NavigationMenu.Content>
22
- <ul class="grid gap-2 p-2 md:w-100 lg:w-125 lg:grid-cols-[.75fr_1fr]">
23
- {#if header}
24
- <li
25
- class="row-span-3 relative"
26
- style={header.imgUrl
27
- ? `background-image: url(${header.imgUrl}); background-repeat: no-repeat; background-size: cover; background-position: center; border-radius: 12px;`
28
- : ``}
29
- >
30
- <NavigationMenu.Link
31
- class={`flex h-full w-full flex-col justify-end p-4 md:p-6 ${
32
- header.imgUrl
33
- ? `no-underline outline-hidden select-none`
34
- : `bg-linear-to-b from-muted/50 to-muted rounded-md focus:shadow-md`
35
- }`}
36
- >
37
- {#snippet child({ props })}
38
- {#if header.imgUrl}
39
- <a
40
- {...props}
41
- href={header.href ?? "#"}
42
- class="bg-transparent absolute left-2 bottom-2"
43
- >
44
- {@render headerSnippet(header.label, header.description)}
45
- </a>
46
- {:else}
47
- <a {...props} href={header.href ?? "#"}>
48
- {@render headerSnippet(header.label, header.description)}
49
- </a>
50
- {/if}
51
- {/snippet}
52
- </NavigationMenu.Link>
53
- </li>
54
- {/if}
55
- {#if items && items.length > 0}
56
- {#each items as item, i (i)}
57
- <MenuListItem {...item} />
58
- {/each}
59
- {/if}
60
- </ul>
61
- </NavigationMenu.Content>
62
- </NavigationMenu.Item>
@@ -1,4 +0,0 @@
1
- import type { NavigationMenuItemCardProps } from "../../../data/types";
2
- declare const NavigationMenuItemCard: import("svelte").Component<NavigationMenuItemCardProps, {}, "">;
3
- type NavigationMenuItemCard = ReturnType<typeof NavigationMenuItemCard>;
4
- export default NavigationMenuItemCard;
@@ -1,32 +0,0 @@
1
- <script lang="ts">
2
- import * as NavigationMenu from "../../../../../ui/navigation-menu/index.js";
3
- import type { NavigationMenuItemGridProps } from "../../../data/types";
4
- import MenuListItem from "../MenuListItem.svelte";
5
-
6
- let { label, grids: items }: NavigationMenuItemGridProps = $props();
7
-
8
- const cols = (): string => {
9
- const len = items?.length ?? 0;
10
- if (len > 10) return "md:grid-cols-3 lg:grid-cols-4";
11
- if (len > 5) return "md:grid-cols-3";
12
- if (len % 3 == 0) return "md:grid-cols-3";
13
- if (len % 2 == 0) return "md:grid-cols-2";
14
- return "grid-cols-1";
15
- };
16
- </script>
17
-
18
- <NavigationMenu.Item>
19
- <NavigationMenu.Trigger>{label}</NavigationMenu.Trigger>
20
- {#if items}
21
- {@const gridCols = cols()}
22
- <NavigationMenu.Content>
23
- <ul
24
- class={`grid w-75 gap-2 p-2 sm:w-100 md:w-125 ${gridCols} lg:min-w-150`}
25
- >
26
- {#each items as item, i (i)}
27
- <MenuListItem {...item} />
28
- {/each}
29
- </ul>
30
- </NavigationMenu.Content>
31
- {/if}
32
- </NavigationMenu.Item>
@@ -1,4 +0,0 @@
1
- import type { NavigationMenuItemGridProps } from "../../../data/types";
2
- declare const NavigationMenuItemGrid: import("svelte").Component<NavigationMenuItemGridProps, {}, "">;
3
- type NavigationMenuItemGrid = ReturnType<typeof NavigationMenuItemGrid>;
4
- export default NavigationMenuItemGrid;
@@ -1,24 +0,0 @@
1
- <script lang="ts">
2
- import * as NavigationMenu from "../../../../../ui/navigation-menu/index.js";
3
- import type { NavigationMenuItemListProps } from "../../../data/types";
4
-
5
- let { label, list }: NavigationMenuItemListProps = $props();
6
- </script>
7
-
8
- <NavigationMenu.Item class="hidden md:block relative">
9
- <NavigationMenu.Trigger>{label}</NavigationMenu.Trigger>
10
- <NavigationMenu.Content>
11
- <ul class="grid w-75 gap-4 p-2">
12
- {#each list as item, i (i)}
13
- <li>
14
- <NavigationMenu.Link href={item.href}>
15
- <div class="font-medium">{item.title ?? ""}</div>
16
- <div class="text-muted-foreground">
17
- {item.content}
18
- </div>
19
- </NavigationMenu.Link>
20
- </li>
21
- {/each}
22
- </ul>
23
- </NavigationMenu.Content>
24
- </NavigationMenu.Item>
@@ -1,4 +0,0 @@
1
- import type { NavigationMenuItemListProps } from "../../../data/types";
2
- declare const NavigationMenuItemList: import("svelte").Component<NavigationMenuItemListProps, {}, "">;
3
- type NavigationMenuItemList = ReturnType<typeof NavigationMenuItemList>;
4
- export default NavigationMenuItemList;
@@ -1,21 +0,0 @@
1
- <script lang="ts">
2
- import * as NavigationMenu from "../../../../../ui/navigation-menu/index.js";
3
- import type { NavigationMenuItemsProps } from "../../../data/types";
4
-
5
- let { label, items }: NavigationMenuItemsProps = $props();
6
- </script>
7
-
8
- <NavigationMenu.Item class="hidden md:block relative">
9
- <NavigationMenu.Trigger>{label}</NavigationMenu.Trigger>
10
- <NavigationMenu.Content>
11
- <ul class="grid min-w-50 gap-4 p-1 md:p-2">
12
- {#each items as item, i (i)}
13
- <li>
14
- <NavigationMenu.Link href={item.href} class="py-1">
15
- {item.title}
16
- </NavigationMenu.Link>
17
- </li>
18
- {/each}
19
- </ul>
20
- </NavigationMenu.Content>
21
- </NavigationMenu.Item>
@@ -1,4 +0,0 @@
1
- import type { NavigationMenuItemsProps } from "../../../data/types";
2
- declare const NavigationMenuItems: import("svelte").Component<NavigationMenuItemsProps, {}, "">;
3
- type NavigationMenuItems = ReturnType<typeof NavigationMenuItems>;
4
- export default NavigationMenuItems;