-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add navigation menu component (#3111)
* create initial files for navigation component * add slotted for nav items * use the prefix site for the components, addressed rtl, removed adding role attribute * rebased. add start and end template, removed slotted directive and observable, add withBehavior to styles file
- Loading branch information
1 parent
4dcf66d
commit 4ab354c
Showing
9 changed files
with
111 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { WebsiteDesignSystemProvider } from "./design-system-provider"; | ||
export { FASTSectionHeader } from "./section-header"; | ||
export { SiteSectionHeader } from "./section-header"; | ||
export { FastFrame } from "./fast-frame"; | ||
export { SiteNavigation } from "./navigation"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { customElement } from "@microsoft/fast-element"; | ||
import { Navigation } from "./navigation"; | ||
import { NavigationTemplate as template } from "./navigation.template"; | ||
import { NavigationStyles as styles } from "./navigation.styles"; | ||
|
||
@customElement({ | ||
name: "site-navigation", | ||
template, | ||
styles, | ||
}) | ||
export class SiteNavigation extends Navigation {} | ||
export * from "./navigation.template"; | ||
export * from "./navigation.styles"; | ||
export * from "./navigation"; |
18 changes: 18 additions & 0 deletions
18
sites/fast-website/src/app/components/navigation/navigation.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { css } from "@microsoft/fast-element"; | ||
import { display, neutralForegroundRestBehavior } from "@microsoft/fast-components"; | ||
|
||
export const NavigationStyles = css` | ||
${display("flex")} :host { | ||
justify-content: space-between; | ||
font-family: var(--body-font); | ||
color: var(--neutral-foreground-rest); | ||
box-sizing: border-box; | ||
width: 100%; | ||
} | ||
.start { | ||
margin-inline-end: auto; | ||
} | ||
.end { | ||
margin-inline-start: auto; | ||
} | ||
`.withBehaviors(neutralForegroundRestBehavior); |
13 changes: 13 additions & 0 deletions
13
sites/fast-website/src/app/components/navigation/navigation.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { html } from "@microsoft/fast-element"; | ||
import { Navigation } from "./navigation"; | ||
import { startTemplate, endTemplate } from "@microsoft/fast-components"; | ||
|
||
export const NavigationTemplate = html<Navigation>` | ||
<template> | ||
${startTemplate} | ||
<nav> | ||
<slot></slot> | ||
</nav> | ||
${endTemplate} | ||
</template> | ||
`; |
8 changes: 8 additions & 0 deletions
8
sites/fast-website/src/app/components/navigation/navigation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { FASTElement } from "@microsoft/fast-element"; | ||
import { applyMixins, StartEnd } from "@microsoft/fast-components"; | ||
|
||
export class Navigation extends FASTElement {} | ||
|
||
/* eslint-disable-next-line */ | ||
export interface Navigation extends StartEnd {} | ||
applyMixins(Navigation, StartEnd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters