Skip to content

Commit 6ca1f12

Browse files
committed
feat(website): add PageHeader component
1 parent 938b9e8 commit 6ca1f12

File tree

19 files changed

+205
-0
lines changed

19 files changed

+205
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageHeader } from './page-header.astro';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageHeaderGithubLink } from './page-header-github-link.astro';
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
import { Icon } from 'astro-icon/components';
3+
import { ButtonLink } from '@/ui/astro/button-link';
4+
import { AccessibleIcon } from '@/ui/astro/accessible-icon';
5+
import { VisuallyHidden } from '@/ui/astro/visually-hidden';
6+
import { pageHeaderGithubLinkStyles } from './page-header-github-link.styles';
7+
---
8+
9+
<ButtonLink.Root
10+
href="https://github.com/ZAHON/qwik-primitives"
11+
external={true}
12+
openInNewTab={true}
13+
shape="icon"
14+
color="default"
15+
variant="ghost"
16+
class={pageHeaderGithubLinkStyles()}
17+
>
18+
<AccessibleIcon.Root>
19+
<Icon name="github-logo" height={16} width={16} />
20+
</AccessibleIcon.Root>
21+
22+
<VisuallyHidden.Root>View GitHub</VisuallyHidden.Root>
23+
</ButtonLink.Root>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { cva } from 'class-variance-authority';
2+
3+
export const pageHeaderGithubLinkStyles = cva(['hidden', 'lg:inline-flex']);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageHeaderLogoHomeLink } from './page-header-logo-home-link.astro';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
import { Link } from '@/ui/astro/link';
3+
import { AccessibleIcon } from '@/ui/astro/accessible-icon';
4+
import { VisuallyHidden } from '@/ui/astro/visually-hidden';
5+
import { QwikLogoAndText } from '@/svgs/qwik-logo-and-text';
6+
7+
const pathname = new URL(Astro.request.url).pathname;
8+
---
9+
10+
<Link.Root aria-current={pathname === '/' ? 'page' : undefined} href="/" color="default" highContrast={true}>
11+
<AccessibleIcon.Root>
12+
<QwikLogoAndText height={28} width={94} />
13+
</AccessibleIcon.Root>
14+
15+
<VisuallyHidden.Root>Qwik Primitives home page</VisuallyHidden.Root>
16+
</Link.Root>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageHeaderNav } from './page-header-nav.astro';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
import { pageHeaderNavStyles } from './page-header-nav.styles';
3+
---
4+
5+
<nav aria-label="Main navigation" class={pageHeaderNavStyles()}>
6+
<slot />
7+
</nav>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { cva } from 'class-variance-authority';
2+
3+
export const pageHeaderNavStyles = cva([
4+
'px-4',
5+
'mx-auto',
6+
'h-full',
7+
'max-w-screen-2xl',
8+
'flex',
9+
'items-center',
10+
'justify-between',
11+
]);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageHeaderScrollWatcher } from './page-header-scroll-watcher.astro';

0 commit comments

Comments
 (0)