Skip to content

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.

Add radix switch (#2187)

Bogdan Chadkine32a3e61ef24
diff --git a/packages/sdk-components-react-radix/package.json b/packages/sdk-components-react-radix/package.json
index cb5f23abf4..25ad446144 100644
--- a/packages/sdk-components-react-radix/package.json
+++ b/packages/sdk-components-react-radix/package.json
@@ -41,7 +41,7 @@
"scripts": {
"dev": "build-package --watch",
"build": "build-package",
- "build:args": "generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.ws.tsx' -e asChild -e modal -e defaultValue -e defaultOpen && prettier --write \"**/*.props.ts\"",
+ "build:args": "generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.ws.tsx' -e asChild -e modal -e defaultValue -e defaultOpen -e defaultChecked && prettier --write \"**/*.props.ts\"",
"dts": "tsc --project tsconfig.dts.json",
"typecheck": "tsc",
"checks": "pnpm typecheck",
@@ -60,6 +60,7 @@
"@radix-ui/react-navigation-menu": "^1.1.3",
"@radix-ui/react-popover": "^1.0.6",
"@radix-ui/react-select": "^1.2.2",
+ "@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.6",
"@webstudio-is/css-data": "workspace:^",
diff --git a/packages/sdk-components-react-radix/src/__generated__/accordion.props.ts b/packages/sdk-components-react-radix/src/__generated__/accordion.props.ts
index 0d235fa8aa..4e5d750deb 100644
--- a/packages/sdk-components-react-radix/src/__generated__/accordion.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/accordion.props.ts
@@ -391,7 +391,6 @@ export const propsAccordion: Record<string, PropMeta> = {
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: {
description: "The language read direction.",
required: false,
@@ -879,7 +878,6 @@ export const propsAccordionItem: Record<string, PropMeta> = {
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: {
description:
@@ -1359,7 +1357,6 @@ export const propsAccordionHeader: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1825,7 +1822,6 @@ export const propsAccordionTrigger: Record<string, PropMeta> = {
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" },
@@ -2305,7 +2301,6 @@ export const propsAccordionContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/collapsible.props.ts b/packages/sdk-components-react-radix/src/__generated__/collapsible.props.ts
index e6be979caf..1126b8e290 100644
--- a/packages/sdk-components-react-radix/src/__generated__/collapsible.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/collapsible.props.ts
@@ -391,7 +391,6 @@ export const propsCollapsible: Record<string, PropMeta> = {
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" },
@@ -860,7 +859,6 @@ export const propsCollapsibleContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/dialog.props.ts b/packages/sdk-components-react-radix/src/__generated__/dialog.props.ts
index 6fcd70f666..e828944d95 100644
--- a/packages/sdk-components-react-radix/src/__generated__/dialog.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/dialog.props.ts
@@ -395,7 +395,6 @@ export const propsDialogOverlay: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -861,7 +860,6 @@ export const propsDialogContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1327,7 +1325,6 @@ export const propsDialogClose: Record<string, PropMeta> = {
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" },
@@ -1807,7 +1804,6 @@ export const propsDialogTitle: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -2273,7 +2269,6 @@ export const propsDialogDescription: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/label.props.ts b/packages/sdk-components-react-radix/src/__generated__/label.props.ts
index 2f4ed01a5e..c147d20090 100644
--- a/packages/sdk-components-react-radix/src/__generated__/label.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/label.props.ts
@@ -391,7 +391,6 @@ export const props: Record<string, PropMeta> = {
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" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/navigation-menu.props.ts b/packages/sdk-components-react-radix/src/__generated__/navigation-menu.props.ts
index d35307b015..f02dee53ea 100644
--- a/packages/sdk-components-react-radix/src/__generated__/navigation-menu.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/navigation-menu.props.ts
@@ -383,7 +383,6 @@ export const propsNavigationMenu: Record<string, PropMeta> = {
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" },
delayDuration: {
description:
"The duration from when the pointer enters the trigger until the tooltip gets opened.\n@defaultValue 200",
@@ -869,7 +868,6 @@ export const propsNavigationMenuList: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1335,7 +1333,6 @@ export const propsNavigationMenuViewport: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1801,7 +1798,6 @@ export const propsNavigationMenuContent: Record<string, PropMeta> = {
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" },
disableOutsidePointerEvents: {
description:
@@ -2274,7 +2270,6 @@ export const propsNavigationMenuItem: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/popover.props.ts b/packages/sdk-components-react-radix/src/__generated__/popover.props.ts
index 1d3679850c..052a65fc65 100644
--- a/packages/sdk-components-react-radix/src/__generated__/popover.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/popover.props.ts
@@ -405,7 +405,6 @@ export const propsPopoverContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/select.props.ts b/packages/sdk-components-react-radix/src/__generated__/select.props.ts
index 080b40b27c..594efdd52c 100644
--- a/packages/sdk-components-react-radix/src/__generated__/select.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/select.props.ts
@@ -405,7 +405,6 @@ export const propsSelectTrigger: Record<string, PropMeta> = {
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" },
@@ -885,7 +884,6 @@ export const propsSelectValue: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1359,7 +1357,6 @@ export const propsSelectContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1397,12 +1394,6 @@ export const propsSelectContent: Record<string, PropMeta> = {
lang: { required: false, control: "text", type: "string" },
nonce: { required: false, control: "text", type: "string" },
placeholder: { required: false, control: "text", type: "string" },
- position: {
- required: false,
- control: "radio",
- type: "string",
- options: ["item-aligned", "popper"],
- },
prefix: { required: false, control: "text", type: "string" },
property: { required: false, control: "text", type: "string" },
radioGroup: { required: false, control: "text", type: "string" },
@@ -1412,12 +1403,6 @@ export const propsSelectContent: Record<string, PropMeta> = {
rev: { required: false, control: "text", type: "string" },
role: { required: false, control: "text", type: "string" },
security: { required: false, control: "text", type: "string" },
- side: {
- required: false,
- control: "select",
- type: "string",
- options: ["top", "right", "bottom", "left"],
- },
sideOffset: { required: false, control: "number", type: "number" },
slot: { required: false, control: "text", type: "string" },
spellCheck: { required: false, control: "boolean", type: "boolean" },
@@ -1845,7 +1830,6 @@ export const propsSelectViewport: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -2311,7 +2295,6 @@ export const propsSelectItem: Record<string, PropMeta> = {
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" },
@@ -2780,7 +2763,6 @@ export const propsSelectItemIndicator: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -3246,1405 +3228,6 @@ export const propsSelectItemText: Record<string, PropMeta> = {
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" },
- 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" },
-};
-export const propsSelectGroup: 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" },
- 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" },
-};
-export const propsSelectLabel: 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" },
- 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" },
-};
-export const propsSelectSeparator: 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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/sheet.props.ts b/packages/sdk-components-react-radix/src/__generated__/sheet.props.ts
index 61fe1503c9..b889623b44 100644
--- a/packages/sdk-components-react-radix/src/__generated__/sheet.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/sheet.props.ts
@@ -395,7 +395,6 @@ export const propsSheetOverlay: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -866,7 +865,6 @@ export const propsSheetClose: Record<string, PropMeta> = {
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" },
@@ -1351,7 +1349,6 @@ export const propsSheetTitle: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1822,7 +1819,6 @@ export const propsSheetDescription: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -2293,7 +2289,6 @@ export const propsSheetContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/switch.props.ts b/packages/sdk-components-react-radix/src/__generated__/switch.props.ts
new file mode 100644
index 0000000000..e007bf4f3e
--- /dev/null
+++ b/packages/sdk-components-react-radix/src/__generated__/switch.props.ts
@@ -0,0 +1,948 @@
+import type { PropMeta } from "@webstudio-is/generate-arg-types";
+
+export const propsSwitch: 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" },
+ 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" },
+ 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"],
+ },
+ vocab: { required: false, control: "text", type: "string" },
+};
+export const propsSwitchThumb: 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/__generated__/tabs.props.ts b/packages/sdk-components-react-radix/src/__generated__/tabs.props.ts
index 4890098165..af088ddd91 100644
--- a/packages/sdk-components-react-radix/src/__generated__/tabs.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/tabs.props.ts
@@ -399,7 +399,6 @@ export const propsTabs: Record<string, PropMeta> = {
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: {
description: "The direction of navigation between toolbar items.",
required: false,
@@ -885,7 +884,6 @@ export const propsTabsList: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
@@ -1352,7 +1350,6 @@ export const propsTabsTrigger: Record<string, PropMeta> = {
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" },
@@ -1833,7 +1830,6 @@ export const propsTabsContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/__generated__/tooltip.props.ts b/packages/sdk-components-react-radix/src/__generated__/tooltip.props.ts
index dfd8a5cb5d..2bb28f6d0b 100644
--- a/packages/sdk-components-react-radix/src/__generated__/tooltip.props.ts
+++ b/packages/sdk-components-react-radix/src/__generated__/tooltip.props.ts
@@ -417,7 +417,6 @@ export const propsTooltipContent: Record<string, PropMeta> = {
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" },
hidden: { required: false, control: "boolean", type: "boolean" },
diff --git a/packages/sdk-components-react-radix/src/accordion.ws.ts b/packages/sdk-components-react-radix/src/accordion.ws.ts
index bc0f0f6b8d..35a9ee40dd 100644
--- a/packages/sdk-components-react-radix/src/accordion.ws.ts
+++ b/packages/sdk-components-react-radix/src/accordion.ws.ts
@@ -15,6 +15,7 @@ import type {
} from "@webstudio-is/react-sdk";
import { div, h3, button } from "@webstudio-is/react-sdk/css-normalize";
import * as tc from "./theme/tailwind-classes";
+import { buttonReset } from "./theme/styles";
import {
propsAccordion,
propsAccordionItem,
@@ -247,23 +248,7 @@ export const metaAccordionTrigger: WsComponentMeta = {
requiredAncestors: ["AccordionHeader"],
detachable: false,
presetStyle: {
- button: [
- button,
- {
- property: "backgroundColor",
- value: { type: "keyword", value: "transparent" },
- } as const,
- {
- property: "backgroundImage",
- value: { type: "keyword", value: "none" },
- } as const,
- {
- property: "cursor",
- value: { type: "keyword", value: "pointer" },
- } as const,
- tc.px(0),
- tc.border(0),
- ].flat(),
+ button: [button, buttonReset].flat(),
},
label: "Item Trigger",
};
diff --git a/packages/sdk-components-react-radix/src/components.ts b/packages/sdk-components-react-radix/src/components.ts
index 45e052c5e9..e62ee9d35c 100644
--- a/packages/sdk-components-react-radix/src/components.ts
+++ b/packages/sdk-components-react-radix/src/components.ts
@@ -44,3 +44,5 @@ export {
SelectItemIndicator,
SelectItemText,
} from "./select";
+
+export { Switch, SwitchThumb } from "./switch";
diff --git a/packages/sdk-components-react-radix/src/metas.ts b/packages/sdk-components-react-radix/src/metas.ts
index 75b56a5e9e..0dc3eedf14 100644
--- a/packages/sdk-components-react-radix/src/metas.ts
+++ b/packages/sdk-components-react-radix/src/metas.ts
@@ -58,3 +58,8 @@ export {
metaSelectItemIndicator as SelectItemIndicator,
metaSelectItemText as SelectItemText,
} from "./select.ws";
+
+export {
+ metaSwitch as Switch,
+ metaSwitchThumb as SwitchThumb,
+} from "./switch.ws";
diff --git a/packages/sdk-components-react-radix/src/props.ts b/packages/sdk-components-react-radix/src/props.ts
index c1c03d73c2..77521f80dc 100644
--- a/packages/sdk-components-react-radix/src/props.ts
+++ b/packages/sdk-components-react-radix/src/props.ts
@@ -57,3 +57,8 @@ export {
propsMetaSelectItemIndicator as SelectItemIndicator,
propsMetaSelectItemText as SelectItemText,
} from "./select.ws";
+
+export {
+ propsMetaSwitch as Switch,
+ propsMetaSwitchThumb as SwitchThumb,
+} from "./switch.ws";
diff --git a/packages/sdk-components-react-radix/src/switch.stories.ts b/packages/sdk-components-react-radix/src/switch.stories.ts
new file mode 100644
index 0000000000..e1a56a8035
--- /dev/null
+++ b/packages/sdk-components-react-radix/src/switch.stories.ts
@@ -0,0 +1,22 @@
+import type { Meta, StoryObj } from "@storybook/react";
+import { renderComponentTemplate } from "@webstudio-is/react-sdk";
+import { Switch as SwitchPrimitive } from "./switch";
+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/Switch",
+ component: SwitchPrimitive,
+} satisfies Meta<typeof SwitchPrimitive>;
+
+export const Switch: StoryObj<typeof SwitchPrimitive> = {
+ render: (props) =>
+ renderComponentTemplate({
+ name: "Switch",
+ props: { ...props },
+ components: { ...baseComponents, ...radixComponents },
+ metas: { ...baseMetas, ...radixMetas },
+ }),
+};
diff --git a/packages/sdk-components-react-radix/src/switch.tsx b/packages/sdk-components-react-radix/src/switch.tsx
new file mode 100644
index 0000000000..934ecafa74
--- /dev/null
+++ b/packages/sdk-components-react-radix/src/switch.tsx
@@ -0,0 +1,10 @@
+import type { ForwardRefExoticComponent, ComponentPropsWithRef } from "react";
+import { Root, Thumb } from "@radix-ui/react-switch";
+
+export const Switch: ForwardRefExoticComponent<
+ ComponentPropsWithRef<typeof Root>
+> = Root;
+
+export const SwitchThumb: ForwardRefExoticComponent<
+ ComponentPropsWithRef<typeof Thumb>
+> = Thumb;
diff --git a/packages/sdk-components-react-radix/src/switch.ws.ts b/packages/sdk-components-react-radix/src/switch.ws.ts
new file mode 100644
index 0000000000..50978d4fcd
--- /dev/null
+++ b/packages/sdk-components-react-radix/src/switch.ws.ts
@@ -0,0 +1,143 @@
+import { SwitchIcon, TriggerIcon } from "@webstudio-is/icons/svg";
+import {
+ defaultStates,
+ type WsComponentMeta,
+ type WsComponentPropsMeta,
+} from "@webstudio-is/react-sdk";
+import { button, span } from "@webstudio-is/react-sdk/css-normalize";
+import * as tc from "./theme/tailwind-classes";
+import { buttonReset } from "./theme/styles";
+import { propsSwitch, propsSwitchThumb } from "./__generated__/switch.props";
+
+export const metaSwitch: WsComponentMeta = {
+ category: "radix",
+ order: 11,
+ type: "container",
+ icon: SwitchIcon,
+ states: [
+ ...defaultStates,
+ {
+ label: "Checked",
+ selector: "[data-state=checked]",
+ category: "component-states",
+ },
+ {
+ label: "Unchecked",
+ selector: "[data-state=unchecked]",
+ category: "component-states",
+ },
+ ],
+ presetStyle: {
+ button: [button, buttonReset].flat(),
+ },
+ template: [
+ {
+ type: "instance",
+ component: "Switch",
+ dataSources: {
+ switchChecked: { type: "variable", initialValue: false },
+ },
+ props: [
+ {
+ name: "checked",
+ type: "dataSource",
+ dataSourceName: "switchChecked",
+ },
+ {
+ name: "onCheckedChange",
+ type: "action",
+ value: [
+ {
+ type: "execute",
+ args: ["checked"],
+ code: `switchChecked = checked`,
+ },
+ ],
+ },
+ ],
+ // peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors
+ // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
+ // disabled:cursor-not-allowed disabled:opacity-50
+ // data-[state=checked]:bg-primary
+ // data-[state=unchecked]:bg-input
+ styles: [
+ // We are not supporting peer like styles yet
+ tc.inlineFlex(),
+ tc.property("height", "24px"),
+ tc.property("width", "44px"),
+ tc.shrink(0),
+ tc.cursor("pointer"),
+ tc.items("center"),
+ tc.rounded("full"),
+ tc.border(2),
+ tc.border("transparent"),
+ tc.transition("all"),
+ tc.focusVisible(
+ [tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
+ ),
+ tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),
+ tc.state([tc.bg("primary")].flat(), "[data-state=checked]"),
+ tc.state([tc.bg("input")].flat(), "[data-state=unchecked]"),
+ ].flat(),
+ children: [
+ {
+ type: "instance",
+ component: "SwitchThumb",
+ // pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform
+ // data-[state=checked]:translate-x-5
+ // data-[state=unchecked]:translate-x-0
+ styles: [
+ tc.pointerEvents("none"),
+ tc.block(),
+ tc.h(5),
+ tc.w(5),
+ tc.rounded("full"),
+ tc.bg("background"),
+ tc.shadow("lg"),
+ tc.transition("transform"),
+ tc.state(
+ [tc.property("transform", "translateX(20px)")].flat(),
+ "[data-state=checked]"
+ ),
+ tc.state(
+ [tc.property("transform", "translateX(0px)")].flat(),
+ "[data-state=unchecked]"
+ ),
+ ].flat(),
+ children: [],
+ },
+ ],
+ },
+ ],
+};
+
+export const metaSwitchThumb: WsComponentMeta = {
+ category: "hidden",
+ type: "container",
+ icon: TriggerIcon,
+ states: [
+ ...defaultStates,
+ {
+ label: "Checked",
+ selector: "[data-state=checked]",
+ category: "component-states",
+ },
+ {
+ label: "Unchecked",
+ selector: "[data-state=unchecked]",
+ category: "component-states",
+ },
+ ],
+ presetStyle: {
+ span,
+ },
+};
+
+export const propsMetaSwitch: WsComponentPropsMeta = {
+ props: propsSwitch,
+ initialProps: ["id", "checked", "name", "required"],
+};
+
+export const propsMetaSwitchThumb: WsComponentPropsMeta = {
+ props: propsSwitchThumb,
+};
diff --git a/packages/sdk-components-react-radix/src/tabs.ws.ts b/packages/sdk-components-react-radix/src/tabs.ws.ts
index 8d87542943..ee10ff3e7a 100644
--- a/packages/sdk-components-react-radix/src/tabs.ws.ts
+++ b/packages/sdk-components-react-radix/src/tabs.ws.ts
@@ -12,6 +12,7 @@ import type {
} from "@webstudio-is/react-sdk";
import { button, div } from "@webstudio-is/react-sdk/css-normalize";
import * as tc from "./theme/tailwind-classes";
+import { buttonReset } from "./theme/styles";
import {
propsTabs,
propsTabsList,
@@ -155,22 +156,7 @@ export const metaTabsTrigger: WsComponentMeta = {
indexWithinAncestor: "Tabs",
label: "Tab Trigger",
presetStyle: {
- button: [
- button,
- {
- property: "backgroundColor",
- value: { type: "keyword", value: "transparent" },
- } as const,
- {
- property: "backgroundImage",
- value: { type: "keyword", value: "none" },
- } as const,
- {
- property: "cursor",
- value: { type: "keyword", value: "pointer" },
- } as const,
- tc.border(0),
- ].flat(),
+ button: [button, buttonReset].flat(),
},
};
diff --git a/packages/sdk-components-react-radix/src/theme/styles.ts b/packages/sdk-components-react-radix/src/theme/styles.ts
index 1418c85834..d6aa307caf 100644
--- a/packages/sdk-components-react-radix/src/theme/styles.ts
+++ b/packages/sdk-components-react-radix/src/theme/styles.ts
@@ -61,3 +61,20 @@ export const getButtonStyles = (
return [...styles, ...variantStyles, ...sizeStyles];
};
+
+export const buttonReset: EmbedTemplateStyleDecl[] = [
+ {
+ property: "backgroundColor",
+ value: { type: "keyword", value: "transparent" },
+ } as const,
+ {
+ property: "backgroundImage",
+ value: { type: "keyword", value: "none" },
+ } as const,
+ {
+ property: "cursor",
+ value: { type: "keyword", value: "pointer" },
+ } as const,
+ tc.border(0),
+ tc.p(0),
+].flat();
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b252a907c9..2f9b9328ac 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1389,6 +1389,9 @@ importers:
'@radix-ui/react-select':
specifier: ^1.2.2
+ '@radix-ui/react-switch':
+ specifier: ^1.0.3
'@radix-ui/react-tabs':
specifier: ^1.0.4