fulldev-ui 0.14.4 → 0.14.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Fulldev UI
2
2
 
3
+ ## 0.14.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#220](https://github.com/fulldotdev/ui/pull/220) [`8e5cd62`](https://github.com/fulldotdev/ui/commit/8e5cd628da654314821ea61841f82e71e36afdff) Thanks [@silveltman](https://github.com/silveltman)! - - Header blocks take `navigationLabel` and `menu` (`label`, `title`, `description`) props for their accessible names, so sites in other languages no longer ship English screen-reader labels. The defaults are the previous English text. The desktop navigation is now named, and the mobile navigation uses the menu title, so the two landmarks have distinct names.
8
+ - `Checkbox` no longer sets the redundant `role="checkbox"` on its native checkbox input.
9
+ - `Label` and `sidebar-1` document why they are exempt from one accessibility lint rule each, so projects that lint installed copies with `eslint-plugin-astro` pass.
10
+
3
11
  ## 0.14.4
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -32,7 +32,6 @@ cd my-project
32
32
  ```json
33
33
  {
34
34
  "compilerOptions": {
35
- "baseUrl": ".",
36
35
  "paths": {
37
36
  "@/*": ["./src/*"]
38
37
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fulldev-ui",
3
3
  "type": "module",
4
- "version": "0.14.4",
4
+ "version": "0.14.5",
5
5
  "description": "Open-source Astro UI components and blocks",
6
6
  "homepage": "https://ui.full.dev",
7
7
  "bugs": "https://github.com/fulldotdev/ui/issues",
@@ -98,19 +98,25 @@
98
98
  "@astrojs/check": "^0.9.9",
99
99
  "@changesets/changelog-github": "^0.7.0",
100
100
  "@changesets/cli": "^2.31.0",
101
+ "@eslint/js": "^10.0.1",
101
102
  "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
103
+ "eslint": "^10.11.0",
104
+ "eslint-plugin-astro": "^3.2.1",
105
+ "eslint-plugin-jsx-a11y": "^6.10.2",
106
+ "globals": "^17.13.0",
102
107
  "prettier": "3.9.3",
103
108
  "prettier-plugin-astro": "0.14.1",
104
109
  "prettier-plugin-tailwindcss": "^0.8.0",
105
- "sharp": "^0.35.2"
110
+ "sharp": "^0.35.2",
111
+ "typescript-eslint": "^8.71.0"
106
112
  },
107
113
  "scripts": {
108
114
  "astro": "astro",
109
115
  "dev": "pnpm stop && astro dev --host 127.0.0.1 --port 4321",
110
116
  "stop": "lsof -tiTCP:4321 -sTCP:LISTEN | xargs kill 2>/dev/null || true",
111
117
  "preview": "pnpm stop && pnpm build && astro preview --host 127.0.0.1 --port 4321",
112
- "typecheck": "astro check",
113
- "check": "pnpm format:check && pnpm typecheck && pnpm registry:check",
118
+ "typecheck": "tsc --noEmit --noCheck && astro check",
119
+ "check": "pnpm format:check && pnpm typecheck && pnpm lint && pnpm registry:check",
114
120
  "build": "astro build",
115
121
  "registry:build": "pnpm registry:meta && shadcn build && pnpm format:write --log-level warn",
116
122
  "registry:check": "pnpm registry:validate && pnpm registry:build && git diff --exit-code -- registry.json public/r",
@@ -120,6 +126,7 @@
120
126
  "release": "changeset version && pnpm install --lockfile-only",
121
127
  "release:publish": "pnpm registry:check && changeset publish",
122
128
  "registry:meta": "node scripts/registry-meta.mjs",
123
- "format": "prettier --write ."
129
+ "format": "prettier --write .",
130
+ "lint": "eslint ."
124
131
  }
125
132
  }
@@ -6,7 +6,7 @@
6
6
  "files": [
7
7
  {
8
8
  "path": "src/components/ui/checkbox/checkbox.astro",
9
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Omit<HTMLAttributes<\"input\">, \"type\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<input\n type=\"checkbox\"\n role=\"checkbox\"\n data-slot=\"checkbox\"\n class={cn(\n \"border-input dark:bg-input/30 checked:bg-primary dark:checked:bg-primary checked:border-primary indeterminate:bg-primary indeterminate:border-primary aria-invalid:checked:border-primary aria-invalid:indeterminate:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer group-has-[:focus-visible]/field-label:not-checked:border-input relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 checked:[color:var(--color-primary-foreground)] indeterminate:[color:var(--color-primary-foreground)] focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3\",\n className\n )}\n {...props}\n/>\n\n<style>\n [data-slot=\"checkbox\"] {\n color: inherit;\n }\n\n [data-slot=\"checkbox\"]::before {\n content: \"\";\n position: absolute;\n inset: 0;\n margin: auto;\n width: 14px;\n height: 14px;\n opacity: 0;\n background-color: currentColor;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 14px 14px;\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E\");\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-position: center;\n -webkit-mask-size: 14px 14px;\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E\");\n mask-repeat: no-repeat;\n mask-position: center;\n mask-size: 14px 14px;\n }\n\n [data-slot=\"checkbox\"]:checked,\n [data-slot=\"checkbox\"]:indeterminate {\n color: var(--color-primary-foreground);\n }\n\n [data-slot=\"checkbox\"]:checked::before {\n opacity: 1;\n }\n\n [data-slot=\"checkbox\"]:indeterminate::before {\n opacity: 1;\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8h9' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8h9' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n</style>\n",
9
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Omit<HTMLAttributes<\"input\">, \"type\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<input\n type=\"checkbox\"\n data-slot=\"checkbox\"\n class={cn(\n \"border-input dark:bg-input/30 checked:bg-primary dark:checked:bg-primary checked:border-primary indeterminate:bg-primary indeterminate:border-primary aria-invalid:checked:border-primary aria-invalid:indeterminate:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer group-has-[:focus-visible]/field-label:not-checked:border-input relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 checked:[color:var(--color-primary-foreground)] indeterminate:[color:var(--color-primary-foreground)] focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3\",\n className\n )}\n {...props}\n/>\n\n<style>\n [data-slot=\"checkbox\"] {\n color: inherit;\n }\n\n [data-slot=\"checkbox\"]::before {\n content: \"\";\n position: absolute;\n inset: 0;\n margin: auto;\n width: 14px;\n height: 14px;\n opacity: 0;\n background-color: currentColor;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 14px 14px;\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E\");\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-position: center;\n -webkit-mask-size: 14px 14px;\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E\");\n mask-repeat: no-repeat;\n mask-position: center;\n mask-size: 14px 14px;\n }\n\n [data-slot=\"checkbox\"]:checked,\n [data-slot=\"checkbox\"]:indeterminate {\n color: var(--color-primary-foreground);\n }\n\n [data-slot=\"checkbox\"]:checked::before {\n opacity: 1;\n }\n\n [data-slot=\"checkbox\"]:indeterminate::before {\n opacity: 1;\n -webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8h9' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E\");\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8h9' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E\");\n }\n</style>\n",
10
10
  "type": "registry:ui"
11
11
  },
12
12
  {
@@ -14,7 +14,7 @@
14
14
  "files": [
15
15
  {
16
16
  "path": "src/components/blocks/header-1.astro",
17
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n}\n\nconst { class: className, logo, navigation, buttons, ...props } = Astro.props\n---\n\n<Header class={cn(\"\", className)} {...props}>\n <HeaderContainer class=\"items-center justify-between gap-4\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <NavigationMenu class=\"hidden flex-none justify-start lg:flex\">\n <NavigationMenuList class=\"justify-start\">\n {\n navigation.map((item, index) => (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))\n }\n </NavigationMenuList>\n </NavigationMenu>\n <HeaderGroup class=\"ml-auto hidden flex-1 justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label=\"Open menu\"\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>Menu</SheetTitle>\n <SheetDescription>Site navigation and actions.</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 px-4 py-12\">\n <nav aria-label=\"Main navigation\" class=\"flex flex-col gap-1\">\n {\n navigation.map((item) => (\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start\"\n >\n {item.label}\n </SheetClose>\n ))\n }\n </nav>\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
17
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n navigationLabel?: string\n menu?: {\n label: string\n title: string\n description: string\n }\n}\n\nconst {\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel = \"Main navigation\",\n menu = {\n label: \"Open menu\",\n title: \"Menu\",\n description: \"Site navigation and actions.\",\n },\n ...props\n} = Astro.props\n---\n\n<Header class={cn(\"\", className)} {...props}>\n <HeaderContainer class=\"items-center justify-between gap-4\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <NavigationMenu\n aria-label={navigationLabel}\n class=\"hidden flex-none justify-start lg:flex\"\n >\n <NavigationMenuList class=\"justify-start\">\n {\n navigation.map((item, index) => (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))\n }\n </NavigationMenuList>\n </NavigationMenu>\n <HeaderGroup class=\"ml-auto hidden flex-1 justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label={menu.label}\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>{menu.title}</SheetTitle>\n <SheetDescription>{menu.description}</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 px-4 py-12\">\n <nav aria-label={menu.title} class=\"flex flex-col gap-1\">\n {\n navigation.map((item) => (\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start\"\n >\n {item.label}\n </SheetClose>\n ))\n }\n </nav>\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
18
18
  "type": "registry:block"
19
19
  }
20
20
  ],
@@ -14,7 +14,7 @@
14
14
  "files": [
15
15
  {
16
16
  "path": "src/components/blocks/header-2.astro",
17
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n}\n\nconst { class: className, logo, navigation, buttons, ...props } = Astro.props\n---\n\n<Header variant=\"floating\" class={cn(\"\", className)} {...props}>\n <HeaderContainer class=\"justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <NavigationMenu\n class=\"absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex\"\n >\n <NavigationMenuList>\n {\n navigation.map((item, index) => (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))\n }\n </NavigationMenuList>\n </NavigationMenu>\n <HeaderGroup class=\"ml-auto hidden justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label=\"Open menu\"\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>Menu</SheetTitle>\n <SheetDescription>Site navigation and actions.</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 px-4 py-12\">\n <nav aria-label=\"Main navigation\" class=\"flex flex-col gap-1\">\n {\n navigation.map((item) => (\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start\"\n >\n {item.label}\n </SheetClose>\n ))\n }\n </nav>\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
17
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n navigationLabel?: string\n menu?: {\n label: string\n title: string\n description: string\n }\n}\n\nconst {\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel = \"Main navigation\",\n menu = {\n label: \"Open menu\",\n title: \"Menu\",\n description: \"Site navigation and actions.\",\n },\n ...props\n} = Astro.props\n---\n\n<Header variant=\"floating\" class={cn(\"\", className)} {...props}>\n <HeaderContainer class=\"justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <NavigationMenu\n aria-label={navigationLabel}\n class=\"absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex\"\n >\n <NavigationMenuList>\n {\n navigation.map((item, index) => (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))\n }\n </NavigationMenuList>\n </NavigationMenu>\n <HeaderGroup class=\"ml-auto hidden justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label={menu.label}\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>{menu.title}</SheetTitle>\n <SheetDescription>{menu.description}</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 px-4 py-12\">\n <nav aria-label={menu.title} class=\"flex flex-col gap-1\">\n {\n navigation.map((item) => (\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start\"\n >\n {item.label}\n </SheetClose>\n ))\n }\n </nav>\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
18
18
  "type": "registry:block"
19
19
  }
20
20
  ],
@@ -15,7 +15,7 @@
15
15
  "files": [
16
16
  {
17
17
  "path": "src/components/blocks/header-3.astro",
18
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n}\n\nconst { class: className, logo, navigation, buttons, ...props } = Astro.props\n---\n\n<Header class={cn(\"border-b\", className)} {...props}>\n <HeaderContainer class=\"justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <HeaderGroup class=\"ml-auto hidden justify-end gap-1 lg:flex\">\n <NavigationMenu class=\"hidden max-w-none justify-end lg:flex\">\n <NavigationMenuList>\n {\n navigation.map((item, index) => (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))\n }\n </NavigationMenuList>\n </NavigationMenu>\n <Separator\n orientation=\"vertical\"\n class=\"mx-1 hidden h-5 self-center lg:block\"\n />\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label=\"Open menu\"\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>Menu</SheetTitle>\n <SheetDescription>Site navigation and actions.</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 px-4 py-12\">\n <nav aria-label=\"Main navigation\" class=\"flex flex-col gap-1\">\n {\n navigation.map((item) => (\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start\"\n >\n {item.label}\n </SheetClose>\n ))\n }\n </nav>\n <Separator />\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
18
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n navigationLabel?: string\n menu?: {\n label: string\n title: string\n description: string\n }\n}\n\nconst {\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel = \"Main navigation\",\n menu = {\n label: \"Open menu\",\n title: \"Menu\",\n description: \"Site navigation and actions.\",\n },\n ...props\n} = Astro.props\n---\n\n<Header class={cn(\"border-b\", className)} {...props}>\n <HeaderContainer class=\"justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <HeaderGroup class=\"ml-auto hidden justify-end gap-1 lg:flex\">\n <NavigationMenu\n aria-label={navigationLabel}\n class=\"hidden max-w-none justify-end lg:flex\"\n >\n <NavigationMenuList>\n {\n navigation.map((item, index) => (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))\n }\n </NavigationMenuList>\n </NavigationMenu>\n <Separator\n orientation=\"vertical\"\n class=\"mx-1 hidden h-5 self-center lg:block\"\n />\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label={menu.label}\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>{menu.title}</SheetTitle>\n <SheetDescription>{menu.description}</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 px-4 py-12\">\n <nav aria-label={menu.title} class=\"flex flex-col gap-1\">\n {\n navigation.map((item) => (\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start\"\n >\n {item.label}\n </SheetClose>\n ))\n }\n </nav>\n <Separator />\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
19
19
  "type": "registry:block"
20
20
  }
21
21
  ],
@@ -14,7 +14,7 @@
14
14
  "files": [
15
15
  {
16
16
  "path": "src/components/blocks/header-4.astro",
17
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n alt: string\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n}\n\nconst { class: className, logo, navigation, buttons, ...props } = Astro.props\n---\n\n<Header class={cn(\"border-b\", className)} {...props}>\n <HeaderContainer class=\"justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <NavigationMenu\n class=\"absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex\"\n align=\"center\"\n >\n <NavigationMenuList>\n {\n navigation.map((item, index) =>\n item.links?.length ? (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuTrigger>{item.label}</NavigationMenuTrigger>\n <NavigationMenuContent>\n <div class=\"grid w-[min(46rem,calc(100vw-2rem))] gap-2 p-1 lg:grid-cols-[1fr_1.1fr]\">\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class=\"bg-muted/50 hover:bg-muted focus:bg-muted flex min-h-40 flex-col items-start justify-end gap-3 p-4 text-left\"\n >\n {item.image && (\n <Image\n src={item.image.src}\n alt={item.image.alt}\n class=\"mb-auto aspect-[16/9] w-full rounded-md object-cover\"\n widths={[320, 480, 640]}\n sizes=\"(min-width: 1024px) 22rem, 100vw\"\n />\n )}\n <span class=\"text-base font-medium\">{item.label}</span>\n {item.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {item.description}\n </span>\n )}\n </NavigationMenuLink>\n <div class=\"grid gap-1\">\n {item.links.map((link) => (\n <NavigationMenuLink\n href={link.href}\n active={link.active}\n class=\"items-start gap-3 p-3\"\n >\n {link.icon && (\n <Icon\n name={link.icon}\n class=\"text-muted-foreground mt-0.5\"\n />\n )}\n <span class=\"grid gap-1\">\n <span class=\"font-medium\">{link.label}</span>\n {link.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {link.description}\n </span>\n )}\n </span>\n </NavigationMenuLink>\n ))}\n </div>\n </div>\n </NavigationMenuContent>\n </NavigationMenuItem>\n ) : (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class={navigationMenuTriggerStyle()}\n >\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n )\n )\n }\n </NavigationMenuList>\n </NavigationMenu>\n <HeaderGroup class=\"ml-auto hidden justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label=\"Open menu\"\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>Menu</SheetTitle>\n <SheetDescription>Site navigation and actions.</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 overflow-y-auto px-4 py-12\">\n <nav aria-label=\"Main navigation\" class=\"flex flex-col gap-4\">\n {\n navigation.map((item) => (\n <div class=\"grid gap-1\">\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start font-medium\"\n >\n {item.label}\n </SheetClose>\n {item.links?.length && (\n <div class=\"border-border ml-3 grid gap-1 border-l pl-3\">\n {item.links.map((link) => (\n <SheetClose\n as=\"a\"\n href={link.href}\n variant=\"ghost\"\n class=\"text-muted-foreground justify-start\"\n >\n {link.icon && <Icon name={link.icon} />}\n {link.label}\n </SheetClose>\n ))}\n </div>\n )}\n </div>\n ))\n }\n </nav>\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
17
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n alt: string\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n navigationLabel?: string\n menu?: {\n label: string\n title: string\n description: string\n }\n}\n\nconst {\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel = \"Main navigation\",\n menu = {\n label: \"Open menu\",\n title: \"Menu\",\n description: \"Site navigation and actions.\",\n },\n ...props\n} = Astro.props\n---\n\n<Header class={cn(\"border-b\", className)} {...props}>\n <HeaderContainer class=\"justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <NavigationMenu\n aria-label={navigationLabel}\n class=\"absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex\"\n align=\"center\"\n >\n <NavigationMenuList>\n {\n navigation.map((item, index) =>\n item.links?.length ? (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuTrigger>{item.label}</NavigationMenuTrigger>\n <NavigationMenuContent>\n <div class=\"grid w-[min(46rem,calc(100vw-2rem))] gap-2 p-1 lg:grid-cols-[1fr_1.1fr]\">\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class=\"bg-muted/50 hover:bg-muted focus:bg-muted flex min-h-40 flex-col items-start justify-end gap-3 p-4 text-left\"\n >\n {item.image && (\n <Image\n src={item.image.src}\n alt={item.image.alt}\n class=\"mb-auto aspect-[16/9] w-full rounded-md object-cover\"\n widths={[320, 480, 640]}\n sizes=\"(min-width: 1024px) 22rem, 100vw\"\n />\n )}\n <span class=\"text-base font-medium\">{item.label}</span>\n {item.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {item.description}\n </span>\n )}\n </NavigationMenuLink>\n <div class=\"grid gap-1\">\n {item.links.map((link) => (\n <NavigationMenuLink\n href={link.href}\n active={link.active}\n class=\"items-start gap-3 p-3\"\n >\n {link.icon && (\n <Icon\n name={link.icon}\n class=\"text-muted-foreground mt-0.5\"\n />\n )}\n <span class=\"grid gap-1\">\n <span class=\"font-medium\">{link.label}</span>\n {link.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {link.description}\n </span>\n )}\n </span>\n </NavigationMenuLink>\n ))}\n </div>\n </div>\n </NavigationMenuContent>\n </NavigationMenuItem>\n ) : (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class={navigationMenuTriggerStyle()}\n >\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n )\n )\n }\n </NavigationMenuList>\n </NavigationMenu>\n <HeaderGroup class=\"ml-auto hidden justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label={menu.label}\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>{menu.title}</SheetTitle>\n <SheetDescription>{menu.description}</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 overflow-y-auto px-4 py-12\">\n <nav aria-label={menu.title} class=\"flex flex-col gap-4\">\n {\n navigation.map((item) => (\n <div class=\"grid gap-1\">\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start font-medium\"\n >\n {item.label}\n </SheetClose>\n {item.links?.length && (\n <div class=\"border-border ml-3 grid gap-1 border-l pl-3\">\n {item.links.map((link) => (\n <SheetClose\n as=\"a\"\n href={link.href}\n variant=\"ghost\"\n class=\"text-muted-foreground justify-start\"\n >\n {link.icon && <Icon name={link.icon} />}\n {link.label}\n </SheetClose>\n ))}\n </div>\n )}\n </div>\n ))\n }\n </nav>\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n</Header>\n",
18
18
  "type": "registry:block"
19
19
  }
20
20
  ],
@@ -15,7 +15,7 @@
15
15
  "files": [
16
16
  {
17
17
  "path": "src/components/blocks/header-5.astro",
18
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n alt: string\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n}\n\nconst { class: className, logo, navigation, buttons, ...props } = Astro.props\n---\n\n<Header\n class={cn(\"flex-col items-stretch gap-0 border-b py-0\", className)}\n {...props}\n>\n <HeaderContainer class=\"min-h-14 justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <HeaderGroup class=\"ml-auto hidden justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label=\"Open menu\"\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>Menu</SheetTitle>\n <SheetDescription>Site navigation and actions.</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 overflow-y-auto px-4 py-12\">\n <nav aria-label=\"Main navigation\" class=\"flex flex-col gap-4\">\n {\n navigation.map((item) => (\n <div class=\"grid gap-1\">\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start font-medium\"\n >\n {item.label}\n </SheetClose>\n {item.links?.length && (\n <div class=\"border-border ml-3 grid gap-1 border-l pl-3\">\n {item.links.map((link) => (\n <SheetClose\n as=\"a\"\n href={link.href}\n variant=\"ghost\"\n class=\"text-muted-foreground justify-start\"\n >\n {link.icon && <Icon name={link.icon} />}\n {link.label}\n </SheetClose>\n ))}\n </div>\n )}\n </div>\n ))\n }\n </nav>\n <Separator />\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n <Separator class=\"hidden lg:block\" />\n <HeaderContainer class=\"hidden min-h-11 lg:flex\">\n <NavigationMenu class=\"max-w-none justify-start\" align=\"start\">\n <NavigationMenuList class=\"justify-start\">\n {\n navigation.map((item, index) =>\n item.links?.length ? (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuTrigger>{item.label}</NavigationMenuTrigger>\n <NavigationMenuContent>\n <div class=\"grid w-[min(52rem,calc(100vw-2rem))] gap-2 p-2 lg:grid-cols-[1fr_1.2fr]\">\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class=\"bg-muted/50 hover:bg-muted focus:bg-muted items-start gap-3 p-3\"\n >\n {item.image && (\n <Image\n src={item.image.src}\n alt={item.image.alt}\n class=\"aspect-[16/9] w-full rounded-md object-cover\"\n widths={[320, 480, 640]}\n sizes=\"(min-width: 1024px) 22rem, 100vw\"\n />\n )}\n <span class=\"grid gap-1\">\n <span class=\"font-medium\">{item.label}</span>\n {item.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {item.description}\n </span>\n )}\n </span>\n </NavigationMenuLink>\n <div class=\"grid gap-1 lg:grid-cols-2\">\n {item.links.map((link) => (\n <NavigationMenuLink\n href={link.href}\n active={link.active}\n class=\"items-start gap-3 p-3\"\n >\n {link.icon && (\n <Icon\n name={link.icon}\n class=\"text-muted-foreground mt-0.5\"\n />\n )}\n <span class=\"grid gap-1\">\n <span class=\"font-medium\">{link.label}</span>\n {link.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {link.description}\n </span>\n )}\n </span>\n </NavigationMenuLink>\n ))}\n </div>\n </div>\n </NavigationMenuContent>\n </NavigationMenuItem>\n ) : (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class={navigationMenuTriggerStyle()}\n >\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n )\n )\n }\n </NavigationMenuList>\n </NavigationMenu>\n </HeaderContainer>\n</Header>\n",
18
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Logo, LogoImage, LogoText } from \"@/components/ui/logo\"\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"@/components/ui/navigation-menu\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/components/ui/sheet\"\n\ntype Props = HTMLAttributes<\"header\"> & {\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n navigation: {\n label: string\n href: string\n description?: string\n active?: boolean\n image?: {\n src: ImageMetadata\n alt: string\n }\n links?: {\n label: string\n href: string\n description?: string\n icon?: string\n active?: boolean\n }[]\n }[]\n buttons: {\n label: string\n href: string\n icon?: string\n variant?: \"default\" | \"outline\" | \"secondary\" | \"ghost\"\n }[]\n navigationLabel?: string\n menu?: {\n label: string\n title: string\n description: string\n }\n}\n\nconst {\n class: className,\n logo,\n navigation,\n buttons,\n navigationLabel = \"Main navigation\",\n menu = {\n label: \"Open menu\",\n title: \"Menu\",\n description: \"Site navigation and actions.\",\n },\n ...props\n} = Astro.props\n---\n\n<Header\n class={cn(\"flex-col items-stretch gap-0 border-b py-0\", className)}\n {...props}\n>\n <HeaderContainer class=\"min-h-14 justify-between\">\n <HeaderGroup>\n <Logo href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n {logo.label && <LogoText>{logo.label}</LogoText>}\n </Logo>\n </HeaderGroup>\n <HeaderGroup class=\"ml-auto hidden justify-end lg:flex\">\n <slot />\n {\n buttons.map(({ label, icon, ...button }) => (\n <Button\n as=\"a\"\n size={icon && !label ? \"icon-sm\" : \"sm\"}\n aria-label={label}\n target={button.href.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={button.href.startsWith(\"http\") ? \"noreferrer\" : undefined}\n {...button}\n >\n {icon && <Icon name={icon} />}\n {label}\n </Button>\n ))\n }\n </HeaderGroup>\n <Sheet class=\"lg:hidden\">\n <SheetTrigger\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ml-auto\"\n aria-label={menu.label}\n >\n <Icon name=\"menu\" />\n </SheetTrigger>\n <SheetContent side=\"right\" class=\"p-0\">\n <SheetHeader class=\"sr-only\">\n <SheetTitle>{menu.title}</SheetTitle>\n <SheetDescription>{menu.description}</SheetDescription>\n </SheetHeader>\n <div class=\"flex h-full flex-col gap-6 overflow-y-auto px-4 py-12\">\n <nav aria-label={menu.title} class=\"flex flex-col gap-4\">\n {\n navigation.map((item) => (\n <div class=\"grid gap-1\">\n <SheetClose\n as=\"a\"\n href={item.href}\n variant=\"ghost\"\n class=\"justify-start font-medium\"\n >\n {item.label}\n </SheetClose>\n {item.links?.length && (\n <div class=\"border-border ml-3 grid gap-1 border-l pl-3\">\n {item.links.map((link) => (\n <SheetClose\n as=\"a\"\n href={link.href}\n variant=\"ghost\"\n class=\"text-muted-foreground justify-start\"\n >\n {link.icon && <Icon name={link.icon} />}\n {link.label}\n </SheetClose>\n ))}\n </div>\n )}\n </div>\n ))\n }\n </nav>\n <Separator />\n <div class=\"mt-auto flex flex-col gap-2\">\n <slot name=\"mobile\" />\n </div>\n </div>\n </SheetContent>\n </Sheet>\n </HeaderContainer>\n <Separator class=\"hidden lg:block\" />\n <HeaderContainer class=\"hidden min-h-11 lg:flex\">\n <NavigationMenu\n aria-label={navigationLabel}\n class=\"max-w-none justify-start\"\n align=\"start\"\n >\n <NavigationMenuList class=\"justify-start\">\n {\n navigation.map((item, index) =>\n item.links?.length ? (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuTrigger>{item.label}</NavigationMenuTrigger>\n <NavigationMenuContent>\n <div class=\"grid w-[min(52rem,calc(100vw-2rem))] gap-2 p-2 lg:grid-cols-[1fr_1.2fr]\">\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class=\"bg-muted/50 hover:bg-muted focus:bg-muted items-start gap-3 p-3\"\n >\n {item.image && (\n <Image\n src={item.image.src}\n alt={item.image.alt}\n class=\"aspect-[16/9] w-full rounded-md object-cover\"\n widths={[320, 480, 640]}\n sizes=\"(min-width: 1024px) 22rem, 100vw\"\n />\n )}\n <span class=\"grid gap-1\">\n <span class=\"font-medium\">{item.label}</span>\n {item.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {item.description}\n </span>\n )}\n </span>\n </NavigationMenuLink>\n <div class=\"grid gap-1 lg:grid-cols-2\">\n {item.links.map((link) => (\n <NavigationMenuLink\n href={link.href}\n active={link.active}\n class=\"items-start gap-3 p-3\"\n >\n {link.icon && (\n <Icon\n name={link.icon}\n class=\"text-muted-foreground mt-0.5\"\n />\n )}\n <span class=\"grid gap-1\">\n <span class=\"font-medium\">{link.label}</span>\n {link.description && (\n <span class=\"text-muted-foreground text-sm leading-relaxed\">\n {link.description}\n </span>\n )}\n </span>\n </NavigationMenuLink>\n ))}\n </div>\n </div>\n </NavigationMenuContent>\n </NavigationMenuItem>\n ) : (\n <NavigationMenuItem value={`nav-${index}`}>\n <NavigationMenuLink\n href={item.href}\n active={item.active}\n class={navigationMenuTriggerStyle()}\n >\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n )\n )\n }\n </NavigationMenuList>\n </NavigationMenu>\n </HeaderContainer>\n</Header>\n",
19
19
  "type": "registry:block"
20
20
  }
21
21
  ],
@@ -6,7 +6,7 @@
6
6
  "files": [
7
7
  {
8
8
  "path": "src/components/ui/label/label.astro",
9
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"label\">\n\nconst {\n class: className,\n \"data-slot\": dataSlot = \"label\",\n ...props\n} = Astro.props\n---\n\n<label\n data-slot={dataSlot}\n class={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n>\n <slot />\n</label>\n",
9
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"label\">\n\nconst {\n class: className,\n \"data-slot\": dataSlot = \"label\",\n ...props\n} = Astro.props\n\n/* eslint-disable astro/jsx-a11y/label-has-associated-control -- A primitive: the caller links the control through `for` or a nested input. */\n---\n\n<label\n data-slot={dataSlot}\n class={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n>\n <slot />\n</label>\n",
10
10
  "type": "registry:ui"
11
11
  },
12
12
  {
@@ -23,7 +23,7 @@
23
23
  "files": [
24
24
  {
25
25
  "path": "src/components/blocks/sidebar-1.astro",
26
- "content": "---\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\nimport SearchIcon from \"@lucide/astro/icons/search\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandShortcut,\n} from \"@/components/ui/command\"\nimport { DialogTrigger } from \"@/components/ui/dialog\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport { LogoImage, LogoText } from \"@/components/ui/logo\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarTrigger,\n} from \"@/components/ui/sidebar\"\nimport { ThemeToggle } from \"@/components/ui/theme-toggle\"\n\ntype Props = {\n class?: string\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n search: {\n label: string\n empty: string\n items: {\n label: string\n href: string\n title: string\n path: string\n description: string\n group: string\n }[]\n }\n breadcrumb: {\n items: {\n label: string\n href: string\n }[]\n menu: {\n label: string\n href: string\n }[]\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n githubRepo: string\n}\n\nconst {\n class: className,\n logo,\n search,\n breadcrumb,\n navigation,\n githubRepo,\n}: Props = Astro.props\n\nconst normalizePath = (path: string) => {\n if (path === \"/\") return path\n\n return path.replace(/\\/$/, \"\")\n}\nconst currentPath = normalizePath(Astro.url.pathname)\nconst searchGroups = search.items.reduce<\n { label: string; items: typeof search.items }[]\n>((groups, item) => {\n const group = groups.find((entry) => entry.label === item.group)\n\n if (group) {\n group.items.push(item)\n } else {\n groups.push({ label: item.group, items: [item] })\n }\n\n return groups\n}, [])\n\nlet githubStars = \"Stars\"\n\ntry {\n const response = await fetch(`https://api.github.com/repos/${githubRepo}`)\n const data = await response.json()\n\n if (response.ok && typeof data.stargazers_count === \"number\") {\n githubStars = new Intl.NumberFormat().format(data.stargazers_count)\n }\n} catch {\n // Keep the fallback label when GitHub is unavailable.\n}\n---\n\n<SidebarProvider>\n <Sidebar class={cn(\"\", className)} collapsible=\"offcanvas\" variant=\"inset\">\n <SidebarHeader class=\"flex-col\">\n <SidebarMenuButton size=\"lg\" href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n <LogoText class=\"font-semibold\">{logo.label}</LogoText>\n </SidebarMenuButton>\n <CommandDialog\n class=\"w-full\"\n data-search-dialog\n title={search.label}\n description={search.label}\n >\n <DialogTrigger\n slot=\"trigger\"\n variant=\"outline\"\n size=\"sm\"\n class=\"w-full justify-start shadow-none\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n >\n <SearchIcon data-icon=\"inline-start\" />\n <span class=\"truncate\">{search.label}</span>\n <Kbd\n class=\"bg-background/80 ml-auto h-4 min-w-4 translate-y-0 px-1 text-[10px]\"\n data-search-shortcut\n >\n ⌘ + K\n </Kbd>\n </DialogTrigger>\n\n <Command\n class=\"[&_[data-slot=command-item][data-selected]]:bg-accent [&_[data-slot=command-item][data-selected]]:text-accent-foreground\"\n >\n <CommandInput autofocus placeholder={search.label} />\n <CommandList>\n <CommandEmpty>{search.empty}</CommandEmpty>\n\n {\n searchGroups.map((group) => (\n <CommandGroup heading={group.label}>\n {group.items.map((item) => (\n <CommandItem\n href={item.href}\n value={`${item.group} ${item.label}`}\n label={item.label}\n keywords={[\n item.group,\n item.title,\n item.path,\n item.description,\n ]}\n >\n {item.label}\n <CommandShortcut>{item.href}</CommandShortcut>\n </CommandItem>\n ))}\n </CommandGroup>\n ))\n }\n </CommandList>\n </Command>\n </CommandDialog>\n </SidebarHeader>\n <SidebarContent\n class=\"[mask-image:linear-gradient(to_bottom,transparent,black_1rem,black_calc(100%_-_1rem),transparent)] [-webkit-mask-image:linear-gradient(to_bottom,transparent,black_1rem,black_calc(100%_-_1rem),transparent)] group-data-[collapsible=icon]:[mask-image:none] group-data-[collapsible=icon]:[-webkit-mask-image:none]\"\n >\n {\n navigation.map((group) => (\n <SidebarGroup>\n <SidebarGroupLabel>{group.label}</SidebarGroupLabel>\n <SidebarMenu>\n {(group.links ?? [group]).map((item) => (\n <SidebarMenuItem>\n <SidebarMenuButton\n href={item.href}\n isActive={normalizePath(item.href) === currentPath}\n >\n <span>{item.label}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarGroup>\n ))\n }\n </SidebarContent>\n </Sidebar>\n <SidebarInset>\n <Header class=\"h-16\">\n <HeaderContainer class=\"max-w-none justify-between\">\n <HeaderGroup>\n <SidebarTrigger />\n <Separator orientation=\"vertical\" class=\"my-auto mr-2 h-4\" />\n <Breadcrumb>\n <BreadcrumbList>\n {\n breadcrumb.items.map((item, index) => {\n const isLast = index === breadcrumb.items.length - 1\n const isHome = item.href === \"/\"\n const hasMenu =\n !isHome &&\n breadcrumb.menu.some(\n (menuItem) =>\n normalizePath(menuItem.href) ===\n normalizePath(item.href)\n )\n\n return (\n <>\n {index > 0 && (\n <BreadcrumbSeparator>/</BreadcrumbSeparator>\n )}\n <BreadcrumbItem>\n {hasMenu ? (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-current={isLast ? \"page\" : undefined}\n class={cn(\n \"hover:text-foreground inline-flex items-center gap-1 transition-colors\",\n isLast && \"text-foreground\"\n )}\n >\n {item.label}\n <ChevronDownIcon\n class=\"size-3.5 opacity-70\"\n aria-hidden=\"true\"\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuGroup>\n {breadcrumb.menu.map((menuItem) => (\n <DropdownMenuItem\n href={menuItem.href}\n aria-current={\n normalizePath(menuItem.href) ===\n currentPath\n ? \"page\"\n : undefined\n }\n class=\"aria-[current=page]:text-foreground\"\n >\n {menuItem.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : isLast ? (\n <BreadcrumbPage>{item.label}</BreadcrumbPage>\n ) : (\n <BreadcrumbLink href={item.href}>\n {item.label}\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n </>\n )\n })\n }\n {\n breadcrumb.menu.length > 0 && currentPath === \"/\" && (\n <>\n <BreadcrumbSeparator>/</BreadcrumbSeparator>\n <BreadcrumbItem>\n <DropdownMenu>\n <DropdownMenuTrigger class=\"hover:text-foreground inline-flex items-center leading-none transition-colors\">\n <BreadcrumbEllipsis />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuGroup>\n {breadcrumb.menu.map((item) => (\n <DropdownMenuItem href={item.href}>\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </BreadcrumbItem>\n </>\n )\n }\n </BreadcrumbList>\n </Breadcrumb>\n </HeaderGroup>\n <HeaderGroup class=\"shrink-0\">\n <Button\n as=\"a\"\n href={`https://github.com/${githubRepo}`}\n size=\"sm\"\n variant=\"ghost\"\n target=\"_blank\"\n rel=\"noreferrer\"\n aria-label={`View ${githubRepo} on GitHub`}\n >\n <Icon name=\"github\" />\n <span class=\"hidden sm:inline\">{githubStars}</span>\n </Button>\n <ThemeToggle />\n </HeaderGroup>\n </HeaderContainer>\n </Header>\n <slot />\n </SidebarInset>\n</SidebarProvider>\n\n<script>\n const isMac = /Mac|iPhone|iPad|iPod/i.test(\n navigator.platform || navigator.userAgent\n )\n\n document.querySelectorAll(\"[data-search-shortcut]\").forEach((shortcut) => {\n shortcut.textContent = isMac ? \"⌘ + K\" : \"Ctrl + K\"\n })\n\n document.addEventListener(\"keydown\", (event) => {\n if (event.key.toLowerCase() !== \"k\") return\n if (event.shiftKey || event.altKey) return\n\n const dialog = document.querySelector(\"[data-search-dialog]\")\n const isSearchShortcut = isMac\n ? event.metaKey && !event.ctrlKey\n : event.ctrlKey && !event.metaKey\n\n if (!dialog || dialog.hasAttribute(\"data-open\") || !isSearchShortcut) return\n\n event.preventDefault()\n dialog.dispatchEvent(\n new CustomEvent(\"dialog:set\", { detail: { open: true } })\n )\n })\n</script>\n",
26
+ "content": "---\nimport ChevronDownIcon from \"@lucide/astro/icons/chevron-down\"\nimport SearchIcon from \"@lucide/astro/icons/search\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Breadcrumb,\n BreadcrumbEllipsis,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandShortcut,\n} from \"@/components/ui/command\"\nimport { DialogTrigger } from \"@/components/ui/dialog\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport { Header, HeaderContainer, HeaderGroup } from \"@/components/ui/header\"\nimport { Icon } from \"@/components/ui/icon\"\nimport { Kbd } from \"@/components/ui/kbd\"\nimport { LogoImage, LogoText } from \"@/components/ui/logo\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarTrigger,\n} from \"@/components/ui/sidebar\"\nimport { ThemeToggle } from \"@/components/ui/theme-toggle\"\n\ntype Props = {\n class?: string\n logo: {\n label: string\n href: string\n src?: any\n srcLight?: any\n srcDark?: any\n alt?: string\n }\n search: {\n label: string\n empty: string\n items: {\n label: string\n href: string\n title: string\n path: string\n description: string\n group: string\n }[]\n }\n breadcrumb: {\n items: {\n label: string\n href: string\n }[]\n menu: {\n label: string\n href: string\n }[]\n }\n navigation: {\n label: string\n href: string\n links?: {\n label: string\n href: string\n }[]\n }[]\n githubRepo: string\n}\n\nconst {\n class: className,\n logo,\n search,\n breadcrumb,\n navigation,\n githubRepo,\n}: Props = Astro.props\n\nconst normalizePath = (path: string) => {\n if (path === \"/\") return path\n\n return path.replace(/\\/$/, \"\")\n}\nconst currentPath = normalizePath(Astro.url.pathname)\nconst searchGroups = search.items.reduce<\n { label: string; items: typeof search.items }[]\n>((groups, item) => {\n const group = groups.find((entry) => entry.label === item.group)\n\n if (group) {\n group.items.push(item)\n } else {\n groups.push({ label: item.group, items: [item] })\n }\n\n return groups\n}, [])\n\nlet githubStars = \"Stars\"\n\ntry {\n const response = await fetch(`https://api.github.com/repos/${githubRepo}`)\n const data = await response.json()\n\n if (response.ok && typeof data.stargazers_count === \"number\") {\n githubStars = new Intl.NumberFormat().format(data.stargazers_count)\n }\n} catch {\n // Keep the fallback label when GitHub is unavailable.\n}\n\n/* eslint-disable astro/jsx-a11y/no-autofocus -- Focus moves into the search dialog when it opens. */\n---\n\n<SidebarProvider>\n <Sidebar class={cn(\"\", className)} collapsible=\"offcanvas\" variant=\"inset\">\n <SidebarHeader class=\"flex-col\">\n <SidebarMenuButton size=\"lg\" href={logo.href}>\n <LogoImage\n src={logo.src}\n srcLight={logo.srcLight}\n srcDark={logo.srcDark}\n alt={logo.alt}\n />\n <LogoText class=\"font-semibold\">{logo.label}</LogoText>\n </SidebarMenuButton>\n <CommandDialog\n class=\"w-full\"\n data-search-dialog\n title={search.label}\n description={search.label}\n >\n <DialogTrigger\n slot=\"trigger\"\n variant=\"outline\"\n size=\"sm\"\n class=\"w-full justify-start shadow-none\"\n aria-keyshortcuts=\"Meta+K Control+K\"\n >\n <SearchIcon data-icon=\"inline-start\" />\n <span class=\"truncate\">{search.label}</span>\n <Kbd\n class=\"bg-background/80 ml-auto h-4 min-w-4 translate-y-0 px-1 text-[10px]\"\n data-search-shortcut\n >\n ⌘ + K\n </Kbd>\n </DialogTrigger>\n\n <Command\n class=\"[&_[data-slot=command-item][data-selected]]:bg-accent [&_[data-slot=command-item][data-selected]]:text-accent-foreground\"\n >\n <CommandInput autofocus placeholder={search.label} />\n <CommandList>\n <CommandEmpty>{search.empty}</CommandEmpty>\n\n {\n searchGroups.map((group) => (\n <CommandGroup heading={group.label}>\n {group.items.map((item) => (\n <CommandItem\n href={item.href}\n value={`${item.group} ${item.label}`}\n label={item.label}\n keywords={[\n item.group,\n item.title,\n item.path,\n item.description,\n ]}\n >\n {item.label}\n <CommandShortcut>{item.href}</CommandShortcut>\n </CommandItem>\n ))}\n </CommandGroup>\n ))\n }\n </CommandList>\n </Command>\n </CommandDialog>\n </SidebarHeader>\n <SidebarContent\n class=\"[mask-image:linear-gradient(to_bottom,transparent,black_1rem,black_calc(100%_-_1rem),transparent)] [-webkit-mask-image:linear-gradient(to_bottom,transparent,black_1rem,black_calc(100%_-_1rem),transparent)] group-data-[collapsible=icon]:[mask-image:none] group-data-[collapsible=icon]:[-webkit-mask-image:none]\"\n >\n {\n navigation.map((group) => (\n <SidebarGroup>\n <SidebarGroupLabel>{group.label}</SidebarGroupLabel>\n <SidebarMenu>\n {(group.links ?? [group]).map((item) => (\n <SidebarMenuItem>\n <SidebarMenuButton\n href={item.href}\n isActive={normalizePath(item.href) === currentPath}\n >\n <span>{item.label}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarGroup>\n ))\n }\n </SidebarContent>\n </Sidebar>\n <SidebarInset>\n <Header class=\"h-16\">\n <HeaderContainer class=\"max-w-none justify-between\">\n <HeaderGroup>\n <SidebarTrigger />\n <Separator orientation=\"vertical\" class=\"my-auto mr-2 h-4\" />\n <Breadcrumb>\n <BreadcrumbList>\n {\n breadcrumb.items.map((item, index) => {\n const isLast = index === breadcrumb.items.length - 1\n const isHome = item.href === \"/\"\n const hasMenu =\n !isHome &&\n breadcrumb.menu.some(\n (menuItem) =>\n normalizePath(menuItem.href) ===\n normalizePath(item.href)\n )\n\n return (\n <>\n {index > 0 && (\n <BreadcrumbSeparator>/</BreadcrumbSeparator>\n )}\n <BreadcrumbItem>\n {hasMenu ? (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-current={isLast ? \"page\" : undefined}\n class={cn(\n \"hover:text-foreground inline-flex items-center gap-1 transition-colors\",\n isLast && \"text-foreground\"\n )}\n >\n {item.label}\n <ChevronDownIcon\n class=\"size-3.5 opacity-70\"\n aria-hidden=\"true\"\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuGroup>\n {breadcrumb.menu.map((menuItem) => (\n <DropdownMenuItem\n href={menuItem.href}\n aria-current={\n normalizePath(menuItem.href) ===\n currentPath\n ? \"page\"\n : undefined\n }\n class=\"aria-[current=page]:text-foreground\"\n >\n {menuItem.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : isLast ? (\n <BreadcrumbPage>{item.label}</BreadcrumbPage>\n ) : (\n <BreadcrumbLink href={item.href}>\n {item.label}\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n </>\n )\n })\n }\n {\n breadcrumb.menu.length > 0 && currentPath === \"/\" && (\n <>\n <BreadcrumbSeparator>/</BreadcrumbSeparator>\n <BreadcrumbItem>\n <DropdownMenu>\n <DropdownMenuTrigger class=\"hover:text-foreground inline-flex items-center leading-none transition-colors\">\n <BreadcrumbEllipsis />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuGroup>\n {breadcrumb.menu.map((item) => (\n <DropdownMenuItem href={item.href}>\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </BreadcrumbItem>\n </>\n )\n }\n </BreadcrumbList>\n </Breadcrumb>\n </HeaderGroup>\n <HeaderGroup class=\"shrink-0\">\n <Button\n as=\"a\"\n href={`https://github.com/${githubRepo}`}\n size=\"sm\"\n variant=\"ghost\"\n target=\"_blank\"\n rel=\"noreferrer\"\n aria-label={`View ${githubRepo} on GitHub`}\n >\n <Icon name=\"github\" />\n <span class=\"hidden sm:inline\">{githubStars}</span>\n </Button>\n <ThemeToggle />\n </HeaderGroup>\n </HeaderContainer>\n </Header>\n <slot />\n </SidebarInset>\n</SidebarProvider>\n\n<script>\n const isMac = /Mac|iPhone|iPad|iPod/i.test(\n navigator.platform || navigator.userAgent\n )\n\n document.querySelectorAll(\"[data-search-shortcut]\").forEach((shortcut) => {\n shortcut.textContent = isMac ? \"⌘ + K\" : \"Ctrl + K\"\n })\n\n document.addEventListener(\"keydown\", (event) => {\n if (event.key.toLowerCase() !== \"k\") return\n if (event.shiftKey || event.altKey) return\n\n const dialog = document.querySelector(\"[data-search-dialog]\")\n const isSearchShortcut = isMac\n ? event.metaKey && !event.ctrlKey\n : event.ctrlKey && !event.metaKey\n\n if (!dialog || dialog.hasAttribute(\"data-open\") || !isSearchShortcut) return\n\n event.preventDefault()\n dialog.dispatchEvent(\n new CustomEvent(\"dialog:set\", { detail: { open: true } })\n )\n })\n</script>\n",
27
27
  "type": "registry:block"
