-
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
8b59b99
commit 91959b5
Showing
12 changed files
with
90 additions
and
307 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,49 +1,38 @@ | ||
import figma from "@figma/code-connect"; | ||
import { Field, Input, InputField } from "primitives"; | ||
import { Input, InputField } from "primitives"; | ||
|
||
figma.connect(Input, "<FIGMA_URL_INPUT>", { | ||
figma.connect(Input, "<FIGMA_URL_INPUT_FIELD>", { | ||
variant: { "Has Label": false }, | ||
props: { | ||
isDisabled: figma.enum("State", { Disabled: true }), | ||
value: figma.enum("Value Type", { | ||
Default: figma.string("Value"), | ||
}), | ||
placeholder: figma.enum("Value Type", { | ||
Default: "Placeholder here...", | ||
default: "I am a placeholder...", | ||
Placeholder: figma.string("Value"), | ||
}), | ||
isDisabled: figma.enum("State", { | ||
Disabled: true, | ||
}), | ||
}, | ||
example: ({ value, placeholder, isDisabled }) => ( | ||
<Input value={value} placeholder={placeholder} disabled={isDisabled} /> | ||
), | ||
example: ({ ...props }) => <Input {...props} />, | ||
}); | ||
|
||
figma.connect(Field, "<FIGMA_URL_INPUT_FIELD>", { | ||
figma.connect(InputField, "<FIGMA_URL_INPUT_FIELD>", { | ||
variant: { "Has Label": true }, | ||
props: { | ||
isDisabled: figma.enum("State", { Disabled: true }), | ||
errorMessage: figma.enum("State", { Error: figma.string("Error") }), | ||
label: figma.string("Label"), | ||
description: figma.boolean("Has Description", { | ||
true: figma.string("Description"), | ||
false: undefined, | ||
}), | ||
label: figma.boolean("Has Label", { | ||
true: figma.string("Label"), | ||
false: undefined, | ||
}), | ||
errorMessage: figma.boolean("Has Error Message", { | ||
true: figma.string("Error Message"), | ||
false: undefined, | ||
value: figma.enum("Value Type", { | ||
Default: figma.string("Value"), | ||
}), | ||
inputProps: figma.nestedProps("Input", { | ||
value: figma.string("Value"), | ||
placeholder: figma.string("Value"), | ||
placeholder: figma.enum("Value Type", { | ||
default: "I am a placeholder...", | ||
Placeholder: figma.string("Value"), | ||
}), | ||
}, | ||
example: ({ inputProps, ...props }) => ( | ||
<InputField | ||
value={inputProps.value} | ||
placeholder={inputProps.placeholder} | ||
{...props} | ||
/> | ||
), | ||
example: ({ ...props }) => <InputField {...props} />, | ||
}); |
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.