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
Add radix radio group (#2192)
Bogdan Chadkine814cfaaed32
diff --git a/packages/icons/icons/radio-dot.svg b/packages/icons/icons/radio-dot.svgnew file mode 100644index 0000000000..6e2ca7a669--- /dev/null+++ b/packages/icons/icons/radio-dot.svg@@ -0,0 +1,5 @@+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">+<g id="icon/radio-dot">+<path id="vector" d="M7.99998 5.3501C6.53642 5.3501 5.34998 6.53654 5.34998 8.0001C5.34998 9.46365 6.53642 10.6501 7.99998 10.6501C9.46353 10.6501 10.65 9.46365 10.65 8.0001C10.65 6.53654 9.46353 5.3501 7.99998 5.3501Z" />+</g>+</svg>diff --git a/packages/icons/src/__generated__/index.ts b/packages/icons/src/__generated__/index.tsindex 6dc15f84e0..8ce2a191a9 100644--- a/packages/icons/src/__generated__/index.ts+++ b/packages/icons/src/__generated__/index.ts@@ -123,6 +123,7 @@ export * from "./play";export * from "./plus";export * from "./popover";export * from "./radio-checked";+export * from "./radio-dot";export * from "./radio-unchecked";export * from "./refresh";export * from "./repeat-column";diff --git a/packages/icons/src/__generated__/radio-dot.tsx b/packages/icons/src/__generated__/radio-dot.tsxnew file mode 100644index 0000000000..a2cbd4df1b--- /dev/null+++ b/packages/icons/src/__generated__/radio-dot.tsx@@ -0,0 +1,15 @@+// Generated from icons/radio-dot.svg++import { forwardRef } from "react";+import type { IconProps } from "../types";++// prettier-ignore+export const RadioDotIcon = forwardRef<SVGSVGElement, IconProps>(+ ({ color = "currentColor", size = 16, ...props }, forwardedRef) => {+ return (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width={size} height={size} fill={color} {...props} ref={forwardedRef}><path d="M8 5.35a2.65 2.65 0 1 0 0 5.3 2.65 2.65 0 0 0 0-5.3Z" /></svg>+ );+ }+);++RadioDotIcon.displayName = "RadioDotIcon";diff --git a/packages/icons/src/__generated__/svg/index.ts b/packages/icons/src/__generated__/svg/index.tsindex 119d4871eb..133a9a2277 100644--- a/packages/icons/src/__generated__/svg/index.ts+++ b/packages/icons/src/__generated__/svg/index.ts@@ -123,6 +123,7 @@ export { PlayIcon } from "./play";export { PlusIcon } from "./plus";export { PopoverIcon } from "./popover";export { RadioCheckedIcon } from "./radio-checked";+export { RadioDotIcon } from "./radio-dot";export { RadioUncheckedIcon } from "./radio-unchecked";export { RefreshIcon } from "./refresh";export { RepeatColumnIcon } from "./repeat-column";diff --git a/packages/icons/src/__generated__/svg/radio-dot.ts b/packages/icons/src/__generated__/svg/radio-dot.tsnew file mode 100644index 0000000000..718d434c62--- /dev/null+++ b/packages/icons/src/__generated__/svg/radio-dot.ts@@ -0,0 +1 @@+export const RadioDotIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M8 5.35a2.65 2.65 0 1 0 0 5.3 2.65 2.65 0 0 0 0-5.3Z"/></svg>`;diff --git a/packages/sdk-components-react-radix/package.json b/packages/sdk-components-react-radix/package.jsonindex 8f04b58ecf..4630150f2e 100644--- a/packages/sdk-components-react-radix/package.json+++ b/packages/sdk-components-react-radix/package.json@@ -60,6 +60,7 @@"@radix-ui/react-label": "^2.0.2","@radix-ui/react-navigation-menu": "^1.1.3","@radix-ui/react-popover": "^1.0.6",+ "@radix-ui/react-radio-group": "^1.1.3","@radix-ui/react-select": "^1.2.2","@radix-ui/react-switch": "^1.0.3","@radix-ui/react-tabs": "^1.0.4",diff --git a/packages/sdk-components-react-radix/src/__generated__/radio-group.props.ts b/packages/sdk-components-react-radix/src/__generated__/radio-group.props.tsnew file mode 100644index 0000000000..3a4cce5c8f--- /dev/null+++ b/packages/sdk-components-react-radix/src/__generated__/radio-group.props.ts@@ -0,0 +1,1429 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const propsRadioGroup: 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" },+ dir: {+ required: false,+ control: "radio",+ type: "string",+ options: ["ltr", "rtl"],+ },+ disabled: { required: false, control: "boolean", type: "boolean" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ 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" },+ loop: { required: false, control: "boolean", type: "boolean" },+ name: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ orientation: {+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ 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" },+ 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" },+ 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"],+ },+ value: { required: false, control: "text", type: "string" },+ vocab: { required: false, control: "text", type: "string" },+};+export const propsRadioGroupItem: 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" },+ 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" },+ dir: { 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" },+ 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" },+ 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" },+ 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" },+ 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" },+ 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"],+ },+ type: {+ required: false,+ control: "radio",+ type: "string",+ options: ["button", "submit", "reset"],+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ value: { required: true, control: "text", type: "string" },+ vocab: { required: false, control: "text", type: "string" },+};+export const propsRadioGroupIndicator: 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" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ 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" },+ 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/components.ts b/packages/sdk-components-react-radix/src/components.tsindex 3593f20405..00fc74006d 100644--- a/packages/sdk-components-react-radix/src/components.ts+++ b/packages/sdk-components-react-radix/src/components.ts@@ -47,3 +47,4 @@ export {export { Switch, SwitchThumb } from "./switch";export { Checkbox, CheckboxIndicator } from "./checkbox";+export { RadioGroup, RadioGroupItem, RadioGroupIndicator } from "./radio-group";diff --git a/packages/sdk-components-react-radix/src/metas.ts b/packages/sdk-components-react-radix/src/metas.tsindex 222d8338dd..187cf80514 100644--- a/packages/sdk-components-react-radix/src/metas.ts+++ b/packages/sdk-components-react-radix/src/metas.ts@@ -67,3 +67,8 @@ export {metaCheckbox as Checkbox,metaCheckboxIndicator as CheckboxIndicator,} from "./checkbox.ws";+export {+ metaRadioGroup as RadioGroup,+ metaRadioGroupItem as RadioGroupItem,+ metaRadioGroupIndicator as RadioGroupIndicator,+} from "./radio-group.ws";diff --git a/packages/sdk-components-react-radix/src/props.ts b/packages/sdk-components-react-radix/src/props.tsindex 4194503a39..6ca4847d16 100644--- a/packages/sdk-components-react-radix/src/props.ts+++ b/packages/sdk-components-react-radix/src/props.ts@@ -66,3 +66,8 @@ export {propsMetaCheckbox as Checkbox,propsMetaCheckboxIndicator as CheckboxIndicator,} from "./checkbox.ws";+export {+ propsMetaRadioGroup as RadioGroup,+ propsMetaRadioGroupItem as RadioGroupItem,+ propsMetaRadioGroupIndicator as RadioGroupIndicator,+} from "./radio-group.ws";diff --git a/packages/sdk-components-react-radix/src/radio-group.stories.ts b/packages/sdk-components-react-radix/src/radio-group.stories.tsnew file mode 100644index 0000000000..0f354e74a4--- /dev/null+++ b/packages/sdk-components-react-radix/src/radio-group.stories.ts@@ -0,0 +1,22 @@+import type { Meta, StoryObj } from "@storybook/react";+import { renderComponentTemplate } from "@webstudio-is/react-sdk";+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";+import { RadioGroup as RadioGroupPrimitive } from "./radio-group";++export default {+ title: "Components/RadioGroup",+ component: RadioGroupPrimitive,+} satisfies Meta<typeof RadioGroupPrimitive>;++export const RadioGroup: StoryObj<typeof RadioGroupPrimitive> = {+ render: (props) =>+ renderComponentTemplate({+ name: "RadioGroup",+ props: { ...props },+ components: { ...baseComponents, ...radixComponents },+ metas: { ...baseMetas, ...radixMetas },+ }),+};diff --git a/packages/sdk-components-react-radix/src/radio-group.tsx b/packages/sdk-components-react-radix/src/radio-group.tsxnew file mode 100644index 0000000000..d037874582--- /dev/null+++ b/packages/sdk-components-react-radix/src/radio-group.tsx@@ -0,0 +1,17 @@+import {+ type ForwardRefExoticComponent,+ type ComponentPropsWithRef,+} from "react";+import { Root, Item, Indicator } from "@radix-ui/react-radio-group";++export const RadioGroup: ForwardRefExoticComponent<+ ComponentPropsWithRef<typeof Root>+> = Root;++export const RadioGroupItem: ForwardRefExoticComponent<+ ComponentPropsWithRef<typeof Item>+> = Item;++export const RadioGroupIndicator: ForwardRefExoticComponent<+ ComponentPropsWithRef<typeof Indicator>+> = Indicator;diff --git a/packages/sdk-components-react-radix/src/radio-group.ws.ts b/packages/sdk-components-react-radix/src/radio-group.ws.tsnew file mode 100644index 0000000000..d0da0b0e2e--- /dev/null+++ b/packages/sdk-components-react-radix/src/radio-group.ws.ts@@ -0,0 +1,174 @@+import {+ ItemIcon,+ RadioCheckedIcon,+ RadioDotIcon,+ TriggerIcon,+} from "@webstudio-is/icons/svg";+import {+ defaultStates,+ WsEmbedTemplate,+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import { button, div, span } from "@webstudio-is/react-sdk/css-normalize";+import * as tc from "./theme/tailwind-classes";+import { buttonReset } from "./theme/styles";+import {+ propsRadioGroup,+ propsRadioGroupIndicator,+ propsRadioGroupItem,+} from "./__generated__/radio-group.props";++const createRadioGroupItem = ({+ value,+ label,+}: {+ value: string;+ label: string;+}): WsEmbedTemplate[number] => ({+ type: "instance",+ component: "Label",+ // flex items-center space-x-2+ styles: [tc.flex(), tc.items("center"), tc.gap(2)].flat(),+ children: [+ {+ type: "instance",+ component: "RadioGroupItem",+ props: [{ name: "value", type: "string", value }],+ // aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background+ // focus:outline-none+ // focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2+ // disabled:cursor-not-allowed disabled:opacity-50+ styles: [+ tc.aspect("square"),+ tc.h(4),+ tc.w(4),+ tc.rounded("full"),+ tc.border(),+ tc.border("primary"),+ tc.text("primary"),+ tc.focusVisible(+ [tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()+ ),+ tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),+ ].flat(),+ children: [+ {+ type: "instance",+ component: "RadioGroupIndicator",+ children: [+ {+ type: "instance",+ component: "HtmlEmbed",+ label: "Indicator Icon",+ props: [+ {+ type: "string",+ name: "code",+ value: RadioDotIcon,+ },+ ],+ children: [],+ },+ ],+ },+ ],+ },+ {+ type: "instance",+ component: "Text",+ children: [{ type: "text", value: label }],+ },+ ],+});++export const metaRadioGroup: WsComponentMeta = {+ category: "radix",+ order: 100,+ type: "container",+ icon: RadioCheckedIcon,+ states: [+ ...defaultStates,+ {+ label: "Checked",+ selector: "[data-state=checked]",+ category: "component-states",+ },+ {+ label: "Unchecked",+ selector: "[data-state=unchecked]",+ category: "component-states",+ },+ ],+ presetStyle: {+ div,+ },+ template: [+ {+ type: "instance",+ component: "RadioGroup",+ dataSources: {+ radioGroupValue: { type: "variable", initialValue: "" },+ },+ // grid gap-2+ styles: [tc.flex(), tc.flex("col"), tc.gap(2)].flat(),+ props: [+ {+ type: "dataSource",+ name: "value",+ dataSourceName: "radioGroupValue",+ },+ {+ name: "onValueChange",+ type: "action",+ value: [+ {+ type: "execute",+ args: ["value"],+ code: `radioGroupValue = value`,+ },+ ],+ },+ ],+ children: [+ createRadioGroupItem({ value: "default", label: "Default" }),+ createRadioGroupItem({ value: "comfortable", label: "Comfortable" }),+ createRadioGroupItem({ value: "compact", label: "Compact" }),+ ],+ },+ ],+};++export const metaRadioGroupItem: WsComponentMeta = {+ category: "hidden",+ type: "container",+ icon: ItemIcon,+ states: defaultStates,+ presetStyle: {+ button: [button, buttonReset].flat(),+ },+};++export const metaRadioGroupIndicator: WsComponentMeta = {+ category: "hidden",+ type: "container",+ icon: TriggerIcon,+ states: defaultStates,+ presetStyle: {+ span,+ },+};++export const propsMetaRadioGroup: WsComponentPropsMeta = {+ props: propsRadioGroup,+ initialProps: ["id", "value", "name", "required"],+};++export const propsMetaRadioGroupItem: WsComponentPropsMeta = {+ props: propsRadioGroupItem,+ initialProps: ["value"],+};++export const propsMetaRadioGroupIndicator: WsComponentPropsMeta = {+ props: propsRadioGroupIndicator,+};diff --git a/packages/sdk-components-react-radix/src/theme/tailwind-classes.ts b/packages/sdk-components-react-radix/src/theme/tailwind-classes.tsindex 3171bad600..8a397daaf6 100644--- a/packages/sdk-components-react-radix/src/theme/tailwind-classes.ts+++ b/packages/sdk-components-react-radix/src/theme/tailwind-classes.ts@@ -415,6 +415,24 @@ export const inset = (positionStyle("bottom", spacing),];+export const aspect = (+ value: "auto" | "square" | "video"+): EmbedTemplateStyleDecl[] => {+ let unparsed: string = value;+ if (value === "square") {+ unparsed = "1 / 1";+ }+ if (value === "video") {+ unparsed = "16 / 9";+ }+ return [+ {+ property: "aspectRatio",+ value: { type: "unparsed", value: unparsed },+ },+ ];+};+export const backdropBlur = (blur: keyof EvaluatedDefaultTheme["blur"]): EmbedTemplateStyleDecl[] => {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 0c922c40dd..32676f6353 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1389,6 +1389,9 @@ importers:'@radix-ui/react-popover':specifier: ^1.0.6version: 1.0.6(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-radio-group':+ specifier: ^1.1.3+ version: 1.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])'@radix-ui/react-select':specifier: ^1.2.2version: 1.2.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])