28
28
  }
29
29
  ],
@@ -45,9 +45,27 @@ type Props = HTMLAttributes<"header"> & {
45
45
  icon?: string
46
46
  variant?: "default" | "outline" | "secondary" | "ghost"
47
47
  }[]
48
+ navigationLabel?: string
49
+ menu?: {
50
+ label: string
51
+ title: string
52
+ description: string
53
+ }
48
54
  }
49
55
 
50
- const { class: className, logo, navigation, buttons, ...props } = Astro.props
56
+ const {
57
+ class: className,
58
+ logo,
59
+ navigation,
60
+ buttons,
61
+ navigationLabel = "Main navigation",
62
+ menu = {
63
+ label: "Open menu",
64
+ title: "Menu",
65
+ description: "Site navigation and actions.",
66
+ },
67
+ ...props
68
+ } = Astro.props
51
69
  ---
52
70
 
53
71
  <Header class={cn("", className)} {...props}>
@@ -63,7 +81,10 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
63
81
  {logo.label && <LogoText>{logo.label}</LogoText>}
64
82
  </Logo>
65
83
  </HeaderGroup>
66
- <NavigationMenu class="hidden flex-none justify-start lg:flex">
84
+ <NavigationMenu
85
+ aria-label={navigationLabel}
86
+ class="hidden flex-none justify-start lg:flex"
87
+ >
67
88
  <NavigationMenuList class="justify-start">
