diff --git a/packages/code-connect/components/Forms/BasicFormDemo.figma.tsx b/packages/code-connect/components/Forms/BasicFormDemo.figma.tsx new file mode 100644 index 00000000000..4cbee6f1dba --- /dev/null +++ b/packages/code-connect/components/Forms/BasicFormDemo.figma.tsx @@ -0,0 +1,15 @@ +import figma from '@figma/code-connect'; +import { Form } from '@patternfly/react-core'; + +// Documentation for Form can be found at https://www.patternfly.org/components/forms + +figma.connect( + Form, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1577-2965&t=IzSunfrnw18ti37Y-11', + { + props: { + children: figma.children('*') + }, + example: (props) =>
{props.children}
+ } +); diff --git a/packages/code-connect/components/Forms/Checkbox.figma.tsx b/packages/code-connect/components/Forms/Checkbox.figma.tsx new file mode 100644 index 00000000000..d8e93154f0e --- /dev/null +++ b/packages/code-connect/components/Forms/Checkbox.figma.tsx @@ -0,0 +1,53 @@ +import figma from '@figma/code-connect'; +import { Checkbox } from '@patternfly/react-core'; + +// Documentation for Checkbox can be found at https://www.patternfly.org/components/forms/checkbox + +figma.connect( + Checkbox, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=157-3078', + { + props: { + // nested props + isChecked: figma.nestedProps('Checkbox Input', { + checked: figma.enum('State', { + Checked: true, + 'Checked Disabled': true + }), + mixed: figma.enum('State', { + Mixed: 'null', + 'Mixed disabled': 'null' + }) + }), + + // boolean + description: figma.boolean('Description', { + true: figma.string('✏️ Description'), + false: undefined + }), + + // enum + ariaLabel: figma.enum('Type', { Standalone: 'Standalone input' }), + isDisabled: figma.enum('State', { + 'Unchecked Disabled': true, + 'Checked Disabled': true, + 'Mixed disabled': true + }), + labelPlacement: figma.enum('Label placement', { Reversed: 'start' }), + toggleLabel: figma.enum('Type', { 'With Label': figma.string('✏️ Toggle label') }) + }, + example: (props) => ( + {}} + /> + ) + } +); diff --git a/packages/code-connect/components/Forms/CheckboxGroup.figma.tsx b/packages/code-connect/components/Forms/CheckboxGroup.figma.tsx new file mode 100644 index 00000000000..a363c0125f4 --- /dev/null +++ b/packages/code-connect/components/Forms/CheckboxGroup.figma.tsx @@ -0,0 +1,54 @@ +import figma from '@figma/code-connect'; +import { FormGroup, FormGroupLabelHelp, Popover } from '@patternfly/react-core'; + +// Documentation for CheckboxGroup can be found at https://www.patternfly.org/components/forms/checkbox-group + +figma.connect( + FormGroup, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1577-4455', + { + props: { + label: figma.boolean('Label', { + true: figma.nestedProps('Input Label', { + isRequired: figma.boolean('Required', { + true: true, + false: undefined + }), + hasHelperText: figma.boolean('Help Icon', { + true: ( + + + + ), + false: undefined + }), + text: figma.string('✏️ Label text') + }), + false: undefined + }), + helperText: figma.boolean('Helper text', { + true: figma.children('HelperText'), + false: undefined + }), + isInline: figma.enum('Layout', { + Horizontal: true, + 'Default (vertical)': false + }), + + checkboxes: figma.children('Checkbox') + }, + example: (props) => ( + + {props.checkboxes} + + ) + } +); diff --git a/packages/code-connect/components/Forms/CheckboxInput.figma.tsx b/packages/code-connect/components/Forms/CheckboxInput.figma.tsx new file mode 100644 index 00000000000..e121dae6332 --- /dev/null +++ b/packages/code-connect/components/Forms/CheckboxInput.figma.tsx @@ -0,0 +1,32 @@ +// import figma from '@figma/code-connect'; +// import { Checkbox } from '@patternfly/react-core'; + +// // Documentation for Checkbox can be found at https://www.patternfly.org/components/forms/text-area + +// figma.connect( +// Checkbox, +// 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=157-1280', +// { +// props: { +// isChecked: figma.enum('State', { +// Checked: true, +// 'Checked Disabled': true +// }), +// isDisabled: figma.enum('State', { +// 'Unchecked Disabled': true, +// 'Checked Disabled': true, +// 'Mixed disabled': true +// }) +// }, +// example: (props) => ( +// {}} +// /> +// ) +// } +// ); diff --git a/packages/code-connect/components/Forms/FieldGroup.figma.tsx b/packages/code-connect/components/Forms/FieldGroup.figma.tsx new file mode 100644 index 00000000000..7cb33178b83 --- /dev/null +++ b/packages/code-connect/components/Forms/FieldGroup.figma.tsx @@ -0,0 +1,15 @@ +import figma from '@figma/code-connect'; +import { FormFieldGroupExpandable } from '@patternfly/react-core'; + +// Documentation for FormFieldGroupExpandable can be found at https://www.patternfly.org/components/forms/field-group + +figma.connect( + FormFieldGroupExpandable, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=17114-21566', + { + props: { + children: figma.children(['Text inputs', 'HelperText']) + }, + example: (props) => {props.children} + } +); diff --git a/packages/code-connect/components/Forms/FieldGroupHeader.figma.tsx b/packages/code-connect/components/Forms/FieldGroupHeader.figma.tsx new file mode 100644 index 00000000000..deb392e0160 --- /dev/null +++ b/packages/code-connect/components/Forms/FieldGroupHeader.figma.tsx @@ -0,0 +1,32 @@ +import figma from '@figma/code-connect'; +import { FormFieldGroupExpandable, FormFieldGroupHeader } from '@patternfly/react-core'; + +// TODO: DESIGN: Separate textTitleText and titleDescription into separate props +// TODO: DESIGN: Separate form field group expandable and non-expandable +// TODO: DESIGN: Separate action buttons +// Documentation for FormGroup can be found at https://www.patternfly.org/components/forms + +figma.connect( + FormFieldGroupExpandable, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=17114-21473', + { + props: { + actions: figma.textContent('Action buttons'), + isExpanded: figma.enum('Type', { 'expandable - open': true }), + titleDescription: 'Description', + titleText: { + // text: figma.string('Title'), + id: 'field-group-title-id', + text: 'Title' + } + // titleDescription: figma.string('Description'), + }, + example: (props) => ( + + ) + } +); diff --git a/packages/code-connect/components/Forms/FieldGroupHeaderNested.figma.tsx b/packages/code-connect/components/Forms/FieldGroupHeaderNested.figma.tsx new file mode 100644 index 00000000000..8fc2413f7df --- /dev/null +++ b/packages/code-connect/components/Forms/FieldGroupHeaderNested.figma.tsx @@ -0,0 +1,32 @@ +import figma from '@figma/code-connect'; +import { FormFieldGroupExpandable, FormFieldGroupHeader } from '@patternfly/react-core'; + +// TODO: DESIGN: Separate textTitleText and titleDescription into separate props +// TODO: DESIGN: Separate form field group expandable and non-expandable +// TODO: DESIGN: Separate action buttons +// Documentation for FormGroup can be found at https://www.patternfly.org/components/forms + +figma.connect( + FormFieldGroupExpandable, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=17114-21536&t=IzSunfrnw18ti37Y-11', + { + props: { + // string literal + titleText: { + // text: figma.string('Title'), + id: 'field-group-title-id', + text: 'Title' + }, + + // titleDescription: figma.string('Description'), + titleDescription: 'Description', + + // enum + isExpanded: figma.enum('Type', { 'expandable - open': true }), + + // text content + actions: figma.textContent('Action buttons') + }, + example: (props) => + } +); diff --git a/packages/code-connect/components/Forms/HelperText.figma.tsx b/packages/code-connect/components/Forms/HelperText.figma.tsx new file mode 100644 index 00000000000..8ac9c1e20ea --- /dev/null +++ b/packages/code-connect/components/Forms/HelperText.figma.tsx @@ -0,0 +1,29 @@ +import figma from '@figma/code-connect'; +import { HelperText, HelperTextItem } from '@patternfly/react-core'; + +// Documentation for HelperText can be found at https://www.patternfly.org/components/helper-text + +figma.connect( + HelperText, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=151-1670&t=lyan2LLnXsDppzjo-11', + { + props: { + // string + helperText: figma.string('✏️ Helper text'), + + // enum + variant: figma.enum('Type', { + Default: undefined, + Indeterminate: 'indeterminate', + Success: 'success', + Warning: 'warning', + Error: 'error' + }) + }, + example: (props) => ( + + {props.helperText} + + ) + } +); diff --git a/packages/code-connect/components/Forms/InputField.figma.tsx b/packages/code-connect/components/Forms/InputField.figma.tsx new file mode 100644 index 00000000000..b93e163933f --- /dev/null +++ b/packages/code-connect/components/Forms/InputField.figma.tsx @@ -0,0 +1,24 @@ +import figma from '@figma/code-connect'; +import { FormGroup } from '@patternfly/react-core'; + +// Documentation for FormGroup can be found at https://www.patternfly.org/components/text-input + +figma.connect( + FormGroup, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=157-788', + { + props: { + // nested props + label: figma.nestedProps('Input Label', { text: figma.string('✏️ Label text') }), + + // children + children: figma.children('Text inputs') + }, + + example: (props) => ( + + {props.children} + + ) + } +); diff --git a/packages/code-connect/components/Forms/InputGroup.figma.tsx b/packages/code-connect/components/Forms/InputGroup.figma.tsx new file mode 100644 index 00000000000..396bbd549ed --- /dev/null +++ b/packages/code-connect/components/Forms/InputGroup.figma.tsx @@ -0,0 +1,18 @@ +import figma from '@figma/code-connect'; +import { InputGroup } from '@patternfly/react-core'; + +// TODO: DESIGN: InputGroupItems is not using TextInput, it's using text layers +// For this component to work properly, components should be nested within the InputGroupItem component +// TODO: DESIGN: Remove or populate `Text` and `Button` variants with actual components +// Documentation for InputGroup can be found at https://www.patternfly.org/components/input-group + +figma.connect( + InputGroup, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=12700-4200', + { + props: { + children: figma.children('*') + }, + example: (props) => {props.children} + } +); diff --git a/packages/code-connect/components/Forms/InputGroupItems.figma.tsx b/packages/code-connect/components/Forms/InputGroupItems.figma.tsx new file mode 100644 index 00000000000..ad16fd22f77 --- /dev/null +++ b/packages/code-connect/components/Forms/InputGroupItems.figma.tsx @@ -0,0 +1,21 @@ +import figma from '@figma/code-connect'; +import { InputGroupItem } from '@patternfly/react-core'; +import CircleIcon from '@patternfly/react-icons/icons/circle-icon/dist/esm/icons/circle-icon'; + +// Documentation for InputGroup can be found at https://www.patternfly.org/components/input-group + +figma.connect( + InputGroupItem, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=176-2806', + { + props: { + inputGroupContent: figma.enum('Type', { + Text: figma.string('✏️ Input text'), + Icon: , + Button: figma.children('Button'), + Dropdown: figma.children('Menu Toggle') + }) + }, + example: (props) => {props.inputGroupContent} + } +); diff --git a/packages/code-connect/components/Forms/InputLabel.figma.tsx b/packages/code-connect/components/Forms/InputLabel.figma.tsx new file mode 100644 index 00000000000..c052ab1f255 --- /dev/null +++ b/packages/code-connect/components/Forms/InputLabel.figma.tsx @@ -0,0 +1,26 @@ +import figma from '@figma/code-connect'; +import { FormGroup, FormGroupLabelHelp, Popover } from '@patternfly/react-core'; + +// Documentation for FormGroup can be found at https://www.patternfly.org/components/forms/form-group + +figma.connect( + FormGroup, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=151-1566', + { + props: { + isRequired: figma.boolean('Required'), + labelText: figma.string('✏️ Label text'), + labelHelp: figma.boolean('Help Icon', { + true: ( + + + + ), + false: undefined + }), + + children: figma.children('*') + }, + example: (props) => {props.children} + } +); diff --git a/packages/code-connect/components/Forms/LabeledInputGroup.figma.tsx b/packages/code-connect/components/Forms/LabeledInputGroup.figma.tsx new file mode 100644 index 00000000000..1c1e4377263 --- /dev/null +++ b/packages/code-connect/components/Forms/LabeledInputGroup.figma.tsx @@ -0,0 +1,21 @@ +import figma from '@figma/code-connect'; +import { FormGroup } from '@patternfly/react-core'; + +// Documentation for FormGroup can be found at https://www.patternfly.org/components/labeled-input-group + +figma.connect( + FormGroup, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=176-3526', + { + props: { + // boolean + helperText: figma.boolean('Helper text'), + + children: figma.children('*') + }, + example: (props) => ( + // Documentation for FormGroup can be found at https://www.patternfly.org/components/labeled-input-group + {props.children} + ) + } +); diff --git a/packages/code-connect/components/Forms/LabeledNumberInput.figma.tsx b/packages/code-connect/components/Forms/LabeledNumberInput.figma.tsx new file mode 100644 index 00000000000..8c42ff9b09c --- /dev/null +++ b/packages/code-connect/components/Forms/LabeledNumberInput.figma.tsx @@ -0,0 +1,25 @@ +// import React from "react" +// import { LabeledNumberInput } from "./LabeledNumberInput" +// import figma from '@figma/code-connect' + +// /** +// * -- This file was auto-generated by Code Connect -- +// * `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( +// LabeledNumberInput, +// "https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=176-4200&t=IzSunfrnw18ti37Y-11", +// { +// props: { +// helperText: figma.boolean("Helper text"), +// }, +// example: (props) => ( +// // Documentation for LabeledNumberInput can be found at https://www.patternfly.org/components/labeled-number-input +// +// ) +// } +// ); diff --git a/packages/code-connect/components/Forms/NumberInputField.figma.tsx b/packages/code-connect/components/Forms/NumberInputField.figma.tsx new file mode 100644 index 00000000000..cf0a7e41d5b --- /dev/null +++ b/packages/code-connect/components/Forms/NumberInputField.figma.tsx @@ -0,0 +1,38 @@ +import figma from '@figma/code-connect'; +import { NumberInput } from '@patternfly/react-core'; + +// Documentation for NumberInput can be found at https://www.patternfly.org/components/number-input + +figma.connect( + NumberInput, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=176-3706&t=IzSunfrnw18ti37Y-11', + { + props: { + // string + unit: figma.string('Unit'), + + // enum + isDisabled: figma.enum('Status', { Disabled: true }), + validated: figma.enum('Status', { + Warning: 'warning', + Error: 'error', + Success: 'success' + }) + }, + example: (props) => ( + {}} + onChange={() => {}} + onPlus={() => {}} + plusBtnAriaLabel="plus" + unit={props.unit} + value={90} + validated={props.validated} + /> + ) + } +); diff --git a/packages/code-connect/components/Forms/RadioButton.figma.tsx b/packages/code-connect/components/Forms/RadioButton.figma.tsx new file mode 100644 index 00000000000..c04897b2521 --- /dev/null +++ b/packages/code-connect/components/Forms/RadioButton.figma.tsx @@ -0,0 +1,48 @@ +import figma from '@figma/code-connect'; +import { Radio } from '@patternfly/react-core'; + +// Documentation for Radio can be found at https://www.patternfly.org/components/radio + +figma.connect( + Radio, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=157-3354', + { + props: { + // nested props + isChecked: figma.nestedProps('Radio button', { + checked: figma.enum('State', { + Checked: true, + 'Checked Disabled': true + }) + }), + + // boolean + description: figma.boolean('Description', { + true: figma.string('✏️ Description'), + false: undefined + }), + + // enum + ariaLabel: figma.enum('Type', { Standalone: 'Standalone input' }), + isDisabled: figma.enum('State', { + 'Checked Disabled': true, + Disabled: true + }), + labelPlacement: figma.enum('Label placement', { Reversed: 'start' }), + toggleLabel: figma.enum('Type', { 'With Label': figma.string('✏️ Toggle label') }) + }, + example: (props) => ( + {}} + /> + ) + } +); diff --git a/packages/code-connect/components/Forms/RadioButtonGroup.figma.tsx b/packages/code-connect/components/Forms/RadioButtonGroup.figma.tsx new file mode 100644 index 00000000000..1081b8210df --- /dev/null +++ b/packages/code-connect/components/Forms/RadioButtonGroup.figma.tsx @@ -0,0 +1,54 @@ +import figma from '@figma/code-connect'; +import { FormGroup, FormGroupLabelHelp, Popover } from '@patternfly/react-core'; + +// Documentation for FormGroup can be found at https://www.patternfly.org/components/forms/radio + +figma.connect( + FormGroup, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1577-4497&m=dev', + { + props: { + // boolean + label: figma.boolean('Label', { + true: figma.nestedProps('Input Label', { + isRequired: figma.boolean('Required', { + true: true, + false: undefined + }), + hasHelperText: figma.boolean('Help Icon', { + true: ( + + + + ), + false: undefined + }), + text: figma.string('✏️ Label text') + }), + false: undefined + }), + helperText: figma.boolean('Helper text', { + true: figma.children('HelperText'), + false: undefined + }), + + // enum + isInline: figma.enum('Layout', { Horizontal: true }), + + radios: figma.children('Radio Button') + }, + example: (props) => ( + + {props.radios} + + ) + } +); diff --git a/packages/code-connect/components/Forms/Switch.figma.tsx b/packages/code-connect/components/Forms/Switch.figma.tsx new file mode 100644 index 00000000000..3f9b792c693 --- /dev/null +++ b/packages/code-connect/components/Forms/Switch.figma.tsx @@ -0,0 +1,31 @@ +import figma from '@figma/code-connect'; +import { Switch } from '@patternfly/react-core'; + +// Documentation for Switch can be found at https://www.patternfly.org/components/switch + +figma.connect( + Switch, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=157-3431', + { + props: { + // enum + ariaLabel: figma.enum('Type', { Standalone: 'Standalone input' }), + isChecked: figma.enum('State', { On: true }), + isDisabled: figma.enum('State', { Disabled: true }), + labelPosition: figma.enum('Label placement', { Reversed: 'start' }), + toggleLabel: figma.enum('Type', { 'With Label': figma.string('✏️ Toggle label') }) + }, + example: (props) => ( + {}} + /> + ) + } +); diff --git a/packages/code-connect/components/Forms/Switches.figma.tsx b/packages/code-connect/components/Forms/Switches.figma.tsx new file mode 100644 index 00000000000..2bb49dc23f9 --- /dev/null +++ b/packages/code-connect/components/Forms/Switches.figma.tsx @@ -0,0 +1,35 @@ +import figma from '@figma/code-connect'; +import { Switch } from '@patternfly/react-core'; + +// Documentation for Switch can be found at https://www.patternfly.org/components/switch + +figma.connect( + Switch, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=157-2878', + { + props: { + // boolean + hasCheckIcon: figma.boolean('Show check'), + + // enum + isChecked: figma.enum('State', { + On: true, + 'Disabled On': true + }), + isDisabled: figma.enum('State', { + 'Disabled On': true, + 'Disabled Off': true + }) + }, + example: (props) => ( + {}} + /> + ) + } +); diff --git a/packages/code-connect/components/Forms/TextInputs.figma.tsx b/packages/code-connect/components/Forms/TextInputs.figma.tsx new file mode 100644 index 00000000000..64034241e14 --- /dev/null +++ b/packages/code-connect/components/Forms/TextInputs.figma.tsx @@ -0,0 +1,37 @@ +import figma from '@figma/code-connect'; +import { TextInput } from '@patternfly/react-core'; + +// Documentation for TextInput can be found at https://www.patternfly.org/components/text-input + +figma.connect( + TextInput, + 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=154-71', + { + props: { + // string + value: figma.string('✏️ Input text'), + + // enum + isDisabled: figma.enum('State', { Disabled: true }), + isReadOnly: figma.enum('State', { 'Read Only': true }), + isReadOnlyPlain: figma.enum('State', { 'ReadOnly - Plain': 'plain' }), + validated: figma.enum('State', { + Success: 'success', + Error: 'error', + Warning: 'warning' + }) + }, + + example: (props) => ( + + ) + } +);