Skip to content

Commit

Permalink
Better boolean instance instance types
Browse files Browse the repository at this point in the history
  • Loading branch information
origami-z committed Oct 27, 2024
1 parent 311b83d commit 932e778
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 47 deletions.
9 changes: 7 additions & 2 deletions figma.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"codeConnect": {
"include": ["packages/core/src/**/*.{tsx,jsx}"],
"include": [
"packages/core/src/**/*.{tsx,jsx}",
"packages/core/figma-src/**/*.{tsx,jsx}",
"packages/icons/src/**/*.{tsx,jsx}"
],
"importPaths": {
"../src/*": "@salt-ds/core"
"packages/core/src/*": "@salt-ds/core",
"packages/icons/*": "@salt-ds/icons"
}
}
}
135 changes: 90 additions & 45 deletions packages/core/figma-src/Button.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ figma.connect(
Bordered: "bordered",
Transparent: "transparent",
}),
label: figma.boolean("Label"),
labelTextValue: figma.string("Label text value"),
rightIcon: figma.boolean("Right icon"),
rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon"),
leftIconType: figma.instance("Left icon type"),
label: figma.boolean("Label", {
true: figma.string("Label text value"),
false: undefined,
}),
// labelTextValue: figma.string("Label text value"),,
rightIcon: figma.boolean("Right icon", {
true: figma.instance("Right icon type"),
false: undefined,
}),
// rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon", {
true: figma.instance("Left icon type"),
false: undefined,
}),
// leftIconType: figma.instance("Left icon type"),
// No matching props could be found for these Figma properties:
},
example: (props) => (
Expand All @@ -31,9 +40,9 @@ figma.connect(
sentiment="neutral"
appearance={props.appearance}
>
{props.leftIcon && props.leftIconType}
{props.label && props.labelTextValue}
{props.rightIcon && props.rightIconType}
{props.leftIcon}
{props.label}
{props.rightIcon}
</Button>
),
},
Expand All @@ -53,12 +62,21 @@ figma.connect(
Bordered: "bordered",
Transparent: "transparent",
}),
label: figma.boolean("Label"),
labelTextValue: figma.string("Label text value"),
rightIcon: figma.boolean("Right icon"),
rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon"),
leftIconType: figma.instance("Left icon type"),
label: figma.boolean("Label", {
true: figma.string("Label text value"),
false: undefined,
}),
// labelTextValue: figma.string("Label text value"),,
rightIcon: figma.boolean("Right icon", {
true: figma.instance("Right icon type"),
false: undefined,
}),
// rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon", {
true: figma.instance("Left icon type"),
false: undefined,
}),
// leftIconType: figma.instance("Left icon type"),
// No matching props could be found for these Figma properties:
},
example: (props) => (
Expand All @@ -67,9 +85,9 @@ figma.connect(
sentiment="accented"
appearance={props.appearance}
>
{props.leftIcon && props.leftIconType}
{props.label && props.labelTextValue}
{props.rightIcon && props.rightIconType}
{props.leftIcon}
{props.label}
{props.rightIcon}
</Button>
),
},
Expand All @@ -90,12 +108,21 @@ figma.connect(
Bordered: "bordered",
Transparent: "transparent",
}),
label: figma.boolean("Label"),
labelTextValue: figma.string("Label text value"),
rightIcon: figma.boolean("Right icon"),
rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon"),
leftIconType: figma.instance("Left icon type"),
label: figma.boolean("Label", {
true: figma.string("Label text value"),
false: undefined,
}),
// labelTextValue: figma.string("Label text value"),,
rightIcon: figma.boolean("Right icon", {
true: figma.instance("Right icon type"),
false: undefined,
}),
// rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon", {
true: figma.instance("Left icon type"),
false: undefined,
}),
// leftIconType: figma.instance("Left icon type"),
// No matching props could be found for these Figma properties:
},
example: (props) => (
Expand All @@ -104,9 +131,9 @@ figma.connect(
sentiment="caution"
appearance={props.appearance}
>
{props.leftIcon && props.leftIconType}
{props.label && props.labelTextValue}
{props.rightIcon && props.rightIconType}
{props.leftIcon}
{props.label}
{props.rightIcon}
</Button>
),
},
Expand All @@ -126,12 +153,21 @@ figma.connect(
Bordered: "bordered",
Transparent: "transparent",
}),
label: figma.boolean("Label"),
labelTextValue: figma.string("Label text value"),
rightIcon: figma.boolean("Right icon"),
rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon"),
leftIconType: figma.instance("Left icon type"),
label: figma.boolean("Label", {
true: figma.string("Label text value"),
false: undefined,
}),
// labelTextValue: figma.string("Label text value"),,
rightIcon: figma.boolean("Right icon", {
true: figma.instance("Right icon type"),
false: undefined,
}),
// rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon", {
true: figma.instance("Left icon type"),
false: undefined,
}),
// leftIconType: figma.instance("Left icon type"),
// No matching props could be found for these Figma properties:
},
example: (props) => (
Expand All @@ -140,9 +176,9 @@ figma.connect(
sentiment="positive"
appearance={props.appearance}
>
{props.leftIcon && props.leftIconType}
{props.label && props.labelTextValue}
{props.rightIcon && props.rightIconType}
{props.leftIcon}
{props.label}
{props.rightIcon}
</Button>
),
},
Expand All @@ -162,12 +198,21 @@ figma.connect(
Bordered: "bordered",
Transparent: "transparent",
}),
label: figma.boolean("Label"),
labelTextValue: figma.string("Label text value"),
rightIcon: figma.boolean("Right icon"),
rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon"),
leftIconType: figma.instance("Left icon type"),
label: figma.boolean("Label", {
true: figma.string("Label text value"),
false: undefined,
}),
// labelTextValue: figma.string("Label text value"),,
rightIcon: figma.boolean("Right icon", {
true: figma.instance("Right icon type"),
false: undefined,
}),
// rightIconType: figma.instance("Right icon type"),
leftIcon: figma.boolean("Left icon", {
true: figma.instance("Left icon type"),
false: undefined,
}),
// leftIconType: figma.instance("Left icon type"),
// No matching props could be found for these Figma properties:
},
example: (props) => (
Expand All @@ -176,9 +221,9 @@ figma.connect(
sentiment="negative"
appearance={props.appearance}
>
{props.leftIcon && props.leftIconType}
{props.label && props.labelTextValue}
{props.rightIcon && props.rightIconType}
{props.leftIcon}
{props.label}
{props.rightIcon}
</Button>
),
},
Expand Down

0 comments on commit 932e778

Please sign in to comment.