68
89
  {
69
90
  navigation.map((item, index) => (
@@ -99,17 +120,17 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
99
120
  variant="ghost"
100
121
  size="icon-sm"
101
122
  class="ml-auto"
102
- aria-label="Open menu"
123
+ aria-label={menu.label}
103
124
  >
104
125
  <Icon name="menu" />
105
126
  </SheetTrigger>
106
127
  <SheetContent side="right" class="p-0">
107
128
  <SheetHeader class="sr-only">
108
- <SheetTitle>Menu</SheetTitle>
109
- <SheetDescription>Site navigation and actions.</SheetDescription>
129
+ <SheetTitle>{menu.title}</SheetTitle>
130
+ <SheetDescription>{menu.description}</SheetDescription>
110
131
  </SheetHeader>
111
132
  <div class="flex h-full flex-col gap-6 px-4 py-12">
112
- <nav aria-label="Main navigation" class="flex flex-col gap-1">
133
+ <nav aria-label={menu.title} class="flex flex-col gap-1">
113
134
  {
114
135
  navigation.map((item) => (
115
136
  <SheetClose
@@ -45,9 +45,27 @@ type Props = HTMLAttributes<"header"> & {
45
45
  icon?: string
46
46
  variant?: "default" | "outline" | "secondary" | "ghost"
47
47
  }[]
48
+ navigationLabel?: string
49
+ menu?: {
50
+ label: string
51
+ title: string
52
+ description: string
53
+ }
48
54
  }
49
55
 
50
- const { class: className, logo, navigation, buttons, ...props } = Astro.props
56
+ const {
57
+ class: className,
58
+ logo,
59
+ navigation,
60
+ buttons,
61
+ navigationLabel = "Main navigation",
62
+ menu = {
63
+ label: "Open menu",
64
+ title: "Menu",
65
+ description: "Site navigation and actions.",
66
+ },
67
+ ...props
68
+ } = Astro.props
51
69
  ---
52
70
 
53
71
  <Header variant="floating" class={cn("", className)} {...props}>
@@ -64,6 +82,7 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
64
82
  </Logo>
65
83
  </HeaderGroup>
66
84
  <NavigationMenu
85
+ aria-label={navigationLabel}
67
86
  class="absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex"
68
87
  >
69
88
  <NavigationMenuList>
@@ -101,17 +120,17 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
101
120
  variant="ghost"
102
121
  size="icon-sm"
103
122
  class="ml-auto"
104
- aria-label="Open menu"
123
+ aria-label={menu.label}
105
124
  >
106
125
  <Icon name="menu" />
107
126
  </SheetTrigger>
108
127
  <SheetContent side="right" class="p-0">
109
128
  <SheetHeader class="sr-only">
110
- <SheetTitle>Menu</SheetTitle>
111
- <SheetDescription>Site navigation and actions.</SheetDescription>
129
+ <SheetTitle>{menu.title}</SheetTitle>
130
+ <SheetDescription>{menu.description}</SheetDescription>
112
131
  </SheetHeader>
113
132
  <div class="flex h-full flex-col gap-6 px-4 py-12">
114
- <nav aria-label="Main navigation" class="flex flex-col gap-1">
133
+ <nav aria-label={menu.title} class="flex flex-col gap-1">
115
134
  {
116
135
  navigation.map((item) => (
117
136
  <SheetClose
@@ -46,9 +46,27 @@ type Props = HTMLAttributes<"header"> & {
46
46
  icon?: string
47
47
  variant?: "default" | "outline" | "secondary" | "ghost"
48
48
  }[]
49
+ navigationLabel?: string
50
+ menu?: {
51
+ label: string
52
+ title: string
53
+ description: string
54
+ }
49
55
  }
50
56
 
51
- const { class: className, logo, navigation, buttons, ...props } = Astro.props
57
+ const {
58
+ class: className,
59
+ logo,
60
+ navigation,
61
+ buttons,
62
+ navigationLabel = "Main navigation",
63
+ menu = {
64
+ label: "Open menu",
65
+ title: "Menu",
66
+ description: "Site navigation and actions.",
67
+ },
68
+ ...props
69
+ } = Astro.props
52
70
  ---
53
71
 
54
72
  <Header class={cn("border-b", className)} {...props}>
@@ -65,7 +83,10 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
65
83
  </Logo>
66
84
  </HeaderGroup>
67
85
  <HeaderGroup class="ml-auto hidden justify-end gap-1 lg:flex">
68
- <NavigationMenu class="hidden max-w-none justify-end lg:flex">
86
+ <NavigationMenu
87
+ aria-label={navigationLabel}
88
+ class="hidden max-w-none justify-end lg:flex"
89
+ >
69
90
  <NavigationMenuList>
70
91
  {
71
92
  navigation.map((item, index) => (
@@ -104,17 +125,17 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
104
125
  variant="ghost"
105
126
  size="icon-sm"
106
127
  class="ml-auto"
107
- aria-label="Open menu"
128
+ aria-label={menu.label}
108
129
  >
109
130
  <Icon name="menu" />
110
131
  </SheetTrigger>
111
132
  <SheetContent side="right" class="p-0">
112
133
  <SheetHeader class="sr-only">
113
- <SheetTitle>Menu</SheetTitle>
114
- <SheetDescription>Site navigation and actions.</SheetDescription>
134
+ <SheetTitle>{menu.title}</SheetTitle>
135
+ <SheetDescription>{menu.description}</SheetDescription>
115
136
  </SheetHeader>
116
137
  <div class="flex h-full flex-col gap-6 px-4 py-12">
117
- <nav aria-label="Main navigation" class="flex flex-col gap-1">
138
+ <nav aria-label={menu.title} class="flex flex-col gap-1">
118
139
  {
119
140
  navigation.map((item) => (
120
141
  <SheetClose
@@ -59,9 +59,27 @@ type Props = HTMLAttributes<"header"> & {
59
59
  icon?: string
60
60
  variant?: "default" | "outline" | "secondary" | "ghost"
61
61
  }[]
62
+ navigationLabel?: string
63
+ menu?: {
64
+ label: string
65
+ title: string
66
+ description: string
67
+ }
62
68
  }
63
69
 
64
- const { class: className, logo, navigation, buttons, ...props } = Astro.props
70
+ const {
71
+ class: className,
72
+ logo,
73
+ navigation,
74
+ buttons,
75
+ navigationLabel = "Main navigation",
76
+ menu = {
77
+ label: "Open menu",
78
+ title: "Menu",
79
+ description: "Site navigation and actions.",
80
+ },
81
+ ...props
82
+ } = Astro.props
65
83
  ---
66
84
 
67
85
  <Header class={cn("border-b", className)} {...props}>
@@ -78,6 +96,7 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
78
96
  </Logo>
79
97
  </HeaderGroup>
80
98
  <NavigationMenu
99
+ aria-label={navigationLabel}
81
100
  class="absolute left-1/2 hidden max-w-none -translate-x-1/2 lg:flex"
82
101
  align="center"
83
102
  >
@@ -175,17 +194,17 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
175
194
  variant="ghost"
176
195
  size="icon-sm"
177
196
  class="ml-auto"
178
- aria-label="Open menu"
197
+ aria-label={menu.label}
179
198
  >
180
199
  <Icon name="menu" />
181
200
  </SheetTrigger>
182
201
  <SheetContent side="right" class="p-0">
183
202
  <SheetHeader class="sr-only">
184
- <SheetTitle>Menu</SheetTitle>
185
- <SheetDescription>Site navigation and actions.</SheetDescription>
203
+ <SheetTitle>{menu.title}</SheetTitle>
204
+ <SheetDescription>{menu.description}</SheetDescription>
186
205
  </SheetHeader>
187
206
  <div class="flex h-full flex-col gap-6 overflow-y-auto px-4 py-12">
188
- <nav aria-label="Main navigation" class="flex flex-col gap-4">
207
+ <nav aria-label={menu.title} class="flex flex-col gap-4">
189
208
  {
190
209
  navigation.map((item) => (
191
210
  <div class="grid gap-1">
@@ -60,9 +60,27 @@ type Props = HTMLAttributes<"header"> & {
60
60
  icon?: string
61
61
  variant?: "default" | "outline" | "secondary" | "ghost"
62
62
  }[]
63
+ navigationLabel?: string
64
+ menu?: {
65
+ label: string
66
+ title: string
67
+ description: string
68
+ }
63
69
  }
64
70
 
65
- const { class: className, logo, navigation, buttons, ...props } = Astro.props
71
+ const {
72
+ class: className,
73
+ logo,
74
+ navigation,
75
+ buttons,
76
+ navigationLabel = "Main navigation",
77
+ menu = {
78
+ label: "Open menu",
79
+ title: "Menu",
80
+ description: "Site navigation and actions.",
81
+ },
82
+ ...props
83
+ } = Astro.props
66
84
  ---
67
85
 
68
86
  <Header
@@ -104,17 +122,17 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
104
122
  variant="ghost"
105
123
  size="icon-sm"
106
124
  class="ml-auto"
107
- aria-label="Open menu"
125
+ aria-label={menu.label}
108
126
  >
109
127
  <Icon name="menu" />
110
128
  </SheetTrigger>
111
129
  <SheetContent side="right" class="p-0">
112
130
  <SheetHeader class="sr-only">
113
- <SheetTitle>Menu</SheetTitle>
114
- <SheetDescription>Site navigation and actions.</SheetDescription>
131
+ <SheetTitle>{menu.title}</SheetTitle>
132
+ <SheetDescription>{menu.description}</SheetDescription>
115
133
  </SheetHeader>
116
134
  <div class="flex h-full flex-col gap-6 overflow-y-auto px-4 py-12">
117
- <nav aria-label="Main navigation" class="flex flex-col gap-4">
135
+ <nav aria-label={menu.title} class="flex flex-col gap-4">
118
136
  {
119
137
  navigation.map((item) => (
120
138
  <div class="grid gap-1">
@@ -155,7 +173,11 @@ const { class: className, logo, navigation, buttons, ...props } = Astro.props
155
173
  </HeaderContainer>
156
174
  <Separator class="hidden lg:block" />
157
175
  <HeaderContainer class="hidden min-h-11 lg:flex">
158
- <NavigationMenu class="max-w-none justify-start" align="start">
176
+ <NavigationMenu
177
+ aria-label={navigationLabel}
178
+ class="max-w-none justify-start"
179
+ align="start"
180
+ >
159
181
  <NavigationMenuList class="justify-start">
160
182
  {
161
183
  navigation.map((item, index) =>
@@ -135,6 +135,8 @@ try {
135
135
  } catch {
136
136
  // Keep the fallback label when GitHub is unavailable.
137
137
  }
138
+
139
+ /* eslint-disable astro/jsx-a11y/no-autofocus -- Focus moves into the search dialog when it opens. */
138
140
  ---
139
141
 
140
142
  <SidebarProvider>
@@ -10,7 +10,6 @@ const { class: className, ...props } = Astro.props
10
10
 
11
11
  <input
12
12
  type="checkbox"
13
- role="checkbox"
14
13
  data-slot="checkbox"
15
14
  class={cn(
16
15
  "border-input dark:bg-input/30 checked:bg-primary dark:checked:bg-primary checked:border-primary indeterminate:bg-primary indeterminate:border-primary aria-invalid:checked:border-primary aria-invalid:indeterminate:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer group-has-[:focus-visible]/field-label:not-checked:border-input relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 checked:[color:var(--color-primary-foreground)] indeterminate:[color:var(--color-primary-foreground)] focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",
@@ -10,6 +10,8 @@ const {
10
10
  "data-slot": dataSlot = "label",
11
11
  ...props
12
12
  } = Astro.props
13
+
14
+ /* eslint-disable astro/jsx-a11y/label-has-associated-control -- A primitive: the caller links the control through `for` or a nested input. */
13
15
  ---
14
16
 
15
17
  <label