-
Notifications
You must be signed in to change notification settings - Fork 30
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
fe4a029
commit 4e47045
Showing
4 changed files
with
137 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
import figma from "@figma/code-connect" | ||
|
||
import { FillButton } from "./FillButton" | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
|
||
figma.connect( | ||
FillButton, | ||
"https://www.figma.com/design/2cQBxc5JTO0M38mcYARs7O/codeConnect?node-id=1106-7&m=dev", | ||
{ | ||
props: { | ||
leadingIcon: figma.instance("↳ leading icon"), | ||
trailingIcon: figma.instance("↳ trailing icon"), | ||
hasTrailingIcon: figma.boolean("hasTrailingIcon"), | ||
hasLeadingIcon: figma.boolean("hasLeadingIcon"), | ||
label: figma.string("label"), | ||
variant: figma.enum("variant", { | ||
primary: "primary", | ||
secondary: "secondary", | ||
danger: "danger", | ||
}), | ||
size: figma.enum("size", { | ||
normal: "normal", | ||
small: "small", | ||
large: "large", | ||
}), | ||
state: figma.enum("state", { | ||
default: "default", | ||
hover: "hover", | ||
active: "active", | ||
focus: "focus", | ||
disabled: "disabled", | ||
}), | ||
}, | ||
example: (props) => { | ||
const hasIcon = props.hasLeadingIcon || props.hasTrailingIcon | ||
const iconPosition = hasIcon ? (props.hasLeadingIcon ? "left" : "right") : undefined; | ||
const icon = iconPosition ? iconPosition === "left" ? props.leadingIcon : props.trailingIcon : undefined; | ||
return ( | ||
<FillButton | ||
icon={icon} | ||
iconPosition={iconPosition} | ||
variant={props.variant} | ||
size={props.size} | ||
state={props.state} | ||
> | ||
{props.label} | ||
</FillButton> | ||
) | ||
}, | ||
}, | ||
) |
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,41 @@ | ||
import figma from "@figma/code-connect" | ||
|
||
import { IconButton } from "./IconButton" | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect( | ||
IconButton, | ||
"https://www.figma.com/design/2cQBxc5JTO0M38mcYARs7O/codeConnect?node-id=1106-90&m=dev", | ||
{ | ||
props: { | ||
icon: figma.instance("icon"), | ||
iconmini: figma.instance("icon-mini"), | ||
variant: figma.enum("variant", { | ||
primary: "primary", | ||
secondary: "secondary", | ||
danger: "danger", | ||
}), | ||
size: figma.enum("size", { | ||
normal: "normal", | ||
small: "small", | ||
large: "large", | ||
}), | ||
state: figma.enum("state", { | ||
default: "default", | ||
hover: "hover", | ||
active: "active", | ||
focus: "focus", | ||
disabled: "disabled", | ||
"disabled + hover": "disabled---hover", | ||
}), | ||
}, | ||
example: (props) => (<IconButton icon={props.icon || props.iconmini} size={props.size} state={props.state}/>), | ||
}, | ||
) |
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,34 @@ | ||
import figma from "@figma/code-connect" | ||
|
||
import { Disclosure } from "./index" | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
// NOT STARTED WITH, WOULD NEED TO UPDATE MORE PROPS IN FIGMA | ||
figma.connect( | ||
Disclosure, | ||
"https://www.figma.com/design/2cQBxc5JTO0M38mcYARs7O/codeConnect?node-id=43343-19299&m=dev", | ||
{ | ||
props: { | ||
variant: figma.enum("variant", { | ||
default: "default", | ||
subtle: "subtle", | ||
transparent: "transparent", | ||
}), | ||
hasBorder: figma.boolean("hasBorder"), | ||
spacing: figma.enum("spacing", { | ||
normal: "normal", | ||
condensed: "condensed", | ||
compact: "compact", | ||
}), | ||
isExpanded: figma.boolean("isExpanded"), | ||
}, | ||
example: (props) => <Disclosure />, | ||
}, | ||
) |