-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e178d9
commit 52c1553
Showing
8 changed files
with
146 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { figma } from "@figma/code-connect"; | ||
import { Grid, GridItem } from "ui"; | ||
import { StandardHeader, VerticalHeader } from "./Headers"; | ||
|
||
const FIGMA_URL_STANDARD_HEADER = | ||
"https://staging.figma.com/design/YfiqA0yWMXuLJAzkZNpBdy/SDS?node-id=7717-3642&t=nZCpXAWLyKWF2wPs-11"; | ||
const FIGMA_URL_VERTICAL_HEADER = | ||
"https://staging.figma.com/design/YfiqA0yWMXuLJAzkZNpBdy/SDS?node-id=7722-3364&t=nZCpXAWLyKWF2wPs-11"; | ||
|
||
figma.connect(StandardHeader, FIGMA_URL_STANDARD_HEADER, { | ||
props: { | ||
logo: figma.children("Logo"), | ||
children: figma.children(["Navigation", "Button Group"]), | ||
}, | ||
example: ({ children, logo }) => ( | ||
<StandardHeader> | ||
<Grid> | ||
<GridItem size="minor">{logo}</GridItem> | ||
<GridItem size="major"> | ||
<Grid auto gap="xl" alignPrimary="end"> | ||
{children} | ||
</Grid> | ||
</GridItem> | ||
</Grid> | ||
</StandardHeader> | ||
), | ||
}); | ||
|
||
figma.connect(VerticalHeader, FIGMA_URL_VERTICAL_HEADER, { | ||
props: { | ||
logo: figma.children("Logo"), | ||
children: figma.children("Navigation"), | ||
}, | ||
example: ({ children, logo }) => ( | ||
<VerticalHeader> | ||
<Grid auto direction="column" alignSecondary="center" gap="md"> | ||
{logo} | ||
{children} | ||
</Grid> | ||
</VerticalHeader> | ||
), | ||
}); |
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 { Section, type SectionProps } from "ui"; | ||
|
||
export type StandardHeaderProps = Omit<SectionProps, "variant" | "padding">; | ||
export function StandardHeader({ className, ...props }: StandardHeaderProps) { | ||
return ( | ||
<Section elementType="header" variant="stroke" padding="sm" {...props} /> | ||
); | ||
} | ||
export type VerticalHeaderProps = Omit<SectionProps, "variant" | "padding">; | ||
export function VerticalHeader({ className, ...props }: VerticalHeaderProps) { | ||
return ( | ||
<Section elementType="header" variant="subtle" padding="sm" {...props} /> | ||
); | ||
} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { figma } from "@figma/code-connect"; | ||
import { Logo } from "./Logo"; | ||
|
||
const FIGMA_URL_LOGO = | ||
"https://staging.figma.com/design/YfiqA0yWMXuLJAzkZNpBdy/SDS?node-id=2159-5053&t=nZCpXAWLyKWF2wPs-11"; | ||
|
||
figma.connect(Logo, FIGMA_URL_LOGO); |
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,17 @@ | ||
import clsx from "clsx"; | ||
import { IconFigma } from "icons"; | ||
import { | ||
AnchorOrButton, | ||
type AnchorOrButtonProps, | ||
} from "ui/utils/AnchorOrButton"; | ||
import "./logo.css"; | ||
|
||
export type LogoProps = AnchorOrButtonProps; | ||
export function Logo({ className, ...props }: LogoProps) { | ||
const classNames = clsx(className, "logo"); | ||
return ( | ||
<AnchorOrButton className={classNames} {...props}> | ||
<IconFigma size="40" /> | ||
</AnchorOrButton> | ||
); | ||
} |
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,21 @@ | ||
.logo { | ||
--border-radius: var(--sds-size-radius-md); | ||
border-radius: var(--border-radius); | ||
position: relative; | ||
|
||
&[data-focus-visible] { | ||
outline: none; | ||
--offset: calc(var(--sds-responsive-border-width) * 2); | ||
&::before { | ||
content: ""; | ||
border-radius: calc(var(--border-radius) + var(--offset)); | ||
bottom: calc(-1 * var(--offset)); | ||
box-shadow: 0 0 0 var(--global-focus-ring-size) | ||
var(--global-focus-ring-color); | ||
left: calc(-1 * var(--offset)); | ||
position: absolute; | ||
right: calc(-1 * var(--offset)); | ||
top: calc(-1 * var(--offset)); | ||
} | ||
} | ||
} |