negodesign 0.0.53 → 0.0.55
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/media/01/CardMedia01.svelte +2 -2
- package/dist/components/core/carousel/badge/ui/CarouselBadge.svelte +54 -29
- package/dist/components/core/carousel/grid/shared/ui/CarouselGridSlot.svelte +3 -3
- package/dist/components/core/carousel/hero/CarouselHero.svelte +1 -1
- package/dist/components/core/carousel/types.d.ts +4 -0
- package/dist/components/core/nav/ui/Menu.svelte +66 -0
- package/dist/components/core/nav/ui/Menu.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/{nav-menu.svelte → NavMenu.svelte} +1 -1
- package/dist/components/core/nav/ui/mobile/nav-menu-drawer.svelte +1 -1
- package/dist/components/core/nav/ui/{menu-links.svelte → shared/MenuLinks.svelte} +2 -2
- package/dist/components/core/nav/ui/{menu-links.svelte.d.ts → shared/MenuLinks.svelte.d.ts} +1 -1
- package/dist/components/core/nav/ui/shared/MenuListItem.svelte +48 -0
- package/dist/components/core/nav/ui/shared/MenuListItem.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItem.svelte +15 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItem.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItemCard.svelte +62 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItemCard.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItemGrid.svelte +32 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItemGrid.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItemList.svelte +24 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItemList.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItems.svelte +21 -0
- package/dist/components/core/nav/ui/shared/NavigationMenuItems.svelte.d.ts +4 -0
- package/dist/components/core/nav/ui/shared/types.d.ts +41 -0
- package/dist/components/core/nav/ui/shared/types.js +1 -0
- package/dist/components/core/sidebar/MenuBarSidebar.svelte +4 -4
- package/dist/components/core/{nav/ui/nav-menu-sidebar.svelte → sidebar/ui/navbar/NavMenuBarSidebar.svelte} +3 -3
- package/dist/components/core/sidebar/ui/navbar/NavMenuBarSidebar.svelte.d.ts +7 -0
- package/dist/components/core/{nav/ui/nav-menu-bottom-sidebar.svelte → sidebar/ui/navbar/NavMenuBottomSidebar.svelte} +2 -2
- package/dist/components/core/{nav/ui/nav-menu-bottom-sidebar.svelte.d.ts → sidebar/ui/navbar/NavMenuBottomSidebar.svelte.d.ts} +2 -2
- package/dist/components/core/{nav/ui/nav-menu-top-bar-sidebar.svelte → sidebar/ui/navbar/NavMenuTopBarSidebar.svelte} +4 -4
- package/dist/components/core/{nav/ui/nav-menu-top-bar-sidebar.svelte.d.ts → sidebar/ui/navbar/NavMenuTopBarSidebar.svelte.d.ts} +1 -1
- package/dist/components/core/{nav/ui/nav-user-sidebar.svelte → sidebar/ui/navbar/NavUserSidebar.svelte} +6 -6
- package/dist/components/core/{nav/ui/nav-user-sidebar.svelte.d.ts → sidebar/ui/navbar/NavUserSidebar.svelte.d.ts} +1 -1
- package/dist/components/core/{nav/ui → sidebar/ui/navbar}/nav-menu-header-sidebar.svelte +3 -3
- package/dist/components/ui/navigation-menu/index.d.ts +9 -0
- package/dist/components/ui/navigation-menu/index.js +11 -0
- package/dist/components/ui/navigation-menu/navigation-menu-content.svelte +20 -0
- package/dist/components/ui/navigation-menu/navigation-menu-content.svelte.d.ts +4 -0
- package/dist/components/ui/navigation-menu/navigation-menu-indicator.svelte +22 -0
- package/dist/components/ui/navigation-menu/navigation-menu-indicator.svelte.d.ts +4 -0
- package/dist/components/ui/navigation-menu/navigation-menu-item.svelte +17 -0
- package/dist/components/ui/navigation-menu/navigation-menu-item.svelte.d.ts +4 -0
- package/dist/components/ui/navigation-menu/navigation-menu-link.svelte +17 -0
- package/dist/components/ui/navigation-menu/navigation-menu-link.svelte.d.ts +4 -0
- package/dist/components/ui/navigation-menu/navigation-menu-list.svelte +20 -0
- package/dist/components/ui/navigation-menu/navigation-menu-list.svelte.d.ts +4 -0
- package/dist/components/ui/navigation-menu/navigation-menu-trigger.svelte +30 -0
- package/dist/components/ui/navigation-menu/navigation-menu-trigger.svelte.d.ts +5 -0
- package/dist/components/ui/navigation-menu/navigation-menu-viewport.svelte +22 -0
- package/dist/components/ui/navigation-menu/navigation-menu-viewport.svelte.d.ts +4 -0
- package/dist/components/ui/navigation-menu/navigation-menu.svelte +31 -0
- package/dist/components/ui/navigation-menu/navigation-menu.svelte.d.ts +7 -0
- package/dist/globals.css +324 -12
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/core/nav/ui/nav-menu-sidebar.svelte.d.ts +0 -7
- /package/dist/components/core/nav/ui/{nav-menu.svelte.d.ts → NavMenu.svelte.d.ts} +0 -0
- /package/dist/components/core/{nav/ui → sidebar/ui/navbar}/nav-menu-header-sidebar.svelte.d.ts +0 -0
|
@@ -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-
|
|
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
|
|
21
|
-
const
|
|
22
|
-
|
|
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
|
-
|
|
58
|
-
<Carousel.
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
class="
|
|
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
|
-
{
|
|
88
|
+
{isInlineBorder ? 'pb-3' : ''}
|
|
72
89
|
{itemClass}
|
|
73
90
|
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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.
|
|
82
|
-
|
|
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
|
|
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
|
/**
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../ui/navigation-menu/index.js";
|
|
3
|
+
import { useDevice } from "../../../../hooks/responsive.svelte";
|
|
4
|
+
import type {
|
|
5
|
+
MenuProps,
|
|
6
|
+
NavigationMenuItemProps,
|
|
7
|
+
NavigationMenuItemListProps,
|
|
8
|
+
NavigationMenuItemCardProps,
|
|
9
|
+
NavigationMenuItemGridProps,
|
|
10
|
+
NavigationMenuItemsProps,
|
|
11
|
+
} from "./shared/types";
|
|
12
|
+
import NavigationMenuItemGrid from "./shared/NavigationMenuItemGrid.svelte";
|
|
13
|
+
import NavigationMenuItemCard from "./shared/NavigationMenuItemCard.svelte";
|
|
14
|
+
import NavigationMenuItem from "./shared/NavigationMenuItem.svelte";
|
|
15
|
+
import NavigationMenuItemList from "./shared/NavigationMenuItemList.svelte";
|
|
16
|
+
import NavigationMenuItems from "./shared/NavigationMenuItems.svelte";
|
|
17
|
+
|
|
18
|
+
const responsive = useDevice();
|
|
19
|
+
|
|
20
|
+
let { links }: MenuProps = $props();
|
|
21
|
+
|
|
22
|
+
type NavMenuItem =
|
|
23
|
+
| NavigationMenuItemCardProps
|
|
24
|
+
| NavigationMenuItemGridProps
|
|
25
|
+
| NavigationMenuItemListProps
|
|
26
|
+
| NavigationMenuItemsProps
|
|
27
|
+
| NavigationMenuItemProps;
|
|
28
|
+
|
|
29
|
+
function isCard(item: NavMenuItem): item is NavigationMenuItemCardProps {
|
|
30
|
+
return "header" in item && "cards" in item;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isGrid(item: NavMenuItem): item is NavigationMenuItemGridProps {
|
|
34
|
+
return "grids" in item && "label" in item;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isList(item: NavMenuItem): item is NavigationMenuItemListProps {
|
|
38
|
+
return "list" in item && "label" in item;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isItems(item: NavMenuItem): item is NavigationMenuItemsProps {
|
|
42
|
+
return "items" in item && "label" in item;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isItem(item: NavMenuItem): item is NavigationMenuItemProps {
|
|
46
|
+
return "href" in item && "label" in item;
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<NavigationMenu.Root viewport={responsive.isMobile}>
|
|
51
|
+
<NavigationMenu.List class="flex-wrap">
|
|
52
|
+
{#each links as link, i (i)}
|
|
53
|
+
{#if isCard(link)}
|
|
54
|
+
<NavigationMenuItemCard {...link} />
|
|
55
|
+
{:else if isGrid(link)}
|
|
56
|
+
<NavigationMenuItemGrid {...link} />
|
|
57
|
+
{:else if isList(link)}
|
|
58
|
+
<NavigationMenuItemList {...link} />
|
|
59
|
+
{:else if isItems(link)}
|
|
60
|
+
<NavigationMenuItems {...link} />
|
|
61
|
+
{:else if isItem(link)}
|
|
62
|
+
<NavigationMenuItem {...link} />
|
|
63
|
+
{/if}
|
|
64
|
+
{/each}
|
|
65
|
+
</NavigationMenu.List>
|
|
66
|
+
</NavigationMenu.Root>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Login03Icon, User03Icon } from "@hugeicons/core-free-icons";
|
|
9
9
|
import { useDevice } from "../../../../hooks/responsive.svelte";
|
|
10
10
|
import NavMenuDrawer from "./mobile/nav-menu-drawer.svelte";
|
|
11
|
-
import MenuLinks from "./
|
|
11
|
+
import MenuLinks from "./shared/MenuLinks.svelte";
|
|
12
12
|
|
|
13
13
|
let {
|
|
14
14
|
logo,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { cn } from "../../../../../utils.js";
|
|
7
7
|
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
8
8
|
import { Login03Icon, Menu, User03Icon } from "@hugeicons/core-free-icons";
|
|
9
|
-
import MenuLinks from "../
|
|
9
|
+
import MenuLinks from "../shared/MenuLinks.svelte";
|
|
10
10
|
import LightSwitch from "../../../../ui/light-switch/light-switch.svelte";
|
|
11
11
|
import LanguageSwitcher from "../../../../ui/language-switcher/language-switcher.svelte";
|
|
12
12
|
import { t } from "../../../../../i18n";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
3
|
-
import type { NavMenuLinksProps } from "
|
|
3
|
+
import type { NavMenuLinksProps } from "../../data/nav-menu";
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
links: NavMenuLinksProps[];
|
|
@@ -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}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../../ui/navigation-menu/index.js";
|
|
3
|
+
import { cn } from "../../../../../utils";
|
|
4
|
+
import type { ListItemProps } from "./types";
|
|
5
|
+
let {
|
|
6
|
+
title,
|
|
7
|
+
content,
|
|
8
|
+
href,
|
|
9
|
+
icon,
|
|
10
|
+
class: className,
|
|
11
|
+
...restProps
|
|
12
|
+
}: ListItemProps = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#snippet header()}
|
|
16
|
+
<div class="leading-none font-medium">{title}</div>
|
|
17
|
+
{/snippet}
|
|
18
|
+
|
|
19
|
+
<li>
|
|
20
|
+
<NavigationMenu.Link>
|
|
21
|
+
{#snippet child()}
|
|
22
|
+
<a
|
|
23
|
+
{href}
|
|
24
|
+
class={cn(
|
|
25
|
+
"block space-y-1 rounded-md p-3 leading-none no-underline transition-colors outline-none select-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...restProps}
|
|
29
|
+
>
|
|
30
|
+
{#if icon}
|
|
31
|
+
<div class="flex gap-1 items-center">
|
|
32
|
+
<div>
|
|
33
|
+
<i class={`${icon} size-8 md:size-10`}></i>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="-mt-1">
|
|
36
|
+
{@render header()}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
{:else}
|
|
40
|
+
{@render header()}
|
|
41
|
+
{/if}
|
|
42
|
+
<p class="line-clamp-2 text-sm leading-snug text-muted-foreground">
|
|
43
|
+
{content}
|
|
44
|
+
</p>
|
|
45
|
+
</a>
|
|
46
|
+
{/snippet}
|
|
47
|
+
</NavigationMenu.Link>
|
|
48
|
+
</li>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../../ui/navigation-menu/index.js";
|
|
3
|
+
import type { NavigationMenuItemProps } from "./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>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../../ui/navigation-menu/index.js";
|
|
3
|
+
import type { NavigationMenuItemCardProps } from "./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>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigationMenuItemCardProps } from "./types";
|
|
2
|
+
declare const NavigationMenuItemCard: import("svelte").Component<NavigationMenuItemCardProps, {}, "">;
|
|
3
|
+
type NavigationMenuItemCard = ReturnType<typeof NavigationMenuItemCard>;
|
|
4
|
+
export default NavigationMenuItemCard;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../../ui/navigation-menu/index.js";
|
|
3
|
+
import type { NavigationMenuItemGridProps } from "./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>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigationMenuItemGridProps } from "./types";
|
|
2
|
+
declare const NavigationMenuItemGrid: import("svelte").Component<NavigationMenuItemGridProps, {}, "">;
|
|
3
|
+
type NavigationMenuItemGrid = ReturnType<typeof NavigationMenuItemGrid>;
|
|
4
|
+
export default NavigationMenuItemGrid;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../../ui/navigation-menu/index.js";
|
|
3
|
+
import type { NavigationMenuItemListProps } from "./types";
|
|
4
|
+
|
|
5
|
+
let { label, list }: NavigationMenuItemListProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<NavigationMenu.Item class="hidden md:block">
|
|
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>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigationMenuItemListProps } from "./types";
|
|
2
|
+
declare const NavigationMenuItemList: import("svelte").Component<NavigationMenuItemListProps, {}, "">;
|
|
3
|
+
type NavigationMenuItemList = ReturnType<typeof NavigationMenuItemList>;
|
|
4
|
+
export default NavigationMenuItemList;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as NavigationMenu from "../../../../ui/navigation-menu/index.js";
|
|
3
|
+
import type { NavigationMenuItemsProps } from "./types";
|
|
4
|
+
|
|
5
|
+
let { label, items }: NavigationMenuItemsProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<NavigationMenu.Item class="hidden md:block">
|
|
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>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
export type ListItemProps = HTMLAttributes<HTMLAnchorElement> & {
|
|
3
|
+
title: string;
|
|
4
|
+
href: string;
|
|
5
|
+
content: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
};
|
|
8
|
+
export type NavigationMenuItemProps = {
|
|
9
|
+
label: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
};
|
|
12
|
+
export type NavigationMenuItemCardProps = {
|
|
13
|
+
label?: string;
|
|
14
|
+
header?: {
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
imgUrl?: string;
|
|
19
|
+
descriptionClass?: string;
|
|
20
|
+
labelClass?: string;
|
|
21
|
+
};
|
|
22
|
+
cards?: ListItemProps[];
|
|
23
|
+
};
|
|
24
|
+
export type NavigationMenuItemGridProps = {
|
|
25
|
+
label: string;
|
|
26
|
+
grids?: ListItemProps[];
|
|
27
|
+
};
|
|
28
|
+
export type NavigationMenuItemListProps = {
|
|
29
|
+
label: string;
|
|
30
|
+
list?: ListItemProps[];
|
|
31
|
+
};
|
|
32
|
+
export type NavigationMenuItemsProps = {
|
|
33
|
+
label: string;
|
|
34
|
+
items?: {
|
|
35
|
+
title: string;
|
|
36
|
+
href: string;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
export type MenuProps = {
|
|
40
|
+
links: (NavigationMenuItemProps | NavigationMenuItemListProps | NavigationMenuItemCardProps | NavigationMenuItemGridProps | NavigationMenuItemsProps)[];
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
NavMenuSidebarProps,
|
|
9
9
|
} from "../nav/data/nav-menu-sidebar";
|
|
10
10
|
import type { Snippet } from "svelte";
|
|
11
|
-
import NavMenuTopBarSidebar from "
|
|
12
|
-
import NavMenuBottomSidebar from "
|
|
13
|
-
import NavMenuBarSidebar from "
|
|
14
|
-
import NavUserSidebar from "
|
|
11
|
+
import NavMenuTopBarSidebar from "./ui/navbar/NavMenuTopBarSidebar.svelte";
|
|
12
|
+
import NavMenuBottomSidebar from "./ui/navbar/NavMenuBottomSidebar.svelte";
|
|
13
|
+
import NavMenuBarSidebar from "./ui/navbar/NavMenuBarSidebar.svelte";
|
|
14
|
+
import NavUserSidebar from "./ui/navbar/NavUserSidebar.svelte";
|
|
15
15
|
import { t } from "../../../i18n";
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import * as Collapsible from "
|
|
4
|
-
import * as Sidebar from "
|
|
3
|
+
import * as Collapsible from "../../../../ui/collapsible/index.js";
|
|
4
|
+
import * as Sidebar from "../../../../ui/sidebar/index.js";
|
|
5
5
|
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
|
|
6
6
|
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
7
7
|
import type {
|
|
8
8
|
NavMenuAndSubmenuSidebarProps,
|
|
9
9
|
NavMenuItem,
|
|
10
10
|
NavMenuSidebarProps,
|
|
11
|
-
} from "
|
|
11
|
+
} from "../../../nav/data/nav-menu-sidebar";
|
|
12
12
|
|
|
13
13
|
let {
|
|
14
14
|
items,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NavMenuItem } from "../../../nav/data/nav-menu-sidebar";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
items: NavMenuItem[];
|
|
4
|
+
};
|
|
5
|
+
declare const NavMenuBarSidebar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type NavMenuBarSidebar = ReturnType<typeof NavMenuBarSidebar>;
|
|
7
|
+
export default NavMenuBarSidebar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as Sidebar from "
|
|
3
|
-
import type { WithoutChildren } from "
|
|
2
|
+
import * as Sidebar from "../../../../ui/sidebar/index.js";
|
|
3
|
+
import type { WithoutChildren } from "../../../../../utils.js";
|
|
4
4
|
import type { ComponentProps } from "svelte";
|
|
5
5
|
import type { NavMenuSidebarProps } from "../data/nav-menu-sidebar";
|
|
6
6
|
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Sidebar from "
|
|
2
|
-
import type { WithoutChildren } from "
|
|
1
|
+
import * as Sidebar from "../../../../ui/sidebar/index.js";
|
|
2
|
+
import type { WithoutChildren } from "../../../../../utils.js";
|
|
3
3
|
import type { ComponentProps } from "svelte";
|
|
4
4
|
import type { NavMenuSidebarProps } from "../data/nav-menu-sidebar";
|
|
5
5
|
type $$ComponentProps = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as DropdownMenu from "
|
|
3
|
-
import * as Sidebar from "
|
|
4
|
-
import { useSidebar } from "
|
|
5
|
-
import type { NavTopBarSidebarItem } from "
|
|
2
|
+
import * as DropdownMenu from "../../../../ui/dropdown-menu/index.js";
|
|
3
|
+
import * as Sidebar from "../../../../ui/sidebar/index.js";
|
|
4
|
+
import { useSidebar } from "../../../../ui/sidebar/index.js";
|
|
5
|
+
import type { NavTopBarSidebarItem } from "../../../nav/data/nav-top-bar-sidebar";
|
|
6
6
|
import { HugeiconsIcon } from "@hugeicons/svelte";
|
|
7
7
|
import { UnfoldMoreIcon } from "@hugeicons/core-free-icons";
|
|
8
8
|
|