-
Notifications
You must be signed in to change notification settings - Fork 4
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
@casey_baggz_omni
committed
Jul 8, 2024
1 parent
e2a5ae0
commit 58a245c
Showing
4 changed files
with
126 additions
and
39 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,72 @@ | ||
import figma from '@figma/code-connect' | ||
import { IconButton } from '@cerberus-design/react' | ||
import { css } from '@cerberus-design/styled-system/css' | ||
|
||
const SELECTION = | ||
'https://www.figma.com/design/ducwqOCxoxcWc3ReV3FYd8/Digital-University-Component-Library?node-id=7705-20494&m=dev' | ||
|
||
const imports = [ | ||
"import { IconButton } from '@cerberus/react'", | ||
"import { css } from '@cerberus/styled-system/css'", | ||
] | ||
|
||
const props = { | ||
palette: figma.enum('Palette', { | ||
action: 'action', | ||
danger: 'danger', | ||
}), | ||
usage: figma.enum('Usage', { | ||
filled: 'filled', | ||
outlined: 'outlined', | ||
text: 'text', | ||
}), | ||
size: figma.enum('Size', { | ||
sm: 'sm', | ||
lg: 'lg', | ||
}), | ||
// Figma specific | ||
icon: figma.children('*'), | ||
} | ||
|
||
figma.connect(IconButton, SELECTION, { | ||
imports, | ||
props, | ||
example: (props) => { | ||
return ( | ||
<IconButton | ||
ariaLabel="ADD DESCRIPTIVE LABEL" | ||
palette={props.palette} | ||
usage={props.usage} | ||
size={props.size} | ||
> | ||
{props.icon} | ||
</IconButton> | ||
) | ||
}, | ||
}) | ||
|
||
figma.connect(IconButton, SELECTION, { | ||
imports, | ||
variant: { | ||
Usage: 'text-alt', | ||
}, | ||
props, | ||
example: (props) => { | ||
return ( | ||
<IconButton | ||
ariaLabel="ADD DESCRIPTIVE LABEL" | ||
className={css({ | ||
bgColor: 'action.bg.100.initial', | ||
_hover: { | ||
bgColor: 'action.bg.100.hover', | ||
}, | ||
})} | ||
palette="action" | ||
usage={props.usage} | ||
size={props.size} | ||
> | ||
{props.icon} | ||
</IconButton> | ||
) | ||
}, | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.