Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Input + Textarea + Label components (#2101)
Ivan Starkovc28ce5275436
diff --git a/packages/sdk-components-react-radix/package.json b/packages/sdk-components-react-radix/package.jsonindex 74a24d33a9..668a4a378e 100644--- a/packages/sdk-components-react-radix/package.json+++ b/packages/sdk-components-react-radix/package.json@@ -55,6 +55,7 @@"dependencies": {"@radix-ui/react-collapsible": "^1.0.3","@radix-ui/react-dialog": "^1.0.4",+ "@radix-ui/react-label": "^2.0.2","@radix-ui/react-popover": "^1.0.6","@radix-ui/react-tabs": "^1.0.4","@radix-ui/react-tooltip": "^1.0.6",diff --git a/packages/sdk-components-react-radix/src/__generated__/input.props.ts b/packages/sdk-components-react-radix/src/__generated__/input.props.tsnew file mode 100644index 0000000000..d468156f74--- /dev/null+++ b/packages/sdk-components-react-radix/src/__generated__/input.props.ts@@ -0,0 +1,500 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accept: { required: false, control: "text", type: "string" },+ accessKey: { required: false, control: "text", type: "string" },+ alt: { required: false, control: "text", type: "string" },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-braillelabel": {+ description:+ "Defines a string value that labels the current element, which is intended to be converted into Braille.\n@see aria-label.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-brailleroledescription": {+ description:+ "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.\n@see aria-roledescription.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-busy": { required: false, control: "boolean", type: "boolean" },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindextext": {+ description:+ "Defines a human readable text alternative of aria-colindex.\n@see aria-rowindextext.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-description": {+ description:+ "Defines a string value that describes or annotates the current element.\n@see related aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindextext": {+ description:+ "Defines a human readable text alternative of aria-rowindex.\n@see aria-colindextext.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoComplete: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ autoSave: { required: false, control: "text", type: "string" },+ checked: { required: false, control: "boolean", type: "boolean" },+ className: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ content: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ dir: { required: false, control: "text", type: "string" },+ disabled: { required: false, control: "boolean", type: "boolean" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ enterKeyHint: {+ required: false,+ control: "select",+ type: "string",+ options: ["search", "enter", "done", "go", "next", "previous", "send"],+ },+ form: { required: false, control: "text", type: "string" },+ formAction: { required: false, control: "text", type: "string" },+ formEncType: { required: false, control: "text", type: "string" },+ formMethod: { required: false, control: "text", type: "string" },+ formNoValidate: { required: false, control: "boolean", type: "boolean" },+ formTarget: { required: false, control: "text", type: "string" },+ height: { required: false, control: "number", type: "number" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "text",+ "email",+ "tel",+ "url",+ "none",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ list: { required: false, control: "text", type: "string" },+ max: { required: false, control: "number", type: "number" },+ maxLength: { required: false, control: "number", type: "number" },+ min: { required: false, control: "number", type: "number" },+ minLength: { required: false, control: "number", type: "number" },+ multiple: { required: false, control: "boolean", type: "boolean" },+ name: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ pattern: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ readOnly: { required: false, control: "boolean", type: "boolean" },+ rel: { required: false, control: "text", type: "string" },+ required: { required: false, control: "boolean", type: "boolean" },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ security: { required: false, control: "text", type: "string" },+ size: { required: false, control: "number", type: "number" },+ slot: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ src: { required: false, control: "text", type: "string" },+ step: { required: false, control: "number", type: "number" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: { required: false, control: "number", type: "number" },+ title: { required: false, control: "text", type: "string" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+ width: { required: false, control: "number", type: "number" },+};diff --git a/packages/sdk-components-react-radix/src/__generated__/label.props.ts b/packages/sdk-components-react-radix/src/__generated__/label.props.tsnew file mode 100644index 0000000000..2f4ed01a5e--- /dev/null+++ b/packages/sdk-components-react-radix/src/__generated__/label.props.ts@@ -0,0 +1,470 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accessKey: { required: false, control: "text", type: "string" },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-braillelabel": {+ description:+ "Defines a string value that labels the current element, which is intended to be converted into Braille.\n@see aria-label.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-brailleroledescription": {+ description:+ "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.\n@see aria-roledescription.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-busy": { required: false, control: "boolean", type: "boolean" },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindextext": {+ description:+ "Defines a human readable text alternative of aria-colindex.\n@see aria-rowindextext.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-description": {+ description:+ "Defines a string value that describes or annotates the current element.\n@see related aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindextext": {+ description:+ "Defines a human readable text alternative of aria-rowindex.\n@see aria-colindextext.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ autoSave: { required: false, control: "text", type: "string" },+ className: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ content: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ form: { required: false, control: "text", type: "string" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ htmlFor: { required: false, control: "text", type: "string" },+ id: { required: false, control: "text", type: "string" },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "text",+ "none",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ rel: { required: false, control: "text", type: "string" },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ security: { required: false, control: "text", type: "string" },+ slot: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: { required: false, control: "number", type: "number" },+ title: { required: false, control: "text", type: "string" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react-radix/src/__generated__/textarea.props.ts b/packages/sdk-components-react-radix/src/__generated__/textarea.props.tsnew file mode 100644index 0000000000..08e3f9fa8b--- /dev/null+++ b/packages/sdk-components-react-radix/src/__generated__/textarea.props.ts@@ -0,0 +1,480 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const props: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accessKey: { required: false, control: "text", type: "string" },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-braillelabel": {+ description:+ "Defines a string value that labels the current element, which is intended to be converted into Braille.\n@see aria-label.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-brailleroledescription": {+ description:+ "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.\n@see aria-roledescription.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-busy": { required: false, control: "boolean", type: "boolean" },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindextext": {+ description:+ "Defines a human readable text alternative of aria-colindex.\n@see aria-rowindextext.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-description": {+ description:+ "Defines a string value that describes or annotates the current element.\n@see related aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindextext": {+ description:+ "Defines a human readable text alternative of aria-rowindex.\n@see aria-colindextext.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoComplete: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ autoSave: { required: false, control: "text", type: "string" },+ className: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ cols: { required: false, control: "number", type: "number" },+ content: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ dir: { required: false, control: "text", type: "string" },+ dirName: { required: false, control: "text", type: "string" },+ disabled: { required: false, control: "boolean", type: "boolean" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ form: { required: false, control: "text", type: "string" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "search",+ "text",+ "none",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ maxLength: { required: false, control: "number", type: "number" },+ minLength: { required: false, control: "number", type: "number" },+ name: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ readOnly: { required: false, control: "boolean", type: "boolean" },+ rel: { required: false, control: "text", type: "string" },+ required: { required: false, control: "boolean", type: "boolean" },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ rows: { required: false, control: "number", type: "number" },+ security: { required: false, control: "text", type: "string" },+ slot: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: { required: false, control: "number", type: "number" },+ title: { required: false, control: "text", type: "string" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+ wrap: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react-radix/src/components.ts b/packages/sdk-components-react-radix/src/components.tsindex 34d13e5c48..737ae70198 100644--- a/packages/sdk-components-react-radix/src/components.ts+++ b/packages/sdk-components-react-radix/src/components.ts@@ -25,3 +25,6 @@ export {} from "./sheet";export { Tabs, TabsList, TabsTrigger, TabsContent } from "./tabs";export { Button } from "./button";+export { Input } from "./input";+export { Textarea } from "./textarea";+export { Label } from "./label";diff --git a/packages/sdk-components-react-radix/src/input.stories.ts b/packages/sdk-components-react-radix/src/input.stories.tsnew file mode 100644index 0000000000..6fb5d201cc--- /dev/null+++ b/packages/sdk-components-react-radix/src/input.stories.ts@@ -0,0 +1,31 @@+import type { Meta, StoryObj } from "@storybook/react";+import { renderComponentTemplate } from "@webstudio-is/react-sdk";+import { Input as InputPrimitive } from "./input";+import * as baseComponents from "@webstudio-is/sdk-components-react";+import * as baseMetas from "@webstudio-is/sdk-components-react/metas";+import * as radixComponents from "./components";+import * as radixMetas from "./metas";++export default {+ title: "Components/Input",+ component: InputPrimitive,+ argTypes: {+ placeholder: {+ type: "string",+ },+ type: {+ options: ["text", "file"],+ control: { type: "select" },+ },+ },+} satisfies Meta<typeof InputPrimitive>;++export const Input: StoryObj<typeof InputPrimitive> = {+ render: (props) =>+ renderComponentTemplate({+ name: "Input",+ props: { ...props },+ components: { ...baseComponents, ...radixComponents },+ metas: { ...baseMetas, ...radixMetas },+ }),+};diff --git a/packages/sdk-components-react-radix/src/input.tsx b/packages/sdk-components-react-radix/src/input.tsxnew file mode 100644index 0000000000..eff43f1a43--- /dev/null+++ b/packages/sdk-components-react-radix/src/input.tsx@@ -0,0 +1,12 @@+/* eslint-disable react/display-name */+// We can't use .displayName until this is merged https://github.com/styleguidist/react-docgen-typescript/pull/449++import { forwardRef, type ComponentPropsWithoutRef } from "react";++export const Input = forwardRef<+ HTMLInputElement,+ ComponentPropsWithoutRef<"input">+ // Make sure children are not passed down to an input, because this will result in error.+>(({ children: _children, ...props }, ref) => {+ return <input ref={ref} {...props} />;+});diff --git a/packages/sdk-components-react-radix/src/input.ws.ts b/packages/sdk-components-react-radix/src/input.ws.tsnew file mode 100644index 0000000000..7d9c9cc911--- /dev/null+++ b/packages/sdk-components-react-radix/src/input.ws.ts@@ -0,0 +1,79 @@+import { FormTextFieldIcon } from "@webstudio-is/icons/svg";+import {+ defaultStates,+ type PresetStyle,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { input } from "@webstudio-is/react-sdk/css-normalize";+import { props } from "./__generated__/input.props";+import * as tc from "./theme/tailwind-classes";++const presetStyle = {+ input,+} satisfies PresetStyle<"input">;++export const meta: WsComponentMeta = {+ category: "radix",+ type: "control",+ invalidAncestors: ["Button"],+ label: "Input",+ icon: FormTextFieldIcon,+ presetStyle,+ states: [+ ...defaultStates,+ { selector: ":disabled", label: "Disabled" },+ { selector: "::placeholder", label: "Placeholder" },+ { selector: "::file-selector-button", label: "File Selector Button" },+ // @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102+ { selector: ":valid", label: "Valid" },+ { selector: ":invalid", label: "Invalid" },+ { selector: ":required", label: "Required" },+ { selector: ":optional", label: "Optional" },+ { selector: ":enabled", label: "Enabled" },+ { selector: ":read-only", label: "Read Only" },+ { selector: ":read-write", label: "Read Write" },+ ],+ order: 1,+ template: [+ {+ type: "instance",+ component: "Input",+ styles: [+ // flex h-10 w-full rounded-md border border-input bg-background+ // px-3 py-2 text-sm+ // ring-offset-background+ // file:border-0 file:bg-transparent file:text-sm file:font-medium+ // placeholder:text-muted-foreground+ // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2+ // disabled:cursor-not-allowed disabled:opacity-50"+ tc.flex(),+ tc.h(10),+ tc.w("full"),+ tc.rounded("md"),+ tc.border(),+ tc.border("input"),+ tc.bg("background"),+ tc.px(3),+ tc.py(2),+ tc.text("sm"),+ tc.state(+ [tc.border(0), tc.bg("transparent"), tc.font("medium")].flat(),+ "::file-selector-button"+ ),+ tc.state(tc.text("mutedForeground"), "::placeholder"),+ tc.focusVisible(+ [tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()+ ),+ tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),+ ].flat(),++ children: [],+ },+ ],+};++export const propsMeta: WsComponentPropsMeta = {+ props,+ initialProps: ["id", "name", "type", "placeholder", "required", "autoFocus"],+};diff --git a/packages/sdk-components-react-radix/src/label.stories.ts b/packages/sdk-components-react-radix/src/label.stories.tsnew file mode 100644index 0000000000..7bcd09d800--- /dev/null+++ b/packages/sdk-components-react-radix/src/label.stories.ts@@ -0,0 +1,22 @@+import type { Meta, StoryObj } from "@storybook/react";+import { renderComponentTemplate } from "@webstudio-is/react-sdk";+import { Label as LabelPrimitive } from "./label";+import * as baseComponents from "@webstudio-is/sdk-components-react";+import * as baseMetas from "@webstudio-is/sdk-components-react/metas";+import * as radixComponents from "./components";+import * as radixMetas from "./metas";++export default {+ title: "Components/Label",+ component: LabelPrimitive,+} satisfies Meta<typeof LabelPrimitive>;++export const Label: StoryObj<typeof LabelPrimitive> = {+ render: (props) =>+ renderComponentTemplate({+ name: "Label",+ props: { ...props },+ components: { ...baseComponents, ...radixComponents },+ metas: { ...baseMetas, ...radixMetas },+ }),+};diff --git a/packages/sdk-components-react-radix/src/label.tsx b/packages/sdk-components-react-radix/src/label.tsxnew file mode 100644index 0000000000..3148ba1fc8--- /dev/null+++ b/packages/sdk-components-react-radix/src/label.tsx@@ -0,0 +1,15 @@+/* eslint-disable react/display-name */+// We can't use .displayName until this is merged https://github.com/styleguidist/react-docgen-typescript/pull/449++import {+ forwardRef,+ type ComponentPropsWithoutRef,+ type ElementRef,+} from "react";++import * as LabelPrimitive from "@radix-ui/react-label";++export const Label = forwardRef<+ ElementRef<typeof LabelPrimitive.Root>,+ Omit<ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, "asChild">+>((props, ref) => <LabelPrimitive.Root ref={ref} {...props} />);diff --git a/packages/sdk-components-react-radix/src/label.ws.ts b/packages/sdk-components-react-radix/src/label.ws.tsnew file mode 100644index 0000000000..64e0310fa6--- /dev/null+++ b/packages/sdk-components-react-radix/src/label.ws.ts@@ -0,0 +1,49 @@+import { LabelIcon } from "@webstudio-is/icons/svg";+import {+ defaultStates,+ type PresetStyle,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { label } from "@webstudio-is/react-sdk/css-normalize";+import { props } from "./__generated__/label.props";+import * as tc from "./theme/tailwind-classes";++const presetStyle = {+ label,+} satisfies PresetStyle<"label">;++export const meta: WsComponentMeta = {+ category: "radix",+ type: "container",+ label: "Label",+ icon: LabelIcon,+ presetStyle,+ states: defaultStates,+ order: 1,+ template: [+ {+ type: "instance",+ component: "Label",+ styles: [+ // text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70+ tc.text("sm"),+ tc.font("medium"),+ tc.leading("none"),+ // We are not supporting peer like styles yet+ ].flat(),+ children: [{ type: "text", value: "Form Label" }],+ },+ ],+};++export const propsMeta: WsComponentPropsMeta = {+ props: {+ ...props,+ htmlFor: {+ ...props.htmlFor,+ label: "For",+ },+ },+ initialProps: ["id", "htmlFor"],+};diff --git a/packages/sdk-components-react-radix/src/metas.ts b/packages/sdk-components-react-radix/src/metas.tsindex 4d4a75264a..a9159fd7b6 100644--- a/packages/sdk-components-react-radix/src/metas.ts+++ b/packages/sdk-components-react-radix/src/metas.ts@@ -38,3 +38,6 @@ export {metaTabsContent as TabsContent,} from "./tabs.ws";export { meta as Button } from "./button.ws";+export { meta as Input } from "./input.ws";+export { meta as Textarea } from "./textarea.ws";+export { meta as Label } from "./label.ws";diff --git a/packages/sdk-components-react-radix/src/props.ts b/packages/sdk-components-react-radix/src/props.tsindex 6f7845e88a..f69330779c 100644--- a/packages/sdk-components-react-radix/src/props.ts+++ b/packages/sdk-components-react-radix/src/props.ts@@ -38,3 +38,6 @@ export {propsMetaTabsContent as TabsContent,} from "./tabs.ws";export { propsMeta as Button } from "./button.ws";+export { propsMeta as Input } from "./input.ws";+export { propsMeta as Textarea } from "./textarea.ws";+export { propsMeta as Label } from "./label.ws";diff --git a/packages/sdk-components-react-radix/src/textarea.stories.ts b/packages/sdk-components-react-radix/src/textarea.stories.tsnew file mode 100644index 0000000000..3411a1bd31--- /dev/null+++ b/packages/sdk-components-react-radix/src/textarea.stories.ts@@ -0,0 +1,27 @@+import type { Meta, StoryObj } from "@storybook/react";+import { renderComponentTemplate } from "@webstudio-is/react-sdk";+import { Textarea as TextareaPrimitive } from "./textarea";+import * as baseComponents from "@webstudio-is/sdk-components-react";+import * as baseMetas from "@webstudio-is/sdk-components-react/metas";+import * as radixComponents from "./components";+import * as radixMetas from "./metas";++export default {+ title: "Components/Textarea",+ component: TextareaPrimitive,+ argTypes: {+ placeholder: {+ type: "string",+ },+ },+} satisfies Meta<typeof TextareaPrimitive>;++export const Textarea: StoryObj<typeof TextareaPrimitive> = {+ render: (props) =>+ renderComponentTemplate({+ name: "Textarea",+ props: { ...props },+ components: { ...baseComponents, ...radixComponents },+ metas: { ...baseMetas, ...radixMetas },+ }),+};diff --git a/packages/sdk-components-react-radix/src/textarea.tsx b/packages/sdk-components-react-radix/src/textarea.tsxnew file mode 100644index 0000000000..42b1593524--- /dev/null+++ b/packages/sdk-components-react-radix/src/textarea.tsx@@ -0,0 +1,12 @@+/* eslint-disable react/display-name */+// We can't use .displayName until this is merged https://github.com/styleguidist/react-docgen-typescript/pull/449++import { forwardRef, type ComponentPropsWithoutRef } from "react";++export const Textarea = forwardRef<+ HTMLTextAreaElement,+ ComponentPropsWithoutRef<"textarea">+ // Make sure children are not passed down to an input, because this will result in error.+>(({ children: _children, ...props }, ref) => {+ return <textarea ref={ref} {...props} />;+});diff --git a/packages/sdk-components-react-radix/src/textarea.ws.ts b/packages/sdk-components-react-radix/src/textarea.ws.tsnew file mode 100644index 0000000000..ea0410221d--- /dev/null+++ b/packages/sdk-components-react-radix/src/textarea.ws.ts@@ -0,0 +1,75 @@+import { FormTextAreaIcon } from "@webstudio-is/icons/svg";+import {+ defaultStates,+ type PresetStyle,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { textarea } from "@webstudio-is/react-sdk/css-normalize";+import { props } from "./__generated__/textarea.props";+import * as tc from "./theme/tailwind-classes";++const presetStyle = {+ textarea,+} satisfies PresetStyle<"textarea">;++export const meta: WsComponentMeta = {+ category: "radix",+ type: "control",+ label: "Textarea",+ invalidAncestors: ["Button"],+ icon: FormTextAreaIcon,+ presetStyle,+ states: [+ ...defaultStates,+ { selector: ":disabled", label: "Disabled" },+ { selector: "::placeholder", label: "Placeholder" },+ // @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102+ { selector: ":valid", label: "Valid" },+ { selector: ":invalid", label: "Invalid" },+ { selector: ":required", label: "Required" },+ { selector: ":optional", label: "Optional" },+ { selector: ":enabled", label: "Enabled" },+ { selector: ":read-only", label: "Read Only" },+ { selector: ":read-write", label: "Read Write" },+ ],+ order: 1,+ template: [+ {+ type: "instance",+ component: "Textarea",+ styles: [+ // flex min-h-[80px] w-full rounded-md+ // border border-input bg-background+ // px-3 py-2 text-sm ring-offset-background+ // placeholder:text-muted-foreground+ // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring+ // focus-visible:ring-offset-2+ // disabled:cursor-not-allowed disabled:opacity-50++ tc.flex(),+ tc.minH(20),+ tc.w("full"),+ tc.rounded("md"),+ tc.border(),+ tc.border("input"),+ tc.bg("background"),+ tc.px(3),+ tc.py(2),+ tc.text("sm"),+ tc.state(tc.text("mutedForeground"), "::placeholder"),+ tc.focusVisible(+ [tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()+ ),+ tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),+ ].flat(),++ children: [],+ },+ ],+};++export const propsMeta: WsComponentPropsMeta = {+ props,+ initialProps: ["id", "name", "placeholder", "required", "autoFocus"],+};diff --git a/packages/sdk-components-react-radix/src/theme/tailwind-classes.ts b/packages/sdk-components-react-radix/src/theme/tailwind-classes.tsindex 7e573e5312..7d18fdeeb4 100644--- a/packages/sdk-components-react-radix/src/theme/tailwind-classes.ts+++ b/packages/sdk-components-react-radix/src/theme/tailwind-classes.ts@@ -254,6 +254,16 @@ export const h = (return [{ property: "height", value }];};+export const minH = (+ spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["height"]>+): EmbedTemplateStyleDecl[] => {+ const key = `${spacing}` as const;+ const valueString = theme("height")?.[key] ?? "0";+ const value = parseCssValue("minHeight", valueString);++ return [{ property: "minHeight", value }];+};+export const opacity = (opacity: StringEnumToNumeric<keyof EvaluatedDefaultTheme["opacity"]>): EmbedTemplateStyleDecl[] => {@@ -269,6 +279,20 @@ export const opacity = (];};+export const cursor = (+ cursor: keyof EvaluatedDefaultTheme["cursor"]+): EmbedTemplateStyleDecl[] => {+ const valueString = theme("cursor")?.[cursor] ?? "auto";+ const value = parseCssValue("cursor", valueString);++ return [+ {+ property: "cursor",+ value,+ },+ ];+};+export const maxW = (spacing:| StringEnumToNumeric<keyof EvaluatedDefaultTheme["maxWidth"]>diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 6c56314896..45923321ef 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1347,6 +1347,9 @@ importers:'@radix-ui/react-dialog':specifier: ^1.0.4version: 1.0.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-label':+ specifier: ^2.0.2+ version: 2.0.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])'@radix-ui/react-popover':specifier: ^1.0.6version: 1.0.6(@types/[email protected])(@types/[email protected])([email protected])([email protected])