-
Notifications
You must be signed in to change notification settings - Fork 153
chore: init code connect for EditInPlace #8575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ibm-products-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8575 +/- ##
==========================================
- Coverage 82.01% 81.98% -0.03%
==========================================
Files 403 404 +1
Lines 18548 18554 +6
Branches 4189 4189
==========================================
Hits 15212 15212
- Misses 3336 3342 +6
🚀 New features to boost your workflow:
|
| /** | ||
| * Copyright IBM Corp. 2025, 2025 | ||
| * | ||
| * This source code is licensed under the Apache-2.0 license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { EditInPlace } from './EditInPlace'; | ||
| import figma from '@figma/code-connect'; | ||
|
|
||
| figma.connect( | ||
| EditInPlace, | ||
| 'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=15713-9770&t=A1DwBD80AwWFp5NR-0', | ||
| { | ||
| props: { | ||
| cancelLabel: figma.string('Cancel label'), | ||
| editLabel: figma.string('Edit label'), | ||
| invalid: figma.boolean('Invalid'), | ||
| invalidText: figma.string('Invalid text'), | ||
| labelText: figma.string('Label text'), | ||
| placeholder: figma.string('Placeholder'), | ||
| saveLabel: figma.string('Save label'), | ||
| size: figma.enum('Size', { | ||
| small: 'sm', | ||
| large: 'lg', | ||
| medium: 'md', | ||
| }), | ||
| value: figma.string('Value'), | ||
| }, | ||
| example: (props) => ( | ||
| <EditInPlace | ||
| cancelLabel={props.cancelLabel} | ||
| editLabel={props.editLabel} | ||
| invalid={props.invalid} | ||
| invalidText={props.invalidText} | ||
| labelText={props.labelText} | ||
| placeholder={props.placeholder} | ||
| saveLabel={props.saveLabel} | ||
| size={props.size} | ||
| value={props.value} | ||
| /> | ||
| ), | ||
| } | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to get it working with these changes in place...
| /** | |
| * Copyright IBM Corp. 2025, 2025 | |
| * | |
| * This source code is licensed under the Apache-2.0 license found in the | |
| * LICENSE file in the root directory of this source tree. | |
| */ | |
| import React from 'react'; | |
| import { EditInPlace } from './EditInPlace'; | |
| import figma from '@figma/code-connect'; | |
| figma.connect( | |
| EditInPlace, | |
| 'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=15713-9770&t=A1DwBD80AwWFp5NR-0', | |
| { | |
| props: { | |
| cancelLabel: figma.string('Cancel label'), | |
| editLabel: figma.string('Edit label'), | |
| invalid: figma.boolean('Invalid'), | |
| invalidText: figma.string('Invalid text'), | |
| labelText: figma.string('Label text'), | |
| placeholder: figma.string('Placeholder'), | |
| saveLabel: figma.string('Save label'), | |
| size: figma.enum('Size', { | |
| small: 'sm', | |
| large: 'lg', | |
| medium: 'md', | |
| }), | |
| value: figma.string('Value'), | |
| }, | |
| example: (props) => ( | |
| <EditInPlace | |
| cancelLabel={props.cancelLabel} | |
| editLabel={props.editLabel} | |
| invalid={props.invalid} | |
| invalidText={props.invalidText} | |
| labelText={props.labelText} | |
| placeholder={props.placeholder} | |
| saveLabel={props.saveLabel} | |
| size={props.size} | |
| value={props.value} | |
| /> | |
| ), | |
| } | |
| ); | |
| /** | |
| * Copyright IBM Corp. 2025, 2025 | |
| * | |
| * This source code is licensed under the Apache-2.0 license found in the | |
| * LICENSE file in the root directory of this source tree. | |
| */ | |
| import React from "react" | |
| import { EditInPlace } from "./EditInPlace" | |
| import figma from "@figma/code-connect" | |
| figma.connect( | |
| EditInPlace, | |
| "https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=15713%3A9775", | |
| { | |
| props: { | |
| // These props were automatically mapped based on your linked code: | |
| size: figma.enum("Size", { | |
| Small: "sm", | |
| }), | |
| invalid: figma.enum("State", { | |
| Active: false, | |
| Disabled: false, | |
| Enabled: false, | |
| Error: true, | |
| Focus: false, | |
| Hover: false, | |
| }), | |
| invalidText: figma.enum("State", { | |
| Active: undefined, | |
| Disabled: undefined, | |
| Enabled: undefined, | |
| Error: figma.textContent('Error message goes here'), | |
| Focus: undefined, | |
| Hover: undefined, | |
| }), | |
| value: figma.textContent('Input text'), | |
| }, | |
| example: (props) => ( | |
| <EditInPlace | |
| cancelLabel='Cancel' | |
| editLabel='Edit' | |
| id='Example-ID' | |
| labelText='Example label text' | |
| onCancel={()=> console.log("Cancel clicked")} | |
| onChange={(val) => {console.log("Changed to: " + val)}} | |
| onSave={()=> console.log("Save clicked")} | |
| saveLabel='Save' | |
| size={props.size} | |
| value={props.value} | |
| invalid={props.invalid} | |
| invalidText={props.invalidText} | |
| /> | |
| ), | |
| }, | |
| ) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that doesn't look right to me, but i don't have dev mode so i'll have to take your word for it 😂
fixt
szinta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a small change required to cover all the size prop values.
| props: { | ||
| // These props were automatically mapped based on your linked code: | ||
| size: figma.enum('Size', { | ||
| Small: 'sm', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Small: 'sm', | |
| Small: 'sm', | |
| Medium: 'md', | |
| Large: 'lg' |
Closes #8363