-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(root): add top navigation patterns compatible with React and web…
… components Add top navigation patterns for React users, compatible with TypeScript and JavaScript. Add top nav patterns for web components, compatible with JavaScript. Prettier fixes . #760
- Loading branch information
1 parent
40c0095
commit b1f842b
Showing
12 changed files
with
1,707 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/content/structured/patterns/components/top-nav-patterns/javascript/react/index.css
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,25 @@ | ||
@import "@ukic/fonts/dist/fonts.css"; | ||
@import "@ukic/react/dist/core/core.css"; | ||
@import "@ukic/react/dist/core/normalize.css"; | ||
|
||
.input-area { | ||
display: flex; | ||
gap: var(--ic-space-md); | ||
} | ||
|
||
/* Remove the .main-content-div styling */ | ||
.main-content-div { | ||
background-color: var(--ic-architectural-100); | ||
height: 800px; | ||
width: 100%; | ||
} | ||
|
||
ic-text-field { | ||
--input-width: 21.5rem; | ||
} | ||
|
||
@media screen and (max-width: 320px) { | ||
.input-area { | ||
gap: var(--ic-space-xs); | ||
} | ||
} |
213 changes: 213 additions & 0 deletions
213
...tured/patterns/components/top-nav-patterns/javascript/react/top-nav-mega-menu-pattern.jsx
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,213 @@ | ||
import React from "react"; | ||
|
||
import { | ||
IcBreadcrumbGroup, | ||
IcBreadcrumb, | ||
IcButton, | ||
IcChip, | ||
IcClassificationBanner, | ||
IcFooter, | ||
IcFooterLink, | ||
IcNavigationGroup, | ||
IcNavigationItem, | ||
IcPageHeader, | ||
IcSectionContainer, | ||
IcTopNavigation, | ||
IcNavigationButton, | ||
IcSearchBar, | ||
IcTextField, | ||
IcTypography, | ||
SlottedSVG, | ||
} from "@ukic/react"; | ||
|
||
import { mdiAccount, mdiCog, mdiPencil, mdiPlus } from "@mdi/js"; | ||
|
||
import "./index.css"; | ||
|
||
const TopNavMegaMenuPattern = () => { | ||
const alignment = "center"; | ||
let pageHeaderAlignment; | ||
// pageHeaderAlignment = "center"; | ||
|
||
return ( | ||
<> | ||
<IcClassificationBanner /> | ||
<IcTopNavigation | ||
contentAligned={alignment} | ||
appTitle="[Enter your application name]" | ||
status="alpha" | ||
version="v0.0.7" | ||
> | ||
<SlottedSVG | ||
slot="app-icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="24px" | ||
viewBox="0 0 24 24" | ||
width="24px" | ||
fill="#000000" | ||
> | ||
<path d="M0 0h24v24H0V0z" fill="none" /> | ||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z" /> | ||
</SlottedSVG> | ||
<IcSearchBar slot="search" placeholder="Search" label="Search" /> | ||
<IcNavigationButton label="Profile" slot="buttons"> | ||
<SlottedSVG | ||
slot="icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="24px" | ||
viewBox="0 0 24 24" | ||
width="24px" | ||
path={mdiAccount} | ||
/> | ||
</IcNavigationButton> | ||
<IcNavigationButton label="Settings" slot="buttons"> | ||
<SlottedSVG | ||
slot="icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="24px" | ||
viewBox="0 0 24 24" | ||
width="24px" | ||
path={mdiCog} | ||
/> | ||
</IcNavigationButton> | ||
<IcNavigationButton label="Edit" slot="buttons"> | ||
<SlottedSVG | ||
slot="icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="24px" | ||
viewBox="0 0 24 24" | ||
width="24px" | ||
path={mdiPencil} | ||
/> | ||
</IcNavigationButton> | ||
<IcNavigationGroup | ||
slot="navigation" | ||
label="[navigationOption]" | ||
expandable | ||
> | ||
<IcNavigationItem label="[navItem]" href="#" /> | ||
<IcNavigationItem label="[navItem]" href="#" /> | ||
<IcNavigationItem label="[navItem]" href="#" /> | ||
</IcNavigationGroup> | ||
<IcNavigationGroup slot="navigation" label="[navItem]"> | ||
<IcNavigationItem label="[navItem]" href="#" /> | ||
<IcNavigationItem label="[navItem]" href="#" /> | ||
</IcNavigationGroup> | ||
<IcNavigationItem | ||
slot="navigation" | ||
label="[navigationOption]" | ||
href="#" | ||
selected | ||
/> | ||
<IcNavigationItem | ||
slot="navigation" | ||
label="[navigationOption]" | ||
href="#" | ||
/> | ||
<IcNavigationItem | ||
slot="navigation" | ||
label="[navigationOption]" | ||
href="#" | ||
/> | ||
<IcNavigationItem | ||
slot="navigation" | ||
label="[navigationOption]" | ||
href="#" | ||
/> | ||
<IcNavigationItem | ||
slot="navigation" | ||
label="[navigationOption]" | ||
href="#" | ||
/> | ||
<IcNavigationItem | ||
slot="navigation" | ||
label="[navigationOption]" | ||
href="#" | ||
/> | ||
</IcTopNavigation> | ||
<IcPageHeader | ||
heading="Page header" | ||
subheading="This is a page header component with additional functionality and this is the text." | ||
reverseOrder | ||
aligned={pageHeaderAlignment || alignment} | ||
> | ||
<IcChip slot="heading-adornment" label="BETA" size="large" /> | ||
<IcBreadcrumbGroup slot="breadcrumbs"> | ||
<IcBreadcrumb pageTitle="Breadcrumb 1" href="#" /> | ||
<IcBreadcrumb pageTitle="Breadcrumb 2" href="#" /> | ||
<IcBreadcrumb pageTitle="Breadcrumb 3" href="#" /> | ||
<IcBreadcrumb pageTitle="Breadcrumb 4" href="#" /> | ||
<IcBreadcrumb pageTitle="Breadcrumb 5" href="#" /> | ||
<IcBreadcrumb current pageTitle="Breadcrumb 6" href="#" /> | ||
</IcBreadcrumbGroup> | ||
<IcButton slot="actions" variant="primary"> | ||
<SlottedSVG | ||
slot="left-icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="24px" | ||
viewBox="0 0 24 24" | ||
width="24px" | ||
path={mdiPlus} | ||
/> | ||
Primary button | ||
</IcButton> | ||
<IcButton slot="actions" variant="tertiary"> | ||
Tertiary button | ||
</IcButton> | ||
<div slot="input" className="input-area"> | ||
<IcTextField | ||
placeholder="Enter your input..." | ||
label="Input" | ||
hideLabel | ||
/> | ||
<IcButton>Submit</IcButton> | ||
</div> | ||
</IcPageHeader> | ||
<IcSectionContainer aligned={alignment}> | ||
<main> | ||
<div className="main-content-div">Replace this div</div> | ||
</main> | ||
</IcSectionContainer> | ||
<IcFooter | ||
aligned={alignment} | ||
caption="This information is exempt under the Freedom of Information Act 2000 (FOIA) and may be exempt under other UK information legislation." | ||
> | ||
<IcTypography slot="description"> | ||
This pattern was built using the Intelligence Community Design System | ||
(ICDS). | ||
</IcTypography> | ||
<IcFooterLink slot="link" href=""> | ||
[footerLink] | ||
</IcFooterLink> | ||
<IcFooterLink slot="link" href=""> | ||
[footerLink] | ||
</IcFooterLink> | ||
<IcFooterLink slot="link" href=""> | ||
[footerLink] | ||
</IcFooterLink> | ||
<IcFooterLink slot="link" href=""> | ||
[footerLink] | ||
</IcFooterLink> | ||
<IcFooterLink slot="link" href=""> | ||
[footerLink] | ||
</IcFooterLink> | ||
<IcFooterLink slot="logo" href="/"> | ||
<SlottedSVG | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="48px" | ||
viewBox="0 0 24 24" | ||
width="48px" | ||
fill="#FFFFFF" | ||
> | ||
<path | ||
d="M12 6.19L17 10.69V18.5H15V12.5H9V18.5H7V10.69L12 6.19ZM12 3.5L2 12.5H5V20.5H11V14.5H13V20.5H19V12.5H22L12 3.5Z" | ||
fill="currentColor" | ||
/> | ||
</SlottedSVG> | ||
</IcFooterLink> | ||
</IcFooter> | ||
</> | ||
); | ||
}; | ||
|
||
export default TopNavMegaMenuPattern; |
Oops, something went wrong.