-
Notifications
You must be signed in to change notification settings - Fork 90
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
Showing
9 changed files
with
356 additions
and
171 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
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,56 @@ | ||
import figma from "@figma/code-connect"; | ||
import { Avatar } from "../src/avatar/Avatar"; | ||
|
||
// Icon - https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?m=auto&node-id=24377-78056 | ||
figma.connect( | ||
Avatar, | ||
"https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?node-id=24377-78056", | ||
{ | ||
props: { | ||
size: figma.enum("Size", { | ||
"1x": 1, | ||
"2x": 2, | ||
"3x": 3, | ||
"4x": 4, | ||
}), | ||
}, | ||
example: (props) => <Avatar size={props.size} />, | ||
}, | ||
); | ||
|
||
// Initials | ||
figma.connect( | ||
Avatar, | ||
"https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?node-id=24377%3A78140", | ||
{ | ||
props: { | ||
size: figma.enum("Size", { | ||
"1x": 1, | ||
"2x": 2, | ||
"3x": 3, | ||
"4x": 4, | ||
}), | ||
// initialsValue: figma.string("Initials value"), // initialsValue in code is generated automatically | ||
}, | ||
example: (props) => <Avatar size={props.size} name="Foo Bar" />, | ||
}, | ||
); | ||
|
||
// Image - https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?m=auto&node-id=5688-71628 | ||
figma.connect( | ||
Avatar, | ||
"https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?node-id=5688-71628", | ||
{ | ||
props: { | ||
size: figma.enum("Size", { | ||
"1x": 1, | ||
"2x": 2, | ||
"3x": 3, | ||
"4x": 4, | ||
}), | ||
}, | ||
example: (props) => ( | ||
<Avatar size={props.size} name="Foo Bar" src="/img/examples/avatar.png" /> | ||
), | ||
}, | ||
); |
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,63 @@ | ||
import figma from "@figma/code-connect"; | ||
import { CloseIcon } from "@salt-ds/icons"; | ||
import { Banner } from "../src/banner/Banner"; | ||
import { | ||
BannerActions, | ||
BannerContent, | ||
Button, | ||
StackLayout, | ||
Text, | ||
} from "../src/index"; | ||
|
||
// Warning https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?m=auto&node-id=7997-78021 | ||
|
||
// Success Banner | ||
figma.connect( | ||
Banner, | ||
"https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?node-id=7997%3A78070", | ||
{ | ||
props: { | ||
// inlineContent: figma.instance("🔁 Inline content"), // Icon next to the close button | ||
title: figma.boolean("👁️ Title", { | ||
true: ( | ||
<Text> | ||
<strong>{figma.string("✏️ Title")}</strong> | ||
</Text> | ||
), | ||
false: undefined, | ||
}), | ||
// inlineSwap: figma.boolean("👁️ Inline swap"), | ||
contentArea: figma.boolean("👁️ Content area", { | ||
true: figma.instance("🔁 Banner content"), | ||
false: undefined, | ||
}), | ||
description: figma.string("✏️ Description"), | ||
closeButton: figma.boolean("👁️ Close button", { | ||
true: ( | ||
<BannerActions> | ||
<Button aria-label="close" variant="secondary"> | ||
<CloseIcon /> | ||
</Button> | ||
</BannerActions> | ||
), | ||
false: undefined, | ||
}), | ||
variant: figma.enum("Variant", { | ||
Primary: "primary", | ||
Secondary: "secondary", | ||
}), | ||
}, | ||
example: (props) => ( | ||
<Banner status="success" variant={props.variant}> | ||
<BannerContent> | ||
<StackLayout gap={1}> | ||
{props.title} | ||
{props.description} | ||
{props.contentArea} | ||
</StackLayout> | ||
</BannerContent> | ||
{props.closeButton} | ||
</Banner> | ||
), | ||
}, | ||
); |
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,23 @@ | ||
import figma from "@figma/code-connect"; | ||
import { InteractableCard } from "../src/interactable-card/"; | ||
|
||
// Tertiary Interactable Card/Accent Left | ||
figma.connect( | ||
InteractableCard, | ||
"https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?node-id=44325%3A4200", | ||
{ | ||
props: { | ||
// customContent: figma.boolean("Custom content"), | ||
// contentArea: figma.boolean("Content area"), | ||
state: figma.enum("State", { | ||
Disabled: true, | ||
}), | ||
content: figma.children("*"), | ||
}, | ||
example: (props) => ( | ||
<InteractableCard variant="tertiary" disabled={props.state} accent="left"> | ||
{props.content} | ||
</InteractableCard> | ||
), | ||
}, | ||
); |
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,31 @@ | ||
import { Divider } from "../src/divider/Divider" | ||
import figma from "@figma/code-connect" | ||
|
||
/** | ||
* -- This file was auto-generated by Code Connect -- | ||
* `props` includes a mapping from your code props to Figma properties. | ||
* You should check this is correct, and update the `example` function | ||
* to return the code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect( | ||
Divider, | ||
"https://www.figma.com/design/ChsbbO7pLomT4F5H6tQyLP/Salt-(Next)-Components-%26-Patterns?node-id=28468%3A15200", | ||
{ | ||
props: { | ||
// These props were automatically mapped based on your linked code: | ||
orientation: figma.enum("Orientation", { | ||
Horizontal: "horizontal", | ||
Vertical: "vertical", | ||
}), | ||
variant: figma.enum("Variant", { | ||
Primary: "primary", | ||
Secondary: "secondary", | ||
Tertiary: "tertiary", | ||
}), | ||
}, | ||
example: (props) => ( | ||
<Divider orientation={props.orientation} variant={props.variant} /> | ||
), | ||
}, | ||
) |
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
Oops, something went wrong.